@claude-sessions/web 0.3.7 → 0.4.1-beta.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/build/client/_app/immutable/assets/0.D2FnNtrO.css +1 -0
- package/build/client/_app/immutable/assets/0.D2FnNtrO.css.br +0 -0
- package/build/client/_app/immutable/assets/0.D2FnNtrO.css.gz +0 -0
- package/build/client/_app/immutable/assets/Toast.CQSY_S6M.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{pOdkXMWy.js → B-Z9hXPk.js} +1 -1
- package/build/client/_app/immutable/chunks/B-Z9hXPk.js.br +0 -0
- package/build/client/_app/immutable/chunks/B-Z9hXPk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Ck-YPZB6.js → BAHJNsIv.js} +1 -1
- package/build/client/_app/immutable/chunks/BAHJNsIv.js.br +0 -0
- package/build/client/_app/immutable/chunks/BAHJNsIv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUqdiQ8V.js +90 -0
- package/build/client/_app/immutable/chunks/BUqdiQ8V.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUqdiQ8V.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Dbjp-HdT.js → Bt_HBaBk.js} +1 -1
- package/build/client/_app/immutable/chunks/Bt_HBaBk.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bt_HBaBk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cr0eW1j3.js +1 -0
- package/build/client/_app/immutable/chunks/Cr0eW1j3.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cr0eW1j3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOXVKi87.js +2 -0
- package/build/client/_app/immutable/chunks/DOXVKi87.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOXVKi87.js.gz +0 -0
- package/build/client/_app/immutable/chunks/YXuXYbOb.js +1 -0
- package/build/client/_app/immutable/chunks/YXuXYbOb.js.br +0 -0
- package/build/client/_app/immutable/chunks/YXuXYbOb.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.B37sNVm4.js +2 -0
- package/build/client/_app/immutable/entry/app.B37sNVm4.js.br +0 -0
- package/build/client/_app/immutable/entry/app.B37sNVm4.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CUKKnspj.js +1 -0
- package/build/client/_app/immutable/entry/start.CUKKnspj.js.br +2 -0
- package/build/client/_app/immutable/entry/start.CUKKnspj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.D4LDvqQb.js → 0.DD0gH91e.js} +1 -1
- package/build/client/_app/immutable/nodes/0.DD0gH91e.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DD0gH91e.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.j1rqa9HA.js +1 -0
- package/build/client/_app/immutable/nodes/1.j1rqa9HA.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.j1rqa9HA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.5x79czX-.js +4 -0
- package/build/client/_app/immutable/nodes/2.5x79czX-.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.5x79czX-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CkQ0QnVZ.js +4 -0
- package/build/client/_app/immutable/nodes/3.CkQ0QnVZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CkQ0QnVZ.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/env.js +51 -2
- package/build/handler.js +46 -4
- package/build/index.js +25 -14
- package/build/server/chunks/0-BhPy9YZY.js +17 -0
- package/build/server/chunks/{0-DkD09WcK.js.map → 0-BhPy9YZY.js.map} +1 -1
- package/build/server/chunks/1-CTTD_wla.js +9 -0
- package/build/server/chunks/{1-CjtVgNYW.js.map → 1-CTTD_wla.js.map} +1 -1
- package/build/server/chunks/2-Bvyspg6i.js +9 -0
- package/build/server/chunks/{2-wstlfOP5.js.map → 2-Bvyspg6i.js.map} +1 -1
- package/build/server/chunks/3-BHD2c0Ph.js +9 -0
- package/build/server/chunks/{3-Cdn9_0OG.js.map → 3-BHD2c0Ph.js.map} +1 -1
- package/build/server/chunks/{InputModal-XaplAR5y.js → InputModal-CbpiMXy3.js} +3 -3
- package/build/server/chunks/InputModal-CbpiMXy3.js.map +1 -0
- package/build/server/chunks/{Toast-ihrVamsT.js → Toast-Dr8M-5Wk.js} +4 -4
- package/build/server/chunks/Toast-Dr8M-5Wk.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-COfbk473.js → _layout.svelte-CkIsNl4s.js} +7 -6
- package/build/server/chunks/_layout.svelte-CkIsNl4s.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CKSi7jlX.js → _page.svelte-BdKbLK1W.js} +8 -7
- package/build/server/chunks/_page.svelte-BdKbLK1W.js.map +1 -0
- package/build/server/chunks/{_page.svelte-C5Xngf9U.js → _page.svelte-DWKQDFXZ.js} +452 -240
- package/build/server/chunks/_page.svelte-DWKQDFXZ.js.map +1 -0
- package/build/server/chunks/{_server.ts-CFQ3_7g1.js → _server.ts-8OBR5eCA.js} +3 -2
- package/build/server/chunks/{_server.ts-CFQ3_7g1.js.map → _server.ts-8OBR5eCA.js.map} +1 -1
- package/build/server/chunks/_server.ts-B2LLvx6I.js +41 -0
- package/build/server/chunks/_server.ts-B2LLvx6I.js.map +1 -0
- package/build/server/chunks/{_server.ts-Bzg6xSYv.js → _server.ts-B4SnxrOX.js} +3 -2
- package/build/server/chunks/{_server.ts-Bzg6xSYv.js.map → _server.ts-B4SnxrOX.js.map} +1 -1
- package/build/server/chunks/{_server.ts-a85289si.js → _server.ts-B9gP-Tri.js} +7 -3
- package/build/server/chunks/_server.ts-B9gP-Tri.js.map +1 -0
- package/build/server/chunks/{_server.ts-IjEZJmtD.js → _server.ts-BQxGBeCg.js} +3 -2
- package/build/server/chunks/{_server.ts-IjEZJmtD.js.map → _server.ts-BQxGBeCg.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CF7wNACi.js → _server.ts-Bcdjougg.js} +3 -2
- package/build/server/chunks/{_server.ts-CF7wNACi.js.map → _server.ts-Bcdjougg.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CBabn3Le.js → _server.ts-BeWDhgJ_.js} +3 -2
- package/build/server/chunks/{_server.ts-CBabn3Le.js.map → _server.ts-BeWDhgJ_.js.map} +1 -1
- package/build/server/chunks/{_server.ts-bj28Awpj.js → _server.ts-CEGd9zNn.js} +3 -2
- package/build/server/chunks/_server.ts-CEGd9zNn.js.map +1 -0
- package/build/server/chunks/{_server.ts-QYg-pRKw.js → _server.ts-CMsFINkl.js} +3 -2
- package/build/server/chunks/{_server.ts-QYg-pRKw.js.map → _server.ts-CMsFINkl.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BNGntgHD.js → _server.ts-CUginV8c.js} +7 -3
- package/build/server/chunks/_server.ts-CUginV8c.js.map +1 -0
- package/build/server/chunks/{_server.ts-DRy1BtKz.js → _server.ts-Crip_Csr.js} +3 -2
- package/build/server/chunks/{_server.ts-DRy1BtKz.js.map → _server.ts-Crip_Csr.js.map} +1 -1
- package/build/server/chunks/{_server.ts-C46vcb_V.js → _server.ts-CuAlKvWH.js} +3 -2
- package/build/server/chunks/{_server.ts-C46vcb_V.js.map → _server.ts-CuAlKvWH.js.map} +1 -1
- package/build/server/chunks/{_server.ts-msjVztXK.js → _server.ts-DfNIRtb5.js} +3 -2
- package/build/server/chunks/{_server.ts-msjVztXK.js.map → _server.ts-DfNIRtb5.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CBCUnjeX.js → _server.ts-DnfpkUoI.js} +3 -2
- package/build/server/chunks/{_server.ts-CBCUnjeX.js.map → _server.ts-DnfpkUoI.js.map} +1 -1
- package/build/server/chunks/_server.ts-cVOhu8ub.js +26 -0
- package/build/server/chunks/_server.ts-cVOhu8ub.js.map +1 -0
- package/build/server/chunks/{_server.ts-Dtvv8PMc.js → _server.ts-dXxEqPlK.js} +3 -2
- package/build/server/chunks/{_server.ts-Dtvv8PMc.js.map → _server.ts-dXxEqPlK.js.map} +1 -1
- package/build/server/chunks/{error.svelte-C43AeaaJ.js → error.svelte-BNCG_dZH.js} +3 -3
- package/build/server/chunks/{error.svelte-C43AeaaJ.js.map → error.svelte-BNCG_dZH.js.map} +1 -1
- package/build/server/chunks/exports-BXvEiaiv.js.map +1 -1
- package/build/server/chunks/{index2-Da0doXJY.js → index-BEaiIYry.js} +388 -4
- package/build/server/chunks/index-BEaiIYry.js.map +1 -0
- package/build/server/chunks/index-CoD1IJuy.js.map +1 -1
- package/build/server/chunks/{index-DzYX9r1_.js → index2-ybZwlzIk.js} +110 -116
- package/build/server/chunks/index2-ybZwlzIk.js.map +1 -0
- package/build/server/chunks/{index3-DkgTDgY2.js → index3-D8wHvUHX.js} +781 -597
- package/build/server/chunks/index3-D8wHvUHX.js.map +1 -0
- package/build/server/chunks/{index4-BUZEWk-I.js → index4-B6vRxXfo.js} +2 -2
- package/build/server/chunks/index4-B6vRxXfo.js.map +1 -0
- package/build/server/chunks/shared-server-DaWdgxVh.js +11 -0
- package/build/server/chunks/shared-server-DaWdgxVh.js.map +1 -0
- package/build/server/index.js +115 -439
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +21 -21
- package/build/server/manifest.js.map +1 -1
- package/dist/cli.js +26 -1
- package/package.json +19 -18
- package/build/client/_app/immutable/assets/0.DYXbBCWs.css +0 -1
- package/build/client/_app/immutable/assets/0.DYXbBCWs.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DYXbBCWs.css.gz +0 -0
- package/build/client/_app/immutable/chunks/CT0aV1AN.js +0 -90
- package/build/client/_app/immutable/chunks/CT0aV1AN.js.br +0 -0
- package/build/client/_app/immutable/chunks/CT0aV1AN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ck-YPZB6.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ck-YPZB6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dbjp-HdT.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dbjp-HdT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HaThayHP.js +0 -1
- package/build/client/_app/immutable/chunks/HaThayHP.js.br +0 -0
- package/build/client/_app/immutable/chunks/HaThayHP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/fuY-CvTV.js +0 -1
- package/build/client/_app/immutable/chunks/fuY-CvTV.js.br +0 -0
- package/build/client/_app/immutable/chunks/fuY-CvTV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/nUq5tIUU.js +0 -2
- package/build/client/_app/immutable/chunks/nUq5tIUU.js.br +0 -0
- package/build/client/_app/immutable/chunks/nUq5tIUU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/pOdkXMWy.js.br +0 -0
- package/build/client/_app/immutable/chunks/pOdkXMWy.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.DMBaTVWt.js +0 -2
- package/build/client/_app/immutable/entry/app.DMBaTVWt.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DMBaTVWt.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.C3tcesOa.js +0 -1
- package/build/client/_app/immutable/entry/start.C3tcesOa.js.br +0 -2
- package/build/client/_app/immutable/entry/start.C3tcesOa.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.D4LDvqQb.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.D4LDvqQb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.5BEtqK67.js +0 -1
- package/build/client/_app/immutable/nodes/1.5BEtqK67.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.5BEtqK67.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.C-xl-nxy.js +0 -4
- package/build/client/_app/immutable/nodes/2.C-xl-nxy.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.C-xl-nxy.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BqDX5X09.js +0 -4
- package/build/client/_app/immutable/nodes/3.BqDX5X09.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BqDX5X09.js.gz +0 -0
- package/build/server/chunks/0-DkD09WcK.js +0 -17
- package/build/server/chunks/1-CjtVgNYW.js +0 -9
- package/build/server/chunks/2-wstlfOP5.js +0 -9
- package/build/server/chunks/3-Cdn9_0OG.js +0 -9
- package/build/server/chunks/InputModal-XaplAR5y.js.map +0 -1
- package/build/server/chunks/Toast-ihrVamsT.js.map +0 -1
- package/build/server/chunks/_layout.svelte-COfbk473.js.map +0 -1
- package/build/server/chunks/_page.svelte-C5Xngf9U.js.map +0 -1
- package/build/server/chunks/_page.svelte-CKSi7jlX.js.map +0 -1
- package/build/server/chunks/_server.ts-BNGntgHD.js.map +0 -1
- package/build/server/chunks/_server.ts-BbeQOMoJ.js +0 -19
- package/build/server/chunks/_server.ts-BbeQOMoJ.js.map +0 -1
- package/build/server/chunks/_server.ts-CHX8x48n.js +0 -27
- package/build/server/chunks/_server.ts-CHX8x48n.js.map +0 -1
- package/build/server/chunks/_server.ts-a85289si.js.map +0 -1
- package/build/server/chunks/_server.ts-bj28Awpj.js.map +0 -1
- package/build/server/chunks/index-DzYX9r1_.js.map +0 -1
- package/build/server/chunks/index2-Da0doXJY.js.map +0 -1
- package/build/server/chunks/index3-DkgTDgY2.js.map +0 -1
- package/build/server/chunks/index4-BUZEWk-I.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
3
|
-
import { I as InputModal } from './InputModal-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a1 as escape_html, a2 as is_array, a3 as get_prototype_of, a4 as object_prototype } from './index2-ybZwlzIk.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-Dr8M-5Wk.js';
|
|
3
|
+
import { I as InputModal } from './InputModal-CbpiMXy3.js';
|
|
4
|
+
import { t as sortProjects, u as getDisplayTitle, v as parseCommandMessage, w as deleteMessageWithChainRepair } from './index3-D8wHvUHX.js';
|
|
5
|
+
import { k as store_get, l as ensure_array_like, d as attr, f as attr_class, j as stringify, m as unsubscribe_stores, n as attributes, o as await_block, p as clsx } from './index-BEaiIYry.js';
|
|
6
6
|
import 'marked';
|
|
7
7
|
import 'fs';
|
|
8
8
|
import 'os';
|
|
9
9
|
import 'path';
|
|
10
10
|
import 'effect';
|
|
11
11
|
import 'fs/promises';
|
|
12
|
+
import 'crypto';
|
|
12
13
|
|
|
13
14
|
const empty = [];
|
|
14
15
|
function snapshot(value, skip_warning = false, no_tojson = false) {
|
|
@@ -133,8 +134,8 @@ const deleteSession = (project, id) => del(
|
|
|
133
134
|
`/session?project=${encodeURIComponent(project)}&id=${encodeURIComponent(id)}`
|
|
134
135
|
);
|
|
135
136
|
const renameSession = (project, id, title) => post("/session/rename", { project, id, title });
|
|
136
|
-
const deleteMessage = (project, session, uuid) => del(
|
|
137
|
-
`/message?project=${encodeURIComponent(project)}&session=${encodeURIComponent(session)}&uuid=${encodeURIComponent(uuid)}`
|
|
137
|
+
const deleteMessage = (project, session, uuid, targetType) => del(
|
|
138
|
+
`/message?project=${encodeURIComponent(project)}&session=${encodeURIComponent(session)}&uuid=${encodeURIComponent(uuid)}${targetType ? `&targetType=${targetType}` : ""}`
|
|
138
139
|
);
|
|
139
140
|
const updateCustomTitle = (project, session, uuid, customTitle) => patch(
|
|
140
141
|
`/message?project=${encodeURIComponent(project)}&session=${encodeURIComponent(session)}&uuid=${encodeURIComponent(uuid)}`,
|
|
@@ -149,7 +150,12 @@ const checkFileExists = async (filePath) => {
|
|
|
149
150
|
return false;
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
|
-
const expandProject = (projectName) =>
|
|
153
|
+
const expandProject = (projectName, sortOptions) => {
|
|
154
|
+
const params = new URLSearchParams({ project: projectName });
|
|
155
|
+
if (sortOptions?.field) params.set("sortField", sortOptions.field);
|
|
156
|
+
if (sortOptions?.order) params.set("sortOrder", sortOptions.order);
|
|
157
|
+
return get(`/project/expand?${params.toString()}`);
|
|
158
|
+
};
|
|
153
159
|
const resumeSession = (projectName, sessionId) => post("/session/resume", { projectName, sessionId });
|
|
154
160
|
const maskHomePaths = (text) => {
|
|
155
161
|
return maskHomePath(text);
|
|
@@ -183,6 +189,41 @@ const getMessageContent = (msg) => {
|
|
|
183
189
|
}
|
|
184
190
|
return maskHomePaths(content);
|
|
185
191
|
};
|
|
192
|
+
const parseStopHookSummary = (msg) => {
|
|
193
|
+
const m = msg;
|
|
194
|
+
if (m?.subtype !== "stop_hook_summary") return null;
|
|
195
|
+
return {
|
|
196
|
+
hookCount: m.hookCount ?? 0,
|
|
197
|
+
hookInfos: m.hookInfos ?? [],
|
|
198
|
+
hookErrors: m.hookErrors ?? [],
|
|
199
|
+
preventedContinuation: m.preventedContinuation ?? false,
|
|
200
|
+
stopReason: m.stopReason ?? "",
|
|
201
|
+
hasOutput: m.hasOutput ?? false,
|
|
202
|
+
level: m.level ?? "info"
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
const parseTurnDuration = (msg) => {
|
|
206
|
+
const m = msg;
|
|
207
|
+
if (m?.subtype !== "turn_duration") return null;
|
|
208
|
+
const durationMs = m.durationMs ?? 0;
|
|
209
|
+
const seconds = Math.round(durationMs / 1e3);
|
|
210
|
+
const minutes = Math.floor(seconds / 60);
|
|
211
|
+
const remainingSeconds = seconds % 60;
|
|
212
|
+
const durationFormatted = minutes > 0 ? `${minutes}m ${remainingSeconds}s` : `${remainingSeconds}s`;
|
|
213
|
+
return { durationMs, durationFormatted };
|
|
214
|
+
};
|
|
215
|
+
const parseProgress = (msg) => {
|
|
216
|
+
const m = msg;
|
|
217
|
+
if (m?.type !== "progress") return null;
|
|
218
|
+
const data = m.data;
|
|
219
|
+
if (!data) return null;
|
|
220
|
+
return {
|
|
221
|
+
type: data.type ?? "unknown",
|
|
222
|
+
hookEvent: data.hookEvent,
|
|
223
|
+
hookName: data.hookName,
|
|
224
|
+
command: data.command
|
|
225
|
+
};
|
|
226
|
+
};
|
|
186
227
|
const parseIdeTags = (content) => {
|
|
187
228
|
const segments = [];
|
|
188
229
|
const regex = /<(ide_[^>]+)>([\s\S]*?)<\/\1>/g;
|
|
@@ -423,12 +464,23 @@ function MessageItem($$renderer, $$props) {
|
|
|
423
464
|
};
|
|
424
465
|
})();
|
|
425
466
|
const commandData = (() => {
|
|
426
|
-
if (
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
467
|
+
if (isLocalCommand) {
|
|
468
|
+
const content = typeof msg.content === "string" ? msg.content : "";
|
|
469
|
+
return parseCommandMessage(content);
|
|
470
|
+
}
|
|
471
|
+
if (isHuman) {
|
|
472
|
+
const m = msg.message;
|
|
473
|
+
const content = typeof m?.content === "string" ? m.content : "";
|
|
474
|
+
if (content.includes("<command-name>")) {
|
|
475
|
+
return parseCommandMessage(content);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return null;
|
|
431
479
|
})();
|
|
480
|
+
const isSlashCommand = commandData !== null && !isLocalCommand;
|
|
481
|
+
const stopHookData = parseStopHookSummary(msg);
|
|
482
|
+
const turnDurationData = parseTurnDuration(msg);
|
|
483
|
+
const progressData = parseProgress(msg);
|
|
432
484
|
const FILE_TOOLS = ["Read", "Write", "Edit"];
|
|
433
485
|
const toolUseData = (() => {
|
|
434
486
|
if (!isAssistant) return null;
|
|
@@ -501,204 +553,274 @@ function MessageItem($$renderer, $$props) {
|
|
|
501
553
|
$$renderer2.push("<!--[-->");
|
|
502
554
|
} else {
|
|
503
555
|
$$renderer2.push("<!--[!-->");
|
|
504
|
-
if (
|
|
556
|
+
if (progressData) {
|
|
505
557
|
$$renderer2.push("<!--[-->");
|
|
506
|
-
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-
|
|
558
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-2 rounded-lg bg-gh-border-subtle/30 group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary/60"><span>🔄 ${escape_html(progressData.hookName ?? progressData.type)}</span> <div class="flex items-center gap-2">`);
|
|
507
559
|
splitButton($$renderer2);
|
|
508
560
|
$$renderer2.push(`<!----> `);
|
|
509
561
|
deleteButton($$renderer2);
|
|
510
|
-
$$renderer2.push(`<!----></div></div
|
|
511
|
-
const each_array = ensure_array_like(snapshotData.files);
|
|
512
|
-
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
513
|
-
let [filePath, info] = each_array[$$index];
|
|
514
|
-
const hasBackup = !!(info.backupFileName && sessionId);
|
|
515
|
-
$$renderer2.push(`<li class="font-mono text-xs truncate"${attr("title", maskHomePaths(filePath))}>`);
|
|
516
|
-
if (hasBackup) {
|
|
517
|
-
$$renderer2.push("<!--[-->");
|
|
518
|
-
$$renderer2.push(`<button class="text-gh-accent hover:underline cursor-pointer bg-transparent border-none p-0" title="Open backup in VS Code">${escape_html(maskHomePaths(filePath))}</button>`);
|
|
519
|
-
} else {
|
|
520
|
-
$$renderer2.push("<!--[!-->");
|
|
521
|
-
$$renderer2.push(`<span class="text-gh-text-secondary">${escape_html(maskHomePaths(filePath))}</span>`);
|
|
522
|
-
}
|
|
523
|
-
$$renderer2.push(`<!--]--></li>`);
|
|
524
|
-
}
|
|
525
|
-
$$renderer2.push(`<!--]--></ul></div>`);
|
|
562
|
+
$$renderer2.push(`<!----></div></div></div>`);
|
|
526
563
|
} else {
|
|
527
564
|
$$renderer2.push("<!--[!-->");
|
|
528
|
-
if (
|
|
565
|
+
if (turnDurationData) {
|
|
529
566
|
$$renderer2.push("<!--[-->");
|
|
530
|
-
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-
|
|
567
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-2 rounded-lg bg-gh-border-subtle/50 group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary"><span class="text-gh-text-secondary/70">⏱️ ${escape_html(turnDurationData.durationFormatted)}</span> <div class="flex items-center gap-2">`);
|
|
531
568
|
splitButton($$renderer2);
|
|
532
569
|
$$renderer2.push(`<!----> `);
|
|
533
570
|
deleteButton($$renderer2);
|
|
534
|
-
$$renderer2.push(`<!----></div></div
|
|
535
|
-
if (commandData.message && commandData.message !== commandData.name?.slice(1)) {
|
|
536
|
-
$$renderer2.push("<!--[-->");
|
|
537
|
-
$$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(commandData.message)}</p>`);
|
|
538
|
-
} else {
|
|
539
|
-
$$renderer2.push("<!--[!-->");
|
|
540
|
-
}
|
|
541
|
-
$$renderer2.push(`<!--]--></div>`);
|
|
571
|
+
$$renderer2.push(`<!----></div></div></div>`);
|
|
542
572
|
} else {
|
|
543
573
|
$$renderer2.push("<!--[!-->");
|
|
544
|
-
if (
|
|
574
|
+
if (stopHookData) {
|
|
545
575
|
$$renderer2.push("<!--[-->");
|
|
546
|
-
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-3 rounded-lg bg-
|
|
576
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-3 rounded-lg bg-emerald-500/10 border-l-3 border-l-emerald-500 group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary"><span class="font-semibold text-emerald-400">🪝 Hook (${escape_html(stopHookData.hookCount)})</span> <div class="flex items-center gap-2"><span>${escape_html(formatDate(msg.timestamp))}</span> `);
|
|
547
577
|
splitButton($$renderer2);
|
|
548
578
|
$$renderer2.push(`<!----> `);
|
|
549
579
|
deleteButton($$renderer2);
|
|
550
580
|
$$renderer2.push(`<!----></div></div> `);
|
|
551
|
-
if (
|
|
581
|
+
if (stopHookData.hookInfos.length > 0) {
|
|
552
582
|
$$renderer2.push("<!--[-->");
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
if (exists) {
|
|
561
|
-
$$renderer2.push("<!--[-->");
|
|
562
|
-
$$renderer2.push(`<button class="mt-1 text-sm text-gh-accent hover:underline cursor-pointer bg-transparent border-none p-0 font-mono truncate block max-w-full text-left"${attr("title", toolUseData.filePath)}>${escape_html(toolUseData.filePath.split("/").pop())}</button>`);
|
|
563
|
-
} else {
|
|
564
|
-
$$renderer2.push("<!--[!-->");
|
|
565
|
-
$$renderer2.push(`<span class="mt-1 text-sm text-gh-text-secondary font-mono"${attr("title", toolUseData.filePath)}>${escape_html(toolUseData.filePath.split("/").pop())}</span>`);
|
|
566
|
-
}
|
|
567
|
-
$$renderer2.push(`<!--]-->`);
|
|
568
|
-
}
|
|
569
|
-
);
|
|
570
|
-
$$renderer2.push(`<!--]-->`);
|
|
583
|
+
$$renderer2.push(`<div class="mt-1 text-xs text-gh-text-secondary"><!--[-->`);
|
|
584
|
+
const each_array = ensure_array_like(stopHookData.hookInfos);
|
|
585
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
586
|
+
let hook = each_array[$$index];
|
|
587
|
+
$$renderer2.push(`<span class="font-mono">${escape_html(hook.command)}</span>`);
|
|
588
|
+
}
|
|
589
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
571
590
|
} else {
|
|
572
591
|
$$renderer2.push("<!--[!-->");
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
$$renderer2.push(
|
|
582
|
-
ExpandableContent($$renderer2, {
|
|
583
|
-
content: String(toolUseData.input.command),
|
|
584
|
-
lang: "sh",
|
|
585
|
-
maxLines: 3
|
|
586
|
-
});
|
|
587
|
-
$$renderer2.push(`<!---->`);
|
|
588
|
-
} else {
|
|
589
|
-
$$renderer2.push("<!--[!-->");
|
|
590
|
-
const { path: _path, ...input } = toolUseData.input;
|
|
591
|
-
const keys = Object.keys(input);
|
|
592
|
-
if (keys.length === 1) {
|
|
593
|
-
$$renderer2.push("<!--[-->");
|
|
594
|
-
const key = keys[0];
|
|
595
|
-
const value = input[key];
|
|
596
|
-
$$renderer2.push(`${escape_html((() => {
|
|
597
|
-
console.info(`${key} =`, value);
|
|
598
|
-
return "";
|
|
599
|
-
})())} `);
|
|
600
|
-
if (key === "todos" && Array.isArray(value)) {
|
|
601
|
-
$$renderer2.push("<!--[-->");
|
|
602
|
-
TodoItem($$renderer2, { todos: value });
|
|
603
|
-
} else {
|
|
604
|
-
$$renderer2.push("<!--[!-->");
|
|
605
|
-
ExpandableContent($$renderer2, {
|
|
606
|
-
content: `${key} = ${JSON.stringify(value, null, 2)}`,
|
|
607
|
-
lang: "js",
|
|
608
|
-
maxLines: 1
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
$$renderer2.push(`<!--]-->`);
|
|
612
|
-
} else {
|
|
613
|
-
$$renderer2.push("<!--[!-->");
|
|
614
|
-
ExpandableContent($$renderer2, {
|
|
615
|
-
content: JSON.stringify(input, null, 2),
|
|
616
|
-
lang: "json",
|
|
617
|
-
maxLines: 6
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
$$renderer2.push(`<!--]-->`);
|
|
592
|
+
}
|
|
593
|
+
$$renderer2.push(`<!--]--> `);
|
|
594
|
+
if (stopHookData.hookErrors.length > 0) {
|
|
595
|
+
$$renderer2.push("<!--[-->");
|
|
596
|
+
$$renderer2.push(`<div class="mt-1 text-xs text-red-400"><!--[-->`);
|
|
597
|
+
const each_array_1 = ensure_array_like(stopHookData.hookErrors);
|
|
598
|
+
for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
|
|
599
|
+
let error = each_array_1[$$index_1];
|
|
600
|
+
$$renderer2.push(`<p>${escape_html(error)}</p>`);
|
|
621
601
|
}
|
|
622
|
-
$$renderer2.push(`<!--]
|
|
602
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
603
|
+
} else {
|
|
604
|
+
$$renderer2.push("<!--[!-->");
|
|
623
605
|
}
|
|
624
606
|
$$renderer2.push(`<!--]--></div>`);
|
|
625
607
|
} else {
|
|
626
608
|
$$renderer2.push("<!--[!-->");
|
|
627
|
-
if (
|
|
609
|
+
if (isFileSnapshot && snapshotData) {
|
|
628
610
|
$$renderer2.push("<!--[-->");
|
|
629
|
-
$$renderer2.push(`<div${attr("data-msg-id", msgId)}
|
|
630
|
-
if (isCustomTitle && onEditTitle) {
|
|
631
|
-
$$renderer2.push("<!--[-->");
|
|
632
|
-
TooltipButton($$renderer2, {
|
|
633
|
-
class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-border text-xs",
|
|
634
|
-
onclick: () => onEditTitle(msg),
|
|
635
|
-
title: "Edit title",
|
|
636
|
-
children: ($$renderer3) => {
|
|
637
|
-
$$renderer3.push(`<!---->✏️`);
|
|
638
|
-
},
|
|
639
|
-
$$slots: { default: true }
|
|
640
|
-
});
|
|
641
|
-
} else {
|
|
642
|
-
$$renderer2.push("<!--[!-->");
|
|
643
|
-
}
|
|
644
|
-
$$renderer2.push(`<!--]--> `);
|
|
611
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-4 rounded-lg bg-amber-500/10 border-l-3 border-l-amber-500 group relative"${attr("title", `messageId: ${stringify(messageId)}`)}><div class="flex justify-between mb-2 text-xs text-gh-text-secondary"><span class="uppercase font-semibold text-amber-400">📁 File Backups (${escape_html(snapshotData.files.length)})</span> <div class="flex items-center gap-2"><span>${escape_html(formatDate(snapshotData.timestamp))}</span> `);
|
|
645
612
|
splitButton($$renderer2);
|
|
646
613
|
$$renderer2.push(`<!----> `);
|
|
647
614
|
deleteButton($$renderer2);
|
|
648
|
-
$$renderer2.push(`<!----></div></div>
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
$$renderer2.push(
|
|
615
|
+
$$renderer2.push(`<!----></div></div> <ul class="space-y-1"><!--[-->`);
|
|
616
|
+
const each_array_2 = ensure_array_like(snapshotData.files);
|
|
617
|
+
for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
|
|
618
|
+
let [filePath, info] = each_array_2[$$index_2];
|
|
619
|
+
const hasBackup = !!(info.backupFileName && sessionId);
|
|
620
|
+
$$renderer2.push(`<li class="font-mono text-xs truncate"${attr("title", maskHomePaths(filePath))}>`);
|
|
621
|
+
if (hasBackup) {
|
|
622
|
+
$$renderer2.push("<!--[-->");
|
|
623
|
+
$$renderer2.push(`<button class="text-gh-accent hover:underline cursor-pointer bg-transparent border-none p-0" title="Open backup in VS Code">${escape_html(maskHomePaths(filePath))}</button>`);
|
|
624
|
+
} else {
|
|
625
|
+
$$renderer2.push("<!--[!-->");
|
|
626
|
+
$$renderer2.push(`<span class="text-gh-text-secondary">${escape_html(maskHomePaths(filePath))}</span>`);
|
|
656
627
|
}
|
|
657
|
-
$$renderer2.push(`<!--]--></
|
|
658
|
-
} else {
|
|
659
|
-
$$renderer2.push("<!--[!-->");
|
|
628
|
+
$$renderer2.push(`<!--]--></li>`);
|
|
660
629
|
}
|
|
661
|
-
$$renderer2.push(`<!--]
|
|
662
|
-
|
|
630
|
+
$$renderer2.push(`<!--]--></ul></div>`);
|
|
631
|
+
} else {
|
|
632
|
+
$$renderer2.push("<!--[!-->");
|
|
633
|
+
if (isSlashCommand && commandData) {
|
|
663
634
|
$$renderer2.push("<!--[-->");
|
|
664
|
-
$$renderer2.push(`<div class="
|
|
665
|
-
|
|
635
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-3 rounded-lg bg-gh-accent/15 border-l-3 border-l-gh-accent group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary"><span class="font-semibold text-gh-accent">${escape_html(commandData.name || "Command")}</span> <div class="flex items-center gap-2"><span>${escape_html(formatDate(msg.timestamp))}</span> `);
|
|
636
|
+
splitButton($$renderer2);
|
|
637
|
+
$$renderer2.push(`<!----> `);
|
|
638
|
+
deleteButton($$renderer2);
|
|
639
|
+
$$renderer2.push(`<!----></div></div></div>`);
|
|
640
|
+
} else {
|
|
641
|
+
$$renderer2.push("<!--[!-->");
|
|
642
|
+
if (isLocalCommand && commandData) {
|
|
666
643
|
$$renderer2.push("<!--[-->");
|
|
667
|
-
$$renderer2.push(`<span class="font-semibold text-
|
|
644
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-3 rounded-lg bg-cyan-500/10 border-l-3 border-l-cyan-500 group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary"><span class="font-semibold text-cyan-400">⚡ ${escape_html(commandData.name || "Command")}</span> <div class="flex items-center gap-2"><span>${escape_html(formatDate(msg.timestamp))}</span> `);
|
|
645
|
+
splitButton($$renderer2);
|
|
646
|
+
$$renderer2.push(`<!----> `);
|
|
647
|
+
deleteButton($$renderer2);
|
|
648
|
+
$$renderer2.push(`<!----></div></div> `);
|
|
649
|
+
if (commandData.message && commandData.message !== commandData.name?.slice(1)) {
|
|
650
|
+
$$renderer2.push("<!--[-->");
|
|
651
|
+
$$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(commandData.message)}</p>`);
|
|
652
|
+
} else {
|
|
653
|
+
$$renderer2.push("<!--[!-->");
|
|
654
|
+
}
|
|
655
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
668
656
|
} else {
|
|
669
657
|
$$renderer2.push("<!--[!-->");
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
658
|
+
if (toolUseData) {
|
|
659
|
+
$$renderer2.push("<!--[-->");
|
|
660
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)} class="p-3 rounded-lg bg-violet-500/10 border-l-3 border-l-violet-500 group relative"><div class="flex justify-between items-center text-xs text-gh-text-secondary"><span class="font-semibold text-violet-400">🔧 ${escape_html(toolUseData.name)}</span> <div class="flex items-center gap-2"><span>${escape_html(formatDate(msg.timestamp))}</span> `);
|
|
661
|
+
splitButton($$renderer2);
|
|
662
|
+
$$renderer2.push(`<!----> `);
|
|
663
|
+
deleteButton($$renderer2);
|
|
664
|
+
$$renderer2.push(`<!----></div></div> `);
|
|
665
|
+
if (toolUseData.filePath) {
|
|
677
666
|
$$renderer2.push("<!--[-->");
|
|
678
|
-
|
|
667
|
+
await_block(
|
|
668
|
+
$$renderer2,
|
|
669
|
+
checkFileExists(toolUseData.filePath),
|
|
670
|
+
() => {
|
|
671
|
+
$$renderer2.push(`<span class="mt-1 text-sm text-gh-text-secondary font-mono">${escape_html(toolUseData.filePath.split("/").pop())}</span>`);
|
|
672
|
+
},
|
|
673
|
+
(exists) => {
|
|
674
|
+
if (exists) {
|
|
675
|
+
$$renderer2.push("<!--[-->");
|
|
676
|
+
$$renderer2.push(`<button class="mt-1 text-sm text-gh-accent hover:underline cursor-pointer bg-transparent border-none p-0 font-mono truncate block max-w-full text-left"${attr("title", toolUseData.filePath)}>${escape_html(toolUseData.filePath.split("/").pop())}</button>`);
|
|
677
|
+
} else {
|
|
678
|
+
$$renderer2.push("<!--[!-->");
|
|
679
|
+
$$renderer2.push(`<span class="mt-1 text-sm text-gh-text-secondary font-mono"${attr("title", toolUseData.filePath)}>${escape_html(toolUseData.filePath.split("/").pop())}</span>`);
|
|
680
|
+
}
|
|
681
|
+
$$renderer2.push(`<!--]-->`);
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
$$renderer2.push(`<!--]-->`);
|
|
679
685
|
} else {
|
|
680
686
|
$$renderer2.push("<!--[!-->");
|
|
681
|
-
|
|
682
|
-
if (textLines.length > 10) {
|
|
687
|
+
if (toolUseData.input.command) {
|
|
683
688
|
$$renderer2.push("<!--[-->");
|
|
684
|
-
|
|
689
|
+
if (toolUseData.input.description) {
|
|
690
|
+
$$renderer2.push("<!--[-->");
|
|
691
|
+
$$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(toolUseData.input.description)}</p>`);
|
|
692
|
+
} else {
|
|
693
|
+
$$renderer2.push("<!--[!-->");
|
|
694
|
+
}
|
|
695
|
+
$$renderer2.push(`<!--]--> `);
|
|
696
|
+
ExpandableContent($$renderer2, {
|
|
697
|
+
content: String(toolUseData.input.command),
|
|
698
|
+
lang: "sh",
|
|
699
|
+
maxLines: 3
|
|
700
|
+
});
|
|
701
|
+
$$renderer2.push(`<!---->`);
|
|
685
702
|
} else {
|
|
686
703
|
$$renderer2.push("<!--[!-->");
|
|
687
|
-
|
|
704
|
+
const { path: _path, ...input } = toolUseData.input;
|
|
705
|
+
const keys = Object.keys(input);
|
|
706
|
+
if (keys.length === 1) {
|
|
707
|
+
$$renderer2.push("<!--[-->");
|
|
708
|
+
const key = keys[0];
|
|
709
|
+
const value = input[key];
|
|
710
|
+
$$renderer2.push(`${escape_html((() => {
|
|
711
|
+
console.info(`${key} =`, value);
|
|
712
|
+
return "";
|
|
713
|
+
})())} `);
|
|
714
|
+
if (key === "todos" && Array.isArray(value)) {
|
|
715
|
+
$$renderer2.push("<!--[-->");
|
|
716
|
+
TodoItem($$renderer2, { todos: value });
|
|
717
|
+
} else {
|
|
718
|
+
$$renderer2.push("<!--[!-->");
|
|
719
|
+
ExpandableContent($$renderer2, {
|
|
720
|
+
content: `${key} = ${JSON.stringify(value, null, 2)}`,
|
|
721
|
+
lang: "js",
|
|
722
|
+
maxLines: 1
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
$$renderer2.push(`<!--]-->`);
|
|
726
|
+
} else {
|
|
727
|
+
$$renderer2.push("<!--[!-->");
|
|
728
|
+
ExpandableContent($$renderer2, {
|
|
729
|
+
content: JSON.stringify(input, null, 2),
|
|
730
|
+
lang: "json",
|
|
731
|
+
maxLines: 6
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
$$renderer2.push(`<!--]-->`);
|
|
688
735
|
}
|
|
689
736
|
$$renderer2.push(`<!--]-->`);
|
|
690
737
|
}
|
|
738
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
739
|
+
} else {
|
|
740
|
+
$$renderer2.push("<!--[!-->");
|
|
741
|
+
if (hasAnyContent) {
|
|
742
|
+
$$renderer2.push("<!--[-->");
|
|
743
|
+
$$renderer2.push(`<div${attr("data-msg-id", msgId)}${attr_class(`p-4 rounded-lg group relative ${stringify(messageClass)} flex flex-col ${stringify(hasAnyContent ? "gap-2" : "")}`)}><div class="flex justify-between text-xs text-gh-text-secondary"><span class="uppercase font-semibold">${escape_html(isToolResult ? "OUT" : msg.type)}</span> <div class="flex items-center gap-2"><span class="group-hover:hidden">${escape_html(formatDate(msg.timestamp))}</span> <span class="hidden group-hover:inline font-mono text-gh-text-secondary/70">${escape_html(messageId)}</span> `);
|
|
744
|
+
if (isCustomTitle && onEditTitle) {
|
|
745
|
+
$$renderer2.push("<!--[-->");
|
|
746
|
+
TooltipButton($$renderer2, {
|
|
747
|
+
class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-border text-xs",
|
|
748
|
+
onclick: () => onEditTitle(msg),
|
|
749
|
+
title: "Edit title",
|
|
750
|
+
children: ($$renderer3) => {
|
|
751
|
+
$$renderer3.push(`<!---->✏️`);
|
|
752
|
+
},
|
|
753
|
+
$$slots: { default: true }
|
|
754
|
+
});
|
|
755
|
+
} else {
|
|
756
|
+
$$renderer2.push("<!--[!-->");
|
|
757
|
+
}
|
|
758
|
+
$$renderer2.push(`<!--]--> `);
|
|
759
|
+
splitButton($$renderer2);
|
|
760
|
+
$$renderer2.push(`<!----> `);
|
|
761
|
+
deleteButton($$renderer2);
|
|
762
|
+
$$renderer2.push(`<!----></div></div> `);
|
|
763
|
+
if (thinkingBlocks.length > 0) {
|
|
764
|
+
$$renderer2.push("<!--[-->");
|
|
765
|
+
$$renderer2.push(`<div class="message-content text-sm"><!--[-->`);
|
|
766
|
+
const each_array_3 = ensure_array_like(thinkingBlocks);
|
|
767
|
+
for (let i = 0, $$length = each_array_3.length; i < $$length; i++) {
|
|
768
|
+
let block = each_array_3[i];
|
|
769
|
+
$$renderer2.push(`<details class="text-gh-text-secondary"><summary class="cursor-pointer text-xs italic hover:text-gh-text select-none">💭 Thinking ${escape_html(thinkingBlocks.length > 1 ? `(${i + 1}/${thinkingBlocks.length})` : "")}</summary> <p class="mt-1 whitespace-pre-wrap italic opacity-70">${escape_html(block.thinking)}</p></details>`);
|
|
770
|
+
}
|
|
771
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
772
|
+
} else {
|
|
773
|
+
$$renderer2.push("<!--[!-->");
|
|
774
|
+
}
|
|
775
|
+
$$renderer2.push(`<!--]--> `);
|
|
776
|
+
if (hasContent) {
|
|
777
|
+
$$renderer2.push("<!--[-->");
|
|
778
|
+
$$renderer2.push(`<div class="message-content text-sm">`);
|
|
779
|
+
if (isCustomTitle) {
|
|
780
|
+
$$renderer2.push("<!--[-->");
|
|
781
|
+
$$renderer2.push(`<span class="font-semibold text-purple-400">${escape_html(customTitle)}</span>`);
|
|
782
|
+
} else {
|
|
783
|
+
$$renderer2.push("<!--[!-->");
|
|
784
|
+
const msgContent = getMessageContent(msg);
|
|
785
|
+
const segments = parseIdeTags(msgContent);
|
|
786
|
+
$$renderer2.push(`<!--[-->`);
|
|
787
|
+
const each_array_4 = ensure_array_like(segments);
|
|
788
|
+
for (let $$index_4 = 0, $$length = each_array_4.length; $$index_4 < $$length; $$index_4++) {
|
|
789
|
+
let segment = each_array_4[$$index_4];
|
|
790
|
+
if (segment.type === "ide_tag" && segment.tag) {
|
|
791
|
+
$$renderer2.push("<!--[-->");
|
|
792
|
+
IdeTag($$renderer2, { tag: segment.tag, content: segment.content });
|
|
793
|
+
} else {
|
|
794
|
+
$$renderer2.push("<!--[!-->");
|
|
795
|
+
const textLines = segment.content.split("\n");
|
|
796
|
+
if (textLines.length > 10) {
|
|
797
|
+
$$renderer2.push("<!--[-->");
|
|
798
|
+
ExpandableContent($$renderer2, { content: segment.content, maxLines: 10 });
|
|
799
|
+
} else {
|
|
800
|
+
$$renderer2.push("<!--[!-->");
|
|
801
|
+
$$renderer2.push(`<p class="whitespace-pre-wrap">${escape_html(segment.content)}</p>`);
|
|
802
|
+
}
|
|
803
|
+
$$renderer2.push(`<!--]-->`);
|
|
804
|
+
}
|
|
805
|
+
$$renderer2.push(`<!--]-->`);
|
|
806
|
+
}
|
|
807
|
+
$$renderer2.push(`<!--]-->`);
|
|
808
|
+
}
|
|
809
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
810
|
+
} else {
|
|
811
|
+
$$renderer2.push("<!--[!-->");
|
|
812
|
+
}
|
|
813
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
814
|
+
} else {
|
|
815
|
+
$$renderer2.push("<!--[!-->");
|
|
816
|
+
}
|
|
691
817
|
$$renderer2.push(`<!--]-->`);
|
|
692
818
|
}
|
|
693
819
|
$$renderer2.push(`<!--]-->`);
|
|
694
820
|
}
|
|
695
|
-
$$renderer2.push(`<!--]
|
|
696
|
-
} else {
|
|
697
|
-
$$renderer2.push("<!--[!-->");
|
|
821
|
+
$$renderer2.push(`<!--]-->`);
|
|
698
822
|
}
|
|
699
|
-
$$renderer2.push(`<!--]
|
|
700
|
-
} else {
|
|
701
|
-
$$renderer2.push("<!--[!-->");
|
|
823
|
+
$$renderer2.push(`<!--]-->`);
|
|
702
824
|
}
|
|
703
825
|
$$renderer2.push(`<!--]-->`);
|
|
704
826
|
}
|
|
@@ -711,6 +833,34 @@ function MessageItem($$renderer, $$props) {
|
|
|
711
833
|
$$renderer2.push(`<!--]-->`);
|
|
712
834
|
});
|
|
713
835
|
}
|
|
836
|
+
function MessageList($$renderer, $$props) {
|
|
837
|
+
$$renderer.component(($$renderer2) => {
|
|
838
|
+
let {
|
|
839
|
+
sessionId,
|
|
840
|
+
messages,
|
|
841
|
+
onDeleteMessage,
|
|
842
|
+
onEditTitle,
|
|
843
|
+
onSplitSession,
|
|
844
|
+
enableScroll = true,
|
|
845
|
+
fullWidth = false
|
|
846
|
+
} = $$props;
|
|
847
|
+
const firstMeaningfulIndex = messages.findIndex((m) => m.type === "user" || m.type === "assistant" || m.type === "human");
|
|
848
|
+
$$renderer2.push(`<section${attr_class(`bg-gh-bg-secondary overflow-hidden flex flex-col ${stringify(fullWidth ? "" : "border border-gh-border rounded-lg")}`)}><div${attr_class(`${stringify(enableScroll ? "overflow-y-auto" : "")} flex-1 p-4 flex flex-col gap-4`)}><!--[-->`);
|
|
849
|
+
const each_array = ensure_array_like(messages);
|
|
850
|
+
for (let i = 0, $$length = each_array.length; i < $$length; i++) {
|
|
851
|
+
let msg = each_array[i];
|
|
852
|
+
MessageItem($$renderer2, {
|
|
853
|
+
msg,
|
|
854
|
+
sessionId,
|
|
855
|
+
isFirst: i === 0 || i === firstMeaningfulIndex,
|
|
856
|
+
onDelete: onDeleteMessage,
|
|
857
|
+
onEditTitle,
|
|
858
|
+
onSplit: onSplitSession
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
$$renderer2.push(`<!--]--></div></section>`);
|
|
862
|
+
});
|
|
863
|
+
}
|
|
714
864
|
function ProjectTree($$renderer, $$props) {
|
|
715
865
|
$$renderer.component(($$renderer2) => {
|
|
716
866
|
var $$store_subs;
|
|
@@ -721,22 +871,31 @@ function ProjectTree($$renderer, $$props) {
|
|
|
721
871
|
expandedProjects,
|
|
722
872
|
selectedSession,
|
|
723
873
|
loadingProject,
|
|
874
|
+
sortField,
|
|
875
|
+
sortOrder,
|
|
724
876
|
onRenameSession,
|
|
725
877
|
onDeleteSession,
|
|
726
|
-
onResumeSession
|
|
878
|
+
onResumeSession,
|
|
879
|
+
onSortChange
|
|
727
880
|
} = $$props;
|
|
881
|
+
const sortFieldLabels = {
|
|
882
|
+
summary: "Summary Time",
|
|
883
|
+
modified: "Modified",
|
|
884
|
+
created: "Created",
|
|
885
|
+
updated: "Last Message",
|
|
886
|
+
messageCount: "Messages",
|
|
887
|
+
title: "Title"
|
|
888
|
+
};
|
|
889
|
+
const handleSortFieldChange = (e) => {
|
|
890
|
+
const target = e.target;
|
|
891
|
+
onSortChange?.(target.value, sortOrder);
|
|
892
|
+
};
|
|
728
893
|
const getSessionData = (projectName, sessionId) => {
|
|
729
894
|
return projectSessionData.get(projectName)?.get(sessionId);
|
|
730
895
|
};
|
|
731
|
-
const
|
|
896
|
+
const getDisplayTitle$1 = (session) => {
|
|
732
897
|
const data = getSessionData(session.projectName, session.id);
|
|
733
|
-
|
|
734
|
-
if (data?.currentSummary) {
|
|
735
|
-
const summary = data.currentSummary;
|
|
736
|
-
return summary.length > 60 ? summary.slice(0, 57) + "..." : summary;
|
|
737
|
-
}
|
|
738
|
-
if (session.title && session.title !== "Untitled") return session.title;
|
|
739
|
-
return "Untitled";
|
|
898
|
+
return getDisplayTitle(data?.customTitle, data?.currentSummary, session.title);
|
|
740
899
|
};
|
|
741
900
|
const getTooltipText = (session) => {
|
|
742
901
|
const data = getSessionData(session.projectName, session.id);
|
|
@@ -767,10 +926,29 @@ function ProjectTree($$renderer, $$props) {
|
|
|
767
926
|
let expandedSessions = selectedSession ? /* @__PURE__ */ new Set([selectedSession.id]) : /* @__PURE__ */ new Set();
|
|
768
927
|
let draggedSession = null;
|
|
769
928
|
let dropTargetProject = null;
|
|
770
|
-
$$renderer2.push(`<aside class="bg-gh-bg-secondary border border-gh-border rounded-lg overflow-hidden flex flex-col"><
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
929
|
+
$$renderer2.push(`<aside class="bg-gh-bg-secondary border border-gh-border rounded-lg overflow-hidden flex flex-col"><div class="p-4 border-b border-gh-border bg-gh-bg"><h2 class="text-base font-semibold mb-2">Projects (${escape_html(sortedProjects.length)})</h2> <div class="flex items-center gap-2 text-sm"><span class="text-gh-text-secondary">Sort:</span> `);
|
|
930
|
+
$$renderer2.select(
|
|
931
|
+
{
|
|
932
|
+
class: "bg-gh-bg-secondary border border-gh-border rounded px-2 py-1 text-sm text-gh-text cursor-pointer hover:border-gh-accent focus:border-gh-accent focus:outline-none",
|
|
933
|
+
value: sortField,
|
|
934
|
+
onchange: handleSortFieldChange
|
|
935
|
+
},
|
|
936
|
+
($$renderer3) => {
|
|
937
|
+
$$renderer3.push(`<!--[-->`);
|
|
938
|
+
const each_array = ensure_array_like(Object.entries(sortFieldLabels));
|
|
939
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
940
|
+
let [value, label] = each_array[$$index];
|
|
941
|
+
$$renderer3.option({ value }, ($$renderer4) => {
|
|
942
|
+
$$renderer4.push(`${escape_html(label)}`);
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
$$renderer3.push(`<!--]-->`);
|
|
946
|
+
}
|
|
947
|
+
);
|
|
948
|
+
$$renderer2.push(` <button class="bg-gh-bg-secondary border border-gh-border rounded px-2 py-1 text-sm cursor-pointer hover:border-gh-accent hover:bg-gh-border-subtle"${attr("title", sortOrder === "desc" ? "Descending (newest first)" : "Ascending (oldest first)")}>${escape_html(sortOrder === "desc" ? "↓" : "↑")}</button></div></div> <ul class="overflow-y-auto flex-1"><!--[-->`);
|
|
949
|
+
const each_array_1 = ensure_array_like(sortedProjects);
|
|
950
|
+
for (let $$index_5 = 0, $$length = each_array_1.length; $$index_5 < $$length; $$index_5++) {
|
|
951
|
+
let project = each_array_1[$$index_5];
|
|
774
952
|
const isDropTarget = dropTargetProject === project.name;
|
|
775
953
|
$$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> `);
|
|
776
954
|
if (expandedProjects.has(project.name)) {
|
|
@@ -782,13 +960,13 @@ function ProjectTree($$renderer, $$props) {
|
|
|
782
960
|
} else {
|
|
783
961
|
$$renderer2.push("<!--[!-->");
|
|
784
962
|
$$renderer2.push(`<!--[-->`);
|
|
785
|
-
const
|
|
786
|
-
for (let $$
|
|
787
|
-
let session =
|
|
963
|
+
const each_array_2 = ensure_array_like(projectSessions.get(project.name) ?? []);
|
|
964
|
+
for (let $$index_4 = 0, $$length2 = each_array_2.length; $$index_4 < $$length2; $$index_4++) {
|
|
965
|
+
let session = each_array_2[$$index_4];
|
|
788
966
|
const isSelected = selectedSession?.id === session.id;
|
|
789
967
|
const isDragging = draggedSession?.id === session.id;
|
|
790
968
|
const sessionInfo = getSessionInfo(session);
|
|
791
|
-
const displayTitle =
|
|
969
|
+
const displayTitle = getDisplayTitle$1(session);
|
|
792
970
|
const tooltipText = getTooltipText(session);
|
|
793
971
|
const data = getSessionData(session.projectName, session.id);
|
|
794
972
|
const isSummaryFallback = !data?.customTitle && !data?.currentSummary;
|
|
@@ -866,9 +1044,9 @@ function ProjectTree($$renderer, $$props) {
|
|
|
866
1044
|
if (data?.summaries && data.summaries.length > 0) {
|
|
867
1045
|
$$renderer2.push("<!--[-->");
|
|
868
1046
|
$$renderer2.push(`<!--[-->`);
|
|
869
|
-
const
|
|
870
|
-
for (let idx = 0, $$length3 =
|
|
871
|
-
let summary =
|
|
1047
|
+
const each_array_3 = ensure_array_like(data.summaries);
|
|
1048
|
+
for (let idx = 0, $$length3 = each_array_3.length; idx < $$length3; idx++) {
|
|
1049
|
+
let summary = each_array_3[idx];
|
|
872
1050
|
$$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> `);
|
|
873
1051
|
if (summary.timestamp) {
|
|
874
1052
|
$$renderer2.push("<!--[-->");
|
|
@@ -893,9 +1071,9 @@ function ProjectTree($$renderer, $$props) {
|
|
|
893
1071
|
if (data?.todos?.agentTodos) {
|
|
894
1072
|
$$renderer2.push("<!--[-->");
|
|
895
1073
|
$$renderer2.push(`<!--[-->`);
|
|
896
|
-
const
|
|
897
|
-
for (let $$
|
|
898
|
-
let agentTodo =
|
|
1074
|
+
const each_array_4 = ensure_array_like(data.todos.agentTodos);
|
|
1075
|
+
for (let $$index_2 = 0, $$length3 = each_array_4.length; $$index_2 < $$length3; $$index_2++) {
|
|
1076
|
+
let agentTodo = each_array_4[$$index_2];
|
|
899
1077
|
$$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>`);
|
|
900
1078
|
}
|
|
901
1079
|
$$renderer2.push(`<!--]-->`);
|
|
@@ -906,9 +1084,9 @@ function ProjectTree($$renderer, $$props) {
|
|
|
906
1084
|
if (data?.agents && data.agents.length > 0) {
|
|
907
1085
|
$$renderer2.push("<!--[-->");
|
|
908
1086
|
$$renderer2.push(`<!--[-->`);
|
|
909
|
-
const
|
|
910
|
-
for (let $$
|
|
911
|
-
let agent =
|
|
1087
|
+
const each_array_5 = ensure_array_like(data.agents);
|
|
1088
|
+
for (let $$index_3 = 0, $$length3 = each_array_5.length; $$index_3 < $$length3; $$index_3++) {
|
|
1089
|
+
let agent = each_array_5[$$index_3];
|
|
912
1090
|
$$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>`);
|
|
913
1091
|
}
|
|
914
1092
|
$$renderer2.push(`<!--]-->`);
|
|
@@ -972,46 +1150,49 @@ function SessionViewer($$renderer, $$props) {
|
|
|
972
1150
|
let undoStack = [];
|
|
973
1151
|
let undoCountdown = 0;
|
|
974
1152
|
let undoTimeoutId = null;
|
|
1153
|
+
let deleteQueue = Promise.resolve();
|
|
975
1154
|
const handleMessageDeleteWithUndo = async (msg, isAgent) => {
|
|
976
1155
|
if (!session) return;
|
|
977
1156
|
const msgId = msg.uuid || msg.messageId || msg.leafUuid;
|
|
978
1157
|
if (!msgId) return;
|
|
1158
|
+
const targetType = msg.type === "file-history-snapshot" ? "file-history-snapshot" : msg.type === "summary" ? "summary" : void 0;
|
|
979
1159
|
const targetSessionId = session.id;
|
|
980
1160
|
let index;
|
|
981
1161
|
{
|
|
982
1162
|
index = messages.findIndex((m) => (m.uuid || m.messageId || m.leafUuid) === msgId);
|
|
983
1163
|
if (index === -1) return;
|
|
984
1164
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
const newMessages = messages.filter((m) => (m.uuid || m.messageId || m.leafUuid) !== msgId);
|
|
990
|
-
onMessagesChange?.(newMessages);
|
|
991
|
-
}
|
|
992
|
-
undoStack = [
|
|
993
|
-
...undoStack,
|
|
994
|
-
{ msg, index, isAgent, sessionId: targetSessionId }
|
|
995
|
-
];
|
|
996
|
-
if (undoTimeoutId) clearTimeout(undoTimeoutId);
|
|
997
|
-
undoCountdown = 10;
|
|
998
|
-
undoTimeoutId = setTimeout(
|
|
999
|
-
() => {
|
|
1000
|
-
undoStack = [];
|
|
1001
|
-
undoCountdown = 0;
|
|
1002
|
-
undoTimeoutId = null;
|
|
1003
|
-
},
|
|
1004
|
-
1e4
|
|
1005
|
-
);
|
|
1006
|
-
onDeleteMessage?.(msg);
|
|
1007
|
-
} catch (e) {
|
|
1008
|
-
console.error("Failed to delete message:", e);
|
|
1165
|
+
{
|
|
1166
|
+
const copy = [...messages];
|
|
1167
|
+
deleteMessageWithChainRepair(copy, msgId, targetType);
|
|
1168
|
+
onMessagesChange?.(copy);
|
|
1009
1169
|
}
|
|
1170
|
+
undoStack = [
|
|
1171
|
+
...undoStack,
|
|
1172
|
+
{ msg, index, isAgent, sessionId: targetSessionId }
|
|
1173
|
+
];
|
|
1174
|
+
if (undoTimeoutId) clearTimeout(undoTimeoutId);
|
|
1175
|
+
undoCountdown = 10;
|
|
1176
|
+
undoTimeoutId = setTimeout(
|
|
1177
|
+
() => {
|
|
1178
|
+
undoStack = [];
|
|
1179
|
+
undoCountdown = 0;
|
|
1180
|
+
undoTimeoutId = null;
|
|
1181
|
+
},
|
|
1182
|
+
1e4
|
|
1183
|
+
);
|
|
1184
|
+
deleteQueue = deleteQueue.then(async () => {
|
|
1185
|
+
try {
|
|
1186
|
+
await deleteMessage(session.projectName, targetSessionId, msgId, targetType);
|
|
1187
|
+
} catch (e) {
|
|
1188
|
+
console.error("Failed to delete message:", e);
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
onDeleteMessage?.(msg);
|
|
1010
1192
|
};
|
|
1011
1193
|
const handleSessionMessageDelete = (msg) => {
|
|
1012
1194
|
handleMessageDeleteWithUndo(msg, false);
|
|
1013
1195
|
};
|
|
1014
|
-
const firstMeaningfulIndex = messages.findIndex((m) => m.type === "user" || m.type === "assistant" || m.type === "human");
|
|
1015
1196
|
$$renderer2.push(`<section${attr_class(`bg-gh-bg-secondary overflow-hidden flex flex-col h-full ${stringify(fullWidth ? "" : "border border-gh-border rounded-lg")}`)}><div class="p-4 border-b border-gh-border bg-gh-bg flex flex-wrap justify-between items-start gap-2">`);
|
|
1016
1197
|
if (backUrl) {
|
|
1017
1198
|
$$renderer2.push("<!--[-->");
|
|
@@ -1067,20 +1248,15 @@ function SessionViewer($$renderer, $$props) {
|
|
|
1067
1248
|
$$renderer2.push(`<div class="flex items-center justify-center h-full text-gh-text-secondary">No messages</div>`);
|
|
1068
1249
|
} else {
|
|
1069
1250
|
$$renderer2.push("<!--[!-->");
|
|
1070
|
-
$$renderer2
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
onSplit: onSplitSession,
|
|
1080
|
-
isFirst: i === firstMeaningfulIndex
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
$$renderer2.push(`<!--]--></div>`);
|
|
1251
|
+
MessageList($$renderer2, {
|
|
1252
|
+
sessionId: session.id,
|
|
1253
|
+
messages,
|
|
1254
|
+
onDeleteMessage: handleSessionMessageDelete,
|
|
1255
|
+
onEditTitle,
|
|
1256
|
+
onSplitSession,
|
|
1257
|
+
enableScroll: false,
|
|
1258
|
+
fullWidth: true
|
|
1259
|
+
});
|
|
1084
1260
|
}
|
|
1085
1261
|
$$renderer2.push(`<!--]-->`);
|
|
1086
1262
|
}
|
|
@@ -1110,6 +1286,8 @@ function _page($$renderer, $$props) {
|
|
|
1110
1286
|
let loadingProject = null;
|
|
1111
1287
|
let error = null;
|
|
1112
1288
|
let toast = null;
|
|
1289
|
+
let sortField = "summary";
|
|
1290
|
+
let sortOrder = "desc";
|
|
1113
1291
|
let confirmModal = {
|
|
1114
1292
|
show: false,
|
|
1115
1293
|
title: "",
|
|
@@ -1199,18 +1377,19 @@ function _page($$renderer, $$props) {
|
|
|
1199
1377
|
if (!selectedSession) return;
|
|
1200
1378
|
const msgId = msg.uuid || msg.messageId || msg.leafUuid;
|
|
1201
1379
|
if (!msgId) return;
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
} catch (e) {
|
|
1212
|
-
error = String(e);
|
|
1380
|
+
const targetType = msg.type === "file-history-snapshot" ? "file-history-snapshot" : msg.type === "summary" ? "summary" : void 0;
|
|
1381
|
+
const copy = [...messages];
|
|
1382
|
+
deleteMessageWithChainRepair(copy, msgId, targetType);
|
|
1383
|
+
messages = copy;
|
|
1384
|
+
const sessions = projectSessions.get(selectedSession.projectName);
|
|
1385
|
+
const session = sessions?.find((s) => s.id === selectedSession.id);
|
|
1386
|
+
if (session) {
|
|
1387
|
+
session.messageCount = messages.length;
|
|
1388
|
+
projectSessions = new Map(projectSessions);
|
|
1213
1389
|
}
|
|
1390
|
+
deleteMessage(selectedSession.projectName, selectedSession.id, msgId, targetType).catch((e) => {
|
|
1391
|
+
error = String(e);
|
|
1392
|
+
});
|
|
1214
1393
|
};
|
|
1215
1394
|
const handleEditCustomTitle = (msg) => {
|
|
1216
1395
|
if (!selectedSession) return;
|
|
@@ -1291,6 +1470,36 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
|
|
|
1291
1470
|
error = String(e2);
|
|
1292
1471
|
}
|
|
1293
1472
|
};
|
|
1473
|
+
const handleSortChange = async (field, order) => {
|
|
1474
|
+
sortField = field;
|
|
1475
|
+
sortOrder = order;
|
|
1476
|
+
for (const projectName of expandedProjects) {
|
|
1477
|
+
loadingProject = projectName;
|
|
1478
|
+
try {
|
|
1479
|
+
const sessionDataList = await expandProject(projectName, { field, order });
|
|
1480
|
+
const sessions = [];
|
|
1481
|
+
const dataMap = /* @__PURE__ */ new Map();
|
|
1482
|
+
for (const data of sessionDataList) {
|
|
1483
|
+
sessions.push({
|
|
1484
|
+
id: data.id,
|
|
1485
|
+
projectName,
|
|
1486
|
+
title: data.title,
|
|
1487
|
+
messageCount: data.messageCount,
|
|
1488
|
+
createdAt: data.createdAt,
|
|
1489
|
+
updatedAt: data.updatedAt
|
|
1490
|
+
});
|
|
1491
|
+
dataMap.set(data.id, data);
|
|
1492
|
+
}
|
|
1493
|
+
projectSessions.set(projectName, sessions);
|
|
1494
|
+
projectSessionData.set(projectName, dataMap);
|
|
1495
|
+
} catch (e) {
|
|
1496
|
+
error = String(e);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
projectSessions = new Map(projectSessions);
|
|
1500
|
+
projectSessionData = new Map(projectSessionData);
|
|
1501
|
+
loadingProject = null;
|
|
1502
|
+
};
|
|
1294
1503
|
let $$settled = true;
|
|
1295
1504
|
let $$inner_renderer;
|
|
1296
1505
|
function $$render_inner($$renderer3) {
|
|
@@ -1302,9 +1511,12 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
|
|
|
1302
1511
|
expandedProjects,
|
|
1303
1512
|
selectedSession,
|
|
1304
1513
|
loadingProject,
|
|
1514
|
+
sortField,
|
|
1515
|
+
sortOrder,
|
|
1305
1516
|
onRenameSession: handleRenameSession,
|
|
1306
1517
|
onDeleteSession: handleDeleteSession,
|
|
1307
|
-
onResumeSession: handleResumeSession
|
|
1518
|
+
onResumeSession: handleResumeSession,
|
|
1519
|
+
onSortChange: handleSortChange
|
|
1308
1520
|
});
|
|
1309
1521
|
$$renderer3.push(`<!----> `);
|
|
1310
1522
|
SessionViewer($$renderer3, {
|
|
@@ -1373,4 +1585,4 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
|
|
|
1373
1585
|
}
|
|
1374
1586
|
|
|
1375
1587
|
export { _page as default };
|
|
1376
|
-
//# sourceMappingURL=_page.svelte-
|
|
1588
|
+
//# sourceMappingURL=_page.svelte-DWKQDFXZ.js.map
|