@burdenoff/microfe-vibecontrols 2026.1113.2 → 2026.1115.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.
|
@@ -2,23 +2,24 @@ import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { useVibeControls as t } from "../../providers/VibeControlsProvider.js";
|
|
3
3
|
import { PageHeader as n } from "../shared/PageHeader.js";
|
|
4
4
|
import { LoadingState as r } from "../shared/LoadingState.js";
|
|
5
|
-
import { ErrorState as
|
|
6
|
-
import { QuotaExhaustedDialog as
|
|
5
|
+
import { ErrorState as i } from "../shared/ErrorState.js";
|
|
6
|
+
import { QuotaExhaustedDialog as ee } from "../shared/QuotaExhaustedDialog.js";
|
|
7
7
|
import { TunnelEnvironment as a, TunnelProtocol as o, TunnelProviderKey as s } from "../../generated/wspace-types.js";
|
|
8
|
-
import { useCreateTunnelMutation as c, useListAgentsQuery as
|
|
9
|
-
import { getQuotaDialogContent as
|
|
10
|
-
import { EntityTagPicker as
|
|
11
|
-
import { useDraftEntityTags as
|
|
12
|
-
import { LINK_TO_VIBE_DEFAULT as
|
|
8
|
+
import { useCreateTunnelMutation as c, useListAgentsQuery as te, useListTunnelProvidersQuery as ne } from "../../generated/wspace-operations.js";
|
|
9
|
+
import { getQuotaDialogContent as l, isQuotaExhaustedError as u, markQuotaHandledLocally as d } from "../../utils/quotaUtils.js";
|
|
10
|
+
import { EntityTagPicker as f } from "../shared/EntityTagPicker.js";
|
|
11
|
+
import { useDraftEntityTags as re } from "../../hooks/useDraftEntityTags.js";
|
|
12
|
+
import { LINK_TO_VIBE_DEFAULT as ie, LinkToVibePanel as ae, linkToVibeInput as p } from "../shared/LinkToVibePanel.js";
|
|
13
13
|
import "../shared/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
14
|
+
import { agentIdFromSearch as oe, resolvePrefilledAgentId as se } from "./tunnelWizardPrefill.js";
|
|
15
|
+
import { useCallback as m, useMemo as h, useState as g } from "react";
|
|
16
|
+
import { useNavigate as ce, useSearchParams as le } from "react-router";
|
|
17
|
+
import { AnimatePresence as _, motion as v } from "framer-motion";
|
|
18
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
19
|
+
import { useEventBus as S } from "@burdenoff/fe-libs/shared/events";
|
|
20
|
+
import { Stepper as C } from "@burdenoff/fe-libs/ui";
|
|
20
21
|
// src/components/tunnels/TunnelCreateWizard.tsx
|
|
21
|
-
var
|
|
22
|
+
var w = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/, T = {
|
|
22
23
|
providerKey: s.Vibetunnels,
|
|
23
24
|
agentId: "",
|
|
24
25
|
name: "",
|
|
@@ -55,51 +56,55 @@ var oe = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/, T = {
|
|
|
55
56
|
}
|
|
56
57
|
];
|
|
57
58
|
function D() {
|
|
58
|
-
let D = e(), A =
|
|
59
|
-
|
|
59
|
+
let D = e(), A = ce(), j = S(), { workspaceId: M } = t(), [N, P] = g(0), [F] = le(), [I, L] = g(() => ({
|
|
60
|
+
...T,
|
|
61
|
+
agentId: oe(F)
|
|
62
|
+
})), [R, z] = g(null), [B, V] = g(!1), [H, U] = g(!1), [W, ue] = g(ie), { setDraftTagIds: de, flushTags: fe } = re("VIBECONTROLS_TUNNEL"), { data: G, loading: pe, error: K } = ne(), { data: q } = te({ variables: { pagination: { limit: 100 } } }), [me, { loading: J }] = c(), he = q?.vibecontrolsAgents, Y = se(I.agentId, he), X = m((e, t) => {
|
|
63
|
+
L((n) => ({
|
|
60
64
|
...n,
|
|
61
65
|
[e]: t
|
|
62
66
|
}));
|
|
63
|
-
}, []),
|
|
64
|
-
|
|
67
|
+
}, []), ge = m((e) => {
|
|
68
|
+
L((t) => ({
|
|
65
69
|
...t,
|
|
66
70
|
providerKey: e,
|
|
67
71
|
hostnameKind: e === s.Cloudflare ? "auto" : "managed"
|
|
68
72
|
}));
|
|
69
|
-
}, []), Z =
|
|
73
|
+
}, []), Z = h(() => [...G?.tunnelProviders ?? []].sort((e, t) => {
|
|
70
74
|
let n = (e) => e === "VIBETUNNELS" ? 0 : e === "CLOUDFLARE" ? 1 : 2, r = n(e.key) - n(t.key);
|
|
71
75
|
return r === 0 ? e.key.localeCompare(t.key) : r;
|
|
72
|
-
}), [
|
|
76
|
+
}), [G]), Q = h(() => Z.find((e) => e.key === I.providerKey), [Z, I.providerKey])?.capabilities, $ = I.providerKey === s.Cloudflare, _e = h(() => {
|
|
73
77
|
if (!Q) return [o.Http];
|
|
74
78
|
let e = [];
|
|
75
79
|
return Q.supportsHttp && e.push(o.Http), Q.supportsHttps && e.push(o.Https), Q.supportsTcp && e.push(o.Tcp), e;
|
|
76
|
-
}, [Q]),
|
|
80
|
+
}, [Q]), ve = h(() => N === 0 ? !!(I.providerKey && Y && I.name.trim()) : N === 1 ? I.localPort > 0 && I.localPort < 65536 : N === 2 ? I.hostnameKind === "managed" ? !!(I.subdomain && w.test(I.subdomain)) : I.hostnameKind === "custom" ? I.customDomain.trim().includes(".") : $ : !0, [
|
|
77
81
|
N,
|
|
78
|
-
|
|
82
|
+
I,
|
|
83
|
+
Y,
|
|
79
84
|
$
|
|
80
|
-
]),
|
|
81
|
-
|
|
85
|
+
]), ye = () => P((e) => Math.min(e + 1, E.length - 1)), be = () => P((e) => Math.max(e - 1, 0)), xe = async () => {
|
|
86
|
+
z(null);
|
|
82
87
|
try {
|
|
83
88
|
let e = {
|
|
84
|
-
agentId:
|
|
85
|
-
name:
|
|
86
|
-
description:
|
|
87
|
-
providerKey:
|
|
88
|
-
protocol:
|
|
89
|
-
localHost:
|
|
90
|
-
localPort:
|
|
91
|
-
environment:
|
|
92
|
-
basicAuthUser:
|
|
93
|
-
basicAuthPassword:
|
|
94
|
-
managedSubdomain:
|
|
95
|
-
...
|
|
96
|
-
}, t = await
|
|
89
|
+
agentId: Y,
|
|
90
|
+
name: I.name,
|
|
91
|
+
description: I.description || void 0,
|
|
92
|
+
providerKey: I.providerKey,
|
|
93
|
+
protocol: I.protocol,
|
|
94
|
+
localHost: I.localHost,
|
|
95
|
+
localPort: I.localPort,
|
|
96
|
+
environment: I.environment,
|
|
97
|
+
basicAuthUser: I.basicAuthUser || void 0,
|
|
98
|
+
basicAuthPassword: I.basicAuthPassword || void 0,
|
|
99
|
+
managedSubdomain: I.hostnameKind === "managed" ? I.subdomain : void 0,
|
|
100
|
+
...p(W)
|
|
101
|
+
}, t = await me({ variables: { input: e } });
|
|
97
102
|
if (t.error) {
|
|
98
|
-
if (
|
|
99
|
-
|
|
103
|
+
if (u(t.error)) {
|
|
104
|
+
d(), U(!0), j.emitCustom("vibecontrols.quota.tunnel_limit_hit", { workspaceId: M ?? void 0 });
|
|
100
105
|
return;
|
|
101
106
|
}
|
|
102
|
-
|
|
107
|
+
z(t.error.message);
|
|
103
108
|
return;
|
|
104
109
|
}
|
|
105
110
|
let n = t.data?.createTunnel.id;
|
|
@@ -107,30 +112,30 @@ function D() {
|
|
|
107
112
|
j.emitCustom("vibecontrols.tunnel.created", {
|
|
108
113
|
workspaceId: M ?? void 0,
|
|
109
114
|
tunnelId: n
|
|
110
|
-
}),
|
|
115
|
+
}), V(!0);
|
|
111
116
|
try {
|
|
112
|
-
await
|
|
117
|
+
await fe(n);
|
|
113
118
|
} finally {
|
|
114
|
-
|
|
119
|
+
V(!1);
|
|
115
120
|
}
|
|
116
121
|
A(`/vibecontrols/tunnels/${n}`, { state: { autoPromptStart: !0 } });
|
|
117
122
|
}
|
|
118
123
|
} catch (e) {
|
|
119
|
-
if (
|
|
120
|
-
|
|
124
|
+
if (u(e)) {
|
|
125
|
+
z(null), d(), U(!0), j.emitCustom("vibecontrols.quota.tunnel_limit_hit", { workspaceId: M ?? void 0 });
|
|
121
126
|
return;
|
|
122
127
|
}
|
|
123
|
-
|
|
128
|
+
z(e instanceof Error ? e.message : String(e));
|
|
124
129
|
}
|
|
125
130
|
};
|
|
126
|
-
return
|
|
131
|
+
return pe ? /* @__PURE__ */ b(r, { message: "Loading providers" }) : K ? /* @__PURE__ */ b(i, {
|
|
127
132
|
title: "Failed to load providers",
|
|
128
|
-
message:
|
|
133
|
+
message: K.message,
|
|
129
134
|
onRetry: () => window.location.reload()
|
|
130
|
-
}) : /* @__PURE__ */
|
|
135
|
+
}) : /* @__PURE__ */ x("div", {
|
|
131
136
|
className: "p-6 max-w-3xl mx-auto",
|
|
132
137
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ b(n, {
|
|
134
139
|
breadcrumb: [{
|
|
135
140
|
label: "Tunnels",
|
|
136
141
|
path: "/vibecontrols/tunnels"
|
|
@@ -138,7 +143,7 @@ function D() {
|
|
|
138
143
|
title: D("vibecontrols.tunnels.createTitle", "Create tunnel"),
|
|
139
144
|
description: D("vibecontrols.tunnels.createDescription", "Expose a local service through a managed tunnel.")
|
|
140
145
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ b(C, {
|
|
142
147
|
className: "mb-6",
|
|
143
148
|
active: N,
|
|
144
149
|
onStepClick: (e) => e <= N && P(e),
|
|
@@ -147,9 +152,9 @@ function D() {
|
|
|
147
152
|
label: e.label
|
|
148
153
|
}))
|
|
149
154
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ b(_, {
|
|
151
156
|
mode: "wait",
|
|
152
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ x(v.div, {
|
|
153
158
|
initial: {
|
|
154
159
|
opacity: 0,
|
|
155
160
|
x: 6
|
|
@@ -165,108 +170,108 @@ function D() {
|
|
|
165
170
|
transition: { duration: .15 },
|
|
166
171
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
167
172
|
children: [
|
|
168
|
-
N === 0 && /* @__PURE__ */
|
|
173
|
+
N === 0 && /* @__PURE__ */ x("div", {
|
|
169
174
|
className: "space-y-4",
|
|
170
175
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ b("h3", {
|
|
172
177
|
className: "text-sm font-semibold text-text-primary",
|
|
173
178
|
children: "Provider"
|
|
174
179
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ b("div", {
|
|
176
181
|
className: "grid gap-3 sm:grid-cols-2",
|
|
177
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
182
|
+
children: Z.map((e) => /* @__PURE__ */ x("button", {
|
|
178
183
|
type: "button",
|
|
179
|
-
onClick: () =>
|
|
180
|
-
className: `rounded-lg border p-4 text-left transition-colors ${
|
|
184
|
+
onClick: () => ge(e.key),
|
|
185
|
+
className: `rounded-lg border p-4 text-left transition-colors ${I.providerKey === e.key ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:border-border-default"}`,
|
|
181
186
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ b("div", {
|
|
183
188
|
className: "font-semibold text-text-primary",
|
|
184
189
|
children: e.displayName
|
|
185
190
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ b("div", {
|
|
187
192
|
className: "text-xs text-text-muted mt-1",
|
|
188
193
|
children: e.key
|
|
189
194
|
}),
|
|
190
|
-
e.description && /* @__PURE__ */
|
|
195
|
+
e.description && /* @__PURE__ */ b("div", {
|
|
191
196
|
className: "text-xs text-text-secondary mt-2",
|
|
192
197
|
children: e.description
|
|
193
198
|
})
|
|
194
199
|
]
|
|
195
200
|
}, e.id))
|
|
196
201
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ b(O, {
|
|
198
203
|
label: "Agent",
|
|
199
|
-
children: /* @__PURE__ */
|
|
200
|
-
value:
|
|
204
|
+
children: /* @__PURE__ */ x("select", {
|
|
205
|
+
value: Y,
|
|
201
206
|
onChange: (e) => X("agentId", e.target.value),
|
|
202
207
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ b("option", {
|
|
204
209
|
value: "",
|
|
205
210
|
children: "Select agent"
|
|
206
|
-
}), (
|
|
211
|
+
}), (q?.vibecontrolsAgents ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
207
212
|
value: e.id,
|
|
208
213
|
children: e.name
|
|
209
214
|
}, e.id))]
|
|
210
215
|
})
|
|
211
216
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ b(O, {
|
|
213
218
|
label: "Name",
|
|
214
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ b("input", {
|
|
215
220
|
"aria-label": "My dev tunnel",
|
|
216
221
|
type: "text",
|
|
217
|
-
value:
|
|
222
|
+
value: I.name,
|
|
218
223
|
onChange: (e) => X("name", e.target.value),
|
|
219
224
|
placeholder: "My dev tunnel",
|
|
220
225
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-muted"
|
|
221
226
|
})
|
|
222
227
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ b(O, {
|
|
224
229
|
label: "Description (optional)",
|
|
225
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ b("input", {
|
|
226
231
|
"aria-label": "control",
|
|
227
232
|
type: "text",
|
|
228
|
-
value:
|
|
233
|
+
value: I.description,
|
|
229
234
|
onChange: (e) => X("description", e.target.value),
|
|
230
235
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-muted"
|
|
231
236
|
})
|
|
232
237
|
})
|
|
233
238
|
]
|
|
234
239
|
}),
|
|
235
|
-
N === 1 && /* @__PURE__ */
|
|
240
|
+
N === 1 && /* @__PURE__ */ x("div", {
|
|
236
241
|
className: "space-y-4",
|
|
237
242
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ b("h3", {
|
|
239
244
|
className: "text-sm font-semibold text-text-primary",
|
|
240
245
|
children: "Protocol & target"
|
|
241
246
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ b(O, {
|
|
243
248
|
label: "Protocol",
|
|
244
|
-
children: /* @__PURE__ */
|
|
249
|
+
children: /* @__PURE__ */ b("div", {
|
|
245
250
|
className: "flex gap-2",
|
|
246
|
-
children:
|
|
251
|
+
children: _e.map((e) => /* @__PURE__ */ b("button", {
|
|
247
252
|
type: "button",
|
|
248
253
|
onClick: () => X("protocol", e),
|
|
249
|
-
className: `rounded-md border px-4 py-2 text-sm ${
|
|
254
|
+
className: `rounded-md border px-4 py-2 text-sm ${I.protocol === e ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
|
|
250
255
|
children: e
|
|
251
256
|
}, e))
|
|
252
257
|
})
|
|
253
258
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ b(O, {
|
|
255
260
|
label: "Local host",
|
|
256
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ b("input", {
|
|
257
262
|
"aria-label": "control",
|
|
258
263
|
type: "text",
|
|
259
|
-
value:
|
|
264
|
+
value: I.localHost,
|
|
260
265
|
onChange: (e) => X("localHost", e.target.value),
|
|
261
266
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
262
267
|
})
|
|
263
268
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ b(O, {
|
|
265
270
|
label: "Local port",
|
|
266
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ b("input", {
|
|
267
272
|
"aria-label": "control",
|
|
268
273
|
type: "number",
|
|
269
|
-
value:
|
|
274
|
+
value: I.localPort,
|
|
270
275
|
onChange: (e) => X("localPort", parseInt(e.target.value, 10) || 0),
|
|
271
276
|
min: 1,
|
|
272
277
|
max: 65535,
|
|
@@ -275,272 +280,272 @@ function D() {
|
|
|
275
280
|
})
|
|
276
281
|
]
|
|
277
282
|
}),
|
|
278
|
-
N === 2 && /* @__PURE__ */
|
|
283
|
+
N === 2 && /* @__PURE__ */ x("div", {
|
|
279
284
|
className: "space-y-4",
|
|
280
285
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ b("h3", {
|
|
282
287
|
className: "text-sm font-semibold text-text-primary",
|
|
283
288
|
children: "Hostname"
|
|
284
289
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ x("div", {
|
|
286
291
|
className: "flex gap-2",
|
|
287
292
|
children: [
|
|
288
|
-
Q?.supportsManagedSubdomains && /* @__PURE__ */
|
|
289
|
-
active:
|
|
293
|
+
Q?.supportsManagedSubdomains && /* @__PURE__ */ b(k, {
|
|
294
|
+
active: I.hostnameKind === "managed",
|
|
290
295
|
onClick: () => X("hostnameKind", "managed"),
|
|
291
296
|
label: "Managed subdomain",
|
|
292
297
|
hint: "*.vibetunnels.com"
|
|
293
298
|
}),
|
|
294
|
-
Q?.supportsCustomDomains && /* @__PURE__ */
|
|
295
|
-
active:
|
|
299
|
+
Q?.supportsCustomDomains && /* @__PURE__ */ b(k, {
|
|
300
|
+
active: I.hostnameKind === "custom",
|
|
296
301
|
onClick: () => X("hostnameKind", "custom"),
|
|
297
302
|
label: "Custom domain",
|
|
298
303
|
hint: "TXT verification"
|
|
299
304
|
}),
|
|
300
|
-
$ && /* @__PURE__ */
|
|
301
|
-
active:
|
|
305
|
+
$ && /* @__PURE__ */ b(k, {
|
|
306
|
+
active: I.hostnameKind === "auto",
|
|
302
307
|
onClick: () => X("hostnameKind", "auto"),
|
|
303
308
|
label: "Auto",
|
|
304
309
|
hint: "assigned by Cloudflare"
|
|
305
310
|
})
|
|
306
311
|
]
|
|
307
312
|
}),
|
|
308
|
-
|
|
309
|
-
/* @__PURE__ */
|
|
313
|
+
I.hostnameKind === "managed" && /* @__PURE__ */ x(y, { children: [
|
|
314
|
+
/* @__PURE__ */ b(O, {
|
|
310
315
|
label: "Environment",
|
|
311
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ x("div", {
|
|
312
317
|
className: "flex gap-2",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ b("button", {
|
|
314
319
|
type: "button",
|
|
315
320
|
onClick: () => X("environment", a.Prod),
|
|
316
|
-
className: `rounded-md border px-4 py-2 text-sm ${
|
|
321
|
+
className: `rounded-md border px-4 py-2 text-sm ${I.environment === a.Prod ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
|
|
317
322
|
children: "Prod (vibetunnels.com)"
|
|
318
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ b("button", {
|
|
319
324
|
type: "button",
|
|
320
325
|
onClick: () => X("environment", a.Alpha),
|
|
321
|
-
className: `rounded-md border px-4 py-2 text-sm ${
|
|
326
|
+
className: `rounded-md border px-4 py-2 text-sm ${I.environment === a.Alpha ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
|
|
322
327
|
children: "Alpha"
|
|
323
328
|
})]
|
|
324
329
|
})
|
|
325
330
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ b(O, {
|
|
327
332
|
label: "Subdomain label",
|
|
328
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ b("input", {
|
|
329
334
|
"aria-label": "demo",
|
|
330
335
|
type: "text",
|
|
331
|
-
value:
|
|
336
|
+
value: I.subdomain,
|
|
332
337
|
onChange: (e) => X("subdomain", e.target.value.toLowerCase()),
|
|
333
338
|
placeholder: "demo",
|
|
334
339
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
335
340
|
})
|
|
336
341
|
}),
|
|
337
|
-
|
|
342
|
+
I.subdomain && /* @__PURE__ */ x("p", {
|
|
338
343
|
className: "text-xs text-text-secondary",
|
|
339
344
|
children: [
|
|
340
345
|
"Will be reserved as",
|
|
341
346
|
" ",
|
|
342
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ x("span", {
|
|
343
348
|
className: "font-mono text-text-primary",
|
|
344
|
-
children: [
|
|
349
|
+
children: [I.subdomain, I.environment === a.Alpha ? ".alpha.vibetunnels.com" : ".vibetunnels.com"]
|
|
345
350
|
})
|
|
346
351
|
]
|
|
347
352
|
})
|
|
348
353
|
] }),
|
|
349
|
-
|
|
354
|
+
I.hostnameKind === "custom" && /* @__PURE__ */ x(O, {
|
|
350
355
|
label: "Custom domain",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ b("input", {
|
|
352
357
|
"aria-label": "preview.example.com",
|
|
353
358
|
type: "text",
|
|
354
|
-
value:
|
|
359
|
+
value: I.customDomain,
|
|
355
360
|
onChange: (e) => X("customDomain", e.target.value.toLowerCase()),
|
|
356
361
|
placeholder: "preview.example.com",
|
|
357
362
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
358
|
-
}), /* @__PURE__ */
|
|
363
|
+
}), /* @__PURE__ */ b("p", {
|
|
359
364
|
className: "text-xs text-text-muted mt-2",
|
|
360
365
|
children: "Custom domains are registered on create but must be verified via a TXT record before they can be attached. You'll see the verification challenge in the Domains tab after creation."
|
|
361
366
|
})]
|
|
362
367
|
})
|
|
363
368
|
]
|
|
364
369
|
}),
|
|
365
|
-
N === 3 && /* @__PURE__ */
|
|
370
|
+
N === 3 && /* @__PURE__ */ x("div", {
|
|
366
371
|
className: "space-y-4",
|
|
367
372
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ b("h3", {
|
|
369
374
|
className: "text-sm font-semibold text-text-primary",
|
|
370
375
|
children: "Policies (optional)"
|
|
371
376
|
}),
|
|
372
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ b(O, {
|
|
373
378
|
label: "Basic auth user",
|
|
374
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ b("input", {
|
|
375
380
|
"aria-label": "control",
|
|
376
381
|
type: "text",
|
|
377
|
-
value:
|
|
382
|
+
value: I.basicAuthUser,
|
|
378
383
|
onChange: (e) => X("basicAuthUser", e.target.value),
|
|
379
384
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
380
385
|
})
|
|
381
386
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ b(O, {
|
|
383
388
|
label: "Basic auth password",
|
|
384
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ b("input", {
|
|
385
390
|
"aria-label": "control",
|
|
386
391
|
type: "password",
|
|
387
|
-
value:
|
|
392
|
+
value: I.basicAuthPassword,
|
|
388
393
|
onChange: (e) => X("basicAuthPassword", e.target.value),
|
|
389
394
|
className: "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
390
395
|
})
|
|
391
396
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
value:
|
|
394
|
-
onChange:
|
|
395
|
-
disabled:
|
|
397
|
+
/* @__PURE__ */ b(ae, {
|
|
398
|
+
value: W,
|
|
399
|
+
onChange: ue,
|
|
400
|
+
disabled: J
|
|
396
401
|
})
|
|
397
402
|
]
|
|
398
403
|
}),
|
|
399
|
-
N === 4 && /* @__PURE__ */
|
|
404
|
+
N === 4 && /* @__PURE__ */ x("div", {
|
|
400
405
|
className: "space-y-3",
|
|
401
406
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ b("h3", {
|
|
403
408
|
className: "text-sm font-semibold text-text-primary",
|
|
404
409
|
children: D("vibecontrols.tunnels.review", "Review")
|
|
405
410
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ x("dl", {
|
|
407
412
|
className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",
|
|
408
413
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ b("dt", {
|
|
410
415
|
className: "text-text-muted",
|
|
411
416
|
children: "Provider"
|
|
412
417
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ b("dd", {
|
|
414
419
|
className: "text-text-primary",
|
|
415
|
-
children:
|
|
420
|
+
children: I.providerKey
|
|
416
421
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ b("dt", {
|
|
418
423
|
className: "text-text-muted",
|
|
419
424
|
children: "Name"
|
|
420
425
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ b("dd", {
|
|
422
427
|
className: "text-text-primary",
|
|
423
|
-
children:
|
|
428
|
+
children: I.name
|
|
424
429
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ b("dt", {
|
|
426
431
|
className: "text-text-muted",
|
|
427
432
|
children: "Agent"
|
|
428
433
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ b("dd", {
|
|
430
435
|
className: "text-text-primary font-mono",
|
|
431
|
-
children:
|
|
436
|
+
children: Y
|
|
432
437
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ b("dt", {
|
|
434
439
|
className: "text-text-muted",
|
|
435
440
|
children: "Protocol"
|
|
436
441
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ b("dd", {
|
|
438
443
|
className: "text-text-primary",
|
|
439
|
-
children:
|
|
444
|
+
children: I.protocol
|
|
440
445
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ b("dt", {
|
|
442
447
|
className: "text-text-muted",
|
|
443
448
|
children: "Target"
|
|
444
449
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ x("dd", {
|
|
446
451
|
className: "text-text-primary font-mono",
|
|
447
452
|
children: [
|
|
448
|
-
|
|
453
|
+
I.localHost,
|
|
449
454
|
":",
|
|
450
|
-
|
|
455
|
+
I.localPort
|
|
451
456
|
]
|
|
452
457
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ b("dt", {
|
|
454
459
|
className: "text-text-muted",
|
|
455
460
|
children: "Hostname"
|
|
456
461
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ b("dd", {
|
|
458
463
|
className: "text-text-primary",
|
|
459
|
-
children:
|
|
464
|
+
children: I.hostnameKind === "managed" ? `${I.subdomain}.${I.environment === "ALPHA" ? "alpha." : ""}vibetunnels.com` : I.hostnameKind === "custom" ? I.customDomain : "auto-assigned"
|
|
460
465
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ b("dt", {
|
|
462
467
|
className: "text-text-muted",
|
|
463
468
|
children: "Basic auth"
|
|
464
469
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ b("dd", {
|
|
466
471
|
className: "text-text-primary",
|
|
467
|
-
children:
|
|
472
|
+
children: I.basicAuthUser ? "yes" : "no"
|
|
468
473
|
})
|
|
469
474
|
]
|
|
470
475
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ x("div", {
|
|
472
477
|
className: "border-t border-border-subtle pt-3",
|
|
473
|
-
children: [/* @__PURE__ */
|
|
478
|
+
children: [/* @__PURE__ */ b("h4", {
|
|
474
479
|
className: "mb-2 text-sm font-medium text-text-secondary",
|
|
475
480
|
children: D("vibecontrols.tunnels.tags", "Tags")
|
|
476
|
-
}), /* @__PURE__ */
|
|
481
|
+
}), /* @__PURE__ */ b(f, {
|
|
477
482
|
entityType: "VIBECONTROLS_TUNNEL",
|
|
478
|
-
onDraftChange:
|
|
483
|
+
onDraftChange: de
|
|
479
484
|
})]
|
|
480
485
|
}),
|
|
481
|
-
|
|
486
|
+
R && /* @__PURE__ */ b("div", {
|
|
482
487
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text",
|
|
483
|
-
children:
|
|
488
|
+
children: R
|
|
484
489
|
})
|
|
485
490
|
]
|
|
486
491
|
})
|
|
487
492
|
]
|
|
488
493
|
}, N)
|
|
489
494
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ x("div", {
|
|
491
496
|
className: "flex items-center justify-between mt-4",
|
|
492
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ b("button", {
|
|
493
498
|
type: "button",
|
|
494
499
|
disabled: N === 0,
|
|
495
|
-
onClick:
|
|
500
|
+
onClick: be,
|
|
496
501
|
className: "rounded-md border border-border-default px-4 py-2 text-sm text-text-primary hover:bg-bg-elevated disabled:opacity-50",
|
|
497
502
|
children: D("vibecontrols.tunnels.back", "Back")
|
|
498
|
-
}), N < E.length - 1 ? /* @__PURE__ */
|
|
503
|
+
}), N < E.length - 1 ? /* @__PURE__ */ b("button", {
|
|
499
504
|
type: "button",
|
|
500
|
-
disabled: !
|
|
501
|
-
onClick:
|
|
505
|
+
disabled: !ve,
|
|
506
|
+
onClick: ye,
|
|
502
507
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-fg hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
503
508
|
children: D("vibecontrols.tunnels.next", "Next")
|
|
504
|
-
}) : /* @__PURE__ */
|
|
509
|
+
}) : /* @__PURE__ */ b("button", {
|
|
505
510
|
type: "button",
|
|
506
|
-
disabled:
|
|
507
|
-
onClick: () => void
|
|
511
|
+
disabled: J || B,
|
|
512
|
+
onClick: () => void xe(),
|
|
508
513
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-fg hover:bg-action-primary-bg-hover disabled:opacity-50",
|
|
509
|
-
children:
|
|
514
|
+
children: J ? D("vibecontrols.tunnels.creating", "Creating...") : D("vibecontrols.tunnels.createTunnel", "Create tunnel")
|
|
510
515
|
})]
|
|
511
516
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
isOpen:
|
|
514
|
-
onClose: () =>
|
|
517
|
+
/* @__PURE__ */ b(ee, {
|
|
518
|
+
isOpen: H,
|
|
519
|
+
onClose: () => U(!1),
|
|
515
520
|
onConfirm: () => {
|
|
516
|
-
|
|
521
|
+
U(!1), A("/billing/plans");
|
|
517
522
|
},
|
|
518
|
-
...
|
|
523
|
+
...l("tunnel-subdomain")
|
|
519
524
|
})
|
|
520
525
|
]
|
|
521
526
|
});
|
|
522
527
|
}
|
|
523
528
|
function O({ label: e, children: t }) {
|
|
524
|
-
return /* @__PURE__ */
|
|
529
|
+
return /* @__PURE__ */ x("label", {
|
|
525
530
|
className: "block",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
531
|
+
children: [/* @__PURE__ */ b("span", {
|
|
527
532
|
className: "text-xs font-medium text-text-secondary",
|
|
528
533
|
children: e
|
|
529
|
-
}), /* @__PURE__ */
|
|
534
|
+
}), /* @__PURE__ */ b("div", {
|
|
530
535
|
className: "mt-1",
|
|
531
536
|
children: t
|
|
532
537
|
})]
|
|
533
538
|
});
|
|
534
539
|
}
|
|
535
540
|
function k({ active: e, onClick: t, label: n, hint: r }) {
|
|
536
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ x("button", {
|
|
537
542
|
type: "button",
|
|
538
543
|
onClick: t,
|
|
539
544
|
className: `flex-1 rounded-md border p-3 text-left transition-colors ${e ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:border-border-default"}`,
|
|
540
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ b("div", {
|
|
541
546
|
className: "text-sm font-medium text-text-primary",
|
|
542
547
|
children: n
|
|
543
|
-
}), /* @__PURE__ */
|
|
548
|
+
}), /* @__PURE__ */ b("div", {
|
|
544
549
|
className: "text-xs text-text-muted mt-0.5",
|
|
545
550
|
children: r
|
|
546
551
|
})]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefill for the tunnel create wizard (BOFF-7056).
|
|
3
|
+
*
|
|
4
|
+
* The VibeControls browser extension's "Share localhost" action opens
|
|
5
|
+
* `/vibecontrols/tunnels/new?agentId=<id>` so the wizard starts with that
|
|
6
|
+
* agent selected. The id is only kept when it names an agent the workspace
|
|
7
|
+
* actually has; anything else falls back to "Select agent".
|
|
8
|
+
*/
|
|
9
|
+
/** Query parameter the wizard reads the agent from. */
|
|
10
|
+
export declare const AGENT_ID_PARAM = "agentId";
|
|
11
|
+
/** The agent id requested in the URL, trimmed; empty when absent. */
|
|
12
|
+
export declare function agentIdFromSearch(params: URLSearchParams): string;
|
|
13
|
+
/**
|
|
14
|
+
* The agent id to keep once the agent list has loaded: the requested id when
|
|
15
|
+
* it is one of the workspace's agents, otherwise empty. While the list is
|
|
16
|
+
* still loading (`agents` undefined) the requested id is kept as is.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolvePrefilledAgentId(requested: string, agents: ReadonlyArray<{
|
|
19
|
+
id: string;
|
|
20
|
+
}> | undefined): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/components/tunnels/tunnelWizardPrefill.ts
|
|
2
|
+
var e = "agentId";
|
|
3
|
+
function t(e) {
|
|
4
|
+
return e.get("agentId")?.trim() ?? "";
|
|
5
|
+
}
|
|
6
|
+
function n(e, t) {
|
|
7
|
+
return !e || !t || t.some((t) => t.id === e) ? e : "";
|
|
8
|
+
}
|
|
9
|
+
export { e as AGENT_ID_PARAM, t as agentIdFromSearch, n as resolvePrefilledAgentId };
|