@omg-dev/app 0.1.377 → 0.1.379

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,4 +1,4 @@
1
- import { R as c, L as f, A as d } from "./streamdown-response-HE4VOBkx.js";
1
+ import { R as c, L as f, A as d } from "./streamdown-response-BqrzLg61.js";
2
2
  import { useContext as p, useState as L, useEffect as N } from "react";
3
3
  import { jsx as x } from "react/jsx-runtime";
4
4
  var A = ({ code: s, language: e, raw: a, className: o, startLine: m, lineNumbers: u, ...g }) => {
@@ -1,4 +1,4 @@
1
- import { w as T, s as U, h as X, c as Y, v as G, S as J, o as k, l as Q, f as M, m as y } from "./streamdown-response-HE4VOBkx.js";
1
+ import { w as T, s as U, h as X, c as Y, v as G, S as J, o as k, l as Q, f as M, m as y } from "./streamdown-response-BqrzLg61.js";
2
2
  import v from "./katex-jHfnQmlp.js";
3
3
  function Z(t, e) {
4
4
  return B(t, {}) || { type: "root", children: [] };
package/dist-lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { ae as p, af as m, ag as o } from "./embedded-BL7wkAd7.js";
3
+ import "@tanstack/react-router";
4
+ import { ac as m, ad as o, ae as s } from "./embedded-DU9yLcqm.js";
4
5
  export {
5
- p as OmgAppSurface,
6
- m as OmgSettingsSurface,
7
- o as createGrantTransport
6
+ m as OmgAppSurface,
7
+ o as OmgSettingsSurface,
8
+ s as createGrantTransport
8
9
  };
@@ -0,0 +1,4 @@
1
+ import { p } from "./streamdown-response-BqrzLg61.js";
2
+ export {
3
+ p as Mermaid
4
+ };
@@ -1,7 +1,8 @@
1
1
  import { jsx as t, jsxs as s, Fragment as N } from "react/jsx-runtime";
2
- import { r as H, n as Q, a as re, o as le, p as oe, q as ie, X, A, f as u, R as B, s as ce, u as de, v as J, T as ue, w as me, x as he, y as pe, L as fe } from "./embedded-BL7wkAd7.js";
2
+ import { r as H, m as Q, a as re, n as le, o as oe, p as ie, X, A, R as B, q as ce, s as de, u as J, T as ue, v as me, w as he, x as pe, L as fe } from "./embedded-DU9yLcqm.js";
3
+ import { cn as u } from "cnfast";
3
4
  import { useState as a, useRef as L, useEffect as v, useCallback as ge } from "react";
4
- function we({
5
+ function ye({
5
6
  initial: m,
6
7
  scopedProject: w,
7
8
  onRestore: K,
@@ -312,5 +313,5 @@ function we({
312
313
  );
313
314
  }
314
315
  export {
315
- we as default
316
+ ye as default
316
317
  };
@@ -1,6 +1,9 @@
1
1
  import { jsx as s, jsxs as n, Fragment as $ } from "react/jsx-runtime";
2
- import { a as C, D as T, b as M, c as D, d as S, G as F, e as L, t as R, L as j, f as z } from "./embedded-BL7wkAd7.js";
3
- import { useState as g, useCallback as P, useEffect as U } from "react";
2
+ import { a as C, D as T, b as M, c as D, d as S, G as F, e as L, t as R, L as j } from "./embedded-DU9yLcqm.js";
3
+ import "@base-ui/react/collapsible";
4
+ import { cn as z } from "cnfast";
5
+ import { useState as p, useCallback as P, useEffect as U } from "react";
6
+ import "@base-ui/react/input";
4
7
  function u({
5
8
  title: r,
6
9
  items: d
@@ -19,21 +22,21 @@ function u({
19
22
  function c(r) {
20
23
  return r == null || !Number.isFinite(r) ? "—" : r < 1e3 ? Math.round(r).toLocaleString() : r < 1e6 ? `${(r / 1e3).toFixed(r < 1e4 ? 1 : 0)}k` : `${(r / 1e6).toFixed(r < 1e7 ? 1 : 0)}m`;
21
24
  }
22
- function G({
25
+ function H({
23
26
  session: r,
24
27
  open: d,
25
28
  onOpenChange: l
26
29
  }) {
27
30
  var k;
28
- const m = r.sessionId, [e, v] = g(null), [x, p] = g(!1), [b, N] = g(null), h = P(async () => {
31
+ const m = r.sessionId, [e, v] = p(null), [x, g] = p(!1), [b, N] = p(null), h = P(async () => {
29
32
  if (m) {
30
- p(!0), N(null);
33
+ g(!0), N(null);
31
34
  try {
32
35
  v(await C(`/api/sessions/${m}/token-usage`));
33
36
  } catch (t) {
34
37
  N(t instanceof Error ? t.message : "Couldn’t load token usage");
35
38
  } finally {
36
- p(!1);
39
+ g(!1);
37
40
  }
38
41
  }
39
42
  }, [m]);
@@ -232,5 +235,5 @@ function G({
232
235
  );
233
236
  }
234
237
  export {
235
- G as default
238
+ H as default
236
239
  };
@@ -1,6 +1,7 @@
1
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 ze } from "react";
3
- import { z as ve, O as he, Q as Te, U as S, V as ge, W as Se, Y as Pe, Z as je, B as Fe, L as pe, v as J, y as Ye, R as Ge, f as P, T as Be, _ as Ke, k as be, g as Ue, $ as He, a as L, a0 as k, a1 as R, l as _, a2 as W, a3 as Ve, a4 as qe, a5 as Qe, a6 as Xe, P as Je, a7 as We } from "./embedded-BL7wkAd7.js";
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-DU9yLcqm.js";
4
+ import { cn as P } from "cnfast";
4
5
  /**
5
6
  * @license lucide-react v0.577.0 - ISC
6
7
  *
@@ -58,7 +59,7 @@ function j(s) {
58
59
  function Z(s, i) {
59
60
  return s ? i.ts > s.through && !s.ids.includes(i.id) : !1;
60
61
  }
61
- function at(s, i) {
62
+ function nt(s, i) {
62
63
  const c = M(s) ?? { through: 0, ids: [] };
63
64
  return c.ids.includes(i) ? c : Ne(s, {
64
65
  ...c,
@@ -72,7 +73,7 @@ function xe(s, i) {
72
73
  ids: c.ids
73
74
  });
74
75
  }
75
- function nt({
76
+ function at({
76
77
  path: s,
77
78
  cacheKey: i,
78
79
  children: c
@@ -142,7 +143,7 @@ function lt(s, i) {
142
143
  ...m.getFullYear() === new Date(i).getFullYear() ? {} : { year: "numeric" }
143
144
  });
144
145
  }
145
- function ut({
146
+ function mt({
146
147
  onOpenSession: s,
147
148
  onOpenArtifactSession: i,
148
149
  onReviewSession: c,
@@ -153,11 +154,11 @@ function ut({
153
154
  }) {
154
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(
155
156
  () => p ? null : M(m)
156
- ), [B, re] = f(!1), [K, se] = f(null), { questions: y, busy: we, dismissAll: ke } = Te(), [U, $] = f(!1);
157
+ ), [B, re] = f(!1), [K, se] = f(null), { questions: y, busy: we, dismissAll: ke } = ze(), [U, $] = f(!1);
157
158
  w(() => {
158
159
  $(!1);
159
160
  }, [y.length]);
160
- const [N, E] = f(() => (b == null ? void 0 : b.items) ?? null), [C, H] = f(() => (b == null ? void 0 : b.total) ?? 0), [V, ae] = f(!1), [ne, 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();
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();
161
162
  w(() => {
162
163
  h === "feed" && I(M(m));
163
164
  }, [m, h]), w(() => {
@@ -175,18 +176,18 @@ function ut({
175
176
  let e = !0;
176
177
  const t = async () => {
177
178
  try {
178
- const n = await L(
179
+ const a = await L(
179
180
  `/api/artifacts?limit=${S}${de}`,
180
181
  { cache: "no-store" }
181
182
  );
182
183
  if (!e) return;
183
- const a = Array.isArray(n.artifacts) ? n.artifacts : [], g = n.total ?? a.length;
184
- E((z) => {
185
- const T = new Set(a.map((X) => X.id)), Me = (z ?? []).filter((X) => !T.has(X.id)), Q = [...a, ...Me];
184
+ 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];
186
187
  return D.current = Math.max(S, Q.length), k(R, Q, g), Q;
187
188
  }), H(g);
188
189
  } catch {
189
- e && E((n) => n ?? []);
190
+ e && E((a) => a ?? []);
190
191
  }
191
192
  };
192
193
  if (t(), !v)
@@ -200,19 +201,19 @@ function ut({
200
201
  }, [h, v]);
201
202
  const Ie = async () => {
202
203
  if (!V) {
203
- ae(!0);
204
+ ne(!0);
204
205
  try {
205
206
  const e = await L(
206
207
  `/api/artifacts?limit=${S}&offset=${D.current}${de}`,
207
208
  { cache: "no-store" }
208
209
  );
209
210
  E((t) => {
210
- const d = new Set((t ?? []).map((a) => a.id)), n = [...t ?? [], ...e.artifacts.filter((a) => !d.has(a.id))];
211
- return D.current = n.length, k(R, n, e.total ?? C), n;
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;
212
213
  }), H((t) => e.total ?? t);
213
214
  } catch {
214
215
  } finally {
215
- ae(!1);
216
+ ne(!1);
216
217
  }
217
218
  }
218
219
  }, Ee = async (e) => {
@@ -231,12 +232,12 @@ function ut({
231
232
  method: "DELETE",
232
233
  headers: { "X-LFG-Session-ID": e.sessionId ?? "" }
233
234
  }
234
- ), E((n) => {
235
- const a = (n == null ? void 0 : n.filter((g) => g.id !== e.id)) ?? null;
236
- return a && k(R, a, Math.max(0, C - 1)), a;
237
- }), H((n) => Math.max(0, n - 1)), D.current = Math.max(0, D.current - 1), _.success("Artifact deleted");
238
- } catch (n) {
239
- _.error(n instanceof Error ? n.message : "Couldn't delete artifact");
235
+ ), E((a) => {
236
+ 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");
239
+ } catch (a) {
240
+ _.error(a instanceof Error ? a.message : "Couldn't delete artifact");
240
241
  } finally {
241
242
  oe(null);
242
243
  }
@@ -253,19 +254,19 @@ function ut({
253
254
  }
254
255
  );
255
256
  E((d) => {
256
- const n = (d == null ? void 0 : d.map((a) => {
257
- var g, z, T;
258
- return a.id === e.id ? {
259
- ...a,
260
- ts: t.artifact.updatedAt ?? a.ts,
261
- version: t.artifact.version ?? a.version,
262
- size: t.artifact.size ?? a.size,
263
- lastRefreshedAt: ((g = t.artifact.refresh) == null ? void 0 : g.lastSuccessAt) ?? a.lastRefreshedAt,
264
- refreshStatus: ((z = t.artifact.refresh) == null ? void 0 : z.status) ?? a.refreshStatus,
265
- refreshEnabled: ((T = t.artifact.refresh) == null ? void 0 : T.enabled) ?? a.refreshEnabled
266
- } : a;
257
+ const a = (d == null ? void 0 : d.map((n) => {
258
+ var g, T, z;
259
+ return n.id === e.id ? {
260
+ ...n,
261
+ ts: t.artifact.updatedAt ?? n.ts,
262
+ version: t.artifact.version ?? n.version,
263
+ size: t.artifact.size ?? n.size,
264
+ 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
267
+ } : n;
267
268
  })) ?? null;
268
- return n && k(R, n, C), n;
269
+ return a && k(R, a, C), a;
269
270
  }), _.success("Artifact refreshed");
270
271
  } catch (t) {
271
272
  _.error(t instanceof Error ? t.message : "Couldn't refresh artifact");
@@ -282,8 +283,8 @@ function ut({
282
283
  return;
283
284
  }
284
285
  F((t) => {
285
- const d = new Set(e.posts.map((g) => g.id)), n = (t ?? []).filter((g) => !d.has(g.id)), a = [...e.posts, ...n];
286
- return q.current = Math.max(We, a.length), k(W, a, e.total), a;
286
+ const d = new Set(e.posts.map((g) => g.id)), a = (t ?? []).filter((g) => !d.has(g.id)), n = [...e.posts, ...a];
287
+ return q.current = Math.max(We, n.length), k(W, n, e.total), n;
287
288
  }), ee(e.total), se(null);
288
289
  });
289
290
  }, [h, v]);
@@ -296,8 +297,8 @@ function ut({
296
297
  { cache: "no-store" }
297
298
  );
298
299
  F((t) => {
299
- const d = new Set((t ?? []).map((a) => a.id)), n = [...t ?? [], ...e.posts.filter((a) => !d.has(a.id))];
300
- return q.current = n.length, k(W, n, e.total ?? Y), n;
300
+ const d = new Set((t ?? []).map((n) => n.id)), a = [...t ?? [], ...e.posts.filter((n) => !d.has(n.id))];
301
+ return q.current = a.length, k(W, a, e.total ?? Y), a;
301
302
  }), ee((t) => e.total ?? t);
302
303
  } catch {
303
304
  } finally {
@@ -309,12 +310,12 @@ function ut({
309
310
  id: j(e),
310
311
  ts: e.ts
311
312
  })
312
- ).length) ?? 0, Le = ze(() => {
313
+ ).length) ?? 0, Le = Te(() => {
313
314
  if (!(u != null && u.length)) return [];
314
315
  const e = Date.now(), t = [];
315
316
  for (const d of u) {
316
- const n = lt(d.ts, e), a = t[t.length - 1];
317
- a && a.label === n ? a.items.push(d) : t.push({ label: n, items: [d] });
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] });
318
319
  }
319
320
  return t;
320
321
  }, [u]), Re = (e) => {
@@ -322,7 +323,7 @@ function ut({
322
323
  id: j(e),
323
324
  ts: e.ts
324
325
  }) && I(
325
- at(m, j(e))
326
+ nt(m, j(e))
326
327
  );
327
328
  }, _e = async () => {
328
329
  if (!B) {
@@ -383,7 +384,7 @@ function ut({
383
384
  }),
384
385
  className: "block w-full text-left active:scale-[0.99]",
385
386
  children: [
386
- /* @__PURE__ */ r(nt, { 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: [
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: [
387
388
  /* @__PURE__ */ r("span", { className: "size-1.5 rounded-full bg-emerald-500" }),
388
389
  "live · v",
389
390
  e.version
@@ -416,10 +417,10 @@ function ut({
416
417
  {
417
418
  type: "button",
418
419
  onClick: () => void Ce(e),
419
- disabled: ne === e.id,
420
+ disabled: ae === e.id,
420
421
  "aria-label": `Refresh ${e.title || e.caption || e.name}`,
421
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",
422
- children: /* @__PURE__ */ r(Ge, { className: P("size-3.5", ne === e.id && "animate-spin") })
423
+ children: /* @__PURE__ */ r(Ge, { className: P("size-3.5", ae === e.id && "animate-spin") })
423
424
  }
424
425
  ) : null,
425
426
  /* @__PURE__ */ r(
@@ -481,10 +482,10 @@ function ut({
481
482
  Le.map((e) => /* @__PURE__ */ l("section", { className: "space-y-1.5", children: [
482
483
  /* @__PURE__ */ r("h2", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: e.label }),
483
484
  /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 shadow-sm", children: e.items.map((t) => {
484
- const d = !!t.sessionId && o.has(t.sessionId), n = Z(A, {
485
+ const d = !!t.sessionId && o.has(t.sessionId), a = Z(A, {
485
486
  id: j(t),
486
487
  ts: t.ts
487
- }), a = t.mediaItems.length > 0;
488
+ }), n = t.mediaItems.length > 0;
488
489
  return /* @__PURE__ */ l("article", { className: "relative border-b border-border/50 last:border-b-0", children: [
489
490
  /* @__PURE__ */ l(
490
491
  "button",
@@ -495,7 +496,7 @@ function ut({
495
496
  },
496
497
  className: P(
497
498
  "flex w-full items-start gap-2.5 py-2.5 pl-2.5 text-left transition-colors hover:bg-foreground/[0.02]",
498
- a ? "pr-[4.75rem]" : "pr-3.5"
499
+ n ? "pr-[4.75rem]" : "pr-3.5"
499
500
  ),
500
501
  children: [
501
502
  /* @__PURE__ */ r(
@@ -503,9 +504,9 @@ function ut({
503
504
  {
504
505
  className: P(
505
506
  "mt-3 size-1.5 shrink-0 rounded-full",
506
- n && "bg-primary"
507
+ a && "bg-primary"
507
508
  ),
508
- title: n ? "Unread" : void 0
509
+ title: a ? "Unread" : void 0
509
510
  }
510
511
  ),
511
512
  /* @__PURE__ */ l("span", { className: "relative mt-0.5 shrink-0", children: [
@@ -545,7 +546,7 @@ function ut({
545
546
  ]
546
547
  }
547
548
  ),
548
- a ? /* @__PURE__ */ r("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ r(
549
+ n ? /* @__PURE__ */ r("div", { className: "absolute right-3.5 top-2.5", children: /* @__PURE__ */ r(
549
550
  it,
550
551
  {
551
552
  items: t.mediaItems,
@@ -570,5 +571,5 @@ function ut({
570
571
  ] });
571
572
  }
572
573
  export {
573
- ut as default
574
+ mt as default
574
575
  };