@omg-dev/app 0.2.20 → 0.2.23
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.
- package/dist-lib/{ChangelogPage-BohAg8Um.js → ChangelogPage-CeCtrXuD.js} +84 -1
- package/dist-lib/{SessionFilesPanel-DktXrSTs.js → SessionFilesPanel-Ck0KNzua.js} +1 -1
- package/dist-lib/{TermView-rm8onW7t.js → TermView-D2F19OhV.js} +1 -1
- package/dist-lib/{chat-engine-Cx-Cq2vI.js → chat-engine-Bo21-04D.js} +1 -1
- package/dist-lib/coding-agents-page-Bfy-IdbL.js +329 -0
- package/dist-lib/{embedded-fYVkvd7A.js → embedded-pRKgmVAd.js} +11564 -11524
- package/dist-lib/{highlighted-body-OFNGDK62-BoAuuZR4.js → highlighted-body-OFNGDK62-XrUZDzoE.js} +1 -1
- package/dist-lib/{index-BnJITiuM.js → index-CdRi0Fvj.js} +1 -1
- package/dist-lib/index.js +1 -1
- package/dist-lib/mermaid-GHXKKRXX-CPr0wWN7.js +4 -0
- package/dist-lib/resume-session-sheet-9na3HKD2.js +347 -0
- package/dist-lib/{session-token-usage-C_WDz8xn.js → session-token-usage-Buv6ihdg.js} +1 -1
- package/dist-lib/{shipped-page-B7XoI1In.js → shipped-page-DRgFmUbI.js} +13 -13
- package/dist-lib/{streamdown-response-gONFDL8V.js → streamdown-response-k_s41jX5.js} +4 -4
- package/dist-lib/styles.css +1 -1
- package/package.json +2 -2
- package/dist-lib/coding-agents-page-DGsPxBfZ.js +0 -288
- package/dist-lib/mermaid-GHXKKRXX-Du3eD6Dj.js +0 -4
- package/dist-lib/resume-session-sheet-Drb_ZIBL.js +0 -317
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omg-dev/app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "The full OMG application surface for React hosts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://omg.dev",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@omg-dev/client": "0.2.
|
|
27
|
+
"@omg-dev/client": "0.2.23",
|
|
28
28
|
"@ai-sdk/react": "^4.0.19",
|
|
29
29
|
"@base-ui/react": "^1.6.0",
|
|
30
30
|
"@number-flow/react": "^0.6.2",
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
2
|
-
import { R as F, B as d, L as z, P as w, S as R, f as $, g, T, h as m, i as M, j as _, k as S, C as q, l as H, X as U, K as W } from "./embedded-fYVkvd7A.js";
|
|
3
|
-
import { cn as E } from "cnfast";
|
|
4
|
-
import { useState as A } from "react";
|
|
5
|
-
function j(a) {
|
|
6
|
-
const i = a.filter((r) => !r.ok);
|
|
7
|
-
return i.length ? i.length === 1 ? `${i[0].label} missing` : `${i.length} checks failing` : null;
|
|
8
|
-
}
|
|
9
|
-
function I({ checks: a }) {
|
|
10
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children: a.map((i) => /* @__PURE__ */ t(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
className: "flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",
|
|
14
|
-
children: [
|
|
15
|
-
i.ok ? /* @__PURE__ */ e(H, { className: "size-3.5 shrink-0 text-success" }) : /* @__PURE__ */ e(U, { className: "size-3.5 shrink-0 text-destructive" }),
|
|
16
|
-
/* @__PURE__ */ e("span", { className: "shrink-0", children: i.label }),
|
|
17
|
-
i.detail ? /* @__PURE__ */ e("span", { className: "min-w-0 truncate text-muted-foreground/70", children: i.detail }) : null
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
i.label
|
|
21
|
-
)) });
|
|
22
|
-
}
|
|
23
|
-
function L({
|
|
24
|
-
icon: a,
|
|
25
|
-
title: i,
|
|
26
|
-
note: r,
|
|
27
|
-
ok: u,
|
|
28
|
-
control: o,
|
|
29
|
-
open: c,
|
|
30
|
-
onToggle: h,
|
|
31
|
-
children: f
|
|
32
|
-
}) {
|
|
33
|
-
return /* @__PURE__ */ t("div", { className: "px-4 py-2.5", children: [
|
|
34
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
|
|
35
|
-
/* @__PURE__ */ t(
|
|
36
|
-
"button",
|
|
37
|
-
{
|
|
38
|
-
type: "button",
|
|
39
|
-
onClick: h,
|
|
40
|
-
"aria-expanded": c,
|
|
41
|
-
className: "flex min-w-0 flex-1 items-center gap-3 text-left",
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ e("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-[8px] border border-border bg-background", children: a }),
|
|
44
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
|
|
45
|
-
/* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
|
|
46
|
-
/* @__PURE__ */ e("span", { className: "truncate text-sm font-medium", children: i }),
|
|
47
|
-
u ? null : /* @__PURE__ */ e("span", { className: "size-1.5 shrink-0 rounded-full bg-destructive", "aria-hidden": !0 })
|
|
48
|
-
] }),
|
|
49
|
-
r ? /* @__PURE__ */ e("span", { className: "block truncate text-xs text-muted-foreground", children: r }) : null
|
|
50
|
-
] }),
|
|
51
|
-
/* @__PURE__ */ e(
|
|
52
|
-
q,
|
|
53
|
-
{
|
|
54
|
-
className: E(
|
|
55
|
-
"size-4 shrink-0 text-muted-foreground/60 transition-transform duration-150",
|
|
56
|
-
c && "rotate-180"
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
),
|
|
63
|
-
o
|
|
64
|
-
] }),
|
|
65
|
-
c ? /* @__PURE__ */ e("div", { className: "mt-3 space-y-3 pl-11", children: f }) : null
|
|
66
|
-
] });
|
|
67
|
-
}
|
|
68
|
-
function X({
|
|
69
|
-
provider: a,
|
|
70
|
-
onConnect: i,
|
|
71
|
-
onDisconnect: r
|
|
72
|
-
}) {
|
|
73
|
-
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: [
|
|
74
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: [
|
|
75
|
-
/* @__PURE__ */ e("span", { className: "block truncate text-xs font-medium", children: a.label }),
|
|
76
|
-
a.detail || a.fromEnv ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-muted-foreground", children: a.detail ?? "From the environment" }) : null
|
|
77
|
-
] }),
|
|
78
|
-
a.connected ? /* @__PURE__ */ t(K, { children: [
|
|
79
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-success", children: "Connected" }),
|
|
80
|
-
a.fromEnv ? null : /* @__PURE__ */ e(
|
|
81
|
-
"button",
|
|
82
|
-
{
|
|
83
|
-
type: "button",
|
|
84
|
-
onClick: () => r(a),
|
|
85
|
-
title: `Disconnect ${a.label}`,
|
|
86
|
-
"aria-label": `Disconnect ${a.label}`,
|
|
87
|
-
className: "flex size-7 items-center justify-center rounded-full text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
|
|
88
|
-
children: /* @__PURE__ */ e(T, { className: "size-3.5" })
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
] }) : /* @__PURE__ */ t(d, { size: "sm", variant: "outline", onClick: () => i(a), children: [
|
|
92
|
-
a.method === "oauth" ? /* @__PURE__ */ e(g, { className: "size-3.5" }) : /* @__PURE__ */ e(W, { className: "size-3.5" }),
|
|
93
|
-
"Connect"
|
|
94
|
-
] })
|
|
95
|
-
] });
|
|
96
|
-
}
|
|
97
|
-
function Z({
|
|
98
|
-
setupChecks: a,
|
|
99
|
-
agents: i,
|
|
100
|
-
onVisibleChange: r,
|
|
101
|
-
onSetup: u,
|
|
102
|
-
onLogin: o,
|
|
103
|
-
onAddClaudeAccount: c,
|
|
104
|
-
onRemoveClaudeAccount: h,
|
|
105
|
-
onConnectProvider: f,
|
|
106
|
-
onDisconnectProvider: D,
|
|
107
|
-
onSetupCheck: O,
|
|
108
|
-
onRefresh: P
|
|
109
|
-
}) {
|
|
110
|
-
const [x, k] = A(!1), [N, B] = A(null), y = (n) => B((s) => s === n ? null : n);
|
|
111
|
-
async function G() {
|
|
112
|
-
if (!x) {
|
|
113
|
-
k(!0);
|
|
114
|
-
try {
|
|
115
|
-
await P(), S.success("Coding agents refreshed");
|
|
116
|
-
} catch (n) {
|
|
117
|
-
S.error(n instanceof Error ? n.message : "Could not refresh coding agents");
|
|
118
|
-
} finally {
|
|
119
|
-
k(!1);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return /* @__PURE__ */ t("div", { className: "mx-auto max-w-xl space-y-3 pb-10", "data-lfg-page-column": !0, children: [
|
|
124
|
-
/* @__PURE__ */ t("div", { className: "flex items-center justify-between px-4", children: [
|
|
125
|
-
/* @__PURE__ */ e("h2", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: "Coding agents" }),
|
|
126
|
-
/* @__PURE__ */ t(
|
|
127
|
-
"button",
|
|
128
|
-
{
|
|
129
|
-
type: "button",
|
|
130
|
-
onClick: () => void G(),
|
|
131
|
-
disabled: x,
|
|
132
|
-
className: "flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50",
|
|
133
|
-
children: [
|
|
134
|
-
/* @__PURE__ */ e(F, { className: E("size-3.5", x && "animate-spin") }),
|
|
135
|
-
"Refresh"
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] }),
|
|
140
|
-
a.length ? /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 divide-y divide-border", children: a.map((n) => /* @__PURE__ */ t(
|
|
141
|
-
L,
|
|
142
|
-
{
|
|
143
|
-
icon: /* @__PURE__ */ e(R, { className: "size-4 text-muted-foreground" }),
|
|
144
|
-
title: n.label,
|
|
145
|
-
note: j(n.checks),
|
|
146
|
-
ok: n.configured,
|
|
147
|
-
open: N === `setup:${n.key}`,
|
|
148
|
-
onToggle: () => y(`setup:${n.key}`),
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ e(I, { checks: n.checks }),
|
|
151
|
-
n.instructions.map((s) => /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s }, s)),
|
|
152
|
-
/* @__PURE__ */ t(
|
|
153
|
-
d,
|
|
154
|
-
{
|
|
155
|
-
size: "sm",
|
|
156
|
-
variant: "outline",
|
|
157
|
-
disabled: !n.canAutoSetup || n.running,
|
|
158
|
-
onClick: () => O(n.key),
|
|
159
|
-
title: n.canAutoSetup ? n.actionLabel : "Install a supported coding agent first",
|
|
160
|
-
children: [
|
|
161
|
-
n.running ? /* @__PURE__ */ e(z, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(w, { className: "size-4" }),
|
|
162
|
-
n.running ? "Running…" : n.actionLabel
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
n.key
|
|
169
|
-
)) }) : null,
|
|
170
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-2xl border border-border bg-card/40 divide-y divide-border", children: i.map((n) => {
|
|
171
|
-
const s = n.status, b = n.key === "aisdk" ? s.accounts ?? [] : [], v = s.providers ?? [], C = b.some((l) => l.connected);
|
|
172
|
-
return /* @__PURE__ */ t(
|
|
173
|
-
L,
|
|
174
|
-
{
|
|
175
|
-
icon: /* @__PURE__ */ e("img", { src: $(n.key), alt: _(n.key), className: "size-5" }),
|
|
176
|
-
title: n.label,
|
|
177
|
-
note: j(s.checks),
|
|
178
|
-
ok: s.configured,
|
|
179
|
-
open: N === `agent:${n.key}`,
|
|
180
|
-
onToggle: () => y(`agent:${n.key}`),
|
|
181
|
-
control: /* @__PURE__ */ e(
|
|
182
|
-
M,
|
|
183
|
-
{
|
|
184
|
-
checked: n.visible,
|
|
185
|
-
onCheckedChange: (l) => r(n.key, l),
|
|
186
|
-
"aria-label": `${n.label} visible in composer`
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
children: [
|
|
190
|
-
/* @__PURE__ */ e(I, { checks: s.checks }),
|
|
191
|
-
b.length ? /* @__PURE__ */ e("div", { className: "space-y-1.5", children: b.map((l) => /* @__PURE__ */ t(
|
|
192
|
-
"div",
|
|
193
|
-
{
|
|
194
|
-
className: "flex items-center gap-2 rounded-xl border border-border/70 bg-background/55 px-2.5 py-2",
|
|
195
|
-
children: [
|
|
196
|
-
/* @__PURE__ */ t("span", { className: "relative flex size-7 shrink-0 items-center justify-center rounded-full bg-muted", children: [
|
|
197
|
-
/* @__PURE__ */ e("img", { src: $("aisdk"), alt: "", className: "size-4.5" }),
|
|
198
|
-
/* @__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: l.number })
|
|
199
|
-
] }),
|
|
200
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-xs font-medium", children: l.label }),
|
|
201
|
-
l.connected ? /* @__PURE__ */ e("span", { className: "text-[11px] text-success", children: "Connected" }) : /* @__PURE__ */ t(
|
|
202
|
-
d,
|
|
203
|
-
{
|
|
204
|
-
size: "sm",
|
|
205
|
-
variant: "outline",
|
|
206
|
-
onClick: () => o(n.key, l.id),
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ e(g, { className: "size-3.5" }),
|
|
209
|
-
"Connect"
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
),
|
|
213
|
-
l.removable ? /* @__PURE__ */ e(
|
|
214
|
-
"button",
|
|
215
|
-
{
|
|
216
|
-
type: "button",
|
|
217
|
-
onClick: () => h(l),
|
|
218
|
-
title: `Remove ${l.label}`,
|
|
219
|
-
"aria-label": `Remove ${l.label}`,
|
|
220
|
-
className: "flex size-7 items-center justify-center rounded-full text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
|
|
221
|
-
children: /* @__PURE__ */ e(T, { className: "size-3.5" })
|
|
222
|
-
}
|
|
223
|
-
) : null
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
l.id
|
|
227
|
-
)) }) : null,
|
|
228
|
-
v.length ? /* @__PURE__ */ e("div", { className: "space-y-1.5", children: v.map((l) => /* @__PURE__ */ e(
|
|
229
|
-
X,
|
|
230
|
-
{
|
|
231
|
-
provider: l,
|
|
232
|
-
onConnect: (p) => f(n.key, p),
|
|
233
|
-
onDisconnect: (p) => D(n.key, p)
|
|
234
|
-
},
|
|
235
|
-
l.id
|
|
236
|
-
)) }) : null,
|
|
237
|
-
s.instructions.map((l) => /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: l }, l)),
|
|
238
|
-
!s.configured && (s.installCommand || s.loginCommand && !m.has(n.key)) ? /* @__PURE__ */ t("div", { className: "space-y-1 text-xs text-muted-foreground", children: [
|
|
239
|
-
s.installCommand ? /* @__PURE__ */ t("div", { className: "truncate", children: [
|
|
240
|
-
"Install: ",
|
|
241
|
-
/* @__PURE__ */ e("code", { children: s.installCommand })
|
|
242
|
-
] }) : null,
|
|
243
|
-
s.loginCommand && !m.has(n.key) ? /* @__PURE__ */ t("div", { className: "truncate", children: [
|
|
244
|
-
"Login: ",
|
|
245
|
-
/* @__PURE__ */ e("code", { children: s.loginCommand })
|
|
246
|
-
] }) : null
|
|
247
|
-
] }) : null,
|
|
248
|
-
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
249
|
-
s.canAutoSetup ? /* @__PURE__ */ t(
|
|
250
|
-
d,
|
|
251
|
-
{
|
|
252
|
-
size: "sm",
|
|
253
|
-
variant: "outline",
|
|
254
|
-
disabled: s.setupRunning,
|
|
255
|
-
onClick: () => u(n.key),
|
|
256
|
-
title: "Run setup for this agent",
|
|
257
|
-
children: [
|
|
258
|
-
s.setupRunning ? /* @__PURE__ */ e(z, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(w, { className: "size-4" }),
|
|
259
|
-
s.setupRunning ? "Running…" : "Install"
|
|
260
|
-
]
|
|
261
|
-
}
|
|
262
|
-
) : null,
|
|
263
|
-
s.canLoginInTerminal ? /* @__PURE__ */ t(
|
|
264
|
-
d,
|
|
265
|
-
{
|
|
266
|
-
size: "sm",
|
|
267
|
-
variant: "outline",
|
|
268
|
-
disabled: s.setupRunning,
|
|
269
|
-
onClick: () => n.key === "aisdk" && C ? c() : o(n.key),
|
|
270
|
-
title: m.has(n.key) ? `Sign in to ${n.label} in your browser` : `Open terminal and run ${s.loginCommand}`,
|
|
271
|
-
children: [
|
|
272
|
-
m.has(n.key) ? /* @__PURE__ */ e(g, { className: "size-4" }) : /* @__PURE__ */ e(R, { className: "size-4" }),
|
|
273
|
-
n.key === "aisdk" && C ? "Add account" : "Login"
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
) : null,
|
|
277
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] text-muted-foreground/70", children: s.omgCapabilityAccess === "mcp" ? "OMG tools" : "OMG prompt only" })
|
|
278
|
-
] })
|
|
279
|
-
]
|
|
280
|
-
},
|
|
281
|
-
n.key
|
|
282
|
-
);
|
|
283
|
-
}) })
|
|
284
|
-
] });
|
|
285
|
-
}
|
|
286
|
-
export {
|
|
287
|
-
Z as default
|
|
288
|
-
};
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as s, Fragment as N } from "react/jsx-runtime";
|
|
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-fYVkvd7A.js";
|
|
3
|
-
import { cn as u } from "cnfast";
|
|
4
|
-
import { useState as a, useRef as L, useEffect as v, useCallback as ge } from "react";
|
|
5
|
-
function ye({
|
|
6
|
-
initial: m,
|
|
7
|
-
scopedProject: w,
|
|
8
|
-
onRestore: K,
|
|
9
|
-
onPick: W,
|
|
10
|
-
onClose: y
|
|
11
|
-
}) {
|
|
12
|
-
const S = w && w !== "__all" ? w : "all", T = H(), [r, R] = a(
|
|
13
|
-
() => T.some((e) => e.status !== "sent") ? "stash" : "sessions"
|
|
14
|
-
), [h, Y] = a(T), [o, k] = a(""), [p, Z] = a(""), [i, E] = a("all"), [n, P] = a(S), [l, D] = a(
|
|
15
|
-
S === "all" && m ? m : []
|
|
16
|
-
), [f, F] = a(S === "all" && m ? m.length : 0), [g, M] = a({ agents: [], projects: [] }), [_, $] = a(!1), [I, G] = a(!1), U = L(null), q = L(l), c = L(0);
|
|
17
|
-
v(() => {
|
|
18
|
-
q.current = l;
|
|
19
|
-
}, [l]), v(() => {
|
|
20
|
-
const e = () => Y(H());
|
|
21
|
-
return window.addEventListener(Q, e), window.addEventListener("storage", e), () => {
|
|
22
|
-
window.removeEventListener(Q, e), window.removeEventListener("storage", e);
|
|
23
|
-
};
|
|
24
|
-
}, []), v(() => {
|
|
25
|
-
const e = window.setTimeout(() => Z(o.trim()), 220);
|
|
26
|
-
return () => window.clearTimeout(e);
|
|
27
|
-
}, [o]);
|
|
28
|
-
const j = ge(
|
|
29
|
-
(e) => {
|
|
30
|
-
const d = e ? ++c.current : c.current, ae = e ? 0 : q.current.length;
|
|
31
|
-
e ? $(!0) : G(!0);
|
|
32
|
-
const x = new URLSearchParams({ limit: String(25), offset: String(ae) });
|
|
33
|
-
p && x.set("search", p), i !== "all" && x.set("agent", i), n !== "all" && x.set("project", n), re(`/api/sessions/resumable?${x.toString()}`).then((b) => {
|
|
34
|
-
if (d !== c.current) return;
|
|
35
|
-
const z = Array.isArray(b.sessions) ? b.sessions : [];
|
|
36
|
-
D((ne) => e ? z : [...ne, ...z]), F(b.total ?? z.length), M(b.facets ?? { agents: [], projects: [] });
|
|
37
|
-
}).catch(() => {
|
|
38
|
-
d !== c.current || !e || (D([]), F(0), M({ agents: [], projects: [] }));
|
|
39
|
-
}).finally(() => {
|
|
40
|
-
d === c.current && (e ? $(!1) : G(!1));
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
[i, p, n]
|
|
44
|
-
);
|
|
45
|
-
v(() => {
|
|
46
|
-
r === "sessions" && j(!0);
|
|
47
|
-
}, [j, r]);
|
|
48
|
-
const C = o.trim().toLowerCase(), O = h.filter(
|
|
49
|
-
(e) => C ? `${e.text} ${e.sessionTitle ?? ""} ${e.project ?? ""}`.toLowerCase().includes(C) : !0
|
|
50
|
-
), ee = _ && !l.length, V = i !== "all" || n !== "all" || !!p, te = l.length < f, se = (e) => e === "draft" ? "Draft" : e === "sending" ? "Sending" : e === "failed" ? "Failed" : "Sent";
|
|
51
|
-
return /* @__PURE__ */ t(
|
|
52
|
-
le,
|
|
53
|
-
{
|
|
54
|
-
open: !0,
|
|
55
|
-
repositionInputs: !1,
|
|
56
|
-
onOpenChange: (e) => {
|
|
57
|
-
e || y();
|
|
58
|
-
},
|
|
59
|
-
children: /* @__PURE__ */ t(oe, { className: "mx-auto w-full max-w-2xl sm:max-w-2xl", children: /* @__PURE__ */ s("div", { className: "flex min-h-0 flex-col overflow-hidden max-h-[72dvh] group-data-[paged=true]/drawer-content:max-h-none group-data-[paged=true]/drawer-content:flex-1", children: [
|
|
60
|
-
/* @__PURE__ */ s("header", { className: "shrink-0 border-b border-border/70 pb-2", children: [
|
|
61
|
-
/* @__PURE__ */ s("div", { className: "flex h-9 items-center gap-2", children: [
|
|
62
|
-
/* @__PURE__ */ t(ie, { className: "text-[15px] font-semibold", children: "Resume" }),
|
|
63
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: "Stash & sessions" }),
|
|
64
|
-
/* @__PURE__ */ t(
|
|
65
|
-
"button",
|
|
66
|
-
{
|
|
67
|
-
type: "button",
|
|
68
|
-
onClick: y,
|
|
69
|
-
"aria-label": "Close",
|
|
70
|
-
className: "ml-auto flex size-8 items-center justify-center rounded-full bg-muted text-muted-foreground transition hover:text-foreground active:scale-95",
|
|
71
|
-
children: /* @__PURE__ */ t(X, { className: "size-4" })
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
] }),
|
|
75
|
-
/* @__PURE__ */ s("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
76
|
-
/* @__PURE__ */ s("div", { className: "inline-flex h-8 shrink-0 items-center rounded-full bg-muted p-0.5 text-xs font-medium", children: [
|
|
77
|
-
/* @__PURE__ */ s(
|
|
78
|
-
"button",
|
|
79
|
-
{
|
|
80
|
-
type: "button",
|
|
81
|
-
onClick: () => R("stash"),
|
|
82
|
-
className: u(
|
|
83
|
-
"flex h-7 items-center gap-1.5 rounded-full px-3 transition",
|
|
84
|
-
r === "stash" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground"
|
|
85
|
-
),
|
|
86
|
-
children: [
|
|
87
|
-
/* @__PURE__ */ t(A, { className: "size-3.5" }),
|
|
88
|
-
"Stash",
|
|
89
|
-
h.length ? /* @__PURE__ */ t("span", { className: "tabular-nums opacity-60", children: h.length }) : null
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
/* @__PURE__ */ s(
|
|
94
|
-
"button",
|
|
95
|
-
{
|
|
96
|
-
type: "button",
|
|
97
|
-
onClick: () => R("sessions"),
|
|
98
|
-
className: u(
|
|
99
|
-
"flex h-7 items-center gap-1.5 rounded-full px-3 transition",
|
|
100
|
-
r === "sessions" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground"
|
|
101
|
-
),
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ t(B, { className: "size-3.5" }),
|
|
104
|
-
"Sessions",
|
|
105
|
-
f ? /* @__PURE__ */ t("span", { className: "tabular-nums opacity-60", children: f }) : null
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
] }),
|
|
110
|
-
r === "stash" && h.length ? /* @__PURE__ */ t(
|
|
111
|
-
"button",
|
|
112
|
-
{
|
|
113
|
-
type: "button",
|
|
114
|
-
onClick: () => ce(),
|
|
115
|
-
className: "ml-auto h-8 rounded-full px-2.5 text-xs font-medium text-muted-foreground transition hover:bg-muted hover:text-destructive",
|
|
116
|
-
children: "Clear"
|
|
117
|
-
}
|
|
118
|
-
) : null
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ s("div", { className: "mt-2 flex items-center gap-1.5", children: [
|
|
121
|
-
/* @__PURE__ */ s("div", { className: "relative min-w-0 flex-1", children: [
|
|
122
|
-
/* @__PURE__ */ t(de, { className: "pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/70" }),
|
|
123
|
-
/* @__PURE__ */ t(
|
|
124
|
-
"input",
|
|
125
|
-
{
|
|
126
|
-
ref: U,
|
|
127
|
-
value: o,
|
|
128
|
-
onChange: (e) => k(e.target.value),
|
|
129
|
-
placeholder: r === "stash" ? "Search prompts" : "Search sessions",
|
|
130
|
-
"aria-label": r === "stash" ? "Search stashed prompts" : "Search resumable sessions",
|
|
131
|
-
autoComplete: "off",
|
|
132
|
-
className: "h-8 w-full rounded-full border border-border bg-muted/40 pl-8 pr-8 text-xs outline-none transition focus:border-ring focus:bg-background"
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
o ? /* @__PURE__ */ t(
|
|
136
|
-
"button",
|
|
137
|
-
{
|
|
138
|
-
type: "button",
|
|
139
|
-
onClick: () => {
|
|
140
|
-
var e;
|
|
141
|
-
k(""), (e = U.current) == null || e.focus();
|
|
142
|
-
},
|
|
143
|
-
"aria-label": "Clear search",
|
|
144
|
-
className: "absolute right-1.5 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground",
|
|
145
|
-
children: /* @__PURE__ */ t(X, { className: "size-3.5" })
|
|
146
|
-
}
|
|
147
|
-
) : null
|
|
148
|
-
] }),
|
|
149
|
-
r === "sessions" ? /* @__PURE__ */ s(N, { children: [
|
|
150
|
-
/* @__PURE__ */ s(
|
|
151
|
-
"select",
|
|
152
|
-
{
|
|
153
|
-
value: i,
|
|
154
|
-
onChange: (e) => E(e.target.value),
|
|
155
|
-
"aria-label": "Filter by agent",
|
|
156
|
-
className: "h-8 max-w-28 rounded-full border border-border bg-background px-2 text-xs outline-none",
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ t("option", { value: "all", children: "All agents" }),
|
|
159
|
-
g.agents.map((e) => /* @__PURE__ */ s("option", { value: e.agent, children: [
|
|
160
|
-
e.agent,
|
|
161
|
-
" · ",
|
|
162
|
-
e.count
|
|
163
|
-
] }, e.agent))
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
g.projects.length || n !== "all" ? /* @__PURE__ */ s(
|
|
168
|
-
"select",
|
|
169
|
-
{
|
|
170
|
-
value: n,
|
|
171
|
-
onChange: (e) => P(e.target.value),
|
|
172
|
-
"aria-label": "Filter by project",
|
|
173
|
-
className: "h-8 max-w-32 rounded-full border border-border bg-background px-2 text-xs outline-none",
|
|
174
|
-
children: [
|
|
175
|
-
/* @__PURE__ */ t("option", { value: "all", children: "All projects" }),
|
|
176
|
-
n !== "all" && !g.projects.some((e) => e.project === n) ? /* @__PURE__ */ t("option", { value: n, children: n }) : null,
|
|
177
|
-
g.projects.map((e) => /* @__PURE__ */ s("option", { value: e.project, children: [
|
|
178
|
-
e.project,
|
|
179
|
-
" · ",
|
|
180
|
-
e.count
|
|
181
|
-
] }, e.project))
|
|
182
|
-
]
|
|
183
|
-
}
|
|
184
|
-
) : null
|
|
185
|
-
] }) : null
|
|
186
|
-
] })
|
|
187
|
-
] }),
|
|
188
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 max-h-[min(28rem,55dvh)] overflow-y-auto overscroll-contain pt-1", children: r === "stash" ? O.length ? /* @__PURE__ */ t("div", { className: "space-y-0.5", children: O.map((e) => /* @__PURE__ */ s(
|
|
189
|
-
"div",
|
|
190
|
-
{
|
|
191
|
-
className: "group flex items-center gap-1 rounded-xl transition hover:bg-muted",
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ s(
|
|
194
|
-
"button",
|
|
195
|
-
{
|
|
196
|
-
type: "button",
|
|
197
|
-
onClick: () => {
|
|
198
|
-
K(e), y();
|
|
199
|
-
},
|
|
200
|
-
className: "flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left active:scale-[0.99]",
|
|
201
|
-
children: [
|
|
202
|
-
/* @__PURE__ */ t(
|
|
203
|
-
"span",
|
|
204
|
-
{
|
|
205
|
-
className: u(
|
|
206
|
-
"flex size-7 shrink-0 items-center justify-center rounded-lg",
|
|
207
|
-
e.status === "draft" || e.status === "failed" ? "bg-primary/12 text-primary" : "bg-muted text-muted-foreground"
|
|
208
|
-
),
|
|
209
|
-
children: /* @__PURE__ */ t(A, { className: "size-3.5" })
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
213
|
-
/* @__PURE__ */ t("span", { className: "line-clamp-2 text-sm leading-snug", children: e.text }),
|
|
214
|
-
/* @__PURE__ */ s("span", { className: "mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
215
|
-
/* @__PURE__ */ t(
|
|
216
|
-
"span",
|
|
217
|
-
{
|
|
218
|
-
className: u(
|
|
219
|
-
"font-medium",
|
|
220
|
-
e.status === "failed" && "text-destructive",
|
|
221
|
-
e.status === "draft" && "text-primary"
|
|
222
|
-
),
|
|
223
|
-
children: se(e.status)
|
|
224
|
-
}
|
|
225
|
-
),
|
|
226
|
-
/* @__PURE__ */ t("span", { children: "·" }),
|
|
227
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: e.source === "new-session" ? e.project || "New session" : e.sessionTitle || "Session" }),
|
|
228
|
-
/* @__PURE__ */ t("span", { children: "·" }),
|
|
229
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 tabular-nums", children: J(e.updatedAt) })
|
|
230
|
-
] })
|
|
231
|
-
] })
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
),
|
|
235
|
-
/* @__PURE__ */ t(
|
|
236
|
-
"button",
|
|
237
|
-
{
|
|
238
|
-
type: "button",
|
|
239
|
-
onClick: () => me(e.id),
|
|
240
|
-
"aria-label": "Remove from Stash",
|
|
241
|
-
className: "mr-1 flex size-7 shrink-0 items-center justify-center rounded-full text-muted-foreground opacity-60 transition hover:bg-background hover:text-destructive group-hover:opacity-100",
|
|
242
|
-
children: /* @__PURE__ */ t(ue, { className: "size-3.5" })
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
]
|
|
246
|
-
},
|
|
247
|
-
e.id
|
|
248
|
-
)) }) : /* @__PURE__ */ s("div", { className: "flex h-full min-h-48 flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground", children: [
|
|
249
|
-
/* @__PURE__ */ t(A, { className: "size-5" }),
|
|
250
|
-
/* @__PURE__ */ t("span", { children: C ? "No stashed prompts match" : "Typed and dictated prompts will appear here" })
|
|
251
|
-
] }) : ee ? /* @__PURE__ */ t("div", { className: "animate-pulse space-y-1", "aria-hidden": !0, children: Array.from({ length: 6 }).map((e, d) => /* @__PURE__ */ s("div", { className: "flex items-center gap-2.5 px-2 py-2.5", children: [
|
|
252
|
-
/* @__PURE__ */ t("div", { className: "size-7 shrink-0 rounded-lg bg-muted" }),
|
|
253
|
-
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
|
|
254
|
-
/* @__PURE__ */ t("div", { className: "h-3 w-1/2 rounded bg-muted" }),
|
|
255
|
-
/* @__PURE__ */ t("div", { className: "h-2.5 w-3/4 rounded bg-muted/60" })
|
|
256
|
-
] })
|
|
257
|
-
] }, d)) }) : l.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full min-h-48 flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground", children: [
|
|
258
|
-
/* @__PURE__ */ t(B, { className: "size-5" }),
|
|
259
|
-
/* @__PURE__ */ t("span", { children: V ? "No sessions match" : "No recent sessions to resume" }),
|
|
260
|
-
V ? /* @__PURE__ */ t(
|
|
261
|
-
"button",
|
|
262
|
-
{
|
|
263
|
-
type: "button",
|
|
264
|
-
onClick: () => {
|
|
265
|
-
k(""), E("all"), P("all");
|
|
266
|
-
},
|
|
267
|
-
className: "rounded-full border border-border px-3 py-1 text-xs font-medium text-foreground",
|
|
268
|
-
children: "Clear filters"
|
|
269
|
-
}
|
|
270
|
-
) : null
|
|
271
|
-
] }) : /* @__PURE__ */ s(N, { children: [
|
|
272
|
-
/* @__PURE__ */ t("div", { className: u("space-y-0.5 transition-opacity", _ && "opacity-60"), children: l.map((e) => /* @__PURE__ */ s(
|
|
273
|
-
"button",
|
|
274
|
-
{
|
|
275
|
-
type: "button",
|
|
276
|
-
onClick: () => W(e),
|
|
277
|
-
className: "flex w-full items-center gap-2.5 rounded-xl px-2 py-2 text-left transition hover:bg-muted active:scale-[0.99]",
|
|
278
|
-
children: [
|
|
279
|
-
/* @__PURE__ */ t("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ t(he, { session: e, className: "size-4", size: "sm" }) }),
|
|
280
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
281
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children: e.title }),
|
|
282
|
-
/* @__PURE__ */ s("span", { className: "mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
|
|
283
|
-
e.lastUserText ? /* @__PURE__ */ s(N, { children: [
|
|
284
|
-
/* @__PURE__ */ t("span", { className: "max-w-[60%] truncate", children: e.lastUserText }),
|
|
285
|
-
/* @__PURE__ */ t("span", { children: "·" })
|
|
286
|
-
] }) : null,
|
|
287
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: e.project }),
|
|
288
|
-
/* @__PURE__ */ t("span", { children: "·" }),
|
|
289
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 tabular-nums", children: J(e.lastActivityAt) })
|
|
290
|
-
] })
|
|
291
|
-
] }),
|
|
292
|
-
/* @__PURE__ */ t(pe, { className: "size-3.5 shrink-0 text-muted-foreground/60" })
|
|
293
|
-
]
|
|
294
|
-
},
|
|
295
|
-
e.sessionId
|
|
296
|
-
)) }),
|
|
297
|
-
te ? /* @__PURE__ */ t(
|
|
298
|
-
"button",
|
|
299
|
-
{
|
|
300
|
-
type: "button",
|
|
301
|
-
onClick: () => j(!1),
|
|
302
|
-
disabled: I,
|
|
303
|
-
className: "mt-1 flex w-full items-center justify-center gap-2 rounded-xl px-3 py-2.5 text-xs font-medium text-muted-foreground transition hover:bg-muted disabled:opacity-60",
|
|
304
|
-
children: I ? /* @__PURE__ */ s(N, { children: [
|
|
305
|
-
/* @__PURE__ */ t(fe, { className: "size-3.5 animate-spin" }),
|
|
306
|
-
" Loading…"
|
|
307
|
-
] }) : `Load ${Math.min(25, f - l.length)} more`
|
|
308
|
-
}
|
|
309
|
-
) : null
|
|
310
|
-
] }) })
|
|
311
|
-
] }) })
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
export {
|
|
316
|
-
ye as default
|
|
317
|
-
};
|