@markmo/europacore-session-ui 0.2.0 → 0.3.0
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/README.md +1 -1
- package/dist/{BoardPage-BAQrGP7G.js → BoardPage-DDcf5vup.js} +257 -248
- package/dist/{CardDetail-CCgP8R61.js → CardDetail-D0TLVhf7.js} +16 -7
- package/dist/{ComparePage-FcLLhKzC.js → ComparePage-C32hPOqV.js} +1 -1
- package/dist/{OverviewPage-CbfbyGNT.js → OverviewPage-BkeuYg6d.js} +24 -23
- package/dist/{RegisterPage-3-hJNQEV.js → RegisterPage-Dawr26jh.js} +9 -9
- package/dist/{SessionPage-CA9hAakW.js → SessionPage-68nDek9w.js} +223 -207
- package/dist/api/agentClient.d.ts +5 -1
- package/dist/api/wire.d.ts +79 -0
- package/dist/features/chat/model/entries.d.ts +5 -0
- package/dist/features/chat/model/fleet.d.ts +11 -0
- package/dist/features/chat/model/inspect.d.ts +11 -0
- package/dist/features/chat/model/memory.d.ts +3 -3
- package/dist/features/chat/model/routing.d.ts +20 -0
- package/dist/features/chat/model/store.d.ts +5 -0
- package/dist/features/chat/session/ComposerHistory.d.ts +1 -1
- package/dist/features/commands/InspectDialog.d.ts +3 -0
- package/dist/features/commands/dialogs.d.ts +1 -1
- package/dist/features/commands/registry.d.ts +1 -1
- package/dist/features/memory/MemoryDialog.d.ts +1 -1
- package/dist/features/memory/memoryService.d.ts +10 -10
- package/dist/{index-NjGO7Jg1.js → index-B0hmy2Cw.js} +3378 -3123
- package/dist/index.js +1 -1
- package/dist/{promptHistory-DjSCHmEk.js → promptHistory-DQyt2Br0.js} +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useParams as je, useSearchParams as qe, useNavigate as
|
|
4
|
-
import { Sparkles as Ve, ArrowDown as Ge, CircleSlash as We, X as
|
|
5
|
-
import { c as
|
|
6
|
-
import { p as
|
|
2
|
+
import { useMemo as B, useEffect as M, useRef as z, useState as S, useCallback as H, useLayoutEffect as te, memo as He, useId as Ce, useSyncExternalStore as Be } from "react";
|
|
3
|
+
import { useParams as je, useSearchParams as qe, useNavigate as se } from "react-router";
|
|
4
|
+
import { Sparkles as Ve, ArrowDown as Ge, CircleSlash as We, X as Ee, ImagePlus as Je, ListPlus as Qe, Square as Ye, ArrowUp as Xe, RefreshCw as Ze, Loader2 as et, Pause as tt, MessageSquareDashed as pe, PanelRightClose as nt, PanelRight as st } from "lucide-react";
|
|
5
|
+
import { c as W, s as Ie, i as he, u as O, C as D, a as R, L as P, t as at, U as rt, D as it, b as ot, A as ct, W as lt, T as ut, R as dt, d as mt, S as ft, N as pt, e as ht, f as gt, B as xt, r as wt, g as Ae, h as bt, j as yt, m as kt, k as vt, l as Nt, I as ne, p as St, n as ge, o as Dt, q as xe, v as Me, w as X, x as Ct, y as A, z as J, E as Et, F as we, G as Te, H as It, J as At, K as Mt, M as Tt, O as $t, P as Pt, Q as Rt, V as zt, X as be, Y as Ft, Z as ye, _ as Kt } from "./index-B0hmy2Cw.js";
|
|
6
|
+
import { p as ae, w as _t, P as Lt } from "./promptHistory-DQyt2Br0.js";
|
|
7
7
|
function Ot({ onPick: e }) {
|
|
8
|
-
const n = (
|
|
8
|
+
const n = (Ie().userName() || "").split(" ")[0];
|
|
9
9
|
return /* @__PURE__ */ g("div", { className: "mx-auto flex w-full max-w-3xl flex-1 flex-col justify-center px-4 py-10 sm:px-6", children: [
|
|
10
10
|
/* @__PURE__ */ g("div", { className: "mb-7 flex flex-col items-start gap-3", children: [
|
|
11
11
|
/* @__PURE__ */ t("span", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-accent text-on-accent", children: /* @__PURE__ */ t(Ve, { size: 19 }) }),
|
|
12
12
|
/* @__PURE__ */ t("h1", { className: "text-[26px] leading-tight font-semibold text-ink", children: n ? `How can I help, ${n}?` : "How can I help?" }),
|
|
13
13
|
/* @__PURE__ */ t("p", { className: "text-[13.5px] text-muted", children: "Ask anything. The assistant can use tools, and it will ask before doing anything with side effects." })
|
|
14
14
|
] }),
|
|
15
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children:
|
|
15
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: W.suggestions.map((r) => /* @__PURE__ */ g(
|
|
16
16
|
"button",
|
|
17
17
|
{
|
|
18
18
|
type: "button",
|
|
@@ -27,9 +27,9 @@ function Ot({ onPick: e }) {
|
|
|
27
27
|
)) })
|
|
28
28
|
] });
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const n =
|
|
32
|
-
return
|
|
30
|
+
function $e(e) {
|
|
31
|
+
const n = B(() => [...new Set(he().flatMap((r) => r.keys ?? []))], []);
|
|
32
|
+
return O(e, D.session, D.reset, D.workspace, D.fleet, ...n), he().filter((r) => r.available(e));
|
|
33
33
|
}
|
|
34
34
|
function ke({
|
|
35
35
|
controller: e,
|
|
@@ -37,12 +37,12 @@ function ke({
|
|
|
37
37
|
onTab: r,
|
|
38
38
|
className: i
|
|
39
39
|
}) {
|
|
40
|
-
const m =
|
|
40
|
+
const m = $e(e), o = m.find((c) => c.id === n) ?? m[0];
|
|
41
41
|
if (M(() => {
|
|
42
42
|
o && o.id !== n && r(o.id);
|
|
43
43
|
}, [o, n, r]), !o) return null;
|
|
44
44
|
const a = o.Component;
|
|
45
|
-
return /* @__PURE__ */ g("div", { className:
|
|
45
|
+
return /* @__PURE__ */ g("div", { className: R("flex min-h-0 flex-col", i), children: [
|
|
46
46
|
/* @__PURE__ */ t("div", { role: "tablist", "aria-label": "Session panels", className: "flex shrink-0 gap-0.5 overflow-x-auto border-b border-line px-2 pt-1.5", children: m.map((c) => {
|
|
47
47
|
const d = c.icon, l = c.badge?.(e) ?? null, f = c.id === o.id;
|
|
48
48
|
return /* @__PURE__ */ g(
|
|
@@ -52,7 +52,7 @@ function ke({
|
|
|
52
52
|
role: "tab",
|
|
53
53
|
"aria-selected": f,
|
|
54
54
|
onClick: () => r(c.id),
|
|
55
|
-
className:
|
|
55
|
+
className: R(
|
|
56
56
|
"-mb-px inline-flex h-9 shrink-0 items-center gap-1.5 border-b-2 px-2.5 text-[12.5px] font-semibold transition-colors",
|
|
57
57
|
f ? "border-accent text-ink" : "border-transparent text-muted hover:text-ink"
|
|
58
58
|
),
|
|
@@ -68,7 +68,7 @@ function ke({
|
|
|
68
68
|
/* @__PURE__ */ t("div", { role: "tabpanel", className: "min-h-0 flex-1 overflow-y-auto p-3", children: /* @__PURE__ */ t(a, { controller: e }) })
|
|
69
69
|
] });
|
|
70
70
|
}
|
|
71
|
-
const Ut = 80, Ht =
|
|
71
|
+
const Ut = 80, Ht = He(function({
|
|
72
72
|
controller: n,
|
|
73
73
|
block: r,
|
|
74
74
|
live: i
|
|
@@ -112,29 +112,29 @@ function Bt({
|
|
|
112
112
|
footer: r,
|
|
113
113
|
renderDiff: i
|
|
114
114
|
}) {
|
|
115
|
-
const m =
|
|
115
|
+
const m = O(e, P.list, D.run), o = e.store.state.entries, a = B(() => at(o), [m, o]), c = e.running(), d = e.store.state.run?.id ?? null, l = z(null), f = z(null), x = z(!0), k = z(0), [p, b] = S(!1), y = H((w = "auto") => {
|
|
116
116
|
const h = l.current;
|
|
117
117
|
h && h.scrollTo({ top: h.scrollHeight, behavior: w });
|
|
118
118
|
}, []), C = () => {
|
|
119
119
|
const w = l.current;
|
|
120
120
|
if (!w) return;
|
|
121
|
-
const h = w.scrollHeight - w.scrollTop - w.clientHeight < Ut, T = w.scrollTop <
|
|
122
|
-
|
|
121
|
+
const h = w.scrollHeight - w.scrollTop - w.clientHeight < Ut, T = w.scrollTop < k.current - 2;
|
|
122
|
+
k.current = w.scrollTop, h ? x.current = !0 : T && (x.current = !1), b(!x.current);
|
|
123
123
|
};
|
|
124
124
|
M(() => {
|
|
125
125
|
const w = f.current;
|
|
126
126
|
if (!w || typeof ResizeObserver > "u") return;
|
|
127
127
|
const h = new ResizeObserver(() => {
|
|
128
|
-
x.current &&
|
|
128
|
+
x.current && y();
|
|
129
129
|
});
|
|
130
130
|
return h.observe(w), () => h.disconnect();
|
|
131
|
-
}, [
|
|
131
|
+
}, [y]);
|
|
132
132
|
const F = a[a.length - 1];
|
|
133
|
-
return
|
|
134
|
-
F?.kind === "user" && (x.current = !0,
|
|
135
|
-
}, [F?.key, F?.kind,
|
|
136
|
-
x.current = !0,
|
|
137
|
-
}, [e,
|
|
133
|
+
return te(() => {
|
|
134
|
+
F?.kind === "user" && (x.current = !0, b(!1)), x.current && y();
|
|
135
|
+
}, [F?.key, F?.kind, y]), te(() => {
|
|
136
|
+
x.current = !0, b(!1), y();
|
|
137
|
+
}, [e, y]), /* @__PURE__ */ g("div", { className: "relative min-h-0 flex-1", children: [
|
|
138
138
|
/* @__PURE__ */ t("div", { ref: l, onScroll: C, className: "h-full overflow-y-auto overscroll-contain", children: /* @__PURE__ */ g(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
@@ -150,12 +150,12 @@ function Bt({
|
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
) }),
|
|
153
|
-
|
|
153
|
+
p && /* @__PURE__ */ g(
|
|
154
154
|
"button",
|
|
155
155
|
{
|
|
156
156
|
type: "button",
|
|
157
157
|
onClick: () => {
|
|
158
|
-
x.current = !0,
|
|
158
|
+
x.current = !0, b(!1), y("smooth");
|
|
159
159
|
},
|
|
160
160
|
className: "absolute bottom-3 left-1/2 inline-flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-line bg-surface px-3 py-1.5 text-[12px] font-semibold text-ink shadow-pop hover:bg-surface-hover",
|
|
161
161
|
children: [
|
|
@@ -212,19 +212,21 @@ function Wt(e, n, r) {
|
|
|
212
212
|
if (a.key === "ArrowUp") {
|
|
213
213
|
if (d.includes(`
|
|
214
214
|
`)) return !1;
|
|
215
|
-
const x = i.current ?? { list:
|
|
216
|
-
return
|
|
215
|
+
const x = i.current ?? { list: ae.recent(), index: -1, draft: e }, k = x.index === -1 ? x.list.length - 1 : x.index - 1;
|
|
216
|
+
return k < 0 ? !1 : (i.current = { ...x, index: k }, a.preventDefault(), m(x.list[k], !0), !0);
|
|
217
217
|
}
|
|
218
218
|
const f = i.current;
|
|
219
219
|
return !f || l.includes(`
|
|
220
220
|
`) ? !1 : (a.preventDefault(), f.index + 1 >= f.list.length ? (i.current = null, m(f.draft, !1)) : (i.current = { ...f, index: f.index + 1 }, m(f.list[f.index + 1], !1)), !0);
|
|
221
|
-
}, reset: () =>
|
|
221
|
+
}, reset: () => {
|
|
222
|
+
i.current = null;
|
|
223
|
+
} };
|
|
222
224
|
}
|
|
223
225
|
function Jt({ workspace: e, onPick: n, onClose: r }) {
|
|
224
|
-
const [i, m] = S(""), [o, a] = S(0), c =
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
};
|
|
226
|
+
const [i, m] = S(""), [o, a] = S(0), c = B(() => ae.search("", e).slice(0, Gt), [e]), d = i.toLowerCase().split(/\s+/).filter(Boolean), l = c.filter((p) => d.every((b) => p.text.toLowerCase().includes(b))), f = Math.min(o, Math.max(0, l.length - 1)), x = (p) => {
|
|
227
|
+
const b = l[p];
|
|
228
|
+
b && n(b.text);
|
|
229
|
+
}, k = Ce();
|
|
228
230
|
return /* @__PURE__ */ g("div", { className: "absolute bottom-full left-0 z-20 mb-2 w-full rounded-xl border border-line bg-surface p-1.5 shadow-pop", children: [
|
|
229
231
|
/* @__PURE__ */ t(
|
|
230
232
|
"input",
|
|
@@ -240,28 +242,35 @@ function Jt({ workspace: e, onPick: n, onClose: r }) {
|
|
|
240
242
|
onBlur: r,
|
|
241
243
|
placeholder: "Search the prompts you have sent",
|
|
242
244
|
"aria-label": "Search prompt history",
|
|
245
|
+
"aria-controls": l.length ? k : void 0,
|
|
246
|
+
"aria-activedescendant": l.length ? `${k}-${f}` : void 0,
|
|
247
|
+
"aria-autocomplete": "list",
|
|
243
248
|
className: "mb-1 h-8 w-full rounded-md border border-line bg-surface px-2 text-[13px] text-ink placeholder:text-faint focus:border-accent focus:outline-none"
|
|
244
249
|
}
|
|
245
250
|
),
|
|
246
|
-
l.length === 0 ? /* @__PURE__ */ t("p", { className: "px-2.5 py-2 text-[12.5px] text-muted", children: c.length ? "No prompt has those words." : "No prompts sent yet." }) : /* @__PURE__ */ t("
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
l.length === 0 ? /* @__PURE__ */ t("p", { className: "px-2.5 py-2 text-[12.5px] text-muted", children: c.length ? "No prompt has those words." : "No prompts sent yet." }) : /* @__PURE__ */ t("div", { id: k, role: "listbox", "aria-label": "Prompt history", className: "max-h-64 overflow-y-auto", children: l.map((p, b) => (
|
|
252
|
+
// biome-ignore lint/a11y/useFocusableInteractive: a combobox option; focus stays in the search box (aria-activedescendant)
|
|
253
|
+
/* @__PURE__ */ g(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
id: `${k}-${b}`,
|
|
257
|
+
role: "option",
|
|
258
|
+
"aria-selected": b === f,
|
|
259
|
+
onMouseDown: (y) => {
|
|
260
|
+
y.preventDefault(), x(b);
|
|
261
|
+
},
|
|
262
|
+
onMouseEnter: () => a(b),
|
|
263
|
+
className: R("flex cursor-pointer items-baseline gap-2 rounded-md px-2.5 py-1.5 text-[13px]", b === f && "bg-accent-soft"),
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-ink", children: p.text.replace(/\s+/g, " ") }),
|
|
266
|
+
/* @__PURE__ */ g("span", { className: "shrink-0 text-[11px] text-faint", children: [
|
|
267
|
+
wt(new Date(p.at).toISOString()),
|
|
268
|
+
p.workspace && p.workspace !== e ? ` · ${p.workspace.split("/").pop()}` : ""
|
|
269
|
+
] })
|
|
270
|
+
]
|
|
253
271
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
children: [
|
|
257
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-ink", children: p.text.replace(/\s+/g, " ") }),
|
|
258
|
-
/* @__PURE__ */ g("span", { className: "shrink-0 text-[11px] text-faint", children: [
|
|
259
|
-
wt(new Date(p.at).toISOString()),
|
|
260
|
-
p.workspace && p.workspace !== e ? ` · ${p.workspace.split("/").pop()}` : ""
|
|
261
|
-
] })
|
|
262
|
-
]
|
|
263
|
-
},
|
|
264
|
-
`${p.at}-${y}`
|
|
272
|
+
`${p.at}-${b}`
|
|
273
|
+
)
|
|
265
274
|
)) })
|
|
266
275
|
] });
|
|
267
276
|
}
|
|
@@ -273,7 +282,7 @@ function Yt(e, n) {
|
|
|
273
282
|
return e.replace(/@([^\s@]*)$/, `@${n} `);
|
|
274
283
|
}
|
|
275
284
|
function Xt(e, n) {
|
|
276
|
-
const [r, i] = S([]), m =
|
|
285
|
+
const [r, i] = S([]), m = Ie().workspaces, o = n !== null && e.hasWorkspace() && m !== null;
|
|
277
286
|
return M(() => {
|
|
278
287
|
if (!o) {
|
|
279
288
|
i([]);
|
|
@@ -293,21 +302,21 @@ function Zt(e) {
|
|
|
293
302
|
return n ? n[1].toLowerCase() : null;
|
|
294
303
|
}
|
|
295
304
|
function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, registerHandle: m }) {
|
|
296
|
-
const { toast: o } =
|
|
297
|
-
|
|
298
|
-
const c = e.running(), d = e.agent?.accepts_images ?? !0, l = d ? Math.min(e.agent?.image_limits?.max_count ??
|
|
305
|
+
const { toast: o } = Ae(), a = O(e, P.commands);
|
|
306
|
+
O(e, D.run, D.pause, P.images, P.draft, P.followUps), Be(bt, yt);
|
|
307
|
+
const c = e.running(), d = e.agent?.accepts_images ?? !0, l = d ? Math.min(e.agent?.image_limits?.max_count ?? W.maxImages, W.maxImages) : 0, f = e.images, [x, k] = S(e.draft), [p, b] = S(!1), [y, C] = S(0), [F, w] = S(!1), [h, T] = S(!1), v = z(null), q = z(null), K = Ce(), E = H(
|
|
299
308
|
(s) => {
|
|
300
|
-
|
|
309
|
+
k(s), e.setDraft(s);
|
|
301
310
|
},
|
|
302
311
|
[e]
|
|
303
|
-
), Pe = e.version(
|
|
312
|
+
), Pe = e.version(P.draft);
|
|
304
313
|
M(() => {
|
|
305
|
-
|
|
306
|
-
}, [e, Pe]),
|
|
314
|
+
k(e.draft);
|
|
315
|
+
}, [e, Pe]), te(() => {
|
|
307
316
|
const s = v.current;
|
|
308
317
|
s && (s.style.height = "auto", s.style.height = `${Math.min(s.scrollHeight, 240)}px`);
|
|
309
318
|
}, [x]);
|
|
310
|
-
const
|
|
319
|
+
const _ = B(
|
|
311
320
|
() => ({
|
|
312
321
|
...n,
|
|
313
322
|
controller: e,
|
|
@@ -321,15 +330,14 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
321
330
|
}),
|
|
322
331
|
[n, e, E]
|
|
323
332
|
);
|
|
324
|
-
M(() => (m?.({ setText:
|
|
325
|
-
const
|
|
326
|
-
() =>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const u = _[Math.min(s, _.length - 1)];
|
|
333
|
+
M(() => (m?.({ setText: _.setComposer, pickImages: _.pickImages, focus: () => v.current?.focus() }), () => m?.(null)), [_, m]);
|
|
334
|
+
const re = Wt(x, E, v), ie = e.session?.workspace ?? e.newSession.workspace?.path ?? null, Q = F ? null : Zt(x), $ = B(
|
|
335
|
+
() => Q === null ? [] : kt([...vt(_), ...Nt(e)], Q).slice(0, 40),
|
|
336
|
+
[Q, _, e, a]
|
|
337
|
+
), U = $.length > 0, Re = U || F ? null : Qt(x), L = Xt(e, Re), V = !U && L.length > 0, oe = (s) => {
|
|
338
|
+
const u = L[Math.min(s, L.length - 1)];
|
|
331
339
|
u && (E(Yt(x, u)), C(0), requestAnimationFrame(() => v.current?.focus()));
|
|
332
|
-
},
|
|
340
|
+
}, Y = H(
|
|
333
341
|
async (s) => {
|
|
334
342
|
const u = s.filter(ve);
|
|
335
343
|
if (s.length && !u.length) {
|
|
@@ -342,16 +350,16 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
342
350
|
}
|
|
343
351
|
const N = l - e.images.length;
|
|
344
352
|
u.length > N && o(`Up to ${l} images per message.`, "danger");
|
|
345
|
-
const
|
|
353
|
+
const Oe = (await Promise.all(u.slice(0, Math.max(0, N)).map((j) => Vt(j)))).map((j, Ue) => {
|
|
346
354
|
const fe = /^data:([^;,]+);base64,(.*)$/s.exec(j.url);
|
|
347
|
-
return { name: j.name ?? `image ${
|
|
355
|
+
return { name: j.name ?? `image ${Ue + 1}`, url: j.url, image: { media_type: fe?.[1] ?? "image/png", data: fe?.[2] ?? "" } };
|
|
348
356
|
});
|
|
349
|
-
e.setImages([...e.images, ...
|
|
357
|
+
e.setImages([...e.images, ...Oe].slice(0, l));
|
|
350
358
|
},
|
|
351
359
|
[d, e, l, o]
|
|
352
|
-
), I = x.trim(), ce = !r && !!(I || f.length && !c),
|
|
360
|
+
), I = x.trim(), ce = !r && !!(I || f.length && !c), G = async (s = !1) => {
|
|
353
361
|
if (!ce) return;
|
|
354
|
-
|
|
362
|
+
re.reset(), I && ae.record(I, ie);
|
|
355
363
|
const u = St(I);
|
|
356
364
|
if (u && e.serverCommand(u.raw) && !ge(u.name)) {
|
|
357
365
|
E(""), await e.runServerCommand(I);
|
|
@@ -360,7 +368,7 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
360
368
|
if (u && ge(u.name)) {
|
|
361
369
|
E("");
|
|
362
370
|
try {
|
|
363
|
-
await Dt(
|
|
371
|
+
await Dt(_, I);
|
|
364
372
|
} catch (N) {
|
|
365
373
|
o(N instanceof Error ? N.message : String(N), "danger");
|
|
366
374
|
}
|
|
@@ -372,23 +380,23 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
372
380
|
}
|
|
373
381
|
await e.submit(I);
|
|
374
382
|
}, le = (s) => {
|
|
375
|
-
const u =
|
|
383
|
+
const u = $[Math.min(s, $.length - 1)];
|
|
376
384
|
if (u) {
|
|
377
385
|
if (C(0), u.needsArgs) {
|
|
378
386
|
E(`/${u.name} `), requestAnimationFrame(() => v.current?.focus());
|
|
379
387
|
return;
|
|
380
388
|
}
|
|
381
|
-
E(""), Promise.resolve(u.run(
|
|
389
|
+
E(""), Promise.resolve(u.run(_, "")).catch((N) => o(N instanceof Error ? N.message : String(N), "danger"));
|
|
382
390
|
}
|
|
383
|
-
},
|
|
391
|
+
}, ze = (s) => {
|
|
384
392
|
if (!s.nativeEvent.isComposing) {
|
|
385
|
-
if (
|
|
393
|
+
if (V) {
|
|
386
394
|
if (s.key === "ArrowDown" || s.key === "ArrowUp") {
|
|
387
|
-
s.preventDefault(), C((u) => Ne(u, s.key === "ArrowDown" ? 1 : -1,
|
|
395
|
+
s.preventDefault(), C((u) => Ne(u, s.key === "ArrowDown" ? 1 : -1, L.length));
|
|
388
396
|
return;
|
|
389
397
|
}
|
|
390
398
|
if (s.key === "Tab" || s.key === "Enter" && !s.shiftKey) {
|
|
391
|
-
s.preventDefault(), oe(
|
|
399
|
+
s.preventDefault(), oe(y);
|
|
392
400
|
return;
|
|
393
401
|
}
|
|
394
402
|
if (s.key === "Escape") {
|
|
@@ -396,19 +404,19 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
396
404
|
return;
|
|
397
405
|
}
|
|
398
406
|
}
|
|
399
|
-
if (
|
|
407
|
+
if (U) {
|
|
400
408
|
if (s.key === "ArrowDown" || s.key === "ArrowUp") {
|
|
401
|
-
s.preventDefault(), C((u) => Ne(u, s.key === "ArrowDown" ? 1 : -1,
|
|
409
|
+
s.preventDefault(), C((u) => Ne(u, s.key === "ArrowDown" ? 1 : -1, $.length));
|
|
402
410
|
return;
|
|
403
411
|
}
|
|
404
412
|
if (s.key === "Tab") {
|
|
405
413
|
s.preventDefault();
|
|
406
|
-
const u =
|
|
414
|
+
const u = $[Math.min(y, $.length - 1)];
|
|
407
415
|
u && E(`/${u.name} `);
|
|
408
416
|
return;
|
|
409
417
|
}
|
|
410
418
|
if (s.key === "Enter" && !s.shiftKey) {
|
|
411
|
-
s.preventDefault(), le(
|
|
419
|
+
s.preventDefault(), le(y);
|
|
412
420
|
return;
|
|
413
421
|
}
|
|
414
422
|
if (s.key === "Escape") {
|
|
@@ -420,94 +428,101 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
420
428
|
s.preventDefault(), T(!0);
|
|
421
429
|
return;
|
|
422
430
|
}
|
|
423
|
-
if (!
|
|
431
|
+
if (!re.onKeyDown(s)) {
|
|
424
432
|
if (s.key === "Escape" && c && !I) {
|
|
425
433
|
s.preventDefault(), e.cancelRun();
|
|
426
434
|
return;
|
|
427
435
|
}
|
|
428
436
|
if (s.key === "Enter" && s.altKey) {
|
|
429
|
-
s.preventDefault(),
|
|
437
|
+
s.preventDefault(), G(!0);
|
|
430
438
|
return;
|
|
431
439
|
}
|
|
432
|
-
s.key === "Enter" && !s.shiftKey && (s.preventDefault(),
|
|
440
|
+
s.key === "Enter" && !s.shiftKey && (s.preventDefault(), G());
|
|
433
441
|
}
|
|
434
442
|
}
|
|
435
|
-
}, ze = (s) => {
|
|
436
|
-
const u = Array.from(s.clipboardData.files);
|
|
437
|
-
u.some(ve) && (s.preventDefault(), Q(u));
|
|
438
443
|
}, Fe = (s) => {
|
|
439
|
-
|
|
440
|
-
|
|
444
|
+
const u = Array.from(s.clipboardData.files);
|
|
445
|
+
u.some(ve) && (s.preventDefault(), Y(u));
|
|
446
|
+
}, Ke = (s) => {
|
|
447
|
+
s.preventDefault(), b(!1), Y(Array.from(s.dataTransfer.files));
|
|
448
|
+
}, ue = e.store.state.pause, de = W.ComposerFooter, _e = e.isWorker(), Le = c ? "Steer the turn in progress… (Alt+Enter queues it for after)" : ue?.kind === "question" ? "Answer in your own words…" : ue?.kind === "flow_input" ? "Reply to the flow…" : _e ? "Steer this task through its fleet…" : `Message ${e.agent?.name ?? "the agent"}… (/ for commands)`;
|
|
441
449
|
return /* @__PURE__ */ g("div", { className: "relative", children: [
|
|
442
450
|
h && /* @__PURE__ */ t(
|
|
443
451
|
Jt,
|
|
444
452
|
{
|
|
445
|
-
workspace:
|
|
453
|
+
workspace: ie,
|
|
446
454
|
onPick: (s) => {
|
|
447
|
-
T(!1),
|
|
455
|
+
T(!1), _.setComposer(s);
|
|
448
456
|
},
|
|
449
457
|
onClose: () => {
|
|
450
458
|
T(!1), requestAnimationFrame(() => v.current?.focus());
|
|
451
459
|
}
|
|
452
460
|
}
|
|
453
461
|
),
|
|
454
|
-
|
|
455
|
-
"
|
|
462
|
+
U && !h && /* @__PURE__ */ t(
|
|
463
|
+
"div",
|
|
456
464
|
{
|
|
457
|
-
id:
|
|
465
|
+
id: K,
|
|
458
466
|
role: "listbox",
|
|
459
467
|
"aria-label": "Commands",
|
|
460
468
|
className: "absolute bottom-full left-0 z-20 mb-2 max-h-72 w-full overflow-y-auto rounded-xl border border-line bg-surface p-1.5 shadow-pop",
|
|
461
|
-
children:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
+
children: $.map((s, u) => (
|
|
470
|
+
// biome-ignore lint/a11y/useFocusableInteractive: a combobox option; focus stays in the textarea (aria-activedescendant)
|
|
471
|
+
/* @__PURE__ */ g(
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
id: `${K}-${u}`,
|
|
475
|
+
role: "option",
|
|
476
|
+
"aria-selected": u === Math.min(y, $.length - 1),
|
|
477
|
+
onMouseDown: (N) => {
|
|
478
|
+
N.preventDefault(), le(u);
|
|
479
|
+
},
|
|
480
|
+
onMouseEnter: () => C(u),
|
|
481
|
+
className: R(
|
|
482
|
+
"flex cursor-pointer items-baseline gap-2 rounded-md px-2.5 py-1.5 text-[13px]",
|
|
483
|
+
u === Math.min(y, $.length - 1) ? "bg-accent-soft" : ""
|
|
484
|
+
),
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ g("span", { className: R("shrink-0 font-mono font-semibold", u === y ? "text-accent" : "text-ink"), children: [
|
|
487
|
+
"/",
|
|
488
|
+
s.name
|
|
489
|
+
] }),
|
|
490
|
+
s.args && /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[11.5px] text-faint", children: s.args }),
|
|
491
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 truncate text-muted", children: s.description })
|
|
492
|
+
]
|
|
469
493
|
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
"flex cursor-pointer items-baseline gap-2 rounded-md px-2.5 py-1.5 text-[13px]",
|
|
473
|
-
u === Math.min(b, P.length - 1) ? "bg-accent-soft" : ""
|
|
474
|
-
),
|
|
475
|
-
children: [
|
|
476
|
-
/* @__PURE__ */ g("span", { className: $("shrink-0 font-mono font-semibold", u === b ? "text-accent" : "text-ink"), children: [
|
|
477
|
-
"/",
|
|
478
|
-
s.name
|
|
479
|
-
] }),
|
|
480
|
-
s.args && /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[11.5px] text-faint", children: s.args }),
|
|
481
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 truncate text-muted", children: s.description })
|
|
482
|
-
]
|
|
483
|
-
},
|
|
484
|
-
s.name
|
|
494
|
+
s.name
|
|
495
|
+
)
|
|
485
496
|
))
|
|
486
497
|
}
|
|
487
498
|
),
|
|
488
|
-
|
|
489
|
-
"
|
|
499
|
+
V && /* @__PURE__ */ t(
|
|
500
|
+
"div",
|
|
490
501
|
{
|
|
491
|
-
id: `${
|
|
502
|
+
id: `${K}-files`,
|
|
492
503
|
role: "listbox",
|
|
493
504
|
"aria-label": "Files",
|
|
494
505
|
className: "absolute bottom-full left-0 z-20 mb-2 max-h-72 w-full overflow-y-auto rounded-xl border border-line bg-surface p-1.5 shadow-pop",
|
|
495
|
-
children:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
506
|
+
children: L.map((s, u) => (
|
|
507
|
+
// biome-ignore lint/a11y/useFocusableInteractive: a combobox option; focus stays in the textarea (aria-activedescendant)
|
|
508
|
+
/* @__PURE__ */ t(
|
|
509
|
+
"div",
|
|
510
|
+
{
|
|
511
|
+
id: `${K}-files-${u}`,
|
|
512
|
+
role: "option",
|
|
513
|
+
"aria-selected": u === Math.min(y, L.length - 1),
|
|
514
|
+
onMouseDown: (N) => {
|
|
515
|
+
N.preventDefault(), oe(u);
|
|
516
|
+
},
|
|
517
|
+
onMouseEnter: () => C(u),
|
|
518
|
+
className: R(
|
|
519
|
+
"cursor-pointer truncate rounded-md px-2.5 py-1.5 font-mono text-[12.5px] text-ink",
|
|
520
|
+
u === Math.min(y, L.length - 1) && "bg-accent-soft text-accent"
|
|
521
|
+
),
|
|
522
|
+
children: s
|
|
502
523
|
},
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
"cursor-pointer truncate rounded-md px-2.5 py-1.5 font-mono text-[12.5px] text-ink",
|
|
506
|
-
u === Math.min(b, _.length - 1) && "bg-accent-soft text-accent"
|
|
507
|
-
),
|
|
508
|
-
children: s
|
|
509
|
-
},
|
|
510
|
-
s
|
|
524
|
+
s
|
|
525
|
+
)
|
|
511
526
|
))
|
|
512
527
|
}
|
|
513
528
|
),
|
|
@@ -515,33 +530,36 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
515
530
|
"div",
|
|
516
531
|
{
|
|
517
532
|
onDragOver: (s) => {
|
|
518
|
-
s.dataTransfer.types.includes("Files") && (s.preventDefault(),
|
|
533
|
+
s.dataTransfer.types.includes("Files") && (s.preventDefault(), b(!0));
|
|
519
534
|
},
|
|
520
|
-
onDragLeave: () =>
|
|
521
|
-
onDrop:
|
|
522
|
-
className:
|
|
535
|
+
onDragLeave: () => b(!1),
|
|
536
|
+
onDrop: Ke,
|
|
537
|
+
className: R(
|
|
523
538
|
"rounded-2xl border bg-surface p-1.5 shadow-sm transition-colors",
|
|
524
539
|
"focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/20",
|
|
525
|
-
|
|
540
|
+
p ? "border-accent bg-accent-soft" : "border-line",
|
|
526
541
|
r && "opacity-60"
|
|
527
542
|
),
|
|
528
543
|
children: [
|
|
529
|
-
f.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2 px-1.5 pt-1 pb-2", children: f.map((s, u) =>
|
|
530
|
-
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
"
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
544
|
+
f.length > 0 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2 px-1.5 pt-1 pb-2", children: f.map((s, u) => (
|
|
545
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: stateless thumbnails, removed by position
|
|
546
|
+
/* @__PURE__ */ g("div", { className: "relative", children: [
|
|
547
|
+
/* @__PURE__ */ t("img", { src: s.url, alt: s.name, className: "h-16 w-16 rounded-lg border border-line-soft object-cover" }),
|
|
548
|
+
/* @__PURE__ */ t(
|
|
549
|
+
"button",
|
|
550
|
+
{
|
|
551
|
+
type: "button",
|
|
552
|
+
"aria-label": `Remove ${s.name}`,
|
|
553
|
+
onClick: () => e.setImages(f.filter((N, me) => me !== u)),
|
|
554
|
+
className: "absolute -top-1.5 -right-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-ink text-surface shadow",
|
|
555
|
+
children: /* @__PURE__ */ t(Ee, { size: 11 })
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
] }, u)
|
|
559
|
+
)) }),
|
|
542
560
|
/* @__PURE__ */ g("div", { className: "flex items-end gap-1", children: [
|
|
543
561
|
/* @__PURE__ */ t(
|
|
544
|
-
|
|
562
|
+
ne,
|
|
545
563
|
{
|
|
546
564
|
label: "Attach images",
|
|
547
565
|
disabled: r || !d || f.length >= l,
|
|
@@ -559,7 +577,7 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
559
577
|
multiple: !0,
|
|
560
578
|
hidden: !0,
|
|
561
579
|
onChange: (s) => {
|
|
562
|
-
|
|
580
|
+
Y(Array.from(s.target.files ?? [])), s.target.value = "";
|
|
563
581
|
}
|
|
564
582
|
}
|
|
565
583
|
),
|
|
@@ -571,22 +589,22 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
571
589
|
onChange: (s) => {
|
|
572
590
|
E(s.target.value), w(!1), C(0);
|
|
573
591
|
},
|
|
574
|
-
onKeyDown:
|
|
575
|
-
onPaste:
|
|
592
|
+
onKeyDown: ze,
|
|
593
|
+
onPaste: Fe,
|
|
576
594
|
rows: 1,
|
|
577
595
|
autoFocus: i,
|
|
578
596
|
disabled: r,
|
|
579
|
-
placeholder:
|
|
597
|
+
placeholder: Le,
|
|
580
598
|
"aria-label": "Message",
|
|
581
|
-
"aria-controls":
|
|
582
|
-
"aria-activedescendant":
|
|
599
|
+
"aria-controls": U ? K : V ? `${K}-files` : void 0,
|
|
600
|
+
"aria-activedescendant": U ? `${K}-${Math.min(y, $.length - 1)}` : V ? `${K}-files-${Math.min(y, L.length - 1)}` : void 0,
|
|
583
601
|
"aria-autocomplete": "list",
|
|
584
602
|
enterKeyHint: "send",
|
|
585
603
|
className: "max-h-[240px] min-h-10 flex-1 resize-none bg-transparent px-1.5 py-2.5 text-[16px] leading-snug text-ink outline-none placeholder:truncate placeholder:text-faint disabled:cursor-not-allowed sm:text-[14.5px]"
|
|
586
604
|
}
|
|
587
605
|
),
|
|
588
|
-
c && I && /* @__PURE__ */ t(
|
|
589
|
-
|
|
606
|
+
c && I && /* @__PURE__ */ t(ne, { label: "Queue for after this turn (Alt+Enter)", className: "mb-0.5 h-9 w-9 rounded-full", onClick: () => {
|
|
607
|
+
G(!0);
|
|
590
608
|
}, children: /* @__PURE__ */ t(Qe, { size: 17 }) }),
|
|
591
609
|
c && !I ? /* @__PURE__ */ t(
|
|
592
610
|
"button",
|
|
@@ -605,7 +623,7 @@ function en({ controller: e, commandContext: n, disabled: r, autoFocus: i, regis
|
|
|
605
623
|
{
|
|
606
624
|
type: "button",
|
|
607
625
|
onClick: () => {
|
|
608
|
-
|
|
626
|
+
G();
|
|
609
627
|
},
|
|
610
628
|
disabled: !ce,
|
|
611
629
|
"aria-label": c ? "Steer the turn in progress" : "Send",
|
|
@@ -630,7 +648,7 @@ const tn = 1e4, nn = 6e4, sn = {
|
|
|
630
648
|
retrying: "retrying"
|
|
631
649
|
};
|
|
632
650
|
function an({ controller: e }) {
|
|
633
|
-
|
|
651
|
+
O(e, D.run, D.pause, D.connection, P.followUps);
|
|
634
652
|
const n = e.store.state, [, r] = S(0), i = n.connection === "reconnecting";
|
|
635
653
|
if (M(() => {
|
|
636
654
|
if (!n.run && !i) return;
|
|
@@ -638,7 +656,7 @@ function an({ controller: e }) {
|
|
|
638
656
|
return () => clearInterval(o);
|
|
639
657
|
}, [n.run, i]), i) {
|
|
640
658
|
const o = n.reconnectingSince ? Date.now() - n.reconnectingSince : 0, a = o >= tn ? ` for ${xe(o)}` : "";
|
|
641
|
-
return /* @__PURE__ */ g("
|
|
659
|
+
return /* @__PURE__ */ g("output", { className: R("flex items-center gap-1.5 text-[12px]", o >= nn ? "text-danger" : "text-warn"), children: [
|
|
642
660
|
/* @__PURE__ */ t(Ze, { size: 12, className: "animate-spin" }),
|
|
643
661
|
" Reconnecting",
|
|
644
662
|
a,
|
|
@@ -647,7 +665,7 @@ function an({ controller: e }) {
|
|
|
647
665
|
}
|
|
648
666
|
if (n.run) {
|
|
649
667
|
const a = [n.run.activity === "tool" && n.run.toolName ? `running ${n.run.toolName}` : sn[n.run.activity]];
|
|
650
|
-
return n.run.step !== null && a.push(`step ${n.run.step + 1}`), a.push(xe(Date.now() - n.run.startedAt) ?? "0s"), e.followUps.length && a.push(`${e.followUps.length} queued`), /* @__PURE__ */ g("
|
|
668
|
+
return n.run.step !== null && a.push(`step ${n.run.step + 1}`), a.push(xe(Date.now() - n.run.startedAt) ?? "0s"), e.followUps.length && a.push(`${e.followUps.length} queued`), /* @__PURE__ */ g("output", { className: "flex items-center gap-1.5 text-[12px] text-accent", children: [
|
|
651
669
|
/* @__PURE__ */ t(et, { size: 12, className: "animate-spin" }),
|
|
652
670
|
" ",
|
|
653
671
|
a.join(" · ")
|
|
@@ -656,7 +674,7 @@ function an({ controller: e }) {
|
|
|
656
674
|
if (n.pause && n.pause.kind !== "fork_seed" && e.deferredPauseId === n.pause.pending_tool_call_id) return null;
|
|
657
675
|
if (n.pause && n.pause.kind !== "fork_seed") {
|
|
658
676
|
const o = n.pause.task_id ? `${n.pause.task_id}: ` : "";
|
|
659
|
-
return /* @__PURE__ */ g("
|
|
677
|
+
return /* @__PURE__ */ g("output", { className: "flex items-center gap-1.5 text-[12px] text-warn", children: [
|
|
660
678
|
/* @__PURE__ */ t(tt, { size: 12 }),
|
|
661
679
|
" ",
|
|
662
680
|
o,
|
|
@@ -670,7 +688,7 @@ function an({ controller: e }) {
|
|
|
670
688
|
" through its fleet"
|
|
671
689
|
] }) : null;
|
|
672
690
|
}
|
|
673
|
-
const
|
|
691
|
+
const Z = "ecui.session.inspector", Se = "ecui.session.tab";
|
|
674
692
|
function De(e, n) {
|
|
675
693
|
try {
|
|
676
694
|
return localStorage.getItem(e) ?? n;
|
|
@@ -678,28 +696,26 @@ function De(e, n) {
|
|
|
678
696
|
return n;
|
|
679
697
|
}
|
|
680
698
|
}
|
|
681
|
-
function
|
|
699
|
+
function ee(e, n) {
|
|
682
700
|
try {
|
|
683
701
|
localStorage.setItem(e, n);
|
|
684
702
|
} catch {
|
|
685
703
|
}
|
|
686
704
|
}
|
|
687
705
|
function rn({ activeId: e }) {
|
|
688
|
-
|
|
689
|
-
const n =
|
|
690
|
-
return r.length < 2 ? null : /* @__PURE__ */ t("
|
|
706
|
+
Me();
|
|
707
|
+
const n = se(), r = A.attached().filter((i) => i.started || i.id === e);
|
|
708
|
+
return r.length < 2 ? null : /* @__PURE__ */ t("nav", { className: "flex h-9 shrink-0 items-end gap-0.5 overflow-x-auto border-b border-line bg-surface-alt px-2", "aria-label": "Open sessions", children: r.map((i) => {
|
|
691
709
|
const m = Mt(i.store.state, { key: i.id, agent: i.agent?.name ?? null, attention: null, draft: "", createdAt: i.createdAt }), o = i.id === e;
|
|
692
710
|
return /* @__PURE__ */ g(
|
|
693
711
|
"div",
|
|
694
712
|
{
|
|
695
|
-
|
|
696
|
-
"aria-selected": o,
|
|
697
|
-
className: $(
|
|
713
|
+
className: R(
|
|
698
714
|
"group flex h-8 max-w-[14rem] shrink-0 items-center gap-1.5 rounded-t-md border border-b-0 pr-1 pl-2.5 text-[12.5px]",
|
|
699
715
|
o ? "border-line bg-bg font-semibold text-ink" : "border-transparent text-muted hover:bg-surface-hover hover:text-ink"
|
|
700
716
|
),
|
|
701
717
|
children: [
|
|
702
|
-
/* @__PURE__ */ g("button", { type: "button", className: "flex min-w-0 items-center gap-1.5", onClick: () => n(
|
|
718
|
+
/* @__PURE__ */ g("button", { type: "button", className: "flex min-w-0 items-center gap-1.5", "aria-current": o ? "page" : void 0, onClick: () => n(J(i.id)), children: [
|
|
703
719
|
/* @__PURE__ */ t(Tt, { row: m }),
|
|
704
720
|
/* @__PURE__ */ t("span", { className: "truncate", children: i.title() })
|
|
705
721
|
] }),
|
|
@@ -711,11 +727,11 @@ function rn({ activeId: e }) {
|
|
|
711
727
|
onClick: () => {
|
|
712
728
|
if (A.detach(i.id), o) {
|
|
713
729
|
const a = A.attached().find((c) => c.started);
|
|
714
|
-
n(a ?
|
|
730
|
+
n(a ? J(a.id) : $t());
|
|
715
731
|
}
|
|
716
732
|
},
|
|
717
733
|
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded text-faint opacity-0 group-hover:opacity-100 hover:bg-surface-hover hover:text-ink focus:opacity-100 max-md:opacity-100",
|
|
718
|
-
children: /* @__PURE__ */ t(
|
|
734
|
+
children: /* @__PURE__ */ t(Ee, { size: 12 })
|
|
719
735
|
}
|
|
720
736
|
)
|
|
721
737
|
]
|
|
@@ -725,7 +741,7 @@ function rn({ activeId: e }) {
|
|
|
725
741
|
}) });
|
|
726
742
|
}
|
|
727
743
|
function on({ controller: e }) {
|
|
728
|
-
|
|
744
|
+
O(e, D.session, P.list);
|
|
729
745
|
const [n, r] = S(!1), [i, m] = S(""), o = z(null), a = e.title();
|
|
730
746
|
return n ? /* @__PURE__ */ t(
|
|
731
747
|
"input",
|
|
@@ -758,20 +774,20 @@ function on({ controller: e }) {
|
|
|
758
774
|
) });
|
|
759
775
|
}
|
|
760
776
|
function cn({ controller: e }) {
|
|
761
|
-
|
|
762
|
-
const n =
|
|
763
|
-
d(h),
|
|
764
|
-
}, []), x = z(null),
|
|
777
|
+
O(e, D.reset, D.session, P.list, P.draft);
|
|
778
|
+
const n = se(), { toast: r } = Ae(), [i, m] = S(() => De(Z, "1") === "1"), [o, a] = S(!1), [c, d] = S(() => De(Se, "brief")), l = $e(e), f = H((h) => {
|
|
779
|
+
d(h), ee(Se, h);
|
|
780
|
+
}, []), x = z(null), k = H((h) => {
|
|
765
781
|
x.current = h;
|
|
766
|
-
}, []),
|
|
767
|
-
() => ({ navigate: (h) => n(h), toast: r, openDialog:
|
|
782
|
+
}, []), p = B(
|
|
783
|
+
() => ({ navigate: (h) => n(h), toast: r, openDialog: Pt }),
|
|
768
784
|
[n, r]
|
|
769
|
-
),
|
|
785
|
+
), b = H(
|
|
770
786
|
async (h) => {
|
|
771
787
|
const T = h.key.slice(2);
|
|
772
788
|
try {
|
|
773
|
-
const v = await
|
|
774
|
-
A.attach(v.id).seedDraft(h.text), r("Editing in a copy of the session from before that message. The original is kept.", "info"), n(
|
|
789
|
+
const v = await Rt.forkSession(e.id, { before_message: T, title: e.session?.title ?? null });
|
|
790
|
+
A.attach(v.id).seedDraft(h.text), r("Editing in a copy of the session from before that message. The original is kept.", "info"), n(J(v.id));
|
|
775
791
|
} catch (v) {
|
|
776
792
|
r(`Couldn't edit: ${zt(v)}`, "danger");
|
|
777
793
|
}
|
|
@@ -780,14 +796,14 @@ function cn({ controller: e }) {
|
|
|
780
796
|
);
|
|
781
797
|
M(() => {
|
|
782
798
|
const h = (v) => {
|
|
783
|
-
f(String(v.detail)), window.matchMedia("(min-width: 1280px)").matches ? (m(!0), Z
|
|
784
|
-
}, T = () =>
|
|
799
|
+
f(String(v.detail)), window.matchMedia("(min-width: 1280px)").matches ? (m(!0), ee(Z, "1")) : a(!0);
|
|
800
|
+
}, T = () => y();
|
|
785
801
|
return window.addEventListener("ecui:inspector", h), window.addEventListener("ecui:toggle-inspector", T), () => {
|
|
786
802
|
window.removeEventListener("ecui:inspector", h), window.removeEventListener("ecui:toggle-inspector", T);
|
|
787
803
|
};
|
|
788
804
|
});
|
|
789
|
-
const
|
|
790
|
-
window.matchMedia("(min-width: 1280px)").matches ? m((h) => (Z
|
|
805
|
+
const y = () => {
|
|
806
|
+
window.matchMedia("(min-width: 1280px)").matches ? m((h) => (ee(Z, h ? "0" : "1"), !h)) : a(!0);
|
|
791
807
|
}, C = e.store.state.entries, F = !e.loading && C.length === 0 && !e.running(), w = l.length > 0;
|
|
792
808
|
return /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1", children: [
|
|
793
809
|
/* @__PURE__ */ g("section", { className: "flex min-w-0 flex-1 flex-col bg-bg", children: [
|
|
@@ -795,21 +811,21 @@ function cn({ controller: e }) {
|
|
|
795
811
|
/* @__PURE__ */ t(on, { controller: e }),
|
|
796
812
|
/* @__PURE__ */ t("div", { className: "hidden min-w-0 md:block", children: /* @__PURE__ */ t(be, { controller: e }) }),
|
|
797
813
|
/* @__PURE__ */ t(Ft, { controller: e }),
|
|
798
|
-
w && /* @__PURE__ */ g(
|
|
814
|
+
w && /* @__PURE__ */ g(ne, { label: i ? "Hide panels" : "Show panels", onClick: y, children: [
|
|
799
815
|
i ? /* @__PURE__ */ t(nt, { size: 17, className: "max-xl:hidden" }) : null,
|
|
800
|
-
/* @__PURE__ */ t(st, { size: 17, className:
|
|
816
|
+
/* @__PURE__ */ t(st, { size: 17, className: R(i && "xl:hidden") })
|
|
801
817
|
] })
|
|
802
818
|
] }),
|
|
803
819
|
/* @__PURE__ */ t("div", { className: "flex shrink-0 items-center border-b border-line bg-surface px-2 py-1 md:hidden", children: /* @__PURE__ */ t(be, { controller: e }) }),
|
|
804
|
-
e.loading && !C.length ? /* @__PURE__ */ t(
|
|
820
|
+
e.loading && !C.length ? /* @__PURE__ */ t(Te, {}) : F ? /* @__PURE__ */ t(Ot, { onPick: (h) => {
|
|
805
821
|
e.submit(h);
|
|
806
822
|
} }) : /* @__PURE__ */ t(Bt, { controller: e, onEdit: e.isWorker() ? void 0 : (h) => {
|
|
807
|
-
|
|
823
|
+
b(h);
|
|
808
824
|
}, renderDiff: ye.renderDiff }),
|
|
809
825
|
/* @__PURE__ */ t("div", { className: "shrink-0 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-6 sm:pb-4", children: /* @__PURE__ */ g("div", { className: "mx-auto flex w-full max-w-3xl flex-col gap-2", children: [
|
|
810
826
|
/* @__PURE__ */ t(Lt, { controller: e, collisions: ye.collisions }),
|
|
811
827
|
/* @__PURE__ */ t(an, { controller: e }),
|
|
812
|
-
/* @__PURE__ */ t(en, { controller: e, commandContext:
|
|
828
|
+
/* @__PURE__ */ t(en, { controller: e, commandContext: p, autoFocus: !0, registerHandle: k })
|
|
813
829
|
] }) })
|
|
814
830
|
] }),
|
|
815
831
|
w && i && /* @__PURE__ */ t("aside", { className: "hidden w-[22rem] shrink-0 border-l border-line bg-surface xl:flex", "aria-label": "Session panels", children: /* @__PURE__ */ t(ke, { controller: e, tab: c, onTab: f, className: "w-full" }) }),
|
|
@@ -817,18 +833,18 @@ function cn({ controller: e }) {
|
|
|
817
833
|
] });
|
|
818
834
|
}
|
|
819
835
|
function hn() {
|
|
820
|
-
const { sessionId: e } = je(), [n] = qe(), r =
|
|
821
|
-
|
|
822
|
-
const i =
|
|
836
|
+
const { sessionId: e } = je(), [n] = qe(), r = se();
|
|
837
|
+
Me();
|
|
838
|
+
const i = X((f) => f.agents), m = X((f) => f.features), o = X((f) => f.status === "ready" || f.status === "error"), a = Ct(i, m), c = e === "new" && o && a.length === 0;
|
|
823
839
|
M(() => {
|
|
824
840
|
if (e !== "new" || !o || a.length === 0) return;
|
|
825
|
-
const f = n.get("agent"), x = a.find((
|
|
841
|
+
const f = n.get("agent"), x = a.find((b) => b.name === f) ?? a.find((b) => b.name === "chat") ?? a[0] ?? null, k = n.get("workspace"), p = A.create({
|
|
826
842
|
agent: x,
|
|
827
843
|
model: n.get("model"),
|
|
828
844
|
permissionMode: n.get("mode"),
|
|
829
|
-
workspace:
|
|
845
|
+
workspace: k ? { path: k, worktree: n.get("worktree") !== "0" } : null
|
|
830
846
|
});
|
|
831
|
-
r(
|
|
847
|
+
r(J(p.id), { replace: !0 });
|
|
832
848
|
}, [e, o]);
|
|
833
849
|
const d = Et(e && e !== "new" ? e : null), l = !!d?.started;
|
|
834
850
|
return M(() => {
|
|
@@ -838,7 +854,7 @@ function hn() {
|
|
|
838
854
|
return A.get(e) || A.attach(e), A.show(e), () => {
|
|
839
855
|
A.activeId === e && A.show(null);
|
|
840
856
|
};
|
|
841
|
-
}, [e]), c ? /* @__PURE__ */ t(we, { icon: /* @__PURE__ */ t(pe, { size: 20 }), title: "No agent to start a session with here", children: "Sessions here start from elsewhere in the app." }) : !d || e === "new" ? /* @__PURE__ */ t(
|
|
857
|
+
}, [e]), c ? /* @__PURE__ */ t(we, { icon: /* @__PURE__ */ t(pe, { size: 20 }), title: "No agent to start a session with here", children: "Sessions here start from elsewhere in the app." }) : !d || e === "new" ? /* @__PURE__ */ t(Te, {}) : d.missing ? /* @__PURE__ */ t(
|
|
842
858
|
we,
|
|
843
859
|
{
|
|
844
860
|
icon: /* @__PURE__ */ t(pe, { size: 20 }),
|