Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Extract infrastructure operations model owner
rcourtman56bca4001fea
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 50d1c6b33a..7ac7f070a9 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -32,28 +32,30 @@ management, and fleet control surfaces.8. `frontend-modern/src/api/agentProfiles.ts`9. `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`10. `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`-11. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`-12. `frontend-modern/src/components/Settings/UnifiedAgents.tsx`-13. `frontend-modern/src/components/Settings/NodeModal.tsx`-14. `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`-15. `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`-16. `frontend-modern/src/utils/agentProfilesPresentation.ts`-17. `frontend-modern/src/utils/agentInstallCommand.ts`-18. `frontend-modern/src/api/nodes.ts`+11. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`+12. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`+13. `frontend-modern/src/components/Settings/UnifiedAgents.tsx`+14. `frontend-modern/src/components/Settings/NodeModal.tsx`+15. `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`+16. `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`+17. `frontend-modern/src/utils/agentProfilesPresentation.ts`+18. `frontend-modern/src/utils/agentInstallCommand.ts`+19. `frontend-modern/src/api/nodes.ts`## Shared Boundaries1. `frontend-modern/src/api/agentProfiles.ts` shared with `api-contracts`: the agent profiles frontend client is both an agent lifecycle control surface and a canonical API payload contract boundary.2. `frontend-modern/src/api/nodes.ts` shared with `api-contracts`: the shared Proxmox node client is both an agent lifecycle setup/install control surface and a canonical API payload contract boundary.3. `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx` shared with `api-contracts`: the infrastructure operations controller is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.-4. `frontend-modern/src/components/Settings/UnifiedAgents.tsx` shared with `api-contracts`: the UnifiedAgents module is a compatibility shim for the canonical infrastructure operations controller and remains on the same shared agent lifecycle and API contract boundary while the old module path exists.-5. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx` shared with `api-contracts`: the shared infrastructure operations state hook is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.-6. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `api-contracts`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.-7. `internal/api/agent_install_command_shared.go` shared with `api-contracts`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.-8. `internal/api/config_setup_handlers.go` shared with `api-contracts`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.-9. `internal/api/unified_agent.go` shared with `api-contracts`: unified agent download and installer handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.-10. `scripts/install.ps1` shared with `deployment-installability`: the Windows installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.-11. `scripts/install.sh` shared with `deployment-installability`: the shell installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.+4. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx` shared with `api-contracts`: the pure infrastructure operations inventory/install model is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.+5. `frontend-modern/src/components/Settings/UnifiedAgents.tsx` shared with `api-contracts`: the UnifiedAgents module is a compatibility shim for the canonical infrastructure operations controller and remains on the same shared agent lifecycle and API contract boundary while the old module path exists.+6. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx` shared with `api-contracts`: the shared infrastructure operations state hook is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.+7. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `api-contracts`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.+8. `internal/api/agent_install_command_shared.go` shared with `api-contracts`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.+9. `internal/api/config_setup_handlers.go` shared with `api-contracts`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.+10. `internal/api/unified_agent.go` shared with `api-contracts`: unified agent download and installer handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.+11. `scripts/install.ps1` shared with `deployment-installability`: the Windows installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.+12. `scripts/install.sh` shared with `deployment-installability`: the shell installer is both a deployment installability entry point and a canonical agent lifecycle runtime continuity boundary.## Extension Points@@ -62,7 +64,7 @@ management, and fleet control surfaces.3. Add or change runtime-side Unified Agent startup, first-report assembly, and enroll/runtime continuity through `internal/hostagent/`.4. Keep legacy Unified Agent compatibility names explicitly secondary when touching shared `internal/api/` runtime helpers: the legacy host-route family and `host-agent:*` scope names may remain as ingress or migration aliases, but they must not retake primary ownership in router state, live runtime scope checks, handler commentary, or operator-facing guidance.5. Add or change installer flags, persisted service arguments, or upgrade-safe re-entry behavior through `scripts/install.sh` and `scripts/install.ps1`.-6. Add or change profile management, shared frontend install-command assembly, Proxmox setup/install API transport, setup-completion install handoff transport, deploy-fallback manual install transport, and fleet-control presentation through `frontend-modern/src/api/agentProfiles.ts`, `frontend-modern/src/api/nodes.ts`, `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`, `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`, `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`, `frontend-modern/src/components/Settings/NodeModal.tsx`, `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`, `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`, and `frontend-modern/src/utils/agentInstallCommand.ts`.+6. Add or change profile management, the pure unified-agent inventory/install model, shared frontend install-command assembly, Proxmox setup/install API transport, setup-completion install handoff transport, deploy-fallback manual install transport, and fleet-control presentation through `frontend-modern/src/api/agentProfiles.ts`, `frontend-modern/src/api/nodes.ts`, `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`, `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`, `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`, `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`, `frontend-modern/src/components/Settings/NodeModal.tsx`, `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`, `frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx`, and `frontend-modern/src/utils/agentInstallCommand.ts`.## Forbidden Pathsdiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 568c83aa59..e3e2241793 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -29,15 +29,16 @@ Own canonical runtime payload shapes between backend and frontend.6. `frontend-modern/src/api/responseUtils.ts`7. `frontend-modern/src/components/Settings/APITokenManager.tsx`8. `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`-9. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`-10. `frontend-modern/src/components/Settings/UnifiedAgents.tsx`-11. `frontend-modern/src/utils/agentInstallCommand.ts`-12. `frontend-modern/src/api/nodes.ts`-13. `frontend-modern/src/api/license.ts`-14. `frontend-modern/src/api/monitoredSystemLedger.ts`-15. `frontend-modern/src/api/resources.ts`-16. `frontend-modern/src/api/monitoring.ts`-17. `internal/api/monitored_system_ledger.go`+9. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`+10. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`+11. `frontend-modern/src/components/Settings/UnifiedAgents.tsx`+12. `frontend-modern/src/utils/agentInstallCommand.ts`+13. `frontend-modern/src/api/nodes.ts`+14. `frontend-modern/src/api/license.ts`+15. `frontend-modern/src/api/monitoredSystemLedger.ts`+16. `frontend-modern/src/api/resources.ts`+17. `frontend-modern/src/api/monitoring.ts`+18. `internal/api/monitored_system_ledger.go`## Shared Boundaries@@ -50,26 +51,27 @@ Own canonical runtime payload shapes between backend and frontend.7. `frontend-modern/src/api/updates.ts` shared with `deployment-installability`: the updates frontend client is both a deployment-installability control surface and a canonical API payload contract boundary.8. `frontend-modern/src/components/Settings/APITokenManager.tsx` shared with `security-privacy`: the API token settings surface is both a security/privacy control surface and a canonical API payload contract boundary.9. `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx` shared with `agent-lifecycle`: the infrastructure operations controller is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.-10. `frontend-modern/src/components/Settings/UnifiedAgents.tsx` shared with `agent-lifecycle`: the UnifiedAgents module is a compatibility shim for the canonical infrastructure operations controller and remains on the same shared agent lifecycle and API contract boundary while the old module path exists.-11. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx` shared with `agent-lifecycle`: the shared infrastructure operations state hook is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.-12. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `agent-lifecycle`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.-13. `internal/api/agent_install_command_shared.go` shared with `agent-lifecycle`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.-14. `internal/api/ai_handler.go` shared with `ai-runtime`: Pulse Assistant handlers are both an AI runtime control surface and a canonical API payload contract boundary.-15. `internal/api/ai_handlers.go` shared with `ai-runtime`: AI settings and remediation handlers are both an AI runtime control surface and a canonical API payload contract boundary.-16. `internal/api/ai_intelligence_handlers.go` shared with `ai-runtime`: AI intelligence handlers are both an AI runtime control surface and a canonical API payload contract boundary.-17. `internal/api/config_setup_handlers.go` shared with `agent-lifecycle`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.-18. `internal/api/licensing_bridge.go` shared with `cloud-paid`: commercial licensing bridge handlers carry both API payload contract and cloud-paid entitlement boundary ownership.-19. `internal/api/licensing_handlers.go` shared with `cloud-paid`: commercial licensing handlers carry both API payload contract and cloud-paid entitlement boundary ownership.-20. `internal/api/notifications.go` shared with `notifications`: notification handlers are both a notification delivery control surface and a canonical API payload contract boundary.-21. `internal/api/payments_webhook_handlers.go` shared with `cloud-paid`: commercial payment webhook handlers carry both API payload contract and cloud-paid billing boundary ownership.-22. `internal/api/public_signup_handlers.go` shared with `cloud-paid`: hosted signup handlers carry both API payload contract and cloud-paid hosted provisioning boundary ownership.-23. `internal/api/resources.go` shared with `unified-resources`: the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary.-24. `internal/api/security.go` shared with `security-privacy`: the security handlers are both a security/privacy control surface and a canonical API payload contract boundary.-25. `internal/api/security_tokens.go` shared with `security-privacy`: the security token handlers are both a security/privacy control surface and a canonical API payload contract boundary.-26. `internal/api/slo.go` shared with `performance-and-scalability`: the SLO endpoint is both an API contract surface and a protected performance hot-path boundary.-27. `internal/api/system_settings.go` shared with `security-privacy`: the system settings telemetry and auth controls are both a security/privacy control surface and a canonical API payload contract boundary.-28. `internal/api/unified_agent.go` shared with `agent-lifecycle`: unified agent download and installer handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.-29. `internal/api/updates.go` shared with `deployment-installability`: update handlers are both a deployment-installability control surface and a canonical API payload contract boundary.+10. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx` shared with `agent-lifecycle`: the pure infrastructure operations inventory/install model is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.+11. `frontend-modern/src/components/Settings/UnifiedAgents.tsx` shared with `agent-lifecycle`: the UnifiedAgents module is a compatibility shim for the canonical infrastructure operations controller and remains on the same shared agent lifecycle and API contract boundary while the old module path exists.+12. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx` shared with `agent-lifecycle`: the shared infrastructure operations state hook is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.+13. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `agent-lifecycle`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.+14. `internal/api/agent_install_command_shared.go` shared with `agent-lifecycle`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.+15. `internal/api/ai_handler.go` shared with `ai-runtime`: Pulse Assistant handlers are both an AI runtime control surface and a canonical API payload contract boundary.+16. `internal/api/ai_handlers.go` shared with `ai-runtime`: AI settings and remediation handlers are both an AI runtime control surface and a canonical API payload contract boundary.+17. `internal/api/ai_intelligence_handlers.go` shared with `ai-runtime`: AI intelligence handlers are both an AI runtime control surface and a canonical API payload contract boundary.+18. `internal/api/config_setup_handlers.go` shared with `agent-lifecycle`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.+19. `internal/api/licensing_bridge.go` shared with `cloud-paid`: commercial licensing bridge handlers carry both API payload contract and cloud-paid entitlement boundary ownership.+20. `internal/api/licensing_handlers.go` shared with `cloud-paid`: commercial licensing handlers carry both API payload contract and cloud-paid entitlement boundary ownership.+21. `internal/api/notifications.go` shared with `notifications`: notification handlers are both a notification delivery control surface and a canonical API payload contract boundary.+22. `internal/api/payments_webhook_handlers.go` shared with `cloud-paid`: commercial payment webhook handlers carry both API payload contract and cloud-paid billing boundary ownership.+23. `internal/api/public_signup_handlers.go` shared with `cloud-paid`: hosted signup handlers carry both API payload contract and cloud-paid hosted provisioning boundary ownership.+24. `internal/api/resources.go` shared with `unified-resources`: the unified resource endpoint is both a backend payload contract surface and a unified-resource runtime boundary.+25. `internal/api/security.go` shared with `security-privacy`: the security handlers are both a security/privacy control surface and a canonical API payload contract boundary.+26. `internal/api/security_tokens.go` shared with `security-privacy`: the security token handlers are both a security/privacy control surface and a canonical API payload contract boundary.+27. `internal/api/slo.go` shared with `performance-and-scalability`: the SLO endpoint is both an API contract surface and a protected performance hot-path boundary.+28. `internal/api/system_settings.go` shared with `security-privacy`: the system settings telemetry and auth controls are both a security/privacy control surface and a canonical API payload contract boundary.+29. `internal/api/unified_agent.go` shared with `agent-lifecycle`: unified agent download and installer handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.+30. `internal/api/updates.go` shared with `deployment-installability`: update handlers are both a deployment-installability control surface and a canonical API payload contract boundary.## Extension Points1. Add or change payload fields through handler + contract tests together@@ -93,7 +95,7 @@ Own canonical runtime payload shapes between backend and frontend.and the shared `frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx` and `frontend-modern/src/components/Infrastructure/ResourceCorrelationSummary.tsx` cards' infrastructure resource-link default, so the Patrol page, resource drawer, and problem-resource dashboard panels inherit the canonical resource-filter path construction instead of rebuilding infrastructure URLs inline8. Route frontend API-client parsed error propagation, API-error-status fallback handling, allowed-status handling, custom status-specific error handling, command-trigger success envelope handling, shared response parsing pipelines, missing-resource lookup handling, metadata CRUD routing, stream event consumption, response status, collection normalization, scalar payload coercion, and structured error normalization through canonical shared helpers under `frontend-modern/src/api/`9. Add or change API token scope, assignment, and revocation presentation through `frontend-modern/src/components/Settings/APITokenManager.tsx`-10. Add or change infrastructure operations token generation, lookup, assignment, and reporting/install presentation through `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx` and `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`+10. Add or change infrastructure operations token generation, lookup, assignment, the pure unified-agent inventory/install model, and reporting/install presentation through `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`, `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`, and `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`11. Keep `internal/api/session_store.go` on a fail-closed auth-persistence boundary: persisted OIDC refresh tokens may only round-trip through encrypted-at-rest session payloads, and any missing-crypto or invalid-ciphertext path must drop the token instead of preserving plaintext-at-rest session state.12. Keep tenant AI handler wiring on canonical provider ownership: `internal/api/ai_handlers.go` may wire tenant `ReadState` and tenant-scoped unified-resource providers into AI services, but it must not revive tenant snapshot-provider bridges once Patrol can initialize and verify from those canonical providers directly.diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.jsonindex 42d09a2ff8..3ecdf0343c 100644--- a/docs/release-control/v6/internal/subsystems/registry.json+++ b/docs/release-control/v6/internal/subsystems/registry.json@@ -105,6 +105,14 @@"api-contracts"]},+ {+ "path": "frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx",+ "rationale": "the pure infrastructure operations inventory/install model is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary",+ "subsystems": [+ "agent-lifecycle",+ "api-contracts"+ ]+ },{"path": "frontend-modern/src/components/Settings/SecurityAuthPanel.tsx","rationale": "the authentication settings surface is both a security/privacy control surface and a canonical settings-shell presentation boundary",@@ -313,6 +321,7 @@"frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx","frontend-modern/src/components/Settings/AgentProfilesPanel.tsx","frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx",+ "frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx","frontend-modern/src/components/Settings/NodeModal.tsx","frontend-modern/src/components/Settings/UnifiedAgents.tsx","frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx",@@ -512,6 +521,7 @@"match_prefixes": [],"match_files": ["frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx",+ "frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx","frontend-modern/src/components/Settings/UnifiedAgents.tsx","frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx"],@@ -520,6 +530,7 @@"exact_files": ["frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx"]}@@ -705,6 +716,7 @@"owned_files": ["frontend-modern/src/components/Settings/APITokenManager.tsx","frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx",+ "frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx","frontend-modern/src/components/Settings/UnifiedAgents.tsx","frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx","frontend-modern/src/types/api.ts",@@ -915,6 +927,7 @@"match_prefixes": [],"match_files": ["frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx",+ "frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx","frontend-modern/src/components/Settings/UnifiedAgents.tsx","frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx"],@@ -924,6 +937,7 @@"frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts","frontend-modern/src/api/__tests__/security.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx"]}diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsxnew file mode 100644index 0000000000..16d6ee1ef7--- /dev/null+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx@@ -0,0 +1,113 @@+import { describe, expect, it } from 'vitest';+import type { ConnectedInfrastructureItem } from '@/types/api';+import {+ getPowerShellInstallProfileEnvFromFlags,+ getStopMonitoringScopeLabel,+ rowFromConnectedInfrastructureItem,+} from '../infrastructureOperationsModel';++describe('infrastructure operations model', () => {+ it('builds unified rows from connected infrastructure surfaces', () => {+ const item: ConnectedInfrastructureItem = {+ id: 'agent-1',+ name: 'node-a',+ hostname: 'node-a.internal',+ status: 'active',+ scopeAgentId: 'agent-1',+ surfaces: [+ {+ id: 'surface-agent',+ kind: 'agent',+ label: 'Host telemetry',+ detail: 'Pulse is receiving host telemetry.',+ controlId: 'agent-1',+ action: 'stop-monitoring',+ idLabel: 'Agent ID',+ idValue: 'agent-1',+ },+ {+ id: 'surface-pbs',+ kind: 'pbs',+ label: 'PBS data',+ detail: 'Pulse is receiving PBS telemetry.',+ controlId: 'pbs-1',+ action: 'stop-monitoring',+ idLabel: 'PBS node ID',+ idValue: 'pbs-1',+ },+ ],+ };++ const row = rowFromConnectedInfrastructureItem(item, {+ label: 'Default',+ detail: 'Auto-detect',+ category: 'default',+ });++ expect(row.rowKey).toBe('agent-agent-1');+ expect(row.capabilities).toEqual(['agent', 'pbs']);+ expect(row.installFlags).toEqual(['--enable-proxmox', '--proxmox-type pbs']);+ expect(row.searchText).toContain('node-a.internal');+ });++ it('keeps host-managed stop monitoring scoped to the full host surface set', () => {+ const row = {+ rowKey: 'agent-agent-1',+ id: 'agent-1',+ name: 'node-a',+ hostname: 'node-a.internal',+ capabilities: ['agent', 'docker', 'pbs'],+ status: 'active' as const,+ upgradePlatform: 'linux' as const,+ scope: {+ label: 'Default',+ detail: 'Auto-detect',+ category: 'default' as const,+ },+ installFlags: ['--enable-docker', '--disable-host', '--enable-proxmox', '--proxmox-type pbs'],+ searchText: 'node-a node-a.internal agent-1',+ surfaces: [+ {+ key: 'agent',+ kind: 'agent' as const,+ label: 'Host telemetry',+ detail: 'Pulse is receiving host telemetry.',+ action: 'stop-monitoring' as const,+ },+ {+ key: 'docker',+ kind: 'docker' as const,+ label: 'Docker runtime data',+ detail: 'Pulse is receiving Docker telemetry.',+ action: 'stop-monitoring' as const,+ },+ {+ key: 'pbs',+ kind: 'pbs' as const,+ label: 'PBS data',+ detail: 'Pulse is receiving PBS telemetry.',+ action: 'stop-monitoring' as const,+ },+ ],+ };++ expect(getStopMonitoringScopeLabel(row)).toBe('Host telemetry, Docker runtime data, and PBS data');+ });++ it('maps install-profile flags into PowerShell installer env assignments', () => {+ expect(+ getPowerShellInstallProfileEnvFromFlags([+ '--enable-docker',+ '--disable-host',+ '--enable-proxmox',+ '--proxmox-type',+ 'pbs',+ ]),+ ).toEqual([+ '$env:PULSE_ENABLE_DOCKER="true"',+ '$env:PULSE_ENABLE_HOST="false"',+ '$env:PULSE_ENABLE_PROXMOX="true"',+ '$env:PULSE_PROXMOX_TYPE="pbs"',+ ]);+ });+});diff --git a/frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx b/frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsxindex bb9f3583b1..1f39196b0a 100644--- a/frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx@@ -6,6 +6,7 @@ import { Router, Route } from '@solidjs/router';import { UnifiedAgents } from '../UnifiedAgents';import infrastructureInstallPanelSource from '../InfrastructureInstallPanel.tsx?raw';import infrastructureOperationsControllerSource from '../InfrastructureOperationsController.tsx?raw';+import infrastructureOperationsModelSource from '../infrastructureOperationsModel.tsx?raw';import infrastructureReportingPanelSource from '../InfrastructureReportingPanel.tsx?raw';import infrastructureOperationsStateSource from '../useInfrastructureOperationsState.tsx?raw';import type {@@ -51,9 +52,14 @@ describe('UnifiedAgents ownership guardrails', () => {expect(infrastructureOperationsControllerSource).toContain('useInfrastructureOperationsState');expect(infrastructureInstallPanelSource).toContain('useInfrastructureOperationsState');expect(infrastructureReportingPanelSource).toContain('useInfrastructureOperationsState');+ expect(infrastructureOperationsStateSource).toContain("./infrastructureOperationsModel");expect(infrastructureOperationsStateSource).toContain('renderInstallerSection');expect(infrastructureOperationsStateSource).toContain('renderInventorySection');expect(infrastructureOperationsStateSource).toContain('renderStopMonitoringDialog');+ expect(infrastructureOperationsModelSource).toContain('export const getRowReportingSummary');+ expect(infrastructureOperationsModelSource).toContain(+ 'export const getPowerShellInstallProfileEnvFromFlags',+ );});});diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex 59ffcedf5b..70fb54ecc2 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -4,6 +4,7 @@ import settingsShellSource from '../SettingsPageShell.tsx?raw';import infrastructureWorkspaceSource from '../InfrastructureWorkspace.tsx?raw';import infrastructureInstallPanelSource from '../InfrastructureInstallPanel.tsx?raw';import infrastructureOperationsControllerSource from '../InfrastructureOperationsController.tsx?raw';+import infrastructureOperationsModelSource from '../infrastructureOperationsModel.tsx?raw';import infrastructureReportingPanelSource from '../InfrastructureReportingPanel.tsx?raw';import infrastructureOperationsStateSource from '../useInfrastructureOperationsState.tsx?raw';import apiAccessPanelSource from '../APIAccessPanel.tsx?raw';@@ -39,6 +40,7 @@ const extractedModules = ['../settingsFeatureGates.ts','../BackupTransferDialogs.tsx','../InfrastructureOperationsController.tsx',+ '../infrastructureOperationsModel.tsx','../useInfrastructureOperationsState.tsx','../InfrastructureWorkspace.tsx','../InfrastructureInstallPanel.tsx',@@ -287,6 +289,20 @@ describe('Settings architecture guardrails', () => {expect(infrastructureReportingPanelSource).not.toContain('<PageHeader');});+ it('keeps the infrastructure operations model extracted from the reactive hook owner', () => {+ expect(infrastructureOperationsStateSource).toContain("./infrastructureOperationsModel");+ expect(infrastructureOperationsStateSource).not.toContain('const INSTALL_PROFILE_OPTIONS');+ expect(infrastructureOperationsStateSource).not.toContain('const buildCommandsByPlatform =');+ expect(infrastructureOperationsStateSource).not.toContain(+ 'const rowFromConnectedInfrastructureItem =',+ );+ expect(infrastructureOperationsModelSource).toContain('export const INSTALL_PROFILE_OPTIONS');+ expect(infrastructureOperationsModelSource).toContain(+ 'export const rowFromConnectedInfrastructureItem',+ );+ expect(infrastructureOperationsModelSource).toContain('export const buildCommandsByPlatform');+ });+it('routes every top-level settings surface through the canonical panel shell framing', () => {for (const [panelName, source] of Object.entries(topLevelSettingsPanelSources)) {const usesCanonicalShell =diff --git a/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx b/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsxnew file mode 100644index 0000000000..c17bd2b52e--- /dev/null+++ b/frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx@@ -0,0 +1,556 @@+import type { JSX } from 'solid-js';+import type {+ ConnectedInfrastructureItem,+ ConnectedInfrastructureSurface,+} from '@/types/api';+import {+ getAgentCapabilityLabel,+ type AgentCapability,+} from '@/utils/agentCapabilityPresentation';++export const TOKEN_PLACEHOLDER = '<api-token>';+export const UNIFIED_AGENT_TELEMETRY_SURFACE = 'settings_unified_agents';++export type AgentPlatform = 'linux' | 'macos' | 'freebsd' | 'windows';+export type UnifiedAgentStatus = 'active' | 'removed';+export type ScopeCategory = 'default' | 'profile' | 'ai-managed' | 'na';+export type InstallProfile =+ | 'auto'+ | 'docker'+ | 'kubernetes'+ | 'proxmox-pve'+ | 'proxmox-pbs'+ | 'truenas';++export type SetupHandoffState = {+ username: string;+ password: string;+ apiToken: string;+ createdAt?: string;+};++export type UnifiedAgentSurface = {+ key: string;+ kind: AgentCapability;+ label: string;+ detail: string;+ idLabel?: string;+ idValue?: string;+ action?: 'stop-monitoring' | 'allow-reconnect';+ controlId?: string;+};++export type UnifiedAgentRow = {+ rowKey: string;+ id: string;+ agentActionId?: string;+ dockerActionId?: string;+ kubernetesActionId?: string;+ name: string;+ hostname?: string;+ displayName?: string;+ capabilities: AgentCapability[];+ status: UnifiedAgentStatus;+ healthStatus?: string;+ lastSeen?: number;+ removedAt?: number;+ version?: string;+ isOutdatedBinary?: boolean;+ linkedNodeId?: string;+ commandsEnabled?: boolean;+ agentId?: string;+ upgradePlatform: AgentPlatform;+ scope: {+ label: string;+ detail?: string;+ category: ScopeCategory;+ };+ installFlags: string[];+ searchText: string;+ kubernetesInfo?: {+ server?: string;+ context?: string;+ tokenName?: string;+ };+ surfaces: UnifiedAgentSurface[];+};++export type InventoryActionType = 'stop-monitoring' | 'allow-reconnect';++export type InventoryActionNotice = {+ tone: 'success' | 'info';+ title: string;+ detail: string;+ showRecoveryQueueLink?: boolean;+};++export type StopMonitoringDialogState = {+ row: UnifiedAgentRow;+ subject: string;+ scopeLabel: string;+};++export type InstallProfileOption = {+ value: InstallProfile;+ label: string;+ description: string;+ flags: string[];+};++export type InfrastructureCommandSnippet = {+ label: string;+ command: string;+ note?: JSX.Element | string;+};++export type InfrastructureCommandSection = {+ title: string;+ description: string;+ snippets: InfrastructureCommandSnippet[];+};++export const buildDefaultTokenName = () => {+ const now = new Date();+ const iso = now.toISOString().slice(0, 16); // YYYY-MM-DDTHH:MM+ const stamp = iso.replace('T', ' ').replace(/:/g, '-');+ return `Agent ${stamp}`;+};++export const normalizeTelemetryPart = (value: string) =>+ value+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, '_')+ .replace(/^_+|_+$/g, '');++export const shellQuoteArg = (value: string) => `'${value.replace(/'/g, `'\"'\"'`)}'`;++export const getCapabilitySurfaceLabel = (capability: AgentCapability) => {+ switch (capability) {+ case 'agent':+ return 'Host telemetry';+ case 'docker':+ return 'Docker runtime data';+ case 'kubernetes':+ return 'Kubernetes cluster data';+ case 'proxmox':+ return 'Proxmox data';+ case 'pbs':+ return 'PBS data';+ case 'pmg':+ return 'PMG data';+ default:+ return getAgentCapabilityLabel(capability);+ }+};++export const getReconnectActionLabel = (row: UnifiedAgentRow) => {+ if (row.capabilities.includes('docker')) {+ return 'Allow Docker reconnect';+ }+ if (row.capabilities.includes('kubernetes')) {+ return 'Allow Kubernetes reconnect';+ }+ return 'Allow host reconnect';+};++export const joinHumanList = (parts: string[]) => {+ if (parts.length === 0) return '';+ if (parts.length === 1) return parts[0];+ if (parts.length === 2) return `${parts[0]} and ${parts[1]}`;+ return `${parts.slice(0, -1).join(', ')}, and ${parts.at(-1)}`;+};++const sentenceCaseSurfaceLabel = (label: string, index: number) => {+ if (index !== 0 || label.length === 0) {+ return label;+ }+ return `${label.slice(0, 1).toLowerCase()}${label.slice(1)}`;+};++export const getRowReportingSummary = (row: UnifiedAgentRow) => {+ const reported = row.surfaces.map((surface, index) =>+ sentenceCaseSurfaceLabel(surface.label, index),+ );+ if (reported.length === 0) {+ return '';+ }+ return `Pulse is receiving ${joinHumanList(reported)} from this item.`;+};++export const getRowSurfaceBreakdown = (row: UnifiedAgentRow) => row.surfaces;++export const getStopMonitoringSurfaces = (row: UnifiedAgentRow) => {+ const surfaces = getRowSurfaceBreakdown(row);+ const stopMonitoringSurfaces = surfaces.filter((surface) => surface.action === 'stop-monitoring');+ const hostManagedStopApplies = stopMonitoringSurfaces.some((surface) => surface.kind === 'agent');+ if (!hostManagedStopApplies) {+ return stopMonitoringSurfaces;+ }+ return surfaces.filter((surface) =>+ ['agent', 'docker', 'kubernetes', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),+ );+};++export const getStopMonitoringScopeLabel = (row: UnifiedAgentRow) => {+ const surfaceLabels = getStopMonitoringSurfaces(row).map((surface) => surface.label);+ if (surfaceLabels.length === 0) {+ return 'Reporting for this item';+ }+ return joinHumanList(surfaceLabels);+};++export const createSurfaceScopedRow = (+ row: UnifiedAgentRow,+ surfaceKey: 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg',+): UnifiedAgentRow => {+ if (surfaceKey === 'docker') {+ return {+ ...row,+ rowKey: `${row.rowKey}-docker-surface`,+ capabilities: ['docker'],+ agentActionId: undefined,+ kubernetesActionId: undefined,+ linkedNodeId: undefined,+ surfaces: row.surfaces.filter((surface) => surface.kind === 'docker'),+ };+ }++ if (surfaceKey === 'kubernetes') {+ return {+ ...row,+ rowKey: `${row.rowKey}-kubernetes-surface`,+ capabilities: ['kubernetes'],+ agentActionId: undefined,+ dockerActionId: undefined,+ linkedNodeId: undefined,+ surfaces: row.surfaces.filter((surface) => surface.kind === 'kubernetes'),+ };+ }++ if (surfaceKey === 'agent') {+ const hostManagedCapabilities: AgentCapability[] = ['agent'];+ if (row.capabilities.includes('proxmox')) hostManagedCapabilities.push('proxmox');+ if (row.capabilities.includes('pbs')) hostManagedCapabilities.push('pbs');+ if (row.capabilities.includes('pmg')) hostManagedCapabilities.push('pmg');+ return {+ ...row,+ rowKey: `${row.rowKey}-agent-surface`,+ capabilities: hostManagedCapabilities,+ dockerActionId: undefined,+ kubernetesActionId: undefined,+ surfaces: row.surfaces.filter((surface) =>+ ['agent', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),+ ),+ };+ }++ if (surfaceKey === 'pbs') {+ return {+ ...row,+ rowKey: `${row.rowKey}-pbs-surface`,+ capabilities: ['pbs'],+ dockerActionId: undefined,+ kubernetesActionId: undefined,+ surfaces: row.surfaces.filter((surface) => surface.kind === 'pbs'),+ };+ }++ if (surfaceKey === 'pmg') {+ return {+ ...row,+ rowKey: `${row.rowKey}-pmg-surface`,+ capabilities: ['pmg'],+ dockerActionId: undefined,+ kubernetesActionId: undefined,+ surfaces: row.surfaces.filter((surface) => surface.kind === 'pmg'),+ };+ }++ return {+ ...row,+ rowKey: `${row.rowKey}-proxmox-surface`,+ capabilities: ['proxmox'],+ dockerActionId: undefined,+ kubernetesActionId: undefined,+ surfaces: row.surfaces.filter((surface) => surface.kind === 'proxmox'),+ };+};++export const INSTALL_PROFILE_OPTIONS: InstallProfileOption[] = [+ {+ value: 'auto',+ label: 'Auto-detect (recommended)',+ description:+ 'Let the installer detect Docker, Kubernetes, Proxmox, and agent capabilities automatically.',+ flags: [],+ },+ {+ value: 'docker',+ label: 'Docker / Podman runtime',+ description: 'Force container runtime monitoring even when detection is restricted.',+ flags: ['--enable-docker', '--disable-host'],+ },+ {+ value: 'kubernetes',+ label: 'Kubernetes node',+ description: 'Force Kubernetes monitoring on cluster nodes.',+ flags: ['--enable-kubernetes'],+ },+ {+ value: 'proxmox-pve',+ label: 'Proxmox VE node',+ description: 'Force Proxmox integration and register as a PVE node.',+ flags: ['--enable-proxmox', '--proxmox-type pve'],+ },+ {+ value: 'proxmox-pbs',+ label: 'Proxmox Backup node',+ description: 'Force Proxmox integration and register as a PBS node.',+ flags: ['--enable-proxmox', '--proxmox-type pbs'],+ },+ {+ value: 'truenas',+ label: 'TrueNAS SCALE agent',+ description:+ 'Use default auto-detection; installer applies TrueNAS-safe service handling automatically.',+ flags: [],+ },+];++export const buildCommandsByPlatform = (+ unixCommand: string,+ windowsInteractiveCommand: string,+ windowsParameterizedCommand: string,+): Record<AgentPlatform, InfrastructureCommandSection> => ({+ linux: {+ title: 'Install on Linux',+ description:+ 'The unified installer downloads the agent binary and configures the appropriate service for your system.',+ snippets: [+ {+ label: 'Install',+ command: unixCommand,+ note: (+ <span>+ Command auto-escalates with <code>sudo</code> when available; otherwise run from a root+ shell (for example <code>su -</code>). Auto-detects your init system and works on+ Debian, Ubuntu, Proxmox, Fedora, Alpine, Unraid, Synology, and more.+ </span>+ ),+ },+ ],+ },+ macos: {+ title: 'Install on macOS',+ description:+ 'The unified installer downloads the universal binary and sets up a launchd service for background monitoring.',+ snippets: [+ {+ label: 'Install with launchd',+ command: unixCommand,+ note: (+ <span>+ Command auto-escalates with <code>sudo</code> when available; otherwise run from a root+ shell. Creates <code>/Library/LaunchDaemons/com.pulse.agent.plist</code> and starts the+ agent automatically.+ </span>+ ),+ },+ ],+ },+ freebsd: {+ title: 'Install on FreeBSD / pfSense / OPNsense',+ description:+ 'The unified installer downloads the FreeBSD binary and sets up an rc.d service for background monitoring.',+ snippets: [+ {+ label: 'Install with rc.d',+ command: unixCommand,+ note: (+ <span>+ Run as root. <strong>Note:</strong> pfSense/OPNsense don't include bash by default.+ Install it first: <code>pkg install bash</code>. Creates{' '}+ <code>/usr/local/etc/rc.d/pulse-agent</code> and starts the agent automatically.+ </span>+ ),+ },+ ],+ },+ windows: {+ title: 'Install on Windows',+ description:+ 'Run the PowerShell script to install and configure the unified agent as a Windows service with automatic startup.',+ snippets: [+ {+ label: 'Install as Windows Service (PowerShell)',+ command: windowsInteractiveCommand,+ note: (+ <span>+ Run in PowerShell as Administrator. The script will prompt for the Pulse URL and API+ token, download the agent binary, and install it as a Windows service with automatic+ startup.+ </span>+ ),+ },+ {+ label: 'Install with parameters (PowerShell)',+ command: windowsParameterizedCommand,+ note: (+ <span>+ Non-interactive installation. Set environment variables before running to skip prompts.+ </span>+ ),+ },+ ],+ },+});++const agentCapabilityFromSurfaceKind = (kind: ConnectedInfrastructureSurface['kind']): AgentCapability => {+ switch (kind) {+ case 'agent':+ case 'docker':+ case 'kubernetes':+ case 'proxmox':+ case 'pbs':+ case 'pmg':+ return kind;+ default:+ return 'agent';+ }+};++const installFlagsForCapabilities = (capabilities: AgentCapability[]) => {+ const flags = new Set<string>();+ if (capabilities.includes('docker')) {+ flags.add('--enable-docker');+ flags.add('--disable-host');+ }+ if (capabilities.includes('kubernetes')) {+ flags.add('--enable-kubernetes');+ }+ if (capabilities.includes('proxmox')) {+ flags.add('--enable-proxmox');+ flags.add('--proxmox-type pve');+ } else if (capabilities.includes('pbs')) {+ flags.add('--enable-proxmox');+ flags.add('--proxmox-type pbs');+ }+ return Array.from(flags);+};++const surfaceBreakdownFromConnectedSurface = (+ surface: ConnectedInfrastructureSurface,+): UnifiedAgentSurface => ({+ key: surface.kind,+ kind: agentCapabilityFromSurfaceKind(surface.kind),+ label: surface.label || getCapabilitySurfaceLabel(agentCapabilityFromSurfaceKind(surface.kind)),+ detail: surface.detail || '',+ idLabel: surface.idLabel,+ idValue: surface.idValue,+ action: surface.action,+ controlId: surface.controlId,+});++export const rowFromConnectedInfrastructureItem = (+ item: ConnectedInfrastructureItem,+ scope: UnifiedAgentRow['scope'],+): UnifiedAgentRow => {+ const surfaces = item.surfaces.map(surfaceBreakdownFromConnectedSurface);+ const capabilities = Array.from(new Set(surfaces.map((surface) => surface.kind)));+ const agentSurface = item.surfaces.find((surface) => surface.kind === 'agent');+ const dockerSurface = item.surfaces.find((surface) => surface.kind === 'docker');+ const kubernetesSurface = item.surfaces.find((surface) => surface.kind === 'kubernetes');+ const name = item.name || item.displayName || item.hostname || item.id;+ const rowKey =+ item.status === 'ignored'+ ? item.surfaces[0]?.kind === 'docker'+ ? `removed-docker-${item.id}`+ : item.surfaces[0]?.kind === 'kubernetes'+ ? `removed-k8s-${item.id}`+ : `removed-host-${item.id}`+ : kubernetesSurface && !agentSurface && !dockerSurface+ ? `k8s-${kubernetesSurface.controlId || item.id}`+ : `agent-${item.id}`;+ return {+ rowKey,+ id: item.id,+ agentActionId: item.uninstallAgentId || agentSurface?.controlId,+ dockerActionId: dockerSurface?.controlId,+ kubernetesActionId: kubernetesSurface?.controlId,+ name,+ hostname: item.hostname,+ displayName: item.displayName,+ capabilities,+ status: item.status === 'ignored' ? 'removed' : 'active',+ healthStatus: item.healthStatus,+ lastSeen: item.lastSeen,+ removedAt: item.removedAt,+ version: item.version,+ isOutdatedBinary: item.isOutdatedBinary,+ linkedNodeId: item.linkedNodeId,+ commandsEnabled: item.commandsEnabled,+ agentId: item.scopeAgentId || item.uninstallAgentId,+ upgradePlatform: item.upgradePlatform || 'linux',+ scope,+ installFlags: installFlagsForCapabilities(capabilities),+ searchText: [+ name,+ item.displayName,+ item.hostname,+ item.id,+ item.scopeAgentId,+ item.uninstallAgentId,+ agentSurface?.controlId,+ dockerSurface?.controlId,+ kubernetesSurface?.controlId,+ ]+ .filter(Boolean)+ .join(' ')+ .toLowerCase(),+ kubernetesInfo:+ kubernetesSurface || capabilities.includes('kubernetes')+ ? {+ server: undefined,+ context: undefined,+ tokenName: undefined,+ }+ : undefined,+ surfaces,+ };+};++export const getPowerShellInstallProfileEnvFromFlags = (flags: string[]) => {+ const envAssignments: string[] = [];+ for (let index = 0; index < flags.length; index += 1) {+ const flag = flags[index];+ switch (flag) {+ case '--enable-docker':+ envAssignments.push(`$env:PULSE_ENABLE_DOCKER="true"`);+ break;+ case '--disable-host':+ envAssignments.push(`$env:PULSE_ENABLE_HOST="false"`);+ break;+ case '--enable-kubernetes':+ envAssignments.push(`$env:PULSE_ENABLE_KUBERNETES="true"`);+ break;+ case '--enable-proxmox':+ envAssignments.push(`$env:PULSE_ENABLE_PROXMOX="true"`);+ break;+ case '--proxmox-type':+ if (typeof flags[index + 1] === 'string' && flags[index + 1].trim()) {+ envAssignments.push(`$env:PULSE_PROXMOX_TYPE="${flags[index + 1].trim()}"`);+ index += 1;+ }+ break;+ default:+ if (flag.startsWith('--proxmox-type ')) {+ const proxmoxType = flag.slice('--proxmox-type '.length).trim();+ if (proxmoxType) {+ envAssignments.push(`$env:PULSE_PROXMOX_TYPE="${proxmoxType}"`);+ }+ }+ break;+ }+ }+ return envAssignments;+};diff --git a/frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx b/frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsxindex eb2523ca1e..a6d701c80d 100644--- a/frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx+++ b/frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx@@ -26,11 +26,7 @@ import { SecurityAPI } from '@/api/security';import { notificationStore } from '@/stores/notifications';import { useResources } from '@/hooks/useResources';import type { SecurityStatus } from '@/types/config';-import type {- AgentLookupResponse,- ConnectedInfrastructureItem,- ConnectedInfrastructureSurface,-} from '@/types/api';+import type { AgentLookupResponse, ConnectedInfrastructureItem } from '@/types/api';import type { APITokenRecord } from '@/api/security';import {AGENT_REPORT_SCOPE,@@ -96,501 +92,33 @@ import {trackAgentInstallTokenGenerated,} from '@/utils/upgradeMetrics';import type { Resource } from '@/types/resource';--const TOKEN_PLACEHOLDER = '<api-token>';-const UNIFIED_AGENT_TELEMETRY_SURFACE = 'settings_unified_agents';--const buildDefaultTokenName = () => {- const now = new Date();- const iso = now.toISOString().slice(0, 16); // YYYY-MM-DDTHH:MM- const stamp = iso.replace('T', ' ').replace(/:/g, '-');- return `Agent ${stamp}`;-};--const normalizeTelemetryPart = (value: string) =>- value- .toLowerCase()- .replace(/[^a-z0-9]+/g, '_')- .replace(/^_+|_+$/g, '');--const shellQuoteArg = (value: string) => `'${value.replace(/'/g, `'\"'\"'`)}'`;-type AgentPlatform = 'linux' | 'macos' | 'freebsd' | 'windows';-type UnifiedAgentStatus = 'active' | 'removed';-type ScopeCategory = 'default' | 'profile' | 'ai-managed' | 'na';-type InstallProfile = 'auto' | 'docker' | 'kubernetes' | 'proxmox-pve' | 'proxmox-pbs' | 'truenas';--type SetupHandoffState = {- username: string;- password: string;- apiToken: string;- createdAt?: string;-};--type UnifiedAgentRow = {- rowKey: string;- id: string;- agentActionId?: string;- dockerActionId?: string;- kubernetesActionId?: string;- name: string;- hostname?: string;- displayName?: string;- capabilities: AgentCapability[];- status: UnifiedAgentStatus;- healthStatus?: string;- lastSeen?: number;- removedAt?: number;- version?: string;- isOutdatedBinary?: boolean;- linkedNodeId?: string;- commandsEnabled?: boolean;- agentId?: string;- upgradePlatform: AgentPlatform;- scope: {- label: string;- detail?: string;- category: ScopeCategory;- };- installFlags: string[];- searchText: string;- kubernetesInfo?: {- server?: string;- context?: string;- tokenName?: string;- };- surfaces: Array<{- key: string;- kind: AgentCapability;- label: string;- detail: string;- idLabel?: string;- idValue?: string;- action?: 'stop-monitoring' | 'allow-reconnect';- controlId?: string;- }>;-};--type InventoryActionType = 'stop-monitoring' | 'allow-reconnect';--type InventoryActionNotice = {- tone: 'success' | 'info';- title: string;- detail: string;- showRecoveryQueueLink?: boolean;-};--type StopMonitoringDialogState = {- row: UnifiedAgentRow;- subject: string;- scopeLabel: string;-};--const getCapabilitySurfaceLabel = (capability: AgentCapability) => {- switch (capability) {- case 'agent':- return 'Host telemetry';- case 'docker':- return 'Docker runtime data';- case 'kubernetes':- return 'Kubernetes cluster data';- case 'proxmox':- return 'Proxmox data';- case 'pbs':- return 'PBS data';- case 'pmg':- return 'PMG data';- default:- return getAgentCapabilityLabel(capability);- }-};--const getReconnectActionLabel = (row: UnifiedAgentRow) => {- if (row.capabilities.includes('docker')) {- return 'Allow Docker reconnect';- }- if (row.capabilities.includes('kubernetes')) {- return 'Allow Kubernetes reconnect';- }- return 'Allow host reconnect';-};--const joinHumanList = (parts: string[]) => {- if (parts.length === 0) return '';- if (parts.length === 1) return parts[0];- if (parts.length === 2) return `${parts[0]} and ${parts[1]}`;- return `${parts.slice(0, -1).join(', ')}, and ${parts.at(-1)}`;-};--const sentenceCaseSurfaceLabel = (label: string, index: number) => {- if (index !== 0 || label.length === 0) {- return label;- }- return `${label.slice(0, 1).toLowerCase()}${label.slice(1)}`;-};--const getRowReportingSummary = (row: UnifiedAgentRow) => {- const reported = row.surfaces.map((surface, index) => sentenceCaseSurfaceLabel(surface.label, index));- if (reported.length === 0) {- return '';- }- return `Pulse is receiving ${joinHumanList(reported)} from this item.`;-};--const getRowSurfaceBreakdown = (row: UnifiedAgentRow) => {- return row.surfaces;-};--const getStopMonitoringSurfaces = (row: UnifiedAgentRow) => {- const surfaces = getRowSurfaceBreakdown(row);- const stopMonitoringSurfaces = surfaces.filter((surface) => surface.action === 'stop-monitoring');- const hostManagedStopApplies = stopMonitoringSurfaces.some((surface) => surface.kind === 'agent');- if (!hostManagedStopApplies) {- return stopMonitoringSurfaces;- }- return surfaces.filter((surface) =>- ['agent', 'docker', 'kubernetes', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),- );-};--const getStopMonitoringScopeLabel = (row: UnifiedAgentRow) => {- const surfaceLabels = getStopMonitoringSurfaces(row).map((surface) => surface.label);- if (surfaceLabels.length === 0) {- return 'Reporting for this item';- }- return joinHumanList(surfaceLabels);-};--const createSurfaceScopedRow = (- row: UnifiedAgentRow,- surfaceKey: 'agent' | 'docker' | 'kubernetes' | 'proxmox' | 'pbs' | 'pmg',-): UnifiedAgentRow => {- if (surfaceKey === 'docker') {- return {- ...row,- rowKey: `${row.rowKey}-docker-surface`,- capabilities: ['docker'],- agentActionId: undefined,- kubernetesActionId: undefined,- linkedNodeId: undefined,- surfaces: row.surfaces.filter((surface) => surface.kind === 'docker'),- };- }-- if (surfaceKey === 'kubernetes') {- return {- ...row,- rowKey: `${row.rowKey}-kubernetes-surface`,- capabilities: ['kubernetes'],- agentActionId: undefined,- dockerActionId: undefined,- linkedNodeId: undefined,- surfaces: row.surfaces.filter((surface) => surface.kind === 'kubernetes'),- };- }-- if (surfaceKey === 'agent') {- const hostManagedCapabilities: AgentCapability[] = ['agent'];- if (row.capabilities.includes('proxmox')) hostManagedCapabilities.push('proxmox');- if (row.capabilities.includes('pbs')) hostManagedCapabilities.push('pbs');- if (row.capabilities.includes('pmg')) hostManagedCapabilities.push('pmg');- return {- ...row,- rowKey: `${row.rowKey}-agent-surface`,- capabilities: hostManagedCapabilities,- dockerActionId: undefined,- kubernetesActionId: undefined,- surfaces: row.surfaces.filter((surface) =>- ['agent', 'proxmox', 'pbs', 'pmg'].includes(surface.kind),- ),- };- }-- if (surfaceKey === 'pbs') {- return {- ...row,- rowKey: `${row.rowKey}-pbs-surface`,- capabilities: ['pbs'],- dockerActionId: undefined,- kubernetesActionId: undefined,- surfaces: row.surfaces.filter((surface) => surface.kind === 'pbs'),- };- }-- if (surfaceKey === 'pmg') {- return {- ...row,- rowKey: `${row.rowKey}-pmg-surface`,- capabilities: ['pmg'],- dockerActionId: undefined,- kubernetesActionId: undefined,- surfaces: row.surfaces.filter((surface) => surface.kind === 'pmg'),- };- }-- return {- ...row,- rowKey: `${row.rowKey}-proxmox-surface`,- capabilities: ['proxmox'],- dockerActionId: undefined,- kubernetesActionId: undefined,- surfaces: row.surfaces.filter((surface) => surface.kind === 'proxmox'),- };-};--const INSTALL_PROFILE_OPTIONS: {- value: InstallProfile;- label: string;- description: string;- flags: string[];-}[] = [- {- value: 'auto',- label: 'Auto-detect (recommended)',- description:- 'Let the installer detect Docker, Kubernetes, Proxmox, and agent capabilities automatically.',- flags: [],- },- {- value: 'docker',- label: 'Docker / Podman runtime',- description: 'Force container runtime monitoring even when detection is restricted.',- flags: ['--enable-docker', '--disable-host'],- },- {- value: 'kubernetes',- label: 'Kubernetes node',- description: 'Force Kubernetes monitoring on cluster nodes.',- flags: ['--enable-kubernetes'],- },- {- value: 'proxmox-pve',- label: 'Proxmox VE node',- description: 'Force Proxmox integration and register as a PVE node.',- flags: ['--enable-proxmox', '--proxmox-type pve'],- },- {- value: 'proxmox-pbs',- label: 'Proxmox Backup node',- description: 'Force Proxmox integration and register as a PBS node.',- flags: ['--enable-proxmox', '--proxmox-type pbs'],- },- {- value: 'truenas',- label: 'TrueNAS SCALE agent',- description:- 'Use default auto-detection; installer applies TrueNAS-safe service handling automatically.',- flags: [],- },-];--// Generate platform-specific commands with the appropriate Pulse URL-// Uses agentUrl from API (PULSE_PUBLIC_URL) if configured, otherwise falls back to window.location-const buildCommandsByPlatform = (- unixCommand: string,- windowsInteractiveCommand: string,- windowsParameterizedCommand: string,-): Record<- AgentPlatform,- {- title: string;- description: string;- snippets: { label: string; command: string; note?: string | any }[];- }-> => ({- linux: {- title: 'Install on Linux',- description:- 'The unified installer downloads the agent binary and configures the appropriate service for your system.',- snippets: [- {- label: 'Install',- command: unixCommand,- note: (- <span>- Command auto-escalates with <code>sudo</code> when available; otherwise run from a root- shell (for example <code>su -</code>). Auto-detects your init system and works on- Debian, Ubuntu, Proxmox, Fedora, Alpine, Unraid, Synology, and more.- </span>- ),- },- ],- },- macos: {- title: 'Install on macOS',- description:- 'The unified installer downloads the universal binary and sets up a launchd service for background monitoring.',- snippets: [- {- label: 'Install with launchd',- command: unixCommand,- note: (- <span>- Command auto-escalates with <code>sudo</code> when available; otherwise run from a root- shell. Creates <code>/Library/LaunchDaemons/com.pulse.agent.plist</code> and starts the- agent automatically.- </span>- ),- },- ],- },- freebsd: {- title: 'Install on FreeBSD / pfSense / OPNsense',- description:- 'The unified installer downloads the FreeBSD binary and sets up an rc.d service for background monitoring.',- snippets: [- {- label: 'Install with rc.d',- command: unixCommand,- note: (- <span>- Run as root. <strong>Note:</strong> pfSense/OPNsense don't include bash by default.- Install it first: <code>pkg install bash</code>. Creates{' '}- <code>/usr/local/etc/rc.d/pulse-agent</code> and starts the agent automatically.- </span>- ),- },- ],- },- windows: {- title: 'Install on Windows',- description:- 'Run the PowerShell script to install and configure the unified agent as a Windows service with automatic startup.',- snippets: [- {- label: 'Install as Windows Service (PowerShell)',- command: windowsInteractiveCommand,- note: (- <span>- Run in PowerShell as Administrator. The script will prompt for the Pulse URL and API- token, download the agent binary, and install it as a Windows service with automatic- startup.- </span>- ),- },- {- label: 'Install with parameters (PowerShell)',- command: windowsParameterizedCommand,- note: (- <span>- Non-interactive installation. Set environment variables before running to skip prompts.- </span>- ),- },- ],- },-});--const agentCapabilityFromSurfaceKind = (kind: ConnectedInfrastructureSurface['kind']): AgentCapability => {- switch (kind) {- case 'agent':- case 'docker':- case 'kubernetes':- case 'proxmox':- case 'pbs':- case 'pmg':- return kind;- default:- return 'agent';- }-};--const installFlagsForCapabilities = (capabilities: AgentCapability[]) => {- const flags = new Set<string>();- if (capabilities.includes('docker')) {- flags.add('--enable-docker');- flags.add('--disable-host');- }- if (capabilities.includes('kubernetes')) {- flags.add('--enable-kubernetes');- }- if (capabilities.includes('proxmox')) {- flags.add('--enable-proxmox');- flags.add('--proxmox-type pve');- } else if (capabilities.includes('pbs')) {- flags.add('--enable-proxmox');- flags.add('--proxmox-type pbs');- }- return Array.from(flags);-};--const surfaceBreakdownFromConnectedSurface = (surface: ConnectedInfrastructureSurface) => ({- key: surface.kind,- kind: agentCapabilityFromSurfaceKind(surface.kind),- label: surface.label || getCapabilitySurfaceLabel(agentCapabilityFromSurfaceKind(surface.kind)),- detail: surface.detail || '',- idLabel: surface.idLabel,- idValue: surface.idValue,- action: surface.action,- controlId: surface.controlId,-});--const rowFromConnectedInfrastructureItem = (- item: ConnectedInfrastructureItem,- scope: UnifiedAgentRow['scope'],-): UnifiedAgentRow => {- const surfaces = item.surfaces.map(surfaceBreakdownFromConnectedSurface);- const capabilities = Array.from(new Set(surfaces.map((surface) => surface.kind)));- const agentSurface = item.surfaces.find((surface) => surface.kind === 'agent');- const dockerSurface = item.surfaces.find((surface) => surface.kind === 'docker');- const kubernetesSurface = item.surfaces.find((surface) => surface.kind === 'kubernetes');- const name = item.name || item.displayName || item.hostname || item.id;- const rowKey =- item.status === 'ignored'- ? item.surfaces[0]?.kind === 'docker'- ? `removed-docker-${item.id}`- : item.surfaces[0]?.kind === 'kubernetes'- ? `removed-k8s-${item.id}`- : `removed-host-${item.id}`- : kubernetesSurface && !agentSurface && !dockerSurface- ? `k8s-${kubernetesSurface.controlId || item.id}`- : `agent-${item.id}`;- return {- rowKey,- id: item.id,- agentActionId: item.uninstallAgentId || agentSurface?.controlId,- dockerActionId: dockerSurface?.controlId,- kubernetesActionId: kubernetesSurface?.controlId,- name,- hostname: item.hostname,- displayName: item.displayName,- capabilities,- status: item.status === 'ignored' ? 'removed' : 'active',- healthStatus: item.healthStatus,- lastSeen: item.lastSeen,- removedAt: item.removedAt,- version: item.version,- isOutdatedBinary: item.isOutdatedBinary,- linkedNodeId: item.linkedNodeId,- commandsEnabled: item.commandsEnabled,- agentId: item.scopeAgentId || item.uninstallAgentId,- upgradePlatform: item.upgradePlatform || 'linux',- scope,- installFlags: installFlagsForCapabilities(capabilities),- searchText: [- name,- item.displayName,- item.hostname,- item.id,- item.scopeAgentId,- item.uninstallAgentId,- agentSurface?.controlId,- dockerSurface?.controlId,- kubernetesSurface?.controlId,- ]- .filter(Boolean)- .join(' ')- .toLowerCase(),- kubernetesInfo:- kubernetesSurface || capabilities.includes('kubernetes')- ? {- server: undefined,- context: undefined,- tokenName: undefined,- }- : undefined,- surfaces,- };-};+import {+ buildCommandsByPlatform,+ buildDefaultTokenName,+ createSurfaceScopedRow,+ getCapabilitySurfaceLabel,+ joinHumanList,+ getPowerShellInstallProfileEnvFromFlags,+ getReconnectActionLabel,+ getRowReportingSummary,+ getRowSurfaceBreakdown,+ getStopMonitoringScopeLabel,+ getStopMonitoringSurfaces,+ INSTALL_PROFILE_OPTIONS,+ normalizeTelemetryPart,+ rowFromConnectedInfrastructureItem,+ shellQuoteArg,+ TOKEN_PLACEHOLDER,+ type AgentPlatform,+ type InstallProfile,+ type InventoryActionNotice,+ type InventoryActionType,+ type ScopeCategory,+ type SetupHandoffState,+ type StopMonitoringDialogState,+ type UnifiedAgentRow,+ UNIFIED_AGENT_TELEMETRY_SURFACE,+} from './infrastructureOperationsModel';export interface InfrastructureOperationsStateOptions {embedded?: boolean;@@ -913,41 +441,6 @@ Generate a scoped install token below before copying Unified Agent install commaINSTALL_PROFILE_OPTIONS.find((option) => option.value === installProfile()) ??INSTALL_PROFILE_OPTIONS[0];const getInstallProfileFlags = () => getSelectedInstallProfile().flags;- const getPowerShellInstallProfileEnvFromFlags = (flags: string[]) => {- const envAssignments: string[] = [];- for (let index = 0; index < flags.length; index += 1) {- const flag = flags[index];- switch (flag) {- case '--enable-docker':- envAssignments.push(`$env:PULSE_ENABLE_DOCKER="true"`);- break;- case '--disable-host':- envAssignments.push(`$env:PULSE_ENABLE_HOST="false"`);- break;- case '--enable-kubernetes':- envAssignments.push(`$env:PULSE_ENABLE_KUBERNETES="true"`);- break;- case '--enable-proxmox':- envAssignments.push(`$env:PULSE_ENABLE_PROXMOX="true"`);- break;- case '--proxmox-type':- if (typeof flags[index + 1] === 'string' && flags[index + 1].trim()) {- envAssignments.push(`$env:PULSE_PROXMOX_TYPE="${flags[index + 1].trim()}"`);- index += 1;- }- break;- default:- if (flag.startsWith('--proxmox-type ')) {- const proxmoxType = flag.slice('--proxmox-type '.length).trim();- if (proxmoxType) {- envAssignments.push(`$env:PULSE_PROXMOX_TYPE="${proxmoxType}"`);- }- }- break;- }- }- return envAssignments;- };const getPowerShellInstallProfileEnv = () =>getPowerShellInstallProfileEnvFromFlags(getInstallProfileFlags());const getPowerShellTransportEnv = () => {diff --git a/scripts/release_control/canonical_completion_guard_test.py b/scripts/release_control/canonical_completion_guard_test.pyindex 164419ab1a..99026a0a8d 100644--- a/scripts/release_control/canonical_completion_guard_test.py+++ b/scripts/release_control/canonical_completion_guard_test.py@@ -1752,6 +1752,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):"exact_files": ["frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx",],}@@ -1782,6 +1783,7 @@ class CanonicalCompletionGuardTest(unittest.TestCase):"frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts","frontend-modern/src/api/__tests__/security.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx",],}diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.pyindex 208fc52ae7..7c099cd1dd 100644--- a/scripts/release_control/subsystem_lookup_test.py+++ b/scripts/release_control/subsystem_lookup_test.py@@ -1843,6 +1843,7 @@ class SubsystemLookupTest(unittest.TestCase):"frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts","frontend-modern/src/api/__tests__/security.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx",],)@@ -1861,6 +1862,7 @@ class SubsystemLookupTest(unittest.TestCase):["frontend-modern/src/api/__tests__/agentProfiles.test.ts","frontend-modern/src/api/__tests__/monitoring.test.ts",+ "frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx","frontend-modern/src/components/Settings/__tests__/UnifiedAgents.test.tsx",],)