@omg-dev/app 0.1.399 → 0.1.401

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 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-BBlmRSMA.js";
4
- import { cn as P } from "cnfast";
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-DwiVQpqX.js";
4
+ import { cn as _ } from "cnfast";
5
5
  /**
6
6
  * @license lucide-react v0.577.0 - ISC
7
7
  *
@@ -11,7 +11,7 @@ import { cn as P } 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 = ve("check-check", Ze);
14
+ ], Oe = ye("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 = 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__"}`;
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__"}`;
35
35
  }
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)] };
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)] };
40
40
  }
41
- function M(s) {
41
+ function M(r) {
42
42
  if (typeof window > "u") return null;
43
43
  try {
44
- return st(JSON.parse(localStorage.getItem(ye(s)) ?? "null"));
44
+ return st(JSON.parse(localStorage.getItem(ve(r)) ?? "null"));
45
45
  } catch {
46
46
  return null;
47
47
  }
48
48
  }
49
- function Ne(s, i) {
50
- return typeof window > "u" || (localStorage.setItem(ye(s), JSON.stringify(i)), window.dispatchEvent(
49
+ function Ne(r, i) {
50
+ return typeof window > "u" || (localStorage.setItem(ve(r), JSON.stringify(i)), window.dispatchEvent(
51
51
  new CustomEvent(O, {
52
- detail: { identity: (s == null ? void 0 : s.trim().toLowerCase()) || "__device__" }
52
+ detail: { identity: (r == null ? void 0 : r.trim().toLowerCase()) || "__device__" }
53
53
  })
54
54
  )), i;
55
55
  }
56
- function j(s) {
57
- return `shipped:${s.id}:${s.rev}`;
56
+ function P(r) {
57
+ return `shipped:${r.id}:${r.rev}`;
58
58
  }
59
- function Z(s, i) {
60
- return s ? i.ts > s.through && !s.ids.includes(i.id) : !1;
59
+ function Z(r, i) {
60
+ return r ? i.ts > r.through && !r.ids.includes(i.id) : !1;
61
61
  }
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)
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)
67
67
  });
68
68
  }
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
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
74
74
  });
75
75
  }
76
76
  function at({
77
- path: s,
77
+ path: r,
78
78
  cacheKey: i,
79
- children: c
79
+ children: d
80
80
  }) {
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
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
84
84
  ] });
85
85
  }
86
86
  function it({
87
- items: s,
87
+ items: r,
88
88
  total: i,
89
- onExpand: c
89
+ onExpand: d
90
90
  }) {
91
- const o = s[0];
92
- if (!o) return null;
91
+ const l = r[0];
92
+ if (!l) return null;
93
93
  const m = Math.max(0, i - 1);
94
- return /* @__PURE__ */ l(
94
+ return /* @__PURE__ */ o(
95
95
  "button",
96
96
  {
97
97
  type: "button",
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
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
105
105
  }),
106
- "aria-label": `Open ${o.caption || o.name}`,
107
- title: o.caption || o.name,
106
+ "aria-label": `Open ${l.caption || l.name}`,
107
+ title: l.caption || l.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
- o.kind === "image" ? /* @__PURE__ */ r(
110
+ l.kind === "image" ? /* @__PURE__ */ s(
111
111
  Qe,
112
112
  {
113
- path: o.url,
114
- alt: o.caption || o.name,
113
+ path: l.url,
114
+ alt: l.caption || l.name,
115
115
  thumb: !0,
116
116
  className: "size-full object-cover"
117
117
  }
118
- ) : o.kind === "html" ? (
118
+ ) : l.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__ */ 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: [
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: [
125
125
  "+",
126
126
  m
127
127
  ] }) : null
@@ -129,94 +129,113 @@ function it({
129
129
  }
130
130
  );
131
131
  }
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);
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);
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 mt({
147
- onOpenSession: s,
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,
148
167
  onOpenArtifactSession: i,
149
- onReviewSession: c,
150
- liveSessionIds: o,
168
+ onReviewSession: d,
169
+ liveSessionIds: l,
151
170
  notificationIdentity: m,
152
171
  artifactsOnly: p = !1,
153
- active: v = !0
172
+ active: y = !0
154
173
  }) {
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(
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(
156
175
  () => p ? null : M(m)
157
- ), [B, re] = f(!1), [K, se] = f(null), { questions: y, busy: we, dismissAll: ke } = ze(), [U, $] = f(!1);
176
+ ), [G, re] = h(!1), [K, se] = h(null), { questions: v, busy: we, dismissAll: ke } = ze(), [U, T] = h(!1);
158
177
  w(() => {
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();
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();
162
181
  w(() => {
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());
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());
167
186
  I(xe(m, e));
168
- }, [m, A, u, h]), w(() => {
169
- if (h !== "feed") return;
187
+ }, [m, A, u, f]), w(() => {
188
+ if (f !== "feed") return;
170
189
  const e = () => I(M(m));
171
190
  return window.addEventListener("storage", e), window.addEventListener(O, e), () => {
172
191
  window.removeEventListener("storage", e), window.removeEventListener(O, e);
173
192
  };
174
- }, [m, h]), w(() => {
175
- if (h !== "artifacts") return;
193
+ }, [m, f]), w(() => {
194
+ if (f !== "artifacts") return;
176
195
  let e = !0;
177
196
  const t = async () => {
178
197
  try {
179
- const a = await L(
180
- `/api/artifacts?limit=${S}${de}`,
198
+ const a = await D(
199
+ `/api/artifacts?limit=${j}${de}`,
181
200
  { cache: "no-store" }
182
201
  );
183
202
  if (!e) return;
184
203
  const n = Array.isArray(a.artifacts) ? a.artifacts : [], g = a.total ?? n.length;
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;
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;
188
207
  }), H(g);
189
208
  } catch {
190
- e && E((a) => a ?? []);
209
+ e && C((a) => a ?? []);
191
210
  }
192
211
  };
193
- if (t(), !v)
212
+ if (t(), !y)
194
213
  return () => {
195
214
  e = !1;
196
215
  };
197
- const d = setInterval(() => void t(), 2e4);
216
+ const c = setInterval(() => void t(), 2e4);
198
217
  return () => {
199
- e = !1, clearInterval(d);
218
+ e = !1, clearInterval(c);
200
219
  };
201
- }, [h, v]);
220
+ }, [f, y]);
202
221
  const Ie = async () => {
203
222
  if (!V) {
204
223
  ne(!0);
205
224
  try {
206
- const e = await L(
207
- `/api/artifacts?limit=${S}&offset=${D.current}${de}`,
225
+ const e = await D(
226
+ `/api/artifacts?limit=${j}&offset=${$.current}${de}`,
208
227
  { cache: "no-store" }
209
228
  );
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;
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;
213
232
  }), H((t) => e.total ?? t);
214
233
  } catch {
215
234
  } finally {
216
235
  ne(!1);
217
236
  }
218
237
  }
219
- }, Ee = async (e) => {
238
+ }, Ce = async (e) => {
220
239
  const t = e.title || e.caption || e.name;
221
240
  if (await Ae.confirm({
222
241
  title: `Delete ${t}?`,
@@ -226,78 +245,78 @@ function mt({
226
245
  })) {
227
246
  oe(e.id);
228
247
  try {
229
- await L(
248
+ await D(
230
249
  `/api/sessions/${encodeURIComponent(e.sessionId ?? "")}/artifacts/${encodeURIComponent(e.id)}`,
231
250
  {
232
251
  method: "DELETE",
233
252
  headers: { "X-LFG-Session-ID": e.sessionId ?? "" }
234
253
  }
235
- ), E((a) => {
254
+ ), C((a) => {
236
255
  const n = (a == null ? void 0 : a.filter((g) => g.id !== e.id)) ?? null;
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");
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");
239
258
  } catch (a) {
240
- _.error(a instanceof Error ? a.message : "Couldn't delete artifact");
259
+ R.error(a instanceof Error ? a.message : "Couldn't delete artifact");
241
260
  } finally {
242
261
  oe(null);
243
262
  }
244
263
  }
245
- }, Ce = async (e) => {
264
+ }, Ee = async (e) => {
246
265
  if (!(!e.sessionId || e.refreshEnabled === void 0)) {
247
266
  ie(e.id);
248
267
  try {
249
- const t = await L(
268
+ const t = await D(
250
269
  `/api/sessions/${encodeURIComponent(e.sessionId)}/artifacts/html/${encodeURIComponent(e.id)}/refresh`,
251
270
  {
252
271
  method: "POST",
253
272
  headers: { "X-LFG-Session-ID": e.sessionId }
254
273
  }
255
274
  );
256
- E((d) => {
257
- const a = (d == null ? void 0 : d.map((n) => {
258
- var g, T, z;
275
+ C((c) => {
276
+ const a = (c == null ? void 0 : c.map((n) => {
277
+ var g, z, S;
259
278
  return n.id === e.id ? {
260
279
  ...n,
261
280
  ts: t.artifact.updatedAt ?? n.ts,
262
281
  version: t.artifact.version ?? n.version,
263
282
  size: t.artifact.size ?? n.size,
264
283
  lastRefreshedAt: ((g = t.artifact.refresh) == null ? void 0 : g.lastSuccessAt) ?? n.lastRefreshedAt,
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
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
267
286
  } : n;
268
287
  })) ?? null;
269
- return a && k(R, a, C), a;
270
- }), _.success("Artifact refreshed");
288
+ return a && k(L, a, E), a;
289
+ }), R.success("Artifact refreshed");
271
290
  } catch (t) {
272
- _.error(t instanceof Error ? t.message : "Couldn't refresh artifact");
291
+ R.error(t instanceof Error ? t.message : "Couldn't refresh artifact");
273
292
  } finally {
274
293
  ie(null);
275
294
  }
276
295
  }
277
296
  };
278
297
  w(() => {
279
- if (!(h !== "feed" || !v))
280
- return je((e) => {
298
+ if (!(f !== "feed" || !y))
299
+ return Pe((e) => {
281
300
  if (!e.ok) {
282
301
  F((t) => (t === null && se(e.error), t));
283
302
  return;
284
303
  }
285
304
  F((t) => {
286
- const d = new Set(e.posts.map((g) => g.id)), a = (t ?? []).filter((g) => !d.has(g.id)), n = [...e.posts, ...a];
305
+ const c = new Set(e.posts.map((g) => g.id)), a = (t ?? []).filter((g) => !c.has(g.id)), n = [...e.posts, ...a];
287
306
  return q.current = Math.max(We, n.length), k(W, n, e.total), n;
288
307
  }), ee(e.total), se(null);
289
308
  });
290
- }, [h, v]);
291
- const De = async () => {
292
- if (!G) {
309
+ }, [f, y]);
310
+ const $e = async () => {
311
+ if (!B) {
293
312
  te(!0);
294
313
  try {
295
- const e = await L(
314
+ const e = await D(
296
315
  `/api/shipped?limit=${ge}&offset=${q.current}`,
297
316
  { cache: "no-store" }
298
317
  );
299
318
  F((t) => {
300
- const d = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.posts.filter((n) => !d.has(n.id))];
319
+ const c = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.posts.filter((n) => !c.has(n.id))];
301
320
  return q.current = a.length, k(W, a, e.total ?? Y), a;
302
321
  }), ee((t) => e.total ?? t);
303
322
  } catch {
@@ -307,69 +326,69 @@ function mt({
307
326
  }
308
327
  }, ue = (u == null ? void 0 : u.filter(
309
328
  (e) => Z(A, {
310
- id: j(e),
329
+ id: P(e),
311
330
  ts: e.ts
312
331
  })
313
- ).length) ?? 0, Le = Te(() => {
332
+ ).length) ?? 0, De = Te(() => {
314
333
  if (!(u != null && u.length)) return [];
315
334
  const e = Date.now(), t = [];
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] });
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] });
319
338
  }
320
339
  return t;
321
- }, [u]), Re = (e) => {
340
+ }, [u]), Le = (e) => {
322
341
  Z(A, {
323
- id: j(e),
342
+ id: P(e),
324
343
  ts: e.ts
325
344
  }) && I(
326
- nt(m, j(e))
345
+ nt(m, P(e))
327
346
  );
328
- }, _e = async () => {
329
- if (!B) {
347
+ }, Re = async () => {
348
+ if (!G) {
330
349
  re(!0);
331
350
  try {
332
351
  const e = Math.max(Date.now(), ...(u ?? []).map((t) => t.ts));
333
- I(xe(m, e)), await Ve(), _.success("Notifications marked read");
352
+ I(xe(m, e)), await Ve(), R.success("Notifications marked read");
334
353
  } finally {
335
354
  re(!1);
336
355
  }
337
356
  }
338
357
  };
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" })
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" })
344
363
  ] }),
345
364
  !p && u !== null ? (
346
365
  // Icon only. It is a rare, undoable housekeeping action — it does not
347
366
  // need to be the second-loudest thing on the page.
348
- /* @__PURE__ */ r(
367
+ /* @__PURE__ */ s(
349
368
  Fe,
350
369
  {
351
370
  size: "icon-sm",
352
371
  variant: "ghost",
353
372
  "aria-label": "Mark all read",
354
373
  title: "Mark all read — clears the app icon badge",
355
- disabled: B,
356
- onClick: () => void _e(),
357
- children: B ? /* @__PURE__ */ r(pe, { className: "size-4 animate-spin" }) : /* @__PURE__ */ r(Oe, { className: "size-4" })
374
+ disabled: G,
375
+ onClick: () => void Re(),
376
+ children: G ? /* @__PURE__ */ s(pe, { className: "size-4 animate-spin" }) : /* @__PURE__ */ s(Oe, { className: "size-4" })
358
377
  }
359
378
  )
360
379
  ) : null
361
380
  ] }),
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: [
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: [
364
383
  "No artifacts yet — agents create them with ",
365
- /* @__PURE__ */ r("code", { children: "omg_publish_artifact" }),
384
+ /* @__PURE__ */ s("code", { children: "omg_publish_artifact" }),
366
385
  "."
367
- ] }) : /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3", children: N.map((e) => /* @__PURE__ */ l(
386
+ ] }) : /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3", children: N.map((e) => /* @__PURE__ */ o(
368
387
  "div",
369
388
  {
370
389
  className: "group relative overflow-hidden rounded-xl border border-border bg-card/40 text-left shadow-sm transition-colors hover:border-foreground/20",
371
390
  children: [
372
- /* @__PURE__ */ l(
391
+ /* @__PURE__ */ o(
373
392
  "button",
374
393
  {
375
394
  type: "button",
@@ -384,19 +403,19 @@ function mt({
384
403
  }),
385
404
  className: "block w-full text-left active:scale-[0.99]",
386
405
  children: [
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" }),
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" }),
389
408
  "live · v",
390
409
  e.version
391
410
  ] }) : null }),
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)}` })
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)}` })
395
414
  ] })
396
415
  ]
397
416
  }
398
417
  ),
399
- e.sessionId ? /* @__PURE__ */ l(
418
+ e.sessionId ? /* @__PURE__ */ o(
400
419
  "button",
401
420
  {
402
421
  type: "button",
@@ -405,33 +424,33 @@ function mt({
405
424
  title: e.sessionTitle || e.project || "Open related session",
406
425
  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",
407
426
  children: [
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 })
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 })
411
430
  ]
412
431
  }
413
432
  ) : null,
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(
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(
416
435
  "button",
417
436
  {
418
437
  type: "button",
419
- onClick: () => void Ce(e),
438
+ onClick: () => void Ee(e),
420
439
  disabled: ae === e.id,
421
440
  "aria-label": `Refresh ${e.title || e.caption || e.name}`,
422
441
  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",
423
- children: /* @__PURE__ */ r(Ge, { className: P("size-3.5", ae === e.id && "animate-spin") })
442
+ children: /* @__PURE__ */ s(Be, { className: _("size-3.5", ae === e.id && "animate-spin") })
424
443
  }
425
444
  ) : null,
426
- /* @__PURE__ */ r(
445
+ /* @__PURE__ */ s(
427
446
  "button",
428
447
  {
429
448
  type: "button",
430
- onClick: () => void Ee(e),
449
+ onClick: () => void Ce(e),
431
450
  disabled: le === e.id,
432
451
  "aria-label": `Delete ${e.title || e.caption || e.name}`,
433
452
  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",
434
- children: le === e.id ? /* @__PURE__ */ r(pe, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ r(Be, { className: "size-3.5" })
453
+ children: le === e.id ? /* @__PURE__ */ s(pe, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ s(Ge, { className: "size-3.5" })
435
454
  }
436
455
  )
437
456
  ] })
@@ -439,78 +458,78 @@ function mt({
439
458
  },
440
459
  e.id
441
460
  )) }),
442
- N !== null && N.length < C ? /* @__PURE__ */ r(
461
+ N !== null && N.length < E ? /* @__PURE__ */ s(
443
462
  "button",
444
463
  {
445
464
  type: "button",
446
465
  onClick: () => void Ie(),
447
466
  disabled: V,
448
467
  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",
449
- children: V ? "Loading…" : `Load more · ${C - N.length} left`
468
+ children: V ? "Loading…" : `Load more · ${E - N.length} left`
450
469
  }
451
470
  ) : null
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(
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(
459
478
  "button",
460
479
  {
461
480
  type: "button",
462
481
  disabled: we,
463
482
  onClick: () => {
464
483
  if (!U) {
465
- $(!0);
484
+ T(!0);
466
485
  return;
467
486
  }
468
- $(!1), ke();
487
+ T(!1), ke();
469
488
  },
470
- onBlur: () => $(!1),
471
- className: P(
489
+ onBlur: () => T(!1),
490
+ className: _(
472
491
  "-my-1 rounded-full px-2 py-1 text-[11px] font-medium transition-colors disabled:opacity-50",
473
492
  U ? "bg-destructive/10 text-destructive" : "text-muted-foreground hover:text-foreground"
474
493
  ),
475
- children: U ? `Dismiss all ${y.length}?` : "Dismiss all"
494
+ children: U ? `Dismiss all ${v.length}?` : "Dismiss all"
476
495
  }
477
496
  ) : null
478
497
  ] }),
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)) })
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)) })
480
499
  ] }) : null,
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),
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),
487
506
  ts: t.ts
488
507
  }), n = t.mediaItems.length > 0;
489
- return /* @__PURE__ */ l("article", { className: "relative border-b border-border/50 last:border-b-0", children: [
490
- /* @__PURE__ */ l(
508
+ return /* @__PURE__ */ o("article", { className: "relative border-b border-border/50 last:border-b-0", children: [
509
+ /* @__PURE__ */ o(
491
510
  "button",
492
511
  {
493
512
  type: "button",
494
513
  onClick: () => {
495
- Re(t), t.sessionId && (c ? c(t) : d && s(t.sessionId));
514
+ Le(t), t.sessionId && (d ? d(t) : c && r(t.sessionId));
496
515
  },
497
- className: P(
516
+ className: _(
498
517
  "flex w-full items-start gap-2.5 py-2.5 pl-2.5 text-left transition-colors hover:bg-foreground/[0.02]",
499
518
  n ? "pr-[4.75rem]" : "pr-3.5"
500
519
  ),
501
520
  children: [
502
- /* @__PURE__ */ r(
521
+ /* @__PURE__ */ s(
503
522
  "span",
504
523
  {
505
- className: P(
524
+ className: _(
506
525
  "mt-3 size-1.5 shrink-0 rounded-full",
507
526
  a && "bg-primary"
508
527
  ),
509
528
  title: a ? "Unread" : void 0
510
529
  }
511
530
  ),
512
- /* @__PURE__ */ l("span", { className: "relative mt-0.5 shrink-0", children: [
513
- /* @__PURE__ */ r(
531
+ /* @__PURE__ */ o("span", { className: "relative mt-0.5 shrink-0", children: [
532
+ /* @__PURE__ */ s(
514
533
  "img",
515
534
  {
516
535
  src: Ue(t.agent),
@@ -518,7 +537,7 @@ function mt({
518
537
  className: "size-7 rounded-full border border-border bg-background p-1"
519
538
  }
520
539
  ),
521
- d ? /* @__PURE__ */ r(
540
+ c ? /* @__PURE__ */ s(
522
541
  "span",
523
542
  {
524
543
  title: "Session is active",
@@ -526,27 +545,30 @@ function mt({
526
545
  }
527
546
  ) : null
528
547
  ] }),
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: [
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: [
533
552
  "· ",
534
553
  t.project
535
554
  ] }) : null,
536
- /* @__PURE__ */ r("span", { className: "ml-auto shrink-0 tabular-nums", children: J(t.ts) })
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
+ ] })
537
559
  ] }),
538
- /* @__PURE__ */ r("h3", { className: "mt-0.5 line-clamp-2 text-[13.5px] font-semibold leading-snug tracking-[-0.01em]", children: t.title }),
560
+ /* @__PURE__ */ s("h3", { className: "mt-0.5 line-clamp-2 text-[13.5px] font-semibold leading-snug tracking-[-0.01em]", children: t.title }),
539
561
  t.summary ? (
540
562
  // Plain text, two lines. Rendering markdown for a body
541
563
  // that is clamped to two lines cost a whole markdown
542
564
  // tree per row for text nobody can see.
543
- /* @__PURE__ */ r("p", { className: "mt-0.5 line-clamp-2 text-[12.5px] leading-relaxed text-muted-foreground", children: He(t.summary) })
565
+ /* @__PURE__ */ s("p", { className: "mt-0.5 line-clamp-2 text-[12.5px] leading-relaxed text-muted-foreground", children: He(t.summary) })
544
566
  ) : null
545
567
  ] })
546
568
  ]
547
569
  }
548
570
  ),
549
- n ? /* @__PURE__ */ r("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ r(
571
+ n ? /* @__PURE__ */ s("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ s(
550
572
  it,
551
573
  {
552
574
  items: t.mediaItems,
@@ -557,19 +579,19 @@ function mt({
557
579
  ] }, t.id);
558
580
  }) })
559
581
  ] }, e.label)),
560
- u !== null && u.length < Y ? /* @__PURE__ */ r(
582
+ u !== null && u.length < Y ? /* @__PURE__ */ s(
561
583
  "button",
562
584
  {
563
585
  type: "button",
564
- onClick: () => void De(),
565
- disabled: G,
586
+ onClick: () => void $e(),
587
+ disabled: B,
566
588
  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",
567
- children: G ? "Loading…" : `Load more · ${Y - u.length} left`
589
+ children: B ? "Loading…" : `Load more · ${Y - u.length} left`
568
590
  }
569
591
  ) : null
570
592
  ] })
571
593
  ] });
572
594
  }
573
595
  export {
574
- mt as default
596
+ ht as default
575
597
  };