@claude-sessions/web 0.3.3 → 0.3.4
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/build/client/_app/immutable/assets/0.012AOslr.css +1 -0
- package/build/client/_app/immutable/assets/0.012AOslr.css.br +0 -0
- package/build/client/_app/immutable/assets/0.012AOslr.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{HouQR_BO.js → B8FrDj8m.js} +1 -1
- package/build/client/_app/immutable/chunks/B8FrDj8m.js.br +0 -0
- package/build/client/_app/immutable/chunks/B8FrDj8m.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CzuOkoRV.js → CXOnRY8x.js} +1 -1
- package/build/client/_app/immutable/chunks/CXOnRY8x.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXOnRY8x.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C_89ThaI.js +90 -0
- package/build/client/_app/immutable/chunks/C_89ThaI.js.br +0 -0
- package/build/client/_app/immutable/chunks/C_89ThaI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CbJths_J.js +1 -0
- package/build/client/_app/immutable/chunks/CbJths_J.js.br +0 -0
- package/build/client/_app/immutable/chunks/CbJths_J.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cyo3OVYg.js +2 -0
- package/build/client/_app/immutable/chunks/Cyo3OVYg.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cyo3OVYg.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dfkti507.js +1 -0
- package/build/client/_app/immutable/chunks/Dfkti507.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dfkti507.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dz2P4HIo.js +1 -0
- package/build/client/_app/immutable/chunks/Dz2P4HIo.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dz2P4HIo.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.DQ0sG0qQ.js +2 -0
- package/build/client/_app/immutable/entry/app.DQ0sG0qQ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DQ0sG0qQ.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BF7HJ4fZ.js +1 -0
- package/build/client/_app/immutable/entry/start.BF7HJ4fZ.js.br +2 -0
- package/build/client/_app/immutable/entry/start.BF7HJ4fZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.B2tjwvIL.js +1 -0
- package/build/client/_app/immutable/nodes/0.B2tjwvIL.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.B2tjwvIL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.BcsF7AIE.js +1 -0
- package/build/client/_app/immutable/nodes/1.BcsF7AIE.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BcsF7AIE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BOGTlhJ8.js +4 -0
- package/build/client/_app/immutable/nodes/2.BOGTlhJ8.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BOGTlhJ8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.B6_hPOud.js +4 -0
- package/build/client/_app/immutable/nodes/3.B6_hPOud.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.B6_hPOud.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/0-Bz7vAUYh.js +17 -0
- package/build/server/chunks/0-Bz7vAUYh.js.map +1 -0
- package/build/server/chunks/{1-NzhdkXbT.js → 1-Dpd0kp2f.js} +2 -2
- package/build/server/chunks/{1-NzhdkXbT.js.map → 1-Dpd0kp2f.js.map} +1 -1
- package/build/server/chunks/2-CH9DzrUp.js +9 -0
- package/build/server/chunks/2-CH9DzrUp.js.map +1 -0
- package/build/server/chunks/3-p3bGcXaZ.js +9 -0
- package/build/server/chunks/3-p3bGcXaZ.js.map +1 -0
- package/build/server/chunks/InputModal-CzUvurky.js +36 -0
- package/build/server/chunks/InputModal-CzUvurky.js.map +1 -0
- package/build/server/chunks/Toast-BzlMSW2A.js +80 -0
- package/build/server/chunks/Toast-BzlMSW2A.js.map +1 -0
- package/build/server/chunks/_layout.svelte-Dr7pTiAq.js +105 -0
- package/build/server/chunks/_layout.svelte-Dr7pTiAq.js.map +1 -0
- package/build/server/chunks/{_page.svelte-C7sseaTW.js → _page.svelte-D8oP1bKp.js} +43 -3
- package/build/server/chunks/_page.svelte-D8oP1bKp.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Bgd-L7N_.js → _page.svelte-OvxQOUCZ.js} +405 -346
- package/build/server/chunks/_page.svelte-OvxQOUCZ.js.map +1 -0
- package/build/server/chunks/{_server.ts-DZQssvoI.js → _server.ts-BGkiZqyw.js} +2 -2
- package/build/server/chunks/{_server.ts-DZQssvoI.js.map → _server.ts-BGkiZqyw.js.map} +1 -1
- package/build/server/chunks/index2-gtN4acH3.js.map +1 -1
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +6 -6
- package/build/server/manifest.js.map +1 -1
- package/package.json +2 -2
- package/build/client/_app/immutable/assets/0.B2yA_bPQ.css +0 -1
- package/build/client/_app/immutable/assets/0.B2yA_bPQ.css.br +0 -0
- package/build/client/_app/immutable/assets/0.B2yA_bPQ.css.gz +0 -0
- package/build/client/_app/immutable/chunks/Bapp9IYO.js +0 -1
- package/build/client/_app/immutable/chunks/Bapp9IYO.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bapp9IYO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BzTxzCCu.js +0 -1
- package/build/client/_app/immutable/chunks/BzTxzCCu.js.br +0 -0
- package/build/client/_app/immutable/chunks/BzTxzCCu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CUTXPORg.js +0 -1
- package/build/client/_app/immutable/chunks/CUTXPORg.js.br +0 -0
- package/build/client/_app/immutable/chunks/CUTXPORg.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CzuOkoRV.js.br +0 -0
- package/build/client/_app/immutable/chunks/CzuOkoRV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DHCLGQT_.js +0 -1
- package/build/client/_app/immutable/chunks/DHCLGQT_.js.br +0 -0
- package/build/client/_app/immutable/chunks/DHCLGQT_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DUNnSDh5.js +0 -66
- package/build/client/_app/immutable/chunks/DUNnSDh5.js.br +0 -0
- package/build/client/_app/immutable/chunks/DUNnSDh5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Di6YbRZt.js +0 -2
- package/build/client/_app/immutable/chunks/Di6YbRZt.js.br +0 -0
- package/build/client/_app/immutable/chunks/Di6YbRZt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HouQR_BO.js.br +0 -0
- package/build/client/_app/immutable/chunks/HouQR_BO.js.gz +0 -0
- package/build/client/_app/immutable/chunks/IVrlObbe.js +0 -25
- package/build/client/_app/immutable/chunks/IVrlObbe.js.br +0 -0
- package/build/client/_app/immutable/chunks/IVrlObbe.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Dj3HhwA8.js +0 -2
- package/build/client/_app/immutable/entry/app.Dj3HhwA8.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Dj3HhwA8.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DhjCZi9N.js +0 -1
- package/build/client/_app/immutable/entry/start.DhjCZi9N.js.br +0 -2
- package/build/client/_app/immutable/entry/start.DhjCZi9N.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CAbelkQT.js +0 -1
- package/build/client/_app/immutable/nodes/0.CAbelkQT.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CAbelkQT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DYaH4O8k.js +0 -1
- package/build/client/_app/immutable/nodes/1.DYaH4O8k.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DYaH4O8k.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.VvV6w9cZ.js +0 -5
- package/build/client/_app/immutable/nodes/2.VvV6w9cZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.VvV6w9cZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.D_uYLiIh.js +0 -4
- package/build/client/_app/immutable/nodes/3.D_uYLiIh.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.D_uYLiIh.js.gz +0 -0
- package/build/server/chunks/0-CWHakFRJ.js +0 -17
- package/build/server/chunks/0-CWHakFRJ.js.map +0 -1
- package/build/server/chunks/2-DrysGJ9C.js +0 -9
- package/build/server/chunks/2-DrysGJ9C.js.map +0 -1
- package/build/server/chunks/3-D4BIPCPc.js +0 -9
- package/build/server/chunks/3-D4BIPCPc.js.map +0 -1
- package/build/server/chunks/Toast-CTZhGpnd.js +0 -45
- package/build/server/chunks/Toast-CTZhGpnd.js.map +0 -1
- package/build/server/chunks/_layout.svelte-D9DyGgZM.js +0 -61
- package/build/server/chunks/_layout.svelte-D9DyGgZM.js.map +0 -1
- package/build/server/chunks/_page.svelte-Bgd-L7N_.js.map +0 -1
- package/build/server/chunks/_page.svelte-C7sseaTW.js.map +0 -1
- package/build/server/chunks/config-DKyxRWWg.js +0 -20
- package/build/server/chunks/config-DKyxRWWg.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Y as escape_html, Z as is_array, _ as get_prototype_of, $ as object_prototype } from './index-CMS8WiSi.js';
|
|
2
|
+
import { T as Toast, C as ConfirmModal, f as formatProjectName, a as appConfig, t as truncate, b as formatDate, m as maskHomePath } from './Toast-BzlMSW2A.js';
|
|
3
|
+
import { I as InputModal } from './InputModal-CzUvurky.js';
|
|
2
4
|
import { c as store_get, e as ensure_array_like, b as attr_class, a as attr, s as stringify, u as unsubscribe_stores, d as attributes, f as await_block, g as clsx } from './index2-gtN4acH3.js';
|
|
3
|
-
import { T as Toast, f as formatProjectName, t as truncate, a as formatDate } from './Toast-CTZhGpnd.js';
|
|
4
|
-
import { a as appConfig, m as maskHomePath } from './config-DKyxRWWg.js';
|
|
5
5
|
import { t as sortProjects, u as getDisplayTitle } from './index3-DVZVsHMK.js';
|
|
6
6
|
import 'marked';
|
|
7
7
|
import 'fs';
|
|
@@ -207,252 +207,6 @@ const parseIdeTags = (content) => {
|
|
|
207
207
|
}
|
|
208
208
|
return segments;
|
|
209
209
|
};
|
|
210
|
-
function TooltipButton($$renderer, $$props) {
|
|
211
|
-
let {
|
|
212
|
-
title,
|
|
213
|
-
children,
|
|
214
|
-
position = "bottom",
|
|
215
|
-
class: className = "",
|
|
216
|
-
$$slots,
|
|
217
|
-
$$events,
|
|
218
|
-
...buttonProps
|
|
219
|
-
} = $$props;
|
|
220
|
-
$$renderer.push(`<button${attributes(
|
|
221
|
-
{
|
|
222
|
-
class: `tooltip-btn ${stringify(className)}`,
|
|
223
|
-
...buttonProps
|
|
224
|
-
},
|
|
225
|
-
"svelte-1yfjzin"
|
|
226
|
-
)}>`);
|
|
227
|
-
children($$renderer);
|
|
228
|
-
$$renderer.push(`<!----></button> `);
|
|
229
|
-
{
|
|
230
|
-
$$renderer.push("<!--[!-->");
|
|
231
|
-
}
|
|
232
|
-
$$renderer.push(`<!--]-->`);
|
|
233
|
-
}
|
|
234
|
-
function ProjectTree($$renderer, $$props) {
|
|
235
|
-
$$renderer.component(($$renderer2) => {
|
|
236
|
-
var $$store_subs;
|
|
237
|
-
let {
|
|
238
|
-
projects,
|
|
239
|
-
projectSessions,
|
|
240
|
-
projectSessionData,
|
|
241
|
-
expandedProjects,
|
|
242
|
-
selectedSession,
|
|
243
|
-
loadingProject,
|
|
244
|
-
onRenameSession,
|
|
245
|
-
onDeleteSession,
|
|
246
|
-
onResumeSession
|
|
247
|
-
} = $$props;
|
|
248
|
-
const getSessionData = (projectName, sessionId) => {
|
|
249
|
-
return projectSessionData.get(projectName)?.get(sessionId);
|
|
250
|
-
};
|
|
251
|
-
const getDisplayTitle2 = (session) => {
|
|
252
|
-
const data = getSessionData(session.projectName, session.id);
|
|
253
|
-
if (data?.customTitle) return data.customTitle;
|
|
254
|
-
if (data?.currentSummary) {
|
|
255
|
-
const summary = data.currentSummary;
|
|
256
|
-
return summary.length > 60 ? summary.slice(0, 57) + "..." : summary;
|
|
257
|
-
}
|
|
258
|
-
if (session.title && session.title !== "Untitled") return session.title;
|
|
259
|
-
return "Untitled";
|
|
260
|
-
};
|
|
261
|
-
const getTooltipText = (session) => {
|
|
262
|
-
const data = getSessionData(session.projectName, session.id);
|
|
263
|
-
if (data?.customTitle && data?.currentSummary) {
|
|
264
|
-
return data.currentSummary;
|
|
265
|
-
}
|
|
266
|
-
if (data?.currentSummary && session.title && session.title !== "Untitled") {
|
|
267
|
-
return session.title;
|
|
268
|
-
}
|
|
269
|
-
if (data?.currentSummary) {
|
|
270
|
-
return data.currentSummary;
|
|
271
|
-
}
|
|
272
|
-
return session.title ?? "No summary available";
|
|
273
|
-
};
|
|
274
|
-
const getSessionInfo = (session) => {
|
|
275
|
-
const data = getSessionData(session.projectName, session.id);
|
|
276
|
-
const todoCount = data?.todos ? data.todos.sessionTodos.length + data.todos.agentTodos.reduce((acc, at) => acc + at.todos.length, 0) : 0;
|
|
277
|
-
return {
|
|
278
|
-
agents: data?.agents.length ?? 0,
|
|
279
|
-
todos: todoCount,
|
|
280
|
-
summaries: data?.summaries.length ?? 0
|
|
281
|
-
};
|
|
282
|
-
};
|
|
283
|
-
const sortedProjects = sortProjects(projects, {
|
|
284
|
-
currentProjectName: store_get($$store_subs ??= {}, "$appConfig", appConfig).currentProjectName,
|
|
285
|
-
homeDir: store_get($$store_subs ??= {}, "$appConfig", appConfig).homeDir
|
|
286
|
-
});
|
|
287
|
-
let expandedSessions = /* @__PURE__ */ new Set();
|
|
288
|
-
let draggedSession = null;
|
|
289
|
-
let dropTargetProject = null;
|
|
290
|
-
$$renderer2.push(`<aside class="bg-gh-bg-secondary border border-gh-border rounded-lg overflow-hidden flex flex-col"><h2 class="p-4 text-base font-semibold border-b border-gh-border bg-gh-bg">Projects (${escape_html(sortedProjects.length)})</h2> <ul class="overflow-y-auto flex-1"><!--[-->`);
|
|
291
|
-
const each_array = ensure_array_like(sortedProjects);
|
|
292
|
-
for (let $$index_4 = 0, $$length = each_array.length; $$index_4 < $$length; $$index_4++) {
|
|
293
|
-
let project = each_array[$$index_4];
|
|
294
|
-
const isDropTarget = dropTargetProject === project.name;
|
|
295
|
-
$$renderer2.push(`<li class="border-b border-gh-border-subtle"><button${attr_class(`w-full py-3 px-4 bg-transparent border-none text-gh-text cursor-pointer text-left flex items-center gap-2 font-medium hover:bg-gh-border-subtle ${stringify(expandedProjects.has(project.name) ? "bg-gh-accent/10" : "")} ${stringify(isDropTarget ? "bg-gh-green/20 ring-2 ring-gh-green ring-inset" : "")}`)}><span class="text-xs w-3 text-gh-text-secondary">${escape_html(expandedProjects.has(project.name) ? "▼" : "▶")}</span> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap"${attr("title", project.displayName)}>${escape_html(formatProjectName(project.displayName))}</span> <span class="bg-gh-border px-2 py-0.5 rounded-full text-xs font-normal">${escape_html(project.sessionCount)}</span></button> `);
|
|
296
|
-
if (expandedProjects.has(project.name)) {
|
|
297
|
-
$$renderer2.push("<!--[-->");
|
|
298
|
-
$$renderer2.push(`<ul class="bg-gh-bg">`);
|
|
299
|
-
if (loadingProject === project.name) {
|
|
300
|
-
$$renderer2.push("<!--[-->");
|
|
301
|
-
$$renderer2.push(`<li class="py-2 px-8 text-gh-text-secondary text-sm">Loading...</li>`);
|
|
302
|
-
} else {
|
|
303
|
-
$$renderer2.push("<!--[!-->");
|
|
304
|
-
$$renderer2.push(`<!--[-->`);
|
|
305
|
-
const each_array_1 = ensure_array_like(projectSessions.get(project.name) ?? []);
|
|
306
|
-
for (let $$index_3 = 0, $$length2 = each_array_1.length; $$index_3 < $$length2; $$index_3++) {
|
|
307
|
-
let session = each_array_1[$$index_3];
|
|
308
|
-
const isSelected = selectedSession?.id === session.id;
|
|
309
|
-
const isDragging = draggedSession?.id === session.id;
|
|
310
|
-
const sessionInfo = getSessionInfo(session);
|
|
311
|
-
const displayTitle = getDisplayTitle2(session);
|
|
312
|
-
const tooltipText = getTooltipText(session);
|
|
313
|
-
const data = getSessionData(session.projectName, session.id);
|
|
314
|
-
const isSummaryFallback = !data?.customTitle && !data?.currentSummary;
|
|
315
|
-
const isExpanded = expandedSessions.has(session.id);
|
|
316
|
-
const hasSubItems = sessionInfo.summaries > 0 || sessionInfo.agents > 0 || sessionInfo.todos > 0;
|
|
317
|
-
$$renderer2.push(`<li${attr_class(`relative border-t border-gh-border-subtle group ${stringify(isSelected ? "bg-gh-accent/20 border-l-3 border-l-gh-accent" : "")} ${stringify(isDragging ? "opacity-50" : "")}`)} draggable="true"><div class="flex items-center">`);
|
|
318
|
-
if (hasSubItems) {
|
|
319
|
-
$$renderer2.push("<!--[-->");
|
|
320
|
-
$$renderer2.push(`<button class="flex-shrink-0 w-5 h-8 flex items-center justify-center bg-transparent border-none cursor-pointer text-gh-text-secondary text-xs ml-1 z-10 relative"${attr("title", isExpanded ? "Collapse" : "Expand")}>${escape_html(isExpanded ? "▼" : "▶")}</button>`);
|
|
321
|
-
} else {
|
|
322
|
-
$$renderer2.push("<!--[!-->");
|
|
323
|
-
$$renderer2.push(`<span class="w-5 ml-1"></span>`);
|
|
324
|
-
}
|
|
325
|
-
$$renderer2.push(`<!--]--> <button class="flex-1 min-w-0 py-2 pr-2 bg-transparent border-none text-gh-text cursor-pointer text-left flex items-center gap-2 text-sm"${attr("title", tooltipText)}><span${attr_class(`flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${stringify(isSummaryFallback ? "italic text-gh-text-secondary" : "")}`)}>${escape_html(displayTitle)}</span> <span class="flex-shrink-0 flex items-center gap-2 text-xs text-gh-text-secondary"><span class="flex items-center gap-0.5"${attr("title", `${stringify(session.messageCount)} messages`)}><span>💬</span><span>${escape_html(session.messageCount)}</span></span> `);
|
|
326
|
-
if (sessionInfo.agents > 0) {
|
|
327
|
-
$$renderer2.push("<!--[-->");
|
|
328
|
-
$$renderer2.push(`<span class="flex items-center gap-0.5"${attr("title", `${stringify(sessionInfo.agents)} agent(s)`)}><span>🤖</span><span>${escape_html(sessionInfo.agents)}</span></span>`);
|
|
329
|
-
} else {
|
|
330
|
-
$$renderer2.push("<!--[!-->");
|
|
331
|
-
}
|
|
332
|
-
$$renderer2.push(`<!--]--> `);
|
|
333
|
-
if (sessionInfo.todos > 0) {
|
|
334
|
-
$$renderer2.push("<!--[-->");
|
|
335
|
-
$$renderer2.push(`<span class="flex items-center gap-0.5"${attr("title", `${stringify(sessionInfo.todos)} todo(s)`)}><span>📋</span><span>${escape_html(sessionInfo.todos)}</span></span>`);
|
|
336
|
-
} else {
|
|
337
|
-
$$renderer2.push("<!--[!-->");
|
|
338
|
-
}
|
|
339
|
-
$$renderer2.push(`<!--]--></span></button> <div${attr_class(`absolute left-0 right-0 top-0 h-8 flex items-center opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none ${stringify(isSelected ? "bg-gradient-to-r from-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))] via-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))] to-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))]" : "bg-gradient-to-r from-gh-bg via-gh-bg to-gh-bg")}`)}><span class="flex-1 min-w-0 pl-7 pr-2 text-xs text-gh-text-secondary italic overflow-hidden text-ellipsis whitespace-nowrap">`);
|
|
340
|
-
if (data?.currentSummary) {
|
|
341
|
-
$$renderer2.push("<!--[-->");
|
|
342
|
-
$$renderer2.push(`${escape_html(data.currentSummary.length > 50 ? data.currentSummary.slice(0, 47) + "..." : data.currentSummary)}`);
|
|
343
|
-
} else {
|
|
344
|
-
$$renderer2.push("<!--[!-->");
|
|
345
|
-
$$renderer2.push(`${escape_html(displayTitle)}`);
|
|
346
|
-
}
|
|
347
|
-
$$renderer2.push(`<!--]--></span> <div class="flex-shrink-0 flex gap-0.5 pr-2 pointer-events-auto">`);
|
|
348
|
-
if (onResumeSession) {
|
|
349
|
-
$$renderer2.push("<!--[-->");
|
|
350
|
-
TooltipButton($$renderer2, {
|
|
351
|
-
class: "p-1 rounded hover:bg-gh-green/20 text-xs",
|
|
352
|
-
onclick: (e) => onResumeSession(e, session),
|
|
353
|
-
title: "Resume session",
|
|
354
|
-
children: ($$renderer3) => {
|
|
355
|
-
$$renderer3.push(`<!---->▶️`);
|
|
356
|
-
},
|
|
357
|
-
$$slots: { default: true }
|
|
358
|
-
});
|
|
359
|
-
} else {
|
|
360
|
-
$$renderer2.push("<!--[!-->");
|
|
361
|
-
}
|
|
362
|
-
$$renderer2.push(`<!--]--> `);
|
|
363
|
-
TooltipButton($$renderer2, {
|
|
364
|
-
class: "p-1 rounded hover:bg-gh-border text-xs",
|
|
365
|
-
onclick: (e) => onRenameSession(e, session),
|
|
366
|
-
title: "Rename",
|
|
367
|
-
children: ($$renderer3) => {
|
|
368
|
-
$$renderer3.push(`<!---->✏️`);
|
|
369
|
-
},
|
|
370
|
-
$$slots: { default: true }
|
|
371
|
-
});
|
|
372
|
-
$$renderer2.push(`<!----> `);
|
|
373
|
-
TooltipButton($$renderer2, {
|
|
374
|
-
class: "p-1 rounded hover:bg-gh-red/20 text-xs",
|
|
375
|
-
onclick: (e) => onDeleteSession(e, session),
|
|
376
|
-
title: "Delete",
|
|
377
|
-
children: ($$renderer3) => {
|
|
378
|
-
$$renderer3.push(`<!---->🗑️`);
|
|
379
|
-
},
|
|
380
|
-
$$slots: { default: true }
|
|
381
|
-
});
|
|
382
|
-
$$renderer2.push(`<!----></div></div></div> `);
|
|
383
|
-
if (isExpanded && hasSubItems) {
|
|
384
|
-
$$renderer2.push("<!--[-->");
|
|
385
|
-
$$renderer2.push(`<ul class="bg-gh-bg-secondary/50 border-t border-gh-border-subtle text-xs">`);
|
|
386
|
-
if (data?.summaries && data.summaries.length > 0) {
|
|
387
|
-
$$renderer2.push("<!--[-->");
|
|
388
|
-
$$renderer2.push(`<!--[-->`);
|
|
389
|
-
const each_array_2 = ensure_array_like(data.summaries);
|
|
390
|
-
for (let idx = 0, $$length3 = each_array_2.length; idx < $$length3; idx++) {
|
|
391
|
-
let summary = each_array_2[idx];
|
|
392
|
-
$$renderer2.push(`<li${attr_class(`py-1.5 px-4 pl-8 hover:bg-gh-border-subtle/50 flex flex-col gap-0.5 ${stringify(idx === 0 ? "text-gh-text" : "text-gh-text-secondary")}`)}${attr("title", summary.summary)}><div class="flex items-start gap-2"><span class="flex-shrink-0">📝</span> <span class="overflow-hidden text-ellipsis line-clamp-2">${escape_html(summary.summary.length > 100 ? summary.summary.slice(0, 97) + "..." : summary.summary)}</span></div> `);
|
|
393
|
-
if (summary.timestamp) {
|
|
394
|
-
$$renderer2.push("<!--[-->");
|
|
395
|
-
$$renderer2.push(`<span class="pl-6 text-[10px] text-gh-text-secondary/70">${escape_html(new Date(summary.timestamp).toLocaleString())}</span>`);
|
|
396
|
-
} else {
|
|
397
|
-
$$renderer2.push("<!--[!-->");
|
|
398
|
-
}
|
|
399
|
-
$$renderer2.push(`<!--]--></li>`);
|
|
400
|
-
}
|
|
401
|
-
$$renderer2.push(`<!--]-->`);
|
|
402
|
-
} else {
|
|
403
|
-
$$renderer2.push("<!--[!-->");
|
|
404
|
-
}
|
|
405
|
-
$$renderer2.push(`<!--]--> `);
|
|
406
|
-
if (data?.todos?.sessionTodos && data.todos.sessionTodos.length > 0) {
|
|
407
|
-
$$renderer2.push("<!--[-->");
|
|
408
|
-
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"><span class="flex-shrink-0">📋</span> <span>Session Todos (${escape_html(data.todos.sessionTodos.length)})</span></li>`);
|
|
409
|
-
} else {
|
|
410
|
-
$$renderer2.push("<!--[!-->");
|
|
411
|
-
}
|
|
412
|
-
$$renderer2.push(`<!--]--> `);
|
|
413
|
-
if (data?.todos?.agentTodos) {
|
|
414
|
-
$$renderer2.push("<!--[-->");
|
|
415
|
-
$$renderer2.push(`<!--[-->`);
|
|
416
|
-
const each_array_3 = ensure_array_like(data.todos.agentTodos);
|
|
417
|
-
for (let $$index_1 = 0, $$length3 = each_array_3.length; $$index_1 < $$length3; $$index_1++) {
|
|
418
|
-
let agentTodo = each_array_3[$$index_1];
|
|
419
|
-
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"><span class="flex-shrink-0">📋</span> <span>Agent Todos (${escape_html(agentTodo.todos.length)})</span></li>`);
|
|
420
|
-
}
|
|
421
|
-
$$renderer2.push(`<!--]-->`);
|
|
422
|
-
} else {
|
|
423
|
-
$$renderer2.push("<!--[!-->");
|
|
424
|
-
}
|
|
425
|
-
$$renderer2.push(`<!--]--> `);
|
|
426
|
-
if (data?.agents && data.agents.length > 0) {
|
|
427
|
-
$$renderer2.push("<!--[-->");
|
|
428
|
-
$$renderer2.push(`<!--[-->`);
|
|
429
|
-
const each_array_4 = ensure_array_like(data.agents);
|
|
430
|
-
for (let $$index_2 = 0, $$length3 = each_array_4.length; $$index_2 < $$length3; $$index_2++) {
|
|
431
|
-
let agent = each_array_4[$$index_2];
|
|
432
|
-
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"${attr("title", agent.name ?? agent.id)}><span class="flex-shrink-0">🤖</span> <span class="overflow-hidden text-ellipsis whitespace-nowrap">${escape_html(agent.name ?? agent.id.slice(0, 12) + "...")} (${escape_html(agent.messageCount)} msgs)</span></li>`);
|
|
433
|
-
}
|
|
434
|
-
$$renderer2.push(`<!--]-->`);
|
|
435
|
-
} else {
|
|
436
|
-
$$renderer2.push("<!--[!-->");
|
|
437
|
-
}
|
|
438
|
-
$$renderer2.push(`<!--]--></ul>`);
|
|
439
|
-
} else {
|
|
440
|
-
$$renderer2.push("<!--[!-->");
|
|
441
|
-
}
|
|
442
|
-
$$renderer2.push(`<!--]--></li>`);
|
|
443
|
-
}
|
|
444
|
-
$$renderer2.push(`<!--]-->`);
|
|
445
|
-
}
|
|
446
|
-
$$renderer2.push(`<!--]--></ul>`);
|
|
447
|
-
} else {
|
|
448
|
-
$$renderer2.push("<!--[!-->");
|
|
449
|
-
}
|
|
450
|
-
$$renderer2.push(`<!--]--></li>`);
|
|
451
|
-
}
|
|
452
|
-
$$renderer2.push(`<!--]--></ul></aside>`);
|
|
453
|
-
if ($$store_subs) unsubscribe_stores($$store_subs);
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
210
|
function ExpandableContent($$renderer, $$props) {
|
|
457
211
|
$$renderer.component(($$renderer2) => {
|
|
458
212
|
let { content, maxLines = 10, lang } = $$props;
|
|
@@ -905,16 +659,262 @@ function MessageItem($$renderer, $$props) {
|
|
|
905
659
|
$$renderer2.push(`<!--]-->`);
|
|
906
660
|
});
|
|
907
661
|
}
|
|
908
|
-
function
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
662
|
+
function TooltipButton($$renderer, $$props) {
|
|
663
|
+
let {
|
|
664
|
+
title,
|
|
665
|
+
children,
|
|
666
|
+
position = "bottom",
|
|
667
|
+
class: className = "",
|
|
668
|
+
$$slots,
|
|
669
|
+
$$events,
|
|
670
|
+
...buttonProps
|
|
671
|
+
} = $$props;
|
|
672
|
+
$$renderer.push(`<button${attributes(
|
|
673
|
+
{
|
|
674
|
+
class: `tooltip-btn ${stringify(className)}`,
|
|
675
|
+
...buttonProps
|
|
676
|
+
},
|
|
677
|
+
"svelte-1yfjzin"
|
|
678
|
+
)}>`);
|
|
679
|
+
children($$renderer);
|
|
680
|
+
$$renderer.push(`<!----></button> `);
|
|
681
|
+
{
|
|
682
|
+
$$renderer.push("<!--[!-->");
|
|
683
|
+
}
|
|
684
|
+
$$renderer.push(`<!--]-->`);
|
|
685
|
+
}
|
|
686
|
+
function ProjectTree($$renderer, $$props) {
|
|
687
|
+
$$renderer.component(($$renderer2) => {
|
|
688
|
+
var $$store_subs;
|
|
689
|
+
let {
|
|
690
|
+
projects,
|
|
691
|
+
projectSessions,
|
|
692
|
+
projectSessionData,
|
|
693
|
+
expandedProjects,
|
|
694
|
+
selectedSession,
|
|
695
|
+
loadingProject,
|
|
696
|
+
onRenameSession,
|
|
697
|
+
onDeleteSession,
|
|
698
|
+
onResumeSession
|
|
699
|
+
} = $$props;
|
|
700
|
+
const getSessionData = (projectName, sessionId) => {
|
|
701
|
+
return projectSessionData.get(projectName)?.get(sessionId);
|
|
702
|
+
};
|
|
703
|
+
const getDisplayTitle2 = (session) => {
|
|
704
|
+
const data = getSessionData(session.projectName, session.id);
|
|
705
|
+
if (data?.customTitle) return data.customTitle;
|
|
706
|
+
if (data?.currentSummary) {
|
|
707
|
+
const summary = data.currentSummary;
|
|
708
|
+
return summary.length > 60 ? summary.slice(0, 57) + "..." : summary;
|
|
709
|
+
}
|
|
710
|
+
if (session.title && session.title !== "Untitled") return session.title;
|
|
711
|
+
return "Untitled";
|
|
712
|
+
};
|
|
713
|
+
const getTooltipText = (session) => {
|
|
714
|
+
const data = getSessionData(session.projectName, session.id);
|
|
715
|
+
if (data?.customTitle && data?.currentSummary) {
|
|
716
|
+
return data.currentSummary;
|
|
717
|
+
}
|
|
718
|
+
if (data?.currentSummary && session.title && session.title !== "Untitled") {
|
|
719
|
+
return session.title;
|
|
720
|
+
}
|
|
721
|
+
if (data?.currentSummary) {
|
|
722
|
+
return data.currentSummary;
|
|
723
|
+
}
|
|
724
|
+
return session.title ?? "No summary available";
|
|
725
|
+
};
|
|
726
|
+
const getSessionInfo = (session) => {
|
|
727
|
+
const data = getSessionData(session.projectName, session.id);
|
|
728
|
+
const todoCount = data?.todos ? data.todos.sessionTodos.length + data.todos.agentTodos.reduce((acc, at) => acc + at.todos.length, 0) : 0;
|
|
729
|
+
return {
|
|
730
|
+
agents: data?.agents.length ?? 0,
|
|
731
|
+
todos: todoCount,
|
|
732
|
+
summaries: data?.summaries.length ?? 0
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
const sortedProjects = sortProjects(projects, {
|
|
736
|
+
currentProjectName: store_get($$store_subs ??= {}, "$appConfig", appConfig).currentProjectName,
|
|
737
|
+
homeDir: store_get($$store_subs ??= {}, "$appConfig", appConfig).homeDir
|
|
738
|
+
});
|
|
739
|
+
let expandedSessions = /* @__PURE__ */ new Set();
|
|
740
|
+
let draggedSession = null;
|
|
741
|
+
let dropTargetProject = null;
|
|
742
|
+
$$renderer2.push(`<aside class="bg-gh-bg-secondary border border-gh-border rounded-lg overflow-hidden flex flex-col"><h2 class="p-4 text-base font-semibold border-b border-gh-border bg-gh-bg">Projects (${escape_html(sortedProjects.length)})</h2> <ul class="overflow-y-auto flex-1"><!--[-->`);
|
|
743
|
+
const each_array = ensure_array_like(sortedProjects);
|
|
744
|
+
for (let $$index_4 = 0, $$length = each_array.length; $$index_4 < $$length; $$index_4++) {
|
|
745
|
+
let project = each_array[$$index_4];
|
|
746
|
+
const isDropTarget = dropTargetProject === project.name;
|
|
747
|
+
$$renderer2.push(`<li class="border-b border-gh-border-subtle"><button${attr_class(`w-full py-3 px-4 bg-transparent border-none text-gh-text cursor-pointer text-left flex items-center gap-2 font-medium hover:bg-gh-border-subtle ${stringify(expandedProjects.has(project.name) ? "bg-gh-accent/10" : "")} ${stringify(isDropTarget ? "bg-gh-green/20 ring-2 ring-gh-green ring-inset" : "")}`)}><span class="text-xs w-3 text-gh-text-secondary">${escape_html(expandedProjects.has(project.name) ? "▼" : "▶")}</span> <span class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap"${attr("title", project.displayName)}>${escape_html(formatProjectName(project.displayName))}</span> <span class="bg-gh-border px-2 py-0.5 rounded-full text-xs font-normal">${escape_html(project.sessionCount)}</span></button> `);
|
|
748
|
+
if (expandedProjects.has(project.name)) {
|
|
749
|
+
$$renderer2.push("<!--[-->");
|
|
750
|
+
$$renderer2.push(`<ul class="bg-gh-bg">`);
|
|
751
|
+
if (loadingProject === project.name) {
|
|
752
|
+
$$renderer2.push("<!--[-->");
|
|
753
|
+
$$renderer2.push(`<li class="py-2 px-8 text-gh-text-secondary text-sm">Loading...</li>`);
|
|
754
|
+
} else {
|
|
755
|
+
$$renderer2.push("<!--[!-->");
|
|
756
|
+
$$renderer2.push(`<!--[-->`);
|
|
757
|
+
const each_array_1 = ensure_array_like(projectSessions.get(project.name) ?? []);
|
|
758
|
+
for (let $$index_3 = 0, $$length2 = each_array_1.length; $$index_3 < $$length2; $$index_3++) {
|
|
759
|
+
let session = each_array_1[$$index_3];
|
|
760
|
+
const isSelected = selectedSession?.id === session.id;
|
|
761
|
+
const isDragging = draggedSession?.id === session.id;
|
|
762
|
+
const sessionInfo = getSessionInfo(session);
|
|
763
|
+
const displayTitle = getDisplayTitle2(session);
|
|
764
|
+
const tooltipText = getTooltipText(session);
|
|
765
|
+
const data = getSessionData(session.projectName, session.id);
|
|
766
|
+
const isSummaryFallback = !data?.customTitle && !data?.currentSummary;
|
|
767
|
+
const isExpanded = expandedSessions.has(session.id);
|
|
768
|
+
const hasSubItems = sessionInfo.summaries > 0 || sessionInfo.agents > 0 || sessionInfo.todos > 0;
|
|
769
|
+
$$renderer2.push(`<li${attr_class(`relative border-t border-gh-border-subtle group ${stringify(isSelected ? "bg-gh-accent/20 border-l-3 border-l-gh-accent" : "")} ${stringify(isDragging ? "opacity-50" : "")}`)} draggable="true"><div class="flex items-center">`);
|
|
770
|
+
if (hasSubItems) {
|
|
771
|
+
$$renderer2.push("<!--[-->");
|
|
772
|
+
$$renderer2.push(`<button class="flex-shrink-0 w-5 h-8 flex items-center justify-center bg-transparent border-none cursor-pointer text-gh-text-secondary text-xs ml-1 z-10 relative"${attr("title", isExpanded ? "Collapse" : "Expand")}>${escape_html(isExpanded ? "▼" : "▶")}</button>`);
|
|
773
|
+
} else {
|
|
774
|
+
$$renderer2.push("<!--[!-->");
|
|
775
|
+
$$renderer2.push(`<span class="w-5 ml-1"></span>`);
|
|
776
|
+
}
|
|
777
|
+
$$renderer2.push(`<!--]--> <button class="flex-1 min-w-0 py-2 pr-2 bg-transparent border-none text-gh-text cursor-pointer text-left flex items-center gap-2 text-sm"${attr("title", tooltipText)}><span${attr_class(`flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap ${stringify(isSummaryFallback ? "italic text-gh-text-secondary" : "")}`)}>${escape_html(displayTitle)}</span> <span class="flex-shrink-0 flex items-center gap-2 text-xs text-gh-text-secondary"><span class="flex items-center gap-0.5"${attr("title", `${stringify(session.messageCount)} messages`)}><span>💬</span><span>${escape_html(session.messageCount)}</span></span> `);
|
|
778
|
+
if (sessionInfo.agents > 0) {
|
|
779
|
+
$$renderer2.push("<!--[-->");
|
|
780
|
+
$$renderer2.push(`<span class="flex items-center gap-0.5"${attr("title", `${stringify(sessionInfo.agents)} agent(s)`)}><span>🤖</span><span>${escape_html(sessionInfo.agents)}</span></span>`);
|
|
781
|
+
} else {
|
|
782
|
+
$$renderer2.push("<!--[!-->");
|
|
783
|
+
}
|
|
784
|
+
$$renderer2.push(`<!--]--> `);
|
|
785
|
+
if (sessionInfo.todos > 0) {
|
|
786
|
+
$$renderer2.push("<!--[-->");
|
|
787
|
+
$$renderer2.push(`<span class="flex items-center gap-0.5"${attr("title", `${stringify(sessionInfo.todos)} todo(s)`)}><span>📋</span><span>${escape_html(sessionInfo.todos)}</span></span>`);
|
|
788
|
+
} else {
|
|
789
|
+
$$renderer2.push("<!--[!-->");
|
|
790
|
+
}
|
|
791
|
+
$$renderer2.push(`<!--]--></span></button> <div${attr_class(`absolute left-0 right-0 top-0 h-8 flex items-center opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none ${stringify(isSelected ? "bg-gradient-to-r from-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))] via-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))] to-[color-mix(in_srgb,var(--color-gh-accent)_20%,var(--color-gh-bg))]" : "bg-gradient-to-r from-gh-bg via-gh-bg to-gh-bg")}`)}><span class="flex-1 min-w-0 pl-7 pr-2 text-xs text-gh-text-secondary italic overflow-hidden text-ellipsis whitespace-nowrap">`);
|
|
792
|
+
if (data?.currentSummary) {
|
|
793
|
+
$$renderer2.push("<!--[-->");
|
|
794
|
+
$$renderer2.push(`${escape_html(data.currentSummary.length > 50 ? data.currentSummary.slice(0, 47) + "..." : data.currentSummary)}`);
|
|
795
|
+
} else {
|
|
796
|
+
$$renderer2.push("<!--[!-->");
|
|
797
|
+
$$renderer2.push(`${escape_html(displayTitle)}`);
|
|
798
|
+
}
|
|
799
|
+
$$renderer2.push(`<!--]--></span> <div class="flex-shrink-0 flex gap-0.5 pr-2 pointer-events-auto">`);
|
|
800
|
+
if (onResumeSession) {
|
|
801
|
+
$$renderer2.push("<!--[-->");
|
|
802
|
+
TooltipButton($$renderer2, {
|
|
803
|
+
class: "p-1 rounded hover:bg-gh-green/20 text-xs",
|
|
804
|
+
onclick: (e) => onResumeSession(e, session),
|
|
805
|
+
title: "Resume session",
|
|
806
|
+
children: ($$renderer3) => {
|
|
807
|
+
$$renderer3.push(`<!---->▶️`);
|
|
808
|
+
},
|
|
809
|
+
$$slots: { default: true }
|
|
810
|
+
});
|
|
811
|
+
} else {
|
|
812
|
+
$$renderer2.push("<!--[!-->");
|
|
813
|
+
}
|
|
814
|
+
$$renderer2.push(`<!--]--> `);
|
|
815
|
+
TooltipButton($$renderer2, {
|
|
816
|
+
class: "p-1 rounded hover:bg-gh-border text-xs",
|
|
817
|
+
onclick: (e) => onRenameSession(e, session),
|
|
818
|
+
title: "Rename",
|
|
819
|
+
children: ($$renderer3) => {
|
|
820
|
+
$$renderer3.push(`<!---->✏️`);
|
|
821
|
+
},
|
|
822
|
+
$$slots: { default: true }
|
|
823
|
+
});
|
|
824
|
+
$$renderer2.push(`<!----> `);
|
|
825
|
+
TooltipButton($$renderer2, {
|
|
826
|
+
class: "p-1 rounded hover:bg-gh-red/20 text-xs",
|
|
827
|
+
onclick: (e) => onDeleteSession(e, session),
|
|
828
|
+
title: "Delete",
|
|
829
|
+
children: ($$renderer3) => {
|
|
830
|
+
$$renderer3.push(`<!---->🗑️`);
|
|
831
|
+
},
|
|
832
|
+
$$slots: { default: true }
|
|
833
|
+
});
|
|
834
|
+
$$renderer2.push(`<!----></div></div></div> `);
|
|
835
|
+
if (isExpanded && hasSubItems) {
|
|
836
|
+
$$renderer2.push("<!--[-->");
|
|
837
|
+
$$renderer2.push(`<ul class="bg-gh-bg-secondary/50 border-t border-gh-border-subtle text-xs">`);
|
|
838
|
+
if (data?.summaries && data.summaries.length > 0) {
|
|
839
|
+
$$renderer2.push("<!--[-->");
|
|
840
|
+
$$renderer2.push(`<!--[-->`);
|
|
841
|
+
const each_array_2 = ensure_array_like(data.summaries);
|
|
842
|
+
for (let idx = 0, $$length3 = each_array_2.length; idx < $$length3; idx++) {
|
|
843
|
+
let summary = each_array_2[idx];
|
|
844
|
+
$$renderer2.push(`<li${attr_class(`py-1.5 px-4 pl-8 hover:bg-gh-border-subtle/50 flex flex-col gap-0.5 ${stringify(idx === 0 ? "text-gh-text" : "text-gh-text-secondary")}`)}${attr("title", summary.summary)}><div class="flex items-start gap-2"><span class="flex-shrink-0">📝</span> <span class="overflow-hidden text-ellipsis line-clamp-2">${escape_html(summary.summary.length > 100 ? summary.summary.slice(0, 97) + "..." : summary.summary)}</span></div> `);
|
|
845
|
+
if (summary.timestamp) {
|
|
846
|
+
$$renderer2.push("<!--[-->");
|
|
847
|
+
$$renderer2.push(`<span class="pl-6 text-[10px] text-gh-text-secondary/70">${escape_html(new Date(summary.timestamp).toLocaleString())}</span>`);
|
|
848
|
+
} else {
|
|
849
|
+
$$renderer2.push("<!--[!-->");
|
|
850
|
+
}
|
|
851
|
+
$$renderer2.push(`<!--]--></li>`);
|
|
852
|
+
}
|
|
853
|
+
$$renderer2.push(`<!--]-->`);
|
|
854
|
+
} else {
|
|
855
|
+
$$renderer2.push("<!--[!-->");
|
|
856
|
+
}
|
|
857
|
+
$$renderer2.push(`<!--]--> `);
|
|
858
|
+
if (data?.todos?.sessionTodos && data.todos.sessionTodos.length > 0) {
|
|
859
|
+
$$renderer2.push("<!--[-->");
|
|
860
|
+
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"><span class="flex-shrink-0">📋</span> <span>Session Todos (${escape_html(data.todos.sessionTodos.length)})</span></li>`);
|
|
861
|
+
} else {
|
|
862
|
+
$$renderer2.push("<!--[!-->");
|
|
863
|
+
}
|
|
864
|
+
$$renderer2.push(`<!--]--> `);
|
|
865
|
+
if (data?.todos?.agentTodos) {
|
|
866
|
+
$$renderer2.push("<!--[-->");
|
|
867
|
+
$$renderer2.push(`<!--[-->`);
|
|
868
|
+
const each_array_3 = ensure_array_like(data.todos.agentTodos);
|
|
869
|
+
for (let $$index_1 = 0, $$length3 = each_array_3.length; $$index_1 < $$length3; $$index_1++) {
|
|
870
|
+
let agentTodo = each_array_3[$$index_1];
|
|
871
|
+
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"><span class="flex-shrink-0">📋</span> <span>Agent Todos (${escape_html(agentTodo.todos.length)})</span></li>`);
|
|
872
|
+
}
|
|
873
|
+
$$renderer2.push(`<!--]-->`);
|
|
874
|
+
} else {
|
|
875
|
+
$$renderer2.push("<!--[!-->");
|
|
876
|
+
}
|
|
877
|
+
$$renderer2.push(`<!--]--> `);
|
|
878
|
+
if (data?.agents && data.agents.length > 0) {
|
|
879
|
+
$$renderer2.push("<!--[-->");
|
|
880
|
+
$$renderer2.push(`<!--[-->`);
|
|
881
|
+
const each_array_4 = ensure_array_like(data.agents);
|
|
882
|
+
for (let $$index_2 = 0, $$length3 = each_array_4.length; $$index_2 < $$length3; $$index_2++) {
|
|
883
|
+
let agent = each_array_4[$$index_2];
|
|
884
|
+
$$renderer2.push(`<li class="py-1.5 px-4 pl-8 text-gh-text-secondary hover:bg-gh-border-subtle/50 flex items-start gap-2"${attr("title", agent.name ?? agent.id)}><span class="flex-shrink-0">🤖</span> <span class="overflow-hidden text-ellipsis whitespace-nowrap">${escape_html(agent.name ?? agent.id.slice(0, 12) + "...")} (${escape_html(agent.messageCount)} msgs)</span></li>`);
|
|
885
|
+
}
|
|
886
|
+
$$renderer2.push(`<!--]-->`);
|
|
887
|
+
} else {
|
|
888
|
+
$$renderer2.push("<!--[!-->");
|
|
889
|
+
}
|
|
890
|
+
$$renderer2.push(`<!--]--></ul>`);
|
|
891
|
+
} else {
|
|
892
|
+
$$renderer2.push("<!--[!-->");
|
|
893
|
+
}
|
|
894
|
+
$$renderer2.push(`<!--]--></li>`);
|
|
895
|
+
}
|
|
896
|
+
$$renderer2.push(`<!--]-->`);
|
|
897
|
+
}
|
|
898
|
+
$$renderer2.push(`<!--]--></ul>`);
|
|
899
|
+
} else {
|
|
900
|
+
$$renderer2.push("<!--[!-->");
|
|
901
|
+
}
|
|
902
|
+
$$renderer2.push(`<!--]--></li>`);
|
|
903
|
+
}
|
|
904
|
+
$$renderer2.push(`<!--]--></ul></aside>`);
|
|
905
|
+
if ($$store_subs) unsubscribe_stores($$store_subs);
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function ScrollButtons($$renderer, $$props) {
|
|
909
|
+
$$renderer.component(($$renderer2) => {
|
|
910
|
+
let { messages, class: className = "" } = $$props;
|
|
911
|
+
const buttonClass = "p-1.5 text-sm rounded border border-gh-border hover:bg-gh-border-subtle text-gh-text-secondary hover:text-gh-text transition-colors bg-gh-bg";
|
|
912
|
+
if (messages.length > 0) {
|
|
913
|
+
$$renderer2.push("<!--[-->");
|
|
914
|
+
$$renderer2.push(`<div${attr_class(`flex gap-0.5 ${stringify(className)}`, "svelte-12kovyu")}><button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l7-7 7 7M5 19l7-7 7 7"></path></svg> <span class="tooltip svelte-12kovyu">Top</span></button> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path></svg> <span class="tooltip svelte-12kovyu">Previous user message</span></button> `);
|
|
915
|
+
{
|
|
916
|
+
$$renderer2.push("<!--[!-->");
|
|
917
|
+
}
|
|
918
918
|
$$renderer2.push(`<!--]--> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9l7 7 7-7"></path></svg> <span class="tooltip svelte-12kovyu">Next user message</span></button> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5l7 7 7-7M5 13l7 7 7-7"></path></svg> <span class="tooltip svelte-12kovyu">Bottom</span></button></div>`);
|
|
919
919
|
} else {
|
|
920
920
|
$$renderer2.push("<!--[!-->");
|
|
@@ -1039,115 +1039,156 @@ function _page($$renderer, $$props) {
|
|
|
1039
1039
|
let loadingProject = null;
|
|
1040
1040
|
let error = null;
|
|
1041
1041
|
let toast = null;
|
|
1042
|
+
let confirmModal = {
|
|
1043
|
+
show: false,
|
|
1044
|
+
title: "",
|
|
1045
|
+
message: "",
|
|
1046
|
+
variant: "default",
|
|
1047
|
+
onConfirm: () => {
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
let inputModal = {
|
|
1051
|
+
show: false,
|
|
1052
|
+
title: "",
|
|
1053
|
+
label: "",
|
|
1054
|
+
initialValue: "",
|
|
1055
|
+
onConfirm: () => {
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
const showConfirm = (title, message, onConfirm, variant = "default") => {
|
|
1059
|
+
confirmModal = { show: true, title, message, variant, onConfirm };
|
|
1060
|
+
};
|
|
1061
|
+
const closeConfirm = () => {
|
|
1062
|
+
confirmModal = { ...confirmModal, show: false };
|
|
1063
|
+
};
|
|
1064
|
+
const showInput = (title, label, initialValue, onConfirm) => {
|
|
1065
|
+
inputModal = { show: true, title, label, initialValue, onConfirm };
|
|
1066
|
+
};
|
|
1067
|
+
const closeInput = () => {
|
|
1068
|
+
inputModal = { ...inputModal, show: false };
|
|
1069
|
+
};
|
|
1042
1070
|
const updateHash = (project, session) => {
|
|
1043
1071
|
return;
|
|
1044
1072
|
};
|
|
1045
|
-
const handleDeleteSession =
|
|
1073
|
+
const handleDeleteSession = (e, session) => {
|
|
1046
1074
|
e.stopPropagation();
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1075
|
+
showConfirm(
|
|
1076
|
+
"Delete Session",
|
|
1077
|
+
`Delete session "${session.title}"?`,
|
|
1078
|
+
async () => {
|
|
1079
|
+
closeConfirm();
|
|
1080
|
+
try {
|
|
1081
|
+
await deleteSession(session.projectName, session.id);
|
|
1082
|
+
const sessions = projectSessions.get(session.projectName);
|
|
1083
|
+
if (sessions) {
|
|
1084
|
+
projectSessions.set(session.projectName, sessions.filter((s) => s.id !== session.id));
|
|
1085
|
+
projectSessions = new Map(projectSessions);
|
|
1086
|
+
}
|
|
1087
|
+
if (selectedSession?.id === session.id) {
|
|
1088
|
+
selectedSession = null;
|
|
1089
|
+
messages = [];
|
|
1090
|
+
updateHash(session.projectName);
|
|
1091
|
+
}
|
|
1092
|
+
} catch (e2) {
|
|
1093
|
+
error = String(e2);
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
"danger"
|
|
1097
|
+
);
|
|
1063
1098
|
};
|
|
1064
|
-
const handleRenameSession =
|
|
1099
|
+
const handleRenameSession = (e, session) => {
|
|
1065
1100
|
e.stopPropagation();
|
|
1066
1101
|
const sessionData = projectSessionData.get(session.projectName)?.get(session.id);
|
|
1067
1102
|
const currentTitle = getDisplayTitle(sessionData?.customTitle, sessionData?.currentSummary, session.title, Infinity, "");
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
sessionData
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
sessionData.summaries
|
|
1077
|
-
|
|
1078
|
-
|
|
1103
|
+
showInput("Rename Session", "Sets custom-title for CLI, first summary for VSCode extension", currentTitle, async (newTitle) => {
|
|
1104
|
+
closeInput();
|
|
1105
|
+
if (newTitle === currentTitle) return;
|
|
1106
|
+
try {
|
|
1107
|
+
await renameSession(session.projectName, session.id, newTitle);
|
|
1108
|
+
if (sessionData) {
|
|
1109
|
+
sessionData.customTitle = newTitle;
|
|
1110
|
+
sessionData.currentSummary = newTitle;
|
|
1111
|
+
if (sessionData.summaries.length > 0) {
|
|
1112
|
+
sessionData.summaries[0] = { ...sessionData.summaries[0], summary: newTitle };
|
|
1113
|
+
} else {
|
|
1114
|
+
sessionData.summaries = [{ summary: newTitle }];
|
|
1115
|
+
}
|
|
1079
1116
|
}
|
|
1117
|
+
projectSessions = new Map(projectSessions);
|
|
1118
|
+
projectSessionData = new Map(projectSessionData);
|
|
1119
|
+
if (selectedSession?.id === session.id) {
|
|
1120
|
+
messages = await getSession(session.projectName, session.id);
|
|
1121
|
+
}
|
|
1122
|
+
} catch (e2) {
|
|
1123
|
+
error = String(e2);
|
|
1080
1124
|
}
|
|
1081
|
-
|
|
1082
|
-
projectSessionData = new Map(projectSessionData);
|
|
1083
|
-
if (selectedSession?.id === session.id) {
|
|
1084
|
-
messages = await getSession(session.projectName, session.id);
|
|
1085
|
-
}
|
|
1086
|
-
} catch (e2) {
|
|
1087
|
-
error = String(e2);
|
|
1088
|
-
}
|
|
1125
|
+
});
|
|
1089
1126
|
};
|
|
1090
|
-
const handleEditCustomTitle =
|
|
1127
|
+
const handleEditCustomTitle = (msg) => {
|
|
1091
1128
|
if (!selectedSession) return;
|
|
1092
1129
|
const currentTitle = msg.customTitle ?? "";
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1130
|
+
showInput("Edit Custom Title", "Custom title:", currentTitle, async (newTitle) => {
|
|
1131
|
+
closeInput();
|
|
1132
|
+
if (newTitle === currentTitle) return;
|
|
1133
|
+
try {
|
|
1134
|
+
await updateCustomTitle(selectedSession.projectName, selectedSession.id, msg.uuid, newTitle);
|
|
1135
|
+
msg.customTitle = newTitle;
|
|
1136
|
+
messages = [...messages];
|
|
1137
|
+
} catch (e) {
|
|
1138
|
+
error = String(e);
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1102
1141
|
};
|
|
1103
|
-
const handleSplitSession =
|
|
1142
|
+
const handleSplitSession = (msg) => {
|
|
1104
1143
|
if (!selectedSession) return;
|
|
1105
1144
|
const msgIndex = messages.findIndex((m) => m.uuid === msg.uuid);
|
|
1106
1145
|
const oldMessagesCount = msgIndex;
|
|
1107
1146
|
const keptMessagesCount = messages.length - msgIndex;
|
|
1108
|
-
|
|
1147
|
+
showConfirm("Split Session", `Split session at this message?
|
|
1109
1148
|
|
|
1110
1149
|
This session will keep ${keptMessagesCount} messages (from here onwards).
|
|
1111
|
-
Old messages (${oldMessagesCount}) will be moved to a new session
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
updatedSession
|
|
1140
|
-
|
|
1150
|
+
Old messages (${oldMessagesCount}) will be moved to a new session.`, async () => {
|
|
1151
|
+
closeConfirm();
|
|
1152
|
+
const currentProjectName = selectedSession.projectName;
|
|
1153
|
+
const currentSessionId = selectedSession.id;
|
|
1154
|
+
try {
|
|
1155
|
+
loading = true;
|
|
1156
|
+
const result = await splitSession(currentProjectName, currentSessionId, msg.uuid);
|
|
1157
|
+
if (result.success && result.newSessionId) {
|
|
1158
|
+
const sessionDataList = await expandProject(currentProjectName);
|
|
1159
|
+
const sessions = [];
|
|
1160
|
+
const dataMap = /* @__PURE__ */ new Map();
|
|
1161
|
+
for (const data of sessionDataList) {
|
|
1162
|
+
sessions.push({
|
|
1163
|
+
id: data.id,
|
|
1164
|
+
projectName: currentProjectName,
|
|
1165
|
+
title: data.title,
|
|
1166
|
+
messageCount: data.messageCount,
|
|
1167
|
+
createdAt: data.createdAt,
|
|
1168
|
+
updatedAt: data.updatedAt
|
|
1169
|
+
});
|
|
1170
|
+
dataMap.set(data.id, data);
|
|
1171
|
+
}
|
|
1172
|
+
projectSessions.set(currentProjectName, sessions);
|
|
1173
|
+
projectSessions = new Map(projectSessions);
|
|
1174
|
+
projectSessionData.set(currentProjectName, dataMap);
|
|
1175
|
+
projectSessionData = new Map(projectSessionData);
|
|
1176
|
+
messages = messages.slice(msgIndex);
|
|
1177
|
+
const updatedSession = sessions.find((s) => s.id === currentSessionId);
|
|
1178
|
+
if (updatedSession) {
|
|
1179
|
+
updatedSession.messageCount = messages.length;
|
|
1180
|
+
selectedSession = { ...updatedSession };
|
|
1181
|
+
}
|
|
1182
|
+
toast = `Session split! Old messages moved to new session: ${result.newSessionId.slice(0, 8)}...`;
|
|
1183
|
+
} else {
|
|
1184
|
+
error = result.error ?? "Failed to split session";
|
|
1141
1185
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1186
|
+
} catch (e) {
|
|
1187
|
+
error = String(e);
|
|
1188
|
+
} finally {
|
|
1189
|
+
loading = false;
|
|
1145
1190
|
}
|
|
1146
|
-
}
|
|
1147
|
-
error = String(e);
|
|
1148
|
-
} finally {
|
|
1149
|
-
loading = false;
|
|
1150
|
-
}
|
|
1191
|
+
});
|
|
1151
1192
|
};
|
|
1152
1193
|
const handleResumeSession = async (e, session) => {
|
|
1153
1194
|
e.stopPropagation();
|
|
@@ -1212,6 +1253,24 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`)) return;
|
|
|
1212
1253
|
$$settled = false;
|
|
1213
1254
|
}
|
|
1214
1255
|
});
|
|
1256
|
+
$$renderer3.push(`<!----> `);
|
|
1257
|
+
ConfirmModal($$renderer3, {
|
|
1258
|
+
show: confirmModal.show,
|
|
1259
|
+
title: confirmModal.title,
|
|
1260
|
+
message: confirmModal.message,
|
|
1261
|
+
variant: confirmModal.variant,
|
|
1262
|
+
onConfirm: confirmModal.onConfirm,
|
|
1263
|
+
onCancel: closeConfirm
|
|
1264
|
+
});
|
|
1265
|
+
$$renderer3.push(`<!----> `);
|
|
1266
|
+
InputModal($$renderer3, {
|
|
1267
|
+
show: inputModal.show,
|
|
1268
|
+
title: inputModal.title,
|
|
1269
|
+
label: inputModal.label,
|
|
1270
|
+
initialValue: inputModal.initialValue,
|
|
1271
|
+
onConfirm: inputModal.onConfirm,
|
|
1272
|
+
onCancel: closeInput
|
|
1273
|
+
});
|
|
1215
1274
|
$$renderer3.push(`<!---->`);
|
|
1216
1275
|
}
|
|
1217
1276
|
do {
|
|
@@ -1224,4 +1283,4 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`)) return;
|
|
|
1224
1283
|
}
|
|
1225
1284
|
|
|
1226
1285
|
export { _page as default };
|
|
1227
|
-
//# sourceMappingURL=_page.svelte-
|
|
1286
|
+
//# sourceMappingURL=_page.svelte-OvxQOUCZ.js.map
|