@skyhook-io/radar-app 1.20.0 → 1.20.1

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 (41) hide show
  1. package/package.json +1 -1
  2. package/src/App.tsx +6 -4
  3. package/src/api/client.ts +69 -10
  4. package/src/api/helmInventory.test.tsx +108 -0
  5. package/src/api/radarFeatures.ts +2 -0
  6. package/src/components/curl/ServiceCurlAvailability.test.tsx +32 -0
  7. package/src/components/curl/ServiceCurlButton.tsx +2 -2
  8. package/src/components/diagnose/investigationCase.test.tsx +41 -0
  9. package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +72 -0
  10. package/src/components/diagnose/investigationEvidence/adapters/helm.ts +51 -16
  11. package/src/components/diagnose/investigationEvidence/adapters/listings.ts +34 -4
  12. package/src/components/diagnose/investigationEvidence/adapters/resource.ts +3 -2
  13. package/src/components/helm/HelmDrawerFrame.tsx +101 -0
  14. package/src/components/helm/HelmDrawerRouting.test.tsx +86 -0
  15. package/src/components/helm/HelmReleaseDrawer.tsx +23 -86
  16. package/src/components/helm/HelmView.tsx +213 -71
  17. package/src/components/helm/ObservedHelmNotice.tsx +146 -0
  18. package/src/components/helm/ObservedHelmRelease.test.tsx +261 -0
  19. package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +80 -0
  20. package/src/components/helm/ObservedHelmReleaseDrawer.tsx +228 -0
  21. package/src/components/helm/OwnedResources.tsx +4 -2
  22. package/src/components/home/ClusterHealthCard.restricted.test.tsx +76 -0
  23. package/src/components/home/ClusterHealthCard.tsx +28 -5
  24. package/src/components/home/HelmSummary.tsx +23 -4
  25. package/src/components/home/HelmSummary.unread.test.ts +16 -0
  26. package/src/components/home/HomeAgentBlock.tsx +7 -0
  27. package/src/components/home/MCPSetupDialog.test.tsx +38 -12
  28. package/src/components/home/MCPSetupDialog.tsx +5 -2
  29. package/src/components/home/mcpToolCatalog.ts +44 -4
  30. package/src/components/issues/uncheckedSources.test.ts +2 -0
  31. package/src/components/issues/uncheckedSources.ts +3 -0
  32. package/src/components/resources/renderers/ServiceRenderer.test.tsx +15 -2
  33. package/src/components/resources/renderers/ServiceRenderer.tsx +1 -1
  34. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.test.tsx +160 -0
  35. package/src/components/resources/renderers/ValidatingAdmissionPolicyRenderer.tsx +128 -0
  36. package/src/components/whats-new/releaseNotes.ts +1 -1
  37. package/src/contexts/CapabilitiesContext.tsx +2 -0
  38. package/src/hooks/useResolvedGitOpsOwner.test.ts +22 -0
  39. package/src/hooks/useResolvedGitOpsOwner.ts +6 -3
  40. package/src/integrations/resourceHosts.test.tsx +1 -1
  41. package/src/integrations/resourceHosts.tsx +5 -0
@@ -0,0 +1,76 @@
1
+ // @vitest-environment jsdom
2
+ import { describe, expect, it, vi } from "vitest";
3
+ import { renderToString } from "react-dom/server";
4
+ import type { DashboardResourceCounts } from "../../api/client";
5
+ import { ClusterHealthCard } from "./ClusterHealthCard";
6
+
7
+ // The MCP block needs the Diagnose provider and is unrelated to the counts.
8
+ vi.mock("./HomeAgentBlock", () => ({ HomeAgentBlock: () => null }));
9
+
10
+ function counts(overrides: Partial<DashboardResourceCounts>): DashboardResourceCounts {
11
+ return {
12
+ pods: { total: 0, running: 0, pending: 0, failed: 0, succeeded: 0 },
13
+ deployments: { total: 0, available: 0, unavailable: 0 },
14
+ statefulSets: { total: 0, ready: 0, unready: 0 },
15
+ daemonSets: { total: 0, ready: 0, unready: 0 },
16
+ services: 0,
17
+ ingresses: 0,
18
+ nodes: { total: 0, ready: 0, notReady: 0, cordoned: 0 },
19
+ namespaces: 0,
20
+ jobs: { total: 0, active: 0, succeeded: 0, failed: 0 },
21
+ cronJobs: { total: 0, active: 0, suspended: 0 },
22
+ configMaps: 0,
23
+ secrets: 0,
24
+ pvcs: { total: 0, bound: 0, pending: 0, unbound: 0 },
25
+ ...overrides,
26
+ };
27
+ }
28
+
29
+ function render(c: DashboardResourceCounts): string {
30
+ return renderToString(
31
+ <ClusterHealthCard
32
+ health={{ healthy: 0, warning: 0, error: 0, warningEvents: 0 }}
33
+ counts={c}
34
+ cluster={{ name: "test", platform: "", version: "", connected: true }}
35
+ metrics={null}
36
+ metricsServerAvailable={false}
37
+ issueCount={0}
38
+ hasCriticalIssues={false}
39
+ nodeVersionSkew={null}
40
+ onNavigateToKind={() => {}}
41
+ onNavigateToView={() => {}}
42
+ />,
43
+ );
44
+ }
45
+
46
+ describe("ClusterHealthCard restricted counts", () => {
47
+ it("shows the restricted Nodes ring instead of a zero ring", () => {
48
+ const html = render(counts({ restricted: ["nodes"] }));
49
+ expect(html).toMatch(/Nodes<\/span><span[^>]*>Restricted/);
50
+ expect(html).not.toContain("0 ready");
51
+ });
52
+
53
+ it("blames Node access, not metrics-server, for missing CPU and memory", () => {
54
+ expect(render(counts({ restricted: ["nodes"] }))).toContain("CPU and memory need permission to list Nodes");
55
+ expect(render(counts({ restricted: ["nodes"] }))).not.toContain("metrics-server");
56
+ expect(render(counts({}))).toContain("metrics-server");
57
+ });
58
+
59
+ it("marks a namespace count Radar could not list as a lower bound", () => {
60
+ const html = render(counts({ namespaces: 15, restricted: ["namespaces"] }));
61
+ expect(html).toContain("≥");
62
+ expect(html).toMatch(/>15<\/span> (<!-- -->)?namespaces/);
63
+ });
64
+
65
+ it("says restricted rather than zero when no namespace is known", () => {
66
+ const html = render(counts({ restricted: ["namespaces"] }));
67
+ expect(html).toContain("Namespaces restricted");
68
+ expect(html).not.toMatch(/>0<\/span> (<!-- -->)?namespaces/);
69
+ });
70
+
71
+ it("keeps an exact namespace count unmarked", () => {
72
+ const html = render(counts({ namespaces: 111 }));
73
+ expect(html).toMatch(/>111<\/span> namespaces/);
74
+ expect(html).not.toContain("≥");
75
+ });
76
+ });
@@ -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 } 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'
@@ -273,7 +273,7 @@ export function ClusterHealthCard({
273
273
  />
274
274
  )}
275
275
  {radarVersion}
276
- <span><span className="font-mono">{counts.namespaces}</span> namespaces</span>
276
+ <NamespaceCountLine count={counts.namespaces} restricted={isRestricted('namespaces')} />
277
277
  </div>
278
278
  {freshness && <div className="mt-2">{freshness}</div>}
279
279
  {nodeVersionSkew && (
@@ -303,7 +303,7 @@ export function ClusterHealthCard({
303
303
  (org-wide endpoint, PAT-authed) rather than per-cluster, so this
304
304
  localhost/no-auth entry would mislead a Cloud user. */}
305
305
  {showLocalMcpCard && (
306
- <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
306
+ <HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} httpTools={caps.mcpHttpTools} helmTools={caps.mcpHelmTools} applicationEvidenceAvailable={caps.mcpApplicationEvidence} />
307
307
  )}
308
308
  </div>
309
309
 
@@ -440,9 +440,15 @@ export function ClusterHealthCard({
440
440
  />
441
441
  </div>
442
442
  )}
443
- {!metricsServerAvailable && (
443
+ {!metricsServerAvailable && (isRestricted('nodes') ? (
444
+ // Capacity comes from Nodes, so installing metrics-server wouldn't help.
445
+ <span className="flex items-center gap-1.5 text-xs text-theme-text-tertiary">
446
+ <Shield className="w-3 h-3 shrink-0" />
447
+ <span>CPU and memory need permission to list Nodes</span>
448
+ </span>
449
+ ) : (
444
450
  <MetricsUnavailableHint platform={cluster.platform} metricsServerAvailable={metricsServerAvailable} />
445
- )}
451
+ ))}
446
452
  </div>
447
453
 
448
454
  </div>
@@ -566,6 +572,23 @@ function KubernetesVersionLine({
566
572
  )
567
573
  }
568
574
 
575
+ // A restricted count covers only the namespaces Radar reads, so it is a lower
576
+ // bound, and zero means unknown rather than none.
577
+ export function NamespaceCountLine({ count, restricted }: { count: number; restricted: boolean }) {
578
+ if (!restricted) {
579
+ return <span><span className="font-mono">{count}</span> namespaces</span>
580
+ }
581
+ if (count === 0) {
582
+ return <span>Namespaces restricted</span>
583
+ }
584
+ return (
585
+ <span className="flex items-center gap-1">
586
+ <CertaintyGlyph certainty="lower_bound" title="Namespaces can't be listed here, so this counts only the ones in view. The cluster may have more." />
587
+ <span><span className="font-mono">{count}</span> {count === 1 ? 'namespace' : 'namespaces'}</span>
588
+ </span>
589
+ )
590
+ }
591
+
569
592
  function RestrictedRing({ label }: { label: string }) {
570
593
  const radius = 36
571
594
  const circumference = 2 * Math.PI * radius
@@ -1,7 +1,8 @@
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'
5
6
 
6
7
  interface HelmSummaryProps {
7
8
  data?: DashboardHelmSummary
@@ -40,7 +41,18 @@ function getHealthDot(health?: string): string {
40
41
  }
41
42
  }
42
43
 
44
+ // What the card is missing when Helm's records couldn't be read in some
45
+ // namespaces. The Helm view still lists those releases from their objects.
46
+ export function unreadHelmNamespacesLine(unread: DashboardHelmSummary['unreadNamespaces']): string | null {
47
+ if (!unread) return null
48
+ if (unread.extent) return 'Helm’s records weren’t read in some namespaces. Open Helm for releases there.'
49
+ const where = unread.names?.length === 1 ? unread.names[0] : `${unread.count} namespaces`
50
+ return `Helm’s records weren’t read in ${where}. Open Helm for releases there.`
51
+ }
52
+
43
53
  export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
54
+ const observedView = useRadarFeature('helmInventory').support === 'supported'
55
+ const unreadLine = unreadHelmNamespacesLine(data?.unreadNamespaces)
44
56
  return (
45
57
  <button
46
58
  onClick={onNavigate}
@@ -79,8 +91,8 @@ export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
79
91
  ) : data.restricted ? (
80
92
  <div className="flex flex-col items-center justify-center h-full py-4 text-theme-text-tertiary">
81
93
  <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>
94
+ <span className="text-xs font-medium text-theme-text-secondary">{observedView ? 'Helm’s records are restricted' : 'Access Restricted'}</span>
95
+ <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
96
  </div>
85
97
  ) : data.error ? (
86
98
  <div className="flex flex-col items-center justify-center h-full py-4 text-theme-text-tertiary">
@@ -98,7 +110,7 @@ export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
98
110
  </div>
99
111
  ) : !data.releases || data.releases.length === 0 ? (
100
112
  <div className="flex items-center justify-center h-full py-4 text-xs text-theme-text-tertiary">
101
- No Helm releases found
113
+ {unreadLine ? 'No Helm releases where Radar could read Helm’s records' : 'No Helm releases found'}
102
114
  </div>
103
115
  ) : (
104
116
  <div className="divide-y divide-theme-border">
@@ -128,6 +140,13 @@ export function HelmSummary({ data, onNavigate }: HelmSummaryProps) {
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,10 +354,29 @@ 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. 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
381
  { arg: 'action', required: true, desc: 'restart, scale, or rollback' },
342
382
  { arg: 'kind', required: true, desc: 'deployment, statefulset, daemonset, or rollout' },
@@ -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
 
@@ -4,6 +4,7 @@ import { RadarFeatureUnsupportedError } from '../../../api/radarFeatures'
4
4
  import { ServiceRenderer } from './ServiceRenderer'
5
5
 
6
6
  const mock = vi.hoisted(() => ({
7
+ local: true,
7
8
  serviceQuery: {} as any,
8
9
  namespaceQuery: {} as any,
9
10
  serviceReads: [] as any[],
@@ -13,9 +14,9 @@ vi.mock('../../../api/client', () => ({
13
14
  useServiceEndpointSlices: (...args: any[]) => { mock.serviceReads.push(args); return mock.serviceQuery },
14
15
  useResources: (...args: any[]) => { mock.namespaceReads.push(args); return mock.namespaceQuery },
15
16
  }))
16
- vi.mock('../../../contexts/CapabilitiesContext', () => ({ useNamespacedCapabilities: () => ({ canPortForward: false }), useIsLocalDeployment: () => true }))
17
+ vi.mock('../../../contexts/CapabilitiesContext', () => ({ useNamespacedCapabilities: () => ({ canPortForward: false }), useIsLocalDeployment: () => mock.local }))
17
18
  vi.mock('../../portforward/PortForwardButton', () => ({ PortForwardInlineButton: () => null }))
18
- vi.mock('../../curl/ServiceCurlButton', () => ({ CurlButton: () => null, CurlPanel: () => null, isHttpishPort: () => false, defaultScheme: () => '', defaultPathForPort: () => '' }))
19
+ vi.mock('../../curl/ServiceCurlButton', () => ({ CurlButton: () => <button>Service curl</button>, CurlPanel: () => null, isHttpishPort: () => true, defaultScheme: () => '', defaultPathForPort: () => '' }))
19
20
 
20
21
  const service = { apiVersion: 'v1', kind: 'Service', metadata: { name: 'web', namespace: 'team' }, spec: { selector: { app: 'web' } } }
21
22
  const selectorless = { ...service, spec: {} }
@@ -24,6 +25,7 @@ const render = (data: any = service) => renderToStaticMarkup(<ServiceRenderer da
24
25
  const unsupported = () => new RadarFeatureUnsupportedError('serviceEndpointSlices', { currentVersion: 'v1.7.0' })
25
26
 
26
27
  beforeEach(() => {
28
+ mock.local = true
27
29
  mock.serviceQuery = {}
28
30
  mock.namespaceQuery = {}
29
31
  mock.serviceReads = []
@@ -79,3 +81,14 @@ it('keeps selector Services free of slice lookups on an older Radar', () => {
79
81
  expect(mock.namespaceReads[0][3].enabled).toBe(false)
80
82
  expect(html).not.toContain('EndpointSlices')
81
83
  })
84
+
85
+ it('preserves in-cluster UI curl for all Service types', () => {
86
+ mock.local = false
87
+ const ports = [{ port: 80, name: 'http', protocol: 'TCP' }]
88
+ expect(render({ ...service, spec: { ...service.spec, ports } })).toContain('Service curl')
89
+ expect(render({ ...service, spec: { ports } })).toContain('Service curl')
90
+ expect(render({ ...service, spec: { type: 'ExternalName', externalName: 'example.org', ports } })).toContain('Service curl')
91
+ expect(render({ ...service, spec: { ...service.spec, clusterIP: 'None', ports } })).toContain('Service curl')
92
+ mock.local = true
93
+ expect(render({ ...service, spec: { ...service.spec, ports } })).not.toContain('Service curl')
94
+ })
@@ -26,7 +26,6 @@ export function ServiceRenderer({ data, onCopy, copied, onNavigate }: ServiceRen
26
26
  const showPortForward = canPortForward || !isLocal
27
27
  // Curl dials the Service directly from in-cluster, so it's only available when
28
28
  // Radar runs in-cluster/Cloud — locally you'd port-forward instead.
29
- const showCurl = !isLocal
30
29
  // Which port's inline curl panel is open (one at a time). `closing` keeps the
31
30
  // panel mounted through its collapse animation before we drop it.
32
31
  const [curl, setCurl] = useState<{ port: number; closing: boolean } | null>(null)
@@ -38,6 +37,7 @@ export function ServiceRenderer({ data, onCopy, copied, onNavigate }: ServiceRen
38
37
  }, [])
39
38
  const spec = data.spec || {}
40
39
  const hasNoSelector = !spec.selector || Object.keys(spec.selector).length === 0
40
+ const showCurl = !isLocal
41
41
  const canListEndpointSlices = Boolean(namespace && serviceName && spec.type !== 'ExternalName')
42
42
  const serviceSlices = useServiceEndpointSlices(namespace, serviceName, canListEndpointSlices)
43
43
  // A Radar without the per-Service endpoint keeps its earlier behavior: only