@omg-dev/app 0.1.320 → 0.1.322

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
1
  import { jsx as ao } from "react/jsx-runtime";
2
2
  import { useRef as Dt, useCallback as Lt, useSyncExternalStore as ut, useEffect as so } from "react";
3
3
  import { g as io } from "./_commonjsHelpers-C6fGbg64.js";
4
- import { ah as uo } from "./embedded-DdwkOHs-.js";
4
+ import { ac as uo } from "./embedded-DT1Dv8oy.js";
5
5
  var Ar = "vercel.ai.error", co = Symbol.for(Ar), Ut, Ft, se = class Nr extends (Ft = Error, Ut = co, Ft) {
6
6
  /**
7
7
  * Creates an AI SDK Error.
@@ -0,0 +1,287 @@
1
+ import { jsxs as t, jsx as e, Fragment as G } from "react/jsx-runtime";
2
+ import { R as K, f as L, B as d, L as C, P as z, S as w, g as R, h as p, T, i as m, j as F, k as M, l as $, C as _, m as q, X as H, K as U } from "./embedded-DT1Dv8oy.js";
3
+ import { useState as S } from "react";
4
+ function j(l) {
5
+ const i = l.filter((r) => !r.ok);
6
+ return i.length ? i.length === 1 ? `${i[0].label} missing` : `${i.length} checks failing` : null;
7
+ }
8
+ function A({ checks: l }) {
9
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: l.map((i) => /* @__PURE__ */ t(
10
+ "div",
11
+ {
12
+ className: "flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",
13
+ children: [
14
+ i.ok ? /* @__PURE__ */ e(q, { className: "size-3.5 shrink-0 text-success" }) : /* @__PURE__ */ e(H, { className: "size-3.5 shrink-0 text-destructive" }),
15
+ /* @__PURE__ */ e("span", { className: "shrink-0", children: i.label }),
16
+ i.detail ? /* @__PURE__ */ e("span", { className: "min-w-0 truncate text-muted-foreground/70", children: i.detail }) : null
17
+ ]
18
+ },
19
+ i.label
20
+ )) });
21
+ }
22
+ function I({
23
+ icon: l,
24
+ title: i,
25
+ note: r,
26
+ ok: u,
27
+ control: o,
28
+ open: c,
29
+ onToggle: h,
30
+ children: f
31
+ }) {
32
+ return /* @__PURE__ */ t("div", { className: "px-4 py-2.5", children: [
33
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
34
+ /* @__PURE__ */ t(
35
+ "button",
36
+ {
37
+ type: "button",
38
+ onClick: h,
39
+ "aria-expanded": c,
40
+ className: "flex min-w-0 flex-1 items-center gap-3 text-left",
41
+ children: [
42
+ /* @__PURE__ */ e("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-[8px] border border-border bg-background", children: l }),
43
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
44
+ /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
45
+ /* @__PURE__ */ e("span", { className: "truncate text-sm font-medium", children: i }),
46
+ u ? null : /* @__PURE__ */ e("span", { className: "size-1.5 shrink-0 rounded-full bg-destructive", "aria-hidden": !0 })
47
+ ] }),
48
+ r ? /* @__PURE__ */ e("span", { className: "block truncate text-xs text-muted-foreground", children: r }) : null
49
+ ] }),
50
+ /* @__PURE__ */ e(
51
+ _,
52
+ {
53
+ className: L(
54
+ "size-4 shrink-0 text-muted-foreground/60 transition-transform duration-150",
55
+ c && "rotate-180"
56
+ )
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ ),
62
+ o
63
+ ] }),
64
+ c ? /* @__PURE__ */ e("div", { className: "mt-3 space-y-3 pl-11", children: f }) : null
65
+ ] });
66
+ }
67
+ function W({
68
+ provider: l,
69
+ onConnect: i,
70
+ onDisconnect: r
71
+ }) {
72
+ return /* @__PURE__ */ t("div", { className: "flex items-center gap-2 rounded-xl border border-border/70 bg-background/55 px-2.5 py-2", children: [
73
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
74
+ /* @__PURE__ */ e("span", { className: "block truncate text-xs font-medium", children: l.label }),
75
+ l.fromEnv ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-muted-foreground", children: "From the environment" }) : null
76
+ ] }),
77
+ l.connected ? /* @__PURE__ */ t(G, { children: [
78
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-success", children: "Connected" }),
79
+ l.fromEnv ? null : /* @__PURE__ */ e(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ onClick: () => r(l),
84
+ title: `Disconnect ${l.label}`,
85
+ "aria-label": `Disconnect ${l.label}`,
86
+ className: "flex size-7 items-center justify-center rounded-full text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
87
+ children: /* @__PURE__ */ e(T, { className: "size-3.5" })
88
+ }
89
+ )
90
+ ] }) : /* @__PURE__ */ t(d, { size: "sm", variant: "outline", onClick: () => i(l), children: [
91
+ l.method === "oauth" ? /* @__PURE__ */ e(p, { className: "size-3.5" }) : /* @__PURE__ */ e(U, { className: "size-3.5" }),
92
+ "Connect"
93
+ ] })
94
+ ] });
95
+ }
96
+ function V({
97
+ setupChecks: l,
98
+ agents: i,
99
+ onVisibleChange: r,
100
+ onSetup: u,
101
+ onLogin: o,
102
+ onAddClaudeAccount: c,
103
+ onRemoveClaudeAccount: h,
104
+ onConnectPiProvider: f,
105
+ onDisconnectPiProvider: E,
106
+ onSetupCheck: D,
107
+ onRefresh: P
108
+ }) {
109
+ const [x, g] = S(!1), [N, O] = S(null), k = (n) => O((s) => s === n ? null : n);
110
+ async function B() {
111
+ if (!x) {
112
+ g(!0);
113
+ try {
114
+ await P(), $.success("Coding agents refreshed");
115
+ } catch (n) {
116
+ $.error(n instanceof Error ? n.message : "Could not refresh coding agents");
117
+ } finally {
118
+ g(!1);
119
+ }
120
+ }
121
+ }
122
+ return /* @__PURE__ */ t("div", { className: "mx-auto max-w-xl space-y-3 pb-10", "data-lfg-page-column": !0, children: [
123
+ /* @__PURE__ */ t("div", { className: "flex items-center justify-between px-4", children: [
124
+ /* @__PURE__ */ e("h2", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: "Coding agents" }),
125
+ /* @__PURE__ */ t(
126
+ "button",
127
+ {
128
+ type: "button",
129
+ onClick: () => void B(),
130
+ disabled: x,
131
+ className: "flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",
132
+ children: [
133
+ /* @__PURE__ */ e(K, { className: L("size-3.5", x && "animate-spin") }),
134
+ "Refresh"
135
+ ]
136
+ }
137
+ )
138
+ ] }),
139
+ l.length ? /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 divide-y divide-border", children: l.map((n) => /* @__PURE__ */ t(
140
+ I,
141
+ {
142
+ icon: /* @__PURE__ */ e(w, { className: "size-4 text-muted-foreground" }),
143
+ title: n.label,
144
+ note: j(n.checks),
145
+ ok: n.configured,
146
+ open: N === `setup:${n.key}`,
147
+ onToggle: () => k(`setup:${n.key}`),
148
+ children: [
149
+ /* @__PURE__ */ e(A, { checks: n.checks }),
150
+ n.instructions.map((s) => /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s }, s)),
151
+ /* @__PURE__ */ t(
152
+ d,
153
+ {
154
+ size: "sm",
155
+ variant: "outline",
156
+ disabled: !n.canAutoSetup || n.running,
157
+ onClick: () => D(n.key),
158
+ title: n.canAutoSetup ? n.actionLabel : "Install a supported coding agent first",
159
+ children: [
160
+ n.running ? /* @__PURE__ */ e(C, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(z, { className: "size-4" }),
161
+ n.running ? "Running…" : n.actionLabel
162
+ ]
163
+ }
164
+ )
165
+ ]
166
+ },
167
+ n.key
168
+ )) }) : null,
169
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 divide-y divide-border", children: i.map((n) => {
170
+ const s = n.status, b = n.key === "aisdk" ? s.accounts ?? [] : [], y = s.providers ?? [], v = b.some((a) => a.connected);
171
+ return /* @__PURE__ */ t(
172
+ I,
173
+ {
174
+ icon: /* @__PURE__ */ e("img", { src: R(n.key), alt: M(n.key), className: "size-5" }),
175
+ title: n.label,
176
+ note: j(s.checks),
177
+ ok: s.configured,
178
+ open: N === `agent:${n.key}`,
179
+ onToggle: () => k(`agent:${n.key}`),
180
+ control: /* @__PURE__ */ e(
181
+ F,
182
+ {
183
+ checked: n.visible,
184
+ onCheckedChange: (a) => r(n.key, a),
185
+ "aria-label": `${n.label} visible in composer`
186
+ }
187
+ ),
188
+ children: [
189
+ /* @__PURE__ */ e(A, { checks: s.checks }),
190
+ b.length ? /* @__PURE__ */ e("div", { className: "space-y-1.5", children: b.map((a) => /* @__PURE__ */ t(
191
+ "div",
192
+ {
193
+ className: "flex items-center gap-2 rounded-xl border border-border/70 bg-background/55 px-2.5 py-2",
194
+ children: [
195
+ /* @__PURE__ */ t("span", { className: "relative flex size-7 shrink-0 items-center justify-center rounded-full bg-muted", children: [
196
+ /* @__PURE__ */ e("img", { src: R("aisdk"), alt: "", className: "size-4.5" }),
197
+ /* @__PURE__ */ e("span", { className: "absolute -bottom-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-foreground text-[8px] font-bold text-background ring-1 ring-background", children: a.number })
198
+ ] }),
199
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-xs font-medium", children: a.label }),
200
+ a.connected ? /* @__PURE__ */ e("span", { className: "text-[11px] text-success", children: "Connected" }) : /* @__PURE__ */ t(
201
+ d,
202
+ {
203
+ size: "sm",
204
+ variant: "outline",
205
+ onClick: () => o(n.key, a.id),
206
+ children: [
207
+ /* @__PURE__ */ e(p, { className: "size-3.5" }),
208
+ "Connect"
209
+ ]
210
+ }
211
+ ),
212
+ a.removable ? /* @__PURE__ */ e(
213
+ "button",
214
+ {
215
+ type: "button",
216
+ onClick: () => h(a),
217
+ title: `Remove ${a.label}`,
218
+ "aria-label": `Remove ${a.label}`,
219
+ className: "flex size-7 items-center justify-center rounded-full text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
220
+ children: /* @__PURE__ */ e(T, { className: "size-3.5" })
221
+ }
222
+ ) : null
223
+ ]
224
+ },
225
+ a.id
226
+ )) }) : null,
227
+ y.length ? /* @__PURE__ */ e("div", { className: "space-y-1.5", children: y.map((a) => /* @__PURE__ */ e(
228
+ W,
229
+ {
230
+ provider: a,
231
+ onConnect: f,
232
+ onDisconnect: E
233
+ },
234
+ a.id
235
+ )) }) : null,
236
+ s.instructions.map((a) => /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a }, a)),
237
+ !s.configured && (s.installCommand || s.loginCommand && !m.has(n.key)) ? /* @__PURE__ */ t("div", { className: "space-y-1 text-xs text-muted-foreground", children: [
238
+ s.installCommand ? /* @__PURE__ */ t("div", { className: "truncate", children: [
239
+ "Install: ",
240
+ /* @__PURE__ */ e("code", { children: s.installCommand })
241
+ ] }) : null,
242
+ s.loginCommand && !m.has(n.key) ? /* @__PURE__ */ t("div", { className: "truncate", children: [
243
+ "Login: ",
244
+ /* @__PURE__ */ e("code", { children: s.loginCommand })
245
+ ] }) : null
246
+ ] }) : null,
247
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
248
+ s.canAutoSetup ? /* @__PURE__ */ t(
249
+ d,
250
+ {
251
+ size: "sm",
252
+ variant: "outline",
253
+ disabled: s.setupRunning,
254
+ onClick: () => u(n.key),
255
+ title: "Run setup for this agent",
256
+ children: [
257
+ s.setupRunning ? /* @__PURE__ */ e(C, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(z, { className: "size-4" }),
258
+ s.setupRunning ? "Running…" : "Install"
259
+ ]
260
+ }
261
+ ) : null,
262
+ s.canLoginInTerminal ? /* @__PURE__ */ t(
263
+ d,
264
+ {
265
+ size: "sm",
266
+ variant: "outline",
267
+ disabled: s.setupRunning,
268
+ onClick: () => n.key === "aisdk" && v ? c() : o(n.key),
269
+ title: m.has(n.key) ? `Sign in to ${n.label} in your browser` : `Open terminal and run ${s.loginCommand}`,
270
+ children: [
271
+ m.has(n.key) ? /* @__PURE__ */ e(p, { className: "size-4" }) : /* @__PURE__ */ e(w, { className: "size-4" }),
272
+ n.key === "aisdk" && v ? "Add account" : "Login"
273
+ ]
274
+ }
275
+ ) : null,
276
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-muted-foreground/70", children: s.omgCapabilityAccess === "mcp" ? "OMG tools" : "OMG prompt only" })
277
+ ] })
278
+ ]
279
+ },
280
+ n.key
281
+ );
282
+ }) })
283
+ ] });
284
+ }
285
+ export {
286
+ V as default
287
+ };