@skyhook-io/radar-app 1.8.7 → 1.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/App.tsx +69 -61
- package/src/RadarApp.tsx +15 -1
- package/src/api/apiResources.ts +1 -1
- package/src/api/client.argoResourceSync.test.ts +69 -0
- package/src/api/client.rightsizing.test.ts +32 -0
- package/src/api/client.ts +1222 -244
- package/src/api/timelineSource.ts +4 -2
- package/src/components/applications/ApplicationsView.tsx +613 -219
- package/src/components/cost/ApplicationCostTab.test.ts +204 -0
- package/src/components/cost/ApplicationCostTab.tsx +571 -0
- package/src/components/cost/CostTrendChart.tsx +103 -72
- package/src/components/cost/CostView.test.ts +12 -0
- package/src/components/cost/CostView.tsx +494 -229
- package/src/components/cost/CostViewTabs.test.tsx +21 -0
- package/src/components/cost/CostViewTabs.tsx +40 -0
- package/src/components/cost/CurrentAllocationUse.test.ts +21 -0
- package/src/components/cost/CurrentAllocationUse.tsx +126 -0
- package/src/components/cost/WorkloadCostTab.test.ts +153 -0
- package/src/components/cost/WorkloadCostTab.tsx +372 -0
- package/src/components/cost/cloud-console.test.ts +39 -0
- package/src/components/cost/cloud-console.ts +81 -0
- package/src/components/cost/errors.ts +8 -0
- package/src/components/cost/format.test.ts +27 -0
- package/src/components/cost/format.ts +46 -0
- package/src/components/cost/kinds.ts +5 -0
- package/src/components/diagnose/AISettings.tsx +7 -12
- package/src/components/diagnose/DiagnoseContext.tsx +1 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +3 -0
- package/src/components/diagnose/InvestigationView.tsx +16 -3
- package/src/components/diagnose/parts.tsx +140 -73
- package/src/components/gitops/ArgoResourceDiffLoader.tsx +23 -0
- package/src/components/gitops/GitOpsView.tsx +81 -14
- package/src/components/gitops/RevisionMetaChip.tsx +63 -0
- package/src/components/helm/HelmCompareRoute.tsx +1 -2
- package/src/components/helm/ManifestDiffViewer.tsx +1 -31
- package/src/components/helm/ValuesDiffPreview.tsx +2 -3
- package/src/components/home/CostCard.tsx +21 -36
- package/src/components/resource/RightsizingStrip.test.ts +109 -0
- package/src/components/resource/RightsizingStrip.tsx +319 -123
- package/src/components/rightsizing/RightsizingScanView.tsx +938 -0
- package/src/components/rightsizing/copy.test.ts +56 -0
- package/src/components/rightsizing/model.test.ts +227 -0
- package/src/components/rightsizing/model.ts +158 -0
- package/src/components/rightsizing/presentation.test.ts +104 -0
- package/src/components/rightsizing/presentation.ts +94 -0
- package/src/components/settings/MyPermissionsDialog.tsx +66 -116
- package/src/components/settings/SettingsDialog.tsx +1268 -318
- package/src/components/timeline/TimelineList.tsx +35 -8
- package/src/components/timeline/TimelineView.tsx +156 -26
- package/src/components/timeline/TimelineView.urlparams.test.ts +43 -2
- package/src/components/workload/WorkloadView.tsx +711 -328
- package/src/context/DiagnoseCustomization.tsx +36 -2
- package/src/index.css +5 -1
- package/src/index.ts +4 -1
- package/src/main.tsx +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// Slot-based injection of a resource-level "Diagnose" action
|
|
1
|
+
// Slot-based injection of a resource-level "Diagnose" action, and of the
|
|
2
|
+
// consent card's trust copy.
|
|
2
3
|
//
|
|
3
4
|
// Lets an embedding host (e.g. Radar Hub) inject a "Diagnose with AI" button
|
|
4
5
|
// into every resource detail action bar — without forking WorkloadView or the
|
|
@@ -21,18 +22,47 @@ export type RenderDiagnoseAction = (ctx: {
|
|
|
21
22
|
health?: "problem" | "healthy" | "unknown";
|
|
22
23
|
}) => ReactNode;
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Trust copy for the first-run consent card.
|
|
27
|
+
*
|
|
28
|
+
* The card makes concrete, checkable claims about *where* the agent runs,
|
|
29
|
+
* *whose* model account it bills, and *where* the transcript is stored. Those
|
|
30
|
+
* claims are only true of OSS's bring-your-own-local-CLI agent. A host that
|
|
31
|
+
* runs the agent anywhere else (Radar Cloud runs it as a sandboxed Job under a
|
|
32
|
+
* managed key) MUST supply its own copy — shipping OSS's over a different data
|
|
33
|
+
* flow states the opposite of what happens.
|
|
34
|
+
*
|
|
35
|
+
* Radar owns the card's chrome (icon, layout, Approve/Cancel) either way; a
|
|
36
|
+
* host only replaces the claims.
|
|
37
|
+
*/
|
|
38
|
+
export type DiagnoseConsentCopy = {
|
|
39
|
+
title: string;
|
|
40
|
+
body: ReactNode;
|
|
41
|
+
/** Detail list under the body; each entry is rendered as its own "•" row. */
|
|
42
|
+
bullets?: ReactNode[];
|
|
43
|
+
/** Label for the settings link. `null` hides it — for hosts with one fixed
|
|
44
|
+
* agent and no isolation choice, where it would open an empty dialog. */
|
|
45
|
+
settingsLabel?: string | null;
|
|
46
|
+
approveLabel?: string;
|
|
47
|
+
};
|
|
48
|
+
|
|
24
49
|
const DiagnoseCustomizationContext = createContext<RenderDiagnoseAction | undefined>(undefined);
|
|
50
|
+
const DiagnoseConsentCopyContext = createContext<DiagnoseConsentCopy | undefined>(undefined);
|
|
25
51
|
|
|
26
52
|
export function DiagnoseCustomizationProvider({
|
|
27
53
|
value,
|
|
54
|
+
consentCopy,
|
|
28
55
|
children,
|
|
29
56
|
}: {
|
|
30
57
|
value: RenderDiagnoseAction | undefined;
|
|
58
|
+
consentCopy?: DiagnoseConsentCopy;
|
|
31
59
|
children: ReactNode;
|
|
32
60
|
}) {
|
|
33
61
|
return (
|
|
34
62
|
<DiagnoseCustomizationContext.Provider value={value}>
|
|
35
|
-
{
|
|
63
|
+
<DiagnoseConsentCopyContext.Provider value={consentCopy}>
|
|
64
|
+
{children}
|
|
65
|
+
</DiagnoseConsentCopyContext.Provider>
|
|
36
66
|
</DiagnoseCustomizationContext.Provider>
|
|
37
67
|
);
|
|
38
68
|
}
|
|
@@ -40,3 +70,7 @@ export function DiagnoseCustomizationProvider({
|
|
|
40
70
|
export function useDiagnoseCustomization(): RenderDiagnoseAction | undefined {
|
|
41
71
|
return useContext(DiagnoseCustomizationContext);
|
|
42
72
|
}
|
|
73
|
+
|
|
74
|
+
export function useDiagnoseConsentCopy(): DiagnoseConsentCopy | undefined {
|
|
75
|
+
return useContext(DiagnoseConsentCopyContext);
|
|
76
|
+
}
|
package/src/index.css
CHANGED
|
@@ -81,7 +81,11 @@ body {
|
|
|
81
81
|
color: var(--text-primary);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
#
|
|
84
|
+
/* App-shell layout for standalone Radar (mounts into #radar — see index.html).
|
|
85
|
+
Keyed off #radar, NOT #root: this file ships as the published library
|
|
86
|
+
stylesheet, so a #root rule here would match a host app's own #root and
|
|
87
|
+
reshape its document. A unique id can't collide — host apps have no #radar. */
|
|
88
|
+
#radar {
|
|
85
89
|
height: 100vh;
|
|
86
90
|
display: flex;
|
|
87
91
|
flex-direction: column;
|
package/src/index.ts
CHANGED
|
@@ -26,7 +26,10 @@ export type {
|
|
|
26
26
|
TimelineCoverageSpan,
|
|
27
27
|
TimelineOverviewResult,
|
|
28
28
|
} from './api/timelineSource';
|
|
29
|
-
export type {
|
|
29
|
+
export type {
|
|
30
|
+
RenderDiagnoseAction,
|
|
31
|
+
DiagnoseConsentCopy,
|
|
32
|
+
} from './context/DiagnoseCustomization';
|
|
30
33
|
export { ShortcutHelpOverlay } from './components/ui/ShortcutHelpOverlay';
|
|
31
34
|
|
|
32
35
|
// Shared cluster-switcher primitive — re-exported from @skyhook-io/k8s-ui so
|
package/src/main.tsx
CHANGED
|
@@ -159,7 +159,7 @@ window.addEventListener('mouseup', (e: MouseEvent) => {
|
|
|
159
159
|
// tab, so it opts into per-view document.title. Library consumers (e.g.
|
|
160
160
|
// radar-hub-web) render <RadarApp apiBase="..." basename="..." /> WITHOUT this
|
|
161
161
|
// flag, keeping their own tab title.
|
|
162
|
-
ReactDOM.createRoot(document.getElementById('
|
|
162
|
+
ReactDOM.createRoot(document.getElementById('radar')!).render(
|
|
163
163
|
<React.StrictMode>
|
|
164
164
|
<RadarApp manageDocumentTitle />
|
|
165
165
|
</React.StrictMode>
|