@tangle-network/sandbox-ui 0.23.4 → 0.24.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.
- package/dist/{chunk-AG7QDC2Q.js → chunk-77WVVJA4.js} +118 -35
- package/dist/hooks.d.ts +19 -9
- package/dist/hooks.js +1 -1
- package/dist/index.js +1 -1
- package/dist/pages.d.ts +62 -2
- package/dist/pages.js +836 -649
- package/dist/terminal.d.ts +7 -1
- package/dist/terminal.js +5 -3
- package/package.json +1 -1
package/dist/pages.js
CHANGED
|
@@ -17,11 +17,197 @@ import {
|
|
|
17
17
|
cn
|
|
18
18
|
} from "./chunk-EI44GEQ5.js";
|
|
19
19
|
|
|
20
|
+
// src/pages/auth-page.tsx
|
|
21
|
+
import { useState } from "react";
|
|
22
|
+
import { Logo, TangleKnot } from "@tangle-network/brand";
|
|
23
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
var C = {
|
|
25
|
+
pageBg: "#f7f7f8",
|
|
26
|
+
card: "#ffffff",
|
|
27
|
+
border: "rgba(15, 23, 42, 0.10)",
|
|
28
|
+
text: "#0f172a",
|
|
29
|
+
muted: "#71717a",
|
|
30
|
+
inputBg: "#f5f5f4"
|
|
31
|
+
};
|
|
32
|
+
function GithubIcon() {
|
|
33
|
+
return /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" }) });
|
|
34
|
+
}
|
|
35
|
+
function GoogleIcon() {
|
|
36
|
+
return /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": true, children: [
|
|
37
|
+
/* @__PURE__ */ jsx("path", { d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z", fill: "#4285F4" }),
|
|
38
|
+
/* @__PURE__ */ jsx("path", { d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z", fill: "#34A853" }),
|
|
39
|
+
/* @__PURE__ */ jsx("path", { d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z", fill: "#FBBC05" }),
|
|
40
|
+
/* @__PURE__ */ jsx("path", { d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z", fill: "#EA4335" })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
var SOCIAL_LABEL = { github: "GitHub", google: "Google" };
|
|
44
|
+
var SOCIAL_ICON = { github: /* @__PURE__ */ jsx(GithubIcon, {}), google: /* @__PURE__ */ jsx(GoogleIcon, {}) };
|
|
45
|
+
function AuthPage({
|
|
46
|
+
product,
|
|
47
|
+
tagline,
|
|
48
|
+
mode = "signin",
|
|
49
|
+
tangleAuthUrl = "/auth/tangle/start",
|
|
50
|
+
providers = ["github", "google"],
|
|
51
|
+
socialHref = (p) => `/api/auth/sign-in/social?provider=${p}&callbackURL=/app`,
|
|
52
|
+
onEmailSubmit,
|
|
53
|
+
collectName,
|
|
54
|
+
altHref,
|
|
55
|
+
accent = "#0f172a",
|
|
56
|
+
accentHover = "#1e293b",
|
|
57
|
+
logoSize = "lg",
|
|
58
|
+
className,
|
|
59
|
+
style,
|
|
60
|
+
children
|
|
61
|
+
}) {
|
|
62
|
+
const [name, setName] = useState("");
|
|
63
|
+
const [email, setEmail] = useState("");
|
|
64
|
+
const [password, setPassword] = useState("");
|
|
65
|
+
const [error, setError] = useState("");
|
|
66
|
+
const [loading, setLoading] = useState(false);
|
|
67
|
+
const isSignup = mode === "signup";
|
|
68
|
+
const showName = collectName ?? isSignup;
|
|
69
|
+
const tangleLabel = isSignup ? "Sign up with Tangle" : "Continue with Tangle";
|
|
70
|
+
const emailLabel = isSignup ? "Create account with email" : "Sign in with email";
|
|
71
|
+
const handleSubmit = async (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
if (!onEmailSubmit) return;
|
|
74
|
+
setLoading(true);
|
|
75
|
+
setError("");
|
|
76
|
+
try {
|
|
77
|
+
const err = await onEmailSubmit(email, password, name);
|
|
78
|
+
if (err) setError(err);
|
|
79
|
+
} catch {
|
|
80
|
+
setError("Connection error \u2014 please try again");
|
|
81
|
+
} finally {
|
|
82
|
+
setLoading(false);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const outlineBtn = {
|
|
86
|
+
display: "flex",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
gap: 10,
|
|
90
|
+
width: "100%",
|
|
91
|
+
padding: "10px 12px",
|
|
92
|
+
borderRadius: 8,
|
|
93
|
+
border: `1px solid ${C.border}`,
|
|
94
|
+
background: "transparent",
|
|
95
|
+
color: C.text,
|
|
96
|
+
fontSize: 14,
|
|
97
|
+
fontWeight: 500,
|
|
98
|
+
cursor: "pointer",
|
|
99
|
+
transition: "background 120ms"
|
|
100
|
+
};
|
|
101
|
+
const inputStyle = {
|
|
102
|
+
width: "100%",
|
|
103
|
+
padding: "10px 12px",
|
|
104
|
+
borderRadius: 8,
|
|
105
|
+
border: `1px solid ${C.border}`,
|
|
106
|
+
background: C.inputBg,
|
|
107
|
+
color: C.text,
|
|
108
|
+
fontSize: 14,
|
|
109
|
+
outline: "none"
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
style: { minHeight: "100vh", display: "flex", alignItems: "center", justifyContent: "center", padding: 16, background: C.pageBg },
|
|
115
|
+
children: /* @__PURE__ */ jsxs(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className,
|
|
119
|
+
style: {
|
|
120
|
+
width: "100%",
|
|
121
|
+
maxWidth: 384,
|
|
122
|
+
background: C.card,
|
|
123
|
+
border: `1px solid ${C.border}`,
|
|
124
|
+
borderRadius: 16,
|
|
125
|
+
padding: 32,
|
|
126
|
+
boxShadow: "0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06)",
|
|
127
|
+
...style
|
|
128
|
+
},
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsxs("div", { style: { marginBottom: 28 }, children: [
|
|
131
|
+
/* @__PURE__ */ jsx(Logo, { variant: "full", suffix: product, size: logoSize }),
|
|
132
|
+
tagline !== null && /* @__PURE__ */ jsx("p", { style: { fontSize: 14, marginTop: 12, color: C.muted }, children: tagline ?? (isSignup ? `Create your ${product ?? "Tangle"} workspace.` : `Sign in to your ${product ?? "Tangle"} workspace.`) })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ jsxs(
|
|
135
|
+
"a",
|
|
136
|
+
{
|
|
137
|
+
href: tangleAuthUrl,
|
|
138
|
+
style: {
|
|
139
|
+
display: "flex",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
justifyContent: "center",
|
|
142
|
+
gap: 10,
|
|
143
|
+
width: "100%",
|
|
144
|
+
padding: "10px 12px",
|
|
145
|
+
borderRadius: 8,
|
|
146
|
+
background: accent,
|
|
147
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
148
|
+
color: "#fff",
|
|
149
|
+
fontSize: 14,
|
|
150
|
+
fontWeight: 600,
|
|
151
|
+
textDecoration: "none",
|
|
152
|
+
transition: "background 120ms"
|
|
153
|
+
},
|
|
154
|
+
onMouseEnter: (e) => e.currentTarget.style.background = accentHover,
|
|
155
|
+
onMouseLeave: (e) => e.currentTarget.style.background = accent,
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx(TangleKnot, { size: 16 }),
|
|
158
|
+
tangleLabel
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
providers.length > 0 && /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8, marginTop: 8 }, children: providers.map((p) => /* @__PURE__ */ jsxs(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
type: "button",
|
|
166
|
+
style: outlineBtn,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
window.location.href = socialHref(p);
|
|
169
|
+
},
|
|
170
|
+
onMouseEnter: (e) => e.currentTarget.style.background = "rgba(0,0,0,0.02)",
|
|
171
|
+
onMouseLeave: (e) => e.currentTarget.style.background = "transparent",
|
|
172
|
+
children: [
|
|
173
|
+
SOCIAL_ICON[p],
|
|
174
|
+
"Continue with ",
|
|
175
|
+
SOCIAL_LABEL[p]
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
p
|
|
179
|
+
)) }),
|
|
180
|
+
onEmailSubmit && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
181
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, margin: "24px 0" }, children: [
|
|
182
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: 1, background: C.border } }),
|
|
183
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 12, color: C.muted }, children: "or" }),
|
|
184
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: 1, background: C.border } })
|
|
185
|
+
] }),
|
|
186
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, style: { display: "flex", flexDirection: "column", gap: 12 }, children: [
|
|
187
|
+
showName && /* @__PURE__ */ jsx("input", { type: "text", required: true, "aria-label": "Name", placeholder: "Name", autoComplete: "name", value: name, onChange: (e) => setName(e.target.value), style: inputStyle }),
|
|
188
|
+
/* @__PURE__ */ jsx("input", { type: "email", required: true, "aria-label": "Email", placeholder: "Email", value: email, onChange: (e) => setEmail(e.target.value), style: inputStyle }),
|
|
189
|
+
/* @__PURE__ */ jsx("input", { type: "password", required: true, "aria-label": "Password", placeholder: "Password", value: password, onChange: (e) => setPassword(e.target.value), style: inputStyle }),
|
|
190
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", style: { fontSize: 14, color: "#b91c1c" }, children: error }),
|
|
191
|
+
/* @__PURE__ */ jsx("button", { type: "submit", disabled: loading, style: { ...outlineBtn, opacity: loading ? 0.5 : 1 }, children: loading ? "\u2026" : emailLabel })
|
|
192
|
+
] })
|
|
193
|
+
] }),
|
|
194
|
+
children,
|
|
195
|
+
altHref && /* @__PURE__ */ jsxs("p", { style: { textAlign: "center", fontSize: 14, marginTop: 24, color: C.muted }, children: [
|
|
196
|
+
isSignup ? "Already have an account? " : `New to Tangle${product ? ` ${product}` : ""}? `,
|
|
197
|
+
/* @__PURE__ */ jsx("a", { href: altHref, style: { fontWeight: 500, color: C.text }, children: isSignup ? "Sign in" : "Create account" })
|
|
198
|
+
] })
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
20
206
|
// src/pages/billing-page.tsx
|
|
21
207
|
import * as React from "react";
|
|
22
208
|
import { Skeleton, SkeletonCard } from "@tangle-network/ui/primitives";
|
|
23
209
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/ui/primitives";
|
|
24
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
210
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
25
211
|
var defaultBillingData = {
|
|
26
212
|
subscription: null,
|
|
27
213
|
balance: { available: 0, used: 0 },
|
|
@@ -67,15 +253,15 @@ async function fetchBillingDataFromApi(apiBasePath) {
|
|
|
67
253
|
function BillingPageSkeleton({
|
|
68
254
|
variant: _variant = "sandbox"
|
|
69
255
|
}) {
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ jsxs2("div", { className: "space-y-8", children: [
|
|
257
|
+
/* @__PURE__ */ jsxs2("div", { className: "grid gap-6 lg:grid-cols-3", children: [
|
|
258
|
+
/* @__PURE__ */ jsx2(SkeletonCard, {}),
|
|
259
|
+
/* @__PURE__ */ jsx2(SkeletonCard, {}),
|
|
260
|
+
/* @__PURE__ */ jsx2(SkeletonCard, {})
|
|
75
261
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ jsxs2("div", { className: "space-y-4 rounded-xl border border-border bg-card p-6", children: [
|
|
263
|
+
/* @__PURE__ */ jsx2(Skeleton, { className: "h-6 w-48" }),
|
|
264
|
+
/* @__PURE__ */ jsx2("div", { className: "h-48", children: /* @__PURE__ */ jsx2(Skeleton, { className: "h-full w-full" }) })
|
|
79
265
|
] })
|
|
80
266
|
] });
|
|
81
267
|
}
|
|
@@ -83,8 +269,8 @@ function BillingPageError({
|
|
|
83
269
|
message,
|
|
84
270
|
onRetry
|
|
85
271
|
}) {
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
272
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center space-y-4 rounded-xl border border-destructive/20 bg-destructive/5 p-8 text-center", children: [
|
|
273
|
+
/* @__PURE__ */ jsx2("div", { className: "rounded-full bg-destructive/10 p-3", children: /* @__PURE__ */ jsxs2(
|
|
88
274
|
"svg",
|
|
89
275
|
{
|
|
90
276
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -96,18 +282,18 @@ function BillingPageError({
|
|
|
96
282
|
strokeLinejoin: "round",
|
|
97
283
|
className: "h-6 w-6 text-destructive",
|
|
98
284
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ jsx2("title", { children: "Error icon" }),
|
|
286
|
+
/* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "10" }),
|
|
287
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
|
|
288
|
+
/* @__PURE__ */ jsx2("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
|
|
103
289
|
]
|
|
104
290
|
}
|
|
105
291
|
) }),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
|
|
293
|
+
/* @__PURE__ */ jsx2("h3", { className: "font-semibold text-lg", children: "Failed to load billing data" }),
|
|
294
|
+
/* @__PURE__ */ jsx2("p", { className: "text-muted-foreground text-sm", children: message })
|
|
109
295
|
] }),
|
|
110
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ jsx2(
|
|
111
297
|
"button",
|
|
112
298
|
{
|
|
113
299
|
type: "button",
|
|
@@ -208,19 +394,19 @@ function BillingPage({
|
|
|
208
394
|
[]
|
|
209
395
|
);
|
|
210
396
|
if (state.loading) {
|
|
211
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsx2(BillingPageSkeleton, { variant });
|
|
212
398
|
}
|
|
213
399
|
if (state.error) {
|
|
214
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsx2(BillingPageError, { message: state.error, onRetry: loadData });
|
|
215
401
|
}
|
|
216
402
|
const data = state.data || defaultBillingData;
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ jsx2("div", { className: "space-y-8", children: /* @__PURE__ */ jsxs2(Tabs, { defaultValue: "overview", className: "w-full", children: [
|
|
404
|
+
/* @__PURE__ */ jsxs2(TabsList, { className: "mb-6", children: [
|
|
405
|
+
/* @__PURE__ */ jsx2(TabsTrigger, { value: "overview", children: "Overview" }),
|
|
406
|
+
/* @__PURE__ */ jsx2(TabsTrigger, { value: "plans", children: "Plans" }),
|
|
407
|
+
/* @__PURE__ */ jsx2(TabsTrigger, { value: "usage", children: "Usage History" })
|
|
222
408
|
] }),
|
|
223
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ jsx2(TabsContent, { value: "overview", className: "space-y-6", children: /* @__PURE__ */ jsx2(
|
|
224
410
|
BillingDashboard,
|
|
225
411
|
{
|
|
226
412
|
subscription: data.subscription,
|
|
@@ -231,7 +417,7 @@ function BillingPage({
|
|
|
231
417
|
variant
|
|
232
418
|
}
|
|
233
419
|
) }),
|
|
234
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ jsx2(TabsContent, { value: "plans", children: /* @__PURE__ */ jsx2(
|
|
235
421
|
PricingPage,
|
|
236
422
|
{
|
|
237
423
|
tiers: data.tiers,
|
|
@@ -243,15 +429,15 @@ function BillingPage({
|
|
|
243
429
|
loading: state.selectingTier
|
|
244
430
|
}
|
|
245
431
|
) }),
|
|
246
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ jsx2(TabsContent, { value: "usage", children: data.usageHistory.length > 0 ? /* @__PURE__ */ jsx2(
|
|
247
433
|
UsageChart,
|
|
248
434
|
{
|
|
249
435
|
data: data.usageHistory,
|
|
250
436
|
title: "Credit Usage History",
|
|
251
437
|
unit: "credits"
|
|
252
438
|
}
|
|
253
|
-
) : /* @__PURE__ */
|
|
254
|
-
/* @__PURE__ */
|
|
439
|
+
) : /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center rounded-xl border border-border bg-card p-12 text-center", children: [
|
|
440
|
+
/* @__PURE__ */ jsxs2(
|
|
255
441
|
"svg",
|
|
256
442
|
{
|
|
257
443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -263,14 +449,14 @@ function BillingPage({
|
|
|
263
449
|
strokeLinejoin: "round",
|
|
264
450
|
className: "mb-4 h-12 w-12 text-muted-foreground",
|
|
265
451
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ jsx2("title", { children: "No usage data icon" }),
|
|
453
|
+
/* @__PURE__ */ jsx2("path", { d: "M3 3v18h18" }),
|
|
454
|
+
/* @__PURE__ */ jsx2("path", { d: "m19 9-5 5-4-4-3 3" })
|
|
269
455
|
]
|
|
270
456
|
}
|
|
271
457
|
),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ jsx2("h3", { className: "font-semibold text-lg", children: "No usage data yet" }),
|
|
459
|
+
/* @__PURE__ */ jsx2("p", { className: "text-muted-foreground text-sm", children: "Start using credits to see your usage history here." })
|
|
274
460
|
] }) })
|
|
275
461
|
] }) });
|
|
276
462
|
}
|
|
@@ -288,7 +474,7 @@ import {
|
|
|
288
474
|
Trash2,
|
|
289
475
|
Check
|
|
290
476
|
} from "lucide-react";
|
|
291
|
-
import { Fragment as
|
|
477
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
292
478
|
var VALID_DRIVERS = /* @__PURE__ */ new Set([
|
|
293
479
|
"docker",
|
|
294
480
|
"firecracker",
|
|
@@ -341,7 +527,7 @@ function resolveEnvironment(env) {
|
|
|
341
527
|
id: env.id,
|
|
342
528
|
name: templateName,
|
|
343
529
|
description: env.description ?? "User template from snapshot",
|
|
344
|
-
icon: /* @__PURE__ */
|
|
530
|
+
icon: /* @__PURE__ */ jsx3("span", { className: "text-[var(--surface-success-text)] text-2xl font-bold", children: "T" }),
|
|
345
531
|
color: "green"
|
|
346
532
|
};
|
|
347
533
|
}
|
|
@@ -354,7 +540,7 @@ function resolveEnvironment(env) {
|
|
|
354
540
|
id: env.id,
|
|
355
541
|
name,
|
|
356
542
|
description: env.description ?? `${name} development environment`,
|
|
357
|
-
icon: /* @__PURE__ */
|
|
543
|
+
icon: /* @__PURE__ */ jsx3("span", { className: `${textClass} text-2xl font-bold`, children: abbr }),
|
|
358
544
|
color
|
|
359
545
|
};
|
|
360
546
|
}
|
|
@@ -363,21 +549,21 @@ var defaultEnvironments = [
|
|
|
363
549
|
id: "node",
|
|
364
550
|
name: "Node.js",
|
|
365
551
|
description: "v20.x LTS with optimized runtime for asynchronous event-driven agents.",
|
|
366
|
-
icon: /* @__PURE__ */
|
|
552
|
+
icon: /* @__PURE__ */ jsx3("span", { className: "text-[var(--code-success)] text-2xl font-bold", children: "N" }),
|
|
367
553
|
color: "green"
|
|
368
554
|
},
|
|
369
555
|
{
|
|
370
556
|
id: "python",
|
|
371
557
|
name: "Python",
|
|
372
558
|
description: "v3.11 pre-installed with PyTorch and common data science libraries.",
|
|
373
|
-
icon: /* @__PURE__ */
|
|
559
|
+
icon: /* @__PURE__ */ jsx3("span", { className: "text-sky-400 text-2xl font-bold", children: "Py" }),
|
|
374
560
|
color: "blue"
|
|
375
561
|
},
|
|
376
562
|
{
|
|
377
563
|
id: "ubuntu",
|
|
378
564
|
name: "Ubuntu",
|
|
379
565
|
description: "Full 22.04 LTS terminal access for custom containerized workloads.",
|
|
380
|
-
icon: /* @__PURE__ */
|
|
566
|
+
icon: /* @__PURE__ */ jsx3("span", { className: "text-orange-400 text-2xl font-bold", children: "U" }),
|
|
381
567
|
color: "orange"
|
|
382
568
|
}
|
|
383
569
|
];
|
|
@@ -450,21 +636,21 @@ function SshAccessStep({ config }) {
|
|
|
450
636
|
const keys = config.keys ?? [];
|
|
451
637
|
const inlineKeyCount = config.inlinePublicKeys.split(/\r?\n/).map((key) => key.trim()).filter(Boolean).length;
|
|
452
638
|
const totalKeyCount = config.selectedKeyIds.length + inlineKeyCount;
|
|
453
|
-
return /* @__PURE__ */
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ jsxs3("div", { className: "space-y-4", children: [
|
|
640
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-start justify-between gap-4", children: [
|
|
641
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
642
|
+
/* @__PURE__ */ jsx3("p", { className: "font-medium text-foreground text-sm", children: "SSH Access" }),
|
|
643
|
+
/* @__PURE__ */ jsx3("p", { className: "mt-1 text-muted-foreground text-xs", children: "Select stored keys or paste public keys for authorized_keys." })
|
|
458
644
|
] }),
|
|
459
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsxs3(Badge, { variant: "outline", children: [
|
|
460
646
|
totalKeyCount,
|
|
461
647
|
" key",
|
|
462
648
|
totalKeyCount === 1 ? "" : "s"
|
|
463
649
|
] })
|
|
464
650
|
] }),
|
|
465
|
-
keys.length > 0 && /* @__PURE__ */
|
|
651
|
+
keys.length > 0 && /* @__PURE__ */ jsx3("div", { className: "grid gap-2 sm:grid-cols-2", children: keys.map((key) => {
|
|
466
652
|
const selected = config.selectedKeyIds.includes(key.id);
|
|
467
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsx3(
|
|
468
654
|
Button,
|
|
469
655
|
{
|
|
470
656
|
type: "button",
|
|
@@ -476,9 +662,9 @@ function SshAccessStep({ config }) {
|
|
|
476
662
|
selected ? config.selectedKeyIds.filter((id) => id !== key.id) : [...config.selectedKeyIds, key.id]
|
|
477
663
|
);
|
|
478
664
|
},
|
|
479
|
-
children: /* @__PURE__ */
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ jsxs3("span", { className: "min-w-0", children: [
|
|
666
|
+
/* @__PURE__ */ jsx3("span", { className: "block font-medium text-foreground", children: key.name }),
|
|
667
|
+
/* @__PURE__ */ jsxs3("span", { className: "block truncate font-mono text-muted-foreground text-xs", children: [
|
|
482
668
|
key.keyType,
|
|
483
669
|
" \xB7 ",
|
|
484
670
|
key.fingerprint
|
|
@@ -488,7 +674,7 @@ function SshAccessStep({ config }) {
|
|
|
488
674
|
key.id
|
|
489
675
|
);
|
|
490
676
|
}) }),
|
|
491
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ jsx3(
|
|
492
678
|
Textarea,
|
|
493
679
|
{
|
|
494
680
|
className: "min-h-24 font-mono text-xs",
|
|
@@ -726,9 +912,9 @@ function ProvisioningWizard({
|
|
|
726
912
|
const pricingSuffix = pricingView === "hourly" ? "/ hour" : "/ sec";
|
|
727
913
|
const rateSuffix = pricingView === "hourly" ? "/h" : "/s";
|
|
728
914
|
const fmtRate = (v) => pricingView === "hourly" ? v.toFixed(2) : formatPerSecondValue(v);
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
onBack && /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("max-w-6xl mx-auto flex flex-col", className), children: [
|
|
916
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-4 flex items-center gap-3 shrink-0", children: [
|
|
917
|
+
onBack && /* @__PURE__ */ jsx3(
|
|
732
918
|
Button,
|
|
733
919
|
{
|
|
734
920
|
type: "button",
|
|
@@ -736,30 +922,30 @@ function ProvisioningWizard({
|
|
|
736
922
|
size: "icon",
|
|
737
923
|
onClick: onBack,
|
|
738
924
|
className: "h-9 w-9 shrink-0",
|
|
739
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ jsx3(ArrowLeft, { className: "h-4 w-4" })
|
|
740
926
|
}
|
|
741
927
|
),
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
928
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
929
|
+
/* @__PURE__ */ jsx3("h1", { className: "text-2xl font-semibold tracking-tight text-foreground", children: "Sandbox Provisioning" }),
|
|
930
|
+
/* @__PURE__ */ jsx3("p", { className: "text-muted-foreground text-sm", children: "Select your stack, allocate resources, and deploy." })
|
|
745
931
|
] })
|
|
746
932
|
] }),
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
isMultistep && /* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-12 gap-5 flex-1 min-h-0", children: [
|
|
934
|
+
/* @__PURE__ */ jsxs3("div", { className: "col-span-12 xl:col-span-8 flex flex-col min-h-0", children: [
|
|
935
|
+
isMultistep && /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-2 mb-4 rounded-lg border border-border bg-card px-4 py-2 shadow-sm mx-auto max-w-2xl justify-between shrink-0", children: stepLabels.map((label, index) => {
|
|
750
936
|
const s = index + 1;
|
|
751
|
-
return /* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center", children: [
|
|
938
|
+
/* @__PURE__ */ jsx3(
|
|
753
939
|
"div",
|
|
754
940
|
{
|
|
755
941
|
className: cn(
|
|
756
942
|
"h-6 w-6 rounded-full flex items-center justify-center font-semibold text-xs shrink-0 transition-colors duration-200",
|
|
757
943
|
currentStep >= s ? "bg-primary text-primary-foreground" : "bg-muted border border-border text-muted-foreground"
|
|
758
944
|
),
|
|
759
|
-
children: currentStep > s ? /* @__PURE__ */
|
|
945
|
+
children: currentStep > s ? /* @__PURE__ */ jsx3(Check, { className: "h-3 w-3" }) : s
|
|
760
946
|
}
|
|
761
947
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ jsx3(
|
|
763
949
|
"span",
|
|
764
950
|
{
|
|
765
951
|
className: cn(
|
|
@@ -769,7 +955,7 @@ function ProvisioningWizard({
|
|
|
769
955
|
children: label
|
|
770
956
|
}
|
|
771
957
|
),
|
|
772
|
-
s < finalStep && /* @__PURE__ */
|
|
958
|
+
s < finalStep && /* @__PURE__ */ jsx3(
|
|
773
959
|
"div",
|
|
774
960
|
{
|
|
775
961
|
className: cn(
|
|
@@ -780,12 +966,12 @@ function ProvisioningWizard({
|
|
|
780
966
|
)
|
|
781
967
|
] }, s);
|
|
782
968
|
}) }),
|
|
783
|
-
dc && isMultistep && /* @__PURE__ */
|
|
784
|
-
/* @__PURE__ */
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
969
|
+
dc && isMultistep && /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between rounded-lg border border-border bg-card px-4 py-2.5 shadow-sm shrink-0 mb-4", children: [
|
|
970
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
971
|
+
/* @__PURE__ */ jsx3(Info, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
972
|
+
/* @__PURE__ */ jsx3("span", { className: "text-muted-foreground", children: "Pre-configured from template." })
|
|
787
973
|
] }),
|
|
788
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ jsx3(
|
|
789
975
|
Button,
|
|
790
976
|
{
|
|
791
977
|
type: "button",
|
|
@@ -812,33 +998,33 @@ function ProvisioningWizard({
|
|
|
812
998
|
}
|
|
813
999
|
)
|
|
814
1000
|
] }),
|
|
815
|
-
loadError && /* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
1001
|
+
loadError && /* @__PURE__ */ jsxs3("div", { className: "rounded-lg border border-destructive/30 bg-destructive/10 p-3 flex items-center gap-2 shrink-0 mb-4", children: [
|
|
1002
|
+
/* @__PURE__ */ jsx3(Info, { className: "h-4 w-4 text-destructive shrink-0" }),
|
|
1003
|
+
/* @__PURE__ */ jsx3("p", { className: "text-sm font-medium text-destructive", children: loadError })
|
|
818
1004
|
] }),
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
(!isMultistep || currentStep === 1) && /* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto min-h-0 space-y-4", children: [
|
|
1006
|
+
(!isMultistep || currentStep === 1) && /* @__PURE__ */ jsx3(React2.Fragment, { children: /* @__PURE__ */ jsxs3("section", { className: SECTION_CARD_CLASS, children: [
|
|
1007
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
1008
|
+
/* @__PURE__ */ jsx3(Layers, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
1009
|
+
/* @__PURE__ */ jsx3("h2", { className: "text-sm font-semibold uppercase tracking-[0.06em] text-muted-foreground", children: "Environment Selection" })
|
|
824
1010
|
] }),
|
|
825
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-3", children: isLoadingEnvironments && environments.length === 0 ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsxs3(
|
|
826
1012
|
"div",
|
|
827
1013
|
{
|
|
828
1014
|
className: "p-3.5 rounded-lg border border-border bg-card/50 animate-pulse",
|
|
829
1015
|
"aria-hidden": "true",
|
|
830
1016
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-start mb-2.5", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx3("div", { className: "w-10 h-10 rounded-full bg-muted/60 border border-border" }),
|
|
1019
|
+
/* @__PURE__ */ jsx3("div", { className: "w-4 h-4 rounded-full border-2 border-border" })
|
|
834
1020
|
] }),
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ jsx3("div", { className: "h-3 w-1/3 rounded bg-muted/60 mb-2" }),
|
|
1022
|
+
/* @__PURE__ */ jsx3("div", { className: "h-2.5 w-5/6 rounded bg-muted/50 mb-1.5" }),
|
|
1023
|
+
/* @__PURE__ */ jsx3("div", { className: "h-2.5 w-2/3 rounded bg-muted/50" })
|
|
838
1024
|
]
|
|
839
1025
|
},
|
|
840
1026
|
`env-skeleton-${i}`
|
|
841
|
-
)) : environments.map((env) => /* @__PURE__ */
|
|
1027
|
+
)) : environments.map((env) => /* @__PURE__ */ jsxs3(
|
|
842
1028
|
"button",
|
|
843
1029
|
{
|
|
844
1030
|
type: "button",
|
|
@@ -848,36 +1034,36 @@ function ProvisioningWizard({
|
|
|
848
1034
|
selectedEnv === env.id ? "bg-primary/5 border-primary ring-1 ring-primary/20" : "bg-card border-border hover:border-primary/30 active:scale-[0.99]"
|
|
849
1035
|
),
|
|
850
1036
|
children: [
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-start mb-2.5", children: [
|
|
1038
|
+
/* @__PURE__ */ jsx3("div", { className: "w-10 h-10 rounded-full flex items-center justify-center bg-muted/50 border border-border", children: env.icon }),
|
|
1039
|
+
/* @__PURE__ */ jsx3(
|
|
854
1040
|
"div",
|
|
855
1041
|
{
|
|
856
1042
|
className: cn(
|
|
857
1043
|
"w-4 h-4 rounded-full border-2 flex items-center justify-center transition-colors duration-200",
|
|
858
1044
|
selectedEnv === env.id ? "border-primary bg-primary" : "border-border group-hover:border-primary/40"
|
|
859
1045
|
),
|
|
860
|
-
children: selectedEnv === env.id && /* @__PURE__ */
|
|
1046
|
+
children: selectedEnv === env.id && /* @__PURE__ */ jsx3(Check, { className: "h-2.5 w-2.5 text-primary-foreground" })
|
|
861
1047
|
}
|
|
862
1048
|
)
|
|
863
1049
|
] }),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ jsx3("h3", { className: "font-semibold text-sm mb-0.5 text-foreground", children: env.name }),
|
|
1051
|
+
/* @__PURE__ */ jsx3("p", { className: "text-xs text-muted-foreground leading-relaxed", children: env.description })
|
|
866
1052
|
]
|
|
867
1053
|
},
|
|
868
1054
|
env.id
|
|
869
1055
|
)) })
|
|
870
1056
|
] }) }),
|
|
871
|
-
(!isMultistep || currentStep === 2) && /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
1057
|
+
(!isMultistep || currentStep === 2) && /* @__PURE__ */ jsx3(React2.Fragment, { children: /* @__PURE__ */ jsxs3("section", { className: SECTION_CARD_CLASS, children: [
|
|
1058
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx3(Cpu, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
1060
|
+
/* @__PURE__ */ jsx3("h2", { className: "text-sm font-semibold uppercase tracking-[0.06em] text-muted-foreground", children: "Resource Allocation" })
|
|
875
1061
|
] }),
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-4", children: [
|
|
1063
|
+
/* @__PURE__ */ jsx3("label", { className: cn(FIELD_LABEL_CLASS, "mb-2"), children: "Compute Presets" }),
|
|
1064
|
+
/* @__PURE__ */ jsx3("div", { className: "grid grid-cols-3 gap-2", children: presets.map((p) => {
|
|
879
1065
|
const active = activePreset === p.name && !p.locked;
|
|
880
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ jsxs3(
|
|
881
1067
|
"button",
|
|
882
1068
|
{
|
|
883
1069
|
type: "button",
|
|
@@ -888,8 +1074,8 @@ function ProvisioningWizard({
|
|
|
888
1074
|
active ? "bg-primary/5 border-primary ring-1 ring-primary/20" : p.locked ? "bg-muted/30 border-border opacity-60 cursor-not-allowed" : "bg-card border-border hover:border-primary/30 active:scale-[0.99]"
|
|
889
1075
|
),
|
|
890
1076
|
children: [
|
|
891
|
-
p.locked && /* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
1077
|
+
p.locked && /* @__PURE__ */ jsx3("div", { className: "absolute -top-1.5 -right-1.5 bg-primary text-primary-foreground text-[9px] font-semibold px-1.5 py-0.5 rounded-full uppercase tracking-wider", children: p.unlockLabel }),
|
|
1078
|
+
/* @__PURE__ */ jsx3(
|
|
893
1079
|
"div",
|
|
894
1080
|
{
|
|
895
1081
|
className: cn(
|
|
@@ -899,7 +1085,7 @@ function ProvisioningWizard({
|
|
|
899
1085
|
children: p.name
|
|
900
1086
|
}
|
|
901
1087
|
),
|
|
902
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ jsxs3("div", { className: "text-xs text-muted-foreground mt-0.5 font-mono", children: [
|
|
903
1089
|
p.cpu,
|
|
904
1090
|
" vCPU",
|
|
905
1091
|
p.cpu === 1 ? "" : "s",
|
|
@@ -916,7 +1102,7 @@ function ProvisioningWizard({
|
|
|
916
1102
|
);
|
|
917
1103
|
}) })
|
|
918
1104
|
] }),
|
|
919
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ jsx3("div", { className: "space-y-4", children: [
|
|
920
1106
|
{
|
|
921
1107
|
label: "Compute Cores (CPU)",
|
|
922
1108
|
value: cpuCores,
|
|
@@ -947,12 +1133,12 @@ function ProvisioningWizard({
|
|
|
947
1133
|
].map(
|
|
948
1134
|
({ label, value, setter, min, max, step: s, unit }) => {
|
|
949
1135
|
const displayUnit = unit === "vCPU" ? `${value} vCPU${value === 1 ? "" : "s"}` : `${value}${unit}`;
|
|
950
|
-
return /* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsxs3("div", { children: [
|
|
1137
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-end pb-1 mb-1.5", children: [
|
|
1138
|
+
/* @__PURE__ */ jsx3("label", { className: FIELD_LABEL_CLASS, children: label }),
|
|
1139
|
+
/* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground tabular-nums", children: displayUnit })
|
|
954
1140
|
] }),
|
|
955
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsx3(
|
|
956
1142
|
"input",
|
|
957
1143
|
{
|
|
958
1144
|
type: "range",
|
|
@@ -967,12 +1153,12 @@ function ProvisioningWizard({
|
|
|
967
1153
|
className: "w-full h-1.5 rounded-full appearance-none cursor-pointer accent-primary [&::-webkit-slider-runnable-track]:bg-border [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:h-1.5 [&::-moz-range-track]:bg-border [&::-moz-range-track]:rounded-full [&::-moz-range-track]:h-1.5 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:-mt-[5px] [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-primary-foreground"
|
|
968
1154
|
}
|
|
969
1155
|
),
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between text-[10px] font-mono text-muted-foreground/60 mt-1", children: [
|
|
1157
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
972
1158
|
min,
|
|
973
1159
|
unit === "vCPU" ? min === 1 ? " vCPU" : " vCPUs" : unit
|
|
974
1160
|
] }),
|
|
975
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
976
1162
|
max,
|
|
977
1163
|
unit === "vCPU" ? max === 1 ? " vCPU" : " vCPUs" : unit
|
|
978
1164
|
] })
|
|
@@ -981,24 +1167,24 @@ function ProvisioningWizard({
|
|
|
981
1167
|
}
|
|
982
1168
|
) })
|
|
983
1169
|
] }) }),
|
|
984
|
-
(!isMultistep || currentStep === 2) && /* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
1170
|
+
(!isMultistep || currentStep === 2) && /* @__PURE__ */ jsx3(React2.Fragment, { children: /* @__PURE__ */ jsx3("section", { className: SECTION_CARD_CLASS, children: /* @__PURE__ */ jsxs3("div", { children: [
|
|
1171
|
+
/* @__PURE__ */ jsxs3(
|
|
986
1172
|
"button",
|
|
987
1173
|
{
|
|
988
1174
|
type: "button",
|
|
989
1175
|
onClick: () => setShowAdvanced(!showAdvanced),
|
|
990
1176
|
className: "flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors text-sm font-medium focus:outline-none",
|
|
991
1177
|
children: [
|
|
992
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsx3(Settings, { className: "w-4 h-4" }),
|
|
993
1179
|
showAdvanced ? "Hide Advanced Options" : "Show Advanced Options"
|
|
994
1180
|
]
|
|
995
1181
|
}
|
|
996
1182
|
),
|
|
997
|
-
showAdvanced && /* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1183
|
+
showAdvanced && /* @__PURE__ */ jsxs3("div", { className: "mt-4 space-y-4", children: [
|
|
1184
|
+
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1185
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1186
|
+
/* @__PURE__ */ jsx3("label", { className: cn(FIELD_LABEL_CLASS, "mb-1.5"), children: "Workspace Name" }),
|
|
1187
|
+
/* @__PURE__ */ jsx3(
|
|
1002
1188
|
Input,
|
|
1003
1189
|
{
|
|
1004
1190
|
type: "text",
|
|
@@ -1010,9 +1196,9 @@ function ProvisioningWizard({
|
|
|
1010
1196
|
}
|
|
1011
1197
|
)
|
|
1012
1198
|
] }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1200
|
+
/* @__PURE__ */ jsx3("label", { className: cn(FIELD_LABEL_CLASS, "mb-1.5"), children: "Virtualization Driver" }),
|
|
1201
|
+
/* @__PURE__ */ jsxs3(
|
|
1016
1202
|
"select",
|
|
1017
1203
|
{
|
|
1018
1204
|
value: driver,
|
|
@@ -1024,8 +1210,8 @@ function ProvisioningWizard({
|
|
|
1024
1210
|
},
|
|
1025
1211
|
className: "w-full bg-card border border-border rounded-lg h-9 px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent appearance-none",
|
|
1026
1212
|
children: [
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ jsx3("option", { value: "docker", className: "bg-gray-900", children: "Docker container (Default)" }),
|
|
1214
|
+
/* @__PURE__ */ jsx3(
|
|
1029
1215
|
"option",
|
|
1030
1216
|
{
|
|
1031
1217
|
value: "firecracker",
|
|
@@ -1033,15 +1219,15 @@ function ProvisioningWizard({
|
|
|
1033
1219
|
children: "Firecracker microVM (Secure)"
|
|
1034
1220
|
}
|
|
1035
1221
|
),
|
|
1036
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ jsx3("option", { value: "tangle", className: "bg-gray-900", children: "Tangle Distributed Node" })
|
|
1037
1223
|
]
|
|
1038
1224
|
}
|
|
1039
1225
|
)
|
|
1040
1226
|
] })
|
|
1041
1227
|
] }),
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
-
/* @__PURE__ */
|
|
1228
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1229
|
+
/* @__PURE__ */ jsx3("label", { className: cn(FIELD_LABEL_CLASS, "mb-1.5"), children: "Git Repository URL" }),
|
|
1230
|
+
/* @__PURE__ */ jsx3(
|
|
1045
1231
|
Input,
|
|
1046
1232
|
{
|
|
1047
1233
|
type: "text",
|
|
@@ -1052,10 +1238,10 @@ function ProvisioningWizard({
|
|
|
1052
1238
|
}
|
|
1053
1239
|
)
|
|
1054
1240
|
] }),
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1242
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-1.5", children: [
|
|
1243
|
+
/* @__PURE__ */ jsx3("label", { className: FIELD_LABEL_CLASS, children: "Environment Variables" }),
|
|
1244
|
+
/* @__PURE__ */ jsxs3(
|
|
1059
1245
|
"button",
|
|
1060
1246
|
{
|
|
1061
1247
|
type: "button",
|
|
@@ -1065,15 +1251,15 @@ function ProvisioningWizard({
|
|
|
1065
1251
|
]),
|
|
1066
1252
|
className: "flex items-center gap-1 text-xs text-primary hover:text-primary/70 transition-colors font-medium",
|
|
1067
1253
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1254
|
+
/* @__PURE__ */ jsx3(Plus, { className: "h-3 w-3" }),
|
|
1069
1255
|
" Add Var"
|
|
1070
1256
|
]
|
|
1071
1257
|
}
|
|
1072
1258
|
)
|
|
1073
1259
|
] }),
|
|
1074
|
-
/* @__PURE__ */
|
|
1075
|
-
envVars.map((env, i) => /* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ jsxs3("div", { className: "space-y-2", children: [
|
|
1261
|
+
envVars.map((env, i) => /* @__PURE__ */ jsxs3("div", { className: "flex gap-2", children: [
|
|
1262
|
+
/* @__PURE__ */ jsx3(
|
|
1077
1263
|
Input,
|
|
1078
1264
|
{
|
|
1079
1265
|
type: "text",
|
|
@@ -1087,7 +1273,7 @@ function ProvisioningWizard({
|
|
|
1087
1273
|
placeholder: "API_KEY"
|
|
1088
1274
|
}
|
|
1089
1275
|
),
|
|
1090
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ jsx3(
|
|
1091
1277
|
Input,
|
|
1092
1278
|
{
|
|
1093
1279
|
type: "password",
|
|
@@ -1101,7 +1287,7 @@ function ProvisioningWizard({
|
|
|
1101
1287
|
placeholder: "sk-xxxxxxxxxxx"
|
|
1102
1288
|
}
|
|
1103
1289
|
),
|
|
1104
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ jsx3(
|
|
1105
1291
|
Button,
|
|
1106
1292
|
{
|
|
1107
1293
|
type: "button",
|
|
@@ -1111,25 +1297,25 @@ function ProvisioningWizard({
|
|
|
1111
1297
|
envVars.filter((_, idx) => idx !== i)
|
|
1112
1298
|
),
|
|
1113
1299
|
className: "h-9 w-9 shrink-0 text-destructive hover:bg-destructive/10 hover:border-destructive/30",
|
|
1114
|
-
children: /* @__PURE__ */
|
|
1300
|
+
children: /* @__PURE__ */ jsx3(Trash2, { className: "h-4 w-4" })
|
|
1115
1301
|
}
|
|
1116
1302
|
)
|
|
1117
1303
|
] }, i)),
|
|
1118
|
-
envVars.length === 0 && /* @__PURE__ */
|
|
1304
|
+
envVars.length === 0 && /* @__PURE__ */ jsx3("div", { className: "text-center p-3 border border-dashed border-border rounded-lg text-muted-foreground/60 text-xs italic", children: "No environment variables set" })
|
|
1119
1305
|
] })
|
|
1120
1306
|
] }),
|
|
1121
|
-
availableScripts.length > 0 && /* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
1307
|
+
availableScripts.length > 0 && /* @__PURE__ */ jsxs3("div", { children: [
|
|
1308
|
+
/* @__PURE__ */ jsx3("div", { className: cn(FIELD_LABEL_CLASS, "mb-1.5"), children: "Startup Scripts" }),
|
|
1309
|
+
/* @__PURE__ */ jsx3("div", { className: "space-y-2", children: availableScripts.filter((s) => s.enabled).map((script) => {
|
|
1124
1310
|
const selected = startupScriptIds.includes(
|
|
1125
1311
|
script.id
|
|
1126
1312
|
);
|
|
1127
|
-
return /* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ jsxs3(
|
|
1128
1314
|
"label",
|
|
1129
1315
|
{
|
|
1130
1316
|
className: "flex items-start gap-3 cursor-pointer group rounded-lg border border-border p-3 transition-colors hover:border-primary/30",
|
|
1131
1317
|
children: [
|
|
1132
|
-
/* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ jsx3(
|
|
1133
1319
|
"input",
|
|
1134
1320
|
{
|
|
1135
1321
|
type: "checkbox",
|
|
@@ -1142,15 +1328,15 @@ function ProvisioningWizard({
|
|
|
1142
1328
|
className: "mt-0.5 h-4 w-4 rounded border-border text-primary focus:ring-primary/30"
|
|
1143
1329
|
}
|
|
1144
1330
|
),
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
script.description && /* @__PURE__ */
|
|
1148
|
-
script.injectSecrets.length > 0 && /* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
|
|
1332
|
+
/* @__PURE__ */ jsx3("div", { className: "text-sm font-medium text-foreground group-hover:text-primary transition-colors", children: script.name }),
|
|
1333
|
+
script.description && /* @__PURE__ */ jsx3("div", { className: "text-xs text-muted-foreground mt-0.5", children: script.description }),
|
|
1334
|
+
script.injectSecrets.length > 0 && /* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-1 mt-1.5", children: script.injectSecrets.map((s) => /* @__PURE__ */ jsxs3(
|
|
1149
1335
|
"span",
|
|
1150
1336
|
{
|
|
1151
1337
|
className: "inline-flex items-center gap-0.5 rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground",
|
|
1152
1338
|
children: [
|
|
1153
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ jsxs3(
|
|
1154
1340
|
"svg",
|
|
1155
1341
|
{
|
|
1156
1342
|
className: "h-2.5 w-2.5",
|
|
@@ -1159,7 +1345,7 @@ function ProvisioningWizard({
|
|
|
1159
1345
|
stroke: "currentColor",
|
|
1160
1346
|
strokeWidth: "2",
|
|
1161
1347
|
children: [
|
|
1162
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ jsx3(
|
|
1163
1349
|
"rect",
|
|
1164
1350
|
{
|
|
1165
1351
|
x: "3",
|
|
@@ -1170,7 +1356,7 @@ function ProvisioningWizard({
|
|
|
1170
1356
|
ry: "2"
|
|
1171
1357
|
}
|
|
1172
1358
|
),
|
|
1173
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ jsx3("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
1174
1360
|
]
|
|
1175
1361
|
}
|
|
1176
1362
|
),
|
|
@@ -1186,9 +1372,9 @@ function ProvisioningWizard({
|
|
|
1186
1372
|
);
|
|
1187
1373
|
}) })
|
|
1188
1374
|
] }),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ jsxs3("div", { className: "pt-3 border-t border-border flex items-start justify-between gap-3", children: [
|
|
1376
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1377
|
+
/* @__PURE__ */ jsx3(
|
|
1192
1378
|
"label",
|
|
1193
1379
|
{
|
|
1194
1380
|
htmlFor: "wizard-bare-mode",
|
|
@@ -1196,9 +1382,9 @@ function ProvisioningWizard({
|
|
|
1196
1382
|
children: "Bare Mode"
|
|
1197
1383
|
}
|
|
1198
1384
|
),
|
|
1199
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx3("p", { className: "text-xs text-muted-foreground mt-0.5", children: "Start as a raw container without an embedded AI Agent backend." })
|
|
1200
1386
|
] }),
|
|
1201
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ jsx3(
|
|
1202
1388
|
Switch,
|
|
1203
1389
|
{
|
|
1204
1390
|
id: "wizard-bare-mode",
|
|
@@ -1210,27 +1396,27 @@ function ProvisioningWizard({
|
|
|
1210
1396
|
] })
|
|
1211
1397
|
] })
|
|
1212
1398
|
] }) }) }),
|
|
1213
|
-
sshAccess && (!isMultistep || currentStep === 3) && /* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1399
|
+
sshAccess && (!isMultistep || currentStep === 3) && /* @__PURE__ */ jsx3(React2.Fragment, { children: /* @__PURE__ */ jsxs3("section", { className: SECTION_CARD_CLASS, children: [
|
|
1400
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
1401
|
+
/* @__PURE__ */ jsx3(Settings, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
1402
|
+
/* @__PURE__ */ jsx3("h2", { className: "text-sm font-semibold uppercase tracking-[0.06em] text-muted-foreground", children: "Access Configuration" })
|
|
1217
1403
|
] }),
|
|
1218
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsx3(SshAccessStep, { config: sshAccess })
|
|
1219
1405
|
] }) })
|
|
1220
1406
|
] })
|
|
1221
1407
|
] }),
|
|
1222
|
-
/* @__PURE__ */
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ jsxs3("div", { className: "col-span-12 xl:col-span-4 sticky top-4 space-y-4", children: [
|
|
1409
|
+
/* @__PURE__ */ jsxs3("div", { className: "rounded-lg border border-border bg-card p-5 shadow-sm", children: [
|
|
1410
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between items-center mb-3", children: [
|
|
1411
|
+
/* @__PURE__ */ jsx3("span", { className: FIELD_LABEL_CLASS, children: "Run Cost" }),
|
|
1412
|
+
/* @__PURE__ */ jsxs3(
|
|
1227
1413
|
"div",
|
|
1228
1414
|
{
|
|
1229
1415
|
role: "group",
|
|
1230
1416
|
"aria-label": "Pricing view",
|
|
1231
1417
|
className: "inline-flex items-center rounded-md border border-border bg-muted/50 p-0.5",
|
|
1232
1418
|
children: [
|
|
1233
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ jsx3(
|
|
1234
1420
|
"button",
|
|
1235
1421
|
{
|
|
1236
1422
|
type: "button",
|
|
@@ -1243,7 +1429,7 @@ function ProvisioningWizard({
|
|
|
1243
1429
|
children: "Per Hour"
|
|
1244
1430
|
}
|
|
1245
1431
|
),
|
|
1246
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ jsx3(
|
|
1247
1433
|
"button",
|
|
1248
1434
|
{
|
|
1249
1435
|
type: "button",
|
|
@@ -1260,8 +1446,8 @@ function ProvisioningWizard({
|
|
|
1260
1446
|
}
|
|
1261
1447
|
)
|
|
1262
1448
|
] }),
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-baseline gap-2 mb-4", children: [
|
|
1450
|
+
/* @__PURE__ */ jsxs3(
|
|
1265
1451
|
"span",
|
|
1266
1452
|
{
|
|
1267
1453
|
className: cn(
|
|
@@ -1275,36 +1461,36 @@ function ProvisioningWizard({
|
|
|
1275
1461
|
},
|
|
1276
1462
|
pricingView
|
|
1277
1463
|
),
|
|
1278
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ jsx3("span", { className: "text-muted-foreground text-sm", children: pricingSuffix })
|
|
1279
1465
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ jsxs3("div", { className: "space-y-2 rounded-md border border-border bg-muted/30 p-3", children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between text-xs font-mono tracking-wide text-muted-foreground", children: [
|
|
1468
|
+
/* @__PURE__ */ jsx3("span", { children: "COMPUTE" }),
|
|
1469
|
+
/* @__PURE__ */ jsxs3("span", { className: "text-foreground", children: [
|
|
1284
1470
|
"$",
|
|
1285
1471
|
fmtRate(hourlyCostBreakdown.compute),
|
|
1286
1472
|
rateSuffix
|
|
1287
1473
|
] })
|
|
1288
1474
|
] }),
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between text-xs font-mono tracking-wide text-muted-foreground", children: [
|
|
1476
|
+
/* @__PURE__ */ jsx3("span", { children: "MEMORY" }),
|
|
1477
|
+
/* @__PURE__ */ jsxs3("span", { className: "text-foreground/80", children: [
|
|
1292
1478
|
"$",
|
|
1293
1479
|
fmtRate(hourlyCostBreakdown.memory),
|
|
1294
1480
|
rateSuffix
|
|
1295
1481
|
] })
|
|
1296
1482
|
] }),
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-between text-xs font-mono tracking-wide text-muted-foreground", children: [
|
|
1484
|
+
/* @__PURE__ */ jsx3("span", { children: "STORAGE" }),
|
|
1485
|
+
/* @__PURE__ */ jsxs3("span", { className: "text-foreground/80", children: [
|
|
1300
1486
|
"$",
|
|
1301
1487
|
fmtRate(hourlyCostBreakdown.storage),
|
|
1302
1488
|
rateSuffix
|
|
1303
1489
|
] })
|
|
1304
1490
|
] }),
|
|
1305
|
-
hourlyCostBreakdown.floorApplies && /* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
/* @__PURE__ */
|
|
1491
|
+
hourlyCostBreakdown.floorApplies && /* @__PURE__ */ jsxs3("div", { className: "flex justify-between text-xs font-mono tracking-wide text-primary border-t border-border pt-2", children: [
|
|
1492
|
+
/* @__PURE__ */ jsx3("span", { children: "MIN CHARGE" }),
|
|
1493
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1308
1494
|
"$",
|
|
1309
1495
|
fmtRate(
|
|
1310
1496
|
hourlyCostBreakdown.floor - hourlyCostBreakdown.lineSum
|
|
@@ -1314,12 +1500,12 @@ function ProvisioningWizard({
|
|
|
1314
1500
|
] })
|
|
1315
1501
|
] })
|
|
1316
1502
|
] }),
|
|
1317
|
-
deployError && /* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1503
|
+
deployError && /* @__PURE__ */ jsxs3("div", { className: "rounded-lg border border-destructive/30 bg-destructive/10 p-3 flex items-center gap-2", children: [
|
|
1504
|
+
/* @__PURE__ */ jsx3(Info, { className: "h-4 w-4 text-destructive shrink-0" }),
|
|
1505
|
+
/* @__PURE__ */ jsx3("p", { className: "text-sm font-medium text-destructive", children: deployError })
|
|
1320
1506
|
] }),
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
currentStep < finalStep ? /* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ jsx3("div", { className: "space-y-2", children: isMultistep ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1508
|
+
currentStep < finalStep ? /* @__PURE__ */ jsxs3(
|
|
1323
1509
|
Button,
|
|
1324
1510
|
{
|
|
1325
1511
|
type: "button",
|
|
@@ -1330,20 +1516,20 @@ function ProvisioningWizard({
|
|
|
1330
1516
|
stepLabels[currentStep]
|
|
1331
1517
|
]
|
|
1332
1518
|
}
|
|
1333
|
-
) : /* @__PURE__ */
|
|
1519
|
+
) : /* @__PURE__ */ jsx3(
|
|
1334
1520
|
Button,
|
|
1335
1521
|
{
|
|
1336
1522
|
type: "button",
|
|
1337
1523
|
onClick: handleDeploy,
|
|
1338
1524
|
disabled: isDeploying || !selectedEnv,
|
|
1339
1525
|
className: "w-full",
|
|
1340
|
-
children: isDeploying ? /* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1526
|
+
children: isDeploying ? /* @__PURE__ */ jsxs3("span", { className: "flex items-center justify-center gap-2", children: [
|
|
1527
|
+
/* @__PURE__ */ jsx3(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1342
1528
|
"Deploying..."
|
|
1343
1529
|
] }) : "Deploy Workspace"
|
|
1344
1530
|
}
|
|
1345
1531
|
),
|
|
1346
|
-
currentStep > 1 && /* @__PURE__ */
|
|
1532
|
+
currentStep > 1 && /* @__PURE__ */ jsx3(
|
|
1347
1533
|
Button,
|
|
1348
1534
|
{
|
|
1349
1535
|
type: "button",
|
|
@@ -1353,15 +1539,15 @@ function ProvisioningWizard({
|
|
|
1353
1539
|
children: "Back"
|
|
1354
1540
|
}
|
|
1355
1541
|
)
|
|
1356
|
-
] }) : /* @__PURE__ */
|
|
1542
|
+
] }) : /* @__PURE__ */ jsx3(
|
|
1357
1543
|
Button,
|
|
1358
1544
|
{
|
|
1359
1545
|
type: "button",
|
|
1360
1546
|
onClick: handleDeploy,
|
|
1361
1547
|
disabled: isDeploying || !selectedEnv,
|
|
1362
1548
|
className: "w-full",
|
|
1363
|
-
children: isDeploying ? /* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1549
|
+
children: isDeploying ? /* @__PURE__ */ jsxs3("span", { className: "flex items-center justify-center gap-2", children: [
|
|
1550
|
+
/* @__PURE__ */ jsx3(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1365
1551
|
"Spinning up environment..."
|
|
1366
1552
|
] }) : "Deploy Workspace"
|
|
1367
1553
|
}
|
|
@@ -1375,7 +1561,7 @@ function ProvisioningWizard({
|
|
|
1375
1561
|
import * as React3 from "react";
|
|
1376
1562
|
import { Skeleton as Skeleton2, SkeletonCard as SkeletonCard2 } from "@tangle-network/ui/primitives";
|
|
1377
1563
|
import { ChevronDown } from "lucide-react";
|
|
1378
|
-
import { jsx as
|
|
1564
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1379
1565
|
async function fetchTiersFromApi(apiBasePath) {
|
|
1380
1566
|
const res = await fetch(`${apiBasePath}/v1/billing/tiers`);
|
|
1381
1567
|
if (!res.ok) throw new Error("Failed to fetch pricing tiers");
|
|
@@ -1459,25 +1645,25 @@ function StandalonePricingPage({
|
|
|
1459
1645
|
},
|
|
1460
1646
|
[apiBasePath, state.billingPeriod, onSelectTier]
|
|
1461
1647
|
);
|
|
1462
|
-
return /* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
eyebrow && /* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("mx-auto max-w-6xl px-6 py-16 space-y-16", className), children: [
|
|
1649
|
+
/* @__PURE__ */ jsxs4("div", { className: "space-y-4 text-center", children: [
|
|
1650
|
+
eyebrow && /* @__PURE__ */ jsx4("span", { className: "text-xs font-bold uppercase tracking-widest text-[var(--brand-emerald,#10B981)]", children: eyebrow }),
|
|
1651
|
+
/* @__PURE__ */ jsx4("h1", { className: "text-4xl font-extrabold tracking-tight text-foreground sm:text-5xl font-display", children: title }),
|
|
1652
|
+
/* @__PURE__ */ jsx4("p", { className: "mx-auto max-w-2xl text-lg text-muted-foreground", children: subtitle })
|
|
1467
1653
|
] }),
|
|
1468
|
-
state.loading ? /* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1654
|
+
state.loading ? /* @__PURE__ */ jsxs4("div", { className: "space-y-8", children: [
|
|
1655
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-center gap-4", children: [
|
|
1656
|
+
/* @__PURE__ */ jsx4(Skeleton2, { className: "h-10 w-24" }),
|
|
1657
|
+
/* @__PURE__ */ jsx4(Skeleton2, { className: "h-10 w-24" })
|
|
1472
1658
|
] }),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-1 gap-6 lg:grid-cols-3", children: [
|
|
1660
|
+
/* @__PURE__ */ jsx4(SkeletonCard2, { className: "h-[500px]" }),
|
|
1661
|
+
/* @__PURE__ */ jsx4(SkeletonCard2, { className: "h-[500px]" }),
|
|
1662
|
+
/* @__PURE__ */ jsx4(SkeletonCard2, { className: "h-[500px]" })
|
|
1477
1663
|
] })
|
|
1478
|
-
] }) : state.error ? /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1664
|
+
] }) : state.error ? /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center justify-center space-y-4 rounded-xl border border-destructive/20 bg-destructive/5 p-8 text-center", children: [
|
|
1665
|
+
/* @__PURE__ */ jsx4("p", { className: "text-destructive text-sm font-medium", children: state.error }),
|
|
1666
|
+
/* @__PURE__ */ jsx4(
|
|
1481
1667
|
"button",
|
|
1482
1668
|
{
|
|
1483
1669
|
type: "button",
|
|
@@ -1486,7 +1672,7 @@ function StandalonePricingPage({
|
|
|
1486
1672
|
children: "Try Again"
|
|
1487
1673
|
}
|
|
1488
1674
|
)
|
|
1489
|
-
] }) : /* @__PURE__ */
|
|
1675
|
+
] }) : /* @__PURE__ */ jsx4(
|
|
1490
1676
|
PricingPage,
|
|
1491
1677
|
{
|
|
1492
1678
|
tiers: state.tiers,
|
|
@@ -1497,14 +1683,14 @@ function StandalonePricingPage({
|
|
|
1497
1683
|
loading: state.selectingTier
|
|
1498
1684
|
}
|
|
1499
1685
|
),
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
FAQ.map(({ q, a }) => /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ jsxs4("div", { className: "mx-auto max-w-2xl space-y-4 border-t border-border pt-12", children: [
|
|
1687
|
+
/* @__PURE__ */ jsx4("h2", { className: "text-center text-xl font-bold text-foreground mb-6", children: "Frequently Asked Questions" }),
|
|
1688
|
+
FAQ.map(({ q, a }) => /* @__PURE__ */ jsxs4("details", { className: "group rounded-xl border border-border bg-card overflow-hidden", children: [
|
|
1689
|
+
/* @__PURE__ */ jsxs4("summary", { className: "flex cursor-pointer items-center justify-between px-6 py-4 font-medium text-foreground text-sm", children: [
|
|
1504
1690
|
q,
|
|
1505
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: "h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180" })
|
|
1506
1692
|
] }),
|
|
1507
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ jsx4("div", { className: "px-6 pb-4", children: /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground leading-relaxed", children: a }) })
|
|
1508
1694
|
] }, q))
|
|
1509
1695
|
] })
|
|
1510
1696
|
] });
|
|
@@ -1536,7 +1722,7 @@ import {
|
|
|
1536
1722
|
} from "@tangle-network/ui/primitives";
|
|
1537
1723
|
import { EmptyState } from "@tangle-network/ui/primitives";
|
|
1538
1724
|
import { Input as Input2 } from "@tangle-network/ui/primitives";
|
|
1539
|
-
import { jsx as
|
|
1725
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1540
1726
|
var TIER_LIMITS = {
|
|
1541
1727
|
free: 3,
|
|
1542
1728
|
starter: 10,
|
|
@@ -1589,14 +1775,14 @@ function ProfilesPage({
|
|
|
1589
1775
|
const filteredCustom = customProfiles.filter(
|
|
1590
1776
|
(p) => p.name.toLowerCase().includes(searchQuery.toLowerCase()) || p.description?.toLowerCase().includes(searchQuery.toLowerCase())
|
|
1591
1777
|
);
|
|
1592
|
-
return /* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ jsxs5("div", { className: "space-y-6", children: [
|
|
1779
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
1780
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1781
|
+
/* @__PURE__ */ jsx5("h1", { className: "font-semibold text-2xl", children: title }),
|
|
1782
|
+
/* @__PURE__ */ jsx5("p", { className: "text-muted-foreground", children: "Customize agent behavior with system prompts, models, and instructions" })
|
|
1597
1783
|
] }),
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
onCompareClick && customProfiles.length >= 2 && /* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3", children: [
|
|
1785
|
+
onCompareClick && customProfiles.length >= 2 && /* @__PURE__ */ jsx5(
|
|
1600
1786
|
Button2,
|
|
1601
1787
|
{
|
|
1602
1788
|
variant: "outline",
|
|
@@ -1604,30 +1790,30 @@ function ProfilesPage({
|
|
|
1604
1790
|
children: "Compare Profiles"
|
|
1605
1791
|
}
|
|
1606
1792
|
),
|
|
1607
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ jsxs5(
|
|
1608
1794
|
Button2,
|
|
1609
1795
|
{
|
|
1610
1796
|
onClick: () => setCreateDialogOpen(true),
|
|
1611
1797
|
disabled: !canCreateMore,
|
|
1612
1798
|
children: [
|
|
1613
|
-
/* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ jsx5(Plus2, { className: "mr-2 h-4 w-4" }),
|
|
1614
1800
|
"Create Profile"
|
|
1615
1801
|
]
|
|
1616
1802
|
}
|
|
1617
1803
|
)
|
|
1618
1804
|
] })
|
|
1619
1805
|
] }),
|
|
1620
|
-
!canCreateMore && /* @__PURE__ */
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1806
|
+
!canCreateMore && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 rounded-lg border border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] p-3 text-sm text-[var(--surface-warning-text)]", children: [
|
|
1807
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "h-4 w-4" }),
|
|
1808
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1623
1809
|
"You've reached your profile limit (",
|
|
1624
1810
|
profileLimit,
|
|
1625
1811
|
" profiles). Upgrade your plan to create more."
|
|
1626
1812
|
] })
|
|
1627
1813
|
] }),
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1814
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative max-w-md", children: [
|
|
1815
|
+
/* @__PURE__ */ jsx5(Search, { className: "absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1816
|
+
/* @__PURE__ */ jsx5(
|
|
1631
1817
|
Input2,
|
|
1632
1818
|
{
|
|
1633
1819
|
placeholder: "Search profiles...",
|
|
@@ -1637,33 +1823,33 @@ function ProfilesPage({
|
|
|
1637
1823
|
}
|
|
1638
1824
|
)
|
|
1639
1825
|
] }),
|
|
1640
|
-
error && /* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1826
|
+
error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 rounded-lg border border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] p-3 text-[var(--surface-danger-text)] text-sm", children: [
|
|
1827
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "h-4 w-4" }),
|
|
1828
|
+
/* @__PURE__ */ jsx5("span", { children: error }),
|
|
1829
|
+
/* @__PURE__ */ jsx5(Button2, { variant: "ghost", size: "sm", onClick: loadProfiles, children: "Retry" })
|
|
1644
1830
|
] }),
|
|
1645
|
-
loading && /* @__PURE__ */
|
|
1646
|
-
!loading && /* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
/* @__PURE__ */
|
|
1831
|
+
loading && /* @__PURE__ */ jsx5("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx5(Loader22, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
|
|
1832
|
+
!loading && /* @__PURE__ */ jsxs5("div", { className: "space-y-8", children: [
|
|
1833
|
+
/* @__PURE__ */ jsxs5("section", { children: [
|
|
1834
|
+
/* @__PURE__ */ jsx5("div", { className: "mb-3 flex items-center justify-between", children: /* @__PURE__ */ jsxs5("h2", { className: "font-medium text-lg", children: [
|
|
1649
1835
|
"Your Profiles (",
|
|
1650
1836
|
customProfiles.length,
|
|
1651
1837
|
"/",
|
|
1652
1838
|
profileLimit === Number.POSITIVE_INFINITY ? "inf" : profileLimit,
|
|
1653
1839
|
")"
|
|
1654
1840
|
] }) }),
|
|
1655
|
-
filteredCustom.length === 0 ? /* @__PURE__ */
|
|
1841
|
+
filteredCustom.length === 0 ? /* @__PURE__ */ jsx5(
|
|
1656
1842
|
EmptyState,
|
|
1657
1843
|
{
|
|
1658
|
-
icon: /* @__PURE__ */
|
|
1844
|
+
icon: /* @__PURE__ */ jsx5(Settings2, { className: "h-8 w-8" }),
|
|
1659
1845
|
title: "No custom profiles yet",
|
|
1660
1846
|
description: "Create a profile to customize agent behavior",
|
|
1661
|
-
action: canCreateMore ? /* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1847
|
+
action: canCreateMore ? /* @__PURE__ */ jsxs5(Button2, { onClick: () => setCreateDialogOpen(true), children: [
|
|
1848
|
+
/* @__PURE__ */ jsx5(Plus2, { className: "mr-2 h-4 w-4" }),
|
|
1663
1849
|
"Create Profile"
|
|
1664
1850
|
] }) : void 0
|
|
1665
1851
|
}
|
|
1666
|
-
) : /* @__PURE__ */
|
|
1852
|
+
) : /* @__PURE__ */ jsx5("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: filteredCustom.map((profile) => /* @__PURE__ */ jsx5(
|
|
1667
1853
|
ProfileCard,
|
|
1668
1854
|
{
|
|
1669
1855
|
profile,
|
|
@@ -1674,13 +1860,13 @@ function ProfilesPage({
|
|
|
1674
1860
|
profile.id
|
|
1675
1861
|
)) })
|
|
1676
1862
|
] }),
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1863
|
+
/* @__PURE__ */ jsxs5("section", { children: [
|
|
1864
|
+
/* @__PURE__ */ jsx5("div", { className: "mb-3 flex items-center justify-between", children: /* @__PURE__ */ jsxs5("h2", { className: "font-medium text-lg", children: [
|
|
1679
1865
|
"Built-in Profiles (",
|
|
1680
1866
|
builtinProfiles.length,
|
|
1681
1867
|
")"
|
|
1682
1868
|
] }) }),
|
|
1683
|
-
filteredBuiltin.length === 0 ? /* @__PURE__ */
|
|
1869
|
+
filteredBuiltin.length === 0 ? /* @__PURE__ */ jsx5("p", { className: "text-muted-foreground text-sm", children: "No matching built-in profiles" }) : /* @__PURE__ */ jsx5("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: filteredBuiltin.map((profile) => /* @__PURE__ */ jsx5(
|
|
1684
1870
|
ProfileCard,
|
|
1685
1871
|
{
|
|
1686
1872
|
profile,
|
|
@@ -1691,7 +1877,7 @@ function ProfilesPage({
|
|
|
1691
1877
|
)) })
|
|
1692
1878
|
] })
|
|
1693
1879
|
] }),
|
|
1694
|
-
/* @__PURE__ */
|
|
1880
|
+
/* @__PURE__ */ jsx5(
|
|
1695
1881
|
ProfileFormDialog,
|
|
1696
1882
|
{
|
|
1697
1883
|
open: createDialogOpen || !!editingProfile,
|
|
@@ -1709,7 +1895,7 @@ function ProfilesPage({
|
|
|
1709
1895
|
}
|
|
1710
1896
|
}
|
|
1711
1897
|
),
|
|
1712
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsx5(
|
|
1713
1899
|
DeleteProfileDialog,
|
|
1714
1900
|
{
|
|
1715
1901
|
profile: deletingProfile,
|
|
@@ -1721,7 +1907,7 @@ function ProfilesPage({
|
|
|
1721
1907
|
}
|
|
1722
1908
|
}
|
|
1723
1909
|
),
|
|
1724
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsx5(
|
|
1725
1911
|
ProfileDetailDialog,
|
|
1726
1912
|
{
|
|
1727
1913
|
profile: detailProfile,
|
|
@@ -1750,61 +1936,61 @@ function ProfileCard({
|
|
|
1750
1936
|
onDelete,
|
|
1751
1937
|
isBuiltin
|
|
1752
1938
|
}) {
|
|
1753
|
-
return /* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ jsxs5(
|
|
1754
1940
|
Card,
|
|
1755
1941
|
{
|
|
1756
1942
|
className: "cursor-pointer p-4 transition-colors hover:border-border/80",
|
|
1757
1943
|
onClick: onView,
|
|
1758
1944
|
children: [
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
isBuiltin && /* @__PURE__ */
|
|
1764
|
-
profile.is_public && !isBuiltin && /* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between", children: [
|
|
1946
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex-1", children: [
|
|
1947
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
1948
|
+
/* @__PURE__ */ jsx5("h3", { className: "font-medium", children: profile.name }),
|
|
1949
|
+
isBuiltin && /* @__PURE__ */ jsx5(Badge2, { variant: "secondary", className: "border-0 text-xs", children: "Built-in" }),
|
|
1950
|
+
profile.is_public && !isBuiltin && /* @__PURE__ */ jsx5(Badge2, { className: "border border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)] text-xs", children: "Public" })
|
|
1765
1951
|
] }),
|
|
1766
|
-
profile.description && /* @__PURE__ */
|
|
1952
|
+
profile.description && /* @__PURE__ */ jsx5("p", { className: "mt-1 line-clamp-2 text-muted-foreground text-sm", children: profile.description })
|
|
1767
1953
|
] }),
|
|
1768
|
-
!isBuiltin && /* @__PURE__ */
|
|
1769
|
-
onEdit && /* @__PURE__ */
|
|
1954
|
+
!isBuiltin && /* @__PURE__ */ jsxs5("div", { className: "flex gap-1", onClick: (e) => e.stopPropagation(), children: [
|
|
1955
|
+
onEdit && /* @__PURE__ */ jsx5(
|
|
1770
1956
|
Button2,
|
|
1771
1957
|
{
|
|
1772
1958
|
variant: "ghost",
|
|
1773
1959
|
size: "icon",
|
|
1774
1960
|
onClick: onEdit,
|
|
1775
1961
|
"aria-label": "Edit profile",
|
|
1776
|
-
children: /* @__PURE__ */
|
|
1962
|
+
children: /* @__PURE__ */ jsx5(Edit2, { className: "h-4 w-4" })
|
|
1777
1963
|
}
|
|
1778
1964
|
),
|
|
1779
|
-
onDelete && /* @__PURE__ */
|
|
1965
|
+
onDelete && /* @__PURE__ */ jsx5(
|
|
1780
1966
|
Button2,
|
|
1781
1967
|
{
|
|
1782
1968
|
variant: "ghost",
|
|
1783
1969
|
size: "icon",
|
|
1784
1970
|
onClick: onDelete,
|
|
1785
1971
|
"aria-label": "Delete profile",
|
|
1786
|
-
children: /* @__PURE__ */
|
|
1972
|
+
children: /* @__PURE__ */ jsx5(Trash22, { className: "h-4 w-4 text-[var(--surface-danger-text)]" })
|
|
1787
1973
|
}
|
|
1788
1974
|
)
|
|
1789
1975
|
] })
|
|
1790
1976
|
] }),
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
profile.extends && /* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsxs5("div", { className: "mt-3 flex flex-wrap gap-2", children: [
|
|
1978
|
+
profile.extends && /* @__PURE__ */ jsxs5(Badge2, { variant: "outline", className: "text-xs", children: [
|
|
1793
1979
|
"extends ",
|
|
1794
1980
|
profile.extends
|
|
1795
1981
|
] }),
|
|
1796
|
-
profile.model && /* @__PURE__ */
|
|
1982
|
+
profile.model && /* @__PURE__ */ jsx5(Badge2, { variant: "outline", className: "text-xs", children: profile.model.split("/").pop() })
|
|
1797
1983
|
] }),
|
|
1798
|
-
profile.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1984
|
+
profile.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */ jsxs5("div", { className: "mt-3 flex gap-4 border-border border-t pt-3 text-muted-foreground text-xs", children: [
|
|
1985
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1800
1986
|
profile.metrics.total_runs,
|
|
1801
1987
|
" runs"
|
|
1802
1988
|
] }),
|
|
1803
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1804
1990
|
profile.metrics.success_rate.toFixed(0),
|
|
1805
1991
|
"% success"
|
|
1806
1992
|
] }),
|
|
1807
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1808
1994
|
"~",
|
|
1809
1995
|
(profile.metrics.avg_duration_ms / 1e3).toFixed(1),
|
|
1810
1996
|
"s avg"
|
|
@@ -1891,19 +2077,19 @@ function ProfileFormDialog({
|
|
|
1891
2077
|
setSaving(false);
|
|
1892
2078
|
}
|
|
1893
2079
|
};
|
|
1894
|
-
return /* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
2080
|
+
return /* @__PURE__ */ jsx5(Dialog, { open, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ jsxs5(DialogContent, { className: "max-w-2xl", children: [
|
|
2081
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
2082
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: isEditing ? "Edit Profile" : "Create Profile" }),
|
|
2083
|
+
/* @__PURE__ */ jsx5(DialogDescription, { children: isEditing ? "Update your custom profile configuration" : "Create a new profile to customize agent behavior" })
|
|
1898
2084
|
] }),
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
error && /* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
|
|
2086
|
+
error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 rounded-lg border border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] p-3 text-[var(--surface-danger-text)] text-sm", children: [
|
|
2087
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "h-4 w-4" }),
|
|
2088
|
+
/* @__PURE__ */ jsx5("span", { children: error })
|
|
1903
2089
|
] }),
|
|
1904
|
-
/* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */
|
|
1906
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2091
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "Name *" }),
|
|
2092
|
+
/* @__PURE__ */ jsx5(
|
|
1907
2093
|
Input2,
|
|
1908
2094
|
{
|
|
1909
2095
|
value: formData.name,
|
|
@@ -1915,9 +2101,9 @@ function ProfileFormDialog({
|
|
|
1915
2101
|
}
|
|
1916
2102
|
)
|
|
1917
2103
|
] }),
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2105
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "Description" }),
|
|
2106
|
+
/* @__PURE__ */ jsx5(
|
|
1921
2107
|
Input2,
|
|
1922
2108
|
{
|
|
1923
2109
|
value: formData.description,
|
|
@@ -1926,17 +2112,17 @@ function ProfileFormDialog({
|
|
|
1926
2112
|
}
|
|
1927
2113
|
)
|
|
1928
2114
|
] }),
|
|
1929
|
-
/* @__PURE__ */
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2116
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "Extends (base profile)" }),
|
|
2117
|
+
/* @__PURE__ */ jsxs5(
|
|
1932
2118
|
"select",
|
|
1933
2119
|
{
|
|
1934
2120
|
value: formData.extends,
|
|
1935
2121
|
onChange: (e) => setFormData((d) => ({ ...d, extends: e.target.value })),
|
|
1936
2122
|
className: "w-full rounded-md border border-border bg-background px-3 py-2 text-sm",
|
|
1937
2123
|
children: [
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
builtinProfiles.map((p) => /* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ jsx5("option", { value: "", children: "None (start from scratch)" }),
|
|
2125
|
+
builtinProfiles.map((p) => /* @__PURE__ */ jsxs5("option", { value: p.name, children: [
|
|
1940
2126
|
p.name,
|
|
1941
2127
|
" - ",
|
|
1942
2128
|
p.description ?? "Built-in profile"
|
|
@@ -1945,9 +2131,9 @@ function ProfileFormDialog({
|
|
|
1945
2131
|
}
|
|
1946
2132
|
)
|
|
1947
2133
|
] }),
|
|
1948
|
-
/* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2135
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "Model" }),
|
|
2136
|
+
/* @__PURE__ */ jsx5(
|
|
1951
2137
|
Input2,
|
|
1952
2138
|
{
|
|
1953
2139
|
value: formData.model,
|
|
@@ -1955,11 +2141,11 @@ function ProfileFormDialog({
|
|
|
1955
2141
|
placeholder: "anthropic/claude-sonnet-4"
|
|
1956
2142
|
}
|
|
1957
2143
|
),
|
|
1958
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-1 text-muted-foreground text-xs", children: "Format: provider/model-id (e.g., anthropic/claude-sonnet-4)" })
|
|
1959
2145
|
] }),
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
-
/* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2147
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "System Prompt" }),
|
|
2148
|
+
/* @__PURE__ */ jsx5(
|
|
1963
2149
|
"textarea",
|
|
1964
2150
|
{
|
|
1965
2151
|
value: formData.system_prompt,
|
|
@@ -1970,9 +2156,9 @@ function ProfileFormDialog({
|
|
|
1970
2156
|
}
|
|
1971
2157
|
)
|
|
1972
2158
|
] }),
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2160
|
+
/* @__PURE__ */ jsx5("label", { className: "mb-1 block font-medium text-sm", children: "Tags" }),
|
|
2161
|
+
/* @__PURE__ */ jsx5(
|
|
1976
2162
|
Input2,
|
|
1977
2163
|
{
|
|
1978
2164
|
value: formData.tags?.join(", "),
|
|
@@ -1983,10 +2169,10 @@ function ProfileFormDialog({
|
|
|
1983
2169
|
placeholder: "trading, aggressive, experimental"
|
|
1984
2170
|
}
|
|
1985
2171
|
),
|
|
1986
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ jsx5("p", { className: "mt-1 text-muted-foreground text-xs", children: "Comma-separated tags for organization" })
|
|
1987
2173
|
] }),
|
|
1988
|
-
/* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
2175
|
+
/* @__PURE__ */ jsx5(
|
|
1990
2176
|
"input",
|
|
1991
2177
|
{
|
|
1992
2178
|
type: "checkbox",
|
|
@@ -1996,12 +2182,12 @@ function ProfileFormDialog({
|
|
|
1996
2182
|
className: "rounded border-border"
|
|
1997
2183
|
}
|
|
1998
2184
|
),
|
|
1999
|
-
/* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ jsx5("label", { htmlFor: "is_public", className: "text-sm", children: "Make this profile public (visible to other users)" })
|
|
2000
2186
|
] }),
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
saving && /* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
2188
|
+
/* @__PURE__ */ jsx5(Button2, { type: "button", variant: "outline", onClick: onClose, children: "Cancel" }),
|
|
2189
|
+
/* @__PURE__ */ jsxs5(Button2, { type: "submit", disabled: saving || !formData.name, children: [
|
|
2190
|
+
saving && /* @__PURE__ */ jsx5(Loader22, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2005
2191
|
isEditing ? "Save Changes" : "Create Profile"
|
|
2006
2192
|
] })
|
|
2007
2193
|
] })
|
|
@@ -2029,34 +2215,34 @@ function DeleteProfileDialog({
|
|
|
2029
2215
|
setDeleting(false);
|
|
2030
2216
|
}
|
|
2031
2217
|
};
|
|
2032
|
-
return /* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2218
|
+
return /* @__PURE__ */ jsx5(Dialog, { open: !!profile, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ jsxs5(DialogContent, { children: [
|
|
2219
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
2220
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: "Delete Profile" }),
|
|
2221
|
+
/* @__PURE__ */ jsxs5(DialogDescription, { children: [
|
|
2036
2222
|
'Are you sure you want to delete "',
|
|
2037
2223
|
profile?.name,
|
|
2038
2224
|
'"? This action cannot be undone.'
|
|
2039
2225
|
] })
|
|
2040
2226
|
] }),
|
|
2041
|
-
error && /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2227
|
+
error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 rounded-lg border border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] p-3 text-[var(--surface-danger-text)] text-sm", children: [
|
|
2228
|
+
/* @__PURE__ */ jsx5(AlertCircle, { className: "h-4 w-4" }),
|
|
2229
|
+
/* @__PURE__ */ jsx5("span", { children: error })
|
|
2044
2230
|
] }),
|
|
2045
|
-
profile?.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */
|
|
2231
|
+
profile?.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */ jsxs5("div", { className: "rounded-lg border border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] p-3 text-sm text-[var(--surface-warning-text)]", children: [
|
|
2046
2232
|
"This profile has ",
|
|
2047
2233
|
profile.metrics.total_runs,
|
|
2048
2234
|
" recorded runs. Deleting it will lose all performance metrics."
|
|
2049
2235
|
] }),
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
2237
|
+
/* @__PURE__ */ jsx5(Button2, { variant: "outline", onClick: onClose, children: "Cancel" }),
|
|
2238
|
+
/* @__PURE__ */ jsxs5(
|
|
2053
2239
|
Button2,
|
|
2054
2240
|
{
|
|
2055
2241
|
variant: "destructive",
|
|
2056
2242
|
onClick: handleDelete,
|
|
2057
2243
|
disabled: deleting,
|
|
2058
2244
|
children: [
|
|
2059
|
-
deleting && /* @__PURE__ */
|
|
2245
|
+
deleting && /* @__PURE__ */ jsx5(Loader22, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2060
2246
|
"Delete Profile"
|
|
2061
2247
|
]
|
|
2062
2248
|
}
|
|
@@ -2071,35 +2257,35 @@ function ProfileDetailDialog({
|
|
|
2071
2257
|
onDuplicate
|
|
2072
2258
|
}) {
|
|
2073
2259
|
if (!profile) return null;
|
|
2074
|
-
return /* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2078
|
-
profile.is_builtin && /* @__PURE__ */
|
|
2079
|
-
profile.is_public && !profile.is_builtin && /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ jsx5(Dialog, { open: !!profile, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ jsxs5(DialogContent, { className: "max-w-2xl", children: [
|
|
2261
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
2262
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
2263
|
+
/* @__PURE__ */ jsx5(DialogTitle, { children: profile.name }),
|
|
2264
|
+
profile.is_builtin && /* @__PURE__ */ jsx5(Badge2, { variant: "secondary", className: "border-0", children: "Built-in" }),
|
|
2265
|
+
profile.is_public && !profile.is_builtin && /* @__PURE__ */ jsx5(Badge2, { className: "border border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]", children: "Public" })
|
|
2080
2266
|
] }),
|
|
2081
|
-
profile.description && /* @__PURE__ */
|
|
2267
|
+
profile.description && /* @__PURE__ */ jsx5(DialogDescription, { children: profile.description })
|
|
2082
2268
|
] }),
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
profile.extends && /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2269
|
+
/* @__PURE__ */ jsxs5("div", { className: "space-y-4", children: [
|
|
2270
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid gap-4 sm:grid-cols-2", children: [
|
|
2271
|
+
profile.extends && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2272
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "Extends" }),
|
|
2273
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm", children: profile.extends })
|
|
2088
2274
|
] }),
|
|
2089
|
-
profile.model && /* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2275
|
+
profile.model && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2276
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "Model" }),
|
|
2277
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm", children: profile.model })
|
|
2092
2278
|
] })
|
|
2093
2279
|
] }),
|
|
2094
|
-
profile.tags && profile.tags.length > 0 && /* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
2280
|
+
profile.tags && profile.tags.length > 0 && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2281
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "Tags" }),
|
|
2282
|
+
/* @__PURE__ */ jsx5("div", { className: "mt-1 flex flex-wrap gap-1", children: profile.tags.map((tag) => /* @__PURE__ */ jsx5(Badge2, { variant: "outline", className: "text-xs", children: tag }, tag)) })
|
|
2097
2283
|
] }),
|
|
2098
|
-
profile.system_prompt && /* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
/* @__PURE__ */
|
|
2284
|
+
profile.system_prompt && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2285
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "System Prompt" }),
|
|
2286
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative mt-1", children: [
|
|
2287
|
+
/* @__PURE__ */ jsx5("pre", { className: "max-h-48 overflow-auto rounded-lg bg-muted p-3 font-mono text-sm", children: profile.system_prompt }),
|
|
2288
|
+
/* @__PURE__ */ jsx5(
|
|
2103
2289
|
Button2,
|
|
2104
2290
|
{
|
|
2105
2291
|
variant: "ghost",
|
|
@@ -2107,54 +2293,54 @@ function ProfileDetailDialog({
|
|
|
2107
2293
|
className: "absolute top-2 right-2",
|
|
2108
2294
|
onClick: () => navigator.clipboard.writeText(profile.system_prompt),
|
|
2109
2295
|
"aria-label": "Copy system prompt",
|
|
2110
|
-
children: /* @__PURE__ */
|
|
2296
|
+
children: /* @__PURE__ */ jsx5(Copy, { className: "h-4 w-4" })
|
|
2111
2297
|
}
|
|
2112
2298
|
)
|
|
2113
2299
|
] })
|
|
2114
2300
|
] }),
|
|
2115
|
-
profile.instructions && profile.instructions.length > 0 && /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2301
|
+
profile.instructions && profile.instructions.length > 0 && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2302
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "Instructions" }),
|
|
2303
|
+
/* @__PURE__ */ jsx5("ul", { className: "mt-1 space-y-1", children: profile.instructions.map((inst, i) => /* @__PURE__ */ jsxs5("li", { className: "flex items-start gap-2 text-sm", children: [
|
|
2304
|
+
/* @__PURE__ */ jsx5(ChevronRight, { className: "mt-0.5 h-4 w-4 text-muted-foreground" }),
|
|
2119
2305
|
inst
|
|
2120
2306
|
] }, i)) })
|
|
2121
2307
|
] }),
|
|
2122
|
-
profile.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2308
|
+
profile.metrics && profile.metrics.total_runs > 0 && /* @__PURE__ */ jsxs5("div", { className: "rounded-lg border border-border p-4", children: [
|
|
2309
|
+
/* @__PURE__ */ jsx5("label", { className: "font-medium text-muted-foreground text-xs", children: "Performance Metrics" }),
|
|
2310
|
+
/* @__PURE__ */ jsxs5("div", { className: "mt-2 grid grid-cols-2 gap-4 sm:grid-cols-4", children: [
|
|
2311
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2312
|
+
/* @__PURE__ */ jsx5("p", { className: "font-medium text-2xl", children: profile.metrics.total_runs }),
|
|
2313
|
+
/* @__PURE__ */ jsx5("p", { className: "text-muted-foreground text-xs", children: "Total Runs" })
|
|
2128
2314
|
] }),
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2315
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2316
|
+
/* @__PURE__ */ jsxs5("p", { className: "font-medium text-2xl", children: [
|
|
2131
2317
|
profile.metrics.success_rate.toFixed(0),
|
|
2132
2318
|
"%"
|
|
2133
2319
|
] }),
|
|
2134
|
-
/* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ jsx5("p", { className: "text-muted-foreground text-xs", children: "Success Rate" })
|
|
2135
2321
|
] }),
|
|
2136
|
-
/* @__PURE__ */
|
|
2137
|
-
/* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
2323
|
+
/* @__PURE__ */ jsxs5("p", { className: "font-medium text-2xl", children: [
|
|
2138
2324
|
(profile.metrics.avg_duration_ms / 1e3).toFixed(1),
|
|
2139
2325
|
"s"
|
|
2140
2326
|
] }),
|
|
2141
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ jsx5("p", { className: "text-muted-foreground text-xs", children: "Avg Duration" })
|
|
2142
2328
|
] }),
|
|
2143
|
-
profile.metrics.avg_tokens_used && /* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2329
|
+
profile.metrics.avg_tokens_used && /* @__PURE__ */ jsxs5("div", { children: [
|
|
2330
|
+
/* @__PURE__ */ jsx5("p", { className: "font-medium text-2xl", children: profile.metrics.avg_tokens_used.toLocaleString() }),
|
|
2331
|
+
/* @__PURE__ */ jsx5("p", { className: "text-muted-foreground text-xs", children: "Avg Tokens" })
|
|
2146
2332
|
] })
|
|
2147
2333
|
] })
|
|
2148
2334
|
] })
|
|
2149
2335
|
] }),
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
-
/* @__PURE__ */
|
|
2152
|
-
onDuplicate && /* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
2337
|
+
/* @__PURE__ */ jsx5(Button2, { variant: "outline", onClick: onClose, children: "Close" }),
|
|
2338
|
+
onDuplicate && /* @__PURE__ */ jsxs5(Button2, { variant: "outline", onClick: onDuplicate, children: [
|
|
2339
|
+
/* @__PURE__ */ jsx5(Copy, { className: "mr-2 h-4 w-4" }),
|
|
2154
2340
|
"Duplicate"
|
|
2155
2341
|
] }),
|
|
2156
|
-
onEdit && /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2342
|
+
onEdit && /* @__PURE__ */ jsxs5(Button2, { onClick: onEdit, children: [
|
|
2343
|
+
/* @__PURE__ */ jsx5(Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2158
2344
|
"Edit"
|
|
2159
2345
|
] })
|
|
2160
2346
|
] })
|
|
@@ -2172,7 +2358,7 @@ import {
|
|
|
2172
2358
|
DialogHeader as DialogHeader2,
|
|
2173
2359
|
DialogTitle as DialogTitle2
|
|
2174
2360
|
} from "@tangle-network/ui/primitives";
|
|
2175
|
-
import { jsx as
|
|
2361
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2176
2362
|
function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
2177
2363
|
const [secrets, setSecrets] = React5.useState([]);
|
|
2178
2364
|
const [loading, setLoading] = React5.useState(true);
|
|
@@ -2245,36 +2431,36 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2245
2431
|
return dateStr;
|
|
2246
2432
|
}
|
|
2247
2433
|
};
|
|
2248
|
-
return /* @__PURE__ */
|
|
2249
|
-
/* @__PURE__ */
|
|
2250
|
-
/* @__PURE__ */
|
|
2251
|
-
/* @__PURE__ */
|
|
2252
|
-
/* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn("mx-auto w-full max-w-7xl space-y-8", className), children: [
|
|
2435
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-4 md:flex-row md:items-end md:justify-between", children: [
|
|
2436
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
2437
|
+
/* @__PURE__ */ jsx6("h1", { className: "font-display text-3xl font-extrabold tracking-tight text-foreground", children: "Environment Secrets" }),
|
|
2438
|
+
/* @__PURE__ */ jsx6("p", { className: "mt-1 text-sm text-muted-foreground", children: "Secrets are securely stored and automatically exposed as environment variables across all your sandboxes." })
|
|
2253
2439
|
] }),
|
|
2254
|
-
/* @__PURE__ */
|
|
2440
|
+
/* @__PURE__ */ jsxs6(
|
|
2255
2441
|
"button",
|
|
2256
2442
|
{
|
|
2257
2443
|
type: "button",
|
|
2258
2444
|
onClick: () => setIsCreateOpen(true),
|
|
2259
2445
|
className: "inline-flex items-center gap-2 rounded-lg bg-[var(--btn-primary-bg)] border border-[var(--border-accent,transparent)] px-5 py-2.5 text-sm font-semibold text-[var(--btn-primary-text)] hover:bg-[var(--btn-primary-hover)] transition-colors active:scale-[0.97]",
|
|
2260
2446
|
children: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ jsx6(Plus3, { className: "h-4 w-4" }),
|
|
2262
2448
|
"New Secret"
|
|
2263
2449
|
]
|
|
2264
2450
|
}
|
|
2265
2451
|
)
|
|
2266
2452
|
] }),
|
|
2267
|
-
teamSecretsHint && /* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2271
|
-
/* @__PURE__ */
|
|
2453
|
+
teamSecretsHint && /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 rounded-lg border border-border bg-[var(--accent-surface-soft)]/40 px-4 py-3", children: [
|
|
2454
|
+
/* @__PURE__ */ jsx6(Users, { className: "h-5 w-5 shrink-0 text-[var(--accent-text)]", "aria-hidden": "true" }),
|
|
2455
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 text-sm", children: [
|
|
2456
|
+
/* @__PURE__ */ jsx6("p", { className: "font-semibold text-foreground", children: "Setting up secrets for a team?" }),
|
|
2457
|
+
/* @__PURE__ */ jsxs6("p", { className: "mt-0.5 text-muted-foreground text-xs", children: [
|
|
2272
2458
|
"Secrets here are ",
|
|
2273
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ jsx6("strong", { children: "personal" }),
|
|
2274
2460
|
" \u2014 only available in sandboxes you create. To share credentials with teammates, configure them on the team page instead."
|
|
2275
2461
|
] })
|
|
2276
2462
|
] }),
|
|
2277
|
-
/* @__PURE__ */
|
|
2463
|
+
/* @__PURE__ */ jsxs6(
|
|
2278
2464
|
"button",
|
|
2279
2465
|
{
|
|
2280
2466
|
type: "button",
|
|
@@ -2282,24 +2468,24 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2282
2468
|
className: "inline-flex shrink-0 items-center gap-1 rounded-md border border-border bg-card px-3 py-1.5 text-xs font-semibold text-foreground hover:bg-muted transition-colors",
|
|
2283
2469
|
children: [
|
|
2284
2470
|
teamSecretsHint.label ?? "Manage team secrets",
|
|
2285
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ jsx6(ArrowRight, { className: "h-3 w-3", "aria-hidden": "true" })
|
|
2286
2472
|
]
|
|
2287
2473
|
}
|
|
2288
2474
|
)
|
|
2289
2475
|
] }),
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-4", children: [
|
|
2477
|
+
/* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-border bg-card p-5 shadow-[var(--shadow-card)]", children: [
|
|
2478
|
+
/* @__PURE__ */ jsx6("p", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Total Active Secrets" }),
|
|
2479
|
+
/* @__PURE__ */ jsx6("div", { className: "mt-2 flex items-baseline gap-2", children: /* @__PURE__ */ jsx6("span", { className: "font-display text-2xl font-extrabold text-foreground", children: secrets.length }) })
|
|
2294
2480
|
] }),
|
|
2295
|
-
/* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2481
|
+
/* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-border bg-card p-5 shadow-[var(--shadow-card)]", children: [
|
|
2482
|
+
/* @__PURE__ */ jsx6("p", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Status" }),
|
|
2483
|
+
/* @__PURE__ */ jsxs6("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
2484
|
+
/* @__PURE__ */ jsx6(CheckCircle, { className: "h-4 w-4 text-[var(--surface-success-text,#047857)]" }),
|
|
2485
|
+
/* @__PURE__ */ jsx6("span", { className: "text-sm font-semibold text-[var(--surface-success-text,#047857)]", children: "Encrypted" })
|
|
2300
2486
|
] })
|
|
2301
2487
|
] }),
|
|
2302
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ jsx6(
|
|
2303
2489
|
InfoPanel,
|
|
2304
2490
|
{
|
|
2305
2491
|
className: "md:col-span-2",
|
|
@@ -2309,11 +2495,11 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2309
2495
|
}
|
|
2310
2496
|
)
|
|
2311
2497
|
] }),
|
|
2312
|
-
error && /* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
/* @__PURE__ */
|
|
2498
|
+
error && /* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-destructive/30 bg-destructive/10 p-4 flex items-center gap-3", children: [
|
|
2499
|
+
/* @__PURE__ */ jsx6(AlertCircle2, { className: "h-5 w-5 text-destructive shrink-0" }),
|
|
2500
|
+
/* @__PURE__ */ jsx6("p", { className: "text-destructive text-sm font-medium", children: error })
|
|
2315
2501
|
] }),
|
|
2316
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ jsx6(Dialog2, { open: isCreateOpen, onOpenChange: (open) => {
|
|
2317
2503
|
if (!open) {
|
|
2318
2504
|
setIsCreateOpen(false);
|
|
2319
2505
|
setNewName("");
|
|
@@ -2321,12 +2507,12 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2321
2507
|
setCreateError(null);
|
|
2322
2508
|
setShowValue(false);
|
|
2323
2509
|
}
|
|
2324
|
-
}, children: /* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
/* @__PURE__ */
|
|
2327
|
-
/* @__PURE__ */
|
|
2510
|
+
}, children: /* @__PURE__ */ jsxs6(DialogContent2, { className: "max-w-md", children: [
|
|
2511
|
+
/* @__PURE__ */ jsxs6(DialogHeader2, { children: [
|
|
2512
|
+
/* @__PURE__ */ jsx6(DialogTitle2, { children: "Create Secret" }),
|
|
2513
|
+
/* @__PURE__ */ jsx6(DialogDescription2, { children: "Secrets are automatically exposed as environment variables across all your new sandboxes." })
|
|
2328
2514
|
] }),
|
|
2329
|
-
/* @__PURE__ */
|
|
2515
|
+
/* @__PURE__ */ jsxs6(
|
|
2330
2516
|
"form",
|
|
2331
2517
|
{
|
|
2332
2518
|
onSubmit: (e) => {
|
|
@@ -2335,9 +2521,9 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2335
2521
|
},
|
|
2336
2522
|
className: "space-y-4",
|
|
2337
2523
|
children: [
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
2525
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: "secret-name", className: "block text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Name" }),
|
|
2526
|
+
/* @__PURE__ */ jsx6(
|
|
2341
2527
|
"input",
|
|
2342
2528
|
{
|
|
2343
2529
|
id: "secret-name",
|
|
@@ -2351,10 +2537,10 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2351
2537
|
}
|
|
2352
2538
|
)
|
|
2353
2539
|
] }),
|
|
2354
|
-
/* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2357
|
-
/* @__PURE__ */
|
|
2540
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
2541
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: "secret-value", className: "block text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Value" }),
|
|
2542
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
2543
|
+
/* @__PURE__ */ jsx6(
|
|
2358
2544
|
"input",
|
|
2359
2545
|
{
|
|
2360
2546
|
id: "secret-value",
|
|
@@ -2367,26 +2553,26 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2367
2553
|
className: "w-full rounded-md border border-border bg-card px-3 py-2.5 pr-10 text-sm font-mono text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2368
2554
|
}
|
|
2369
2555
|
),
|
|
2370
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx6(
|
|
2371
2557
|
"button",
|
|
2372
2558
|
{
|
|
2373
2559
|
type: "button",
|
|
2374
2560
|
onClick: () => setShowValue(!showValue),
|
|
2375
2561
|
className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground",
|
|
2376
2562
|
"aria-label": showValue ? "Hide value" : "Show value",
|
|
2377
|
-
children: showValue ? /* @__PURE__ */
|
|
2563
|
+
children: showValue ? /* @__PURE__ */ jsx6(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx6(Eye, { className: "h-4 w-4" })
|
|
2378
2564
|
}
|
|
2379
2565
|
)
|
|
2380
2566
|
] }),
|
|
2381
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ jsx6("p", { className: "mt-1.5 text-xs text-muted-foreground", children: "This value cannot be retrieved after creation." })
|
|
2382
2568
|
] }),
|
|
2383
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ jsx6("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": "true", children: "Submit" })
|
|
2384
2570
|
]
|
|
2385
2571
|
}
|
|
2386
2572
|
),
|
|
2387
|
-
createError && /* @__PURE__ */
|
|
2388
|
-
/* @__PURE__ */
|
|
2389
|
-
/* @__PURE__ */
|
|
2573
|
+
createError && /* @__PURE__ */ jsx6("p", { className: "mt-3 text-sm text-destructive", children: createError }),
|
|
2574
|
+
/* @__PURE__ */ jsxs6(DialogFooter2, { children: [
|
|
2575
|
+
/* @__PURE__ */ jsx6(
|
|
2390
2576
|
"button",
|
|
2391
2577
|
{
|
|
2392
2578
|
type: "button",
|
|
@@ -2400,7 +2586,7 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2400
2586
|
children: "Cancel"
|
|
2401
2587
|
}
|
|
2402
2588
|
),
|
|
2403
|
-
/* @__PURE__ */
|
|
2589
|
+
/* @__PURE__ */ jsx6(
|
|
2404
2590
|
"button",
|
|
2405
2591
|
{
|
|
2406
2592
|
type: "button",
|
|
@@ -2412,19 +2598,19 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2412
2598
|
)
|
|
2413
2599
|
] })
|
|
2414
2600
|
] }) }),
|
|
2415
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ jsx6(Dialog2, { open: !!deleteTarget, onOpenChange: (open) => {
|
|
2416
2602
|
if (!open) setDeleteTarget(null);
|
|
2417
|
-
}, children: /* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
/* @__PURE__ */
|
|
2603
|
+
}, children: /* @__PURE__ */ jsxs6(DialogContent2, { className: "max-w-sm", children: [
|
|
2604
|
+
/* @__PURE__ */ jsxs6(DialogHeader2, { children: [
|
|
2605
|
+
/* @__PURE__ */ jsx6(DialogTitle2, { children: "Delete Secret?" }),
|
|
2606
|
+
/* @__PURE__ */ jsxs6(DialogDescription2, { children: [
|
|
2421
2607
|
"This will permanently delete ",
|
|
2422
|
-
/* @__PURE__ */
|
|
2608
|
+
/* @__PURE__ */ jsx6("span", { className: "font-mono font-bold text-foreground", children: deleteTarget }),
|
|
2423
2609
|
". Sandboxes using this secret will lose access to it."
|
|
2424
2610
|
] })
|
|
2425
2611
|
] }),
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ jsxs6(DialogFooter2, { children: [
|
|
2613
|
+
/* @__PURE__ */ jsx6(
|
|
2428
2614
|
"button",
|
|
2429
2615
|
{
|
|
2430
2616
|
type: "button",
|
|
@@ -2433,7 +2619,7 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2433
2619
|
children: "Cancel"
|
|
2434
2620
|
}
|
|
2435
2621
|
),
|
|
2436
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsx6(
|
|
2437
2623
|
"button",
|
|
2438
2624
|
{
|
|
2439
2625
|
type: "button",
|
|
@@ -2445,20 +2631,20 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2445
2631
|
)
|
|
2446
2632
|
] })
|
|
2447
2633
|
] }) }),
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ jsxs6("div", { className: "overflow-hidden rounded-lg border border-border bg-card shadow-[var(--shadow-card)]", children: [
|
|
2635
|
+
/* @__PURE__ */ jsxs6("div", { className: "border-b border-border px-6 py-4 flex items-center justify-between", children: [
|
|
2636
|
+
/* @__PURE__ */ jsx6("div", { className: "flex gap-6", children: /* @__PURE__ */ jsx6("button", { type: "button", className: "text-xs font-bold uppercase tracking-widest text-foreground border-b-2 border-foreground pb-1", children: "All Secrets" }) }),
|
|
2637
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-xs text-muted-foreground font-mono", children: [
|
|
2452
2638
|
secrets.length,
|
|
2453
2639
|
" secret",
|
|
2454
2640
|
secrets.length !== 1 ? "s" : ""
|
|
2455
2641
|
] })
|
|
2456
2642
|
] }),
|
|
2457
|
-
loading ? /* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2643
|
+
loading ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-center py-16", children: /* @__PURE__ */ jsx6("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" }) }) : secrets.length === 0 ? /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
2644
|
+
/* @__PURE__ */ jsx6(Lock, { className: "h-10 w-10 text-muted-foreground mb-4" }),
|
|
2645
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-lg font-semibold text-foreground", children: "No secrets yet" }),
|
|
2646
|
+
/* @__PURE__ */ jsx6("p", { className: "mt-1 text-sm text-muted-foreground max-w-sm", children: "Create a secret to inject into your sandboxes." }),
|
|
2647
|
+
/* @__PURE__ */ jsxs6(
|
|
2462
2648
|
"button",
|
|
2463
2649
|
{
|
|
2464
2650
|
type: "button",
|
|
@@ -2466,52 +2652,52 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2466
2652
|
"aria-label": "Create your first secret",
|
|
2467
2653
|
className: "mt-6 inline-flex items-center gap-2 rounded-md bg-[var(--btn-primary-bg)] px-4 py-2 text-sm font-semibold text-[var(--btn-primary-text)] hover:bg-[var(--btn-primary-hover)] transition-colors active:scale-[0.97]",
|
|
2468
2654
|
children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx6(Plus3, { className: "h-4 w-4" }),
|
|
2470
2656
|
"New Secret"
|
|
2471
2657
|
]
|
|
2472
2658
|
}
|
|
2473
2659
|
)
|
|
2474
|
-
] }) : /* @__PURE__ */
|
|
2475
|
-
/* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
/* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2660
|
+
] }) : /* @__PURE__ */ jsxs6("table", { className: "w-full text-left border-collapse", children: [
|
|
2661
|
+
/* @__PURE__ */ jsx6("thead", { children: /* @__PURE__ */ jsxs6("tr", { className: "bg-muted/30 border-b border-border", children: [
|
|
2662
|
+
/* @__PURE__ */ jsx6("th", { className: "px-6 py-4 text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Secret Name" }),
|
|
2663
|
+
/* @__PURE__ */ jsx6("th", { className: "px-6 py-4 text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Encrypted Value" }),
|
|
2664
|
+
/* @__PURE__ */ jsx6("th", { className: "px-6 py-4 text-[10px] font-bold uppercase tracking-widest text-muted-foreground text-right", children: "Created" }),
|
|
2665
|
+
/* @__PURE__ */ jsx6("th", { className: "px-6 py-4 w-12" })
|
|
2480
2666
|
] }) }),
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ jsx6("tbody", { className: "divide-y divide-border", children: secrets.map((secret) => /* @__PURE__ */ jsxs6("tr", { className: "hover:bg-muted/20 transition-colors", children: [
|
|
2668
|
+
/* @__PURE__ */ jsx6("td", { className: "px-6 py-4", children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
|
|
2669
|
+
/* @__PURE__ */ jsx6(Key, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2670
|
+
/* @__PURE__ */ jsx6("span", { className: "text-sm font-bold font-mono text-foreground", children: secret.name })
|
|
2485
2671
|
] }) }),
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
/* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ jsx6("td", { className: "px-6 py-4", children: /* @__PURE__ */ jsx6("code", { className: "text-xs font-mono text-muted-foreground bg-muted px-2 py-1 rounded", children: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" }) }),
|
|
2673
|
+
/* @__PURE__ */ jsx6("td", { className: "px-6 py-4 text-right", children: /* @__PURE__ */ jsx6("span", { className: "text-xs text-muted-foreground", children: formatDate(secret.createdAt) }) }),
|
|
2674
|
+
/* @__PURE__ */ jsx6("td", { className: "px-6 py-4", children: /* @__PURE__ */ jsx6(
|
|
2489
2675
|
"button",
|
|
2490
2676
|
{
|
|
2491
2677
|
type: "button",
|
|
2492
2678
|
onClick: () => setDeleteTarget(secret.name),
|
|
2493
2679
|
className: "p-1.5 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",
|
|
2494
2680
|
"aria-label": `Delete ${secret.name}`,
|
|
2495
|
-
children: /* @__PURE__ */
|
|
2681
|
+
children: /* @__PURE__ */ jsx6(Trash23, { className: "h-4 w-4" })
|
|
2496
2682
|
}
|
|
2497
2683
|
) })
|
|
2498
2684
|
] }, secret.name)) })
|
|
2499
2685
|
] })
|
|
2500
2686
|
] }),
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [
|
|
2688
|
+
/* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-border bg-card p-6 shadow-[var(--shadow-card)]", children: [
|
|
2689
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
2690
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-9 w-9 items-center justify-center rounded-md bg-[var(--brand-primary,hsl(var(--primary)))] text-[var(--btn-primary-text)]", children: /* @__PURE__ */ jsx6(Shield, { className: "h-5 w-5" }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-sm font-bold text-foreground", children: "Encryption Standard" })
|
|
2506
2692
|
] }),
|
|
2507
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground leading-relaxed", children: "Your secrets are encrypted using AES-256-GCM at rest and TLS 1.3 in transit. Hardware Security Modules manage all root keys." })
|
|
2508
2694
|
] }),
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsxs6("div", { className: "rounded-lg border border-border bg-card p-6 shadow-[var(--shadow-card)]", children: [
|
|
2696
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
2697
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-9 w-9 items-center justify-center rounded-md bg-[var(--brand-primary,hsl(var(--primary)))] text-[var(--btn-primary-text)]", children: /* @__PURE__ */ jsx6(Lock, { className: "h-5 w-5" }) }),
|
|
2698
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-sm font-bold text-foreground", children: "Access Policy" })
|
|
2513
2699
|
] }),
|
|
2514
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground leading-relaxed", children: "Secrets are injected at sandbox creation time and are never exposed in logs, API responses, or container metadata." })
|
|
2515
2701
|
] })
|
|
2516
2702
|
] })
|
|
2517
2703
|
] });
|
|
@@ -2520,18 +2706,18 @@ function SecretsPage({ apiClient, className, teamSecretsHint }) {
|
|
|
2520
2706
|
// src/pages/templates-page.tsx
|
|
2521
2707
|
import { Layers as Layers2 } from "lucide-react";
|
|
2522
2708
|
import { Skeleton as Skeleton3 } from "@tangle-network/ui/primitives";
|
|
2523
|
-
import { jsx as
|
|
2709
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2524
2710
|
function TemplatesPage({ templates, loading = false, onUseTemplate, className }) {
|
|
2525
|
-
return /* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2528
|
-
/* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn("space-y-8", className), children: [
|
|
2712
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
2713
|
+
/* @__PURE__ */ jsx7("h1", { className: "font-bold text-3xl text-foreground", children: "Templates" }),
|
|
2714
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-1 text-muted-foreground", children: "Pre-configured environments to get started quickly" })
|
|
2529
2715
|
] }),
|
|
2530
|
-
loading || !templates ? /* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2534
|
-
] }) : /* @__PURE__ */
|
|
2716
|
+
loading || !templates ? /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsx7(Skeleton3, { className: "h-56 rounded-2xl" }, i)) }) : templates.length === 0 ? /* @__PURE__ */ jsxs7("div", { className: "rounded-2xl border border-border bg-card p-16 text-center", children: [
|
|
2717
|
+
/* @__PURE__ */ jsx7(Layers2, { className: "mx-auto mb-3 h-10 w-10 text-muted-foreground" }),
|
|
2718
|
+
/* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-foreground mb-1", children: "No templates available" }),
|
|
2719
|
+
/* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "Check back later for pre-configured environments." })
|
|
2720
|
+
] }) : /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3", children: templates.map((template) => /* @__PURE__ */ jsx7(
|
|
2535
2721
|
TemplateCard,
|
|
2536
2722
|
{
|
|
2537
2723
|
template,
|
|
@@ -2571,7 +2757,7 @@ import {
|
|
|
2571
2757
|
DialogHeader as DialogHeader3,
|
|
2572
2758
|
DialogTitle as DialogTitle3
|
|
2573
2759
|
} from "@tangle-network/ui/primitives";
|
|
2574
|
-
import { jsx as
|
|
2760
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2575
2761
|
var SCRIPT_TYPE_META = {
|
|
2576
2762
|
bash: {
|
|
2577
2763
|
label: "Bash",
|
|
@@ -2893,41 +3079,41 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
2893
3079
|
}));
|
|
2894
3080
|
};
|
|
2895
3081
|
const activeCount = scripts.filter((s) => s.enabled).length;
|
|
2896
|
-
return /* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
/* @__PURE__ */
|
|
2900
|
-
/* @__PURE__ */
|
|
3082
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("mx-auto w-full max-w-7xl space-y-6", className), children: [
|
|
3083
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-4 md:flex-row md:items-end md:justify-between", children: [
|
|
3084
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3085
|
+
/* @__PURE__ */ jsx8("h1", { className: "font-display text-3xl font-extrabold tracking-tight text-foreground", children: "Startup Scripts" }),
|
|
3086
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground", children: "Define scripts that run automatically when your sandboxes start. Scripts can access your encrypted secrets." })
|
|
2901
3087
|
] }),
|
|
2902
|
-
/* @__PURE__ */
|
|
3088
|
+
/* @__PURE__ */ jsxs8(
|
|
2903
3089
|
"button",
|
|
2904
3090
|
{
|
|
2905
3091
|
type: "button",
|
|
2906
3092
|
onClick: openCreate,
|
|
2907
3093
|
className: "inline-flex items-center gap-2 rounded-lg bg-[var(--btn-primary-bg)] px-4 py-2.5 text-sm font-bold text-[var(--btn-primary-text)] shadow-sm transition-colors hover:bg-[var(--btn-primary-hover)]",
|
|
2908
3094
|
children: [
|
|
2909
|
-
/* @__PURE__ */
|
|
3095
|
+
/* @__PURE__ */ jsx8(Plus4, { className: "h-4 w-4" }),
|
|
2910
3096
|
"New Script"
|
|
2911
3097
|
]
|
|
2912
3098
|
}
|
|
2913
3099
|
)
|
|
2914
3100
|
] }),
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
/* @__PURE__ */
|
|
2917
|
-
/* @__PURE__ */
|
|
2918
|
-
/* @__PURE__ */
|
|
3101
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-4", children: [
|
|
3102
|
+
/* @__PURE__ */ jsxs8("div", { className: "rounded-lg border border-border bg-card p-5 shadow-[var(--shadow-card)]", children: [
|
|
3103
|
+
/* @__PURE__ */ jsx8("p", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Total Scripts" }),
|
|
3104
|
+
/* @__PURE__ */ jsx8("div", { className: "mt-2 flex items-baseline gap-2", children: /* @__PURE__ */ jsx8("span", { className: "font-display text-2xl font-extrabold text-foreground", children: scripts.length }) })
|
|
2919
3105
|
] }),
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsxs8("div", { className: "rounded-lg border border-border bg-card p-5 shadow-[var(--shadow-card)]", children: [
|
|
3107
|
+
/* @__PURE__ */ jsx8("p", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Active" }),
|
|
3108
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
3109
|
+
/* @__PURE__ */ jsx8("span", { className: "font-display text-2xl font-extrabold text-foreground", children: activeCount }),
|
|
3110
|
+
/* @__PURE__ */ jsxs8("span", { className: "text-xs text-muted-foreground", children: [
|
|
2925
3111
|
"of ",
|
|
2926
3112
|
scripts.length
|
|
2927
3113
|
] })
|
|
2928
3114
|
] })
|
|
2929
3115
|
] }),
|
|
2930
|
-
/* @__PURE__ */
|
|
3116
|
+
/* @__PURE__ */ jsx8(
|
|
2931
3117
|
InfoPanel,
|
|
2932
3118
|
{
|
|
2933
3119
|
className: "md:col-span-2",
|
|
@@ -2937,12 +3123,12 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
2937
3123
|
}
|
|
2938
3124
|
)
|
|
2939
3125
|
] }),
|
|
2940
|
-
error && /* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
2942
|
-
/* @__PURE__ */
|
|
3126
|
+
error && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 rounded-lg border border-destructive/30 bg-destructive/10 p-4", children: [
|
|
3127
|
+
/* @__PURE__ */ jsx8(AlertCircle3, { className: "h-5 w-5 shrink-0 text-destructive" }),
|
|
3128
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-destructive", children: error })
|
|
2943
3129
|
] }),
|
|
2944
|
-
/* @__PURE__ */
|
|
2945
|
-
dialogStep === "picker" && /* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx8(Dialog3, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: /* @__PURE__ */ jsxs8(DialogContent3, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
|
|
3131
|
+
dialogStep === "picker" && /* @__PURE__ */ jsxs8(
|
|
2946
3132
|
"div",
|
|
2947
3133
|
{
|
|
2948
3134
|
className: cn(
|
|
@@ -2950,14 +3136,14 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
2950
3136
|
transitionDir === "back" ? "slide-in-from-left-4" : "slide-in-from-right-4"
|
|
2951
3137
|
),
|
|
2952
3138
|
children: [
|
|
2953
|
-
/* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
/* @__PURE__ */
|
|
3139
|
+
/* @__PURE__ */ jsxs8(DialogHeader3, { children: [
|
|
3140
|
+
/* @__PURE__ */ jsx8(DialogTitle3, { children: "New Startup Script" }),
|
|
3141
|
+
/* @__PURE__ */ jsx8(DialogDescription3, { children: "Start from a template or create a blank script." })
|
|
2956
3142
|
] }),
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsxs8("div", { className: "space-y-4 py-2", children: [
|
|
3144
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3145
|
+
/* @__PURE__ */ jsx8("p", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Blank Script" }),
|
|
3146
|
+
/* @__PURE__ */ jsx8("div", { className: "flex flex-wrap gap-2", children: Object.entries(SCRIPT_TYPE_META).map(([type, meta]) => /* @__PURE__ */ jsx8(
|
|
2961
3147
|
"button",
|
|
2962
3148
|
{
|
|
2963
3149
|
type: "button",
|
|
@@ -2968,24 +3154,24 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
2968
3154
|
type
|
|
2969
3155
|
)) })
|
|
2970
3156
|
] }),
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3158
|
+
/* @__PURE__ */ jsx8("p", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Templates" }),
|
|
3159
|
+
/* @__PURE__ */ jsx8("div", { className: "space-y-2", children: SCRIPT_TEMPLATES.map((tmpl) => /* @__PURE__ */ jsxs8(
|
|
2974
3160
|
"button",
|
|
2975
3161
|
{
|
|
2976
3162
|
type: "button",
|
|
2977
3163
|
onClick: () => openFromTemplate(tmpl),
|
|
2978
3164
|
className: "w-full text-left rounded-lg border border-border bg-card p-4 hover:border-primary/30 hover:bg-muted/30 transition-colors group",
|
|
2979
3165
|
children: [
|
|
2980
|
-
/* @__PURE__ */
|
|
2981
|
-
/* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
3166
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
3167
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3168
|
+
/* @__PURE__ */ jsx8("h4", { className: "text-sm font-bold text-foreground group-hover:text-primary transition-colors", children: tmpl.name }),
|
|
3169
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-0.5 text-xs text-muted-foreground", children: tmpl.description })
|
|
2984
3170
|
] }),
|
|
2985
|
-
/* @__PURE__ */
|
|
3171
|
+
/* @__PURE__ */ jsx8("span", { className: "text-[10px] font-mono text-muted-foreground bg-muted rounded px-1.5 py-0.5", children: SCRIPT_TYPE_META[tmpl.scriptType].label })
|
|
2986
3172
|
] }),
|
|
2987
|
-
tmpl.injectSecrets.length > 0 && /* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
3173
|
+
tmpl.injectSecrets.length > 0 && /* @__PURE__ */ jsx8("div", { className: "mt-2 flex flex-wrap gap-1", children: tmpl.injectSecrets.map((s) => /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center gap-0.5 rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground", children: [
|
|
3174
|
+
/* @__PURE__ */ jsx8(Lock2, { className: "h-2.5 w-2.5" }),
|
|
2989
3175
|
s
|
|
2990
3176
|
] }, s)) })
|
|
2991
3177
|
]
|
|
@@ -2998,7 +3184,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
2998
3184
|
},
|
|
2999
3185
|
`picker-${stepKey}`
|
|
3000
3186
|
),
|
|
3001
|
-
dialogStep === "form" && /* @__PURE__ */
|
|
3187
|
+
dialogStep === "form" && /* @__PURE__ */ jsxs8(
|
|
3002
3188
|
"div",
|
|
3003
3189
|
{
|
|
3004
3190
|
className: cn(
|
|
@@ -3006,14 +3192,14 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3006
3192
|
transitionDir === "forward" ? "slide-in-from-right-4" : "slide-in-from-left-4"
|
|
3007
3193
|
),
|
|
3008
3194
|
children: [
|
|
3009
|
-
/* @__PURE__ */
|
|
3010
|
-
/* @__PURE__ */
|
|
3011
|
-
/* @__PURE__ */
|
|
3195
|
+
/* @__PURE__ */ jsxs8(DialogHeader3, { children: [
|
|
3196
|
+
/* @__PURE__ */ jsx8(DialogTitle3, { children: editingScript ? "Edit Script" : "Create Startup Script" }),
|
|
3197
|
+
/* @__PURE__ */ jsx8(DialogDescription3, { children: editingScript ? "Modify your startup script configuration." : "Define a shell script that runs when sandboxes start. Scripts execute before the AI agent." })
|
|
3012
3198
|
] }),
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3015
|
-
/* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3199
|
+
/* @__PURE__ */ jsxs8("div", { className: "space-y-5 py-2", children: [
|
|
3200
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3201
|
+
/* @__PURE__ */ jsx8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Name" }),
|
|
3202
|
+
/* @__PURE__ */ jsx8(
|
|
3017
3203
|
"input",
|
|
3018
3204
|
{
|
|
3019
3205
|
type: "text",
|
|
@@ -3025,9 +3211,9 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3025
3211
|
}
|
|
3026
3212
|
)
|
|
3027
3213
|
] }),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */
|
|
3214
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3215
|
+
/* @__PURE__ */ jsx8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Description" }),
|
|
3216
|
+
/* @__PURE__ */ jsx8(
|
|
3031
3217
|
"input",
|
|
3032
3218
|
{
|
|
3033
3219
|
type: "text",
|
|
@@ -3039,9 +3225,9 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3039
3225
|
}
|
|
3040
3226
|
)
|
|
3041
3227
|
] }),
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3229
|
+
/* @__PURE__ */ jsx8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Language" }),
|
|
3230
|
+
/* @__PURE__ */ jsx8("div", { className: "mt-1.5 flex flex-wrap gap-2", children: Object.entries(SCRIPT_TYPE_META).map(([type, meta]) => /* @__PURE__ */ jsx8(
|
|
3045
3231
|
"button",
|
|
3046
3232
|
{
|
|
3047
3233
|
type: "button",
|
|
@@ -3063,9 +3249,9 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3063
3249
|
type
|
|
3064
3250
|
)) })
|
|
3065
3251
|
] }),
|
|
3066
|
-
/* @__PURE__ */
|
|
3067
|
-
/* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3253
|
+
/* @__PURE__ */ jsx8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Script" }),
|
|
3254
|
+
/* @__PURE__ */ jsx8(
|
|
3069
3255
|
"textarea",
|
|
3070
3256
|
{
|
|
3071
3257
|
value: formData.content,
|
|
@@ -3075,19 +3261,19 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3075
3261
|
className: "mt-1.5 w-full rounded-lg border border-border bg-[var(--depth-1,hsl(var(--muted)))] px-4 py-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 resize-y"
|
|
3076
3262
|
}
|
|
3077
3263
|
),
|
|
3078
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsxs8("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
3079
3265
|
SCRIPT_TYPE_META[formData.scriptType].label,
|
|
3080
3266
|
" script. Injected secrets are available as environment variables (e.g. ",
|
|
3081
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx8("code", { className: "text-primary", children: "$GITHUB_TOKEN" }),
|
|
3082
3268
|
")."
|
|
3083
3269
|
] })
|
|
3084
3270
|
] }),
|
|
3085
|
-
secrets.length > 0 && /* @__PURE__ */
|
|
3086
|
-
/* @__PURE__ */
|
|
3087
|
-
/* @__PURE__ */
|
|
3088
|
-
/* @__PURE__ */
|
|
3271
|
+
secrets.length > 0 && /* @__PURE__ */ jsxs8("div", { children: [
|
|
3272
|
+
/* @__PURE__ */ jsx8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground", children: "Inject Secrets" }),
|
|
3273
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-0.5 text-xs text-muted-foreground", children: "Select secrets to make available as environment variables." }),
|
|
3274
|
+
/* @__PURE__ */ jsx8("div", { className: "mt-2 flex flex-wrap gap-2", children: secrets.map((secret) => {
|
|
3089
3275
|
const selected = formData.injectSecrets.includes(secret.name);
|
|
3090
|
-
return /* @__PURE__ */
|
|
3276
|
+
return /* @__PURE__ */ jsxs8(
|
|
3091
3277
|
"button",
|
|
3092
3278
|
{
|
|
3093
3279
|
type: "button",
|
|
@@ -3097,7 +3283,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3097
3283
|
selected ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted border-border text-muted-foreground hover:border-primary/20"
|
|
3098
3284
|
),
|
|
3099
3285
|
children: [
|
|
3100
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsx8(Lock2, { className: "h-3 w-3" }),
|
|
3101
3287
|
secret.name
|
|
3102
3288
|
]
|
|
3103
3289
|
},
|
|
@@ -3105,29 +3291,29 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3105
3291
|
);
|
|
3106
3292
|
}) })
|
|
3107
3293
|
] }),
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3295
|
+
/* @__PURE__ */ jsxs8(
|
|
3110
3296
|
"button",
|
|
3111
3297
|
{
|
|
3112
3298
|
type: "button",
|
|
3113
3299
|
onClick: () => setShowConditions(!showConditions),
|
|
3114
3300
|
className: "flex items-center gap-2 text-xs font-bold uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors",
|
|
3115
3301
|
children: [
|
|
3116
|
-
showConditions ? /* @__PURE__ */
|
|
3302
|
+
showConditions ? /* @__PURE__ */ jsx8(ChevronUp, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx8(ChevronDown2, { className: "h-3.5 w-3.5" }),
|
|
3117
3303
|
"Conditions & Execution"
|
|
3118
3304
|
]
|
|
3119
3305
|
}
|
|
3120
3306
|
),
|
|
3121
|
-
showConditions && /* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3307
|
+
showConditions && /* @__PURE__ */ jsxs8("div", { className: "mt-3 space-y-4 rounded-lg border border-border bg-muted/30 p-4", children: [
|
|
3308
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3309
|
+
/* @__PURE__ */ jsxs8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5", children: [
|
|
3310
|
+
/* @__PURE__ */ jsx8(Layers3, { className: "h-3.5 w-3.5" }),
|
|
3125
3311
|
"Environments"
|
|
3126
3312
|
] }),
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
environments.length > 0 && /* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-0.5 text-xs text-muted-foreground", children: environments.length > 0 ? "Only run for these environments. Leave empty to run for all." : "No templates configured. Script will run for all environments." }),
|
|
3314
|
+
environments.length > 0 && /* @__PURE__ */ jsx8("div", { className: "mt-2 flex flex-wrap gap-2", children: environments.map((env) => {
|
|
3129
3315
|
const selected = formData.environments.includes(env.id);
|
|
3130
|
-
return /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ jsx8(
|
|
3131
3317
|
"button",
|
|
3132
3318
|
{
|
|
3133
3319
|
type: "button",
|
|
@@ -3142,13 +3328,13 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3142
3328
|
);
|
|
3143
3329
|
}) })
|
|
3144
3330
|
] }),
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3147
|
-
/* @__PURE__ */
|
|
3148
|
-
/* @__PURE__ */
|
|
3331
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3332
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3333
|
+
/* @__PURE__ */ jsxs8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5", children: [
|
|
3334
|
+
/* @__PURE__ */ jsx8(Cpu2, { className: "h-3.5 w-3.5" }),
|
|
3149
3335
|
"Min CPU Cores"
|
|
3150
3336
|
] }),
|
|
3151
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx8(
|
|
3152
3338
|
"input",
|
|
3153
3339
|
{
|
|
3154
3340
|
type: "number",
|
|
@@ -3164,12 +3350,12 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3164
3350
|
}
|
|
3165
3351
|
)
|
|
3166
3352
|
] }),
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3353
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3354
|
+
/* @__PURE__ */ jsxs8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5", children: [
|
|
3355
|
+
/* @__PURE__ */ jsx8(MemoryStick, { className: "h-3.5 w-3.5" }),
|
|
3170
3356
|
"Min RAM (GB)"
|
|
3171
3357
|
] }),
|
|
3172
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx8(
|
|
3173
3359
|
"input",
|
|
3174
3360
|
{
|
|
3175
3361
|
type: "number",
|
|
@@ -3186,13 +3372,13 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3186
3372
|
)
|
|
3187
3373
|
] })
|
|
3188
3374
|
] }),
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3375
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3376
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3377
|
+
/* @__PURE__ */ jsxs8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5", children: [
|
|
3378
|
+
/* @__PURE__ */ jsx8(GripVertical, { className: "h-3.5 w-3.5" }),
|
|
3193
3379
|
"Run Order"
|
|
3194
3380
|
] }),
|
|
3195
|
-
/* @__PURE__ */
|
|
3381
|
+
/* @__PURE__ */ jsx8(
|
|
3196
3382
|
"input",
|
|
3197
3383
|
{
|
|
3198
3384
|
type: "number",
|
|
@@ -3203,14 +3389,14 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3203
3389
|
className: "mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30"
|
|
3204
3390
|
}
|
|
3205
3391
|
),
|
|
3206
|
-
/* @__PURE__ */
|
|
3392
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-1 text-xs text-muted-foreground", children: "Lower runs first" })
|
|
3207
3393
|
] }),
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
3210
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3395
|
+
/* @__PURE__ */ jsxs8("label", { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground flex items-center gap-1.5", children: [
|
|
3396
|
+
/* @__PURE__ */ jsx8(Clock, { className: "h-3.5 w-3.5" }),
|
|
3211
3397
|
"Timeout (seconds)"
|
|
3212
3398
|
] }),
|
|
3213
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ jsx8(
|
|
3214
3400
|
"input",
|
|
3215
3401
|
{
|
|
3216
3402
|
type: "number",
|
|
@@ -3223,13 +3409,13 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3223
3409
|
)
|
|
3224
3410
|
] })
|
|
3225
3411
|
] }),
|
|
3226
|
-
/* @__PURE__ */
|
|
3227
|
-
/* @__PURE__ */
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ jsxs8("div", { className: "space-y-3", children: [
|
|
3413
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between cursor-pointer", children: [
|
|
3414
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3415
|
+
/* @__PURE__ */ jsx8("span", { className: "text-sm font-medium text-foreground", children: "Continue on failure" }),
|
|
3416
|
+
/* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "If script fails, continue starting the sandbox" })
|
|
3231
3417
|
] }),
|
|
3232
|
-
/* @__PURE__ */
|
|
3418
|
+
/* @__PURE__ */ jsx8(
|
|
3233
3419
|
"button",
|
|
3234
3420
|
{
|
|
3235
3421
|
type: "button",
|
|
@@ -3238,7 +3424,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3238
3424
|
"relative h-6 w-11 rounded-full transition-colors",
|
|
3239
3425
|
formData.continueOnFailure ? "bg-primary" : "bg-border"
|
|
3240
3426
|
),
|
|
3241
|
-
children: /* @__PURE__ */
|
|
3427
|
+
children: /* @__PURE__ */ jsx8(
|
|
3242
3428
|
"span",
|
|
3243
3429
|
{
|
|
3244
3430
|
className: cn(
|
|
@@ -3250,12 +3436,12 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3250
3436
|
}
|
|
3251
3437
|
)
|
|
3252
3438
|
] }),
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
/* @__PURE__ */
|
|
3256
|
-
/* @__PURE__ */
|
|
3439
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between cursor-pointer", children: [
|
|
3440
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3441
|
+
/* @__PURE__ */ jsx8("span", { className: "text-sm font-medium text-foreground", children: "Run as root" }),
|
|
3442
|
+
/* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Execute with root privileges instead of the agent user" })
|
|
3257
3443
|
] }),
|
|
3258
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx8(
|
|
3259
3445
|
"button",
|
|
3260
3446
|
{
|
|
3261
3447
|
type: "button",
|
|
@@ -3264,7 +3450,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3264
3450
|
"relative h-6 w-11 rounded-full transition-colors",
|
|
3265
3451
|
formData.runAsRoot ? "bg-primary" : "bg-border"
|
|
3266
3452
|
),
|
|
3267
|
-
children: /* @__PURE__ */
|
|
3453
|
+
children: /* @__PURE__ */ jsx8(
|
|
3268
3454
|
"span",
|
|
3269
3455
|
{
|
|
3270
3456
|
className: cn(
|
|
@@ -3279,26 +3465,26 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3279
3465
|
] })
|
|
3280
3466
|
] })
|
|
3281
3467
|
] }),
|
|
3282
|
-
formError && /* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
/* @__PURE__ */
|
|
3468
|
+
formError && /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 rounded-lg border border-destructive/30 bg-destructive/10 p-3", children: [
|
|
3469
|
+
/* @__PURE__ */ jsx8(AlertCircle3, { className: "h-4 w-4 text-destructive" }),
|
|
3470
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm text-destructive", children: formError })
|
|
3285
3471
|
] })
|
|
3286
3472
|
] }),
|
|
3287
|
-
/* @__PURE__ */
|
|
3288
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsxs8(DialogFooter3, { className: "flex items-center justify-between sm:justify-between", children: [
|
|
3474
|
+
/* @__PURE__ */ jsx8("div", { children: !editingScript && /* @__PURE__ */ jsxs8(
|
|
3289
3475
|
"button",
|
|
3290
3476
|
{
|
|
3291
3477
|
type: "button",
|
|
3292
3478
|
onClick: () => goToStep("picker"),
|
|
3293
3479
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
3294
3480
|
children: [
|
|
3295
|
-
/* @__PURE__ */
|
|
3481
|
+
/* @__PURE__ */ jsx8("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: "m15 18-6-6 6-6" }) }),
|
|
3296
3482
|
"Back"
|
|
3297
3483
|
]
|
|
3298
3484
|
}
|
|
3299
3485
|
) }),
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3486
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
3487
|
+
/* @__PURE__ */ jsx8(
|
|
3302
3488
|
"button",
|
|
3303
3489
|
{
|
|
3304
3490
|
type: "button",
|
|
@@ -3307,7 +3493,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3307
3493
|
children: "Cancel"
|
|
3308
3494
|
}
|
|
3309
3495
|
),
|
|
3310
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsx8(
|
|
3311
3497
|
"button",
|
|
3312
3498
|
{
|
|
3313
3499
|
type: "button",
|
|
@@ -3324,17 +3510,17 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3324
3510
|
`form-${stepKey}`
|
|
3325
3511
|
)
|
|
3326
3512
|
] }) }),
|
|
3327
|
-
/* @__PURE__ */
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ jsx8(Dialog3, { open: !!deleteTarget, onOpenChange: () => setDeleteTarget(null), children: /* @__PURE__ */ jsxs8(DialogContent3, { className: "max-w-md", children: [
|
|
3514
|
+
/* @__PURE__ */ jsxs8(DialogHeader3, { children: [
|
|
3515
|
+
/* @__PURE__ */ jsx8(DialogTitle3, { children: "Delete Startup Script" }),
|
|
3516
|
+
/* @__PURE__ */ jsxs8(DialogDescription3, { children: [
|
|
3331
3517
|
"Are you sure you want to delete \u201C",
|
|
3332
3518
|
deleteTarget?.name,
|
|
3333
3519
|
"\u201D? This action cannot be undone."
|
|
3334
3520
|
] })
|
|
3335
3521
|
] }),
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3522
|
+
/* @__PURE__ */ jsxs8(DialogFooter3, { children: [
|
|
3523
|
+
/* @__PURE__ */ jsx8(
|
|
3338
3524
|
"button",
|
|
3339
3525
|
{
|
|
3340
3526
|
type: "button",
|
|
@@ -3343,7 +3529,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3343
3529
|
children: "Cancel"
|
|
3344
3530
|
}
|
|
3345
3531
|
),
|
|
3346
|
-
/* @__PURE__ */
|
|
3532
|
+
/* @__PURE__ */ jsx8(
|
|
3347
3533
|
"button",
|
|
3348
3534
|
{
|
|
3349
3535
|
type: "button",
|
|
@@ -3355,20 +3541,20 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3355
3541
|
)
|
|
3356
3542
|
] })
|
|
3357
3543
|
] }) }),
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ jsxs8("div", { className: "overflow-hidden rounded-lg border border-border bg-card shadow-[var(--shadow-card)]", children: [
|
|
3545
|
+
/* @__PURE__ */ jsxs8("div", { className: "border-b border-border px-6 py-4 flex items-center justify-between", children: [
|
|
3546
|
+
/* @__PURE__ */ jsx8("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx8("button", { className: "text-xs font-bold uppercase tracking-widest text-foreground", children: "All Scripts" }) }),
|
|
3547
|
+
/* @__PURE__ */ jsxs8("span", { className: "text-xs text-muted-foreground font-mono", children: [
|
|
3362
3548
|
scripts.length,
|
|
3363
3549
|
" script",
|
|
3364
3550
|
scripts.length !== 1 ? "s" : ""
|
|
3365
3551
|
] })
|
|
3366
3552
|
] }),
|
|
3367
|
-
loading ? /* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3369
|
-
/* @__PURE__ */
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3553
|
+
loading ? /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-center py-16", children: /* @__PURE__ */ jsx8("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent" }) }) : scripts.length === 0 ? /* @__PURE__ */ jsxs8("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
3554
|
+
/* @__PURE__ */ jsx8(Terminal, { className: "h-10 w-10 text-muted-foreground mb-4" }),
|
|
3555
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-lg font-semibold text-foreground", children: "No startup scripts yet" }),
|
|
3556
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground max-w-sm", children: "Create a script to run automatically when your sandboxes start." }),
|
|
3557
|
+
/* @__PURE__ */ jsxs8(
|
|
3372
3558
|
"button",
|
|
3373
3559
|
{
|
|
3374
3560
|
type: "button",
|
|
@@ -3376,12 +3562,12 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3376
3562
|
"aria-label": "Create your first startup script",
|
|
3377
3563
|
className: "mt-4 inline-flex items-center gap-2 rounded-lg bg-[var(--btn-primary-bg)] px-4 py-2.5 text-sm font-bold text-[var(--btn-primary-text)] shadow-sm transition-colors hover:bg-[var(--btn-primary-hover)]",
|
|
3378
3564
|
children: [
|
|
3379
|
-
/* @__PURE__ */
|
|
3565
|
+
/* @__PURE__ */ jsx8(Plus4, { className: "h-4 w-4" }),
|
|
3380
3566
|
"New Script"
|
|
3381
3567
|
]
|
|
3382
3568
|
}
|
|
3383
3569
|
)
|
|
3384
|
-
] }) : /* @__PURE__ */
|
|
3570
|
+
] }) : /* @__PURE__ */ jsx8("div", { className: "divide-y divide-border", children: scripts.map((script) => /* @__PURE__ */ jsxs8(
|
|
3385
3571
|
"div",
|
|
3386
3572
|
{
|
|
3387
3573
|
className: cn(
|
|
@@ -3389,7 +3575,7 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3389
3575
|
!script.enabled && "opacity-60"
|
|
3390
3576
|
),
|
|
3391
3577
|
children: [
|
|
3392
|
-
/* @__PURE__ */
|
|
3578
|
+
/* @__PURE__ */ jsx8(
|
|
3393
3579
|
"button",
|
|
3394
3580
|
{
|
|
3395
3581
|
type: "button",
|
|
@@ -3399,53 +3585,53 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3399
3585
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors",
|
|
3400
3586
|
script.enabled ? "bg-[var(--surface-success-bg,hsl(142 76% 90%))] text-[var(--surface-success-text,hsl(142 76% 36%))]" : "bg-muted text-muted-foreground"
|
|
3401
3587
|
),
|
|
3402
|
-
children: script.enabled ? /* @__PURE__ */
|
|
3588
|
+
children: script.enabled ? /* @__PURE__ */ jsx8(Power, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx8(PowerOff, { className: "h-4 w-4" })
|
|
3403
3589
|
}
|
|
3404
3590
|
),
|
|
3405
|
-
/* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
script.runOrder !== 100 && /* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex-1 min-w-0", children: [
|
|
3592
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
3593
|
+
/* @__PURE__ */ jsx8("h4", { className: "text-sm font-bold text-foreground truncate", children: script.name }),
|
|
3594
|
+
/* @__PURE__ */ jsx8("span", { className: "text-[10px] font-mono text-muted-foreground bg-muted rounded px-1.5 py-0.5", children: SCRIPT_TYPE_META[script.scriptType ?? "bash"].label }),
|
|
3595
|
+
script.runOrder !== 100 && /* @__PURE__ */ jsxs8("span", { className: "text-[10px] font-mono text-muted-foreground bg-muted rounded px-1.5 py-0.5", children: [
|
|
3410
3596
|
"#",
|
|
3411
3597
|
script.runOrder
|
|
3412
3598
|
] })
|
|
3413
3599
|
] }),
|
|
3414
|
-
script.description && /* @__PURE__ */
|
|
3415
|
-
/* @__PURE__ */
|
|
3416
|
-
script.environments.map((env) => /* @__PURE__ */
|
|
3417
|
-
script.injectSecrets.map((s) => /* @__PURE__ */
|
|
3418
|
-
/* @__PURE__ */
|
|
3600
|
+
script.description && /* @__PURE__ */ jsx8("p", { className: "mt-0.5 text-xs text-muted-foreground truncate", children: script.description }),
|
|
3601
|
+
/* @__PURE__ */ jsxs8("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: [
|
|
3602
|
+
script.environments.map((env) => /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary", children: env }, env)),
|
|
3603
|
+
script.injectSecrets.map((s) => /* @__PURE__ */ jsxs8("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground flex items-center gap-0.5", children: [
|
|
3604
|
+
/* @__PURE__ */ jsx8(Lock2, { className: "h-2.5 w-2.5" }),
|
|
3419
3605
|
s
|
|
3420
3606
|
] }, s)),
|
|
3421
|
-
script.continueOnFailure && /* @__PURE__ */
|
|
3422
|
-
script.runAsRoot && /* @__PURE__ */
|
|
3607
|
+
script.continueOnFailure && /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-600", children: "soft fail" }),
|
|
3608
|
+
script.runAsRoot && /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive", children: "root" })
|
|
3423
3609
|
] })
|
|
3424
3610
|
] }),
|
|
3425
|
-
/* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsxs8("div", { className: "hidden md:flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
3612
|
+
/* @__PURE__ */ jsx8(Clock, { className: "h-3.5 w-3.5" }),
|
|
3427
3613
|
script.timeoutSeconds,
|
|
3428
3614
|
"s"
|
|
3429
3615
|
] }),
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3616
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1 sm:opacity-0 sm:group-hover:opacity-100 sm:focus-within:opacity-100 transition-opacity", children: [
|
|
3617
|
+
/* @__PURE__ */ jsx8(
|
|
3432
3618
|
"button",
|
|
3433
3619
|
{
|
|
3434
3620
|
type: "button",
|
|
3435
3621
|
onClick: () => openEdit(script),
|
|
3436
3622
|
className: "rounded-md p-2 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
3437
3623
|
"aria-label": `Edit ${script.name}`,
|
|
3438
|
-
children: /* @__PURE__ */
|
|
3624
|
+
children: /* @__PURE__ */ jsx8(Pencil, { className: "h-4 w-4" })
|
|
3439
3625
|
}
|
|
3440
3626
|
),
|
|
3441
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx8(
|
|
3442
3628
|
"button",
|
|
3443
3629
|
{
|
|
3444
3630
|
type: "button",
|
|
3445
3631
|
onClick: () => setDeleteTarget(script),
|
|
3446
3632
|
className: "rounded-md p-2 text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors",
|
|
3447
3633
|
"aria-label": `Delete ${script.name}`,
|
|
3448
|
-
children: /* @__PURE__ */
|
|
3634
|
+
children: /* @__PURE__ */ jsx8(Trash24, { className: "h-4 w-4" })
|
|
3449
3635
|
}
|
|
3450
3636
|
)
|
|
3451
3637
|
] })
|
|
@@ -3454,20 +3640,20 @@ function StartupScriptsPage({ apiClient, className }) {
|
|
|
3454
3640
|
script.id
|
|
3455
3641
|
)) })
|
|
3456
3642
|
] }),
|
|
3457
|
-
/* @__PURE__ */
|
|
3458
|
-
/* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [
|
|
3644
|
+
/* @__PURE__ */ jsxs8("div", { className: "rounded-lg border border-border bg-card p-6 shadow-[var(--shadow-card)]", children: [
|
|
3645
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
3646
|
+
/* @__PURE__ */ jsx8("div", { className: "flex h-9 w-9 items-center justify-center rounded-md bg-[var(--brand-primary,hsl(var(--primary)))] text-[var(--btn-primary-text)]", children: /* @__PURE__ */ jsx8(Play, { className: "h-5 w-5" }) }),
|
|
3647
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-sm font-bold text-foreground", children: "How Scripts Run" })
|
|
3462
3648
|
] }),
|
|
3463
|
-
/* @__PURE__ */
|
|
3649
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: 'Scripts execute in order after the container starts but before the AI agent. They run as bash scripts with full access to mounted tools (Nix profile) and workspace. Failed scripts abort sandbox creation unless "continue on failure" is enabled.' })
|
|
3464
3650
|
] }),
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3467
|
-
/* @__PURE__ */
|
|
3468
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsxs8("div", { className: "rounded-lg border border-border bg-card p-6 shadow-[var(--shadow-card)]", children: [
|
|
3652
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 mb-3", children: [
|
|
3653
|
+
/* @__PURE__ */ jsx8("div", { className: "flex h-9 w-9 items-center justify-center rounded-md bg-[var(--brand-primary,hsl(var(--primary)))] text-[var(--btn-primary-text)]", children: /* @__PURE__ */ jsx8(Shield2, { className: "h-5 w-5" }) }),
|
|
3654
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-sm font-bold text-foreground", children: "Security & Secrets" })
|
|
3469
3655
|
] }),
|
|
3470
|
-
/* @__PURE__ */
|
|
3656
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "Selected secrets are injected as environment variables at execution time. Secret values are never stored in the script itself \u2014 they are decrypted and injected only when the sandbox starts. Scripts can use conditions to restrict execution to specific environments or resource tiers." })
|
|
3471
3657
|
] })
|
|
3472
3658
|
] })
|
|
3473
3659
|
] });
|
|
@@ -3615,6 +3801,7 @@ function getPresetForTemplate(id) {
|
|
|
3615
3801
|
return { ...defaults, environment: id };
|
|
3616
3802
|
}
|
|
3617
3803
|
export {
|
|
3804
|
+
AuthPage,
|
|
3618
3805
|
BillingPage,
|
|
3619
3806
|
ProfilesPage,
|
|
3620
3807
|
ProvisioningWizard,
|