@burdenoff/microfe-vibecontrols 2026.1117.2 → 2026.1123.2

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.
@@ -9,117 +9,118 @@ import { useVibeControls as a } from "../../providers/VibeControlsProvider.js";
9
9
  import { useGitopsContributors as ee, useGitopsIssues as te, useGitopsLanguages as ne, useGitopsPipelineAnalytics as re, useGitopsProviders as ie, useGitopsPullRequests as ae, useGitopsRepos as o, useGitopsRuns as oe, useGitopsSecurityAlerts as se } from "../../hooks/useGitops.js";
10
10
  import { composeCiStatus as ce, composeRepoStats as le } from "./types.js";
11
11
  import { appendIframeTokenQuery as s, mintIframeToken as c, scheduleIframeTokenRefresh as l } from "../../services/iframeToken.js";
12
- import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
13
- import { BarChart3 as ue, GitBranch as de, GitMerge as m, Play as h, RefreshCw as g } from "lucide-react";
14
- import { useQueryClient as _ } from "@tanstack/react-query";
15
- import { motion as fe } from "framer-motion";
16
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
12
+ import { getSafeTunnelIframeUrl as ue } from "../../utils/iframeUrl.js";
13
+ import { useCallback as de, useEffect as u, useMemo as d, useState as f } from "react";
14
+ import { BarChart3 as fe, GitBranch as pe, GitMerge as p, Play as m, RefreshCw as h } from "lucide-react";
15
+ import { useQueryClient as me } from "@tanstack/react-query";
16
+ import { motion as he } from "framer-motion";
17
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
17
18
  // src/components/gitops/VibeGitOpsTab.tsx
18
- var x = ({ vibeId: x, agentId: w, profile: T, tunnelUrl: E, tr: D }) => {
19
- let [O, pe] = p("repo-stats"), [k, A] = p(!1), [j, M] = p(null), [N, me] = p(null), { workspaceId: P } = a(), F = _(), I = f(() => ({
20
- profile: T,
21
- workspaceId: P ?? "",
22
- agentId: w
19
+ var y = ({ vibeId: y, agentId: S, profile: C, tunnelUrl: w, tr: T }) => {
20
+ let [E, ge] = f("repo-stats"), [D, O] = f(!1), [k, A] = f(null), [j, _e] = f(null), { workspaceId: M } = a(), N = me(), P = d(() => ({
21
+ profile: C,
22
+ workspaceId: M ?? "",
23
+ agentId: S
23
24
  }), [
24
- T,
25
- P,
26
- w
27
- ]), L = ie(I), R = f(() => L.data?.filter((e) => e.registered && e.authenticated) ?? [], [L.data]), z = R.length > 0;
28
- d(() => {
29
- if (!j && R.length > 0) {
30
- let e = R[0];
31
- e && M(e.name);
25
+ C,
26
+ M,
27
+ S
28
+ ]), F = ie(P), I = d(() => F.data?.filter((e) => e.registered && e.authenticated) ?? [], [F.data]), L = I.length > 0;
29
+ u(() => {
30
+ if (!k && I.length > 0) {
31
+ let e = I[0];
32
+ e && A(e.name);
32
33
  }
33
- }, [R, j]);
34
- let B = o(I, j, { limit: 30 });
35
- d(() => {
36
- if (!N && B.data?.items.length) {
37
- let e = B.data.items[0];
38
- e && me(e.fqn);
34
+ }, [I, k]);
35
+ let R = o(P, k, { limit: 30 });
36
+ u(() => {
37
+ if (!j && R.data?.items.length) {
38
+ let e = R.data.items[0];
39
+ e && _e(e.fqn);
39
40
  }
40
- }, [B.data, N]);
41
- let V = o(I, j, { limit: 1 });
41
+ }, [R.data, j]);
42
+ let z = o(P, k, { limit: 1 });
42
43
  o.length;
43
- let H = ae(I, j, N, {
44
+ let B = ae(P, k, j, {
44
45
  state: "open",
45
46
  limit: 100
46
- }), U = te(I, j, N, {
47
+ }), V = te(P, k, j, {
47
48
  state: "open",
48
49
  limit: 100
49
- }), W = ne(I, j, N), G = ee(I, j, N, 20), K = se(I, j, N), q = f(() => N ? V.data?.items.find((e) => e.fqn === N) ?? B.data?.items.find((e) => e.fqn === N) ?? null : V.data?.items[0] ?? null, [
50
- V.data,
51
- B.data,
52
- N
53
- ]), he = f(() => le({
54
- repo: q,
55
- pulls: H.data,
56
- issues: U.data,
57
- languages: W.data,
58
- contributors: G.data,
59
- securityAlerts: K.data
50
+ }), H = ne(P, k, j), U = ee(P, k, j, 20), W = se(P, k, j), G = d(() => j ? z.data?.items.find((e) => e.fqn === j) ?? R.data?.items.find((e) => e.fqn === j) ?? null : z.data?.items[0] ?? null, [
51
+ z.data,
52
+ R.data,
53
+ j
54
+ ]), ve = d(() => le({
55
+ repo: G,
56
+ pulls: B.data,
57
+ issues: V.data,
58
+ languages: H.data,
59
+ contributors: U.data,
60
+ securityAlerts: W.data
60
61
  }), [
61
- q,
62
+ G,
63
+ B.data,
64
+ V.data,
62
65
  H.data,
63
66
  U.data,
64
- W.data,
65
- G.data,
66
- K.data
67
- ]), J = oe(I, j, N, { limit: 30 }), Y = re(I, j, N), ge = f(() => ce({
67
+ W.data
68
+ ]), K = oe(P, k, j, { limit: 30 }), q = re(P, k, j), ye = d(() => ce({
68
69
  pipelines: void 0,
69
- runs: J.data,
70
- analytics: Y.data
71
- }), [J.data, Y.data]), _e = H.isLoading || U.isLoading || W.isLoading, ve = J.isLoading || Y.isLoading, ye = (H.error || U.error || W.error)?.message, be = (J.error || Y.error)?.message, xe = u(() => {
72
- F.invalidateQueries({ queryKey: [
70
+ runs: K.data,
71
+ analytics: q.data
72
+ }), [K.data, q.data]), be = B.isLoading || V.isLoading || H.isLoading, xe = K.isLoading || q.isLoading, J = (B.error || V.error || H.error)?.message, Se = (K.error || q.error)?.message, Ce = de(() => {
73
+ N.invalidateQueries({ queryKey: [
73
74
  "gitops",
74
- P ?? "",
75
- w,
76
- T
75
+ M ?? "",
76
+ S,
77
+ C
77
78
  ] });
78
79
  }, [
79
- F,
80
- P,
81
- w,
82
- T
83
- ]), X = H.isFetching || J.isFetching, Se = [
80
+ N,
81
+ M,
82
+ S,
83
+ C
84
+ ]), Y = B.isFetching || K.isFetching, we = [
84
85
  {
85
86
  id: "repo-stats",
86
- label: D("gitops.repoStats", "Repo Stats"),
87
- icon: ue
87
+ label: T("gitops.repoStats", "Repo Stats"),
88
+ icon: fe
88
89
  },
89
90
  {
90
91
  id: "ci",
91
- label: D("gitops.ci", "CI Pipelines"),
92
- icon: h
92
+ label: T("gitops.ci", "CI Pipelines"),
93
+ icon: m
93
94
  },
94
95
  {
95
96
  id: "git-ui",
96
- label: D("gitops.gitUI", "Git UI"),
97
- icon: de
97
+ label: T("gitops.gitUI", "Git UI"),
98
+ icon: pe
98
99
  }
99
- ], [Z, Q] = p(null), [$, Ce] = p(null);
100
- return d(() => {
100
+ ], [X, Z] = f(null), [Q, Te] = f(null), $ = d(() => ue(X), [X]);
101
+ return u(() => {
101
102
  let e = !1, t = null;
102
103
  return (async () => {
103
- if (!w || !E || O !== "git-ui") Q(null);
104
+ if (!S || !w || E !== "git-ui") Z(null);
104
105
  else try {
105
- let n = await c(w, T, "/git");
106
+ let n = await c(S, C, "/git");
106
107
  if (e) return;
107
- let r = `${E.replace(/\/$/, "")}/git/`;
108
- Q(s(r, n.token)), t = l(w, T, "/git", n, (e) => {
109
- Q(s(r, e.token));
108
+ let r = `${w.replace(/\/$/, "")}/git/`;
109
+ Z(s(r, n.token)), t = l(S, C, "/git", n, (e) => {
110
+ Z(s(r, e.token));
110
111
  });
111
112
  } catch (t) {
112
- e || Ce(t instanceof Error ? t.message : "Failed to fetch iframe token");
113
+ e || Te(t instanceof Error ? t.message : "Failed to fetch iframe token");
113
114
  }
114
115
  })(), () => {
115
116
  e = !0, t?.cancel();
116
117
  };
117
118
  }, [
119
+ S,
120
+ C,
118
121
  w,
119
- T,
120
- E,
121
- O
122
- ]), /* @__PURE__ */ b(fe.div, {
122
+ E
123
+ ]), /* @__PURE__ */ v(he.div, {
123
124
  initial: {
124
125
  opacity: 0,
125
126
  y: 8
@@ -134,124 +135,126 @@ var x = ({ vibeId: x, agentId: w, profile: T, tunnelUrl: E, tr: D }) => {
134
135
  },
135
136
  transition: { duration: .2 },
136
137
  className: "space-y-4",
137
- "data-vibe-id": x,
138
- children: [/* @__PURE__ */ b("div", {
138
+ "data-vibe-id": y,
139
+ children: [/* @__PURE__ */ v("div", {
139
140
  className: "flex items-center justify-between",
140
- children: [/* @__PURE__ */ b("div", {
141
+ children: [/* @__PURE__ */ v("div", {
141
142
  className: "flex items-center gap-2",
142
- children: [/* @__PURE__ */ y(m, { className: "size-5 text-text-secondary" }), /* @__PURE__ */ y("h3", {
143
+ children: [/* @__PURE__ */ _(p, { className: "size-5 text-text-secondary" }), /* @__PURE__ */ _("h3", {
143
144
  className: "font-semibold text-text-primary",
144
- children: D("vibeDetails.gitopsTitle", "GitOps")
145
+ children: T("vibeDetails.gitopsTitle", "GitOps")
145
146
  })]
146
- }), /* @__PURE__ */ b("div", {
147
+ }), /* @__PURE__ */ v("div", {
147
148
  className: "flex items-center gap-2",
148
149
  children: [
149
- z && /* @__PURE__ */ y(i, {
150
- providers: R.map((e) => e.name),
151
- selected: j,
152
- onChange: M
150
+ L && /* @__PURE__ */ _(i, {
151
+ providers: I.map((e) => e.name),
152
+ selected: k,
153
+ onChange: A
153
154
  }),
154
- z && (O === "repo-stats" || O === "ci") && /* @__PURE__ */ b("button", {
155
+ L && (E === "repo-stats" || E === "ci") && /* @__PURE__ */ v("button", {
155
156
  type: "button",
156
- onClick: xe,
157
- disabled: X,
157
+ onClick: Ce,
158
+ disabled: Y,
158
159
  className: "flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md border border-border-default text-text-secondary hover:text-text-primary hover:border-border-strong disabled:opacity-50 transition-colors",
159
160
  "data-testid": "gitops-refresh",
160
- children: [/* @__PURE__ */ y(g, { className: `size-3 ${X ? "animate-spin" : ""}` }), D("gitops.refresh", "Refresh")]
161
+ children: [/* @__PURE__ */ _(h, { className: `size-3 ${Y ? "animate-spin" : ""}` }), T("gitops.refresh", "Refresh")]
161
162
  }),
162
- !k && /* @__PURE__ */ y("button", {
163
+ !D && /* @__PURE__ */ _("button", {
163
164
  type: "button",
164
- onClick: () => A(!0),
165
+ onClick: () => O(!0),
165
166
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
166
167
  "data-testid": "gitops-add-provider",
167
- children: D(z ? "gitops.addAnotherProvider" : "gitops.addProvider", "Add Provider")
168
+ children: T(L ? "gitops.addAnotherProvider" : "gitops.addProvider", "Add Provider")
168
169
  })
169
170
  ]
170
171
  })]
171
- }), /* @__PURE__ */ b("div", {
172
+ }), /* @__PURE__ */ v("div", {
172
173
  className: "flex flex-col gap-4 lg:flex-row lg:gap-6",
173
- children: [/* @__PURE__ */ y("nav", {
174
+ children: [/* @__PURE__ */ _("nav", {
174
175
  className: "w-full flex-shrink-0 rounded-lg border border-border-default bg-bg-surface p-2 lg:w-56",
175
176
  role: "tablist",
176
- "aria-label": D("gitops.navigation", "GitOps navigation"),
177
- children: Se.map((e) => {
178
- let t = e.icon, n = O === e.id;
179
- return /* @__PURE__ */ b("button", {
177
+ "aria-label": T("gitops.navigation", "GitOps navigation"),
178
+ children: we.map((e) => {
179
+ let t = e.icon, n = E === e.id;
180
+ return /* @__PURE__ */ v("button", {
180
181
  type: "button",
181
182
  role: "tab",
182
183
  "aria-selected": n,
183
- onClick: () => pe(e.id),
184
+ onClick: () => ge(e.id),
184
185
  className: `flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm font-medium transition-colors ${n ? "bg-action-primary-bg text-action-primary-text shadow-sm" : "text-text-secondary hover:bg-action-ghost-bg-hover hover:text-text-primary"}`,
185
- children: [/* @__PURE__ */ y(t, { className: "size-4 shrink-0" }), /* @__PURE__ */ y("span", {
186
+ children: [/* @__PURE__ */ _(t, { className: "size-4 shrink-0" }), /* @__PURE__ */ _("span", {
186
187
  className: "truncate",
187
188
  children: e.label
188
189
  })]
189
190
  }, e.id);
190
191
  })
191
- }), /* @__PURE__ */ b("div", {
192
+ }), /* @__PURE__ */ v("div", {
192
193
  className: "min-w-0 flex-1 space-y-4",
193
194
  children: [
194
- k && /* @__PURE__ */ y(r, {
195
- ctx: I,
195
+ D && /* @__PURE__ */ _(r, {
196
+ ctx: P,
196
197
  onCreated: () => {
197
- A(!1), L.refetch();
198
+ O(!1), F.refetch();
198
199
  },
199
- onCancel: () => A(!1)
200
+ onCancel: () => O(!1)
200
201
  }),
201
- O === "repo-stats" && !k && /* @__PURE__ */ y(v, { children: z ? w ? /* @__PURE__ */ y(e, {
202
- stats: he,
203
- loading: _e || L.isLoading,
204
- error: ye
205
- }) : /* @__PURE__ */ y(C, {
206
- tr: D,
202
+ E === "repo-stats" && !D && /* @__PURE__ */ _(g, { children: L ? S ? /* @__PURE__ */ _(e, {
203
+ stats: ve,
204
+ loading: be || F.isLoading,
205
+ error: J
206
+ }) : /* @__PURE__ */ _(x, {
207
+ tr: T,
207
208
  message: "gitops.noTunnel",
208
209
  fallback: "Waiting for agent tunnel. Make sure the agent is running and a tunnel is active."
209
- }) : /* @__PURE__ */ y(S, {
210
- tr: D,
211
- icon: m,
210
+ }) : /* @__PURE__ */ _(b, {
211
+ tr: T,
212
+ icon: p,
212
213
  message: "gitops.noProvidersVibe",
213
214
  fallback: "No GitOps provider configured. Add a PAT to see repository stats.",
214
- ctaLabel: D("gitops.addProvider", "Add Provider"),
215
- onCta: () => A(!0)
215
+ ctaLabel: T("gitops.addProvider", "Add Provider"),
216
+ onCta: () => O(!0)
216
217
  }) }),
217
- O === "ci" && !k && /* @__PURE__ */ y(v, { children: z ? w ? /* @__PURE__ */ y(t, {
218
- status: ge,
219
- loading: ve || L.isLoading,
220
- error: be
221
- }) : /* @__PURE__ */ y(C, {
222
- tr: D,
218
+ E === "ci" && !D && /* @__PURE__ */ _(g, { children: L ? S ? /* @__PURE__ */ _(t, {
219
+ status: ye,
220
+ loading: xe || F.isLoading,
221
+ error: Se
222
+ }) : /* @__PURE__ */ _(x, {
223
+ tr: T,
223
224
  message: "gitops.noTunnelCi",
224
225
  fallback: "Waiting for agent tunnel."
225
- }) : /* @__PURE__ */ y(S, {
226
- tr: D,
227
- icon: h,
226
+ }) : /* @__PURE__ */ _(b, {
227
+ tr: T,
228
+ icon: m,
228
229
  message: "gitops.noProvidersCi",
229
230
  fallback: "No GitOps provider configured. Add a PAT to see CI pipeline status.",
230
- ctaLabel: D("gitops.addProvider", "Add Provider"),
231
- onCta: () => A(!0)
231
+ ctaLabel: T("gitops.addProvider", "Add Provider"),
232
+ onCta: () => O(!0)
232
233
  }) }),
233
- O === "git-ui" && /* @__PURE__ */ y(n, {
234
- agentId: w || null,
234
+ E === "git-ui" && /* @__PURE__ */ _(n, {
235
+ agentId: S || null,
235
236
  required: ["@vibecontrols/vibe-plugin-tool-git"],
236
237
  mode: "all",
237
- eyebrow: D("gitops.ungitEyebrow", "Ungit plugin required"),
238
- title: D("gitops.ungitTitle", "Install the visual git client"),
239
- description: D("gitops.ungitDescription", "The Git UI embeds the Ungit visual git client served by your agent. Install the plugin to continue."),
240
- children: $ ? /* @__PURE__ */ y("div", {
238
+ eyebrow: T("gitops.ungitEyebrow", "Ungit plugin required"),
239
+ title: T("gitops.ungitTitle", "Install the visual git client"),
240
+ description: T("gitops.ungitDescription", "The Git UI embeds the Ungit visual git client served by your agent. Install the plugin to continue."),
241
+ children: Q ? /* @__PURE__ */ _("div", {
241
242
  className: "rounded-lg border border-border-default bg-status-error-bg-subtle p-4",
242
- children: /* @__PURE__ */ y("p", {
243
+ children: /* @__PURE__ */ _("p", {
243
244
  className: "text-sm text-status-error-text",
244
- children: $
245
+ children: Q
245
246
  })
246
- }) : Z ? /* @__PURE__ */ y("iframe", {
247
- src: Z,
247
+ }) : $ ? /* @__PURE__ */ _("iframe", {
248
+ src: $,
248
249
  title: "Ungit",
249
- className: "w-full min-h-[600px] rounded-lg border border-border-default"
250
- }) : /* @__PURE__ */ y("div", {
250
+ className: "w-full min-h-[600px] rounded-lg border border-border-default",
251
+ sandbox: "allow-scripts allow-same-origin allow-forms",
252
+ referrerPolicy: "no-referrer"
253
+ }) : /* @__PURE__ */ _("div", {
251
254
  className: "rounded-lg border border-border-default bg-bg-sunken p-4",
252
- children: /* @__PURE__ */ y("p", {
255
+ children: /* @__PURE__ */ _("p", {
253
256
  className: "text-sm text-text-secondary",
254
- children: D("gitops.ungitLoading", "Loading Ungit…")
257
+ children: T("gitops.ungitLoading", "Loading Ungit…")
255
258
  })
256
259
  })
257
260
  })
@@ -259,26 +262,26 @@ var x = ({ vibeId: x, agentId: w, profile: T, tunnelUrl: E, tr: D }) => {
259
262
  })]
260
263
  })]
261
264
  }, "gitops");
262
- }, S = ({ tr: e, icon: t, message: n, fallback: r, ctaLabel: i, onCta: a }) => /* @__PURE__ */ b("div", {
265
+ }, b = ({ tr: e, icon: t, message: n, fallback: r, ctaLabel: i, onCta: a }) => /* @__PURE__ */ v("div", {
263
266
  className: "rounded-lg border border-border-default bg-bg-surface p-6 text-center",
264
267
  children: [
265
- /* @__PURE__ */ y(t, { className: "size-8 text-text-secondary mx-auto mb-3" }),
266
- /* @__PURE__ */ y("p", {
268
+ /* @__PURE__ */ _(t, { className: "size-8 text-text-secondary mx-auto mb-3" }),
269
+ /* @__PURE__ */ _("p", {
267
270
  className: "text-sm text-text-secondary",
268
271
  children: e(n, r)
269
272
  }),
270
- i && a && /* @__PURE__ */ y("button", {
273
+ i && a && /* @__PURE__ */ _("button", {
271
274
  type: "button",
272
275
  onClick: a,
273
276
  className: "mt-3 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
274
277
  children: i
275
278
  })
276
279
  ]
277
- }), C = ({ tr: e, message: t, fallback: n }) => /* @__PURE__ */ y("div", {
280
+ }), x = ({ tr: e, message: t, fallback: n }) => /* @__PURE__ */ _("div", {
278
281
  className: "rounded-lg border border-border-default bg-bg-sunken p-4",
279
- children: /* @__PURE__ */ y("p", {
282
+ children: /* @__PURE__ */ _("p", {
280
283
  className: "text-sm text-text-secondary",
281
284
  children: e(t, n)
282
285
  })
283
286
  });
284
- export { x as VibeGitOpsTab };
287
+ export { y as VibeGitOpsTab };