@skyhook-io/radar-app 1.20.0 → 1.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/package.json +1 -1
  2. package/src/App.tsx +18 -11
  3. package/src/api/client.namespaceSwitch.hook.test.tsx +170 -1
  4. package/src/api/client.pauseDeployment.test.tsx +77 -0
  5. package/src/api/client.restartError.test.ts +14 -0
  6. package/src/api/client.revisionRefresh.test.tsx +44 -0
  7. package/src/api/client.rollbackError.test.ts +14 -0
  8. package/src/api/client.ts +287 -21
  9. package/src/api/helmInventory.test.tsx +108 -0
  10. package/src/api/networkAttachments.test.tsx +120 -0
  11. package/src/api/networkAttachments.ts +30 -0
  12. package/src/api/radarFeatures.test.ts +5 -0
  13. package/src/api/radarFeatures.ts +5 -0
  14. package/src/api/secretsStore.test.ts +33 -0
  15. package/src/api/secretsStore.ts +37 -0
  16. package/src/components/ConnectionErrorView.test.tsx +11 -0
  17. package/src/components/ConnectionErrorView.tsx +19 -0
  18. package/src/components/ContextSwitcher.tsx +9 -2
  19. package/src/components/applications/ApplicationsView.openResource.test.tsx +118 -0
  20. package/src/components/applications/ApplicationsView.tsx +8 -11
  21. package/src/components/cost/CostView.tsx +27 -9
  22. package/src/components/curl/ServiceCurlAvailability.test.tsx +32 -0
  23. package/src/components/curl/ServiceCurlButton.tsx +2 -2
  24. package/src/components/diagnose/InvestigationView.tsx +12 -3
  25. package/src/components/diagnose/investigationCase.test.tsx +41 -0
  26. package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +72 -0
  27. package/src/components/diagnose/investigationEvidence/adapters/helm.test.tsx +52 -0
  28. package/src/components/diagnose/investigationEvidence/adapters/helm.ts +61 -16
  29. package/src/components/diagnose/investigationEvidence/adapters/listings.ts +34 -4
  30. package/src/components/diagnose/investigationEvidence/adapters/resource.ts +3 -2
  31. package/src/components/diagnose/investigationEvidence/bodies/platform.tsx +82 -51
  32. package/src/components/diagnose/investigationEvidence/types.ts +5 -0
  33. package/src/components/dock/TerminalPreferences.query.test.tsx +57 -0
  34. package/src/components/dock/TerminalPreferences.test.tsx +68 -0
  35. package/src/components/dock/TerminalPreferences.tsx +73 -0
  36. package/src/components/gitops/GitOpsView.tsx +1 -9
  37. package/src/components/helm/HelmDrawerFrame.tsx +101 -0
  38. package/src/components/helm/HelmDrawerRouting.test.tsx +86 -0
  39. package/src/components/helm/HelmReleaseDrawer.tsx +47 -98
  40. package/src/components/helm/HelmView.tsx +215 -71
  41. package/src/components/helm/NotCheckedBadge.test.tsx +62 -0
  42. package/src/components/helm/NotCheckedBadge.tsx +39 -0
  43. package/src/components/helm/ObservedHelmNotice.tsx +146 -0
  44. package/src/components/helm/ObservedHelmRelease.test.tsx +261 -0
  45. package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +80 -0
  46. package/src/components/helm/ObservedHelmReleaseDrawer.tsx +228 -0
  47. package/src/components/helm/OwnedResources.test.tsx +86 -0
  48. package/src/components/helm/OwnedResources.tsx +69 -10
  49. package/src/components/home/ClusterHealthCard.heading.test.tsx +72 -0
  50. package/src/components/home/ClusterHealthCard.restricted.test.tsx +76 -0
  51. package/src/components/home/ClusterHealthCard.test.ts +44 -1
  52. package/src/components/home/ClusterHealthCard.tsx +49 -14
  53. package/src/components/home/HelmSummary.tsx +38 -19
  54. package/src/components/home/HelmSummary.unread.test.ts +16 -0
  55. package/src/components/home/HomeAgentBlock.tsx +7 -0
  56. package/src/components/home/MCPSetupDialog.test.tsx +38 -12
  57. package/src/components/home/MCPSetupDialog.tsx +5 -2
  58. package/src/components/home/mcpToolCatalog.ts +45 -5
  59. package/src/components/issues/uncheckedSources.test.ts +2 -0
  60. package/src/components/issues/uncheckedSources.ts +3 -0
  61. package/src/components/resource/RightsizingStrip.test.ts +57 -0
  62. package/src/components/resource/RightsizingStrip.tsx +53 -4
  63. package/src/components/resources/ImageFilesystemModal.test.tsx +74 -6
  64. package/src/components/resources/ImageFilesystemModal.tsx +98 -6
  65. package/src/components/resources/PodFileUploadPanel.tsx +150 -0
  66. package/src/components/resources/PodFilesystemModal.tsx +246 -3
  67. package/src/components/resources/pod-file-upload.test.tsx +223 -0
  68. package/src/components/resources/pod-file-upload.ts +266 -0
  69. package/src/components/resources/renderers/HTTPRouteRenderer.test.tsx +50 -0
  70. package/src/components/resources/renderers/HTTPRouteRenderer.tsx +27 -0
  71. package/src/components/resources/renderers/PodRenderer.tsx +26 -1
  72. package/src/components/resources/renderers/SecretProviderClassRenderer.tsx +25 -0
  73. package/src/components/resources/renderers/ServiceRenderer.test.tsx +15 -2
  74. package/src/components/resources/renderers/ServiceRenderer.tsx +1 -1
  75. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.test.tsx +160 -0
  76. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.tsx +128 -0
  77. package/src/components/rightsizing/RightsizingScanView.tsx +16 -1
  78. package/src/components/rightsizing/model.test.ts +11 -0
  79. package/src/components/rightsizing/model.ts +3 -1
  80. package/src/components/rightsizing/presentation.test.ts +46 -0
  81. package/src/components/rightsizing/presentation.ts +17 -2
  82. package/src/components/traffic/TrafficView.tsx +27 -27
  83. package/src/components/traffic/trafficFilters.test.ts +18 -1
  84. package/src/components/traffic/trafficFilters.ts +30 -1
  85. package/src/components/ui/Omnibar.tsx +4 -1
  86. package/src/components/ui/RadarOmnibar.test.tsx +55 -2
  87. package/src/components/ui/RadarOmnibar.tsx +7 -1
  88. package/src/components/ui/SearchSyntaxHelp.test.tsx +9 -2
  89. package/src/components/ui/SearchSyntaxHelp.tsx +3 -2
  90. package/src/components/ui/UpdateNotification.test.tsx +23 -1
  91. package/src/components/ui/UpdateNotification.tsx +26 -2
  92. package/src/components/ui/omnibar-match.test.ts +7 -0
  93. package/src/components/ui/omnibar-match.ts +1 -0
  94. package/src/components/ui/searchCoverageNote.test.ts +17 -0
  95. package/src/components/ui/searchCoverageNote.ts +31 -7
  96. package/src/components/useContextSwitchFlow.tsx +9 -1
  97. package/src/components/whats-new/releaseNotes.ts +1 -1
  98. package/src/components/workload/NodeCertificateEvidence.test.tsx +51 -0
  99. package/src/components/workload/NodeCertificateEvidence.tsx +44 -0
  100. package/src/components/workload/WorkloadView.tsx +51 -11
  101. package/src/context/ConnectionContext.test.ts +1 -0
  102. package/src/context/ConnectionContext.tsx +2 -2
  103. package/src/contexts/CapabilitiesContext.tsx +2 -0
  104. package/src/hooks/useResolvedGitOpsOwner.test.ts +22 -0
  105. package/src/hooks/useResolvedGitOpsOwner.ts +6 -3
  106. package/src/integrations/resourceHosts.test.tsx +2 -2
  107. package/src/integrations/resourceHosts.tsx +9 -0
  108. package/src/utils/namespacePick.test.ts +87 -0
  109. package/src/utils/namespacePick.ts +88 -0
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { minorsBehind } from "./ClusterHealthCard";
2
+ import { clusterIdentity, minorsBehind } from "./ClusterHealthCard";
3
3
 
4
4
  describe("minorsBehind", () => {
5
5
  it("counts minors between plain versions", () => {
@@ -29,3 +29,46 @@ describe("minorsBehind", () => {
29
29
  expect(minorsBehind("1.33", "")).toBe(0);
30
30
  });
31
31
  });
32
+
33
+ describe("clusterIdentity", () => {
34
+ it("names contexts that share one kubeconfig cluster entry apart", () => {
35
+ const a = clusterIdentity({ name: "agent-a", kubeconfigCluster: "gitlab_com" });
36
+ const b = clusterIdentity({ name: "agent-b", kubeconfigCluster: "gitlab_com" });
37
+ expect(a.headline).toBe("agent-a");
38
+ expect(b.headline).toBe("agent-b");
39
+ expect(a.raw).toBe("agent-a");
40
+ });
41
+
42
+ it("shortens cloud contexts the same way the switcher does", () => {
43
+ const id = clusterIdentity({ name: "gke_proj_us-east1-b_my-cluster", kubeconfigCluster: "gke_proj_us-east1-b_my-cluster" });
44
+ expect(id.headline).toBe("my-cluster");
45
+ expect(id.location).toBe("proj · us-east1-b");
46
+ });
47
+
48
+ it("shows the server host for an OpenShift context, keeping the full context as raw", () => {
49
+ const id = clusterIdentity({ name: "myproject/api-prod-example-com:6443/alice", kubeconfigCluster: "api-prod-example-com:6443" });
50
+ expect(id.headline).toBe("api-prod-example-com");
51
+ expect(id.raw).toBe("myproject/api-prod-example-com:6443/alice");
52
+ expect(id.location).toBe("");
53
+ });
54
+
55
+ it("keeps the cluster entry's account and region for a renamed cloud context", () => {
56
+ const id = clusterIdentity({ name: "prod-eks-alias", kubeconfigCluster: "arn:aws:eks:us-west-2:123456789012:cluster/orders" });
57
+ expect(id.headline).toBe("prod-eks-alias");
58
+ expect(id.location).toBe("123456789012 · us-west-2");
59
+ });
60
+
61
+ it("shows no location when neither name is a cloud name", () => {
62
+ expect(clusterIdentity({ name: "group/project:agent", kubeconfigCluster: "gitlab_com" }).location).toBe("");
63
+ });
64
+
65
+ it("reads an older Radar that sends only the cluster entry as name", () => {
66
+ expect(clusterIdentity({ name: "gitlab_com" }).headline).toBe("gitlab_com");
67
+ expect(clusterIdentity({ name: "arn:aws:eks:us-west-2:123456789012:cluster/orders" }).location).toBe("123456789012 · us-west-2");
68
+ });
69
+
70
+ it("falls back to Cluster with no name", () => {
71
+ expect(clusterIdentity({ name: "in-cluster" }).headline).toBe("in-cluster");
72
+ expect(clusterIdentity({ name: "" }).headline).toBe("Cluster");
73
+ });
74
+ });
@@ -10,7 +10,7 @@ import { clsx } from 'clsx'
10
10
  import { formatCPUMillicores, formatMemoryMiB } from '../../utils/format'
11
11
  import { useCapabilitiesContext } from '../../contexts/CapabilitiesContext'
12
12
  import { HomeAgentBlock } from './HomeAgentBlock'
13
- import { assetUrl, pluralize, parseContextName } from '@skyhook-io/k8s-ui'
13
+ import { assetUrl, pluralize, parseContextName, CertaintyGlyph, MiddleEllipsis } from '@skyhook-io/k8s-ui'
14
14
  import { Tooltip } from '../ui/Tooltip'
15
15
  import { mcpEndpointUrl } from '../../api/config'
16
16
  import { parseMajorMinor } from '../../utils/version'
@@ -219,12 +219,11 @@ export function ClusterHealthCard({
219
219
  // has no meaningful kubeconfig context — bootstrap sets it to
220
220
  // the literal "in-cluster" sentinel. Fall back to the platform
221
221
  // label ("Google Kubernetes Engine") which IS recognizable.
222
- // 3. Last resort: the literal cluster.name, or "Cluster".
222
+ // 3. Last resort: the raw cluster.name, or "Cluster".
223
223
  // When the card is rendered embedded (cloud mode), the H2 itself is
224
224
  // suppressed below — the hub shell already shows the cluster name in
225
225
  // its top bar.
226
- const parsedContext = parseContextName(cluster.name || '')
227
- const rawHeadline = parsedContext.clusterName || cluster.name || 'Cluster'
226
+ const { raw: rawName, location, headline: rawHeadline } = clusterIdentity(cluster)
228
227
  const headlineName = isInCluster ? platformInfo.name : rawHeadline
229
228
 
230
229
  return (
@@ -251,17 +250,19 @@ export function ClusterHealthCard({
251
250
  // the visible text falls back to the platform label. Render no
252
251
  // tooltip in that case; local mode keeps it so users can hover
253
252
  // to see the full kubeconfig context path.
254
- <Tooltip content={isInCluster ? '' : cluster.name} wrapperClassName="!block min-w-0">
255
- <h2 className="text-xl font-semibold text-theme-text-primary truncate leading-tight mb-1.5">
256
- {headlineName}
253
+ <Tooltip content={isInCluster ? '' : rawName} wrapperClassName="!block min-w-0">
254
+ <h2 aria-label={isInCluster ? headlineName : rawName} className="text-xl font-semibold text-theme-text-primary leading-tight mb-1.5">
255
+ {/* Generated contexts often share a long prefix and differ only at the end.
256
+ MiddleEllipsis exposes only the cut text to screen readers; aria-label keeps the full name. */}
257
+ <MiddleEllipsis text={headlineName} />
257
258
  </h2>
258
259
  </Tooltip>
259
260
  )}
260
261
  <div className="flex flex-col gap-0.5 text-xs text-theme-text-tertiary">
261
- {(parsedContext.account || parsedContext.region) && (
262
- <Tooltip content={[parsedContext.account, parsedContext.region].filter(Boolean).join(' · ')} wrapperClassName="min-w-0">
262
+ {location && (
263
+ <Tooltip content={location} wrapperClassName="min-w-0">
263
264
  <span className="truncate font-mono">
264
- {[parsedContext.account, parsedContext.region].filter(Boolean).join(' · ')}
265
+ {location}
265
266
  </span>
266
267
  </Tooltip>
267
268
  )}
@@ -273,7 +274,7 @@ export function ClusterHealthCard({
273
274
  />
274
275
  )}
275
276
  {radarVersion}
276
- <span><span className="font-mono">{counts.namespaces}</span> namespaces</span>
277
+ <NamespaceCountLine count={counts.namespaces} restricted={isRestricted('namespaces')} />
277
278
  </div>
278
279
  {freshness && <div className="mt-2">{freshness}</div>}
279
280
  {nodeVersionSkew && (
@@ -303,7 +304,7 @@ export function ClusterHealthCard({
303
304
  (org-wide endpoint, PAT-authed) rather than per-cluster, so this
304
305
  localhost/no-auth entry would mislead a Cloud user. */}
305
306
  {showLocalMcpCard && (
306
- <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
307
+ <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} httpTools={caps.mcpHttpTools} helmTools={caps.mcpHelmTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
307
308
  )}
308
309
  </div>
309
310
 
@@ -440,9 +441,15 @@ export function ClusterHealthCard({
440
441
  />
441
442
  </div>
442
443
  )}
443
- {!metricsServerAvailable && (
444
+ {!metricsServerAvailable && (isRestricted('nodes') ? (
445
+ // Capacity comes from Nodes, so installing metrics-server wouldn't help.
446
+ <span className="flex items-center gap-1.5 text-xs text-theme-text-tertiary">
447
+ <Shield className="w-3 h-3 shrink-0" />
448
+ <span>CPU and memory need permission to list Nodes</span>
449
+ </span>
450
+ ) : (
444
451
  <MetricsUnavailableHint platform={cluster.platform} metricsServerAvailable={metricsServerAvailable} />
445
- )}
452
+ ))}
446
453
  </div>
447
454
 
448
455
  </div>
@@ -516,6 +523,17 @@ export function ClusterHealthCard({
516
523
  )
517
524
  }
518
525
 
526
+ // `name` is the kubeconfig context. A renamed cloud context
527
+ // (`aws eks update-kubeconfig --alias`) no longer parses, but its kubeconfig
528
+ // cluster entry still carries the account and region.
529
+ export function clusterIdentity(cluster: Pick<DashboardResponse['cluster'], 'name' | 'kubeconfigCluster'>) {
530
+ const raw = cluster.name || ''
531
+ const parsed = parseContextName(raw)
532
+ const located = parsed.provider ? parsed : parseContextName(cluster.kubeconfigCluster || '')
533
+ const location = [located.account, located.region].filter(Boolean).join(' · ')
534
+ return { raw, headline: parsed.clusterName || raw || 'Cluster', location }
535
+ }
536
+
519
537
  // How many minors the running version trails the newest one the upgrade-impact
520
538
  // catalog covers. Cross-major comparisons return 0 — better a missing hint than
521
539
  // a wrong count on an exotic version string.
@@ -566,6 +584,23 @@ function KubernetesVersionLine({
566
584
  )
567
585
  }
568
586
 
587
+ // A restricted count covers only the namespaces Radar reads, so it is a lower
588
+ // bound, and zero means unknown rather than none.
589
+ export function NamespaceCountLine({ count, restricted }: { count: number; restricted: boolean }) {
590
+ if (!restricted) {
591
+ return <span><span className="font-mono">{count}</span> namespaces</span>
592
+ }
593
+ if (count === 0) {
594
+ return <span>Namespaces restricted</span>
595
+ }
596
+ return (
597
+ <span className="flex items-center gap-1">
598
+ <CertaintyGlyph certainty="lower_bound" title="Namespaces can't be listed here, so this counts only the ones in view. The cluster may have more." />
599
+ <span><span className="font-mono">{count}</span> {count === 1 ? 'namespace' : 'namespaces'}</span>
600
+ </span>
601
+ )
602
+ }
603
+
569
604
  function RestrictedRing({ label }: { label: string }) {
570
605
  const radius = 36
571
606
  const circumference = 2 * Math.PI * radius
@@ -1,7 +1,9 @@
1
- import type { DashboardHelmSummary } from '../../api/client'
1
+ import { useRadarFeature, type DashboardHelmSummary } from '../../api/client'
2
2
  import { Package, ArrowRight, Shield } from 'lucide-react'
3
3
  import { clsx } from 'clsx'
4
4
  import { Tooltip } from '../ui/Tooltip'
5
+ import { SEVERITY_TEXT } from '../../utils/badge-colors'
6
+ import { NotCheckedBadge } from '../helm/NotCheckedBadge'
5
7
 
6
8
  interface HelmSummaryProps {
7
9
  data?: DashboardHelmSummary
@@ -40,7 +42,18 @@ function getHealthDot(health?: string): string {
40
42
  }
41
43
  }
42
44
 
45
+ // What the card is missing when Helm's records couldn't be read in some
46
+ // namespaces. The Helm view still lists those releases from their objects.
47
+ export function unreadHelmNamespacesLine(unread: DashboardHelmSummary['unreadNamespaces']): string | null {
48
+ if (!unread) return null
49
+ if (unread.extent) return 'Helm’s records weren’t read in some namespaces. Open Helm for releases there.'
50
+ const where = unread.names?.length === 1 ? unread.names[0] : `${unread.count} namespaces`
51
+ return `Helm’s records weren’t read in ${where}. Open Helm for releases there.`
52
+ }
53
+
43
54
  export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
55
+ const observedView = useRadarFeature('helmInventory').support === 'supported'
56
+ const unreadLine = unreadHelmNamespacesLine(data?.unreadNamespaces)
44
57
  return (
45
58
  <button
46
59
  onClick={onNavigate}
@@ -79,8 +92,8 @@ export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
79
92
  ) : data.restricted ? (
80
93
  <div className="flex flex-col items-center justify-center h-full py-4 text-theme-text-tertiary">
81
94
  <Shield className="w-8 h-8 text-amber-400 mb-2" />
82
- <span className="text-xs font-medium text-theme-text-secondary">Access Restricted</span>
83
- <span className="text-[11px] mt-1">Insufficient permissions to list Helm releases</span>
95
+ <span className="text-xs font-medium text-theme-text-secondary">{observedView ? 'Helm’s records are restricted' : 'Access Restricted'}</span>
96
+ <span className="text-[11px] mt-1">{observedView ? 'Open Helm to see releases from object labels and annotations' : 'Insufficient permissions to list Helm releases'}</span>
84
97
  </div>
85
98
  ) : data.error ? (
86
99
  <div className="flex flex-col items-center justify-center h-full py-4 text-theme-text-tertiary">
@@ -98,36 +111,42 @@ export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
98
111
  </div>
99
112
  ) : !data.releases || data.releases.length === 0 ? (
100
113
  <div className="flex items-center justify-center h-full py-4 text-xs text-theme-text-tertiary">
101
- No Helm releases found
114
+ {unreadLine ? 'No Helm releases where Radar could read Helm’s records' : 'No Helm releases found'}
102
115
  </div>
103
116
  ) : (
104
117
  <div className="divide-y divide-theme-border">
105
118
  {data.releases.map((release) => (
119
+ // One flex row so space runs out in order: the chart text first,
120
+ // then the namespace, then the name. The badges never shrink.
106
121
  <div
107
122
  key={`${release.namespace}/${release.name}`}
108
- className="flex items-center justify-between px-3 py-1.5 overflow-hidden"
123
+ className="flex items-center gap-2 px-3 py-1.5 overflow-hidden"
109
124
  >
110
- <div className="flex items-center gap-2 min-w-0">
111
- <span className={clsx('w-1.5 h-1.5 rounded-full shrink-0', getHealthDot(release.resourceHealth))} />
112
- <span className="text-xs text-theme-text-primary truncate">{release.name}</span>
113
- <span className="text-[10px] text-theme-text-tertiary truncate">{release.namespace}</span>
114
- </div>
115
- <div className="flex items-center gap-1.5 ml-2 min-w-0">
116
- <Tooltip content={`${release.chart} ${release.chartVersion}`} delay={100}>
117
- <span className="text-[10px] text-theme-text-tertiary hidden sm:inline truncate max-w-[150px]">
118
- {release.chart} {release.chartVersion}
119
- </span>
120
- </Tooltip>
121
- <span className={clsx('badge-sm shrink-0', getStatusBadgeClass(release.status))}>
122
- {release.status}
125
+ <span className={clsx('w-1.5 h-1.5 rounded-full shrink-0', getHealthDot(release.resourceHealth))} />
126
+ <span className="min-w-[3rem] text-xs text-theme-text-primary truncate">{release.name}</span>
127
+ <span className="min-w-0 shrink-[20] text-[10px] text-theme-text-tertiary truncate">{release.namespace}</span>
128
+ <Tooltip content={`${release.chart} ${release.chartVersion}`} delay={100} wrapperClassName="ml-auto min-w-0 shrink-[400]">
129
+ <span className="text-[10px] text-theme-text-tertiary hidden sm:inline truncate max-w-[150px]">
130
+ {release.chart} {release.chartVersion}
123
131
  </span>
124
- </div>
132
+ </Tooltip>
133
+ <NotCheckedBadge count={release.statusUnreadCount} />
134
+ <span className={clsx('badge-sm shrink-0', getStatusBadgeClass(release.status))}>
135
+ {release.status}
136
+ </span>
125
137
  </div>
126
138
  ))}
127
139
  </div>
128
140
  )}
129
141
  </div>
130
142
 
143
+ {unreadLine && data && !data.restricted && !data.error && (
144
+ <Tooltip content={unreadLine} wrapperClassName="!block min-w-0 w-full">
145
+ <div className={clsx('px-4 py-1.5 border-t border-theme-border/50 text-[11px] truncate', SEVERITY_TEXT.warning)}>
146
+ {unreadLine}
147
+ </div>
148
+ </Tooltip>
149
+ )}
131
150
  <div className="px-4 py-1.5 border-t border-theme-border/50 flex items-center justify-between">
132
151
  <span className="text-[10px] text-theme-text-tertiary">
133
152
  {data && data.releases && data.total > data.releases.length ? `+${data.total - data.releases.length} more` : ''}
@@ -0,0 +1,16 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { unreadHelmNamespacesLine } from './HelmSummary'
3
+
4
+ describe('the Home Helm card when some namespaces went unread', () => {
5
+ it('says nothing when everything was read', () => {
6
+ expect(unreadHelmNamespacesLine(undefined)).toBeNull()
7
+ })
8
+
9
+ it('names a single namespace', () => {
10
+ expect(unreadHelmNamespacesLine({ count: 1, names: ['team-b'] })).toBe('Helm’s records weren’t read in team-b. Open Helm for releases there.')
11
+ })
12
+
13
+ it('counts several', () => {
14
+ expect(unreadHelmNamespacesLine({ count: 30, names: ['a', 'b'] })).toContain('in 30 namespaces')
15
+ })
16
+ })
@@ -14,11 +14,16 @@ export function HomeAgentBlock({
14
14
  mcpUrl,
15
15
  readOnly,
16
16
  execTools,
17
+ httpTools,
18
+ helmTools,
17
19
  applicationEvidenceAvailable,
18
20
  }: {
19
21
  mcpUrl: string
20
22
  readOnly?: boolean
21
23
  execTools?: boolean
24
+ httpTools?: boolean
25
+ /** Whether the native Helm MCP tool is registered; target Kubernetes permissions still required. */
26
+ helmTools?: boolean
22
27
  applicationEvidenceAvailable?: boolean
23
28
  }) {
24
29
  const [mcpDialogOpen, setMcpDialogOpen] = useState(false)
@@ -54,6 +59,8 @@ export function HomeAgentBlock({
54
59
  mcpUrl={mcpUrl}
55
60
  readOnly={readOnly}
56
61
  execTools={execTools}
62
+ httpTools={httpTools}
63
+ helmTools={helmTools}
57
64
  onInvestigate={showInvestigate && d.available ? () => openComposer(d) : undefined}
58
65
  applicationEvidenceAvailable={applicationEvidenceAvailable}
59
66
  />
@@ -20,13 +20,14 @@ describe('MCP setup in read-only mode', () => {
20
20
  setBasename('/radar')
21
21
  try {
22
22
  const url = mcpEndpointUrl(true)
23
- const html = renderToStaticMarkup(<MCPSetupDialog open readOnly applicationEvidenceAvailable mcpUrl={url} onClose={() => {}} />)
23
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools readOnly applicationEvidenceAvailable mcpUrl={url} onClose={() => {}} />)
24
24
  expect(html).toContain(`claude mcp add --transport http radar ${url}`)
25
25
  expect(html).toContain(`codex mcp add radar --url ${url}`)
26
26
  expect(html).toContain('/radar/mcp-readonly')
27
27
  expect(html).toContain('list_namespaces')
28
28
  expect(html).not.toContain('apply_resource')
29
29
  expect(html).not.toContain('exec_pod')
30
+ expect(html).not.toContain('curl_service')
30
31
  expect(html).not.toContain('collect_application_evidence')
31
32
  expect(html).not.toContain('in_cluster')
32
33
  expect(html).toContain('Read-only mode blocks write tools')
@@ -36,43 +37,46 @@ describe('MCP setup in read-only mode', () => {
36
37
  })
37
38
 
38
39
  it('explains disabled exec without including it in the available tool count', () => {
39
- const html = renderToStaticMarkup(<MCPSetupDialog open execTools={false} mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
40
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools execTools={false} mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
40
41
  expect(html).toContain('apply_resource')
41
42
  expect(html).toContain('in_cluster')
42
43
  expect(html).toContain('exec_pod')
43
44
  expect(html).toContain('is disabled')
44
45
  expect(html).toContain('--mcp-exec-tools')
45
- expect(html).toContain(`${MCP_TOOL_CATALOG.length - 2} tools`)
46
+ expect(html).toContain(`${MCP_TOOL_CATALOG.length - 3} tools`)
46
47
  })
47
48
 
48
49
  it('does not suggest an unsupported flag when the capability is absent', () => {
49
- const html = renderToStaticMarkup(<MCPSetupDialog open mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
50
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
50
51
  expect(html).not.toContain('exec_pod')
52
+ expect(html).not.toContain('curl_service')
51
53
  expect(html).not.toContain('--mcp-exec-tools')
52
54
  })
53
55
 
54
- it('shows exec and counts it only when enabled', () => {
55
- const html = renderToStaticMarkup(<MCPSetupDialog open execTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
56
+ it('shows exec without enabling HTTP', () => {
57
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools execTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
56
58
  expect(html).toContain('exec_pod')
57
- expect(html).toContain(`${MCP_TOOL_CATALOG.length - 1} tools`)
59
+ expect(html).not.toContain('curl_service')
60
+ expect(html).toContain(`${MCP_TOOL_CATALOG.length - 2} tools`)
58
61
  expect(html.indexOf('exec_pod')).toBeGreaterThan(html.indexOf('get_workload_logs'))
59
62
  })
60
63
 
61
64
  it('hides exec in read-only mode even if exec is requested', () => {
62
- const html = renderToStaticMarkup(<MCPSetupDialog open readOnly execTools mcpUrl={mcpEndpointUrl(true)} onClose={() => {}} />)
65
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools readOnly execTools mcpUrl={mcpEndpointUrl(true)} onClose={() => {}} />)
63
66
  expect(html).not.toContain('exec_pod')
67
+ expect(html).not.toContain('curl_service')
64
68
  expect(html).toContain(`${MCP_TOOL_CATALOG.filter((tool) => !tool.write && !tool.localOnly).length} tools`)
65
69
  })
66
70
 
67
71
  it('keeps the full catalog in default mode', () => {
68
- const html = renderToStaticMarkup(<MCPSetupDialog open applicationEvidenceAvailable mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
72
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools applicationEvidenceAvailable mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
69
73
  expect(html).toContain('apply_resource')
70
74
  expect(html).toContain('in_cluster')
71
75
  expect(html).toContain('collect_application_evidence')
72
76
  })
73
77
 
74
78
  it('hides local-only tools unless the server advertises availability', () => {
75
- const html = renderToStaticMarkup(<MCPSetupDialog open mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
79
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
76
80
  expect(html).toContain('apply_resource')
77
81
  expect(html).not.toContain('collect_application_evidence')
78
82
  })
@@ -81,7 +85,7 @@ describe('MCP setup in read-only mode', () => {
81
85
  describe('MCP setup prompt tip', () => {
82
86
  it('tips to name Radar under the client setups, as plain text, without the in-Radar link when no handler is given', () => {
83
87
  const host = document.createElement('div')
84
- host.innerHTML = renderToStaticMarkup(<MCPSetupDialog open mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
88
+ host.innerHTML = renderToStaticMarkup(<MCPSetupDialog open helmTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
85
89
  const tip = [...host.querySelectorAll('p')].find((p) => p.textContent?.startsWith('Tip:'))
86
90
  expect(tip?.textContent).toBe(
87
91
  "Tip: name Radar in your prompt so your agent uses Radar instead of kubectl, e.g. Use Radar to find what's broken in my cluster and why.",
@@ -131,7 +135,7 @@ describe('MCP setup prompt tip', () => {
131
135
  document.body.appendChild(host)
132
136
  const root = createRoot(host)
133
137
  try {
134
- act(() => root.render(<MCPSetupDialog open mcpUrl={mcpEndpointUrl()} onClose={() => {}} />))
138
+ act(() => root.render(<MCPSetupDialog open helmTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />))
135
139
  const endpoint = [...host.querySelectorAll('code')].find((c) => c.textContent === mcpEndpointUrl())!
136
140
  const copy = endpoint.closest('.relative')!.querySelector('button')!
137
141
  await act(async () => copy.click())
@@ -143,3 +147,25 @@ describe('MCP setup prompt tip', () => {
143
147
  }
144
148
  })
145
149
  })
150
+
151
+ it('shows HTTP independently of exec', () => {
152
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools httpTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
153
+ expect(html).toContain('curl_service')
154
+ expect(html).not.toContain('exec_pod')
155
+ expect(html).toContain(`${MCP_TOOL_CATALOG.length - 2} tools`)
156
+ const readOnly = renderToStaticMarkup(<MCPSetupDialog open helmTools readOnly httpTools mcpUrl={mcpEndpointUrl(true)} onClose={() => {}} />)
157
+ expect(readOnly).not.toContain('curl_service')
158
+ })
159
+
160
+
161
+ it('hides disabled Helm writes while retaining release reads and other writes', () => {
162
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools={false} mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
163
+ expect(html).not.toContain('manage_helm')
164
+ expect(html).toContain('get_helm_release')
165
+ expect(html).toContain('apply_resource')
166
+ })
167
+
168
+ it('shows registered Helm tools independently of target namespace permissions', () => {
169
+ const html = renderToStaticMarkup(<MCPSetupDialog open helmTools mcpUrl={mcpEndpointUrl()} onClose={() => {}} />)
170
+ expect(html).toContain('manage_helm')
171
+ })
@@ -13,6 +13,9 @@ interface MCPSetupDialogProps {
13
13
  onClose: () => void
14
14
  readOnly?: boolean
15
15
  execTools?: boolean
16
+ httpTools?: boolean
17
+ /** Whether the native Helm MCP tool is registered; target Kubernetes permissions still required. */
18
+ helmTools?: boolean
16
19
  applicationEvidenceAvailable?: boolean
17
20
  mcpUrl: string
18
21
  /** Opens Radar's own investigation composer. Omit where investigations can't run. */
@@ -56,7 +59,7 @@ function CodeBlock({ children }: { children: string }) {
56
59
  )
57
60
  }
58
61
 
59
- export function MCPSetupDialog({ open, onClose, mcpUrl, readOnly = false, execTools, onInvestigate, applicationEvidenceAvailable = false }: MCPSetupDialogProps) {
62
+ export function MCPSetupDialog({ open, onClose, mcpUrl, readOnly = false, execTools, httpTools, helmTools, onInvestigate, applicationEvidenceAvailable = false }: MCPSetupDialogProps) {
60
63
  const dialogRef = useRef<HTMLDivElement>(null)
61
64
  const [isDesktop, setIsDesktop] = useState(false)
62
65
  const [portPinned, setPortPinned] = useState(false)
@@ -130,7 +133,7 @@ export function MCPSetupDialog({ open, onClose, mcpUrl, readOnly = false, execTo
130
133
  const currentPort = Number(window.location.port) || 80
131
134
 
132
135
  const tools = MCP_TOOL_CATALOG
133
- .filter((tool) => (!readOnly || !tool.write) && (tool.name !== 'exec_pod' || execTools) && (!tool.localOnly || (!readOnly && applicationEvidenceAvailable)))
136
+ .filter((tool) => (!readOnly || !tool.write) && (tool.name !== 'exec_pod' || execTools) && (tool.name !== 'curl_service' || httpTools) && (tool.name !== 'manage_helm' || helmTools) && (!tool.localOnly || (!readOnly && applicationEvidenceAvailable)))
134
137
  .map((tool) => readOnly && tool.name === 'diagnose'
135
138
  ? { ...tool, params: tool.params.filter((param) => param.arg !== 'in_cluster') }
136
139
  : tool)
@@ -173,20 +173,29 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
173
173
  },
174
174
  {
175
175
  name: 'list_helm_releases',
176
- desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations.',
176
+ desc: 'All Helm releases with status, resource health, storage namespace, Flux ownership, current lastOperation, and capped operation trails for failed upgrades, rollbacks, or stuck pending operations. Without access to Helm’s Secrets, rows come from labels and annotations on objects you can read, with no status.',
177
177
  params: [{ arg: 'namespace', desc: 'filter to a specific namespace' }],
178
178
  },
179
179
  {
180
180
  name: 'get_helm_release',
181
- desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available.',
181
+ desc: 'Detailed Helm release info with owned resources, health, Flux ownership, current lastOperation, operationInsight, hooks, and failed/running hook diagnostics with live Job/Pod/Event/redacted-log evidence when available. Without access to Helm’s Secrets, the release as its objects describe it, with no status or history.',
182
182
  params: [
183
183
  { arg: 'namespace', required: true, desc: 'Helm storage namespace; use storageNamespace from list_helm_releases when present' },
184
184
  { arg: 'name', required: true, desc: 'release name' },
185
- { arg: 'include', desc: 'values, history, operations, diff, values_diff, notes_diff, resource_diff' },
185
+ { arg: 'include', desc: 'chart (stored defaults/schema), notes (untrusted), versions (upgrade targets from the confirmed source), values, history, operations, diff, values_diff, notes_diff, resource_diff' },
186
+ { arg: 'chart_path', desc: 'with include=chart: JSON pointer into defaults; omit to list top-level paths' },
186
187
  { arg: 'diff_revision_1', desc: 'first revision for any diff include' },
187
188
  { arg: 'diff_revision_2', desc: 'second revision for any diff include (defaults to current)' },
188
189
  ],
189
190
  },
191
+ {
192
+ name: 'get_helm_chart',
193
+ desc: 'Versions of a chart in a configured repository or OCI source, newest first, read live before installing it; latest is the newest non-prerelease.',
194
+ params: [
195
+ { arg: 'repository', required: true, desc: 'configured repository name or URL, or OCI prefix: the value an install uses' },
196
+ { arg: 'chart', required: true, desc: 'chart name' },
197
+ ],
198
+ },
190
199
  {
191
200
  name: 'list_packages',
192
201
  desc: 'Unified "what\'s installed" view across Helm releases, workload labels, CRD registrations, and GitOps declarations (Argo + Flux), with sources, versions, health, and a sourceLegend for the stable source codes.',
@@ -308,6 +317,18 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
308
317
  { arg: 'previous', desc: 'logs from the previous terminated container' },
309
318
  ],
310
319
  },
320
+ {
321
+ name: 'curl_service',
322
+ write: true,
323
+ desc: 'HTTP GET to a selector-backed Service with a ClusterIP from in-cluster Radar, with status/body and no Kubernetes credentials. Requires --mcp-http-tools and get services/proxy permission. No redirects or authenticated requests; internal TLS certificates are not verified.',
324
+ params: [
325
+ { arg: 'namespace', required: true, desc: 'Service namespace' },
326
+ { arg: 'name', required: true, desc: 'Service name' },
327
+ { arg: 'port', required: true, desc: 'numeric Service port' },
328
+ { arg: 'scheme', desc: 'http (default) or https' },
329
+ { arg: 'path', desc: 'path and query; defaults to /' },
330
+ ],
331
+ },
311
332
  {
312
333
  name: 'exec_pod',
313
334
  write: true,
@@ -333,12 +354,31 @@ export const MCP_TOOL_CATALOG: MCPToolInfo[] = [
333
354
  { arg: 'confirm_network_access', required: true, desc: 'true after operator authorization to collect endpoint evidence' },
334
355
  ],
335
356
  },
357
+ {
358
+ name: 'manage_helm',
359
+ write: true,
360
+ desc: 'Install, upgrade, roll back or uninstall a native Helm release. Uses your Kubernetes permissions. Keep GitOps-managed dependencies in git. Upgrade and rollback can be previewed first; a rollback preview names objects it would take over from other releases. Uninstall previews what it deletes, keeps and runs before accepting a reviewed confirmation token.',
361
+ params: [
362
+ { arg: 'action', required: true, desc: 'install, upgrade, rollback, or uninstall' },
363
+ { arg: 'namespace', required: true, desc: 'release storage namespace' },
364
+ { arg: 'name', required: true, desc: 'release name' },
365
+ { arg: 'chart', desc: 'chart name for install' },
366
+ { arg: 'repository', desc: 'configured install source; upgrade optionally asserts the confirmed saved source and requires it to be configured' },
367
+ { arg: 'version', desc: 'exact version for install (choices from get_helm_chart); upgrade choices come from get_helm_release include=versions; omit on upgrade only when latest and deployed charts agree' },
368
+ { arg: 'values', desc: 'upgrade overrides merge over the deployed revision\'s overrides; no literal credentials' },
369
+ { arg: 'replace_values', desc: 'upgrade only: explicitly replace all stored overrides with values' },
370
+ { arg: 'dry_run', desc: 'upgrade or rollback: advisory preview (upgrade: same merge rules; rollback: stored diff plus live takeover and retention checks); false executes' },
371
+ { arg: 'expected_revision', desc: 'upgrade or rollback: refuse a changed latest revision; not an atomic lock' },
372
+ { arg: 'revision', desc: 'positive rollback revision from release history' },
373
+ { arg: 'confirm', desc: 'reviewed preview token to execute uninstall; expires after 5 minutes' },
374
+ ],
375
+ },
336
376
  {
337
377
  name: 'manage_workload',
338
378
  write: true,
339
- desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
379
+ desc: 'Operate on a workload: restart triggers a rolling restart, scale changes the replica count, rollback reverts to a previous revision, pause holds a Deployment\'s rollouts until resume releases them. Roll back a native Helm release\'s workload as the Helm release, not the workload alone. Rollout rollback re-runs every canary step — pair it with manage_rollout promote-full, or abort instead.',
340
380
  params: [
341
- { arg: 'action', required: true, desc: 'restart, scale, or rollback' },
381
+ { arg: 'action', required: true, desc: 'restart, scale, rollback, pause, or resume (pause and resume are Deployment only)' },
342
382
  { arg: 'kind', required: true, desc: 'deployment, statefulset, daemonset, or rollout' },
343
383
  { arg: 'namespace', required: true, desc: 'workload namespace' },
344
384
  { arg: 'name', required: true, desc: 'workload name' },
@@ -28,6 +28,8 @@ describe('uncheckedSourceLines', () => {
28
28
  })
29
29
 
30
30
  it("says when Radar's own service account is the problem", () => {
31
+ expect(uncheckedSourceLines([{ source: 'helm', reason: 'caller_access_denied' }]))
32
+ .toEqual(['Radar can\'t read Helm\'s release Secrets here, so failed or stuck releases may be missing.'])
31
33
  expect(uncheckedSourceLines([{ source: 'helm', reason: 'collector_access_denied' }]))
32
34
  .toEqual(["Helm releases couldn't be checked because Radar's service account isn't allowed to impersonate users, so failed or stuck releases may be missing."])
33
35
  })
@@ -34,6 +34,9 @@ function helmLine({ reason, namespaces }: UncheckedSource): string {
34
34
  if (reason === "collector_access_denied") {
35
35
  return `Helm releases ${where}couldn't be checked because Radar's service account isn't allowed to impersonate users, so ${missing}.`;
36
36
  }
37
+ if (reason === "caller_access_denied") {
38
+ return `Radar can't read Helm's release Secrets ${where ? where.trim() : "here"}, so ${missing}.`;
39
+ }
37
40
  return `Helm releases ${where}couldn't be checked, so ${missing}.`;
38
41
  }
39
42