@burdenoff/microfe-vibecontrols 2026.528.7 → 2026.528.8

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.
Files changed (33) hide show
  1. package/dist/VibeControlsRoot.js +1 -0
  2. package/dist/VibeControlsRoot.js.map +1 -1
  3. package/dist/components/audit/AuditLogFilters.js +71 -47
  4. package/dist/components/audit/AuditLogFilters.js.map +1 -1
  5. package/dist/components/shared/AgentSetupBanner.js +50 -45
  6. package/dist/components/shared/AgentSetupBanner.js.map +1 -1
  7. package/dist/components/shared/LinkToVibePanel.js +97 -0
  8. package/dist/components/shared/LinkToVibePanel.js.map +1 -0
  9. package/dist/components/shared/index.js +1 -0
  10. package/dist/components/vibe/VibeLinkedEntitiesPanel.js +60 -0
  11. package/dist/components/vibe/VibeLinkedEntitiesPanel.js.map +1 -0
  12. package/dist/components/vibedeck/VibeDeckButtonTile.js +25 -23
  13. package/dist/components/vibedeck/VibeDeckButtonTile.js.map +1 -1
  14. package/dist/components/vibedeck/VibeDeckGrid.js +2 -2
  15. package/dist/components/vibedeck/VibeDeckGrid.js.map +1 -1
  16. package/dist/microfe-vibecontrols.css +1 -1
  17. package/dist/pages/AgentDetailsPage.js +2 -2
  18. package/dist/pages/AgentDetailsPage.js.map +1 -1
  19. package/dist/pages/AnalyticsPage.js +255 -204
  20. package/dist/pages/AnalyticsPage.js.map +1 -1
  21. package/dist/pages/OverviewPage.js +1 -11
  22. package/dist/pages/OverviewPage.js.map +1 -1
  23. package/dist/pages/SessionsPage.js +825 -629
  24. package/dist/pages/SessionsPage.js.map +1 -1
  25. package/dist/pages/VibeAuditPage.js +184 -153
  26. package/dist/pages/VibeAuditPage.js.map +1 -1
  27. package/dist/pages/VibeDeckPage.js +416 -379
  28. package/dist/pages/VibeDeckPage.js.map +1 -1
  29. package/dist/pages/VibeDetailsPage.js +621 -557
  30. package/dist/pages/VibeDetailsPage.js.map +1 -1
  31. package/dist/pages/tunnels/TunnelsTab.js +115 -90
  32. package/dist/pages/tunnels/TunnelsTab.js.map +1 -1
  33. package/package.json +1 -1
@@ -5,169 +5,172 @@ import { useCreateVibeDeckButtonMutation as i, useCreateVibeDeckMutation as ee,
5
5
  import { useVibeNavigate as fe } from "../providers/VibeControlsProvider.js";
6
6
  import { useVibeControlsStore as pe } from "../store/vibeControlsStore.js";
7
7
  import { PageHeader as me } from "../components/shared/PageHeader.js";
8
- import { LoadingState as a } from "../components/shared/LoadingState.js";
9
- import { ErrorState as he } from "../components/shared/ErrorState.js";
10
- import { EntityTagPicker as ge } from "../components/shared/EntityTagPicker.js";
11
- import { useDraftEntityTags as _e } from "../hooks/useDraftEntityTags.js";
12
- import { isNative as ve, nativeNotify as ye } from "../utils/nativeBridge.js";
13
- import { EmptyState as be } from "../components/shared/EmptyState.js";
14
- import { GetHelpButton as xe } from "../components/shared/GetHelpButton.js";
15
- import { SelectionCheckbox as Se } from "../components/shared/SelectionCheckbox.js";
8
+ import { LoadingState as he } from "../components/shared/LoadingState.js";
9
+ import { ErrorState as ge } from "../components/shared/ErrorState.js";
10
+ import { EntityTagPicker as _e } from "../components/shared/EntityTagPicker.js";
11
+ import { useDraftEntityTags as ve } from "../hooks/useDraftEntityTags.js";
12
+ import { isNative as ye, nativeNotify as be } from "../utils/nativeBridge.js";
13
+ import { EmptyState as xe } from "../components/shared/EmptyState.js";
14
+ import { LINK_TO_VIBE_DEFAULT as a, LinkToVibePanel as Se } from "../components/shared/LinkToVibePanel.js";
15
+ import { GetHelpButton as Ce } from "../components/shared/GetHelpButton.js";
16
+ import { SelectionCheckbox as we } from "../components/shared/SelectionCheckbox.js";
16
17
  import "../components/shared/index.js";
17
18
  import { VIBE_PERMISSIONS as o } from "../constants/permissions.js";
18
- import { VibeDeckGrid as Ce } from "../components/vibedeck/VibeDeckGrid.js";
19
- import { VibeDeckSwitcher as we } from "../components/vibedeck/VibeDeckSwitcher.js";
20
- import { VibeDeckForm as Te } from "../components/vibedeck/VibeDeckForm.js";
21
- import { VibeDeckButtonForm as Ee } from "../components/vibedeck/VibeDeckButtonForm.js";
22
- import { VibeDeckShareDialog as De } from "../components/vibedeck/VibeDeckShareDialog.js";
23
- import { VibeDeckExecutionLog as Oe } from "../components/vibedeck/VibeDeckExecutionLog.js";
19
+ import { VibeDeckGrid as Te } from "../components/vibedeck/VibeDeckGrid.js";
20
+ import { VibeDeckSwitcher as Ee } from "../components/vibedeck/VibeDeckSwitcher.js";
21
+ import { VibeDeckForm as De } from "../components/vibedeck/VibeDeckForm.js";
22
+ import { VibeDeckButtonForm as Oe } from "../components/vibedeck/VibeDeckButtonForm.js";
23
+ import { VibeDeckShareDialog as ke } from "../components/vibedeck/VibeDeckShareDialog.js";
24
+ import { VibeDeckExecutionLog as Ae } from "../components/vibedeck/VibeDeckExecutionLog.js";
24
25
  import "../components/vibedeck/index.js";
25
- import { useCallback as s, useEffect as ke, useMemo as Ae, useRef as je, useState as c } from "react";
26
- import { useI18n as Me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
27
- import { Copy as Ne, Eye as Pe, Pencil as Fe, Play as Ie, RefreshCw as Le, Share2 as Re, Star as ze, Trash2 as Be } from "lucide-react";
28
- import { usePermissions as Ve } from "@burdenoff/fe-libs/shared/providers/shell";
29
- import { AnimatePresence as He } from "framer-motion";
26
+ import { useCallback as s, useEffect as je, useMemo as Me, useRef as Ne, useState as c } from "react";
27
+ import { useI18n as Pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { Copy as Fe, Eye as Ie, Pencil as Le, Play as Re, RefreshCw as ze, Share2 as Be, Star as Ve, Trash2 as He } from "lucide-react";
29
+ import { usePermissions as Ue } from "@burdenoff/fe-libs/shared/providers/shell";
30
+ import { AnimatePresence as We } from "framer-motion";
30
31
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
31
32
  import { MotionPage as d } from "@burdenoff/fe-libs/shared/motion";
32
- import { AccessDenied as Ue } from "@burdenoff/fe-libs/shared/components";
33
+ import { AccessDenied as Ge } from "@burdenoff/fe-libs/shared/components";
33
34
  //#region src/pages/VibeDeckPage.tsx
34
- function We() {
35
- let We = fe(), { hasPermission: f, isLoading: Ge, permissions: p } = Ve(), m = ((e) => (t, n) => {
35
+ function Ke() {
36
+ let Ke = fe(), { hasPermission: f, isLoading: qe, permissions: p } = Ue(), m = ((e) => (t, n) => {
36
37
  let r = e.t(t);
37
38
  return r === t ? n : r;
38
- })(Me()), h = (Array.isArray(p) ? p : p?.permissionStrings)?.some?.((e) => e.startsWith("vibedeck:")), Ke = h ? f(o.VIBEDECK_LIST) : !0, g = h ? f(o.VIBEDECK_CREATE) : !0, qe = h ? f(o.VIBEDECK_UPDATE) : !0, Je = h ? f(o.VIBEDECK_DELETE) : !0, Ye = h ? f(o.VIBEDECK_EXECUTE) : !0, Xe = Ge, { activeVibeDeckId: _, setActiveVibeDeckId: v, vibeDeckMode: Ze, setVibeDeckMode: Qe } = pe(), y = Ze === "preview", $e = y ? !1 : g, et = y ? !1 : qe, tt = y ? !1 : Je, [b, x] = c({ type: "none" }), [nt, rt] = c(null), [S, C] = c(/* @__PURE__ */ new Set()), [w, T] = c(/* @__PURE__ */ new Set()), [it, at] = c(null), [ot, E] = c(null), [D, O] = c(null), [st, k] = c([]), A = je(/* @__PURE__ */ new Map()), [ct, lt] = c([]), [ut, dt] = c(!0), [ft, pt] = c(/* @__PURE__ */ new Map()), [mt, j] = c(null), M = je(/* @__PURE__ */ new Map());
39
- ke(() => {
40
- let e = M.current;
39
+ })(Pe()), h = (Array.isArray(p) ? p : p?.permissionStrings)?.some?.((e) => e.startsWith("vibedeck:")), Je = h ? f(o.VIBEDECK_LIST) : !0, Ye = h ? f(o.VIBEDECK_CREATE) : !0, Xe = h ? f(o.VIBEDECK_UPDATE) : !0, Ze = h ? f(o.VIBEDECK_DELETE) : !0, Qe = h ? f(o.VIBEDECK_EXECUTE) : !0, $e = qe, { activeVibeDeckId: g, setActiveVibeDeckId: _, vibeDeckMode: et, setVibeDeckMode: tt } = pe(), v = et === "preview", nt = v ? !1 : Ye, rt = v ? !1 : Xe, it = v ? !1 : Ze, [y, b] = c({ type: "none" }), [at, ot] = c(null), [x, st] = c(/* @__PURE__ */ new Set()), [S, C] = c(/* @__PURE__ */ new Set()), [ct, lt] = c(null), [ut, w] = c(null), [T, E] = c(null), [dt, D] = c([]), O = Ne(/* @__PURE__ */ new Map()), [k, A] = c(a), [ft, j] = c([]), [pt, mt] = c(!0), [ht, gt] = c(/* @__PURE__ */ new Map()), [M, _t] = c(null), N = Ne(/* @__PURE__ */ new Map());
40
+ je(() => {
41
+ let e = N.current;
41
42
  return () => {
42
43
  for (let t of e.values()) clearTimeout(t);
43
44
  };
44
45
  }, []);
45
- let ht = s((e) => {
46
+ let vt = s((e) => {
46
47
  let t = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, n = {
47
48
  ...e,
48
49
  id: t
49
50
  };
50
- return lt((e) => [...e.slice(-49), n]), t;
51
- }, []), N = s((e, t) => {
52
- lt((n) => n.map((n) => n.id === e ? {
51
+ return j((e) => [...e.slice(-49), n]), t;
52
+ }, []), P = s((e, t) => {
53
+ j((n) => n.map((n) => n.id === e ? {
53
54
  ...n,
54
55
  ...t
55
56
  } : n));
56
- }, []), P = s((e, t) => {
57
- if (pt((n) => {
57
+ }, []), F = s((e, t) => {
58
+ if (gt((n) => {
58
59
  let r = new Map(n);
59
60
  return r.set(e, t), r;
60
61
  }), t === "success" || t === "error") {
61
62
  let n = setTimeout(() => {
62
- pt((n) => {
63
+ gt((n) => {
63
64
  let r = new Map(n);
64
65
  return r.get(e) === t && r.delete(e), r;
65
- }), M.current.delete(e);
66
- }, 3e3), r = M.current.get(e);
67
- r && clearTimeout(r), M.current.set(e, n);
66
+ }), N.current.delete(e);
67
+ }, 3e3), r = N.current.get(e);
68
+ r && clearTimeout(r), N.current.set(e, n);
68
69
  }
69
70
  }, []);
70
- ke(() => {
71
- let e = A.current;
71
+ je(() => {
72
+ let e = O.current;
72
73
  return () => {
73
74
  for (let t of e.values()) clearTimeout(t);
74
75
  };
75
76
  }, []);
76
- let F = s((e, t, n, r) => {
77
+ let I = s((e, t, n, r) => {
77
78
  let i = Date.now() + Math.random();
78
- k((r) => [...r, {
79
+ D((r) => [...r, {
79
80
  message: e,
80
81
  variant: t,
81
82
  detail: n,
82
83
  id: i
83
84
  }]);
84
85
  let ee = setTimeout(() => {
85
- k((e) => e.filter((e) => e.id !== i)), A.current.delete(i);
86
+ D((e) => e.filter((e) => e.id !== i)), O.current.delete(i);
86
87
  }, r ?? (t === "success" ? 1e4 : 3e4));
87
- A.current.set(i, ee);
88
- }, []), gt = s((e) => {
89
- k((t) => t.filter((t) => t.id !== e));
90
- let t = A.current.get(e);
91
- t && (clearTimeout(t), A.current.delete(e));
92
- }, []), I = s((e, t) => {
93
- r(), j({
88
+ O.current.set(i, ee);
89
+ }, []), yt = s((e) => {
90
+ D((t) => t.filter((t) => t.id !== e));
91
+ let t = O.current.get(e);
92
+ t && (clearTimeout(t), O.current.delete(e));
93
+ }, []), L = s((e, t) => {
94
+ r(), _t({
94
95
  title: e,
95
96
  message: t
96
97
  });
97
- }, []), { data: _t, loading: vt, error: yt, refetch: L } = se({
98
+ }, []), { data: bt, loading: xt, error: St, refetch: R } = se({
98
99
  variables: { pagination: { limit: 50 } },
99
- skip: Xe
100
- }), R = Ae(() => _t?.vibeDecks?.items || [], [_t]), z = _ || R.find((e) => e.isDefault)?.id || R[0]?.id || null, { data: bt, loading: xt, refetch: B } = ae({
101
- variables: { id: z },
102
- skip: !z || Xe
103
- }), V = bt?.vibeDeck, H = Ae(() => R.filter((e) => S.has(e.id)), [R, S]), U = Ae(() => V?.buttons?.filter((e) => w.has(e.id)) ?? [], [V?.buttons, w]), St = R.length > 0 && R.every((e) => S.has(e.id)), Ct = R.some((e) => S.has(e.id)) && !St, wt = (V?.buttons?.length ?? 0) > 0 && (V?.buttons ?? []).every((e) => w.has(e.id)), Tt = (V?.buttons ?? []).some((e) => w.has(e.id)) && !wt, { data: Et } = oe({
100
+ skip: $e
101
+ }), z = Me(() => bt?.vibeDecks?.items || [], [bt]), B = g || z.find((e) => e.isDefault)?.id || z[0]?.id || null, { data: Ct, loading: wt, refetch: Tt } = ae({
102
+ variables: { id: B },
103
+ skip: !B || $e
104
+ }), V = Ct?.vibeDeck, H = Me(() => z.filter((e) => x.has(e.id)), [z, x]), U = Me(() => V?.buttons?.filter((e) => S.has(e.id)) ?? [], [V?.buttons, S]), Et = z.length > 0 && z.every((e) => x.has(e.id)), Dt = z.some((e) => x.has(e.id)) && !Et, Ot = (V?.buttons?.length ?? 0) > 0 && (V?.buttons ?? []).every((e) => S.has(e.id)), kt = (V?.buttons ?? []).some((e) => S.has(e.id)) && !Ot, { data: At } = oe({
104
105
  variables: { pagination: { limit: 100 } },
105
106
  fetchPolicy: "cache-and-network",
106
- skip: Xe
107
- }), Dt = (Et?.vibecontrolsAgents ?? []).map((e) => ({
107
+ skip: $e
108
+ }), jt = (At?.vibecontrolsAgents ?? []).map((e) => ({
108
109
  id: e.id,
109
110
  name: e.name,
110
111
  isActive: e.isActive
111
- })), [Ot, { loading: kt }] = ee({ refetchQueries: ["ListVibeDecks"] }), { setDraftTagIds: At, flushTags: jt } = _e("VIBECONTROLS_VIBEDECK"), [Mt, { loading: Nt }] = de({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [W] = ne({ refetchQueries: ["ListVibeDecks"] }), [G] = le({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [K] = re({ refetchQueries: ["ListVibeDecks"] }), [Pt, { loading: Ft }] = i({ refetchQueries: ["GetVibeDeck"] }), [It, { loading: Lt }] = ue({ refetchQueries: ["GetVibeDeck"] }), [q] = te({ refetchQueries: ["GetVibeDeck"] }), [Rt] = ce({ refetchQueries: ["GetVibeDeck"] }), [J] = ie();
112
- ke(() => {
113
- T(/* @__PURE__ */ new Set());
114
- }, [z]);
115
- let zt = s((e, t) => {
116
- C((n) => {
112
+ })), [Mt, { loading: Nt }] = ee({ refetchQueries: ["ListVibeDecks"] }), { setDraftTagIds: Pt, flushTags: Ft } = ve("VIBECONTROLS_VIBEDECK"), [It, { loading: Lt }] = de({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [W] = ne({ refetchQueries: ["ListVibeDecks"] }), [G] = le({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [K] = re({ refetchQueries: ["ListVibeDecks"] }), [Rt, { loading: zt }] = i({ refetchQueries: ["GetVibeDeck"] }), [Bt, { loading: Vt }] = ue({ refetchQueries: ["GetVibeDeck"] }), [q] = te({ refetchQueries: ["GetVibeDeck"] }), [Ht] = ce({ refetchQueries: ["GetVibeDeck"] }), [J] = ie();
113
+ je(() => {
114
+ C(/* @__PURE__ */ new Set());
115
+ }, [B]);
116
+ let Ut = s((e, t) => {
117
+ st((n) => {
117
118
  let r = new Set(n);
118
119
  return t ? r.add(e) : r.delete(e), r;
119
120
  });
120
- }, []), Bt = s((e) => {
121
- C((t) => {
121
+ }, []), Wt = s((e) => {
122
+ st((t) => {
122
123
  let n = new Set(t);
123
- return R.forEach((t) => {
124
+ return z.forEach((t) => {
124
125
  e ? n.add(t.id) : n.delete(t.id);
125
126
  }), n;
126
127
  });
127
- }, [R]), Y = s(() => {
128
- C(/* @__PURE__ */ new Set());
128
+ }, [z]), Y = s(() => {
129
+ st(/* @__PURE__ */ new Set());
129
130
  }, []);
130
131
  s((e, t) => {
131
- T((n) => {
132
+ C((n) => {
132
133
  let r = new Set(n);
133
134
  return t ? r.add(e) : r.delete(e), r;
134
135
  });
135
136
  }, []);
136
- let Vt = s((e) => {
137
- T((t) => {
137
+ let Gt = s((e) => {
138
+ C((t) => {
138
139
  let n = new Set(t);
139
140
  return (V?.buttons ?? []).forEach((t) => {
140
141
  e ? n.add(t.id) : n.delete(t.id);
141
142
  }), n;
142
143
  });
143
144
  }, [V?.buttons]), X = s(() => {
144
- T(/* @__PURE__ */ new Set());
145
- }, []), Ht = s(async (e) => {
145
+ C(/* @__PURE__ */ new Set());
146
+ }, []), Kt = s(async (e) => {
146
147
  try {
147
- let t = (await Ot({ variables: { input: {
148
+ let t = {
148
149
  name: e.name,
149
150
  description: e.description || null,
150
151
  colorTheme: e.colorTheme || null,
151
152
  gridColumns: e.gridColumns,
152
153
  gridRows: e.gridRows
153
- } } })).data?.createVibeDeck?.id;
154
- x({ type: "none" }), F("Deck created", "success"), t && await jt(t);
154
+ };
155
+ k.vibeId && (t.vibeId = k.vibeId, t.visibility = k.visibility);
156
+ let n = (await Mt({ variables: { input: t } })).data?.createVibeDeck?.id;
157
+ b({ type: "none" }), I("Deck created", "success"), A(a), n && await Ft(n);
155
158
  } catch (e) {
156
159
  if (n(e)) {
157
- x({ type: "none" }), I("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to create more decks.");
160
+ b({ type: "none" }), L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to create more decks.");
158
161
  return;
159
162
  }
160
- F(e instanceof Error ? e.message : "Failed to create deck", "error");
163
+ I(e instanceof Error ? e.message : "Failed to create deck", "error");
161
164
  }
162
165
  }, [
163
- Ot,
164
- jt,
165
- I,
166
- F
167
- ]), Ut = s(async (e) => {
168
- if (b.type === "editDeck") try {
169
- await Mt({ variables: {
170
- id: b.deckId,
166
+ Mt,
167
+ Ft,
168
+ L,
169
+ I
170
+ ]), qt = s(async (e) => {
171
+ if (y.type === "editDeck") try {
172
+ await It({ variables: {
173
+ id: y.deckId,
171
174
  input: {
172
175
  name: e.name,
173
176
  description: e.description || null,
@@ -175,31 +178,31 @@ function We() {
175
178
  gridColumns: e.gridColumns,
176
179
  gridRows: e.gridRows
177
180
  }
178
- } }), x({ type: "none" }), F("Deck updated", "success");
181
+ } }), b({ type: "none" }), I("Deck updated", "success");
179
182
  } catch (e) {
180
- F(e instanceof Error ? e.message : "Failed to update deck", "error");
183
+ I(e instanceof Error ? e.message : "Failed to update deck", "error");
181
184
  }
182
185
  }, [
183
- Mt,
184
- b,
185
- F
186
- ]), Wt = s(async () => {
187
- if (b.type === "confirmDelete") try {
188
- b.target === "deck" ? (await W({ variables: { id: b.id } }), _ === b.id && v(null), F("Deck deleted", "success")) : (await q({ variables: { id: b.id } }), F("Button deleted", "success")), x({ type: "none" }), ve() && ye("success");
186
+ It,
187
+ y,
188
+ I
189
+ ]), Jt = s(async () => {
190
+ if (y.type === "confirmDelete") try {
191
+ y.target === "deck" ? (await W({ variables: { id: y.id } }), g === y.id && _(null), I("Deck deleted", "success")) : (await q({ variables: { id: y.id } }), I("Button deleted", "success")), b({ type: "none" }), ye() && be("success");
189
192
  } catch (e) {
190
- F(e instanceof Error ? e.message : "Failed to delete", "error"), ve() && ye("error");
193
+ I(e instanceof Error ? e.message : "Failed to delete", "error"), ye() && be("error");
191
194
  }
192
195
  }, [
193
- b,
196
+ y,
194
197
  W,
195
198
  q,
199
+ g,
196
200
  _,
197
- v,
198
- F
201
+ I
199
202
  ]), Z = s(async (e) => {
200
203
  let t = V?.buttons?.find((t) => t.id === e);
201
204
  if (!t || !t.action) return;
202
- let r = t.action, i = ht({
205
+ let r = t.action, i = vt({
203
206
  buttonId: e,
204
207
  buttonLabel: t.label,
205
208
  actionType: r.actionType,
@@ -207,12 +210,12 @@ function We() {
207
210
  status: "running",
208
211
  startedAt: /* @__PURE__ */ new Date()
209
212
  });
210
- rt(e), P(e, "executing");
213
+ ot(e), F(e, "executing");
211
214
  try {
212
215
  let t = (await J({ variables: { id: e } })).data?.executeVibeDeckButton;
213
216
  if (t) {
214
217
  let n = t.status === "success";
215
- P(e, n ? "success" : "error"), N(i, {
218
+ F(e, n ? "success" : "error"), P(i, {
216
219
  status: n ? "success" : "error",
217
220
  output: t.output,
218
221
  exitCode: t.exitCode,
@@ -222,35 +225,35 @@ function We() {
222
225
  }
223
226
  } catch (t) {
224
227
  if (n(t)) {
225
- P(e, "error"), N(i, {
228
+ F(e, "error"), P(i, {
226
229
  status: "error",
227
230
  error: "Usage quota exhausted",
228
231
  completedAt: /* @__PURE__ */ new Date()
229
- }), I("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
232
+ }), L("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
230
233
  return;
231
234
  }
232
235
  let r = t instanceof Error ? t.message : "Execution failed";
233
- P(e, "error"), N(i, {
236
+ F(e, "error"), P(i, {
234
237
  status: "error",
235
238
  error: r,
236
239
  completedAt: /* @__PURE__ */ new Date()
237
240
  });
238
241
  } finally {
239
- rt(null);
242
+ ot(null);
240
243
  }
241
244
  }, [
242
245
  V,
243
246
  J,
244
- ht,
245
- N,
247
+ vt,
246
248
  P,
247
- I
248
- ]), Gt = s(async (e) => {
249
+ F,
250
+ L
251
+ ]), Yt = s(async (e) => {
249
252
  let t = V?.buttons?.find((t) => t.id === e);
250
253
  if (t) {
251
254
  if (t.confirmationRequired) {
252
255
  let n = t.action, r = n?.actionType === "WEBHOOK" ? `POST ${n.webhookUrl || ""}` : n?.command || "";
253
- x({
256
+ b({
254
257
  type: "confirmExecute",
255
258
  buttonId: e,
256
259
  label: t.label,
@@ -260,37 +263,37 @@ function We() {
260
263
  }
261
264
  await Z(e);
262
265
  }
263
- }, [V, Z]), Kt = s(async () => {
264
- if (b.type !== "confirmExecute") return;
265
- let e = b.buttonId;
266
- x({ type: "none" }), await Z(e);
267
- }, [b, Z]), qt = s(async (e) => {
268
- if (!(b.type !== "createButton" || !z)) try {
269
- await Pt({ variables: { input: {
270
- vibeDeckId: z,
266
+ }, [V, Z]), Xt = s(async () => {
267
+ if (y.type !== "confirmExecute") return;
268
+ let e = y.buttonId;
269
+ b({ type: "none" }), await Z(e);
270
+ }, [y, Z]), Zt = s(async (e) => {
271
+ if (!(y.type !== "createButton" || !B)) try {
272
+ await Rt({ variables: { input: {
273
+ vibeDeckId: B,
271
274
  label: e.label,
272
275
  actionId: e.actionId,
273
- row: b.row,
274
- column: b.column,
276
+ row: y.row,
277
+ column: y.column,
275
278
  rowSpan: e.rowSpan,
276
279
  colSpan: e.colSpan,
277
280
  color: e.color || null,
278
281
  category: e.category || null,
279
282
  keyboardShortcut: e.keyboardShortcut || null,
280
283
  confirmationRequired: e.confirmationRequired
281
- } } }), x({ type: "none" }), F("Button created", "success");
284
+ } } }), b({ type: "none" }), I("Button created", "success");
282
285
  } catch (e) {
283
- F(e instanceof Error ? e.message : "Failed to create button", "error");
286
+ I(e instanceof Error ? e.message : "Failed to create button", "error");
284
287
  }
285
288
  }, [
286
- b,
287
- Pt,
288
- z,
289
- F
290
- ]), Jt = s(async (e) => {
291
- if (b.type === "editButton") try {
292
- await It({ variables: {
293
- id: b.buttonId,
289
+ y,
290
+ Rt,
291
+ B,
292
+ I
293
+ ]), Qt = s(async (e) => {
294
+ if (y.type === "editButton") try {
295
+ await Bt({ variables: {
296
+ id: y.buttonId,
294
297
  input: {
295
298
  label: e.label,
296
299
  actionId: e.actionId,
@@ -301,17 +304,17 @@ function We() {
301
304
  rowSpan: e.rowSpan,
302
305
  colSpan: e.colSpan
303
306
  }
304
- } }), x({ type: "none" }), F("Button updated", "success");
307
+ } }), b({ type: "none" }), I("Button updated", "success");
305
308
  } catch (e) {
306
- F(e instanceof Error ? e.message : "Failed to update button", "error");
309
+ I(e instanceof Error ? e.message : "Failed to update button", "error");
307
310
  }
308
311
  }, [
309
- b,
310
- It,
311
- F
312
- ]), Yt = s(async (e, t, n) => {
312
+ y,
313
+ Bt,
314
+ I
315
+ ]), $t = s(async (e, t, n) => {
313
316
  try {
314
- await Rt({ variables: {
317
+ await Ht({ variables: {
315
318
  id: e,
316
319
  input: {
317
320
  row: t,
@@ -319,154 +322,154 @@ function We() {
319
322
  }
320
323
  } });
321
324
  } catch (e) {
322
- F(e instanceof Error ? e.message : "Failed to move button", "error");
325
+ I(e instanceof Error ? e.message : "Failed to move button", "error");
323
326
  }
324
- }, [Rt, F]), Xt = s(async (e) => {
325
- let t = R.find((t) => t.id === e);
327
+ }, [Ht, I]), en = s(async (e) => {
328
+ let t = z.find((t) => t.id === e);
326
329
  if (t) try {
327
330
  await K({ variables: {
328
331
  id: e,
329
332
  name: `${t.name} (Copy)`
330
- } }), F("Deck duplicated", "success");
333
+ } }), I("Deck duplicated", "success");
331
334
  } catch (e) {
332
335
  if (n(e)) {
333
- I("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
336
+ L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
334
337
  return;
335
338
  }
336
- F(e instanceof Error ? e.message : "Failed to duplicate deck", "error");
339
+ I(e instanceof Error ? e.message : "Failed to duplicate deck", "error");
337
340
  }
338
341
  }, [
339
- R,
342
+ z,
340
343
  K,
341
- I,
342
- F
343
- ]), Zt = s(async (e) => {
344
+ L,
345
+ I
346
+ ]), tn = s(async (e) => {
344
347
  try {
345
- await G({ variables: { id: e } }), F("Default deck set", "success");
348
+ await G({ variables: { id: e } }), I("Default deck set", "success");
346
349
  } catch (e) {
347
- F(e instanceof Error ? e.message : "Failed to set default", "error");
350
+ I(e instanceof Error ? e.message : "Failed to set default", "error");
348
351
  }
349
- }, [G, F]), Qt = s(async () => {
352
+ }, [G, I]), nn = s(async () => {
350
353
  if (H.length === 1) {
351
- O("setDefaultDeck");
354
+ E("setDefaultDeck");
352
355
  try {
353
- await G({ variables: { id: H[0].id } }), F("Default deck set", "success"), Y(), await L();
356
+ await G({ variables: { id: H[0].id } }), I("Default deck set", "success"), Y(), await R();
354
357
  } catch (e) {
355
- F(e instanceof Error ? e.message : "Failed to set default deck", "error");
358
+ I(e instanceof Error ? e.message : "Failed to set default deck", "error");
356
359
  } finally {
357
- O(null);
360
+ E(null);
358
361
  }
359
362
  }
360
363
  }, [
361
364
  H,
362
365
  G,
363
- F,
366
+ I,
364
367
  Y,
365
- L
366
- ]), $t = s(async () => {
368
+ R
369
+ ]), rn = s(async () => {
367
370
  if (H.length !== 0) {
368
- O("duplicateDeck");
371
+ E("duplicateDeck");
369
372
  try {
370
373
  let e = await Promise.allSettled(H.map((e) => K({ variables: {
371
374
  id: e.id,
372
375
  name: `${e.name} (Copy)`
373
376
  } })));
374
377
  if (e.some((e) => e.status === "rejected" && n(e.reason))) {
375
- I("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
378
+ L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
376
379
  return;
377
380
  }
378
381
  let t = e.filter((e) => e.status === "fulfilled").length, r = e.length - t;
379
- F(`Duplicated ${t} deck${t === 1 ? "" : "s"}${r > 0 ? ` • ${r} failed` : ""}`, r > 0 ? "error" : "success"), Y(), await L();
382
+ I(`Duplicated ${t} deck${t === 1 ? "" : "s"}${r > 0 ? ` • ${r} failed` : ""}`, r > 0 ? "error" : "success"), Y(), await R();
380
383
  } catch (e) {
381
384
  if (n(e)) {
382
- I("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
385
+ L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
383
386
  return;
384
387
  }
385
- F(e instanceof Error ? e.message : "Failed to duplicate decks", "error");
388
+ I(e instanceof Error ? e.message : "Failed to duplicate decks", "error");
386
389
  } finally {
387
- O(null);
390
+ E(null);
388
391
  }
389
392
  }
390
393
  }, [
391
394
  H,
392
395
  K,
396
+ L,
393
397
  I,
394
- F,
395
398
  Y,
396
- L
397
- ]), en = s(async () => {
399
+ R
400
+ ]), an = s(async () => {
398
401
  if (H.length !== 0) {
399
- O("deleteDeck");
402
+ E("deleteDeck");
400
403
  try {
401
404
  let e = await Promise.allSettled(H.map((e) => W({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
402
- H.some((e) => e.id === _) && v(null), F(`Deleted ${t} deck${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), Y(), at(null), await L();
405
+ H.some((e) => e.id === g) && _(null), I(`Deleted ${t} deck${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), Y(), lt(null), await R();
403
406
  } catch (e) {
404
- F(e instanceof Error ? e.message : "Failed to delete decks", "error");
407
+ I(e instanceof Error ? e.message : "Failed to delete decks", "error");
405
408
  } finally {
406
- O(null);
409
+ E(null);
407
410
  }
408
411
  }
409
412
  }, [
410
413
  H,
411
414
  W,
415
+ g,
412
416
  _,
413
- v,
414
- F,
417
+ I,
415
418
  Y,
416
- L
417
- ]), tn = s(async () => {
419
+ R
420
+ ]), on = s(async () => {
418
421
  if (U.length === 0) return;
419
- O("executeButton");
422
+ E("executeButton");
420
423
  let e = 0, t = 0;
421
424
  try {
422
425
  for (let r of U) try {
423
426
  (await J({ variables: { id: r.id } })).data?.executeVibeDeckButton?.status === "success" ? e += 1 : t += 1;
424
427
  } catch (e) {
425
428
  if (n(e)) {
426
- E(null), I("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
429
+ w(null), L("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
427
430
  return;
428
431
  }
429
432
  t += 1;
430
433
  }
431
- F(`Executed ${e} button${e === 1 ? "" : "s"}${t > 0 ? ` • ${t} failed` : ""}`, t > 0 ? "error" : "success"), X(), E(null);
434
+ I(`Executed ${e} button${e === 1 ? "" : "s"}${t > 0 ? ` • ${t} failed` : ""}`, t > 0 ? "error" : "success"), X(), w(null);
432
435
  } catch (e) {
433
- F(e instanceof Error ? e.message : "Failed to execute buttons", "error");
436
+ I(e instanceof Error ? e.message : "Failed to execute buttons", "error");
434
437
  } finally {
435
- O(null);
438
+ E(null);
436
439
  }
437
440
  }, [
438
441
  U,
439
442
  J,
443
+ L,
440
444
  I,
441
- F,
442
445
  X
443
- ]), nn = s(async () => {
446
+ ]), sn = s(async () => {
444
447
  if (U.length !== 0) {
445
- O("deleteButton");
448
+ E("deleteButton");
446
449
  try {
447
450
  let e = await Promise.allSettled(U.map((e) => q({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
448
- F(`Deleted ${t} button${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), X(), E(null), await B();
451
+ I(`Deleted ${t} button${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), X(), w(null), await Tt();
449
452
  } catch (e) {
450
- F(e instanceof Error ? e.message : "Failed to delete buttons", "error");
453
+ I(e instanceof Error ? e.message : "Failed to delete buttons", "error");
451
454
  } finally {
452
- O(null);
455
+ E(null);
453
456
  }
454
457
  }
455
458
  }, [
456
459
  U,
457
460
  q,
458
- F,
461
+ I,
459
462
  X,
460
- B
463
+ Tt
461
464
  ]);
462
- if (Ge) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(a, { message: "Loading permissions..." }) });
463
- if (p && (p.permissionStrings?.length ?? 0) > 0 && !Ke) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(Ue, {}) });
464
- if (vt) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(a, { message: "Loading Vibe Decks..." }) });
465
- if (yt) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(he, {
466
- message: yt.message,
467
- onRetry: () => L()
465
+ if (qe) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(he, { message: "Loading permissions..." }) });
466
+ if (p && (p.permissionStrings?.length ?? 0) > 0 && !Je) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(Ge, {}) });
467
+ if (xt) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(he, { message: "Loading Vibe Decks..." }) });
468
+ if (St) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(ge, {
469
+ message: St.message,
470
+ onRetry: () => R()
468
471
  }) });
469
- let Q = b.type === "editButton" ? V?.buttons?.find((e) => e.id === b.buttonId) : null, $ = b.type === "editDeck" ? R.find((e) => e.id === b.deckId) : null;
472
+ let Q = y.type === "editButton" ? V?.buttons?.find((e) => e.id === y.buttonId) : null, $ = y.type === "editDeck" ? z.find((e) => e.id === y.deckId) : null;
470
473
  return /* @__PURE__ */ u(d, {
471
474
  className: "p-4 sm:p-6 space-y-6",
472
475
  children: [
@@ -480,42 +483,44 @@ function We() {
480
483
  className: "flex items-center rounded-lg border border-border-default bg-bg-secondary p-0.5",
481
484
  children: [/* @__PURE__ */ u("button", {
482
485
  type: "button",
483
- onClick: () => Qe("preview"),
484
- className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${y ? "bg-action-primary-bg text-action-primary-text shadow-sm" : "text-text-tertiary hover:text-text-primary"}`,
485
- title: "Preview mode — execute only",
486
- children: [/* @__PURE__ */ l(Pe, { size: 14 }), "Preview"]
486
+ onClick: () => tt("preview"),
487
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${v ? "bg-action-primary-bg text-action-primary-text shadow-sm" : "text-text-tertiary hover:text-text-primary"}`,
488
+ title: v ? "Preview mode — execute only" : "Switch to Preview mode",
489
+ "aria-pressed": v,
490
+ children: [/* @__PURE__ */ l(Ie, { size: 14 }), "Preview"]
487
491
  }), /* @__PURE__ */ u("button", {
488
492
  type: "button",
489
- onClick: () => Qe("edit"),
490
- className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${y ? "text-text-tertiary hover:text-text-primary" : "bg-action-primary-bg text-action-primary-text shadow-sm"}`,
491
- title: "Edit mode — full editing",
492
- children: [/* @__PURE__ */ l(Fe, { size: 14 }), "Edit"]
493
+ onClick: () => tt("edit"),
494
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${v ? "text-text-tertiary hover:text-text-primary" : "bg-action-primary-bg text-action-primary-text shadow-sm"}`,
495
+ title: v ? "Switch to Edit mode" : "Edit mode — full editing",
496
+ "aria-pressed": !v,
497
+ children: [/* @__PURE__ */ l(Le, { size: 14 }), "Edit"]
493
498
  })]
494
499
  }),
495
- z && V && /* @__PURE__ */ l("button", {
500
+ B && V && /* @__PURE__ */ l("button", {
496
501
  type: "button",
497
- onClick: () => x({
502
+ onClick: () => b({
498
503
  type: "shareDeck",
499
- deckId: z,
504
+ deckId: B,
500
505
  deckName: V.name
501
506
  }),
502
507
  className: "p-2 rounded-lg hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary transition-colors",
503
508
  title: "Share deck",
504
- children: /* @__PURE__ */ l(Re, { size: 16 })
509
+ children: /* @__PURE__ */ l(Be, { size: 16 })
505
510
  }),
506
511
  /* @__PURE__ */ l("button", {
507
512
  type: "button",
508
513
  onClick: () => {
509
- L(), z && B();
514
+ R(), B && Tt();
510
515
  },
511
516
  className: "p-2 rounded-lg hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary transition-colors",
512
517
  title: "Refresh",
513
- children: /* @__PURE__ */ l(Le, { size: 16 })
518
+ children: /* @__PURE__ */ l(ze, { size: 16 })
514
519
  })
515
520
  ]
516
521
  })
517
522
  }),
518
- !y && R.length > 0 && /* @__PURE__ */ l("div", {
523
+ !v && z.length > 0 && /* @__PURE__ */ l("div", {
519
524
  className: "rounded-lg border border-border-default bg-bg-surface p-4",
520
525
  children: /* @__PURE__ */ u("div", {
521
526
  className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
@@ -523,16 +528,16 @@ function We() {
523
528
  className: "flex flex-wrap items-center gap-3",
524
529
  children: [/* @__PURE__ */ u("div", {
525
530
  className: "flex items-center gap-2",
526
- children: [/* @__PURE__ */ l(Se, {
527
- checked: St,
528
- indeterminate: Ct,
529
- onChange: Bt,
531
+ children: [/* @__PURE__ */ l(we, {
532
+ checked: Et,
533
+ indeterminate: Dt,
534
+ onChange: Wt,
530
535
  ariaLabel: "Select all vibe decks"
531
536
  }), /* @__PURE__ */ l("span", {
532
537
  className: "text-sm font-medium text-text-primary",
533
538
  children: "Select all decks"
534
539
  })]
535
- }), S.size > 0 && /* @__PURE__ */ l("button", {
540
+ }), x.size > 0 && /* @__PURE__ */ l("button", {
536
541
  type: "button",
537
542
  onClick: Y,
538
543
  className: "text-sm text-text-secondary hover:text-text-primary",
@@ -543,27 +548,27 @@ function We() {
543
548
  children: [
544
549
  /* @__PURE__ */ u("span", {
545
550
  className: "rounded-full bg-bg-sunken px-3 py-1 text-sm font-medium text-text-secondary",
546
- children: [S.size, " selected"]
551
+ children: [x.size, " selected"]
547
552
  }),
548
553
  /* @__PURE__ */ l("button", {
549
554
  type: "button",
550
- onClick: Qt,
551
- disabled: H.length !== 1 || H[0]?.isDefault || D !== null,
555
+ onClick: nn,
556
+ disabled: H.length !== 1 || H[0]?.isDefault || T !== null,
552
557
  className: "rounded-md border border-status-warning-border px-3 py-2 text-sm font-medium text-status-warning-text hover:bg-status-warning-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
553
558
  children: /* @__PURE__ */ u("span", {
554
559
  className: "inline-flex items-center gap-2",
555
- children: [/* @__PURE__ */ l(ze, { size: 14 }), "Set Selected Default"]
560
+ children: [/* @__PURE__ */ l(Ve, { size: 14 }), "Set Selected Default"]
556
561
  })
557
562
  }),
558
563
  /* @__PURE__ */ l("button", {
559
564
  type: "button",
560
- onClick: $t,
561
- disabled: H.length === 0 || D !== null,
565
+ onClick: rn,
566
+ disabled: H.length === 0 || T !== null,
562
567
  className: "rounded-md border border-border-default px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50",
563
568
  children: /* @__PURE__ */ u("span", {
564
569
  className: "inline-flex items-center gap-2",
565
570
  children: [
566
- /* @__PURE__ */ l(Ne, { size: 14 }),
571
+ /* @__PURE__ */ l(Fe, { size: 14 }),
567
572
  "Duplicate Selected",
568
573
  H.length > 0 ? ` (${H.length})` : ""
569
574
  ]
@@ -571,13 +576,13 @@ function We() {
571
576
  }),
572
577
  /* @__PURE__ */ l("button", {
573
578
  type: "button",
574
- onClick: () => at("delete"),
575
- disabled: H.length === 0 || D !== null,
579
+ onClick: () => lt("delete"),
580
+ disabled: H.length === 0 || T !== null,
576
581
  className: "rounded-md border border-status-error-border px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg disabled:cursor-not-allowed disabled:opacity-50",
577
582
  children: /* @__PURE__ */ u("span", {
578
583
  className: "inline-flex items-center gap-2",
579
584
  children: [
580
- /* @__PURE__ */ l(Be, { size: 14 }),
585
+ /* @__PURE__ */ l(He, { size: 14 }),
581
586
  "Delete Selected",
582
587
  H.length > 0 ? ` (${H.length})` : ""
583
588
  ]
@@ -587,64 +592,64 @@ function We() {
587
592
  })]
588
593
  })
589
594
  }),
590
- /* @__PURE__ */ l(we, {
591
- decks: R.map((e) => ({
595
+ /* @__PURE__ */ l(Ee, {
596
+ decks: z.map((e) => ({
592
597
  id: e.id,
593
598
  name: e.name,
594
599
  icon: e.icon || null,
595
600
  colorTheme: e.colorTheme || null,
596
601
  isDefault: e.isDefault
597
602
  })),
598
- activeDeckId: z,
599
- selectedDeckIds: S,
600
- onSelectDeck: (e) => v(e),
601
- onToggleSelectDeck: zt,
602
- onCreateDeck: () => x({ type: "createDeck" }),
603
- onSetDefault: Zt,
604
- onDuplicate: (e) => Xt(e),
603
+ activeDeckId: B,
604
+ selectedDeckIds: x,
605
+ onSelectDeck: (e) => _(e),
606
+ onToggleSelectDeck: Ut,
607
+ onCreateDeck: () => b({ type: "createDeck" }),
608
+ onSetDefault: tn,
609
+ onDuplicate: (e) => en(e),
605
610
  onDelete: (e) => {
606
- x({
611
+ b({
607
612
  type: "confirmDelete",
608
613
  target: "deck",
609
614
  id: e,
610
- name: R.find((t) => t.id === e)?.name || "this deck"
615
+ name: z.find((t) => t.id === e)?.name || "this deck"
611
616
  });
612
617
  },
613
- onEdit: (e) => x({
618
+ onEdit: (e) => b({
614
619
  type: "editDeck",
615
620
  deckId: e
616
621
  }),
617
622
  onShare: (e) => {
618
- let t = R.find((t) => t.id === e);
619
- t && x({
623
+ let t = z.find((t) => t.id === e);
624
+ t && b({
620
625
  type: "shareDeck",
621
626
  deckId: e,
622
627
  deckName: t.name
623
628
  });
624
629
  },
625
- canCreate: g,
626
- canUpdate: et,
627
- canDelete: tt
630
+ canCreate: Ye,
631
+ canUpdate: rt,
632
+ canDelete: it
628
633
  }),
629
- /* @__PURE__ */ u(He, {
634
+ /* @__PURE__ */ u(We, {
630
635
  mode: "wait",
631
- children: [!V && !xt && R.length === 0 && /* @__PURE__ */ l(be, {
636
+ children: [!V && !wt && z.length === 0 && /* @__PURE__ */ l(xe, {
632
637
  title: "No Vibe Decks yet",
633
638
  description: "Create your first Vibe Deck to start organizing your commands and webhooks",
634
639
  action: /* @__PURE__ */ u("div", {
635
640
  className: "flex items-center gap-2",
636
- children: [g && /* @__PURE__ */ l("button", {
641
+ children: [Ye && /* @__PURE__ */ l("button", {
637
642
  type: "button",
638
- onClick: () => x({ type: "createDeck" }),
643
+ onClick: () => b({ type: "createDeck" }),
639
644
  className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:opacity-90 text-sm font-medium",
640
645
  children: "Create Vibe Deck"
641
- }), /* @__PURE__ */ l(xe, { prompt: "What is a VibeDeck and how do I use it to organise controls?" })]
646
+ }), /* @__PURE__ */ l(Ce, { prompt: "What is a VibeDeck and how do I use it to organise controls?" })]
642
647
  })
643
- }), xt && /* @__PURE__ */ l(a, { message: "Loading deck..." })]
648
+ }), wt && /* @__PURE__ */ l(he, { message: "Loading deck..." })]
644
649
  }),
645
650
  V && /* @__PURE__ */ u("div", {
646
651
  className: "space-y-4",
647
- children: [!y && (V.buttons?.length ?? 0) > 0 && /* @__PURE__ */ l("div", {
652
+ children: [!v && (V.buttons?.length ?? 0) > 0 && /* @__PURE__ */ l("div", {
648
653
  className: "rounded-lg border border-border-default bg-bg-surface p-4",
649
654
  children: /* @__PURE__ */ u("div", {
650
655
  className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
@@ -652,16 +657,16 @@ function We() {
652
657
  className: "flex flex-wrap items-center gap-3",
653
658
  children: [/* @__PURE__ */ u("div", {
654
659
  className: "flex items-center gap-2",
655
- children: [/* @__PURE__ */ l(Se, {
656
- checked: wt,
657
- indeterminate: Tt,
658
- onChange: Vt,
660
+ children: [/* @__PURE__ */ l(we, {
661
+ checked: Ot,
662
+ indeterminate: kt,
663
+ onChange: Gt,
659
664
  ariaLabel: "Select all buttons in active deck"
660
665
  }), /* @__PURE__ */ l("span", {
661
666
  className: "text-sm font-medium text-text-primary",
662
667
  children: "Select all buttons in this deck"
663
668
  })]
664
- }), w.size > 0 && /* @__PURE__ */ l("button", {
669
+ }), S.size > 0 && /* @__PURE__ */ l("button", {
665
670
  type: "button",
666
671
  onClick: X,
667
672
  className: "text-sm text-text-secondary hover:text-text-primary",
@@ -672,17 +677,17 @@ function We() {
672
677
  children: [
673
678
  /* @__PURE__ */ u("span", {
674
679
  className: "rounded-full bg-bg-sunken px-3 py-1 text-sm font-medium text-text-secondary",
675
- children: [w.size, " selected"]
680
+ children: [S.size, " selected"]
676
681
  }),
677
682
  /* @__PURE__ */ l("button", {
678
683
  type: "button",
679
- onClick: () => E("execute"),
680
- disabled: U.length === 0 || D !== null,
684
+ onClick: () => w("execute"),
685
+ disabled: U.length === 0 || T !== null,
681
686
  className: "rounded-md border border-status-success-border px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg disabled:cursor-not-allowed disabled:opacity-50",
682
687
  children: /* @__PURE__ */ u("span", {
683
688
  className: "inline-flex items-center gap-2",
684
689
  children: [
685
- /* @__PURE__ */ l(Ie, { size: 14 }),
690
+ /* @__PURE__ */ l(Re, { size: 14 }),
686
691
  "Execute Selected",
687
692
  U.length > 0 ? ` (${U.length})` : ""
688
693
  ]
@@ -690,13 +695,13 @@ function We() {
690
695
  }),
691
696
  /* @__PURE__ */ l("button", {
692
697
  type: "button",
693
- onClick: () => E("delete"),
694
- disabled: U.length === 0 || D !== null,
698
+ onClick: () => w("delete"),
699
+ disabled: U.length === 0 || T !== null,
695
700
  className: "rounded-md border border-status-error-border px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg disabled:cursor-not-allowed disabled:opacity-50",
696
701
  children: /* @__PURE__ */ u("span", {
697
702
  className: "inline-flex items-center gap-2",
698
703
  children: [
699
- /* @__PURE__ */ l(Be, { size: 14 }),
704
+ /* @__PURE__ */ l(He, { size: 14 }),
700
705
  "Delete Selected",
701
706
  U.length > 0 ? ` (${U.length})` : ""
702
707
  ]
@@ -705,76 +710,100 @@ function We() {
705
710
  ]
706
711
  })]
707
712
  })
708
- }), /* @__PURE__ */ l(Ce, {
709
- gridColumns: V.gridColumns,
710
- gridRows: V.gridRows,
711
- buttons: (V.buttons || []).map((e) => ({
712
- id: e.id,
713
- label: e.label,
714
- icon: e.icon || null,
715
- color: e.color || null,
716
- category: e.category || null,
717
- confirmationRequired: e.confirmationRequired,
718
- keyboardShortcut: e.keyboardShortcut || null,
719
- actionId: e.actionId || null,
720
- action: e.action ? {
721
- id: e.action.id,
722
- name: e.action.name,
723
- displayName: e.action.displayName || null,
724
- actionType: e.action.actionType,
725
- command: e.action.command || null,
726
- script: e.action.script || null,
727
- webhookUrl: e.action.webhookUrl || null,
728
- targetAgentId: e.action.targetAgentId || null
729
- } : null,
730
- row: e.row,
731
- column: e.column,
732
- rowSpan: e.rowSpan,
733
- colSpan: e.colSpan
734
- })),
735
- onExecuteButton: Gt,
736
- onEditButton: (e) => x({
737
- type: "editButton",
738
- buttonId: e
739
- }),
740
- onDeleteButton: (e) => {
741
- let t = V.buttons?.find((t) => t.id === e);
742
- x({
743
- type: "confirmDelete",
744
- target: "button",
745
- id: e,
746
- name: t?.label || "this button"
747
- });
748
- },
749
- onDropButton: Yt,
750
- onAddButton: (e, t) => x({
751
- type: "createButton",
752
- row: e,
753
- column: t
754
- }),
755
- executingButtonId: nt,
756
- canCreate: $e,
757
- canUpdate: et,
758
- canDelete: tt,
759
- canExecute: Ye
713
+ }), /* @__PURE__ */ u("div", {
714
+ className: "relative",
715
+ children: [/* @__PURE__ */ l(Te, {
716
+ gridColumns: V.gridColumns,
717
+ gridRows: V.gridRows,
718
+ buttons: (V.buttons || []).map((e) => ({
719
+ id: e.id,
720
+ label: e.label,
721
+ icon: e.icon || null,
722
+ color: e.color || null,
723
+ category: e.category || null,
724
+ confirmationRequired: e.confirmationRequired,
725
+ keyboardShortcut: e.keyboardShortcut || null,
726
+ actionId: e.actionId || null,
727
+ action: e.action ? {
728
+ id: e.action.id,
729
+ name: e.action.name,
730
+ displayName: e.action.displayName || null,
731
+ actionType: e.action.actionType,
732
+ command: e.action.command || null,
733
+ script: e.action.script || null,
734
+ webhookUrl: e.action.webhookUrl || null,
735
+ targetAgentId: e.action.targetAgentId || null
736
+ } : null,
737
+ row: e.row,
738
+ column: e.column,
739
+ rowSpan: e.rowSpan,
740
+ colSpan: e.colSpan
741
+ })),
742
+ onExecuteButton: Yt,
743
+ onEditButton: (e) => b({
744
+ type: "editButton",
745
+ buttonId: e
746
+ }),
747
+ onDeleteButton: (e) => {
748
+ let t = V.buttons?.find((t) => t.id === e);
749
+ b({
750
+ type: "confirmDelete",
751
+ target: "button",
752
+ id: e,
753
+ name: t?.label || "this button"
754
+ });
755
+ },
756
+ onDropButton: $t,
757
+ onAddButton: (e, t) => b({
758
+ type: "createButton",
759
+ row: e,
760
+ column: t
761
+ }),
762
+ executingButtonId: at,
763
+ canCreate: nt,
764
+ canUpdate: rt,
765
+ canDelete: it,
766
+ canExecute: Qe
767
+ }), (V.buttons?.length ?? 0) === 0 && v && /* @__PURE__ */ l("div", {
768
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none",
769
+ children: /* @__PURE__ */ u("div", {
770
+ className: "bg-bg-elevated/90 backdrop-blur-md border border-border-default rounded-lg p-6 max-w-md pointer-events-auto shadow-xl text-center",
771
+ children: [
772
+ /* @__PURE__ */ l("h3", {
773
+ className: "text-lg font-semibold text-text-primary",
774
+ children: m("vibeDeck.emptyDeckTitle", "This deck is empty")
775
+ }),
776
+ /* @__PURE__ */ l("p", {
777
+ className: "text-sm text-text-secondary mt-2",
778
+ children: m("vibeDeck.emptyDeckDescription", "Switch to Edit mode to add buttons.")
779
+ }),
780
+ Xe && /* @__PURE__ */ l("button", {
781
+ type: "button",
782
+ onClick: () => tt("edit"),
783
+ className: "mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text text-sm font-medium hover:opacity-90 transition-opacity",
784
+ children: m("vibeDeck.editDeck", "Edit deck")
785
+ })
786
+ ]
787
+ })
788
+ })]
760
789
  })]
761
790
  }),
762
- ct.length > 0 && /* @__PURE__ */ l(Oe, {
763
- entries: ct,
764
- expanded: ut,
765
- onToggleExpanded: () => dt((e) => !e),
766
- onClear: () => lt([])
791
+ ft.length > 0 && /* @__PURE__ */ l(Ae, {
792
+ entries: ft,
793
+ expanded: pt,
794
+ onToggleExpanded: () => mt((e) => !e),
795
+ onClear: () => j([])
767
796
  }),
768
- /* @__PURE__ */ l(He, { children: st.length > 0 && /* @__PURE__ */ l("div", {
797
+ /* @__PURE__ */ l(We, { children: dt.length > 0 && /* @__PURE__ */ l("div", {
769
798
  className: "fixed bottom-4 left-4 right-4 sm:left-auto sm:bottom-6 sm:right-6 z-50 flex flex-col gap-2 max-w-[calc(100vw-2rem)] sm:max-w-md",
770
- children: st.slice(-3).map((e) => /* @__PURE__ */ u("div", {
799
+ children: dt.slice(-3).map((e) => /* @__PURE__ */ u("div", {
771
800
  role: "button",
772
801
  tabIndex: 0,
773
802
  onKeyDown: (t) => {
774
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), gt(e.id));
803
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), yt(e.id));
775
804
  },
776
805
  className: `p-4 rounded-xl shadow-lg border cursor-pointer ${e.variant === "success" ? "bg-status-success-bg/10 border-status-success-border/30 text-status-success-text" : "bg-status-error-bg/10 border-status-error-border/30 text-status-error-text"}`,
777
- onClick: () => gt(e.id),
806
+ onClick: () => yt(e.id),
778
807
  children: [/* @__PURE__ */ l("div", {
779
808
  className: "font-medium text-sm",
780
809
  children: e.message
@@ -784,20 +813,28 @@ function We() {
784
813
  })]
785
814
  }, e.id))
786
815
  }) }),
787
- b.type === "createDeck" && /* @__PURE__ */ l(Te, {
816
+ y.type === "createDeck" && /* @__PURE__ */ l(De, {
788
817
  title: "Create Vibe Deck",
789
- onSubmit: Ht,
790
- onCancel: () => x({ type: "none" }),
791
- isLoading: kt,
792
- extraSection: /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
793
- className: "text-sm font-medium text-text-secondary mb-2",
794
- children: m("vibeDeck.tags", "Tags")
795
- }), /* @__PURE__ */ l(ge, {
796
- entityType: "VIBECONTROLS_VIBEDECK",
797
- onDraftChange: At
798
- })] })
818
+ onSubmit: Kt,
819
+ onCancel: () => {
820
+ b({ type: "none" }), A(a);
821
+ },
822
+ isLoading: Nt,
823
+ extraSection: /* @__PURE__ */ u("div", {
824
+ className: "space-y-4",
825
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
826
+ className: "text-sm font-medium text-text-secondary mb-2",
827
+ children: m("vibeDeck.tags", "Tags")
828
+ }), /* @__PURE__ */ l(_e, {
829
+ entityType: "VIBECONTROLS_VIBEDECK",
830
+ onDraftChange: Pt
831
+ })] }), /* @__PURE__ */ l(Se, {
832
+ value: k,
833
+ onChange: A
834
+ })]
835
+ })
799
836
  }),
800
- b.type === "editDeck" && $ && /* @__PURE__ */ l(Te, {
837
+ y.type === "editDeck" && $ && /* @__PURE__ */ l(De, {
801
838
  title: "Edit Vibe Deck",
802
839
  initialData: {
803
840
  name: $.name,
@@ -806,29 +843,29 @@ function We() {
806
843
  gridColumns: $.gridColumns,
807
844
  gridRows: $.gridRows
808
845
  },
809
- onSubmit: Ut,
810
- onCancel: () => x({ type: "none" }),
811
- isLoading: Nt,
846
+ onSubmit: qt,
847
+ onCancel: () => b({ type: "none" }),
848
+ isLoading: Lt,
812
849
  extraSection: /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
813
850
  className: "text-sm font-medium text-text-secondary mb-2",
814
851
  children: m("vibeDeck.tags", "Tags")
815
- }), /* @__PURE__ */ l(ge, {
852
+ }), /* @__PURE__ */ l(_e, {
816
853
  entityType: "VIBECONTROLS_VIBEDECK",
817
854
  entityId: $.id
818
855
  })] })
819
856
  }),
820
- b.type === "createButton" && /* @__PURE__ */ l(Ee, {
857
+ y.type === "createButton" && /* @__PURE__ */ l(Oe, {
821
858
  title: "Add Button",
822
- agents: Dt,
823
- onSubmit: qt,
824
- onCancel: () => x({ type: "none" }),
825
- isLoading: Ft,
859
+ agents: jt,
860
+ onSubmit: Zt,
861
+ onCancel: () => b({ type: "none" }),
862
+ isLoading: zt,
826
863
  gridColumns: V?.gridColumns,
827
864
  gridRows: V?.gridRows,
828
- buttonRow: b.row,
829
- buttonColumn: b.column
865
+ buttonRow: y.row,
866
+ buttonColumn: y.column
830
867
  }),
831
- b.type === "editButton" && Q && /* @__PURE__ */ l(Ee, {
868
+ y.type === "editButton" && Q && /* @__PURE__ */ l(Oe, {
832
869
  title: "Edit Button",
833
870
  initialData: {
834
871
  label: Q.label,
@@ -840,81 +877,81 @@ function We() {
840
877
  rowSpan: Q.rowSpan,
841
878
  colSpan: Q.colSpan
842
879
  },
843
- agents: Dt,
844
- onSubmit: Jt,
845
- onCancel: () => x({ type: "none" }),
846
- isLoading: Lt,
880
+ agents: jt,
881
+ onSubmit: Qt,
882
+ onCancel: () => b({ type: "none" }),
883
+ isLoading: Vt,
847
884
  gridColumns: V?.gridColumns,
848
885
  gridRows: V?.gridRows,
849
886
  buttonRow: Q.row,
850
887
  buttonColumn: Q.column
851
888
  }),
852
- b.type === "confirmDelete" && /* @__PURE__ */ l(e, {
889
+ y.type === "confirmDelete" && /* @__PURE__ */ l(e, {
853
890
  isOpen: !0,
854
- title: `Delete ${b.target === "deck" ? "Vibe Deck" : "Button"}`,
855
- message: `Are you sure you want to delete "${b.name}"?${b.target === "deck" ? " All buttons in this deck will also be deleted." : ""}`,
891
+ title: `Delete ${y.target === "deck" ? "Vibe Deck" : "Button"}`,
892
+ message: `Are you sure you want to delete "${y.name}"?${y.target === "deck" ? " All buttons in this deck will also be deleted." : ""}`,
856
893
  confirmLabel: "Delete",
857
894
  variant: "danger",
858
- onConfirm: Wt,
859
- onClose: () => x({ type: "none" })
895
+ onConfirm: Jt,
896
+ onClose: () => b({ type: "none" })
860
897
  }),
861
- b.type === "confirmExecute" && /* @__PURE__ */ l(e, {
898
+ y.type === "confirmExecute" && /* @__PURE__ */ l(e, {
862
899
  isOpen: !0,
863
- title: `Execute: ${b.label}`,
864
- message: `Are you sure you want to execute this action?\n\n${b.detail}`,
900
+ title: `Execute: ${y.label}`,
901
+ message: `Are you sure you want to execute this action?\n\n${y.detail}`,
865
902
  confirmLabel: "Execute",
866
903
  variant: "warning",
867
- onConfirm: Kt,
868
- onClose: () => x({ type: "none" })
904
+ onConfirm: Xt,
905
+ onClose: () => b({ type: "none" })
869
906
  }),
870
907
  /* @__PURE__ */ l(e, {
871
- isOpen: it === "delete",
908
+ isOpen: ct === "delete",
872
909
  title: "Delete Vibe Decks",
873
910
  message: `Are you sure you want to delete ${H.length} selected deck${H.length === 1 ? "" : "s"}? All buttons in those decks will also be deleted.`,
874
911
  confirmLabel: "Delete Decks",
875
912
  variant: "danger",
876
- onConfirm: en,
877
- onClose: () => at(null),
878
- isLoading: D === "deleteDeck"
913
+ onConfirm: an,
914
+ onClose: () => lt(null),
915
+ isLoading: T === "deleteDeck"
879
916
  }),
880
917
  /* @__PURE__ */ l(e, {
881
- isOpen: ot === "execute",
918
+ isOpen: ut === "execute",
882
919
  title: "Execute Vibe Deck Buttons",
883
920
  message: `Execute ${U.length} selected button${U.length === 1 ? "" : "s"}? This may trigger commands, scripts, or webhooks immediately.`,
884
921
  confirmLabel: "Execute Buttons",
885
922
  variant: "warning",
886
- onConfirm: tn,
887
- onClose: () => E(null),
888
- isLoading: D === "executeButton"
923
+ onConfirm: on,
924
+ onClose: () => w(null),
925
+ isLoading: T === "executeButton"
889
926
  }),
890
927
  /* @__PURE__ */ l(e, {
891
- isOpen: ot === "delete",
928
+ isOpen: ut === "delete",
892
929
  title: "Delete Vibe Deck Buttons",
893
930
  message: `Delete ${U.length} selected button${U.length === 1 ? "" : "s"}? This cannot be undone.`,
894
931
  confirmLabel: "Delete Buttons",
895
932
  variant: "danger",
896
- onConfirm: nn,
897
- onClose: () => E(null),
898
- isLoading: D === "deleteButton"
933
+ onConfirm: sn,
934
+ onClose: () => w(null),
935
+ isLoading: T === "deleteButton"
899
936
  }),
900
- b.type === "shareDeck" && /* @__PURE__ */ l(De, {
901
- vibeDeckId: b.deckId,
902
- vibeDeckName: b.deckName,
903
- onClose: () => x({ type: "none" })
937
+ y.type === "shareDeck" && /* @__PURE__ */ l(ke, {
938
+ vibeDeckId: y.deckId,
939
+ vibeDeckName: y.deckName,
940
+ onClose: () => b({ type: "none" })
904
941
  }),
905
942
  /* @__PURE__ */ l(t, {
906
- isOpen: mt !== null,
907
- onClose: () => j(null),
943
+ isOpen: M !== null,
944
+ onClose: () => _t(null),
908
945
  onConfirm: () => {
909
- j(null), We("/billing");
946
+ _t(null), Ke("/billing");
910
947
  },
911
- title: mt?.title || "Quota Reached",
912
- message: mt?.message || "Upgrade your plan to continue."
948
+ title: M?.title || "Quota Reached",
949
+ message: M?.message || "Upgrade your plan to continue."
913
950
  })
914
951
  ]
915
952
  });
916
953
  }
917
954
  //#endregion
918
- export { We as VibeDeckPage };
955
+ export { Ke as VibeDeckPage };
919
956
 
920
957
  //# sourceMappingURL=VibeDeckPage.js.map