@burdenoff/microfe-vibecontrols 2026.528.6 → 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 (42) hide show
  1. package/dist/VibeControlsRoot.js +90 -81
  2. package/dist/VibeControlsRoot.js.map +1 -1
  3. package/dist/VibeControlsRoutes.js +144 -140
  4. package/dist/VibeControlsRoutes.js.map +1 -1
  5. package/dist/components/audit/AuditLogFilters.js +71 -47
  6. package/dist/components/audit/AuditLogFilters.js.map +1 -1
  7. package/dist/components/shared/AgentSetupBanner.js +50 -45
  8. package/dist/components/shared/AgentSetupBanner.js.map +1 -1
  9. package/dist/components/shared/LinkToVibePanel.js +97 -0
  10. package/dist/components/shared/LinkToVibePanel.js.map +1 -0
  11. package/dist/components/shared/index.js +1 -0
  12. package/dist/components/templates/TemplateWizard.js +2 -2
  13. package/dist/components/templates/TemplateWizard.js.map +1 -1
  14. package/dist/components/vibe/VibeLinkedEntitiesPanel.js +60 -0
  15. package/dist/components/vibe/VibeLinkedEntitiesPanel.js.map +1 -0
  16. package/dist/components/vibedeck/VibeDeckButtonTile.js +25 -23
  17. package/dist/components/vibedeck/VibeDeckButtonTile.js.map +1 -1
  18. package/dist/components/vibedeck/VibeDeckGrid.js +2 -2
  19. package/dist/components/vibedeck/VibeDeckGrid.js.map +1 -1
  20. package/dist/constants/pluginCatalog.js +1 -1
  21. package/dist/microfe-vibecontrols.css +1 -1
  22. package/dist/pages/AgentDetailsPage.js +2 -2
  23. package/dist/pages/AgentDetailsPage.js.map +1 -1
  24. package/dist/pages/AnalyticsPage.js +255 -204
  25. package/dist/pages/AnalyticsPage.js.map +1 -1
  26. package/dist/pages/OverviewPage.js +1 -11
  27. package/dist/pages/OverviewPage.js.map +1 -1
  28. package/dist/pages/PluginsCatalogPage.js +287 -0
  29. package/dist/pages/PluginsCatalogPage.js.map +1 -0
  30. package/dist/pages/SessionsPage.js +825 -629
  31. package/dist/pages/SessionsPage.js.map +1 -1
  32. package/dist/pages/VibeAuditPage.js +184 -153
  33. package/dist/pages/VibeAuditPage.js.map +1 -1
  34. package/dist/pages/VibeCalendarPage.js +132 -107
  35. package/dist/pages/VibeCalendarPage.js.map +1 -1
  36. package/dist/pages/VibeDeckPage.js +416 -379
  37. package/dist/pages/VibeDeckPage.js.map +1 -1
  38. package/dist/pages/VibeDetailsPage.js +621 -557
  39. package/dist/pages/VibeDetailsPage.js.map +1 -1
  40. package/dist/pages/tunnels/TunnelsTab.js +115 -90
  41. package/dist/pages/tunnels/TunnelsTab.js.map +1 -1
  42. package/package.json +2 -2
@@ -14,14 +14,15 @@ import { SandboxAnalyticsSection as p } from "../components/analytics/SandboxAna
14
14
  import "../components/analytics/index.js";
15
15
  import { Suspense as m, lazy as h, useCallback as g, useMemo as _, useState as v } from "react";
16
16
  import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
- import { usePermissions as b } from "@burdenoff/fe-libs/shared/providers/shell";
18
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
19
- import { MotionPage as C } from "@burdenoff/fe-libs/shared/motion";
17
+ import { Download as b, Printer as x } from "lucide-react";
18
+ import { usePermissions as S } from "@burdenoff/fe-libs/shared/providers/shell";
19
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
+ import { MotionPage as T } from "@burdenoff/fe-libs/shared/motion";
20
21
  //#region src/pages/AnalyticsPage.tsx
21
- var w = h(() => import("../components/analytics/AnalyticsTimeSeriesChart.js").then((e) => ({ default: e.AnalyticsTimeSeriesChart }))), T = h(() => import("../components/analytics/AnalyticsBreakdownChart.js").then((e) => ({ default: e.AnalyticsBreakdownChart }))), E = () => /* @__PURE__ */ x("div", {
22
+ var E = h(() => import("../components/analytics/AnalyticsTimeSeriesChart.js").then((e) => ({ default: e.AnalyticsTimeSeriesChart }))), D = h(() => import("../components/analytics/AnalyticsBreakdownChart.js").then((e) => ({ default: e.AnalyticsBreakdownChart }))), O = () => /* @__PURE__ */ C("div", {
22
23
  className: "bg-bg-surface border border-border-default rounded-lg p-4",
23
- children: /* @__PURE__ */ x(a, { height: "h-40" })
24
- }), D = [
24
+ children: /* @__PURE__ */ C(a, { height: "h-40" })
25
+ }), k = [
25
26
  "overview",
26
27
  "agents",
27
28
  "sessions",
@@ -32,438 +33,463 @@ var w = h(() => import("../components/analytics/AnalyticsTimeSeriesChart.js").th
32
33
  "aievents",
33
34
  "audit",
34
35
  "docs"
35
- ], O = {
36
+ ], A = {
36
37
  primary: "var(--color-text-link)",
37
38
  success: "var(--color-status-success-text)",
38
39
  accent: "var(--color-accent-purple)",
39
40
  warning: "var(--color-status-warning-text)"
40
41
  };
41
- function k() {
42
- let { workspaceId: a } = t(), { t: h } = y(), k = n(), { hasPermission: M, isLoading: N } = b(), [P, F] = v("LAST_7D"), [I, L] = v("DAY"), [R, z] = o(D, "overview"), B = g((e, t) => {
42
+ function j() {
43
+ let { workspaceId: a } = t(), { t: h } = y(), j = n(), { hasPermission: I, isLoading: L } = S(), [R, z] = v("LAST_7D"), [B, V] = v("DAY"), [H, U] = o(k, "overview"), W = g((e, t) => {
43
44
  let n = h(e);
44
45
  return n === e ? t : n;
45
- }, [h]), { startDate: V, endDate: H } = _(() => c(P), [P]), U = _(() => s(R), [R]), { data: W, loading: G, error: K, refetch: q } = e({
46
+ }, [h]), { startDate: G, endDate: K } = _(() => c(R), [R]), q = _(() => s(H), [H]), { data: J, loading: Y, error: X, refetch: Z } = e({
46
47
  variables: { input: {
47
- startDate: V.toISOString(),
48
- endDate: H.toISOString(),
49
- granularity: I,
50
- entityTypes: U.entityTypes
48
+ startDate: G.toISOString(),
49
+ endDate: K.toISOString(),
50
+ granularity: B,
51
+ entityTypes: q.entityTypes
51
52
  } },
52
53
  fetchPolicy: "cache-first",
53
54
  nextFetchPolicy: "cache-first",
54
55
  notifyOnNetworkStatusChange: !0,
55
56
  skip: !a
56
- }), J = W?.vibecontrolsAnalytics, Y = g(() => {
57
- q();
58
- }, [q]), X = g((e) => {
59
- k(e);
60
- }, [k]);
61
- return N ? /* @__PURE__ */ x("div", {
57
+ }), Q = J?.vibecontrolsAnalytics, $ = g(() => {
58
+ Z();
59
+ }, [Z]), ee = g(() => {
60
+ typeof window < "u" && window.print();
61
+ }, []), te = g(() => {
62
+ if (!Q) return;
63
+ let e = F(H, Q);
64
+ if (e.length === 0) return;
65
+ let t = P(e), n = new Blob([t], { type: "text/csv;charset=utf-8;" }), r = URL.createObjectURL(n), i = document.createElement("a");
66
+ i.href = r, i.download = `vibecontrols-analytics-${H}-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
67
+ }, [Q, H]), ne = g((e) => {
68
+ j(e);
69
+ }, [j]);
70
+ return L ? /* @__PURE__ */ C("div", {
62
71
  className: "flex items-center justify-center min-h-[400px]",
63
- children: /* @__PURE__ */ x("p", {
72
+ children: /* @__PURE__ */ C("p", {
64
73
  className: "text-text-secondary",
65
74
  children: "Loading permissions…"
66
75
  })
67
- }) : M(i.ANALYTICS_READ) ? a ? K && !J ? /* @__PURE__ */ S(C, {
76
+ }) : I(i.ANALYTICS_READ) ? a ? X && !Q ? /* @__PURE__ */ w(T, {
68
77
  className: "min-h-screen space-y-6 bg-bg-surface p-4 sm:p-6",
69
- children: [/* @__PURE__ */ x(r, { title: B("nav.analytics", "Analytics") }), /* @__PURE__ */ S("div", {
78
+ children: [/* @__PURE__ */ C(r, { title: W("nav.analytics", "Analytics") }), /* @__PURE__ */ w("div", {
70
79
  className: "space-y-3 rounded-lg border border-status-error-border bg-status-error-bg/10 p-4 text-sm text-status-error-text",
71
- children: [/* @__PURE__ */ S("p", { children: ["Failed to load analytics: ", K.message] }), /* @__PURE__ */ x("button", {
80
+ children: [/* @__PURE__ */ w("p", { children: ["Failed to load analytics: ", X.message] }), /* @__PURE__ */ C("button", {
72
81
  type: "button",
73
- onClick: Y,
82
+ onClick: $,
74
83
  className: "rounded-md bg-status-error-bg/20 px-3 py-1.5 text-xs font-medium transition-colors hover:bg-status-error-bg/30",
75
84
  children: "Retry"
76
85
  })]
77
86
  })]
78
- }) : /* @__PURE__ */ S(C, {
79
- className: "min-h-screen space-y-4 bg-bg-surface p-4 sm:p-6",
87
+ }) : /* @__PURE__ */ w(T, {
88
+ className: "min-h-screen space-y-4 bg-bg-surface p-4 sm:p-6 vc-printable",
80
89
  children: [
81
- /* @__PURE__ */ x(r, { title: B("nav.analytics", "Analytics") }),
82
- /* @__PURE__ */ x(l, {
83
- timeRange: P,
84
- granularity: I,
85
- onTimeRangeChange: F,
86
- onGranularityChange: L,
87
- onRefresh: Y,
88
- loading: G,
89
- executionTimeMs: J?.executionTimeMs,
90
- cached: J?.cached
90
+ /* @__PURE__ */ C(r, { title: W("nav.analytics", "Analytics") }),
91
+ /* @__PURE__ */ C(l, {
92
+ timeRange: R,
93
+ granularity: B,
94
+ onTimeRangeChange: z,
95
+ onGranularityChange: V,
96
+ onRefresh: $,
97
+ loading: Y,
98
+ executionTimeMs: Q?.executionTimeMs,
99
+ cached: Q?.cached
91
100
  }),
92
- /* @__PURE__ */ x(f, {
93
- activeTab: R,
94
- onTabChange: z
101
+ /* @__PURE__ */ C(f, {
102
+ activeTab: H,
103
+ onTabChange: U
95
104
  }),
96
- /* @__PURE__ */ x(m, {
97
- fallback: /* @__PURE__ */ x(E, {}),
98
- children: /* @__PURE__ */ S("section", {
99
- id: `analytics-panel-${R}`,
105
+ /* @__PURE__ */ w("div", {
106
+ className: "flex flex-wrap items-center justify-end gap-2 vc-print-hide",
107
+ children: [/* @__PURE__ */ w("button", {
108
+ type: "button",
109
+ onClick: te,
110
+ disabled: Y || !Q,
111
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-default px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
112
+ title: W("analytics.exportCsvTitle", "Export current tab as CSV"),
113
+ children: [/* @__PURE__ */ C(b, { size: 14 }), W("analytics.exportCsv", "Export CSV")]
114
+ }), /* @__PURE__ */ w("button", {
115
+ type: "button",
116
+ onClick: ee,
117
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-default px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
118
+ title: W("analytics.printTitle", "Print this report"),
119
+ children: [/* @__PURE__ */ C(x, { size: 14 }), W("analytics.print", "Print")]
120
+ })]
121
+ }),
122
+ /* @__PURE__ */ C(m, {
123
+ fallback: /* @__PURE__ */ C(O, {}),
124
+ children: /* @__PURE__ */ w("section", {
125
+ id: `analytics-panel-${H}`,
100
126
  role: "tabpanel",
101
- "aria-labelledby": `analytics-tab-${R}`,
127
+ "aria-labelledby": `analytics-tab-${H}`,
102
128
  className: "space-y-4",
103
129
  children: [
104
- R === "overview" ? /* @__PURE__ */ S("div", {
130
+ H === "overview" ? /* @__PURE__ */ w("div", {
105
131
  className: "space-y-4",
106
132
  children: [
107
- /* @__PURE__ */ x(u, {
108
- data: J,
109
- loading: G,
110
- onCardClick: X
133
+ /* @__PURE__ */ C(u, {
134
+ data: Q,
135
+ loading: Y,
136
+ onCardClick: ne
111
137
  }),
112
- /* @__PURE__ */ x(w, {
138
+ /* @__PURE__ */ C(E, {
113
139
  title: "Activity Over Time",
114
140
  datasets: [
115
141
  {
116
142
  label: "Sessions",
117
- data: J?.sessions?.createdOverTime,
118
- color: O.primary
143
+ data: Q?.sessions?.createdOverTime,
144
+ color: A.primary
119
145
  },
120
146
  {
121
147
  label: "Executions",
122
- data: J?.actions?.executionsOverTime,
123
- color: O.success
148
+ data: Q?.actions?.executionsOverTime,
149
+ color: A.success
124
150
  },
125
151
  {
126
152
  label: "AI Events",
127
- data: J?.aiEvents?.eventsOverTime,
128
- color: O.accent
153
+ data: Q?.aiEvents?.eventsOverTime,
154
+ color: A.accent
129
155
  },
130
156
  {
131
157
  label: "Audit Logs",
132
- data: J?.audit?.eventsOverTime,
133
- color: O.warning
158
+ data: Q?.audit?.eventsOverTime,
159
+ color: A.warning
134
160
  }
135
161
  ]
136
162
  }),
137
- /* @__PURE__ */ S("div", {
163
+ /* @__PURE__ */ w("div", {
138
164
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
139
- children: [/* @__PURE__ */ x(T, {
165
+ children: [/* @__PURE__ */ C(D, {
140
166
  title: "Sessions by Status",
141
- data: J?.sessions?.byStatus
142
- }), /* @__PURE__ */ x(T, {
167
+ data: Q?.sessions?.byStatus
168
+ }), /* @__PURE__ */ C(D, {
143
169
  title: "Vibes by Status",
144
- data: J?.vibes?.byStatus
170
+ data: Q?.vibes?.byStatus
145
171
  })]
146
172
  })
147
173
  ]
148
174
  }) : null,
149
- R === "agents" && J?.agents ? /* @__PURE__ */ S("div", {
175
+ H === "agents" && Q?.agents ? /* @__PURE__ */ w("div", {
150
176
  className: "space-y-4",
151
177
  children: [
152
- /* @__PURE__ */ S("div", {
178
+ /* @__PURE__ */ w("div", {
153
179
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
154
180
  children: [
155
- /* @__PURE__ */ x(A, {
181
+ /* @__PURE__ */ C(M, {
156
182
  label: "Total",
157
- value: J.agents.total
183
+ value: Q.agents.total
158
184
  }),
159
- /* @__PURE__ */ x(A, {
185
+ /* @__PURE__ */ C(M, {
160
186
  label: "Active",
161
- value: J.agents.active,
187
+ value: Q.agents.active,
162
188
  variant: "success"
163
189
  }),
164
- /* @__PURE__ */ x(A, {
190
+ /* @__PURE__ */ C(M, {
165
191
  label: "Inactive",
166
- value: J.agents.inactive,
192
+ value: Q.agents.inactive,
167
193
  variant: "warning"
168
194
  }),
169
- /* @__PURE__ */ x(A, {
195
+ /* @__PURE__ */ C(M, {
170
196
  label: "Stale Heartbeat",
171
- value: J.agents.staleHeartbeatCount,
197
+ value: Q.agents.staleHeartbeatCount,
172
198
  variant: "error"
173
199
  })
174
200
  ]
175
201
  }),
176
- /* @__PURE__ */ x(w, {
202
+ /* @__PURE__ */ C(E, {
177
203
  title: "Agents Created Over Time",
178
204
  datasets: [{
179
205
  label: "Agents",
180
- data: J.agents.createdOverTime,
181
- color: O.primary
206
+ data: Q.agents.createdOverTime,
207
+ color: A.primary
182
208
  }],
183
209
  height: 250
184
210
  }),
185
- /* @__PURE__ */ S("div", {
211
+ /* @__PURE__ */ w("div", {
186
212
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
187
- children: [/* @__PURE__ */ x(d, {
213
+ children: [/* @__PURE__ */ C(d, {
188
214
  title: "By Platform",
189
- data: J.agents.byPlatform,
215
+ data: Q.agents.byPlatform,
190
216
  keyLabel: "Platform"
191
- }), /* @__PURE__ */ x(d, {
217
+ }), /* @__PURE__ */ C(d, {
192
218
  title: "By Architecture",
193
- data: J.agents.byArchitecture,
219
+ data: Q.agents.byArchitecture,
194
220
  keyLabel: "Architecture"
195
221
  })]
196
222
  })
197
223
  ]
198
224
  }) : null,
199
- R === "sessions" && J?.sessions ? /* @__PURE__ */ S("div", {
225
+ H === "sessions" && Q?.sessions ? /* @__PURE__ */ w("div", {
200
226
  className: "space-y-4",
201
227
  children: [
202
- /* @__PURE__ */ S("div", {
228
+ /* @__PURE__ */ w("div", {
203
229
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
204
230
  children: [
205
- /* @__PURE__ */ x(A, {
231
+ /* @__PURE__ */ C(M, {
206
232
  label: "Total",
207
- value: J.sessions.total
233
+ value: Q.sessions.total
208
234
  }),
209
- /* @__PURE__ */ x(A, {
235
+ /* @__PURE__ */ C(M, {
210
236
  label: "Running",
211
- value: J.sessions.active,
237
+ value: Q.sessions.active,
212
238
  variant: "success"
213
239
  }),
214
- /* @__PURE__ */ x(A, {
240
+ /* @__PURE__ */ C(M, {
215
241
  label: "Collaborators",
216
- value: J.sessions.totalCollaborators
242
+ value: Q.sessions.totalCollaborators
217
243
  }),
218
- /* @__PURE__ */ x(A, {
244
+ /* @__PURE__ */ C(M, {
219
245
  label: "Shares",
220
- value: J.sessions.totalShares + J.sessions.totalShareLinks
246
+ value: Q.sessions.totalShares + Q.sessions.totalShareLinks
221
247
  })
222
248
  ]
223
249
  }),
224
- J.sessions.avgDurationMs == null ? null : /* @__PURE__ */ S("div", {
250
+ Q.sessions.avgDurationMs == null ? null : /* @__PURE__ */ w("div", {
225
251
  className: "text-sm text-text-secondary",
226
252
  children: [
227
253
  "Average duration:",
228
254
  " ",
229
- /* @__PURE__ */ x("span", {
255
+ /* @__PURE__ */ C("span", {
230
256
  className: "font-medium text-text-primary",
231
- children: j(J.sessions.avgDurationMs)
257
+ children: N(Q.sessions.avgDurationMs)
232
258
  })
233
259
  ]
234
260
  }),
235
- /* @__PURE__ */ x(w, {
261
+ /* @__PURE__ */ C(E, {
236
262
  title: "Sessions Created Over Time",
237
263
  datasets: [{
238
264
  label: "Sessions",
239
- data: J.sessions.createdOverTime,
240
- color: O.primary
265
+ data: Q.sessions.createdOverTime,
266
+ color: A.primary
241
267
  }],
242
268
  height: 250
243
269
  }),
244
- /* @__PURE__ */ S("div", {
270
+ /* @__PURE__ */ w("div", {
245
271
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
246
- children: [/* @__PURE__ */ x(T, {
272
+ children: [/* @__PURE__ */ C(D, {
247
273
  title: "Sessions by Type",
248
- data: J.sessions.byType
249
- }), /* @__PURE__ */ x(d, {
274
+ data: Q.sessions.byType
275
+ }), /* @__PURE__ */ C(d, {
250
276
  title: "Sessions by Status",
251
- data: J.sessions.byStatus,
277
+ data: Q.sessions.byStatus,
252
278
  keyLabel: "Status"
253
279
  })]
254
280
  })
255
281
  ]
256
282
  }) : null,
257
- R === "sandbox" ? /* @__PURE__ */ x(p, {}) : null,
258
- R === "vibes" && J?.vibes ? /* @__PURE__ */ S("div", {
283
+ H === "sandbox" ? /* @__PURE__ */ C(p, {}) : null,
284
+ H === "vibes" && Q?.vibes ? /* @__PURE__ */ w("div", {
259
285
  className: "space-y-4",
260
286
  children: [
261
- /* @__PURE__ */ S("div", {
287
+ /* @__PURE__ */ w("div", {
262
288
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
263
289
  children: [
264
- /* @__PURE__ */ x(A, {
290
+ /* @__PURE__ */ C(M, {
265
291
  label: "Total",
266
- value: J.vibes.total
292
+ value: Q.vibes.total
267
293
  }),
268
- /* @__PURE__ */ x(A, {
294
+ /* @__PURE__ */ C(M, {
269
295
  label: "With Agent",
270
- value: J.vibes.withAgent,
296
+ value: Q.vibes.withAgent,
271
297
  variant: "success"
272
298
  }),
273
- /* @__PURE__ */ x(A, {
299
+ /* @__PURE__ */ C(M, {
274
300
  label: "Without Agent",
275
- value: J.vibes.withoutAgent
301
+ value: Q.vibes.withoutAgent
276
302
  })
277
303
  ]
278
304
  }),
279
- /* @__PURE__ */ x(w, {
305
+ /* @__PURE__ */ C(E, {
280
306
  title: "Vibes Created Over Time",
281
307
  datasets: [{
282
308
  label: "Vibes",
283
- data: J.vibes.createdOverTime,
284
- color: O.accent
309
+ data: Q.vibes.createdOverTime,
310
+ color: A.accent
285
311
  }],
286
312
  height: 250
287
313
  }),
288
- /* @__PURE__ */ S("div", {
314
+ /* @__PURE__ */ w("div", {
289
315
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
290
- children: [/* @__PURE__ */ x(T, {
316
+ children: [/* @__PURE__ */ C(D, {
291
317
  title: "Vibes by Type",
292
- data: J.vibes.byType
293
- }), /* @__PURE__ */ x(T, {
318
+ data: Q.vibes.byType
319
+ }), /* @__PURE__ */ C(D, {
294
320
  title: "Vibes by Status",
295
- data: J.vibes.byStatus
321
+ data: Q.vibes.byStatus
296
322
  })]
297
323
  })
298
324
  ]
299
325
  }) : null,
300
- R === "actions" && J?.actions ? /* @__PURE__ */ S("div", {
326
+ H === "actions" && Q?.actions ? /* @__PURE__ */ w("div", {
301
327
  className: "space-y-4",
302
328
  children: [
303
- /* @__PURE__ */ S("div", {
329
+ /* @__PURE__ */ w("div", {
304
330
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
305
331
  children: [
306
- /* @__PURE__ */ x(A, {
332
+ /* @__PURE__ */ C(M, {
307
333
  label: "Total Actions",
308
- value: J.actions.total
334
+ value: Q.actions.total
309
335
  }),
310
- /* @__PURE__ */ x(A, {
336
+ /* @__PURE__ */ C(M, {
311
337
  label: "Executions",
312
- value: J.actions.totalExecutions
338
+ value: Q.actions.totalExecutions
313
339
  }),
314
- /* @__PURE__ */ x(A, {
340
+ /* @__PURE__ */ C(M, {
315
341
  label: "Success Rate",
316
- value: J.actions.successRate == null ? "N/A" : `${J.actions.successRate.toFixed(1)}%`,
317
- variant: J.actions.successRate != null && J.actions.successRate >= 90 ? "success" : "warning"
342
+ value: Q.actions.successRate == null ? "N/A" : `${Q.actions.successRate.toFixed(1)}%`,
343
+ variant: Q.actions.successRate != null && Q.actions.successRate >= 90 ? "success" : "warning"
318
344
  }),
319
- /* @__PURE__ */ x(A, {
345
+ /* @__PURE__ */ C(M, {
320
346
  label: "Avg Duration",
321
- value: J.actions.avgDurationMs == null ? "N/A" : j(J.actions.avgDurationMs)
347
+ value: Q.actions.avgDurationMs == null ? "N/A" : N(Q.actions.avgDurationMs)
322
348
  })
323
349
  ]
324
350
  }),
325
- /* @__PURE__ */ x(w, {
351
+ /* @__PURE__ */ C(E, {
326
352
  title: "Executions Over Time",
327
353
  datasets: [{
328
354
  label: "Executions",
329
- data: J.actions.executionsOverTime,
330
- color: O.success
355
+ data: Q.actions.executionsOverTime,
356
+ color: A.success
331
357
  }],
332
358
  height: 250
333
359
  }),
334
- /* @__PURE__ */ S("div", {
360
+ /* @__PURE__ */ w("div", {
335
361
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
336
- children: [/* @__PURE__ */ x(T, {
362
+ children: [/* @__PURE__ */ C(D, {
337
363
  title: "By Action Type",
338
- data: J.actions.byActionType
339
- }), /* @__PURE__ */ x(T, {
364
+ data: Q.actions.byActionType
365
+ }), /* @__PURE__ */ C(D, {
340
366
  title: "Execution Status",
341
- data: J.actions.executionsByStatus
367
+ data: Q.actions.executionsByStatus
342
368
  })]
343
369
  }),
344
- /* @__PURE__ */ S("div", {
370
+ /* @__PURE__ */ w("div", {
345
371
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
346
- children: [/* @__PURE__ */ x(d, {
372
+ children: [/* @__PURE__ */ C(d, {
347
373
  title: "By Trigger Type",
348
- data: J.actions.byTriggerType,
374
+ data: Q.actions.byTriggerType,
349
375
  keyLabel: "Trigger"
350
- }), /* @__PURE__ */ x(d, {
376
+ }), /* @__PURE__ */ C(d, {
351
377
  title: "By Source Type",
352
- data: J.actions.bySourceType,
378
+ data: Q.actions.bySourceType,
353
379
  keyLabel: "Source"
354
380
  })]
355
381
  })
356
382
  ]
357
383
  }) : null,
358
- R === "vibedecks" && J?.vibeDecks ? /* @__PURE__ */ S("div", {
384
+ H === "vibedecks" && Q?.vibeDecks ? /* @__PURE__ */ w("div", {
359
385
  className: "space-y-4",
360
- children: [/* @__PURE__ */ S("div", {
386
+ children: [/* @__PURE__ */ w("div", {
361
387
  className: "grid grid-cols-2 gap-3 sm:grid-cols-3",
362
- children: [/* @__PURE__ */ x(A, {
388
+ children: [/* @__PURE__ */ C(M, {
363
389
  label: "Decks",
364
- value: J.vibeDecks.totalDecks
365
- }), /* @__PURE__ */ x(A, {
390
+ value: Q.vibeDecks.totalDecks
391
+ }), /* @__PURE__ */ C(M, {
366
392
  label: "Buttons",
367
- value: J.vibeDecks.totalButtons
393
+ value: Q.vibeDecks.totalButtons
368
394
  })]
369
- }), /* @__PURE__ */ x(T, {
395
+ }), /* @__PURE__ */ C(D, {
370
396
  title: "Buttons by Action Type",
371
- data: J.vibeDecks.buttonsByActionType
397
+ data: Q.vibeDecks.buttonsByActionType
372
398
  })]
373
399
  }) : null,
374
- R === "aievents" && J?.aiEvents ? /* @__PURE__ */ S("div", {
400
+ H === "aievents" && Q?.aiEvents ? /* @__PURE__ */ w("div", {
375
401
  className: "space-y-4",
376
402
  children: [
377
- /* @__PURE__ */ x(A, {
403
+ /* @__PURE__ */ C(M, {
378
404
  label: "Total AI Events",
379
- value: J.aiEvents.total
405
+ value: Q.aiEvents.total
380
406
  }),
381
- /* @__PURE__ */ x(w, {
407
+ /* @__PURE__ */ C(E, {
382
408
  title: "AI Events Over Time",
383
409
  datasets: [{
384
410
  label: "Events",
385
- data: J.aiEvents.eventsOverTime,
386
- color: O.accent
411
+ data: Q.aiEvents.eventsOverTime,
412
+ color: A.accent
387
413
  }],
388
414
  height: 250
389
415
  }),
390
- /* @__PURE__ */ S("div", {
416
+ /* @__PURE__ */ w("div", {
391
417
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
392
- children: [/* @__PURE__ */ x(T, {
418
+ children: [/* @__PURE__ */ C(D, {
393
419
  title: "By Source",
394
- data: J.aiEvents.bySource
395
- }), /* @__PURE__ */ x(d, {
420
+ data: Q.aiEvents.bySource
421
+ }), /* @__PURE__ */ C(d, {
396
422
  title: "By Event Type",
397
- data: J.aiEvents.byEventType,
423
+ data: Q.aiEvents.byEventType,
398
424
  keyLabel: "Event Type"
399
425
  })]
400
426
  })
401
427
  ]
402
428
  }) : null,
403
- R === "audit" && J?.audit ? /* @__PURE__ */ S("div", {
429
+ H === "audit" && Q?.audit ? /* @__PURE__ */ w("div", {
404
430
  className: "space-y-4",
405
431
  children: [
406
- /* @__PURE__ */ x(A, {
432
+ /* @__PURE__ */ C(M, {
407
433
  label: "Total Audit Logs",
408
- value: J.audit.total
434
+ value: Q.audit.total
409
435
  }),
410
- /* @__PURE__ */ x(w, {
436
+ /* @__PURE__ */ C(E, {
411
437
  title: "Audit Events Over Time",
412
438
  datasets: [{
413
439
  label: "Events",
414
- data: J.audit.eventsOverTime,
415
- color: O.warning
440
+ data: Q.audit.eventsOverTime,
441
+ color: A.warning
416
442
  }],
417
443
  height: 250
418
444
  }),
419
- /* @__PURE__ */ S("div", {
445
+ /* @__PURE__ */ w("div", {
420
446
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
421
- children: [/* @__PURE__ */ x(T, {
447
+ children: [/* @__PURE__ */ C(D, {
422
448
  title: "By Action",
423
- data: J.audit.byAction
424
- }), /* @__PURE__ */ x(T, {
449
+ data: Q.audit.byAction
450
+ }), /* @__PURE__ */ C(D, {
425
451
  title: "By Status",
426
- data: J.audit.byStatus
452
+ data: Q.audit.byStatus
427
453
  })]
428
454
  }),
429
- /* @__PURE__ */ x(d, {
455
+ /* @__PURE__ */ C(d, {
430
456
  title: "By Resource Type",
431
- data: J.audit.byResourceType,
457
+ data: Q.audit.byResourceType,
432
458
  keyLabel: "Resource"
433
459
  })
434
460
  ]
435
461
  }) : null,
436
- R === "docs" && J?.docs ? /* @__PURE__ */ S("div", {
462
+ H === "docs" && Q?.docs ? /* @__PURE__ */ w("div", {
437
463
  className: "space-y-4",
438
- children: [/* @__PURE__ */ S("div", {
464
+ children: [/* @__PURE__ */ w("div", {
439
465
  className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
440
466
  children: [
441
- /* @__PURE__ */ x(A, {
467
+ /* @__PURE__ */ C(M, {
442
468
  label: "Sites",
443
- value: J.docs.totalSites
469
+ value: Q.docs.totalSites
444
470
  }),
445
- /* @__PURE__ */ x(A, {
471
+ /* @__PURE__ */ C(M, {
446
472
  label: "Pages",
447
- value: J.docs.totalPages
473
+ value: Q.docs.totalPages
448
474
  }),
449
- /* @__PURE__ */ x(A, {
475
+ /* @__PURE__ */ C(M, {
450
476
  label: "Revisions",
451
- value: J.docs.totalRevisions
477
+ value: Q.docs.totalRevisions
452
478
  }),
453
- /* @__PURE__ */ x(A, {
479
+ /* @__PURE__ */ C(M, {
454
480
  label: "Build Success",
455
- value: J.docs.buildSuccessRate == null ? "N/A" : `${J.docs.buildSuccessRate.toFixed(1)}%`,
456
- variant: J.docs.buildSuccessRate != null && J.docs.buildSuccessRate >= 90 ? "success" : "warning"
481
+ value: Q.docs.buildSuccessRate == null ? "N/A" : `${Q.docs.buildSuccessRate.toFixed(1)}%`,
482
+ variant: Q.docs.buildSuccessRate != null && Q.docs.buildSuccessRate >= 90 ? "success" : "warning"
457
483
  })
458
484
  ]
459
- }), /* @__PURE__ */ S("div", {
485
+ }), /* @__PURE__ */ w("div", {
460
486
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
461
- children: [/* @__PURE__ */ x(T, {
487
+ children: [/* @__PURE__ */ C(D, {
462
488
  title: "Pages by Status",
463
- data: J.docs.pagesByStatus
464
- }), /* @__PURE__ */ x(T, {
489
+ data: Q.docs.pagesByStatus
490
+ }), /* @__PURE__ */ C(D, {
465
491
  title: "Revisions by Status",
466
- data: J.docs.revisionsByStatus
492
+ data: Q.docs.revisionsByStatus
467
493
  })]
468
494
  })]
469
495
  }) : null
@@ -471,42 +497,67 @@ function k() {
471
497
  })
472
498
  })
473
499
  ]
474
- }) : /* @__PURE__ */ S(C, {
500
+ }) : /* @__PURE__ */ w(T, {
475
501
  className: "min-h-screen space-y-6 bg-bg-surface p-4 sm:p-6",
476
- children: [/* @__PURE__ */ x(r, { title: B("nav.analytics", "Analytics") }), /* @__PURE__ */ x("div", {
502
+ children: [/* @__PURE__ */ C(r, { title: W("nav.analytics", "Analytics") }), /* @__PURE__ */ C("div", {
477
503
  className: "text-sm text-text-secondary",
478
504
  children: "Waiting for workspace context…"
479
505
  })]
480
- }) : /* @__PURE__ */ x("div", {
506
+ }) : /* @__PURE__ */ C("div", {
481
507
  className: "flex items-center justify-center min-h-[400px]",
482
- children: /* @__PURE__ */ S("div", {
508
+ children: /* @__PURE__ */ w("div", {
483
509
  className: "text-center space-y-2",
484
- children: [/* @__PURE__ */ x("h2", {
510
+ children: [/* @__PURE__ */ C("h2", {
485
511
  className: "text-lg font-semibold text-foreground",
486
512
  children: "Access Denied"
487
- }), /* @__PURE__ */ x("p", {
513
+ }), /* @__PURE__ */ C("p", {
488
514
  className: "text-sm text-text-secondary",
489
515
  children: "You don't have permission to access this page."
490
516
  })]
491
517
  })
492
518
  });
493
519
  }
494
- function A({ label: e, value: t, variant: n }) {
495
- return /* @__PURE__ */ S("div", {
520
+ function M({ label: e, value: t, variant: n }) {
521
+ return /* @__PURE__ */ w("div", {
496
522
  className: `${n === "success" ? "bg-status-success-bg/10" : n === "warning" ? "bg-status-warning-bg/10" : n === "error" ? "bg-status-error-bg/10" : "bg-bg-surface"} rounded-lg border border-border-default p-3`,
497
- children: [/* @__PURE__ */ x("p", {
523
+ children: [/* @__PURE__ */ C("p", {
498
524
  className: "text-xs text-text-secondary",
499
525
  children: e
500
- }), /* @__PURE__ */ x("p", {
526
+ }), /* @__PURE__ */ C("p", {
501
527
  className: "mt-1 text-xl font-bold text-text-primary",
502
528
  children: typeof t == "number" ? t.toLocaleString() : t
503
529
  })]
504
530
  });
505
531
  }
506
- function j(e) {
532
+ function N(e) {
507
533
  return e < 1e3 ? `${Math.round(e)}ms` : e < 6e4 ? `${(e / 1e3).toFixed(1)}s` : `${Math.floor(e / 6e4)}m ${Math.round(e % 6e4 / 1e3)}s`;
508
534
  }
535
+ function P(e) {
536
+ return e.map((e) => e.map((e) => {
537
+ let t = e == null ? "" : String(e);
538
+ return /[",\n\r]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
539
+ }).join(",")).join("\r\n");
540
+ }
541
+ function F(e, t) {
542
+ let n = [];
543
+ if (e === "overview") return n.push(["metric", "value"]), t.sessions && n.push(["sessions.total", t.sessions.total ?? 0]), t.agents && n.push(["agents.total", t.agents.total ?? 0]), t.vibes && n.push(["vibes.total", t.vibes.total ?? 0]), t.actions && n.push(["actions.total", t.actions.total ?? 0]), n;
544
+ if (e === "agents" && t.agents) {
545
+ if (n.push(["metric", "value"]), n.push(["total", t.agents.total ?? 0]), n.push(["active", t.agents.active ?? 0]), n.push(["inactive", t.agents.inactive ?? 0]), n.push(["staleHeartbeat", t.agents.staleHeartbeatCount ?? 0]), Array.isArray(t.agents.byPlatform)) {
546
+ n.push([], ["platform", "count"]);
547
+ for (let e of t.agents.byPlatform) n.push([e.key ?? e.label ?? "", e.count ?? 0]);
548
+ }
549
+ return n;
550
+ }
551
+ if (e === "sessions" && t.sessions) {
552
+ if (n.push(["metric", "value"]), n.push(["total", t.sessions.total ?? 0]), n.push(["running", t.sessions.active ?? 0]), n.push(["avgDurationMs", t.sessions.avgDurationMs ?? ""]), Array.isArray(t.sessions.byType)) {
553
+ n.push([], ["type", "count"]);
554
+ for (let e of t.sessions.byType) n.push([e.key ?? e.label ?? "", e.count ?? 0]);
555
+ }
556
+ return n;
557
+ }
558
+ return e === "actions" && t.actions ? (n.push(["metric", "value"]), n.push(["total", t.actions.total ?? 0]), n.push(["totalExecutions", t.actions.totalExecutions ?? 0]), n.push(["successRate", t.actions.successRate ?? ""]), n.push(["avgDurationMs", t.actions.avgDurationMs ?? ""]), n) : e === "vibes" && t.vibes ? (n.push(["metric", "value"]), n.push(["total", t.vibes.total ?? 0]), n.push(["withAgent", t.vibes.withAgent ?? 0]), n.push(["withoutAgent", t.vibes.withoutAgent ?? 0]), n) : e === "vibedecks" && t.vibeDecks ? (n.push(["metric", "value"]), n.push(["decks", t.vibeDecks.totalDecks ?? 0]), n.push(["buttons", t.vibeDecks.totalButtons ?? 0]), n) : e === "aievents" && t.aiEvents ? (n.push(["metric", "value"]), n.push(["total", t.aiEvents.total ?? 0]), n) : e === "audit" && t.audit ? (n.push(["metric", "value"]), n.push(["total", t.audit.total ?? 0]), n) : e === "docs" && t.docs ? (n.push(["metric", "value"]), n.push(["sites", t.docs.totalSites ?? 0]), n.push(["pages", t.docs.totalPages ?? 0]), n.push(["revisions", t.docs.totalRevisions ?? 0]), n.push(["buildSuccessRate", t.docs.buildSuccessRate ?? ""]), n) : (n.push(["metric", "value"]), n.push(["note", `No CSV serialiser for ${e} tab yet`]), n);
559
+ }
509
560
  //#endregion
510
- export { k as AnalyticsPage };
561
+ export { j as AnalyticsPage };
511
562
 
512
563
  //# sourceMappingURL=AnalyticsPage.js.map