@claude-sessions/web 0.4.0 → 0.4.2-beta.1
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/chunks/{pIpqdOQZ.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/BRMlZq2r.js +1 -0
- package/build/client/_app/immutable/chunks/BRMlZq2r.js.br +0 -0
- package/build/client/_app/immutable/chunks/BRMlZq2r.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/{D36ll3tU.js → Cr0eW1j3.js} +1 -1
- 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/chunks/{Ct7gnOMS.js → wR6tcHqD.js} +1 -1
- package/build/client/_app/immutable/chunks/wR6tcHqD.js.br +0 -0
- package/build/client/_app/immutable/chunks/wR6tcHqD.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.B8IwrV9r.js → app.BIf927Xy.js} +2 -2
- package/build/client/_app/immutable/entry/app.BIf927Xy.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BIf927Xy.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.ChLZh9N7.js +1 -0
- package/build/client/_app/immutable/entry/start.ChLZh9N7.js.br +2 -0
- package/build/client/_app/immutable/entry/start.ChLZh9N7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.DErsC77t.js → 0.DKYfg-8s.js} +1 -1
- package/build/client/_app/immutable/nodes/0.DKYfg-8s.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DKYfg-8s.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.CttaK5cr.js → 1.zZICpoUK.js} +1 -1
- package/build/client/_app/immutable/nodes/1.zZICpoUK.js.br +2 -0
- package/build/client/_app/immutable/nodes/1.zZICpoUK.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.Drt04u7Q.js +4 -0
- package/build/client/_app/immutable/nodes/3.Drt04u7Q.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Drt04u7Q.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-Bpz08Uhs.js +17 -0
- package/build/server/chunks/{0-BVOw-QLW.js.map → 0-Bpz08Uhs.js.map} +1 -1
- package/build/server/chunks/1-BjgZlhLm.js +9 -0
- package/build/server/chunks/{1-DcWoDxkF.js.map → 1-BjgZlhLm.js.map} +1 -1
- package/build/server/chunks/2-Bvyspg6i.js +9 -0
- package/build/server/chunks/{2-CeDc2VGX.js.map → 2-Bvyspg6i.js.map} +1 -1
- package/build/server/chunks/3-BpYq9koE.js +9 -0
- package/build/server/chunks/{3-CnCgC9Lk.js.map → 3-BpYq9koE.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-D4IwVuee.js → Toast-Dr8M-5Wk.js} +4 -4
- package/build/server/chunks/Toast-Dr8M-5Wk.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-D8RsKs1I.js → _layout.svelte-CkIsNl4s.js} +6 -6
- package/build/server/chunks/_layout.svelte-CkIsNl4s.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CnzAaQ3o.js → _page.svelte-BdKbLK1W.js} +7 -7
- package/build/server/chunks/_page.svelte-BdKbLK1W.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DLMeV_uH.js → _page.svelte-DWKQDFXZ.js} +358 -221
- package/build/server/chunks/_page.svelte-DWKQDFXZ.js.map +1 -0
- package/build/server/chunks/{_server.ts-3KinOGG2.js → _server.ts-8OBR5eCA.js} +2 -2
- package/build/server/chunks/{_server.ts-3KinOGG2.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-BUP1oLdG.js → _server.ts-B4SnxrOX.js} +2 -2
- package/build/server/chunks/{_server.ts-BUP1oLdG.js.map → _server.ts-B4SnxrOX.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CijK2VGG.js → _server.ts-B9gP-Tri.js} +6 -3
- package/build/server/chunks/_server.ts-B9gP-Tri.js.map +1 -0
- package/build/server/chunks/{_server.ts-Qm-5UM6l.js → _server.ts-BQxGBeCg.js} +2 -2
- package/build/server/chunks/{_server.ts-Qm-5UM6l.js.map → _server.ts-BQxGBeCg.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CFN6ekMg.js → _server.ts-Bcdjougg.js} +2 -2
- package/build/server/chunks/{_server.ts-CFN6ekMg.js.map → _server.ts-Bcdjougg.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DrDTz9tO.js → _server.ts-BeWDhgJ_.js} +2 -2
- package/build/server/chunks/{_server.ts-DrDTz9tO.js.map → _server.ts-BeWDhgJ_.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DS4LtLJR.js → _server.ts-CEGd9zNn.js} +2 -2
- package/build/server/chunks/{_server.ts-DS4LtLJR.js.map → _server.ts-CEGd9zNn.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Chx6z8Ha.js → _server.ts-CMsFINkl.js} +2 -2
- package/build/server/chunks/{_server.ts-Chx6z8Ha.js.map → _server.ts-CMsFINkl.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Csnu3HvS.js → _server.ts-CUginV8c.js} +2 -2
- package/build/server/chunks/{_server.ts-Csnu3HvS.js.map → _server.ts-CUginV8c.js.map} +1 -1
- package/build/server/chunks/{_server.ts-WMEN7B0K.js → _server.ts-Crip_Csr.js} +2 -2
- package/build/server/chunks/{_server.ts-WMEN7B0K.js.map → _server.ts-Crip_Csr.js.map} +1 -1
- package/build/server/chunks/{_server.ts-C_J07ZgO.js → _server.ts-CuAlKvWH.js} +2 -2
- package/build/server/chunks/{_server.ts-C_J07ZgO.js.map → _server.ts-CuAlKvWH.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BI9MivzV.js → _server.ts-DfNIRtb5.js} +2 -2
- package/build/server/chunks/{_server.ts-BI9MivzV.js.map → _server.ts-DfNIRtb5.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BDll_uG4.js → _server.ts-DnfpkUoI.js} +2 -2
- package/build/server/chunks/{_server.ts-BDll_uG4.js.map → _server.ts-DnfpkUoI.js.map} +1 -1
- package/build/server/chunks/{_server.ts-B0L-omzE.js → _server.ts-dXxEqPlK.js} +2 -2
- package/build/server/chunks/{_server.ts-B0L-omzE.js.map → _server.ts-dXxEqPlK.js.map} +1 -1
- package/build/server/chunks/_server.ts-sXXQUi2v.js +26 -0
- package/build/server/chunks/_server.ts-sXXQUi2v.js.map +1 -0
- 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-BOWsMtX4.js → index3-D8wHvUHX.js} +481 -379
- 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 +18 -18
- package/build/client/_app/immutable/assets/0.CdaICEam.css +0 -1
- package/build/client/_app/immutable/assets/0.CdaICEam.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CdaICEam.css.gz +0 -0
- package/build/client/_app/immutable/chunks/6qMZRyTA.js +0 -90
- package/build/client/_app/immutable/chunks/6qMZRyTA.js.br +0 -0
- package/build/client/_app/immutable/chunks/6qMZRyTA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BezDCpdL.js +0 -1
- package/build/client/_app/immutable/chunks/BezDCpdL.js.br +0 -0
- package/build/client/_app/immutable/chunks/BezDCpdL.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ct7gnOMS.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ct7gnOMS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D36ll3tU.js.br +0 -0
- package/build/client/_app/immutable/chunks/D36ll3tU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DSHOiHEu.js +0 -1
- package/build/client/_app/immutable/chunks/DSHOiHEu.js.br +0 -0
- package/build/client/_app/immutable/chunks/DSHOiHEu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DW1ZKM0I.js +0 -2
- package/build/client/_app/immutable/chunks/DW1ZKM0I.js.br +0 -0
- package/build/client/_app/immutable/chunks/DW1ZKM0I.js.gz +0 -0
- package/build/client/_app/immutable/chunks/pIpqdOQZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/pIpqdOQZ.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.B8IwrV9r.js.br +0 -0
- package/build/client/_app/immutable/entry/app.B8IwrV9r.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BWG5JAGE.js +0 -1
- package/build/client/_app/immutable/entry/start.BWG5JAGE.js.br +0 -2
- package/build/client/_app/immutable/entry/start.BWG5JAGE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.DErsC77t.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DErsC77t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CttaK5cr.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CttaK5cr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BoE8-2iz.js +0 -4
- package/build/client/_app/immutable/nodes/2.BoE8-2iz.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BoE8-2iz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CNK57PCS.js +0 -4
- package/build/client/_app/immutable/nodes/3.CNK57PCS.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CNK57PCS.js.gz +0 -0
- package/build/server/chunks/0-BVOw-QLW.js +0 -17
- package/build/server/chunks/1-DcWoDxkF.js +0 -9
- package/build/server/chunks/2-CeDc2VGX.js +0 -9
- package/build/server/chunks/3-CnCgC9Lk.js +0 -9
- package/build/server/chunks/InputModal-XaplAR5y.js.map +0 -1
- package/build/server/chunks/Toast-D4IwVuee.js.map +0 -1
- package/build/server/chunks/_layout.svelte-D8RsKs1I.js.map +0 -1
- package/build/server/chunks/_page.svelte-CnzAaQ3o.js.map +0 -1
- package/build/server/chunks/_page.svelte-DLMeV_uH.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-CijK2VGG.js.map +0 -1
- package/build/server/chunks/_server.ts-u9CxsloP.js +0 -20
- package/build/server/chunks/_server.ts-u9CxsloP.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-BOWsMtX4.js.map +0 -1
- package/build/server/chunks/index4-BUZEWk-I.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
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';
|
|
@@ -134,8 +134,8 @@ const deleteSession = (project, id) => del(
|
|
|
134
134
|
`/session?project=${encodeURIComponent(project)}&id=${encodeURIComponent(id)}`
|
|
135
135
|
);
|
|
136
136
|
const renameSession = (project, id, title) => post("/session/rename", { project, id, title });
|
|
137
|
-
const deleteMessage = (project, session, uuid) => del(
|
|
138
|
-
`/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}` : ""}`
|
|
139
139
|
);
|
|
140
140
|
const updateCustomTitle = (project, session, uuid, customTitle) => patch(
|
|
141
141
|
`/message?project=${encodeURIComponent(project)}&session=${encodeURIComponent(session)}&uuid=${encodeURIComponent(uuid)}`,
|
|
@@ -189,6 +189,41 @@ const getMessageContent = (msg) => {
|
|
|
189
189
|
}
|
|
190
190
|
return maskHomePaths(content);
|
|
191
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
|
+
};
|
|
192
227
|
const parseIdeTags = (content) => {
|
|
193
228
|
const segments = [];
|
|
194
229
|
const regex = /<(ide_[^>]+)>([\s\S]*?)<\/\1>/g;
|
|
@@ -429,12 +464,23 @@ function MessageItem($$renderer, $$props) {
|
|
|
429
464
|
};
|
|
430
465
|
})();
|
|
431
466
|
const commandData = (() => {
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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;
|
|
437
479
|
})();
|
|
480
|
+
const isSlashCommand = commandData !== null && !isLocalCommand;
|
|
481
|
+
const stopHookData = parseStopHookSummary(msg);
|
|
482
|
+
const turnDurationData = parseTurnDuration(msg);
|
|
483
|
+
const progressData = parseProgress(msg);
|
|
438
484
|
const FILE_TOOLS = ["Read", "Write", "Edit"];
|
|
439
485
|
const toolUseData = (() => {
|
|
440
486
|
if (!isAssistant) return null;
|
|
@@ -507,204 +553,274 @@ function MessageItem($$renderer, $$props) {
|
|
|
507
553
|
$$renderer2.push("<!--[-->");
|
|
508
554
|
} else {
|
|
509
555
|
$$renderer2.push("<!--[!-->");
|
|
510
|
-
if (
|
|
556
|
+
if (progressData) {
|
|
511
557
|
$$renderer2.push("<!--[-->");
|
|
512
|
-
$$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">`);
|
|
513
559
|
splitButton($$renderer2);
|
|
514
560
|
$$renderer2.push(`<!----> `);
|
|
515
561
|
deleteButton($$renderer2);
|
|
516
|
-
$$renderer2.push(`<!----></div></div
|
|
517
|
-
const each_array = ensure_array_like(snapshotData.files);
|
|
518
|
-
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
519
|
-
let [filePath, info] = each_array[$$index];
|
|
520
|
-
const hasBackup = !!(info.backupFileName && sessionId);
|
|
521
|
-
$$renderer2.push(`<li class="font-mono text-xs truncate"${attr("title", maskHomePaths(filePath))}>`);
|
|
522
|
-
if (hasBackup) {
|
|
523
|
-
$$renderer2.push("<!--[-->");
|
|
524
|
-
$$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>`);
|
|
525
|
-
} else {
|
|
526
|
-
$$renderer2.push("<!--[!-->");
|
|
527
|
-
$$renderer2.push(`<span class="text-gh-text-secondary">${escape_html(maskHomePaths(filePath))}</span>`);
|
|
528
|
-
}
|
|
529
|
-
$$renderer2.push(`<!--]--></li>`);
|
|
530
|
-
}
|
|
531
|
-
$$renderer2.push(`<!--]--></ul></div>`);
|
|
562
|
+
$$renderer2.push(`<!----></div></div></div>`);
|
|
532
563
|
} else {
|
|
533
564
|
$$renderer2.push("<!--[!-->");
|
|
534
|
-
if (
|
|
565
|
+
if (turnDurationData) {
|
|
535
566
|
$$renderer2.push("<!--[-->");
|
|
536
|
-
$$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">`);
|
|
537
568
|
splitButton($$renderer2);
|
|
538
569
|
$$renderer2.push(`<!----> `);
|
|
539
570
|
deleteButton($$renderer2);
|
|
540
|
-
$$renderer2.push(`<!----></div></div
|
|
541
|
-
if (commandData.message && commandData.message !== commandData.name?.slice(1)) {
|
|
542
|
-
$$renderer2.push("<!--[-->");
|
|
543
|
-
$$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(commandData.message)}</p>`);
|
|
544
|
-
} else {
|
|
545
|
-
$$renderer2.push("<!--[!-->");
|
|
546
|
-
}
|
|
547
|
-
$$renderer2.push(`<!--]--></div>`);
|
|
571
|
+
$$renderer2.push(`<!----></div></div></div>`);
|
|
548
572
|
} else {
|
|
549
573
|
$$renderer2.push("<!--[!-->");
|
|
550
|
-
if (
|
|
574
|
+
if (stopHookData) {
|
|
551
575
|
$$renderer2.push("<!--[-->");
|
|
552
|
-
$$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> `);
|
|
553
577
|
splitButton($$renderer2);
|
|
554
578
|
$$renderer2.push(`<!----> `);
|
|
555
579
|
deleteButton($$renderer2);
|
|
556
580
|
$$renderer2.push(`<!----></div></div> `);
|
|
557
|
-
if (
|
|
581
|
+
if (stopHookData.hookInfos.length > 0) {
|
|
558
582
|
$$renderer2.push("<!--[-->");
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
if (exists) {
|
|
567
|
-
$$renderer2.push("<!--[-->");
|
|
568
|
-
$$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>`);
|
|
569
|
-
} else {
|
|
570
|
-
$$renderer2.push("<!--[!-->");
|
|
571
|
-
$$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>`);
|
|
572
|
-
}
|
|
573
|
-
$$renderer2.push(`<!--]-->`);
|
|
574
|
-
}
|
|
575
|
-
);
|
|
576
|
-
$$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>`);
|
|
577
590
|
} else {
|
|
578
591
|
$$renderer2.push("<!--[!-->");
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
$$renderer2.push(
|
|
588
|
-
ExpandableContent($$renderer2, {
|
|
589
|
-
content: String(toolUseData.input.command),
|
|
590
|
-
lang: "sh",
|
|
591
|
-
maxLines: 3
|
|
592
|
-
});
|
|
593
|
-
$$renderer2.push(`<!---->`);
|
|
594
|
-
} else {
|
|
595
|
-
$$renderer2.push("<!--[!-->");
|
|
596
|
-
const { path: _path, ...input } = toolUseData.input;
|
|
597
|
-
const keys = Object.keys(input);
|
|
598
|
-
if (keys.length === 1) {
|
|
599
|
-
$$renderer2.push("<!--[-->");
|
|
600
|
-
const key = keys[0];
|
|
601
|
-
const value = input[key];
|
|
602
|
-
$$renderer2.push(`${escape_html((() => {
|
|
603
|
-
console.info(`${key} =`, value);
|
|
604
|
-
return "";
|
|
605
|
-
})())} `);
|
|
606
|
-
if (key === "todos" && Array.isArray(value)) {
|
|
607
|
-
$$renderer2.push("<!--[-->");
|
|
608
|
-
TodoItem($$renderer2, { todos: value });
|
|
609
|
-
} else {
|
|
610
|
-
$$renderer2.push("<!--[!-->");
|
|
611
|
-
ExpandableContent($$renderer2, {
|
|
612
|
-
content: `${key} = ${JSON.stringify(value, null, 2)}`,
|
|
613
|
-
lang: "js",
|
|
614
|
-
maxLines: 1
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
$$renderer2.push(`<!--]-->`);
|
|
618
|
-
} else {
|
|
619
|
-
$$renderer2.push("<!--[!-->");
|
|
620
|
-
ExpandableContent($$renderer2, {
|
|
621
|
-
content: JSON.stringify(input, null, 2),
|
|
622
|
-
lang: "json",
|
|
623
|
-
maxLines: 6
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
$$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>`);
|
|
627
601
|
}
|
|
628
|
-
$$renderer2.push(`<!--]
|
|
602
|
+
$$renderer2.push(`<!--]--></div>`);
|
|
603
|
+
} else {
|
|
604
|
+
$$renderer2.push("<!--[!-->");
|
|
629
605
|
}
|
|
630
606
|
$$renderer2.push(`<!--]--></div>`);
|
|
631
607
|
} else {
|
|
632
608
|
$$renderer2.push("<!--[!-->");
|
|
633
|
-
if (
|
|
609
|
+
if (isFileSnapshot && snapshotData) {
|
|
634
610
|
$$renderer2.push("<!--[-->");
|
|
635
|
-
$$renderer2.push(`<div${attr("data-msg-id", msgId)}
|
|
636
|
-
if (isCustomTitle && onEditTitle) {
|
|
637
|
-
$$renderer2.push("<!--[-->");
|
|
638
|
-
TooltipButton($$renderer2, {
|
|
639
|
-
class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-border text-xs",
|
|
640
|
-
onclick: () => onEditTitle(msg),
|
|
641
|
-
title: "Edit title",
|
|
642
|
-
children: ($$renderer3) => {
|
|
643
|
-
$$renderer3.push(`<!---->✏️`);
|
|
644
|
-
},
|
|
645
|
-
$$slots: { default: true }
|
|
646
|
-
});
|
|
647
|
-
} else {
|
|
648
|
-
$$renderer2.push("<!--[!-->");
|
|
649
|
-
}
|
|
650
|
-
$$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> `);
|
|
651
612
|
splitButton($$renderer2);
|
|
652
613
|
$$renderer2.push(`<!----> `);
|
|
653
614
|
deleteButton($$renderer2);
|
|
654
|
-
$$renderer2.push(`<!----></div></div>
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
$$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>`);
|
|
662
627
|
}
|
|
663
|
-
$$renderer2.push(`<!--]--></
|
|
664
|
-
} else {
|
|
665
|
-
$$renderer2.push("<!--[!-->");
|
|
628
|
+
$$renderer2.push(`<!--]--></li>`);
|
|
666
629
|
}
|
|
667
|
-
$$renderer2.push(`<!--]
|
|
668
|
-
|
|
630
|
+
$$renderer2.push(`<!--]--></ul></div>`);
|
|
631
|
+
} else {
|
|
632
|
+
$$renderer2.push("<!--[!-->");
|
|
633
|
+
if (isSlashCommand && commandData) {
|
|
669
634
|
$$renderer2.push("<!--[-->");
|
|
670
|
-
$$renderer2.push(`<div class="
|
|
671
|
-
|
|
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) {
|
|
672
643
|
$$renderer2.push("<!--[-->");
|
|
673
|
-
$$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>`);
|
|
674
656
|
} else {
|
|
675
657
|
$$renderer2.push("<!--[!-->");
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
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) {
|
|
683
666
|
$$renderer2.push("<!--[-->");
|
|
684
|
-
|
|
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(`<!--]-->`);
|
|
685
685
|
} else {
|
|
686
686
|
$$renderer2.push("<!--[!-->");
|
|
687
|
-
|
|
688
|
-
if (textLines.length > 10) {
|
|
687
|
+
if (toolUseData.input.command) {
|
|
689
688
|
$$renderer2.push("<!--[-->");
|
|
690
|
-
|
|
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(`<!---->`);
|
|
691
702
|
} else {
|
|
692
703
|
$$renderer2.push("<!--[!-->");
|
|
693
|
-
|
|
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(`<!--]-->`);
|
|
694
735
|
}
|
|
695
736
|
$$renderer2.push(`<!--]-->`);
|
|
696
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
|
+
}
|
|
697
817
|
$$renderer2.push(`<!--]-->`);
|
|
698
818
|
}
|
|
699
819
|
$$renderer2.push(`<!--]-->`);
|
|
700
820
|
}
|
|
701
|
-
$$renderer2.push(`<!--]
|
|
702
|
-
} else {
|
|
703
|
-
$$renderer2.push("<!--[!-->");
|
|
821
|
+
$$renderer2.push(`<!--]-->`);
|
|
704
822
|
}
|
|
705
|
-
$$renderer2.push(`<!--]
|
|
706
|
-
} else {
|
|
707
|
-
$$renderer2.push("<!--[!-->");
|
|
823
|
+
$$renderer2.push(`<!--]-->`);
|
|
708
824
|
}
|
|
709
825
|
$$renderer2.push(`<!--]-->`);
|
|
710
826
|
}
|
|
@@ -717,6 +833,34 @@ function MessageItem($$renderer, $$props) {
|
|
|
717
833
|
$$renderer2.push(`<!--]-->`);
|
|
718
834
|
});
|
|
719
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
|
+
}
|
|
720
864
|
function ProjectTree($$renderer, $$props) {
|
|
721
865
|
$$renderer.component(($$renderer2) => {
|
|
722
866
|
var $$store_subs;
|
|
@@ -749,15 +893,9 @@ function ProjectTree($$renderer, $$props) {
|
|
|
749
893
|
const getSessionData = (projectName, sessionId) => {
|
|
750
894
|
return projectSessionData.get(projectName)?.get(sessionId);
|
|
751
895
|
};
|
|
752
|
-
const
|
|
896
|
+
const getDisplayTitle$1 = (session) => {
|
|
753
897
|
const data = getSessionData(session.projectName, session.id);
|
|
754
|
-
|
|
755
|
-
if (data?.currentSummary) {
|
|
756
|
-
const summary = data.currentSummary;
|
|
757
|
-
return summary.length > 60 ? summary.slice(0, 57) + "..." : summary;
|
|
758
|
-
}
|
|
759
|
-
if (session.title && session.title !== "Untitled") return session.title;
|
|
760
|
-
return "Untitled";
|
|
898
|
+
return getDisplayTitle(data?.customTitle, data?.currentSummary, session.title);
|
|
761
899
|
};
|
|
762
900
|
const getTooltipText = (session) => {
|
|
763
901
|
const data = getSessionData(session.projectName, session.id);
|
|
@@ -828,7 +966,7 @@ function ProjectTree($$renderer, $$props) {
|
|
|
828
966
|
const isSelected = selectedSession?.id === session.id;
|
|
829
967
|
const isDragging = draggedSession?.id === session.id;
|
|
830
968
|
const sessionInfo = getSessionInfo(session);
|
|
831
|
-
const displayTitle =
|
|
969
|
+
const displayTitle = getDisplayTitle$1(session);
|
|
832
970
|
const tooltipText = getTooltipText(session);
|
|
833
971
|
const data = getSessionData(session.projectName, session.id);
|
|
834
972
|
const isSummaryFallback = !data?.customTitle && !data?.currentSummary;
|
|
@@ -1012,46 +1150,49 @@ function SessionViewer($$renderer, $$props) {
|
|
|
1012
1150
|
let undoStack = [];
|
|
1013
1151
|
let undoCountdown = 0;
|
|
1014
1152
|
let undoTimeoutId = null;
|
|
1153
|
+
let deleteQueue = Promise.resolve();
|
|
1015
1154
|
const handleMessageDeleteWithUndo = async (msg, isAgent) => {
|
|
1016
1155
|
if (!session) return;
|
|
1017
1156
|
const msgId = msg.uuid || msg.messageId || msg.leafUuid;
|
|
1018
1157
|
if (!msgId) return;
|
|
1158
|
+
const targetType = msg.type === "file-history-snapshot" ? "file-history-snapshot" : msg.type === "summary" ? "summary" : void 0;
|
|
1019
1159
|
const targetSessionId = session.id;
|
|
1020
1160
|
let index;
|
|
1021
1161
|
{
|
|
1022
1162
|
index = messages.findIndex((m) => (m.uuid || m.messageId || m.leafUuid) === msgId);
|
|
1023
1163
|
if (index === -1) return;
|
|
1024
1164
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
const newMessages = messages.filter((m) => (m.uuid || m.messageId || m.leafUuid) !== msgId);
|
|
1030
|
-
onMessagesChange?.(newMessages);
|
|
1031
|
-
}
|
|
1032
|
-
undoStack = [
|
|
1033
|
-
...undoStack,
|
|
1034
|
-
{ msg, index, isAgent, sessionId: targetSessionId }
|
|
1035
|
-
];
|
|
1036
|
-
if (undoTimeoutId) clearTimeout(undoTimeoutId);
|
|
1037
|
-
undoCountdown = 10;
|
|
1038
|
-
undoTimeoutId = setTimeout(
|
|
1039
|
-
() => {
|
|
1040
|
-
undoStack = [];
|
|
1041
|
-
undoCountdown = 0;
|
|
1042
|
-
undoTimeoutId = null;
|
|
1043
|
-
},
|
|
1044
|
-
1e4
|
|
1045
|
-
);
|
|
1046
|
-
onDeleteMessage?.(msg);
|
|
1047
|
-
} catch (e) {
|
|
1048
|
-
console.error("Failed to delete message:", e);
|
|
1165
|
+
{
|
|
1166
|
+
const copy = [...messages];
|
|
1167
|
+
deleteMessageWithChainRepair(copy, msgId, targetType);
|
|
1168
|
+
onMessagesChange?.(copy);
|
|
1049
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);
|
|
1050
1192
|
};
|
|
1051
1193
|
const handleSessionMessageDelete = (msg) => {
|
|
1052
1194
|
handleMessageDeleteWithUndo(msg, false);
|
|
1053
1195
|
};
|
|
1054
|
-
const firstMeaningfulIndex = messages.findIndex((m) => m.type === "user" || m.type === "assistant" || m.type === "human");
|
|
1055
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">`);
|
|
1056
1197
|
if (backUrl) {
|
|
1057
1198
|
$$renderer2.push("<!--[-->");
|
|
@@ -1107,20 +1248,15 @@ function SessionViewer($$renderer, $$props) {
|
|
|
1107
1248
|
$$renderer2.push(`<div class="flex items-center justify-center h-full text-gh-text-secondary">No messages</div>`);
|
|
1108
1249
|
} else {
|
|
1109
1250
|
$$renderer2.push("<!--[!-->");
|
|
1110
|
-
$$renderer2
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
onSplit: onSplitSession,
|
|
1120
|
-
isFirst: i === firstMeaningfulIndex
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
$$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
|
+
});
|
|
1124
1260
|
}
|
|
1125
1261
|
$$renderer2.push(`<!--]-->`);
|
|
1126
1262
|
}
|
|
@@ -1241,18 +1377,19 @@ function _page($$renderer, $$props) {
|
|
|
1241
1377
|
if (!selectedSession) return;
|
|
1242
1378
|
const msgId = msg.uuid || msg.messageId || msg.leafUuid;
|
|
1243
1379
|
if (!msgId) return;
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
} catch (e) {
|
|
1254
|
-
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);
|
|
1255
1389
|
}
|
|
1390
|
+
deleteMessage(selectedSession.projectName, selectedSession.id, msgId, targetType).catch((e) => {
|
|
1391
|
+
error = String(e);
|
|
1392
|
+
});
|
|
1256
1393
|
};
|
|
1257
1394
|
const handleEditCustomTitle = (msg) => {
|
|
1258
1395
|
if (!selectedSession) return;
|
|
@@ -1448,4 +1585,4 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
|
|
|
1448
1585
|
}
|
|
1449
1586
|
|
|
1450
1587
|
export { _page as default };
|
|
1451
|
-
//# sourceMappingURL=_page.svelte-
|
|
1588
|
+
//# sourceMappingURL=_page.svelte-DWKQDFXZ.js.map
|