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