@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 ee } from "../shared/ErrorState.js";
6
- import { QuotaExhaustedDialog as i } from "../shared/QuotaExhaustedDialog.js";
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 l, useListTunnelProvidersQuery as u } from "../../generated/wspace-operations.js";
9
- import { getQuotaDialogContent as te, isQuotaExhaustedError as d, markQuotaHandledLocally as f } from "../../utils/quotaUtils.js";
10
- import { EntityTagPicker as p } from "../shared/EntityTagPicker.js";
11
- import { useDraftEntityTags as ne } from "../../hooks/useDraftEntityTags.js";
12
- import { LINK_TO_VIBE_DEFAULT as re, LinkToVibePanel as m, linkToVibeInput as h } from "../shared/LinkToVibePanel.js";
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 { useCallback as g, useMemo as _, useState as v } from "react";
15
- import { useNavigate as y } from "react-router";
16
- import { AnimatePresence as b, motion as x } from "framer-motion";
17
- import { Fragment as ie, jsx as S, jsxs as C } from "react/jsx-runtime";
18
- import { useEventBus as w } from "@burdenoff/fe-libs/shared/events";
19
- import { Stepper as ae } from "@burdenoff/fe-libs/ui";
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 oe = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/, T = {
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 = y(), j = w(), { workspaceId: M } = t(), [N, P] = v(0), [F, I] = v(T), [L, R] = v(null), [z, B] = v(!1), [V, H] = v(!1), [U, W] = v(re), { setDraftTagIds: G, flushTags: K } = ne("VIBECONTROLS_TUNNEL"), { data: q, loading: se, error: J } = u(), { data: ce } = l({ variables: { pagination: { limit: 100 } } }), [le, { loading: Y }] = c(), X = g((e, t) => {
59
- I((n) => ({
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
- }, []), ue = g((e) => {
64
- I((t) => ({
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 = _(() => [...q?.tunnelProviders ?? []].sort((e, t) => {
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
- }), [q]), Q = _(() => Z.find((e) => e.key === F.providerKey), [Z, F.providerKey])?.capabilities, $ = F.providerKey === s.Cloudflare, de = _(() => {
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]), fe = _(() => N === 0 ? !!(F.providerKey && F.agentId && F.name.trim()) : N === 1 ? F.localPort > 0 && F.localPort < 65536 : N === 2 ? F.hostnameKind === "managed" ? !!(F.subdomain && oe.test(F.subdomain)) : F.hostnameKind === "custom" ? F.customDomain.trim().includes(".") : $ : !0, [
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
- F,
82
+ I,
83
+ Y,
79
84
  $
80
- ]), pe = () => P((e) => Math.min(e + 1, E.length - 1)), me = () => P((e) => Math.max(e - 1, 0)), he = async () => {
81
- R(null);
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: F.agentId,
85
- name: F.name,
86
- description: F.description || void 0,
87
- providerKey: F.providerKey,
88
- protocol: F.protocol,
89
- localHost: F.localHost,
90
- localPort: F.localPort,
91
- environment: F.environment,
92
- basicAuthUser: F.basicAuthUser || void 0,
93
- basicAuthPassword: F.basicAuthPassword || void 0,
94
- managedSubdomain: F.hostnameKind === "managed" ? F.subdomain : void 0,
95
- ...h(U)
96
- }, t = await le({ variables: { input: e } });
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 (d(t.error)) {
99
- f(), H(!0), j.emitCustom("vibecontrols.quota.tunnel_limit_hit", { workspaceId: M ?? void 0 });
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
- R(t.error.message);
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
- }), B(!0);
115
+ }), V(!0);
111
116
  try {
112
- await K(n);
117
+ await fe(n);
113
118
  } finally {
114
- B(!1);
119
+ V(!1);
115
120
  }
116
121
  A(`/vibecontrols/tunnels/${n}`, { state: { autoPromptStart: !0 } });
117
122
  }
118
123
  } catch (e) {
119
- if (d(e)) {
120
- R(null), f(), H(!0), j.emitCustom("vibecontrols.quota.tunnel_limit_hit", { workspaceId: M ?? void 0 });
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
- R(e instanceof Error ? e.message : String(e));
128
+ z(e instanceof Error ? e.message : String(e));
124
129
  }
125
130
  };
126
- return se ? /* @__PURE__ */ S(r, { message: "Loading providers" }) : J ? /* @__PURE__ */ S(ee, {
131
+ return pe ? /* @__PURE__ */ b(r, { message: "Loading providers" }) : K ? /* @__PURE__ */ b(i, {
127
132
  title: "Failed to load providers",
128
- message: J.message,
133
+ message: K.message,
129
134
  onRetry: () => window.location.reload()
130
- }) : /* @__PURE__ */ C("div", {
135
+ }) : /* @__PURE__ */ x("div", {
131
136
  className: "p-6 max-w-3xl mx-auto",
132
137
  children: [
133
- /* @__PURE__ */ S(n, {
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__ */ S(ae, {
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__ */ S(b, {
155
+ /* @__PURE__ */ b(_, {
151
156
  mode: "wait",
152
- children: /* @__PURE__ */ C(x.div, {
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__ */ C("div", {
173
+ N === 0 && /* @__PURE__ */ x("div", {
169
174
  className: "space-y-4",
170
175
  children: [
171
- /* @__PURE__ */ S("h3", {
176
+ /* @__PURE__ */ b("h3", {
172
177
  className: "text-sm font-semibold text-text-primary",
173
178
  children: "Provider"
174
179
  }),
175
- /* @__PURE__ */ S("div", {
180
+ /* @__PURE__ */ b("div", {
176
181
  className: "grid gap-3 sm:grid-cols-2",
177
- children: Z.map((e) => /* @__PURE__ */ C("button", {
182
+ children: Z.map((e) => /* @__PURE__ */ x("button", {
178
183
  type: "button",
179
- onClick: () => ue(e.key),
180
- className: `rounded-lg border p-4 text-left transition-colors ${F.providerKey === e.key ? "border-action-primary-bg bg-bg-sunken" : "border-border-subtle hover:border-border-default"}`,
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__ */ S("div", {
187
+ /* @__PURE__ */ b("div", {
183
188
  className: "font-semibold text-text-primary",
184
189
  children: e.displayName
185
190
  }),
186
- /* @__PURE__ */ S("div", {
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__ */ S("div", {
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__ */ S(O, {
202
+ /* @__PURE__ */ b(O, {
198
203
  label: "Agent",
199
- children: /* @__PURE__ */ C("select", {
200
- value: F.agentId,
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__ */ S("option", {
208
+ children: [/* @__PURE__ */ b("option", {
204
209
  value: "",
205
210
  children: "Select agent"
206
- }), (ce?.vibecontrolsAgents ?? []).map((e) => /* @__PURE__ */ S("option", {
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__ */ S(O, {
217
+ /* @__PURE__ */ b(O, {
213
218
  label: "Name",
214
- children: /* @__PURE__ */ S("input", {
219
+ children: /* @__PURE__ */ b("input", {
215
220
  "aria-label": "My dev tunnel",
216
221
  type: "text",
217
- value: F.name,
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__ */ S(O, {
228
+ /* @__PURE__ */ b(O, {
224
229
  label: "Description (optional)",
225
- children: /* @__PURE__ */ S("input", {
230
+ children: /* @__PURE__ */ b("input", {
226
231
  "aria-label": "control",
227
232
  type: "text",
228
- value: F.description,
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__ */ C("div", {
240
+ N === 1 && /* @__PURE__ */ x("div", {
236
241
  className: "space-y-4",
237
242
  children: [
238
- /* @__PURE__ */ S("h3", {
243
+ /* @__PURE__ */ b("h3", {
239
244
  className: "text-sm font-semibold text-text-primary",
240
245
  children: "Protocol & target"
241
246
  }),
242
- /* @__PURE__ */ S(O, {
247
+ /* @__PURE__ */ b(O, {
243
248
  label: "Protocol",
244
- children: /* @__PURE__ */ S("div", {
249
+ children: /* @__PURE__ */ b("div", {
245
250
  className: "flex gap-2",
246
- children: de.map((e) => /* @__PURE__ */ S("button", {
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 ${F.protocol === e ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
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__ */ S(O, {
259
+ /* @__PURE__ */ b(O, {
255
260
  label: "Local host",
256
- children: /* @__PURE__ */ S("input", {
261
+ children: /* @__PURE__ */ b("input", {
257
262
  "aria-label": "control",
258
263
  type: "text",
259
- value: F.localHost,
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__ */ S(O, {
269
+ /* @__PURE__ */ b(O, {
265
270
  label: "Local port",
266
- children: /* @__PURE__ */ S("input", {
271
+ children: /* @__PURE__ */ b("input", {
267
272
  "aria-label": "control",
268
273
  type: "number",
269
- value: F.localPort,
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__ */ C("div", {
283
+ N === 2 && /* @__PURE__ */ x("div", {
279
284
  className: "space-y-4",
280
285
  children: [
281
- /* @__PURE__ */ S("h3", {
286
+ /* @__PURE__ */ b("h3", {
282
287
  className: "text-sm font-semibold text-text-primary",
283
288
  children: "Hostname"
284
289
  }),
285
- /* @__PURE__ */ C("div", {
290
+ /* @__PURE__ */ x("div", {
286
291
  className: "flex gap-2",
287
292
  children: [
288
- Q?.supportsManagedSubdomains && /* @__PURE__ */ S(k, {
289
- active: F.hostnameKind === "managed",
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__ */ S(k, {
295
- active: F.hostnameKind === "custom",
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__ */ S(k, {
301
- active: F.hostnameKind === "auto",
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
- F.hostnameKind === "managed" && /* @__PURE__ */ C(ie, { children: [
309
- /* @__PURE__ */ S(O, {
313
+ I.hostnameKind === "managed" && /* @__PURE__ */ x(y, { children: [
314
+ /* @__PURE__ */ b(O, {
310
315
  label: "Environment",
311
- children: /* @__PURE__ */ C("div", {
316
+ children: /* @__PURE__ */ x("div", {
312
317
  className: "flex gap-2",
313
- children: [/* @__PURE__ */ S("button", {
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 ${F.environment === a.Prod ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
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__ */ S("button", {
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 ${F.environment === a.Alpha ? "border-action-primary-bg bg-bg-sunken text-text-primary" : "border-border-subtle text-text-secondary hover:border-border-default"}`,
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__ */ S(O, {
331
+ /* @__PURE__ */ b(O, {
327
332
  label: "Subdomain label",
328
- children: /* @__PURE__ */ S("input", {
333
+ children: /* @__PURE__ */ b("input", {
329
334
  "aria-label": "demo",
330
335
  type: "text",
331
- value: F.subdomain,
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
- F.subdomain && /* @__PURE__ */ C("p", {
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__ */ C("span", {
347
+ /* @__PURE__ */ x("span", {
343
348
  className: "font-mono text-text-primary",
344
- children: [F.subdomain, F.environment === a.Alpha ? ".alpha.vibetunnels.com" : ".vibetunnels.com"]
349
+ children: [I.subdomain, I.environment === a.Alpha ? ".alpha.vibetunnels.com" : ".vibetunnels.com"]
345
350
  })
346
351
  ]
347
352
  })
348
353
  ] }),
349
- F.hostnameKind === "custom" && /* @__PURE__ */ C(O, {
354
+ I.hostnameKind === "custom" && /* @__PURE__ */ x(O, {
350
355
  label: "Custom domain",
351
- children: [/* @__PURE__ */ S("input", {
356
+ children: [/* @__PURE__ */ b("input", {
352
357
  "aria-label": "preview.example.com",
353
358
  type: "text",
354
- value: F.customDomain,
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__ */ S("p", {
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__ */ C("div", {
370
+ N === 3 && /* @__PURE__ */ x("div", {
366
371
  className: "space-y-4",
367
372
  children: [
368
- /* @__PURE__ */ S("h3", {
373
+ /* @__PURE__ */ b("h3", {
369
374
  className: "text-sm font-semibold text-text-primary",
370
375
  children: "Policies (optional)"
371
376
  }),
372
- /* @__PURE__ */ S(O, {
377
+ /* @__PURE__ */ b(O, {
373
378
  label: "Basic auth user",
374
- children: /* @__PURE__ */ S("input", {
379
+ children: /* @__PURE__ */ b("input", {
375
380
  "aria-label": "control",
376
381
  type: "text",
377
- value: F.basicAuthUser,
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__ */ S(O, {
387
+ /* @__PURE__ */ b(O, {
383
388
  label: "Basic auth password",
384
- children: /* @__PURE__ */ S("input", {
389
+ children: /* @__PURE__ */ b("input", {
385
390
  "aria-label": "control",
386
391
  type: "password",
387
- value: F.basicAuthPassword,
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__ */ S(m, {
393
- value: U,
394
- onChange: W,
395
- disabled: Y
397
+ /* @__PURE__ */ b(ae, {
398
+ value: W,
399
+ onChange: ue,
400
+ disabled: J
396
401
  })
397
402
  ]
398
403
  }),
399
- N === 4 && /* @__PURE__ */ C("div", {
404
+ N === 4 && /* @__PURE__ */ x("div", {
400
405
  className: "space-y-3",
401
406
  children: [
402
- /* @__PURE__ */ S("h3", {
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__ */ C("dl", {
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__ */ S("dt", {
414
+ /* @__PURE__ */ b("dt", {
410
415
  className: "text-text-muted",
411
416
  children: "Provider"
412
417
  }),
413
- /* @__PURE__ */ S("dd", {
418
+ /* @__PURE__ */ b("dd", {
414
419
  className: "text-text-primary",
415
- children: F.providerKey
420
+ children: I.providerKey
416
421
  }),
417
- /* @__PURE__ */ S("dt", {
422
+ /* @__PURE__ */ b("dt", {
418
423
  className: "text-text-muted",
419
424
  children: "Name"
420
425
  }),
421
- /* @__PURE__ */ S("dd", {
426
+ /* @__PURE__ */ b("dd", {
422
427
  className: "text-text-primary",
423
- children: F.name
428
+ children: I.name
424
429
  }),
425
- /* @__PURE__ */ S("dt", {
430
+ /* @__PURE__ */ b("dt", {
426
431
  className: "text-text-muted",
427
432
  children: "Agent"
428
433
  }),
429
- /* @__PURE__ */ S("dd", {
434
+ /* @__PURE__ */ b("dd", {
430
435
  className: "text-text-primary font-mono",
431
- children: F.agentId
436
+ children: Y
432
437
  }),
433
- /* @__PURE__ */ S("dt", {
438
+ /* @__PURE__ */ b("dt", {
434
439
  className: "text-text-muted",
435
440
  children: "Protocol"
436
441
  }),
437
- /* @__PURE__ */ S("dd", {
442
+ /* @__PURE__ */ b("dd", {
438
443
  className: "text-text-primary",
439
- children: F.protocol
444
+ children: I.protocol
440
445
  }),
441
- /* @__PURE__ */ S("dt", {
446
+ /* @__PURE__ */ b("dt", {
442
447
  className: "text-text-muted",
443
448
  children: "Target"
444
449
  }),
445
- /* @__PURE__ */ C("dd", {
450
+ /* @__PURE__ */ x("dd", {
446
451
  className: "text-text-primary font-mono",
447
452
  children: [
448
- F.localHost,
453
+ I.localHost,
449
454
  ":",
450
- F.localPort
455
+ I.localPort
451
456
  ]
452
457
  }),
453
- /* @__PURE__ */ S("dt", {
458
+ /* @__PURE__ */ b("dt", {
454
459
  className: "text-text-muted",
455
460
  children: "Hostname"
456
461
  }),
457
- /* @__PURE__ */ S("dd", {
462
+ /* @__PURE__ */ b("dd", {
458
463
  className: "text-text-primary",
459
- children: F.hostnameKind === "managed" ? `${F.subdomain}.${F.environment === "ALPHA" ? "alpha." : ""}vibetunnels.com` : F.hostnameKind === "custom" ? F.customDomain : "auto-assigned"
464
+ children: I.hostnameKind === "managed" ? `${I.subdomain}.${I.environment === "ALPHA" ? "alpha." : ""}vibetunnels.com` : I.hostnameKind === "custom" ? I.customDomain : "auto-assigned"
460
465
  }),
461
- /* @__PURE__ */ S("dt", {
466
+ /* @__PURE__ */ b("dt", {
462
467
  className: "text-text-muted",
463
468
  children: "Basic auth"
464
469
  }),
465
- /* @__PURE__ */ S("dd", {
470
+ /* @__PURE__ */ b("dd", {
466
471
  className: "text-text-primary",
467
- children: F.basicAuthUser ? "yes" : "no"
472
+ children: I.basicAuthUser ? "yes" : "no"
468
473
  })
469
474
  ]
470
475
  }),
471
- /* @__PURE__ */ C("div", {
476
+ /* @__PURE__ */ x("div", {
472
477
  className: "border-t border-border-subtle pt-3",
473
- children: [/* @__PURE__ */ S("h4", {
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__ */ S(p, {
481
+ }), /* @__PURE__ */ b(f, {
477
482
  entityType: "VIBECONTROLS_TUNNEL",
478
- onDraftChange: G
483
+ onDraftChange: de
479
484
  })]
480
485
  }),
481
- L && /* @__PURE__ */ S("div", {
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: L
488
+ children: R
484
489
  })
485
490
  ]
486
491
  })
487
492
  ]
488
493
  }, N)
489
494
  }),
490
- /* @__PURE__ */ C("div", {
495
+ /* @__PURE__ */ x("div", {
491
496
  className: "flex items-center justify-between mt-4",
492
- children: [/* @__PURE__ */ S("button", {
497
+ children: [/* @__PURE__ */ b("button", {
493
498
  type: "button",
494
499
  disabled: N === 0,
495
- onClick: me,
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__ */ S("button", {
503
+ }), N < E.length - 1 ? /* @__PURE__ */ b("button", {
499
504
  type: "button",
500
- disabled: !fe,
501
- onClick: pe,
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__ */ S("button", {
509
+ }) : /* @__PURE__ */ b("button", {
505
510
  type: "button",
506
- disabled: Y || z,
507
- onClick: () => void he(),
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: Y ? D("vibecontrols.tunnels.creating", "Creating...") : D("vibecontrols.tunnels.createTunnel", "Create tunnel")
514
+ children: J ? D("vibecontrols.tunnels.creating", "Creating...") : D("vibecontrols.tunnels.createTunnel", "Create tunnel")
510
515
  })]
511
516
  }),
512
- /* @__PURE__ */ S(i, {
513
- isOpen: V,
514
- onClose: () => H(!1),
517
+ /* @__PURE__ */ b(ee, {
518
+ isOpen: H,
519
+ onClose: () => U(!1),
515
520
  onConfirm: () => {
516
- H(!1), A("/billing/plans");
521
+ U(!1), A("/billing/plans");
517
522
  },
518
- ...te("tunnel-subdomain")
523
+ ...l("tunnel-subdomain")
519
524
  })
520
525
  ]
521
526
  });
522
527
  }
523
528
  function O({ label: e, children: t }) {
524
- return /* @__PURE__ */ C("label", {
529
+ return /* @__PURE__ */ x("label", {
525
530
  className: "block",
526
- children: [/* @__PURE__ */ S("span", {
531
+ children: [/* @__PURE__ */ b("span", {
527
532
  className: "text-xs font-medium text-text-secondary",
528
533
  children: e
529
- }), /* @__PURE__ */ S("div", {
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__ */ C("button", {
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__ */ S("div", {
545
+ children: [/* @__PURE__ */ b("div", {
541
546
  className: "text-sm font-medium text-text-primary",
542
547
  children: n
543
- }), /* @__PURE__ */ S("div", {
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-vibecontrols",
3
- "version": "2026.1113.2",
3
+ "version": "2026.1115.1",
4
4
  "description": "VibeControls microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [