@omg-dev/app 0.1.402 → 0.1.404

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.
@@ -1,7 +1,7 @@
1
- import { jsxs as o, jsx as s, Fragment as me } from "react/jsx-runtime";
2
- import { useState as h, useEffect as w, useRef as he, useContext as Me, useMemo as Te } from "react";
3
- import { y as ye, N as fe, O as ze, Q as j, U as ge, V as Se, W as je, Y as Pe, B as Fe, L as pe, u as J, x as Ye, R as Be, T as Ge, Z as Ke, j as be, f as Ue, _ as He, a as D, $ as k, a0 as L, k as R, a1 as W, a2 as Ve, a3 as qe, a4 as Qe, a5 as Xe, P as Je, a6 as We } from "./embedded-BDqwXtD2.js";
4
- import { cn as _ } from "cnfast";
1
+ import { jsxs as l, jsx as r, Fragment as me } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as w, useRef as fe, useContext as $e, useMemo as Te } from "react";
3
+ import { y as ve, N as he, O as ze, Q as S, U as ge, V as Se, W as Pe, Y as je, B as Fe, L as pe, u as J, x as Ye, R as Ge, T as Be, Z as Ke, j as be, f as Ue, _ as He, a as L, $ as k, a0 as R, k as _, a1 as W, a2 as Ve, a3 as qe, a4 as Qe, a5 as Xe, P as Je, a6 as We } from "./embedded-Ct4Idtzw.js";
4
+ import { cn as P } from "cnfast";
5
5
  /**
6
6
  * @license lucide-react v0.577.0 - ISC
7
7
  *
@@ -11,7 +11,7 @@ import { cn as _ } from "cnfast";
11
11
  const Ze = [
12
12
  ["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
13
13
  ["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
14
- ], Oe = ye("check-check", Ze);
14
+ ], Oe = ve("check-check", Ze);
15
15
  /**
16
16
  * @license lucide-react v0.577.0 - ISC
17
17
  *
@@ -29,99 +29,99 @@ const et = [
29
29
  ["path", { d: "M7 11h10", key: "1twpyw" }],
30
30
  ["path", { d: "M7 15h6", key: "d9of3u" }],
31
31
  ["path", { d: "M7 7h8", key: "af5zfr" }]
32
- ], tt = ye("message-square-text", et), O = "lfg-notification-read-state", rt = "lfg_notification_reads_v1:";
33
- function ve(r) {
34
- return `${rt}${(r == null ? void 0 : r.trim().toLowerCase()) || "__device__"}`;
32
+ ], tt = ve("message-square-text", et), O = "lfg-notification-read-state", rt = "lfg_notification_reads_v1:";
33
+ function ye(s) {
34
+ return `${rt}${(s == null ? void 0 : s.trim().toLowerCase()) || "__device__"}`;
35
35
  }
36
- function st(r) {
37
- if (!r || typeof r != "object") return null;
38
- const i = r, d = typeof i.through == "number" && Number.isFinite(i.through) ? Math.max(0, i.through) : 0, l = Array.isArray(i.ids) ? i.ids.filter((m) => typeof m == "string").slice(-500) : [];
39
- return { through: d, ids: [...new Set(l)] };
36
+ function st(s) {
37
+ if (!s || typeof s != "object") return null;
38
+ const i = s, c = typeof i.through == "number" && Number.isFinite(i.through) ? Math.max(0, i.through) : 0, o = Array.isArray(i.ids) ? i.ids.filter((m) => typeof m == "string").slice(-500) : [];
39
+ return { through: c, ids: [...new Set(o)] };
40
40
  }
41
- function M(r) {
41
+ function M(s) {
42
42
  if (typeof window > "u") return null;
43
43
  try {
44
- return st(JSON.parse(localStorage.getItem(ve(r)) ?? "null"));
44
+ return st(JSON.parse(localStorage.getItem(ye(s)) ?? "null"));
45
45
  } catch {
46
46
  return null;
47
47
  }
48
48
  }
49
- function Ne(r, i) {
50
- return typeof window > "u" || (localStorage.setItem(ve(r), JSON.stringify(i)), window.dispatchEvent(
49
+ function Ne(s, i) {
50
+ return typeof window > "u" || (localStorage.setItem(ye(s), JSON.stringify(i)), window.dispatchEvent(
51
51
  new CustomEvent(O, {
52
- detail: { identity: (r == null ? void 0 : r.trim().toLowerCase()) || "__device__" }
52
+ detail: { identity: (s == null ? void 0 : s.trim().toLowerCase()) || "__device__" }
53
53
  })
54
54
  )), i;
55
55
  }
56
- function P(r) {
57
- return `shipped:${r.id}:${r.rev}`;
56
+ function j(s) {
57
+ return `shipped:${s.id}:${s.rev}`;
58
58
  }
59
- function Z(r, i) {
60
- return r ? i.ts > r.through && !r.ids.includes(i.id) : !1;
59
+ function Z(s, i) {
60
+ return s ? i.ts > s.through && !s.ids.includes(i.id) : !1;
61
61
  }
62
- function nt(r, i) {
63
- const d = M(r) ?? { through: 0, ids: [] };
64
- return d.ids.includes(i) ? d : Ne(r, {
65
- ...d,
66
- ids: [...d.ids, i].slice(-500)
62
+ function nt(s, i) {
63
+ const c = M(s) ?? { through: 0, ids: [] };
64
+ return c.ids.includes(i) ? c : Ne(s, {
65
+ ...c,
66
+ ids: [...c.ids, i].slice(-500)
67
67
  });
68
68
  }
69
- function xe(r, i) {
70
- const d = M(r) ?? { through: 0, ids: [] };
71
- return Ne(r, {
72
- through: Math.max(d.through, i),
73
- ids: d.ids
69
+ function xe(s, i) {
70
+ const c = M(s) ?? { through: 0, ids: [] };
71
+ return Ne(s, {
72
+ through: Math.max(c.through, i),
73
+ ids: c.ids
74
74
  });
75
75
  }
76
76
  function at({
77
- path: r,
77
+ path: s,
78
78
  cacheKey: i,
79
- children: d
79
+ children: c
80
80
  }) {
81
- return /* @__PURE__ */ o("div", { className: "relative h-32 w-full overflow-hidden bg-background", children: [
82
- /* @__PURE__ */ s(qe, { path: r, cacheKey: i, className: "h-full w-full" }),
83
- d
81
+ return /* @__PURE__ */ l("div", { className: "relative h-32 w-full overflow-hidden bg-background", children: [
82
+ /* @__PURE__ */ r(qe, { path: s, cacheKey: i, className: "h-full w-full" }),
83
+ c
84
84
  ] });
85
85
  }
86
86
  function it({
87
- items: r,
87
+ items: s,
88
88
  total: i,
89
- onExpand: d
89
+ onExpand: c
90
90
  }) {
91
- const l = r[0];
92
- if (!l) return null;
91
+ const o = s[0];
92
+ if (!o) return null;
93
93
  const m = Math.max(0, i - 1);
94
- return /* @__PURE__ */ o(
94
+ return /* @__PURE__ */ l(
95
95
  "button",
96
96
  {
97
97
  type: "button",
98
- onClick: () => d == null ? void 0 : d({
99
- url: l.url,
100
- kind: l.kind,
101
- caption: l.caption,
102
- name: l.name,
103
- version: l.version,
104
- cacheKey: l.updatedAt
98
+ onClick: () => c == null ? void 0 : c({
99
+ url: o.url,
100
+ kind: o.kind,
101
+ caption: o.caption,
102
+ name: o.name,
103
+ version: o.version,
104
+ cacheKey: o.updatedAt
105
105
  }),
106
- "aria-label": `Open ${l.caption || l.name}`,
107
- title: l.caption || l.name,
106
+ "aria-label": `Open ${o.caption || o.name}`,
107
+ title: o.caption || o.name,
108
108
  className: "relative size-[52px] shrink-0 overflow-hidden rounded-lg border border-border/60 bg-muted transition-transform active:scale-[0.97]",
109
109
  children: [
110
- l.kind === "image" ? /* @__PURE__ */ s(
110
+ o.kind === "image" ? /* @__PURE__ */ r(
111
111
  Qe,
112
112
  {
113
- path: l.url,
114
- alt: l.caption || l.name,
113
+ path: o.url,
114
+ alt: o.caption || o.name,
115
115
  thumb: !0,
116
116
  className: "size-full object-cover"
117
117
  }
118
- ) : l.kind === "html" ? (
118
+ ) : o.kind === "html" ? (
119
119
  // Deliberately an icon, not a live preview. A document scaled into a
120
120
  // 52px box is two words of giant text — unreadable, and it costs a
121
121
  // fetch + parse per row. The Artifacts page is where previews belong.
122
- /* @__PURE__ */ s("span", { className: "flex size-full items-center justify-center bg-primary/10 text-primary", children: /* @__PURE__ */ s(Xe, { className: "size-4" }) })
123
- ) : /* @__PURE__ */ s("span", { className: "flex size-full items-center justify-center bg-black/80 text-white/80", children: /* @__PURE__ */ s(Je, { className: "size-4" }) }),
124
- m > 0 ? /* @__PURE__ */ o("span", { className: "absolute inset-x-0 bottom-0 bg-black/55 py-0.5 text-center text-[9px] font-semibold text-white", children: [
122
+ /* @__PURE__ */ r("span", { className: "flex size-full items-center justify-center bg-primary/10 text-primary", children: /* @__PURE__ */ r(Xe, { className: "size-4" }) })
123
+ ) : /* @__PURE__ */ r("span", { className: "flex size-full items-center justify-center bg-black/80 text-white/80", children: /* @__PURE__ */ r(Je, { className: "size-4" }) }),
124
+ m > 0 ? /* @__PURE__ */ l("span", { className: "absolute inset-x-0 bottom-0 bg-black/55 py-0.5 text-center text-[9px] font-semibold text-white", children: [
125
125
  "+",
126
126
  m
127
127
  ] }) : null
@@ -129,113 +129,94 @@ function it({
129
129
  }
130
130
  );
131
131
  }
132
- function lt(r, i) {
133
- const d = (p) => {
134
- const y = new Date(p);
135
- return new Date(y.getFullYear(), y.getMonth(), y.getDate()).getTime();
136
- }, l = Math.round((d(i) - d(r)) / 864e5);
137
- if (l <= 0) return "Today";
138
- if (l === 1) return "Yesterday";
139
- const m = new Date(r);
132
+ function lt(s, i) {
133
+ const c = (p) => {
134
+ const v = new Date(p);
135
+ return new Date(v.getFullYear(), v.getMonth(), v.getDate()).getTime();
136
+ }, o = Math.round((c(i) - c(s)) / 864e5);
137
+ if (o <= 0) return "Today";
138
+ if (o === 1) return "Yesterday";
139
+ const m = new Date(s);
140
140
  return m.toLocaleDateString(void 0, {
141
141
  month: "long",
142
142
  day: "numeric",
143
143
  ...m.getFullYear() === new Date(i).getFullYear() ? {} : { year: "numeric" }
144
144
  });
145
145
  }
146
- function ot({ code: r }) {
147
- if (!r || r.state === "landed") return null;
148
- const i = r.state === "uncommitted" ? `${r.dirty} uncommitted` : r.state === "unlanded" ? `${r.ahead} not on main` : r.state === "clean" ? "no code" : "no git", d = r.state === "uncommitted" ? "border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400" : r.state === "unlanded" ? "border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-400" : "border-border bg-muted/40 text-muted-foreground", l = [
149
- r.state === "uncommitted" ? "Shipped with uncommitted changes in the session worktree." : r.state === "unlanded" ? "Committed, but these commits have not reached origin/main." : r.state === "clean" ? "No code changes in this session's worktree." : "The session worktree was not a readable Git checkout.",
150
- r.branch ? `branch ${r.branch}` : null,
151
- r.head ? `head ${r.head}` : null
152
- ].filter(Boolean).join(" · ");
153
- return /* @__PURE__ */ s(
154
- "span",
155
- {
156
- title: l,
157
- className: _(
158
- "shrink-0 rounded-full border px-1.5 py-px text-[10px] font-medium leading-tight",
159
- d
160
- ),
161
- children: i
162
- }
163
- );
164
- }
165
- function ht({
166
- onOpenSession: r,
146
+ function mt({
147
+ onOpenSession: s,
167
148
  onOpenArtifactSession: i,
168
- onReviewSession: d,
169
- liveSessionIds: l,
149
+ onReviewSession: c,
150
+ liveSessionIds: o,
170
151
  notificationIdentity: m,
171
152
  artifactsOnly: p = !1,
172
- active: y = !0
153
+ active: v = !0
173
154
  }) {
174
- const f = p ? "artifacts" : "feed", b = p ? fe(L) : null, x = p ? null : fe(W), [u, F] = h(() => (x == null ? void 0 : x.items) ?? null), [Y, ee] = h(() => (x == null ? void 0 : x.total) ?? 0), [B, te] = h(!1), [A, I] = h(
155
+ const h = p ? "artifacts" : "feed", b = p ? he(R) : null, x = p ? null : he(W), [u, F] = f(() => (x == null ? void 0 : x.items) ?? null), [Y, ee] = f(() => (x == null ? void 0 : x.total) ?? 0), [G, te] = f(!1), [A, I] = f(
175
156
  () => p ? null : M(m)
176
- ), [G, re] = h(!1), [K, se] = h(null), { questions: v, busy: we, dismissAll: ke } = ze(), [U, T] = h(!1);
157
+ ), [B, re] = f(!1), [K, se] = f(null), { questions: y, busy: we, dismissAll: ke } = ze(), [U, $] = f(!1);
177
158
  w(() => {
178
- T(!1);
179
- }, [v.length]);
180
- const [N, C] = h(() => (b == null ? void 0 : b.items) ?? null), [E, H] = h(() => (b == null ? void 0 : b.total) ?? 0), [V, ne] = h(!1), [ae, ie] = h(null), [le, oe] = h(null), de = "&kind=html", $ = he(Math.max(j, (b == null ? void 0 : b.items.length) ?? 0)), q = he(Math.max(ge, (x == null ? void 0 : x.items.length) ?? 0)), ce = Me(Se), Ae = je();
159
+ $(!1);
160
+ }, [y.length]);
161
+ const [N, E] = f(() => (b == null ? void 0 : b.items) ?? null), [C, H] = f(() => (b == null ? void 0 : b.total) ?? 0), [V, ne] = f(!1), [ae, ie] = f(null), [le, oe] = f(null), de = "&kind=html", D = fe(Math.max(S, (b == null ? void 0 : b.items.length) ?? 0)), q = fe(Math.max(ge, (x == null ? void 0 : x.items.length) ?? 0)), ce = $e(Se), Ae = Pe();
181
162
  w(() => {
182
- f === "feed" && I(M(m));
183
- }, [m, f]), w(() => {
184
- if (f !== "feed" || u === null || A) return;
185
- const e = u.reduce((t, c) => Math.max(t, c.ts), Date.now());
163
+ h === "feed" && I(M(m));
164
+ }, [m, h]), w(() => {
165
+ if (h !== "feed" || u === null || A) return;
166
+ const e = u.reduce((t, d) => Math.max(t, d.ts), Date.now());
186
167
  I(xe(m, e));
187
- }, [m, A, u, f]), w(() => {
188
- if (f !== "feed") return;
168
+ }, [m, A, u, h]), w(() => {
169
+ if (h !== "feed") return;
189
170
  const e = () => I(M(m));
190
171
  return window.addEventListener("storage", e), window.addEventListener(O, e), () => {
191
172
  window.removeEventListener("storage", e), window.removeEventListener(O, e);
192
173
  };
193
- }, [m, f]), w(() => {
194
- if (f !== "artifacts") return;
174
+ }, [m, h]), w(() => {
175
+ if (h !== "artifacts") return;
195
176
  let e = !0;
196
177
  const t = async () => {
197
178
  try {
198
- const a = await D(
199
- `/api/artifacts?limit=${j}${de}`,
179
+ const a = await L(
180
+ `/api/artifacts?limit=${S}${de}`,
200
181
  { cache: "no-store" }
201
182
  );
202
183
  if (!e) return;
203
184
  const n = Array.isArray(a.artifacts) ? a.artifacts : [], g = a.total ?? n.length;
204
- C((z) => {
205
- const S = new Set(n.map((X) => X.id)), _e = (z ?? []).filter((X) => !S.has(X.id)), Q = [...n, ..._e];
206
- return $.current = Math.max(j, Q.length), k(L, Q, g), Q;
185
+ E((T) => {
186
+ const z = new Set(n.map((X) => X.id)), Me = (T ?? []).filter((X) => !z.has(X.id)), Q = [...n, ...Me];
187
+ return D.current = Math.max(S, Q.length), k(R, Q, g), Q;
207
188
  }), H(g);
208
189
  } catch {
209
- e && C((a) => a ?? []);
190
+ e && E((a) => a ?? []);
210
191
  }
211
192
  };
212
- if (t(), !y)
193
+ if (t(), !v)
213
194
  return () => {
214
195
  e = !1;
215
196
  };
216
- const c = setInterval(() => void t(), 2e4);
197
+ const d = setInterval(() => void t(), 2e4);
217
198
  return () => {
218
- e = !1, clearInterval(c);
199
+ e = !1, clearInterval(d);
219
200
  };
220
- }, [f, y]);
201
+ }, [h, v]);
221
202
  const Ie = async () => {
222
203
  if (!V) {
223
204
  ne(!0);
224
205
  try {
225
- const e = await D(
226
- `/api/artifacts?limit=${j}&offset=${$.current}${de}`,
206
+ const e = await L(
207
+ `/api/artifacts?limit=${S}&offset=${D.current}${de}`,
227
208
  { cache: "no-store" }
228
209
  );
229
- C((t) => {
230
- const c = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.artifacts.filter((n) => !c.has(n.id))];
231
- return $.current = a.length, k(L, a, e.total ?? E), a;
210
+ E((t) => {
211
+ const d = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.artifacts.filter((n) => !d.has(n.id))];
212
+ return D.current = a.length, k(R, a, e.total ?? C), a;
232
213
  }), H((t) => e.total ?? t);
233
214
  } catch {
234
215
  } finally {
235
216
  ne(!1);
236
217
  }
237
218
  }
238
- }, Ce = async (e) => {
219
+ }, Ee = async (e) => {
239
220
  const t = e.title || e.caption || e.name;
240
221
  if (await Ae.confirm({
241
222
  title: `Delete ${t}?`,
@@ -245,78 +226,78 @@ function ht({
245
226
  })) {
246
227
  oe(e.id);
247
228
  try {
248
- await D(
229
+ await L(
249
230
  `/api/sessions/${encodeURIComponent(e.sessionId ?? "")}/artifacts/${encodeURIComponent(e.id)}`,
250
231
  {
251
232
  method: "DELETE",
252
233
  headers: { "X-LFG-Session-ID": e.sessionId ?? "" }
253
234
  }
254
- ), C((a) => {
235
+ ), E((a) => {
255
236
  const n = (a == null ? void 0 : a.filter((g) => g.id !== e.id)) ?? null;
256
- return n && k(L, n, Math.max(0, E - 1)), n;
257
- }), H((a) => Math.max(0, a - 1)), $.current = Math.max(0, $.current - 1), R.success("Artifact deleted");
237
+ return n && k(R, n, Math.max(0, C - 1)), n;
238
+ }), H((a) => Math.max(0, a - 1)), D.current = Math.max(0, D.current - 1), _.success("Artifact deleted");
258
239
  } catch (a) {
259
- R.error(a instanceof Error ? a.message : "Couldn't delete artifact");
240
+ _.error(a instanceof Error ? a.message : "Couldn't delete artifact");
260
241
  } finally {
261
242
  oe(null);
262
243
  }
263
244
  }
264
- }, Ee = async (e) => {
245
+ }, Ce = async (e) => {
265
246
  if (!(!e.sessionId || e.refreshEnabled === void 0)) {
266
247
  ie(e.id);
267
248
  try {
268
- const t = await D(
249
+ const t = await L(
269
250
  `/api/sessions/${encodeURIComponent(e.sessionId)}/artifacts/html/${encodeURIComponent(e.id)}/refresh`,
270
251
  {
271
252
  method: "POST",
272
253
  headers: { "X-LFG-Session-ID": e.sessionId }
273
254
  }
274
255
  );
275
- C((c) => {
276
- const a = (c == null ? void 0 : c.map((n) => {
277
- var g, z, S;
256
+ E((d) => {
257
+ const a = (d == null ? void 0 : d.map((n) => {
258
+ var g, T, z;
278
259
  return n.id === e.id ? {
279
260
  ...n,
280
261
  ts: t.artifact.updatedAt ?? n.ts,
281
262
  version: t.artifact.version ?? n.version,
282
263
  size: t.artifact.size ?? n.size,
283
264
  lastRefreshedAt: ((g = t.artifact.refresh) == null ? void 0 : g.lastSuccessAt) ?? n.lastRefreshedAt,
284
- refreshStatus: ((z = t.artifact.refresh) == null ? void 0 : z.status) ?? n.refreshStatus,
285
- refreshEnabled: ((S = t.artifact.refresh) == null ? void 0 : S.enabled) ?? n.refreshEnabled
265
+ refreshStatus: ((T = t.artifact.refresh) == null ? void 0 : T.status) ?? n.refreshStatus,
266
+ refreshEnabled: ((z = t.artifact.refresh) == null ? void 0 : z.enabled) ?? n.refreshEnabled
286
267
  } : n;
287
268
  })) ?? null;
288
- return a && k(L, a, E), a;
289
- }), R.success("Artifact refreshed");
269
+ return a && k(R, a, C), a;
270
+ }), _.success("Artifact refreshed");
290
271
  } catch (t) {
291
- R.error(t instanceof Error ? t.message : "Couldn't refresh artifact");
272
+ _.error(t instanceof Error ? t.message : "Couldn't refresh artifact");
292
273
  } finally {
293
274
  ie(null);
294
275
  }
295
276
  }
296
277
  };
297
278
  w(() => {
298
- if (!(f !== "feed" || !y))
299
- return Pe((e) => {
279
+ if (!(h !== "feed" || !v))
280
+ return je((e) => {
300
281
  if (!e.ok) {
301
282
  F((t) => (t === null && se(e.error), t));
302
283
  return;
303
284
  }
304
285
  F((t) => {
305
- const c = new Set(e.posts.map((g) => g.id)), a = (t ?? []).filter((g) => !c.has(g.id)), n = [...e.posts, ...a];
286
+ const d = new Set(e.posts.map((g) => g.id)), a = (t ?? []).filter((g) => !d.has(g.id)), n = [...e.posts, ...a];
306
287
  return q.current = Math.max(We, n.length), k(W, n, e.total), n;
307
288
  }), ee(e.total), se(null);
308
289
  });
309
- }, [f, y]);
310
- const $e = async () => {
311
- if (!B) {
290
+ }, [h, v]);
291
+ const De = async () => {
292
+ if (!G) {
312
293
  te(!0);
313
294
  try {
314
- const e = await D(
295
+ const e = await L(
315
296
  `/api/shipped?limit=${ge}&offset=${q.current}`,
316
297
  { cache: "no-store" }
317
298
  );
318
299
  F((t) => {
319
- const c = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.posts.filter((n) => !c.has(n.id))];
300
+ const d = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.posts.filter((n) => !d.has(n.id))];
320
301
  return q.current = a.length, k(W, a, e.total ?? Y), a;
321
302
  }), ee((t) => e.total ?? t);
322
303
  } catch {
@@ -326,69 +307,69 @@ function ht({
326
307
  }
327
308
  }, ue = (u == null ? void 0 : u.filter(
328
309
  (e) => Z(A, {
329
- id: P(e),
310
+ id: j(e),
330
311
  ts: e.ts
331
312
  })
332
- ).length) ?? 0, De = Te(() => {
313
+ ).length) ?? 0, Le = Te(() => {
333
314
  if (!(u != null && u.length)) return [];
334
315
  const e = Date.now(), t = [];
335
- for (const c of u) {
336
- const a = lt(c.ts, e), n = t[t.length - 1];
337
- n && n.label === a ? n.items.push(c) : t.push({ label: a, items: [c] });
316
+ for (const d of u) {
317
+ const a = lt(d.ts, e), n = t[t.length - 1];
318
+ n && n.label === a ? n.items.push(d) : t.push({ label: a, items: [d] });
338
319
  }
339
320
  return t;
340
- }, [u]), Le = (e) => {
321
+ }, [u]), Re = (e) => {
341
322
  Z(A, {
342
- id: P(e),
323
+ id: j(e),
343
324
  ts: e.ts
344
325
  }) && I(
345
- nt(m, P(e))
326
+ nt(m, j(e))
346
327
  );
347
- }, Re = async () => {
348
- if (!G) {
328
+ }, _e = async () => {
329
+ if (!B) {
349
330
  re(!0);
350
331
  try {
351
332
  const e = Math.max(Date.now(), ...(u ?? []).map((t) => t.ts));
352
- I(xe(m, e)), await Ve(), R.success("Notifications marked read");
333
+ I(xe(m, e)), await Ve(), _.success("Notifications marked read");
353
334
  } finally {
354
335
  re(!1);
355
336
  }
356
337
  }
357
338
  };
358
- return /* @__PURE__ */ o("div", { className: "mx-auto max-w-xl space-y-4 pb-10", "data-lfg-page-column": !0, children: [
359
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-1", children: [
360
- /* @__PURE__ */ o("div", { children: [
361
- /* @__PURE__ */ s("h1", { className: "text-lg font-semibold tracking-[-0.01em]", children: p ? "Artifacts" : "Notifications" }),
362
- p ? /* @__PURE__ */ s("p", { className: "mt-0.5 text-xs text-muted-foreground", children: "Interactive reports and live dashboards" }) : /* @__PURE__ */ s("p", { className: "mt-0.5 text-xs text-muted-foreground", children: v.length ? `${v.length} waiting on you` : ue ? `${ue} unread` : "You're all caught up" })
339
+ return /* @__PURE__ */ l("div", { className: "mx-auto max-w-xl space-y-4 pb-10", "data-lfg-page-column": !0, children: [
340
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-1", children: [
341
+ /* @__PURE__ */ l("div", { children: [
342
+ /* @__PURE__ */ r("h1", { className: "text-lg font-semibold tracking-[-0.01em]", children: p ? "Artifacts" : "Notifications" }),
343
+ p ? /* @__PURE__ */ r("p", { className: "mt-0.5 text-xs text-muted-foreground", children: "Interactive reports and live dashboards" }) : /* @__PURE__ */ r("p", { className: "mt-0.5 text-xs text-muted-foreground", children: y.length ? `${y.length} waiting on you` : ue ? `${ue} unread` : "You're all caught up" })
363
344
  ] }),
364
345
  !p && u !== null ? (
365
346
  // Icon only. It is a rare, undoable housekeeping action — it does not
366
347
  // need to be the second-loudest thing on the page.
367
- /* @__PURE__ */ s(
348
+ /* @__PURE__ */ r(
368
349
  Fe,
369
350
  {
370
351
  size: "icon-sm",
371
352
  variant: "ghost",
372
353
  "aria-label": "Mark all read",
373
354
  title: "Mark all read — clears the app icon badge",
374
- disabled: G,
375
- onClick: () => void Re(),
376
- children: G ? /* @__PURE__ */ s(pe, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(Oe, { className: "size-4" })
355
+ disabled: B,
356
+ onClick: () => void _e(),
357
+ children: B ? /* @__PURE__ */ r(pe, { className: "size-4 animate-spin" }) : /* @__PURE__ */ r(Oe, { className: "size-4" })
377
358
  }
378
359
  )
379
360
  ) : null
380
361
  ] }),
381
- f === "artifacts" ? /* @__PURE__ */ o(me, { children: [
382
- N === null ? /* @__PURE__ */ s("div", { className: "py-10 text-center text-sm text-muted-foreground", children: "Loading…" }) : N.length === 0 ? /* @__PURE__ */ o("div", { className: "rounded-2xl border border-border bg-card/40 px-4 py-10 text-center text-sm text-muted-foreground", children: [
362
+ h === "artifacts" ? /* @__PURE__ */ l(me, { children: [
363
+ N === null ? /* @__PURE__ */ r("div", { className: "py-10 text-center text-sm text-muted-foreground", children: "Loading…" }) : N.length === 0 ? /* @__PURE__ */ l("div", { className: "rounded-2xl border border-border bg-card/40 px-4 py-10 text-center text-sm text-muted-foreground", children: [
383
364
  "No artifacts yet — agents create them with ",
384
- /* @__PURE__ */ s("code", { children: "omg_publish_artifact" }),
365
+ /* @__PURE__ */ r("code", { children: "omg_publish_artifact" }),
385
366
  "."
386
- ] }) : /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3", children: N.map((e) => /* @__PURE__ */ o(
367
+ ] }) : /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3", children: N.map((e) => /* @__PURE__ */ l(
387
368
  "div",
388
369
  {
389
370
  className: "group relative overflow-hidden rounded-xl border border-border bg-card/40 text-left shadow-sm transition-colors hover:border-foreground/20",
390
371
  children: [
391
- /* @__PURE__ */ o(
372
+ /* @__PURE__ */ l(
392
373
  "button",
393
374
  {
394
375
  type: "button",
@@ -403,19 +384,19 @@ function ht({
403
384
  }),
404
385
  className: "block w-full text-left active:scale-[0.99]",
405
386
  children: [
406
- /* @__PURE__ */ s(at, { path: e.url, cacheKey: e.ts, children: (e.version ?? 1) > 1 ? /* @__PURE__ */ o("span", { className: "absolute left-1.5 top-1.5 flex items-center gap-1 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-600 backdrop-blur dark:text-emerald-400", children: [
407
- /* @__PURE__ */ s("span", { className: "size-1.5 rounded-full bg-emerald-500" }),
387
+ /* @__PURE__ */ r(at, { path: e.url, cacheKey: e.ts, children: (e.version ?? 1) > 1 ? /* @__PURE__ */ l("span", { className: "absolute left-1.5 top-1.5 flex items-center gap-1 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-600 backdrop-blur dark:text-emerald-400", children: [
388
+ /* @__PURE__ */ r("span", { className: "size-1.5 rounded-full bg-emerald-500" }),
408
389
  "live · v",
409
390
  e.version
410
391
  ] }) : null }),
411
- /* @__PURE__ */ o("div", { className: "px-2.5 py-2 pr-9", children: [
412
- /* @__PURE__ */ s("div", { className: "truncate text-xs font-medium", children: e.title || e.caption || e.name }),
413
- /* @__PURE__ */ s("div", { className: "mt-0.5 truncate text-[10px] text-muted-foreground", children: e.lastRefreshedAt ? `Refreshed ${J(e.lastRefreshedAt)}` : `Published ${J(e.ts)}` })
392
+ /* @__PURE__ */ l("div", { className: "px-2.5 py-2 pr-9", children: [
393
+ /* @__PURE__ */ r("div", { className: "truncate text-xs font-medium", children: e.title || e.caption || e.name }),
394
+ /* @__PURE__ */ r("div", { className: "mt-0.5 truncate text-[10px] text-muted-foreground", children: e.lastRefreshedAt ? `Refreshed ${J(e.lastRefreshedAt)}` : `Published ${J(e.ts)}` })
414
395
  ] })
415
396
  ]
416
397
  }
417
398
  ),
418
- e.sessionId ? /* @__PURE__ */ o(
399
+ e.sessionId ? /* @__PURE__ */ l(
419
400
  "button",
420
401
  {
421
402
  type: "button",
@@ -424,33 +405,33 @@ function ht({
424
405
  title: e.sessionTitle || e.project || "Open related session",
425
406
  className: "flex w-full items-center gap-1.5 border-t border-border/60 px-2.5 py-2 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-foreground/[0.03] hover:text-foreground",
426
407
  children: [
427
- /* @__PURE__ */ s(tt, { className: "size-3 shrink-0", "aria-hidden": !0 }),
428
- /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate text-left", children: e.sessionTitle || e.project || "Related session" }),
429
- /* @__PURE__ */ s(Ye, { className: "size-3 shrink-0", "aria-hidden": !0 })
408
+ /* @__PURE__ */ r(tt, { className: "size-3 shrink-0", "aria-hidden": !0 }),
409
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate text-left", children: e.sessionTitle || e.project || "Related session" }),
410
+ /* @__PURE__ */ r(Ye, { className: "size-3 shrink-0", "aria-hidden": !0 })
430
411
  ]
431
412
  }
432
413
  ) : null,
433
- /* @__PURE__ */ o("div", { className: "absolute right-1.5 top-1.5 flex items-center gap-0.5 rounded-full bg-background/80 backdrop-blur", children: [
434
- e.refreshEnabled !== void 0 ? /* @__PURE__ */ s(
414
+ /* @__PURE__ */ l("div", { className: "absolute right-1.5 top-1.5 flex items-center gap-0.5 rounded-full bg-background/80 backdrop-blur", children: [
415
+ e.refreshEnabled !== void 0 ? /* @__PURE__ */ r(
435
416
  "button",
436
417
  {
437
418
  type: "button",
438
- onClick: () => void Ee(e),
419
+ onClick: () => void Ce(e),
439
420
  disabled: ae === e.id,
440
421
  "aria-label": `Refresh ${e.title || e.caption || e.name}`,
441
422
  className: "flex size-7 items-center justify-center rounded-full text-muted-foreground opacity-100 transition-[color,background-color,transform,opacity] duration-150 hover:bg-foreground/[0.06] hover:text-foreground active:scale-[0.94] disabled:opacity-50 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100",
442
- children: /* @__PURE__ */ s(Be, { className: _("size-3.5", ae === e.id && "animate-spin") })
423
+ children: /* @__PURE__ */ r(Ge, { className: P("size-3.5", ae === e.id && "animate-spin") })
443
424
  }
444
425
  ) : null,
445
- /* @__PURE__ */ s(
426
+ /* @__PURE__ */ r(
446
427
  "button",
447
428
  {
448
429
  type: "button",
449
- onClick: () => void Ce(e),
430
+ onClick: () => void Ee(e),
450
431
  disabled: le === e.id,
451
432
  "aria-label": `Delete ${e.title || e.caption || e.name}`,
452
433
  className: "flex size-7 items-center justify-center rounded-full text-muted-foreground opacity-100 transition-[color,background-color,transform,opacity] duration-150 hover:bg-destructive/10 hover:text-destructive active:scale-[0.94] disabled:opacity-50 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100",
453
- children: le === e.id ? /* @__PURE__ */ s(pe, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ s(Ge, { className: "size-3.5" })
434
+ children: le === e.id ? /* @__PURE__ */ r(pe, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ r(Be, { className: "size-3.5" })
454
435
  }
455
436
  )
456
437
  ] })
@@ -458,78 +439,78 @@ function ht({
458
439
  },
459
440
  e.id
460
441
  )) }),
461
- N !== null && N.length < E ? /* @__PURE__ */ s(
442
+ N !== null && N.length < C ? /* @__PURE__ */ r(
462
443
  "button",
463
444
  {
464
445
  type: "button",
465
446
  onClick: () => void Ie(),
466
447
  disabled: V,
467
448
  className: "w-full rounded-xl border border-border bg-card/40 px-4 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:border-foreground/20 hover:text-foreground disabled:opacity-60",
468
- children: V ? "Loading…" : `Load more · ${E - N.length} left`
449
+ children: V ? "Loading…" : `Load more · ${C - N.length} left`
469
450
  }
470
451
  ) : null
471
- ] }) : /* @__PURE__ */ o(me, { children: [
472
- K ? /* @__PURE__ */ s("div", { className: "rounded-xl border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: K }) : null,
473
- u === null && !K ? /* @__PURE__ */ s("div", { className: "py-10 text-center text-sm text-muted-foreground", children: "Loading…" }) : null,
474
- v.length ? /* @__PURE__ */ o("section", { className: "space-y-1.5", children: [
475
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 px-1", children: [
476
- /* @__PURE__ */ s("h2", { className: "text-[11px] font-semibold uppercase tracking-wide text-primary", children: "Needs you" }),
477
- v.length > 1 ? /* @__PURE__ */ s(
452
+ ] }) : /* @__PURE__ */ l(me, { children: [
453
+ K ? /* @__PURE__ */ r("div", { className: "rounded-xl border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: K }) : null,
454
+ u === null && !K ? /* @__PURE__ */ r("div", { className: "py-10 text-center text-sm text-muted-foreground", children: "Loading…" }) : null,
455
+ y.length ? /* @__PURE__ */ l("section", { className: "space-y-1.5", children: [
456
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 px-1", children: [
457
+ /* @__PURE__ */ r("h2", { className: "text-[11px] font-semibold uppercase tracking-wide text-primary", children: "Needs you" }),
458
+ y.length > 1 ? /* @__PURE__ */ r(
478
459
  "button",
479
460
  {
480
461
  type: "button",
481
462
  disabled: we,
482
463
  onClick: () => {
483
464
  if (!U) {
484
- T(!0);
465
+ $(!0);
485
466
  return;
486
467
  }
487
- T(!1), ke();
468
+ $(!1), ke();
488
469
  },
489
- onBlur: () => T(!1),
490
- className: _(
470
+ onBlur: () => $(!1),
471
+ className: P(
491
472
  "-my-1 rounded-full px-2 py-1 text-[11px] font-medium transition-colors disabled:opacity-50",
492
473
  U ? "bg-destructive/10 text-destructive" : "text-muted-foreground hover:text-foreground"
493
474
  ),
494
- children: U ? `Dismiss all ${v.length}?` : "Dismiss all"
475
+ children: U ? `Dismiss all ${y.length}?` : "Dismiss all"
495
476
  }
496
477
  ) : null
497
478
  ] }),
498
- /* @__PURE__ */ s("div", { className: "overflow-hidden rounded-2xl border border-primary/25 bg-primary/[0.03] shadow-sm", children: [...v].sort((e, t) => t.createdAt - e.createdAt).map((e) => /* @__PURE__ */ s(Ke, { q: e, onOpenSession: r }, e.id)) })
479
+ /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-2xl border border-primary/25 bg-primary/[0.03] shadow-sm", children: [...y].sort((e, t) => t.createdAt - e.createdAt).map((e) => /* @__PURE__ */ r(Ke, { q: e, onOpenSession: s }, e.id)) })
499
480
  ] }) : null,
500
- u !== null && u.length === 0 && !v.length ? /* @__PURE__ */ s("div", { className: "rounded-2xl border border-border bg-card/40 px-4 py-10 text-center text-sm text-muted-foreground", children: "No notifications yet — verified results and future activity will collect here." }) : null,
501
- De.map((e) => /* @__PURE__ */ o("section", { className: "space-y-1.5", children: [
502
- /* @__PURE__ */ s("h2", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: e.label }),
503
- /* @__PURE__ */ s("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 shadow-sm", children: e.items.map((t) => {
504
- const c = !!t.sessionId && l.has(t.sessionId), a = Z(A, {
505
- id: P(t),
481
+ u !== null && u.length === 0 && !y.length ? /* @__PURE__ */ r("div", { className: "rounded-2xl border border-border bg-card/40 px-4 py-10 text-center text-sm text-muted-foreground", children: "No notifications yet — verified results and future activity will collect here." }) : null,
482
+ Le.map((e) => /* @__PURE__ */ l("section", { className: "space-y-1.5", children: [
483
+ /* @__PURE__ */ r("h2", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: e.label }),
484
+ /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 shadow-sm", children: e.items.map((t) => {
485
+ const d = !!t.sessionId && o.has(t.sessionId), a = Z(A, {
486
+ id: j(t),
506
487
  ts: t.ts
507
488
  }), n = t.mediaItems.length > 0;
508
- return /* @__PURE__ */ o("article", { className: "relative border-b border-border/50 last:border-b-0", children: [
509
- /* @__PURE__ */ o(
489
+ return /* @__PURE__ */ l("article", { className: "relative border-b border-border/50 last:border-b-0", children: [
490
+ /* @__PURE__ */ l(
510
491
  "button",
511
492
  {
512
493
  type: "button",
513
494
  onClick: () => {
514
- Le(t), t.sessionId && (d ? d(t) : c && r(t.sessionId));
495
+ Re(t), t.sessionId && (c ? c(t) : d && s(t.sessionId));
515
496
  },
516
- className: _(
497
+ className: P(
517
498
  "flex w-full items-start gap-2.5 py-2.5 pl-2.5 text-left transition-colors hover:bg-foreground/[0.02]",
518
499
  n ? "pr-[4.75rem]" : "pr-3.5"
519
500
  ),
520
501
  children: [
521
- /* @__PURE__ */ s(
502
+ /* @__PURE__ */ r(
522
503
  "span",
523
504
  {
524
- className: _(
505
+ className: P(
525
506
  "mt-3 size-1.5 shrink-0 rounded-full",
526
507
  a && "bg-primary"
527
508
  ),
528
509
  title: a ? "Unread" : void 0
529
510
  }
530
511
  ),
531
- /* @__PURE__ */ o("span", { className: "relative mt-0.5 shrink-0", children: [
532
- /* @__PURE__ */ s(
512
+ /* @__PURE__ */ l("span", { className: "relative mt-0.5 shrink-0", children: [
513
+ /* @__PURE__ */ r(
533
514
  "img",
534
515
  {
535
516
  src: Ue(t.agent),
@@ -537,7 +518,7 @@ function ht({
537
518
  className: "size-7 rounded-full border border-border bg-background p-1"
538
519
  }
539
520
  ),
540
- c ? /* @__PURE__ */ s(
521
+ d ? /* @__PURE__ */ r(
541
522
  "span",
542
523
  {
543
524
  title: "Session is active",
@@ -545,30 +526,27 @@ function ht({
545
526
  }
546
527
  ) : null
547
528
  ] }),
548
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
549
- /* @__PURE__ */ o("div", { className: "flex items-baseline gap-1.5 text-[11px] text-muted-foreground", children: [
550
- /* @__PURE__ */ s("span", { className: "min-w-0 shrink truncate font-medium text-foreground/75", children: be(t.agent) }),
551
- t.project ? /* @__PURE__ */ o("span", { className: "min-w-0 shrink truncate", children: [
529
+ /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
530
+ /* @__PURE__ */ l("div", { className: "flex items-baseline gap-1.5 text-[11px] text-muted-foreground", children: [
531
+ /* @__PURE__ */ r("span", { className: "min-w-0 shrink truncate font-medium text-foreground/75", children: be(t.agent) }),
532
+ t.project ? /* @__PURE__ */ l("span", { className: "min-w-0 shrink truncate", children: [
552
533
  "· ",
553
534
  t.project
554
535
  ] }) : null,
555
- /* @__PURE__ */ o("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
556
- /* @__PURE__ */ s(ot, { code: t.code }),
557
- /* @__PURE__ */ s("span", { className: "tabular-nums", children: J(t.ts) })
558
- ] })
536
+ /* @__PURE__ */ r("span", { className: "ml-auto shrink-0 tabular-nums", children: J(t.ts) })
559
537
  ] }),
560
- /* @__PURE__ */ s("h3", { className: "mt-0.5 line-clamp-2 text-[13.5px] font-semibold leading-snug tracking-[-0.01em]", children: t.title }),
538
+ /* @__PURE__ */ r("h3", { className: "mt-0.5 line-clamp-2 text-[13.5px] font-semibold leading-snug tracking-[-0.01em]", children: t.title }),
561
539
  t.summary ? (
562
540
  // Plain text, two lines. Rendering markdown for a body
563
541
  // that is clamped to two lines cost a whole markdown
564
542
  // tree per row for text nobody can see.
565
- /* @__PURE__ */ s("p", { className: "mt-0.5 line-clamp-2 text-[12.5px] leading-relaxed text-muted-foreground", children: He(t.summary) })
543
+ /* @__PURE__ */ r("p", { className: "mt-0.5 line-clamp-2 text-[12.5px] leading-relaxed text-muted-foreground", children: He(t.summary) })
566
544
  ) : null
567
545
  ] })
568
546
  ]
569
547
  }
570
548
  ),
571
- n ? /* @__PURE__ */ s("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ s(
549
+ n ? /* @__PURE__ */ r("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ r(
572
550
  it,
573
551
  {
574
552
  items: t.mediaItems,
@@ -579,19 +557,19 @@ function ht({
579
557
  ] }, t.id);
580
558
  }) })
581
559
  ] }, e.label)),
582
- u !== null && u.length < Y ? /* @__PURE__ */ s(
560
+ u !== null && u.length < Y ? /* @__PURE__ */ r(
583
561
  "button",
584
562
  {
585
563
  type: "button",
586
- onClick: () => void $e(),
587
- disabled: B,
564
+ onClick: () => void De(),
565
+ disabled: G,
588
566
  className: "w-full rounded-xl border border-border bg-card/40 px-4 py-2.5 text-sm font-medium text-muted-foreground transition-colors hover:border-foreground/20 hover:text-foreground disabled:opacity-60",
589
- children: B ? "Loading…" : `Load more · ${Y - u.length} left`
567
+ children: G ? "Loading…" : `Load more · ${Y - u.length} left`
590
568
  }
591
569
  ) : null
592
570
  ] })
593
571
  ] });
594
572
  }
595
573
  export {
596
- ht as default
574
+ mt as default
597
575
  };