@hansenexus/hud 0.1.1 → 0.3.0
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/README.md +106 -25
- package/dist/define-hud-BHQR8Lbv.d.ts +31 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +1198 -0
- package/dist/next.d.ts +48 -0
- package/dist/next.js +77 -0
- package/dist/plugins/vitals.d.ts +25 -0
- package/dist/plugins/vitals.js +109 -0
- package/dist/plugins-1QmTmZyL.d.ts +76 -0
- package/dist/plugins-CzUiTn_r.js +68 -0
- package/dist/server.d.ts +39 -0
- package/dist/server.js +106 -0
- package/package.json +55 -133
- package/chunk-20zke7cs.js +0 -574
- package/chunk-24vrg16w.js +0 -39
- package/chunk-50pq4sg6.js +0 -41
- package/chunk-5gtx3pza.js +0 -9
- package/chunk-6cdpasm9.js +0 -79
- package/chunk-6jt8yg4m.js +0 -117
- package/chunk-6ngkpwz7.js +0 -127
- package/chunk-71se605m.js +0 -85
- package/chunk-82nm9wcg.js +0 -316
- package/chunk-9hw5r9y1.js +0 -67
- package/chunk-c5y856ad.js +0 -98
- package/chunk-edq4jqch.js +0 -89
- package/chunk-emfnvz4p.js +0 -166
- package/chunk-h0hmjdqa.js +0 -264
- package/chunk-hc2g0n35.js +0 -24
- package/chunk-hex3wqag.js +0 -179
- package/chunk-kvxve0hx.js +0 -140
- package/chunk-kyeb6qeq.js +0 -95
- package/chunk-mz55rvw3.js +0 -172
- package/chunk-nm82wr8r.js +0 -58
- package/chunk-q15xwpy8.js +0 -48
- package/chunk-q96mkjve.js +0 -68
- package/chunk-tczzx083.js +0 -26
- package/chunk-tf774c4w.js +0 -115
- package/chunk-v086j53b.js +0 -19
- package/chunk-vjh0d29g.js +0 -52
- package/chunk-xezxydm3.js +0 -47
- package/chunk-xztw0xyt.js +0 -113
- package/chunk-yn1d38pb.js +0 -172
- package/core/access.d.mts +0 -53
- package/core/access.js +0 -27
- package/core/api-types.d.mts +0 -146
- package/core/api-types.js +0 -9
- package/core/capabilities.d.mts +0 -27
- package/core/capabilities.js +0 -14
- package/core/capture-buffer.d.mts +0 -37
- package/core/capture-buffer.js +0 -9
- package/core/force-state.d.mts +0 -68
- package/core/force-state.js +0 -21
- package/core/mock-cookie.d.mts +0 -30
- package/core/mock-cookie.js +0 -15
- package/core/types.d.mts +0 -59
- package/core/types.js +0 -9
- package/hud-provider.d.mts +0 -38
- package/hud-provider.js +0 -15
- package/hud.d.mts +0 -15
- package/hud.js +0 -18
- package/index.d.mts +0 -94
- package/index.js +0 -170
- package/lazy-panel.d.mts +0 -28
- package/lazy-panel.js +0 -11
- package/panels/cicd-panel.d.mts +0 -9
- package/panels/cicd-panel.js +0 -13
- package/panels/debug-info-panel.d.mts +0 -21
- package/panels/debug-info-panel.js +0 -9
- package/panels/dispatch-panel.d.mts +0 -10
- package/panels/dispatch-panel.js +0 -14
- package/panels/env-info-panel.d.mts +0 -9
- package/panels/env-info-panel.js +0 -12
- package/panels/feature-flags-panel.d.mts +0 -26
- package/panels/feature-flags-panel.js +0 -9
- package/panels/force-state-panel.d.mts +0 -11
- package/panels/force-state-panel.js +0 -113
- package/panels/info-row.d.mts +0 -21
- package/panels/info-row.js +0 -14
- package/panels/mock-seed-panel.d.mts +0 -15
- package/panels/mock-seed-panel.js +0 -14
- package/panels/network-console-panel.d.mts +0 -6
- package/panels/network-console-panel.js +0 -9
- package/panels/role-switcher-panel.d.mts +0 -28
- package/panels/role-switcher-panel.js +0 -9
- package/panels/sessions-panel.d.mts +0 -6
- package/panels/sessions-panel.js +0 -13
- package/panels/tokens-panel.d.mts +0 -38
- package/panels/tokens-panel.js +0 -9
- package/panels/unlock-panel.d.mts +0 -33
- package/panels/unlock-panel.js +0 -14
- package/panels/variants-panel.d.mts +0 -51
- package/panels/variants-panel.js +0 -12
- package/panels/vitals-panel.d.mts +0 -11
- package/panels/vitals-panel.js +0 -15
- package/server/guard.d.mts +0 -42
- package/server/guard.js +0 -12
- package/server/unlock.d.mts +0 -28
- package/server/unlock.js +0 -108
- package/state-boundary.d.mts +0 -25
- package/state-boundary.js +0 -54
package/chunk-kvxve0hx.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
hudRequiresUnlock
|
|
3
|
-
} from "./chunk-6cdpasm9.js";
|
|
4
|
-
import {
|
|
5
|
-
PanelSection
|
|
6
|
-
} from "./chunk-kyeb6qeq.js";
|
|
7
|
-
import {
|
|
8
|
-
Button
|
|
9
|
-
} from "./chunk-xztw0xyt.js";
|
|
10
|
-
|
|
11
|
-
// panels/unlock-panel.tsx
|
|
12
|
-
import { Lock, ShieldAlert } from "lucide-react";
|
|
13
|
-
import { useCallback, useEffect, useState } from "react";
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
"use client";
|
|
16
|
-
function useHudUnlock(apiBase, access) {
|
|
17
|
-
const required = hudRequiresUnlock(access);
|
|
18
|
-
const [state, setState] = useState(required ? "checking" : "unlocked");
|
|
19
|
-
const [error, setError] = useState(null);
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (!required) {
|
|
22
|
-
setState("unlocked");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
let cancelled = false;
|
|
26
|
-
(async () => {
|
|
27
|
-
try {
|
|
28
|
-
const res = await fetch(`${apiBase}/unlock`, { cache: "no-store" });
|
|
29
|
-
const body = await res.json().catch(() => ({}));
|
|
30
|
-
if (cancelled)
|
|
31
|
-
return;
|
|
32
|
-
if (body.configured === false)
|
|
33
|
-
setState("unconfigured");
|
|
34
|
-
else
|
|
35
|
-
setState(body.unlocked ? "unlocked" : "locked");
|
|
36
|
-
} catch {
|
|
37
|
-
if (!cancelled)
|
|
38
|
-
setState("locked");
|
|
39
|
-
}
|
|
40
|
-
})();
|
|
41
|
-
return () => {
|
|
42
|
-
cancelled = true;
|
|
43
|
-
};
|
|
44
|
-
}, [apiBase, required]);
|
|
45
|
-
const unlock = useCallback(async (password) => {
|
|
46
|
-
setError(null);
|
|
47
|
-
try {
|
|
48
|
-
const res = await fetch(`${apiBase}/unlock`, {
|
|
49
|
-
method: "POST",
|
|
50
|
-
headers: { "Content-Type": "application/json" },
|
|
51
|
-
body: JSON.stringify({ password })
|
|
52
|
-
});
|
|
53
|
-
const body = await res.json().catch(() => ({}));
|
|
54
|
-
if (res.ok && body.unlocked) {
|
|
55
|
-
setState("unlocked");
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
setError(body.error ?? "unlock refused");
|
|
59
|
-
} catch (cause) {
|
|
60
|
-
setError(cause instanceof Error ? cause.message : "unlock failed");
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
}, [apiBase]);
|
|
64
|
-
return { state, error, unlock };
|
|
65
|
-
}
|
|
66
|
-
function HudUnlockPanel({ env, state, error, onUnlock }) {
|
|
67
|
-
const [password, setPassword] = useState("");
|
|
68
|
-
const [submitting, setSubmitting] = useState(false);
|
|
69
|
-
async function handleSubmit(event) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
if (!password || submitting)
|
|
72
|
-
return;
|
|
73
|
-
setSubmitting(true);
|
|
74
|
-
const ok = await onUnlock(password);
|
|
75
|
-
setSubmitting(false);
|
|
76
|
-
if (ok)
|
|
77
|
-
setPassword("");
|
|
78
|
-
}
|
|
79
|
-
if (state === "unconfigured") {
|
|
80
|
-
return /* @__PURE__ */ jsx("div", {
|
|
81
|
-
className: "space-y-3 p-3",
|
|
82
|
-
children: /* @__PURE__ */ jsx(PanelSection, {
|
|
83
|
-
icon: ShieldAlert,
|
|
84
|
-
title: "hud locked",
|
|
85
|
-
children: /* @__PURE__ */ jsxs("p", {
|
|
86
|
-
className: "px-2 text-[11px] leading-relaxed text-muted-foreground",
|
|
87
|
-
children: [
|
|
88
|
-
"No ",
|
|
89
|
-
/* @__PURE__ */ jsx("code", {
|
|
90
|
-
className: "font-mono",
|
|
91
|
-
children: "HUD_ACCESS_PASSWORD"
|
|
92
|
-
}),
|
|
93
|
-
" is configured for this deployment, so the hud cannot be unlocked here. Set it from the app's 1Password item and restart the pod."
|
|
94
|
-
]
|
|
95
|
-
})
|
|
96
|
-
})
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return /* @__PURE__ */ jsx("div", {
|
|
100
|
-
className: "space-y-3 p-3",
|
|
101
|
-
children: /* @__PURE__ */ jsxs(PanelSection, {
|
|
102
|
-
icon: Lock,
|
|
103
|
-
title: `hud locked · ${env}`,
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ jsx("p", {
|
|
106
|
-
className: "px-2 text-[11px] leading-relaxed text-muted-foreground",
|
|
107
|
-
children: env === "production" ? "Production is observe-only: vitals, logs and CI state, nothing that writes. The unlock lasts 2 hours." : "Enter the deployment's hud password to open the panels. The unlock lasts 12 hours."
|
|
108
|
-
}),
|
|
109
|
-
/* @__PURE__ */ jsxs("form", {
|
|
110
|
-
className: "flex items-center gap-2 px-2 pt-1",
|
|
111
|
-
onSubmit: handleSubmit,
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ jsx("input", {
|
|
114
|
-
type: "password",
|
|
115
|
-
autoComplete: "off",
|
|
116
|
-
value: password,
|
|
117
|
-
onChange: (event) => setPassword(event.target.value),
|
|
118
|
-
placeholder: "hud password",
|
|
119
|
-
"aria-label": "hud password",
|
|
120
|
-
className: "h-7 flex-1 rounded border bg-background px-2 font-mono text-[11px] outline-none focus:ring-1 focus:ring-ring"
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ jsx(Button, {
|
|
123
|
-
type: "submit",
|
|
124
|
-
size: "sm",
|
|
125
|
-
className: "h-7 text-[11px]",
|
|
126
|
-
disabled: !password || submitting,
|
|
127
|
-
children: submitting ? "Checking…" : "Unlock"
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
}),
|
|
131
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
132
|
-
className: "px-2 text-[10px] text-destructive",
|
|
133
|
-
children: error
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export { useHudUnlock, HudUnlockPanel };
|
package/chunk-kyeb6qeq.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button
|
|
3
|
-
} from "./chunk-xztw0xyt.js";
|
|
4
|
-
|
|
5
|
-
// panels/info-row.tsx
|
|
6
|
-
import { Copy } from "lucide-react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
"use client";
|
|
9
|
-
function PanelSection({
|
|
10
|
-
icon: Icon,
|
|
11
|
-
title,
|
|
12
|
-
children
|
|
13
|
-
}) {
|
|
14
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
-
children: [
|
|
16
|
-
/* @__PURE__ */ jsxs("h4", {
|
|
17
|
-
className: "mb-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",
|
|
18
|
-
children: [
|
|
19
|
-
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
20
|
-
className: "h-3 w-3"
|
|
21
|
-
}),
|
|
22
|
-
title
|
|
23
|
-
]
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx("div", {
|
|
26
|
-
className: "space-y-1.5",
|
|
27
|
-
children
|
|
28
|
-
})
|
|
29
|
-
]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function InfoRow({
|
|
33
|
-
label,
|
|
34
|
-
value,
|
|
35
|
-
copyable = false
|
|
36
|
-
}) {
|
|
37
|
-
function handleCopy() {
|
|
38
|
-
navigator.clipboard.writeText(value);
|
|
39
|
-
}
|
|
40
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
41
|
-
className: "flex items-center justify-between px-2 py-1 hover:bg-muted/50",
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ jsx("span", {
|
|
44
|
-
className: "text-[10px] text-muted-foreground",
|
|
45
|
-
children: label
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ jsxs("div", {
|
|
48
|
-
className: "flex items-center gap-1",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx("span", {
|
|
51
|
-
className: "max-w-[220px] truncate font-mono text-[10px]",
|
|
52
|
-
children: value
|
|
53
|
-
}),
|
|
54
|
-
copyable && /* @__PURE__ */ jsx(Button, {
|
|
55
|
-
variant: "ghost",
|
|
56
|
-
size: "icon",
|
|
57
|
-
className: "h-4 w-4 shrink-0",
|
|
58
|
-
onClick: handleCopy,
|
|
59
|
-
children: /* @__PURE__ */ jsx(Copy, {
|
|
60
|
-
className: "h-2.5 w-2.5"
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function ShortcutRow({ keys, label }) {
|
|
69
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
70
|
-
className: "flex items-center justify-between px-2 py-1",
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ jsx("span", {
|
|
73
|
-
className: "text-[10px] text-muted-foreground",
|
|
74
|
-
children: label
|
|
75
|
-
}),
|
|
76
|
-
/* @__PURE__ */ jsx("div", {
|
|
77
|
-
className: "flex gap-0.5",
|
|
78
|
-
children: keys.map((key) => /* @__PURE__ */ jsx("kbd", {
|
|
79
|
-
className: "flex h-5 min-w-[20px] items-center justify-center rounded border bg-muted/50 px-1 font-mono text-[10px]",
|
|
80
|
-
children: key
|
|
81
|
-
}, key))
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function LoadingSpinner() {
|
|
87
|
-
return /* @__PURE__ */ jsx("div", {
|
|
88
|
-
className: "flex items-center justify-center py-8",
|
|
89
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
90
|
-
className: "h-5 w-5 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"
|
|
91
|
-
})
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { PanelSection, InfoRow, ShortcutRow, LoadingSpinner };
|
package/chunk-mz55rvw3.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
usePoll
|
|
3
|
-
} from "./chunk-xezxydm3.js";
|
|
4
|
-
import {
|
|
5
|
-
useHud
|
|
6
|
-
} from "./chunk-9hw5r9y1.js";
|
|
7
|
-
import {
|
|
8
|
-
InfoRow,
|
|
9
|
-
LoadingSpinner,
|
|
10
|
-
PanelSection
|
|
11
|
-
} from "./chunk-kyeb6qeq.js";
|
|
12
|
-
import {
|
|
13
|
-
Badge
|
|
14
|
-
} from "./chunk-xztw0xyt.js";
|
|
15
|
-
|
|
16
|
-
// panels/cicd-panel.tsx
|
|
17
|
-
import { GitBranch, Rocket } from "lucide-react";
|
|
18
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
19
|
-
"use client";
|
|
20
|
-
function CicdPanel() {
|
|
21
|
-
const { config } = useHud();
|
|
22
|
-
const apiBase = config.apiBase ?? "/api/hud";
|
|
23
|
-
const { data, error, loading } = usePoll(`${apiBase}/cicd?app=${encodeURIComponent(config.appSlug)}`, 60000);
|
|
24
|
-
if (loading)
|
|
25
|
-
return /* @__PURE__ */ jsx(LoadingSpinner, {});
|
|
26
|
-
if (error) {
|
|
27
|
-
return /* @__PURE__ */ jsxs("p", {
|
|
28
|
-
className: "px-2 text-[10px] text-amber-500",
|
|
29
|
-
children: [
|
|
30
|
-
"hub unreachable — ",
|
|
31
|
-
error
|
|
32
|
-
]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (!data)
|
|
36
|
-
return null;
|
|
37
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
38
|
-
className: "space-y-4",
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsx(PanelSection, {
|
|
41
|
-
icon: Rocket,
|
|
42
|
-
title: `Deployed · ${data.app}`,
|
|
43
|
-
children: data.deployed ? /* @__PURE__ */ jsxs(Fragment, {
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
46
|
-
label: "Image",
|
|
47
|
-
value: data.deployed.image,
|
|
48
|
-
copyable: true
|
|
49
|
-
}),
|
|
50
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
51
|
-
label: "Sha (prod tag)",
|
|
52
|
-
value: data.deployed.sha,
|
|
53
|
-
copyable: true
|
|
54
|
-
}),
|
|
55
|
-
data.deployed.lastGoodTag && /* @__PURE__ */ jsx(InfoRow, {
|
|
56
|
-
label: "last-good-tag",
|
|
57
|
-
value: data.deployed.lastGoodTag
|
|
58
|
-
}),
|
|
59
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
60
|
-
label: "Ready",
|
|
61
|
-
value: data.deployed.ready
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}) : /* @__PURE__ */ jsx("p", {
|
|
65
|
-
className: "px-2 text-[10px] text-muted-foreground/60",
|
|
66
|
-
children: "No deployment found for this app (deploy: false, or namespace mismatch)."
|
|
67
|
-
})
|
|
68
|
-
}),
|
|
69
|
-
/* @__PURE__ */ jsxs(PanelSection, {
|
|
70
|
-
icon: GitBranch,
|
|
71
|
-
title: "Recent runs",
|
|
72
|
-
children: [
|
|
73
|
-
data.githubUnconfigured && /* @__PURE__ */ jsx("p", {
|
|
74
|
-
className: "px-2 text-[10px] text-amber-500",
|
|
75
|
-
children: "GITHUB_TOKEN unset — CI runs missing."
|
|
76
|
-
}),
|
|
77
|
-
/* @__PURE__ */ jsx("div", {
|
|
78
|
-
className: "overflow-x-auto",
|
|
79
|
-
children: /* @__PURE__ */ jsxs("table", {
|
|
80
|
-
className: "w-full text-[10.5px]",
|
|
81
|
-
children: [
|
|
82
|
-
/* @__PURE__ */ jsx("thead", {
|
|
83
|
-
children: /* @__PURE__ */ jsxs("tr", {
|
|
84
|
-
className: "text-left text-[9px] uppercase tracking-wider text-muted-foreground",
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ jsx("th", {
|
|
87
|
-
className: "px-2 py-1 font-medium",
|
|
88
|
-
children: "Run"
|
|
89
|
-
}),
|
|
90
|
-
/* @__PURE__ */ jsx("th", {
|
|
91
|
-
className: "px-2 py-1 font-medium",
|
|
92
|
-
children: "Source"
|
|
93
|
-
}),
|
|
94
|
-
/* @__PURE__ */ jsx("th", {
|
|
95
|
-
className: "px-2 py-1 font-medium",
|
|
96
|
-
children: "Status"
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ jsx("th", {
|
|
99
|
-
className: "px-2 py-1 font-medium",
|
|
100
|
-
children: "Branch"
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
})
|
|
104
|
-
}),
|
|
105
|
-
/* @__PURE__ */ jsx("tbody", {
|
|
106
|
-
children: data.runs.map((run) => /* @__PURE__ */ jsx(RunRow, {
|
|
107
|
-
run
|
|
108
|
-
}, `${run.source}-${run.id}`))
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
})
|
|
112
|
-
}),
|
|
113
|
-
data.runs.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
114
|
-
className: "px-2 text-[10px] text-muted-foreground/60",
|
|
115
|
-
children: "No runs available."
|
|
116
|
-
})
|
|
117
|
-
]
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function runStatusClass(run) {
|
|
123
|
-
const outcome = run.conclusion ?? run.status;
|
|
124
|
-
if (outcome === "success")
|
|
125
|
-
return "text-emerald-500";
|
|
126
|
-
if (outcome === "failure" || outcome === "cancelled")
|
|
127
|
-
return "text-red-500";
|
|
128
|
-
if (run.status === "in_progress" || run.status === "running" || run.status === "waiting") {
|
|
129
|
-
return "text-amber-500";
|
|
130
|
-
}
|
|
131
|
-
return "text-muted-foreground";
|
|
132
|
-
}
|
|
133
|
-
function RunRow({ run }) {
|
|
134
|
-
const title = /* @__PURE__ */ jsx("span", {
|
|
135
|
-
className: "max-w-[260px] truncate font-mono",
|
|
136
|
-
title: run.title,
|
|
137
|
-
children: run.title || run.name
|
|
138
|
-
});
|
|
139
|
-
return /* @__PURE__ */ jsxs("tr", {
|
|
140
|
-
className: "border-t border-border/40 hover:bg-muted/30",
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ jsx("td", {
|
|
143
|
-
className: "px-2 py-1",
|
|
144
|
-
children: run.url ? /* @__PURE__ */ jsx("a", {
|
|
145
|
-
href: run.url,
|
|
146
|
-
target: "_blank",
|
|
147
|
-
rel: "noreferrer",
|
|
148
|
-
className: "hover:underline",
|
|
149
|
-
children: title
|
|
150
|
-
}) : title
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ jsx("td", {
|
|
153
|
-
className: "px-2 py-1",
|
|
154
|
-
children: /* @__PURE__ */ jsx(Badge, {
|
|
155
|
-
variant: "outline",
|
|
156
|
-
className: "h-4 px-1.5 text-[9px] text-muted-foreground",
|
|
157
|
-
children: run.source
|
|
158
|
-
})
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ jsx("td", {
|
|
161
|
-
className: `px-2 py-1 font-mono ${runStatusClass(run)}`,
|
|
162
|
-
children: run.conclusion ?? run.status
|
|
163
|
-
}),
|
|
164
|
-
/* @__PURE__ */ jsx("td", {
|
|
165
|
-
className: "px-2 py-1 font-mono text-muted-foreground",
|
|
166
|
-
children: run.branch ?? "—"
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export { CicdPanel };
|
package/chunk-nm82wr8r.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PanelSection
|
|
3
|
-
} from "./chunk-kyeb6qeq.js";
|
|
4
|
-
|
|
5
|
-
// panels/tokens-panel.tsx
|
|
6
|
-
import { Palette } from "lucide-react";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
"use client";
|
|
10
|
-
function TokensPanel({ adapter }) {
|
|
11
|
-
const { groups, sourceHint } = adapter;
|
|
12
|
-
const [copied, setCopied] = useState(null);
|
|
13
|
-
function copy(cssVar) {
|
|
14
|
-
navigator.clipboard?.writeText(`var(${cssVar})`).catch(() => {});
|
|
15
|
-
setCopied(cssVar);
|
|
16
|
-
window.setTimeout(() => setCopied((prev) => prev === cssVar ? null : prev), 1200);
|
|
17
|
-
}
|
|
18
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
-
className: "space-y-4",
|
|
20
|
-
children: [
|
|
21
|
-
groups.map((group) => {
|
|
22
|
-
const scopeProps = group.scope ? { [group.scope.attribute]: group.scope.value ?? "" } : {};
|
|
23
|
-
return /* @__PURE__ */ jsx("div", {
|
|
24
|
-
...scopeProps,
|
|
25
|
-
children: /* @__PURE__ */ jsx(PanelSection, {
|
|
26
|
-
icon: Palette,
|
|
27
|
-
title: group.label,
|
|
28
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
29
|
-
className: "flex flex-wrap gap-1.5 px-2",
|
|
30
|
-
children: group.tokens.map((token) => /* @__PURE__ */ jsxs("button", {
|
|
31
|
-
type: "button",
|
|
32
|
-
onClick: () => copy(token.cssVar),
|
|
33
|
-
title: `var(${token.cssVar}) — click to copy`,
|
|
34
|
-
className: "group flex w-[104px] flex-col overflow-hidden rounded-md border text-left",
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ jsx("span", {
|
|
37
|
-
className: "block h-8 w-full border-b",
|
|
38
|
-
style: { background: `var(${token.cssVar})` }
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ jsx("span", {
|
|
41
|
-
className: "truncate px-1.5 py-1 font-mono text-[9px] text-muted-foreground group-hover:text-foreground",
|
|
42
|
-
children: copied === token.cssVar ? "copied!" : token.label ?? token.cssVar.replace(/^--[a-z]+-/, "")
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}, token.cssVar))
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
}, group.label);
|
|
49
|
-
}),
|
|
50
|
-
sourceHint && /* @__PURE__ */ jsx("p", {
|
|
51
|
-
className: "px-2 font-mono text-[9.5px] text-muted-foreground/50",
|
|
52
|
-
children: sourceHint
|
|
53
|
-
})
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { TokensPanel };
|
package/chunk-q15xwpy8.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HUD_UNLOCK_COOKIE,
|
|
3
|
-
hudRequiresUnlock,
|
|
4
|
-
hudUnlockTtlMs,
|
|
5
|
-
readCookie,
|
|
6
|
-
resolveHudAccess,
|
|
7
|
-
verifyHudUnlockToken
|
|
8
|
-
} from "./chunk-6cdpasm9.js";
|
|
9
|
-
import {
|
|
10
|
-
hasCapability,
|
|
11
|
-
isHudVisible,
|
|
12
|
-
resolveHudEnv
|
|
13
|
-
} from "./chunk-vjh0d29g.js";
|
|
14
|
-
|
|
15
|
-
// server/guard.ts
|
|
16
|
-
async function checkHudRequest(request, capability) {
|
|
17
|
-
const env = resolveHudEnv();
|
|
18
|
-
if (!isHudVisible(env)) {
|
|
19
|
-
return { ok: false, status: 404, error: "not found" };
|
|
20
|
-
}
|
|
21
|
-
if (!hasCapability(env, capability)) {
|
|
22
|
-
return { ok: false, status: 403, error: `capability ${capability} is denied in ${env}` };
|
|
23
|
-
}
|
|
24
|
-
const access = resolveHudAccess(env);
|
|
25
|
-
if (!hudRequiresUnlock(access)) {
|
|
26
|
-
return { ok: true, env };
|
|
27
|
-
}
|
|
28
|
-
const password = process.env.HUD_ACCESS_PASSWORD;
|
|
29
|
-
if (!password) {
|
|
30
|
-
return { ok: false, status: 401, error: "hud unlock is not configured" };
|
|
31
|
-
}
|
|
32
|
-
const token = readCookie(request.headers.get("cookie"), HUD_UNLOCK_COOKIE);
|
|
33
|
-
const unlocked = await verifyHudUnlockToken(token, password, { ttlMs: hudUnlockTtlMs(access) });
|
|
34
|
-
if (!unlocked) {
|
|
35
|
-
return { ok: false, status: 401, error: "hud is locked" };
|
|
36
|
-
}
|
|
37
|
-
return { ok: true, env };
|
|
38
|
-
}
|
|
39
|
-
async function isHudRequestUnlocked(request) {
|
|
40
|
-
const access = resolveHudAccess();
|
|
41
|
-
if (!hudRequiresUnlock(access))
|
|
42
|
-
return true;
|
|
43
|
-
const password = process.env.HUD_ACCESS_PASSWORD;
|
|
44
|
-
const token = readCookie(request.headers.get("cookie"), HUD_UNLOCK_COOKIE);
|
|
45
|
-
return verifyHudUnlockToken(token, password, { ttlMs: hudUnlockTtlMs(access) });
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { checkHudRequest, isHudRequestUnlocked };
|
package/chunk-q96mkjve.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InfoRow,
|
|
3
|
-
LoadingSpinner,
|
|
4
|
-
PanelSection
|
|
5
|
-
} from "./chunk-kyeb6qeq.js";
|
|
6
|
-
|
|
7
|
-
// panels/debug-info-panel.tsx
|
|
8
|
-
import { Info, Monitor } from "lucide-react";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
"use client";
|
|
11
|
-
function DebugInfoPanel({ user, isLoading = false }) {
|
|
12
|
-
if (isLoading)
|
|
13
|
-
return /* @__PURE__ */ jsx(LoadingSpinner, {});
|
|
14
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
15
|
-
className: "space-y-4",
|
|
16
|
-
children: [
|
|
17
|
-
user && /* @__PURE__ */ jsxs(PanelSection, {
|
|
18
|
-
icon: Info,
|
|
19
|
-
title: "User",
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
22
|
-
label: "Name",
|
|
23
|
-
value: user.name ?? "—"
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
26
|
-
label: "Email",
|
|
27
|
-
value: user.email ?? "—",
|
|
28
|
-
copyable: !!user.email
|
|
29
|
-
}),
|
|
30
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
31
|
-
label: "ID",
|
|
32
|
-
value: user.id ?? "—",
|
|
33
|
-
copyable: !!user.id
|
|
34
|
-
}),
|
|
35
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
36
|
-
label: "Role",
|
|
37
|
-
value: user.role ?? "—"
|
|
38
|
-
}),
|
|
39
|
-
Object.entries(user.extra ?? {}).map(([label, value]) => /* @__PURE__ */ jsx(InfoRow, {
|
|
40
|
-
label,
|
|
41
|
-
value
|
|
42
|
-
}, label))
|
|
43
|
-
]
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ jsxs(PanelSection, {
|
|
46
|
-
icon: Monitor,
|
|
47
|
-
title: "Environment",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
50
|
-
label: "NODE_ENV",
|
|
51
|
-
value: process.env.NODE_ENV ?? "unknown"
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
54
|
-
label: "Convex URL",
|
|
55
|
-
value: process.env.NEXT_PUBLIC_CONVEX_URL ?? "not set",
|
|
56
|
-
copyable: true
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ jsx(InfoRow, {
|
|
59
|
-
label: "Origin",
|
|
60
|
-
value: typeof window !== "undefined" ? window.location.origin : "—"
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
})
|
|
64
|
-
]
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export { DebugInfoPanel };
|
package/chunk-tczzx083.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LoadingSpinner
|
|
3
|
-
} from "./chunk-kyeb6qeq.js";
|
|
4
|
-
import {
|
|
5
|
-
hasCapability,
|
|
6
|
-
resolveHudEnv
|
|
7
|
-
} from "./chunk-vjh0d29g.js";
|
|
8
|
-
|
|
9
|
-
// lazy-panel.tsx
|
|
10
|
-
import { lazy, Suspense } from "react";
|
|
11
|
-
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
"use client";
|
|
13
|
-
function hudLazyPanel(meta, load, env = resolveHudEnv()) {
|
|
14
|
-
if (!hasCapability(env, meta.capability))
|
|
15
|
-
return null;
|
|
16
|
-
const Panel = lazy(async () => ({ default: await load() }));
|
|
17
|
-
return {
|
|
18
|
-
...meta,
|
|
19
|
-
content: /* @__PURE__ */ jsx(Suspense, {
|
|
20
|
-
fallback: /* @__PURE__ */ jsx(LoadingSpinner, {}),
|
|
21
|
-
children: /* @__PURE__ */ jsx(Panel, {})
|
|
22
|
-
})
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { hudLazyPanel };
|