@claude-sessions/web 0.4.6-beta.2 → 0.4.7-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.
Files changed (187) hide show
  1. package/build/client/_app/immutable/assets/0.cQgYior5.css +1 -0
  2. package/build/client/_app/immutable/assets/0.cQgYior5.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.cQgYior5.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/Toast.BpcxWUYz.css.gz +0 -0
  5. package/build/client/_app/immutable/chunks/B8g5xi4b.js +1 -0
  6. package/build/client/_app/immutable/chunks/B8g5xi4b.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/B8g5xi4b.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/CBiqUHp4.js +1 -0
  9. package/build/client/_app/immutable/chunks/CBiqUHp4.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/CBiqUHp4.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/CG99hqDQ.js +2 -0
  12. package/build/client/_app/immutable/chunks/CG99hqDQ.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/CG99hqDQ.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/CYKpEMl5.js +1 -0
  15. package/build/client/_app/immutable/chunks/CYKpEMl5.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/CYKpEMl5.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/DWa7QuMS.js +1 -0
  18. package/build/client/_app/immutable/chunks/DWa7QuMS.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/DWa7QuMS.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/DicbBas7.js +1 -0
  21. package/build/client/_app/immutable/chunks/DicbBas7.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/DicbBas7.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/Dw50LpzA.js +1 -0
  24. package/build/client/_app/immutable/chunks/Dw50LpzA.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/Dw50LpzA.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/GmjPUgZ0.js +100 -0
  27. package/build/client/_app/immutable/chunks/GmjPUgZ0.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/GmjPUgZ0.js.gz +0 -0
  29. package/build/client/_app/immutable/entry/app.CMV94ayS.js +2 -0
  30. package/build/client/_app/immutable/entry/app.CMV94ayS.js.br +0 -0
  31. package/build/client/_app/immutable/entry/app.CMV94ayS.js.gz +0 -0
  32. package/build/client/_app/immutable/entry/start.CgzpSnrE.js +1 -0
  33. package/build/client/_app/immutable/entry/start.CgzpSnrE.js.br +0 -0
  34. package/build/client/_app/immutable/entry/start.CgzpSnrE.js.gz +0 -0
  35. package/build/client/_app/immutable/nodes/0.DVHVg7U5.js +1 -0
  36. package/build/client/_app/immutable/nodes/0.DVHVg7U5.js.br +0 -0
  37. package/build/client/_app/immutable/nodes/0.DVHVg7U5.js.gz +0 -0
  38. package/build/client/_app/immutable/nodes/1.D0PdYLPm.js +1 -0
  39. package/build/client/_app/immutable/nodes/1.D0PdYLPm.js.br +0 -0
  40. package/build/client/_app/immutable/nodes/1.D0PdYLPm.js.gz +0 -0
  41. package/build/client/_app/immutable/nodes/2.Cs83Zp7C.js +4 -0
  42. package/build/client/_app/immutable/nodes/2.Cs83Zp7C.js.br +0 -0
  43. package/build/client/_app/immutable/nodes/2.Cs83Zp7C.js.gz +0 -0
  44. package/build/client/_app/immutable/nodes/3.BMgB8JW6.js +4 -0
  45. package/build/client/_app/immutable/nodes/3.BMgB8JW6.js.br +0 -0
  46. package/build/client/_app/immutable/nodes/3.BMgB8JW6.js.gz +0 -0
  47. package/build/client/_app/version.json +1 -1
  48. package/build/client/_app/version.json.br +0 -0
  49. package/build/client/_app/version.json.gz +0 -0
  50. package/build/handler.js +290 -228
  51. package/build/server/chunks/0-CEq226Yu.js +17 -0
  52. package/build/server/chunks/0-CEq226Yu.js.map +1 -0
  53. package/build/server/chunks/1-CZKii7cF.js +9 -0
  54. package/build/server/chunks/1-CZKii7cF.js.map +1 -0
  55. package/build/server/chunks/2-1NHU8T7t.js +9 -0
  56. package/build/server/chunks/2-1NHU8T7t.js.map +1 -0
  57. package/build/server/chunks/3-DHru04k0.js +9 -0
  58. package/build/server/chunks/3-DHru04k0.js.map +1 -0
  59. package/build/server/chunks/{InputModal-Bo_3Ym8j.js → InputModal-B2QW71Rc.js} +6 -7
  60. package/build/server/chunks/InputModal-B2QW71Rc.js.map +1 -0
  61. package/build/server/chunks/{Toast-Bd3XGXXC.js → Toast-BzqOqKOg.js} +7 -8
  62. package/build/server/chunks/Toast-BzqOqKOg.js.map +1 -0
  63. package/build/server/chunks/{_layout.svelte-BvleGV6e.js → _layout.svelte-CkLZkYhs.js} +25 -29
  64. package/build/server/chunks/_layout.svelte-CkLZkYhs.js.map +1 -0
  65. package/build/server/chunks/{_page.svelte-C1-T5LLg.js → _page.svelte-DSpIiljH.js} +459 -499
  66. package/build/server/chunks/_page.svelte-DSpIiljH.js.map +1 -0
  67. package/build/server/chunks/{_page.svelte-CWnsm7d3.js → _page.svelte-DuQWccy1.js} +10 -13
  68. package/build/server/chunks/_page.svelte-DuQWccy1.js.map +1 -0
  69. package/build/server/chunks/{_server.ts-BAppHpQz.js → _server.ts-B-2v0wgR.js} +2 -2
  70. package/build/server/chunks/{_server.ts-BAppHpQz.js.map → _server.ts-B-2v0wgR.js.map} +1 -1
  71. package/build/server/chunks/{_server.ts-CsiQMtcc.js → _server.ts-Ba6jXSm2.js} +2 -2
  72. package/build/server/chunks/{_server.ts-CsiQMtcc.js.map → _server.ts-Ba6jXSm2.js.map} +1 -1
  73. package/build/server/chunks/{_server.ts-CZ9tt8rA.js → _server.ts-BhA9i-7j.js} +3 -3
  74. package/build/server/chunks/{_server.ts-CZ9tt8rA.js.map → _server.ts-BhA9i-7j.js.map} +1 -1
  75. package/build/server/chunks/{_server.ts-BC_LO1Mo.js → _server.ts-BjynU3C4.js} +2 -2
  76. package/build/server/chunks/{_server.ts-BC_LO1Mo.js.map → _server.ts-BjynU3C4.js.map} +1 -1
  77. package/build/server/chunks/{_server.ts-D9g_mUy6.js → _server.ts-C-iKh37d.js} +2 -2
  78. package/build/server/chunks/{_server.ts-D9g_mUy6.js.map → _server.ts-C-iKh37d.js.map} +1 -1
  79. package/build/server/chunks/{_server.ts-vcWTIQsw.js → _server.ts-CoLbb7aT.js} +2 -2
  80. package/build/server/chunks/{_server.ts-vcWTIQsw.js.map → _server.ts-CoLbb7aT.js.map} +1 -1
  81. package/build/server/chunks/{_server.ts-CjqbXM-Y.js → _server.ts-CozgvvoX.js} +2 -2
  82. package/build/server/chunks/{_server.ts-CjqbXM-Y.js.map → _server.ts-CozgvvoX.js.map} +1 -1
  83. package/build/server/chunks/{_server.ts-BeYJJW16.js → _server.ts-Cy5z0Rsk.js} +2 -2
  84. package/build/server/chunks/{_server.ts-BeYJJW16.js.map → _server.ts-Cy5z0Rsk.js.map} +1 -1
  85. package/build/server/chunks/{_server.ts-CYmVizOg.js → _server.ts-DCSJsfkA.js} +2 -2
  86. package/build/server/chunks/{_server.ts-CYmVizOg.js.map → _server.ts-DCSJsfkA.js.map} +1 -1
  87. package/build/server/chunks/{_server.ts-BjQjT0Ng.js → _server.ts-DRrwjyQ0.js} +2 -2
  88. package/build/server/chunks/{_server.ts-BjQjT0Ng.js.map → _server.ts-DRrwjyQ0.js.map} +1 -1
  89. package/build/server/chunks/{_server.ts-DU5J1Z8u.js → _server.ts-DcfIBmy4.js} +3 -3
  90. package/build/server/chunks/_server.ts-DcfIBmy4.js.map +1 -0
  91. package/build/server/chunks/{_server.ts-CKsrouac.js → _server.ts-Dq4A0ML7.js} +2 -2
  92. package/build/server/chunks/{_server.ts-CKsrouac.js.map → _server.ts-Dq4A0ML7.js.map} +1 -1
  93. package/build/server/chunks/{_server.ts-D7CP1EUi.js → _server.ts-dEWE9PbU.js} +2 -2
  94. package/build/server/chunks/{_server.ts-D7CP1EUi.js.map → _server.ts-dEWE9PbU.js.map} +1 -1
  95. package/build/server/chunks/{_server.ts-PJQyhLdS.js → _server.ts-g1VNk1F2.js} +2 -2
  96. package/build/server/chunks/{_server.ts-PJQyhLdS.js.map → _server.ts-g1VNk1F2.js.map} +1 -1
  97. package/build/server/chunks/{_server.ts-BP2cDreo.js → _server.ts-klbpGqf9.js} +2 -2
  98. package/build/server/chunks/{_server.ts-BP2cDreo.js.map → _server.ts-klbpGqf9.js.map} +1 -1
  99. package/build/server/chunks/{_server.ts-D-UcueSG.js → _server.ts-xRJQMsoy.js} +3 -3
  100. package/build/server/chunks/{_server.ts-D-UcueSG.js.map → _server.ts-xRJQMsoy.js.map} +1 -1
  101. package/build/server/chunks/{index4-BmUt-fl5.js → client-CJUAsTTN.js} +3 -23
  102. package/build/server/chunks/client-CJUAsTTN.js.map +1 -0
  103. package/build/server/chunks/{error.svelte-DhuTv3Mg.js → error.svelte-CYLEgCzL.js} +5 -4
  104. package/build/server/chunks/error.svelte-CYLEgCzL.js.map +1 -0
  105. package/build/server/chunks/exports-7ECo9oy7.js +102 -0
  106. package/build/server/chunks/exports-7ECo9oy7.js.map +1 -0
  107. package/build/server/chunks/index-CUeePJRv.js +4652 -0
  108. package/build/server/chunks/index-CUeePJRv.js.map +1 -0
  109. package/build/server/chunks/index-CoD1IJuy.js.map +1 -1
  110. package/build/server/chunks/{index3-Dje3vfFw.js → index2-BbHYMsUG.js} +266 -64
  111. package/build/server/chunks/index2-BbHYMsUG.js.map +1 -0
  112. package/build/server/chunks/index3-BKokHvI9.js +21 -0
  113. package/build/server/chunks/index3-BKokHvI9.js.map +1 -0
  114. package/build/server/chunks/server-Bf8x1V_n.js +16 -0
  115. package/build/server/chunks/server-Bf8x1V_n.js.map +1 -0
  116. package/build/server/chunks/{session-B5yQnNDv.js → session-BEXBEvJ9.js} +2 -2
  117. package/build/server/chunks/{session-B5yQnNDv.js.map → session-BEXBEvJ9.js.map} +1 -1
  118. package/build/server/index.js +703 -1424
  119. package/build/server/index.js.map +1 -1
  120. package/build/server/manifest.js +21 -21
  121. package/build/server/manifest.js.map +1 -1
  122. package/package.json +3 -2
  123. package/build/client/_app/immutable/assets/0.CmB_mQ6r.css +0 -1
  124. package/build/client/_app/immutable/assets/0.CmB_mQ6r.css.br +0 -0
  125. package/build/client/_app/immutable/assets/0.CmB_mQ6r.css.gz +0 -0
  126. package/build/client/_app/immutable/chunks/0ghLiCJk.js +0 -1
  127. package/build/client/_app/immutable/chunks/0ghLiCJk.js.br +0 -0
  128. package/build/client/_app/immutable/chunks/0ghLiCJk.js.gz +0 -0
  129. package/build/client/_app/immutable/chunks/Az6Ah2To.js +0 -2
  130. package/build/client/_app/immutable/chunks/Az6Ah2To.js.br +0 -0
  131. package/build/client/_app/immutable/chunks/Az6Ah2To.js.gz +0 -0
  132. package/build/client/_app/immutable/chunks/B4jA3VLS.js +0 -1
  133. package/build/client/_app/immutable/chunks/B4jA3VLS.js.br +0 -0
  134. package/build/client/_app/immutable/chunks/B4jA3VLS.js.gz +0 -0
  135. package/build/client/_app/immutable/chunks/BVlcxAlQ.js +0 -1
  136. package/build/client/_app/immutable/chunks/BVlcxAlQ.js.br +0 -0
  137. package/build/client/_app/immutable/chunks/BVlcxAlQ.js.gz +0 -0
  138. package/build/client/_app/immutable/chunks/CRomTuQI.js +0 -1
  139. package/build/client/_app/immutable/chunks/CRomTuQI.js.br +0 -0
  140. package/build/client/_app/immutable/chunks/CRomTuQI.js.gz +0 -0
  141. package/build/client/_app/immutable/chunks/HeMoCUQR.js +0 -1
  142. package/build/client/_app/immutable/chunks/HeMoCUQR.js.br +0 -0
  143. package/build/client/_app/immutable/chunks/HeMoCUQR.js.gz +0 -0
  144. package/build/client/_app/immutable/chunks/bVA83Itg.js +0 -96
  145. package/build/client/_app/immutable/chunks/bVA83Itg.js.br +0 -0
  146. package/build/client/_app/immutable/chunks/bVA83Itg.js.gz +0 -0
  147. package/build/client/_app/immutable/entry/app.r1xZjjw5.js +0 -2
  148. package/build/client/_app/immutable/entry/app.r1xZjjw5.js.br +0 -0
  149. package/build/client/_app/immutable/entry/app.r1xZjjw5.js.gz +0 -0
  150. package/build/client/_app/immutable/entry/start.CFaqHpYi.js +0 -1
  151. package/build/client/_app/immutable/entry/start.CFaqHpYi.js.br +0 -2
  152. package/build/client/_app/immutable/entry/start.CFaqHpYi.js.gz +0 -0
  153. package/build/client/_app/immutable/nodes/0.qoGoldyZ.js +0 -1
  154. package/build/client/_app/immutable/nodes/0.qoGoldyZ.js.br +0 -0
  155. package/build/client/_app/immutable/nodes/0.qoGoldyZ.js.gz +0 -0
  156. package/build/client/_app/immutable/nodes/1.N-a8xEtx.js +0 -1
  157. package/build/client/_app/immutable/nodes/1.N-a8xEtx.js.br +0 -1
  158. package/build/client/_app/immutable/nodes/1.N-a8xEtx.js.gz +0 -0
  159. package/build/client/_app/immutable/nodes/2.UjUuJUYA.js +0 -4
  160. package/build/client/_app/immutable/nodes/2.UjUuJUYA.js.br +0 -0
  161. package/build/client/_app/immutable/nodes/2.UjUuJUYA.js.gz +0 -0
  162. package/build/client/_app/immutable/nodes/3.CeWx5wYV.js +0 -4
  163. package/build/client/_app/immutable/nodes/3.CeWx5wYV.js.br +0 -0
  164. package/build/client/_app/immutable/nodes/3.CeWx5wYV.js.gz +0 -0
  165. package/build/server/chunks/0-DJQ9yHD-.js +0 -17
  166. package/build/server/chunks/0-DJQ9yHD-.js.map +0 -1
  167. package/build/server/chunks/1-0fAAqH6q.js +0 -9
  168. package/build/server/chunks/1-0fAAqH6q.js.map +0 -1
  169. package/build/server/chunks/2-C3kTHFPu.js +0 -9
  170. package/build/server/chunks/2-C3kTHFPu.js.map +0 -1
  171. package/build/server/chunks/3-DViOURTs.js +0 -9
  172. package/build/server/chunks/3-DViOURTs.js.map +0 -1
  173. package/build/server/chunks/InputModal-Bo_3Ym8j.js.map +0 -1
  174. package/build/server/chunks/Toast-Bd3XGXXC.js.map +0 -1
  175. package/build/server/chunks/_layout.svelte-BvleGV6e.js.map +0 -1
  176. package/build/server/chunks/_page.svelte-C1-T5LLg.js.map +0 -1
  177. package/build/server/chunks/_page.svelte-CWnsm7d3.js.map +0 -1
  178. package/build/server/chunks/_server.ts-DU5J1Z8u.js.map +0 -1
  179. package/build/server/chunks/error.svelte-DhuTv3Mg.js.map +0 -1
  180. package/build/server/chunks/exports-BXvEiaiv.js +0 -238
  181. package/build/server/chunks/exports-BXvEiaiv.js.map +0 -1
  182. package/build/server/chunks/index-Cw8KcxMg.js +0 -1352
  183. package/build/server/chunks/index-Cw8KcxMg.js.map +0 -1
  184. package/build/server/chunks/index2-4GAMKCnB.js +0 -1925
  185. package/build/server/chunks/index2-4GAMKCnB.js.map +0 -1
  186. package/build/server/chunks/index3-Dje3vfFw.js.map +0 -1
  187. package/build/server/chunks/index4-BmUt-fl5.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { a1 as escape_html, a3 as is_array, a4 as get_prototype_of, a5 as object_prototype } from './index2-4GAMKCnB.js';
2
- import { T as Toast, C as ConfirmModal, a as appConfig, f as formatProjectName, t as truncate, b as formatDate, m as maskHomePath } from './Toast-Bd3XGXXC.js';
3
- import { I as InputModal } from './InputModal-Bo_3Ym8j.js';
4
- import { x as sortProjects, T as TREE_ICONS, v as validateChain, y as validateProgressMessages, z as getTotalTodoCount, A as getDisplayTitle, B as sessionHasSubItems, C as getSessionTooltip, D as parseCommandMessage, E as deleteMessageWithChainRepair } from './index3-Dje3vfFw.js';
5
- import { j as store_get, m as ensure_array_like, d as attr, k as attr_class, f as stringify, l as unsubscribe_stores, n as clsx, o as attributes, p as await_block } from './index-Cw8KcxMg.js';
1
+ import { x as escape_html, E as ensure_array_like, p as attr, y as attr_class, q as stringify, z as derived, t as store_get, F as clsx, G as attributes, B as unsubscribe_stores, H as await_block, I as is_array, J as get_prototype_of, K as object_prototype } from './index-CUeePJRv.js';
2
+ import { b as base } from './server-Bf8x1V_n.js';
3
+ import { T as Toast, C as ConfirmModal, f as formatProjectName, a as appConfig, t as truncate, b as formatDate, m as maskHomePath } from './Toast-BzqOqKOg.js';
4
+ import { I as InputModal } from './InputModal-B2QW71Rc.js';
5
+ import { T as TREE_ICONS, x as sortProjects, y as getTotalTodoCount, z as getDisplayTitle, A as sessionHasSubItems, B as getSessionTooltip, C as validateProgressMessages, v as validateChain, D as parseCommandMessage, E as deleteMessageWithChainRepair } from './index2-BbHYMsUG.js';
6
6
  import 'marked';
7
7
  import 'fs';
8
8
  import 'fs/promises';
@@ -50,7 +50,7 @@ function clone(value, cloned, path, paths, original = null, no_tojson = false) {
50
50
  if (original !== null) {
51
51
  cloned.set(original, copy);
52
52
  }
53
- for (var key in value) {
53
+ for (var key of Object.keys(value)) {
54
54
  copy[key] = clone(
55
55
  // @ts-expect-error
56
56
  value[key],
@@ -100,7 +100,7 @@ function clone(value, cloned, path, paths, original = null, no_tojson = false) {
100
100
  );
101
101
  }
102
102
  }
103
- const BASE_URL = "/api";
103
+ const BASE_URL = `${base}/api`;
104
104
  const get = async (path) => {
105
105
  const res = await fetch(`${BASE_URL}${path}`);
106
106
  if (!res.ok) throw new Error(await res.text());
@@ -258,39 +258,35 @@ const parseIdeTags = (content) => {
258
258
  function ExpandableContent($$renderer, $$props) {
259
259
  $$renderer.component(($$renderer2) => {
260
260
  let { content, maxLines = 10, lang } = $$props;
261
- const lines = content.split("\n");
262
- const needsExpand = lines.length > maxLines;
263
- const displayContent = needsExpand && true ? lines.slice(0, maxLines).join("\n") : content;
264
- if (needsExpand) {
265
- $$renderer2.push("<!--[-->");
261
+ const lines = derived(() => content.split("\n"));
262
+ const needsExpand = derived(() => lines().length > maxLines);
263
+ const displayContent = derived(() => needsExpand() && true ? lines().slice(0, maxLines).join("\n") : content);
264
+ if (needsExpand()) {
265
+ $$renderer2.push("<!--[0-->");
266
266
  $$renderer2.push(`<div class="relative">`);
267
267
  if (lang) {
268
- $$renderer2.push("<!--[-->");
269
- $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto"><code${attr_class(`language-${stringify(lang)}`)}>${escape_html(displayContent)}</code></pre>`);
268
+ $$renderer2.push("<!--[0-->");
269
+ $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto"><code${attr_class(`language-${stringify(lang)}`)}>${escape_html(displayContent())}</code></pre>`);
270
270
  } else {
271
- $$renderer2.push("<!--[!-->");
272
- $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto">${escape_html(displayContent)}</pre>`);
271
+ $$renderer2.push("<!--[-1-->");
272
+ $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto">${escape_html(displayContent())}</pre>`);
273
273
  }
274
274
  $$renderer2.push(`<!--]--> `);
275
275
  {
276
- $$renderer2.push("<!--[-->");
276
+ $$renderer2.push("<!--[0-->");
277
277
  $$renderer2.push(`<div class="absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-gh-canvas to-transparent pointer-events-none"></div> `);
278
278
  {
279
- $$renderer2.push("<!--[!-->");
279
+ $$renderer2.push("<!--[-1-->");
280
280
  }
281
281
  $$renderer2.push(`<!--]-->`);
282
282
  }
283
283
  $$renderer2.push(`<!--]--></div>`);
284
+ } else if (lang) {
285
+ $$renderer2.push("<!--[1-->");
286
+ $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto"><code${attr_class(`language-${stringify(lang)}`)}>${escape_html(content)}</code></pre>`);
284
287
  } else {
285
- $$renderer2.push("<!--[!-->");
286
- if (lang) {
287
- $$renderer2.push("<!--[-->");
288
- $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto"><code${attr_class(`language-${stringify(lang)}`)}>${escape_html(content)}</code></pre>`);
289
- } else {
290
- $$renderer2.push("<!--[!-->");
291
- $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto">${escape_html(content)}</pre>`);
292
- }
293
- $$renderer2.push(`<!--]-->`);
288
+ $$renderer2.push("<!--[-1-->");
289
+ $$renderer2.push(`<pre class="whitespace-pre-wrap font-mono text-xs text-gh-text-secondary overflow-x-auto">${escape_html(content)}</pre>`);
294
290
  }
295
291
  $$renderer2.push(`<!--]-->`);
296
292
  });
@@ -298,84 +294,80 @@ function ExpandableContent($$renderer, $$props) {
298
294
  function IdeTag($$renderer, $$props) {
299
295
  $$renderer.component(($$renderer2) => {
300
296
  const { tag, content } = $$props;
301
- const filePath = (() => {
297
+ const filePath = derived(() => {
302
298
  const pathMatch = content.match(/(?:opened the file |selected.*from )(\/[^\s]+)/);
303
299
  if (pathMatch) return pathMatch[1];
304
300
  if (content.trim().startsWith("/")) {
305
301
  return content.trim().split("\n")[0].split(" ")[0];
306
302
  }
307
303
  return null;
308
- })();
309
- const lineInfo = (() => {
304
+ });
305
+ const lineInfo = derived(() => {
310
306
  const lineMatch = content.match(/lines? (\d+)(?:\s*to\s*(\d+))?/);
311
307
  if (lineMatch) {
312
308
  return lineMatch[2] ? `L${lineMatch[1]}-${lineMatch[2]}` : `L${lineMatch[1]}`;
313
309
  }
314
310
  return null;
315
- })();
311
+ });
316
312
  if (tag === "ide_opened_file") {
317
- $$renderer2.push("<!--[-->");
313
+ $$renderer2.push("<!--[0-->");
318
314
  $$renderer2.push(`<div class="flex items-center gap-2 text-xs text-blue-400 bg-blue-900/20 rounded px-2 py-1"><span class="opacity-60">📂</span> `);
319
- if (filePath) {
320
- $$renderer2.push("<!--[-->");
315
+ if (filePath()) {
316
+ $$renderer2.push("<!--[0-->");
321
317
  await_block(
322
318
  $$renderer2,
323
- checkFileExists(filePath),
319
+ checkFileExists(filePath()),
324
320
  () => {
325
- $$renderer2.push(`<span class="font-mono">${escape_html(filePath.split("/").pop())}</span>`);
321
+ $$renderer2.push(`<span class="font-mono">${escape_html(filePath().split("/").pop())}</span>`);
326
322
  },
327
323
  (exists) => {
328
324
  if (exists) {
329
- $$renderer2.push("<!--[-->");
330
- $$renderer2.push(`<button class="font-mono hover:underline cursor-pointer bg-transparent border-none text-blue-400 p-0"${attr("title", filePath)}>${escape_html(filePath.split("/").pop())}${escape_html(lineInfo ? `:${lineInfo}` : "")}</button>`);
325
+ $$renderer2.push("<!--[0-->");
326
+ $$renderer2.push(`<button class="font-mono hover:underline cursor-pointer bg-transparent border-none text-blue-400 p-0"${attr("title", filePath())}>${escape_html(filePath().split("/").pop())}${escape_html(lineInfo() ? `:${lineInfo()}` : "")}</button>`);
331
327
  } else {
332
- $$renderer2.push("<!--[!-->");
333
- $$renderer2.push(`<span class="font-mono opacity-60"${attr("title", filePath)}>${escape_html(filePath.split("/").pop())}</span>`);
328
+ $$renderer2.push("<!--[-1-->");
329
+ $$renderer2.push(`<span class="font-mono opacity-60"${attr("title", filePath())}>${escape_html(filePath().split("/").pop())}</span>`);
334
330
  }
335
331
  $$renderer2.push(`<!--]-->`);
336
332
  }
337
333
  );
338
334
  $$renderer2.push(`<!--]-->`);
339
335
  } else {
340
- $$renderer2.push("<!--[!-->");
336
+ $$renderer2.push("<!--[-1-->");
341
337
  $$renderer2.push(`<span class="opacity-60">${escape_html(content)}</span>`);
342
338
  }
343
339
  $$renderer2.push(`<!--]--></div>`);
344
- } else {
345
- $$renderer2.push("<!--[!-->");
346
- if (tag === "ide_selection") {
347
- $$renderer2.push("<!--[-->");
348
- $$renderer2.push(`<div class="text-xs text-purple-400 bg-purple-900/20 rounded px-2 py-1"><div class="flex items-center gap-2"><span class="opacity-60">✂️</span> `);
349
- if (filePath) {
350
- $$renderer2.push("<!--[-->");
351
- await_block(
352
- $$renderer2,
353
- checkFileExists(filePath),
354
- () => {
355
- $$renderer2.push(`<span class="font-mono">${escape_html(filePath.split("/").pop())}${escape_html(lineInfo ? `:${lineInfo}` : "")}</span>`);
356
- },
357
- (exists) => {
358
- if (exists) {
359
- $$renderer2.push("<!--[-->");
360
- $$renderer2.push(`<button class="font-mono hover:underline cursor-pointer bg-transparent border-none text-purple-400 p-0"${attr("title", filePath)}>${escape_html(filePath.split("/").pop())}${escape_html(lineInfo ? `:${lineInfo}` : "")}</button>`);
361
- } else {
362
- $$renderer2.push("<!--[!-->");
363
- $$renderer2.push(`<span class="font-mono opacity-60"${attr("title", filePath)}>${escape_html(filePath.split("/").pop())}${escape_html(lineInfo ? `:${lineInfo}` : "")}</span>`);
364
- }
365
- $$renderer2.push(`<!--]-->`);
340
+ } else if (tag === "ide_selection") {
341
+ $$renderer2.push("<!--[1-->");
342
+ $$renderer2.push(`<div class="text-xs text-purple-400 bg-purple-900/20 rounded px-2 py-1"><div class="flex items-center gap-2"><span class="opacity-60">✂️</span> `);
343
+ if (filePath()) {
344
+ $$renderer2.push("<!--[0-->");
345
+ await_block(
346
+ $$renderer2,
347
+ checkFileExists(filePath()),
348
+ () => {
349
+ $$renderer2.push(`<span class="font-mono">${escape_html(filePath().split("/").pop())}${escape_html(lineInfo() ? `:${lineInfo()}` : "")}</span>`);
350
+ },
351
+ (exists) => {
352
+ if (exists) {
353
+ $$renderer2.push("<!--[0-->");
354
+ $$renderer2.push(`<button class="font-mono hover:underline cursor-pointer bg-transparent border-none text-purple-400 p-0"${attr("title", filePath())}>${escape_html(filePath().split("/").pop())}${escape_html(lineInfo() ? `:${lineInfo()}` : "")}</button>`);
355
+ } else {
356
+ $$renderer2.push("<!--[-1-->");
357
+ $$renderer2.push(`<span class="font-mono opacity-60"${attr("title", filePath())}>${escape_html(filePath().split("/").pop())}${escape_html(lineInfo() ? `:${lineInfo()}` : "")}</span>`);
366
358
  }
367
- );
368
- $$renderer2.push(`<!--]-->`);
369
- } else {
370
- $$renderer2.push("<!--[!-->");
371
- $$renderer2.push(`<span class="font-mono">${escape_html(content.split("\n")[0].slice(0, 60))}</span>`);
372
- }
373
- $$renderer2.push(`<!--]--></div></div>`);
359
+ $$renderer2.push(`<!--]-->`);
360
+ }
361
+ );
362
+ $$renderer2.push(`<!--]-->`);
374
363
  } else {
375
- $$renderer2.push("<!--[!-->");
376
- $$renderer2.push(`<div class="text-xs text-yellow-400 bg-yellow-900/20 rounded px-2 py-1"><span class="opacity-60">⚠️</span> <span class="font-mono">&lt;${escape_html(tag)}></span> <span class="opacity-60 ml-1">${escape_html(content.slice(0, 50))}${escape_html(content.length > 50 ? "..." : "")}</span></div>`);
364
+ $$renderer2.push("<!--[-1-->");
365
+ $$renderer2.push(`<span class="font-mono">${escape_html(content.split("\n")[0].slice(0, 60))}</span>`);
377
366
  }
378
- $$renderer2.push(`<!--]-->`);
367
+ $$renderer2.push(`<!--]--></div></div>`);
368
+ } else {
369
+ $$renderer2.push("<!--[-1-->");
370
+ $$renderer2.push(`<div class="text-xs text-yellow-400 bg-yellow-900/20 rounded px-2 py-1"><span class="opacity-60">⚠️</span> <span class="font-mono">&lt;${escape_html(tag)}></span> <span class="opacity-60 ml-1">${escape_html(content.slice(0, 50))}${escape_html(content.length > 50 ? "..." : "")}</span></div>`);
379
371
  }
380
372
  $$renderer2.push(`<!--]-->`);
381
373
  });
@@ -430,7 +422,7 @@ function TooltipButton($$renderer, $$props) {
430
422
  children($$renderer);
431
423
  $$renderer.push(`<!----></button> `);
432
424
  {
433
- $$renderer.push("<!--[!-->");
425
+ $$renderer.push("<!--[-1-->");
434
426
  }
435
427
  $$renderer.push(`<!--]-->`);
436
428
  }
@@ -444,35 +436,35 @@ function MessageItem($$renderer, $$props) {
444
436
  onEditTitle,
445
437
  onSplit
446
438
  } = $$props;
447
- const msgId = msg.uuid ?? "";
448
- const isAssistant = msg.type === "assistant";
449
- const isCustomTitle = msg.type === "custom-title";
450
- const isFileSnapshot = msg.type === "file-history-snapshot";
451
- const isHuman = msg.type === "human" || msg.type === "user";
452
- const isLocalCommand = msg.type === "system" && msg.subtype === "local_command";
453
- const isQueueOperation = msg.type === "queue-operation";
454
- const isToolResult = (() => {
439
+ const msgId = derived(() => msg.uuid ?? "");
440
+ const isAssistant = derived(() => msg.type === "assistant");
441
+ const isCustomTitle = derived(() => msg.type === "custom-title");
442
+ const isFileSnapshot = derived(() => msg.type === "file-history-snapshot");
443
+ const isHuman = derived(() => msg.type === "human" || msg.type === "user");
444
+ const isLocalCommand = derived(() => msg.type === "system" && msg.subtype === "local_command");
445
+ const isQueueOperation = derived(() => msg.type === "queue-operation");
446
+ const isToolResult = derived(() => {
455
447
  if (msg.type !== "user") return false;
456
448
  const m = msg.message;
457
449
  if (!Array.isArray(m?.content)) return false;
458
450
  const first = m.content[0];
459
451
  return first?.type === "tool_result";
460
- })();
461
- const snapshotData = (() => {
462
- if (!isFileSnapshot) return null;
452
+ });
453
+ const snapshotData = derived(() => {
454
+ if (!isFileSnapshot()) return null;
463
455
  const snapshot2 = msg.snapshot;
464
456
  const backups = snapshot2?.trackedFileBackups ?? {};
465
457
  return {
466
458
  files: Object.entries(backups),
467
459
  timestamp: snapshot2?.timestamp
468
460
  };
469
- })();
470
- const commandData = (() => {
471
- if (isLocalCommand) {
461
+ });
462
+ const commandData = derived(() => {
463
+ if (isLocalCommand()) {
472
464
  const content = typeof msg.content === "string" ? msg.content : "";
473
465
  return parseCommandMessage(content);
474
466
  }
475
- if (isHuman) {
467
+ if (isHuman()) {
476
468
  const m = msg.message;
477
469
  const content = typeof m?.content === "string" ? m.content : "";
478
470
  if (content.includes("<command-name>")) {
@@ -480,14 +472,14 @@ function MessageItem($$renderer, $$props) {
480
472
  }
481
473
  }
482
474
  return null;
483
- })();
484
- const isSlashCommand = commandData !== null && !isLocalCommand;
485
- const stopHookData = parseStopHookSummary(msg);
486
- const turnDurationData = parseTurnDuration(msg);
487
- const progressData = parseProgress(msg);
475
+ });
476
+ const isSlashCommand = derived(() => commandData() !== null && !isLocalCommand());
477
+ const stopHookData = derived(() => parseStopHookSummary(msg));
478
+ const turnDurationData = derived(() => parseTurnDuration(msg));
479
+ const progressData = derived(() => parseProgress(msg));
488
480
  const FILE_TOOLS = ["Read", "Write", "Edit"];
489
- const toolUseData = (() => {
490
- if (!isAssistant) return null;
481
+ const toolUseData = derived(() => {
482
+ if (!isAssistant()) return null;
491
483
  const m = msg.message;
492
484
  if (!Array.isArray(m?.content)) return null;
493
485
  const toolUse = m.content.find((item) => typeof item === "object" && item !== null && item.type === "tool_use");
@@ -498,36 +490,36 @@ function MessageItem($$renderer, $$props) {
498
490
  // Extract file path for file tools (Read, Write, Edit)
499
491
  filePath: FILE_TOOLS.includes(toolUse.name) ? toolUse.input.file_path : null
500
492
  };
501
- })();
502
- const thinkingBlocks = (() => {
503
- if (!isAssistant) return [];
493
+ });
494
+ const thinkingBlocks = derived(() => {
495
+ if (!isAssistant()) return [];
504
496
  const m = msg.message;
505
497
  if (!Array.isArray(m?.content)) return [];
506
498
  return m.content.filter((item) => typeof item === "object" && item !== null && item.type === "thinking");
507
- })();
508
- const customTitle = msg.customTitle ?? "";
509
- const messageId = msg.uuid || msg.messageId || "";
510
- const hasContent = (() => {
511
- if (isQueueOperation) return false;
512
- if (isFileSnapshot || isLocalCommand || isCustomTitle || toolUseData) return true;
499
+ });
500
+ const customTitle = derived(() => msg.customTitle ?? "");
501
+ const messageId = derived(() => msg.uuid || msg.messageId || "");
502
+ const hasContent = derived(() => {
503
+ if (isQueueOperation()) return false;
504
+ if (isFileSnapshot() || isLocalCommand() || isCustomTitle() || toolUseData()) return true;
513
505
  const content = getMessageContent(msg);
514
506
  if (content.trim().length > 0) return true;
515
507
  if (msg.type === "user" || msg.type === "human") {
516
- const label = isToolResult ? "Tool result" : "User message";
508
+ const label = isToolResult() ? "Tool result" : "User message";
517
509
  console.warn(`${label} without content:`, snapshot(msg));
518
510
  }
519
511
  return false;
520
- })();
521
- const hasAnyContent = hasContent || thinkingBlocks.length > 0;
522
- const messageClass = (() => {
523
- if (isHuman) return "bg-gh-accent/15 border-l-3 border-l-gh-accent";
524
- if (isAssistant) return "bg-gh-green/15 border-l-3 border-l-gh-green";
525
- if (isCustomTitle) return "bg-purple-500/15 border-l-3 border-l-purple-500";
512
+ });
513
+ const hasAnyContent = derived(() => hasContent() || thinkingBlocks().length > 0);
514
+ const messageClass = derived(() => {
515
+ if (isHuman()) return "bg-gh-accent/15 border-l-3 border-l-gh-accent";
516
+ if (isAssistant()) return "bg-gh-green/15 border-l-3 border-l-gh-green";
517
+ if (isCustomTitle()) return "bg-purple-500/15 border-l-3 border-l-purple-500";
526
518
  return "bg-gh-border-subtle";
527
- })();
519
+ });
528
520
  function splitButton($$renderer3) {
529
521
  if (onSplit && !isFirst && msg.uuid) {
530
- $$renderer3.push("<!--[-->");
522
+ $$renderer3.push("<!--[0-->");
531
523
  TooltipButton($$renderer3, {
532
524
  class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-accent/20 text-xs",
533
525
  onclick: () => onSplit(msg),
@@ -538,7 +530,7 @@ function MessageItem($$renderer, $$props) {
538
530
  $$slots: { default: true }
539
531
  });
540
532
  } else {
541
- $$renderer3.push("<!--[!-->");
533
+ $$renderer3.push("<!--[-1-->");
542
534
  }
543
535
  $$renderer3.push(`<!--]-->`);
544
536
  }
@@ -553,276 +545,236 @@ function MessageItem($$renderer, $$props) {
553
545
  $$slots: { default: true }
554
546
  });
555
547
  }
556
- if (isQueueOperation) {
557
- $$renderer2.push("<!--[-->");
558
- } else {
559
- $$renderer2.push("<!--[!-->");
560
- if (progressData) {
561
- $$renderer2.push("<!--[-->");
562
- $$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">`);
563
- splitButton($$renderer2);
564
- $$renderer2.push(`<!----> `);
565
- deleteButton($$renderer2);
566
- $$renderer2.push(`<!----></div></div></div>`);
548
+ if (isQueueOperation()) {
549
+ $$renderer2.push("<!--[0-->");
550
+ } else if (progressData()) {
551
+ $$renderer2.push("<!--[1-->");
552
+ $$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">`);
553
+ splitButton($$renderer2);
554
+ $$renderer2.push(`<!----> `);
555
+ deleteButton($$renderer2);
556
+ $$renderer2.push(`<!----></div></div></div>`);
557
+ } else if (turnDurationData()) {
558
+ $$renderer2.push("<!--[2-->");
559
+ $$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">`);
560
+ splitButton($$renderer2);
561
+ $$renderer2.push(`<!----> `);
562
+ deleteButton($$renderer2);
563
+ $$renderer2.push(`<!----></div></div></div>`);
564
+ } else if (stopHookData()) {
565
+ $$renderer2.push("<!--[3-->");
566
+ $$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> `);
567
+ splitButton($$renderer2);
568
+ $$renderer2.push(`<!----> `);
569
+ deleteButton($$renderer2);
570
+ $$renderer2.push(`<!----></div></div> `);
571
+ if (stopHookData().hookInfos.length > 0) {
572
+ $$renderer2.push("<!--[0-->");
573
+ $$renderer2.push(`<div class="mt-1 text-xs text-gh-text-secondary"><!--[-->`);
574
+ const each_array = ensure_array_like(stopHookData().hookInfos);
575
+ for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
576
+ let hook = each_array[$$index];
577
+ $$renderer2.push(`<span class="font-mono">${escape_html(hook.command)}</span>`);
578
+ }
579
+ $$renderer2.push(`<!--]--></div>`);
567
580
  } else {
568
- $$renderer2.push("<!--[!-->");
569
- if (turnDurationData) {
570
- $$renderer2.push("<!--[-->");
571
- $$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">`);
572
- splitButton($$renderer2);
573
- $$renderer2.push(`<!----> `);
574
- deleteButton($$renderer2);
575
- $$renderer2.push(`<!----></div></div></div>`);
581
+ $$renderer2.push("<!--[-1-->");
582
+ }
583
+ $$renderer2.push(`<!--]--> `);
584
+ if (stopHookData().hookErrors.length > 0) {
585
+ $$renderer2.push("<!--[0-->");
586
+ $$renderer2.push(`<div class="mt-1 text-xs text-red-400"><!--[-->`);
587
+ const each_array_1 = ensure_array_like(stopHookData().hookErrors);
588
+ for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
589
+ let error = each_array_1[$$index_1];
590
+ $$renderer2.push(`<p>${escape_html(error)}</p>`);
591
+ }
592
+ $$renderer2.push(`<!--]--></div>`);
593
+ } else {
594
+ $$renderer2.push("<!--[-1-->");
595
+ }
596
+ $$renderer2.push(`<!--]--></div>`);
597
+ } else if (isFileSnapshot() && snapshotData()) {
598
+ $$renderer2.push("<!--[4-->");
599
+ $$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> `);
600
+ splitButton($$renderer2);
601
+ $$renderer2.push(`<!----> `);
602
+ deleteButton($$renderer2);
603
+ $$renderer2.push(`<!----></div></div> <ul class="space-y-1"><!--[-->`);
604
+ const each_array_2 = ensure_array_like(snapshotData().files);
605
+ for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
606
+ let [filePath, info] = each_array_2[$$index_2];
607
+ const hasBackup = !!(info.backupFileName && sessionId);
608
+ $$renderer2.push(`<li class="font-mono text-xs truncate"${attr("title", maskHomePaths(filePath))}>`);
609
+ if (hasBackup) {
610
+ $$renderer2.push("<!--[0-->");
611
+ $$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>`);
576
612
  } else {
577
- $$renderer2.push("<!--[!-->");
578
- if (stopHookData) {
579
- $$renderer2.push("<!--[-->");
580
- $$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> `);
581
- splitButton($$renderer2);
582
- $$renderer2.push(`<!----> `);
583
- deleteButton($$renderer2);
584
- $$renderer2.push(`<!----></div></div> `);
585
- if (stopHookData.hookInfos.length > 0) {
586
- $$renderer2.push("<!--[-->");
587
- $$renderer2.push(`<div class="mt-1 text-xs text-gh-text-secondary"><!--[-->`);
588
- const each_array = ensure_array_like(stopHookData.hookInfos);
589
- for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
590
- let hook = each_array[$$index];
591
- $$renderer2.push(`<span class="font-mono">${escape_html(hook.command)}</span>`);
592
- }
593
- $$renderer2.push(`<!--]--></div>`);
594
- } else {
595
- $$renderer2.push("<!--[!-->");
596
- }
597
- $$renderer2.push(`<!--]--> `);
598
- if (stopHookData.hookErrors.length > 0) {
599
- $$renderer2.push("<!--[-->");
600
- $$renderer2.push(`<div class="mt-1 text-xs text-red-400"><!--[-->`);
601
- const each_array_1 = ensure_array_like(stopHookData.hookErrors);
602
- for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
603
- let error = each_array_1[$$index_1];
604
- $$renderer2.push(`<p>${escape_html(error)}</p>`);
605
- }
606
- $$renderer2.push(`<!--]--></div>`);
613
+ $$renderer2.push("<!--[-1-->");
614
+ $$renderer2.push(`<span class="text-gh-text-secondary">${escape_html(maskHomePaths(filePath))}</span>`);
615
+ }
616
+ $$renderer2.push(`<!--]--></li>`);
617
+ }
618
+ $$renderer2.push(`<!--]--></ul></div>`);
619
+ } else if (isSlashCommand() && commandData()) {
620
+ $$renderer2.push("<!--[5-->");
621
+ $$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> `);
622
+ splitButton($$renderer2);
623
+ $$renderer2.push(`<!----> `);
624
+ deleteButton($$renderer2);
625
+ $$renderer2.push(`<!----></div></div></div>`);
626
+ } else if (isLocalCommand() && commandData()) {
627
+ $$renderer2.push("<!--[6-->");
628
+ $$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> `);
629
+ splitButton($$renderer2);
630
+ $$renderer2.push(`<!----> `);
631
+ deleteButton($$renderer2);
632
+ $$renderer2.push(`<!----></div></div> `);
633
+ if (commandData().message && commandData().message !== commandData().name?.slice(1)) {
634
+ $$renderer2.push("<!--[0-->");
635
+ $$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(commandData().message)}</p>`);
636
+ } else {
637
+ $$renderer2.push("<!--[-1-->");
638
+ }
639
+ $$renderer2.push(`<!--]--></div>`);
640
+ } else if (toolUseData()) {
641
+ $$renderer2.push("<!--[7-->");
642
+ $$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> `);
643
+ splitButton($$renderer2);
644
+ $$renderer2.push(`<!----> `);
645
+ deleteButton($$renderer2);
646
+ $$renderer2.push(`<!----></div></div> `);
647
+ if (toolUseData().filePath) {
648
+ $$renderer2.push("<!--[0-->");
649
+ await_block(
650
+ $$renderer2,
651
+ checkFileExists(toolUseData().filePath),
652
+ () => {
653
+ $$renderer2.push(`<span class="mt-1 text-sm text-gh-text-secondary font-mono">${escape_html(toolUseData().filePath.split("/").pop())}</span>`);
654
+ },
655
+ (exists) => {
656
+ if (exists) {
657
+ $$renderer2.push("<!--[0-->");
658
+ $$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>`);
607
659
  } else {
608
- $$renderer2.push("<!--[!-->");
660
+ $$renderer2.push("<!--[-1-->");
661
+ $$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>`);
609
662
  }
610
- $$renderer2.push(`<!--]--></div>`);
663
+ $$renderer2.push(`<!--]-->`);
664
+ }
665
+ );
666
+ $$renderer2.push(`<!--]-->`);
667
+ } else if (toolUseData().input.command) {
668
+ $$renderer2.push("<!--[1-->");
669
+ if (toolUseData().input.description) {
670
+ $$renderer2.push("<!--[0-->");
671
+ $$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(toolUseData().input.description)}</p>`);
672
+ } else {
673
+ $$renderer2.push("<!--[-1-->");
674
+ }
675
+ $$renderer2.push(`<!--]--> `);
676
+ ExpandableContent($$renderer2, {
677
+ content: String(toolUseData().input.command),
678
+ lang: "sh",
679
+ maxLines: 3
680
+ });
681
+ $$renderer2.push(`<!---->`);
682
+ } else {
683
+ $$renderer2.push("<!--[-1-->");
684
+ const { path: _path, ...input } = toolUseData().input;
685
+ const keys = Object.keys(input);
686
+ if (keys.length === 1) {
687
+ $$renderer2.push("<!--[0-->");
688
+ const key = keys[0];
689
+ const value = input[key];
690
+ $$renderer2.push(`${escape_html((() => {
691
+ console.info(`${key} =`, value);
692
+ return "";
693
+ })())} `);
694
+ if (key === "todos" && Array.isArray(value)) {
695
+ $$renderer2.push("<!--[0-->");
696
+ TodoItem($$renderer2, { todos: value });
611
697
  } else {
612
- $$renderer2.push("<!--[!-->");
613
- if (isFileSnapshot && snapshotData) {
614
- $$renderer2.push("<!--[-->");
615
- $$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> `);
616
- splitButton($$renderer2);
617
- $$renderer2.push(`<!----> `);
618
- deleteButton($$renderer2);
619
- $$renderer2.push(`<!----></div></div> <ul class="space-y-1"><!--[-->`);
620
- const each_array_2 = ensure_array_like(snapshotData.files);
621
- for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
622
- let [filePath, info] = each_array_2[$$index_2];
623
- const hasBackup = !!(info.backupFileName && sessionId);
624
- $$renderer2.push(`<li class="font-mono text-xs truncate"${attr("title", maskHomePaths(filePath))}>`);
625
- if (hasBackup) {
626
- $$renderer2.push("<!--[-->");
627
- $$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>`);
628
- } else {
629
- $$renderer2.push("<!--[!-->");
630
- $$renderer2.push(`<span class="text-gh-text-secondary">${escape_html(maskHomePaths(filePath))}</span>`);
631
- }
632
- $$renderer2.push(`<!--]--></li>`);
633
- }
634
- $$renderer2.push(`<!--]--></ul></div>`);
698
+ $$renderer2.push("<!--[-1-->");
699
+ ExpandableContent($$renderer2, {
700
+ content: `${key} = ${JSON.stringify(value, null, 2)}`,
701
+ lang: "js",
702
+ maxLines: 1
703
+ });
704
+ }
705
+ $$renderer2.push(`<!--]-->`);
706
+ } else {
707
+ $$renderer2.push("<!--[-1-->");
708
+ ExpandableContent($$renderer2, {
709
+ content: JSON.stringify(input, null, 2),
710
+ lang: "json",
711
+ maxLines: 6
712
+ });
713
+ }
714
+ $$renderer2.push(`<!--]-->`);
715
+ }
716
+ $$renderer2.push(`<!--]--></div>`);
717
+ } else if (hasAnyContent()) {
718
+ $$renderer2.push("<!--[8-->");
719
+ $$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> `);
720
+ if (isCustomTitle() && onEditTitle) {
721
+ $$renderer2.push("<!--[0-->");
722
+ TooltipButton($$renderer2, {
723
+ class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-border text-xs",
724
+ onclick: () => onEditTitle(msg),
725
+ title: "Edit title",
726
+ children: ($$renderer3) => {
727
+ $$renderer3.push(`<!---->✏️`);
728
+ },
729
+ $$slots: { default: true }
730
+ });
731
+ } else {
732
+ $$renderer2.push("<!--[-1-->");
733
+ }
734
+ $$renderer2.push(`<!--]--> `);
735
+ splitButton($$renderer2);
736
+ $$renderer2.push(`<!----> `);
737
+ deleteButton($$renderer2);
738
+ $$renderer2.push(`<!----></div></div> `);
739
+ if (thinkingBlocks().length > 0) {
740
+ $$renderer2.push("<!--[0-->");
741
+ $$renderer2.push(`<div class="message-content text-sm"><!--[-->`);
742
+ const each_array_3 = ensure_array_like(thinkingBlocks());
743
+ for (let i = 0, $$length = each_array_3.length; i < $$length; i++) {
744
+ let block = each_array_3[i];
745
+ $$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>`);
746
+ }
747
+ $$renderer2.push(`<!--]--></div>`);
748
+ } else {
749
+ $$renderer2.push("<!--[-1-->");
750
+ }
751
+ $$renderer2.push(`<!--]--> `);
752
+ if (hasContent()) {
753
+ $$renderer2.push("<!--[0-->");
754
+ $$renderer2.push(`<div class="message-content text-sm">`);
755
+ if (isCustomTitle()) {
756
+ $$renderer2.push("<!--[0-->");
757
+ $$renderer2.push(`<span class="font-semibold text-purple-400">${escape_html(customTitle())}</span>`);
758
+ } else {
759
+ $$renderer2.push("<!--[-1-->");
760
+ const msgContent = getMessageContent(msg);
761
+ const segments = parseIdeTags(msgContent);
762
+ $$renderer2.push(`<!--[-->`);
763
+ const each_array_4 = ensure_array_like(segments);
764
+ for (let $$index_4 = 0, $$length = each_array_4.length; $$index_4 < $$length; $$index_4++) {
765
+ let segment = each_array_4[$$index_4];
766
+ if (segment.type === "ide_tag" && segment.tag) {
767
+ $$renderer2.push("<!--[0-->");
768
+ IdeTag($$renderer2, { tag: segment.tag, content: segment.content });
635
769
  } else {
636
- $$renderer2.push("<!--[!-->");
637
- if (isSlashCommand && commandData) {
638
- $$renderer2.push("<!--[-->");
639
- $$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> `);
640
- splitButton($$renderer2);
641
- $$renderer2.push(`<!----> `);
642
- deleteButton($$renderer2);
643
- $$renderer2.push(`<!----></div></div></div>`);
770
+ $$renderer2.push("<!--[-1-->");
771
+ const textLines = segment.content.split("\n");
772
+ if (textLines.length > 10) {
773
+ $$renderer2.push("<!--[0-->");
774
+ ExpandableContent($$renderer2, { content: segment.content, maxLines: 10 });
644
775
  } else {
645
- $$renderer2.push("<!--[!-->");
646
- if (isLocalCommand && commandData) {
647
- $$renderer2.push("<!--[-->");
648
- $$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> `);
649
- splitButton($$renderer2);
650
- $$renderer2.push(`<!----> `);
651
- deleteButton($$renderer2);
652
- $$renderer2.push(`<!----></div></div> `);
653
- if (commandData.message && commandData.message !== commandData.name?.slice(1)) {
654
- $$renderer2.push("<!--[-->");
655
- $$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(commandData.message)}</p>`);
656
- } else {
657
- $$renderer2.push("<!--[!-->");
658
- }
659
- $$renderer2.push(`<!--]--></div>`);
660
- } else {
661
- $$renderer2.push("<!--[!-->");
662
- if (toolUseData) {
663
- $$renderer2.push("<!--[-->");
664
- $$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> `);
665
- splitButton($$renderer2);
666
- $$renderer2.push(`<!----> `);
667
- deleteButton($$renderer2);
668
- $$renderer2.push(`<!----></div></div> `);
669
- if (toolUseData.filePath) {
670
- $$renderer2.push("<!--[-->");
671
- await_block(
672
- $$renderer2,
673
- checkFileExists(toolUseData.filePath),
674
- () => {
675
- $$renderer2.push(`<span class="mt-1 text-sm text-gh-text-secondary font-mono">${escape_html(toolUseData.filePath.split("/").pop())}</span>`);
676
- },
677
- (exists) => {
678
- if (exists) {
679
- $$renderer2.push("<!--[-->");
680
- $$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>`);
681
- } else {
682
- $$renderer2.push("<!--[!-->");
683
- $$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>`);
684
- }
685
- $$renderer2.push(`<!--]-->`);
686
- }
687
- );
688
- $$renderer2.push(`<!--]-->`);
689
- } else {
690
- $$renderer2.push("<!--[!-->");
691
- if (toolUseData.input.command) {
692
- $$renderer2.push("<!--[-->");
693
- if (toolUseData.input.description) {
694
- $$renderer2.push("<!--[-->");
695
- $$renderer2.push(`<p class="mt-1 text-sm text-gh-text-secondary">${escape_html(toolUseData.input.description)}</p>`);
696
- } else {
697
- $$renderer2.push("<!--[!-->");
698
- }
699
- $$renderer2.push(`<!--]--> `);
700
- ExpandableContent($$renderer2, {
701
- content: String(toolUseData.input.command),
702
- lang: "sh",
703
- maxLines: 3
704
- });
705
- $$renderer2.push(`<!---->`);
706
- } else {
707
- $$renderer2.push("<!--[!-->");
708
- const { path: _path, ...input } = toolUseData.input;
709
- const keys = Object.keys(input);
710
- if (keys.length === 1) {
711
- $$renderer2.push("<!--[-->");
712
- const key = keys[0];
713
- const value = input[key];
714
- $$renderer2.push(`${escape_html((() => {
715
- console.info(`${key} =`, value);
716
- return "";
717
- })())} `);
718
- if (key === "todos" && Array.isArray(value)) {
719
- $$renderer2.push("<!--[-->");
720
- TodoItem($$renderer2, { todos: value });
721
- } else {
722
- $$renderer2.push("<!--[!-->");
723
- ExpandableContent($$renderer2, {
724
- content: `${key} = ${JSON.stringify(value, null, 2)}`,
725
- lang: "js",
726
- maxLines: 1
727
- });
728
- }
729
- $$renderer2.push(`<!--]-->`);
730
- } else {
731
- $$renderer2.push("<!--[!-->");
732
- ExpandableContent($$renderer2, {
733
- content: JSON.stringify(input, null, 2),
734
- lang: "json",
735
- maxLines: 6
736
- });
737
- }
738
- $$renderer2.push(`<!--]-->`);
739
- }
740
- $$renderer2.push(`<!--]-->`);
741
- }
742
- $$renderer2.push(`<!--]--></div>`);
743
- } else {
744
- $$renderer2.push("<!--[!-->");
745
- if (hasAnyContent) {
746
- $$renderer2.push("<!--[-->");
747
- $$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> `);
748
- if (isCustomTitle && onEditTitle) {
749
- $$renderer2.push("<!--[-->");
750
- TooltipButton($$renderer2, {
751
- class: "opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-gh-border text-xs",
752
- onclick: () => onEditTitle(msg),
753
- title: "Edit title",
754
- children: ($$renderer3) => {
755
- $$renderer3.push(`<!---->✏️`);
756
- },
757
- $$slots: { default: true }
758
- });
759
- } else {
760
- $$renderer2.push("<!--[!-->");
761
- }
762
- $$renderer2.push(`<!--]--> `);
763
- splitButton($$renderer2);
764
- $$renderer2.push(`<!----> `);
765
- deleteButton($$renderer2);
766
- $$renderer2.push(`<!----></div></div> `);
767
- if (thinkingBlocks.length > 0) {
768
- $$renderer2.push("<!--[-->");
769
- $$renderer2.push(`<div class="message-content text-sm"><!--[-->`);
770
- const each_array_3 = ensure_array_like(thinkingBlocks);
771
- for (let i = 0, $$length = each_array_3.length; i < $$length; i++) {
772
- let block = each_array_3[i];
773
- $$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>`);
774
- }
775
- $$renderer2.push(`<!--]--></div>`);
776
- } else {
777
- $$renderer2.push("<!--[!-->");
778
- }
779
- $$renderer2.push(`<!--]--> `);
780
- if (hasContent) {
781
- $$renderer2.push("<!--[-->");
782
- $$renderer2.push(`<div class="message-content text-sm">`);
783
- if (isCustomTitle) {
784
- $$renderer2.push("<!--[-->");
785
- $$renderer2.push(`<span class="font-semibold text-purple-400">${escape_html(customTitle)}</span>`);
786
- } else {
787
- $$renderer2.push("<!--[!-->");
788
- const msgContent = getMessageContent(msg);
789
- const segments = parseIdeTags(msgContent);
790
- $$renderer2.push(`<!--[-->`);
791
- const each_array_4 = ensure_array_like(segments);
792
- for (let $$index_4 = 0, $$length = each_array_4.length; $$index_4 < $$length; $$index_4++) {
793
- let segment = each_array_4[$$index_4];
794
- if (segment.type === "ide_tag" && segment.tag) {
795
- $$renderer2.push("<!--[-->");
796
- IdeTag($$renderer2, { tag: segment.tag, content: segment.content });
797
- } else {
798
- $$renderer2.push("<!--[!-->");
799
- const textLines = segment.content.split("\n");
800
- if (textLines.length > 10) {
801
- $$renderer2.push("<!--[-->");
802
- ExpandableContent($$renderer2, { content: segment.content, maxLines: 10 });
803
- } else {
804
- $$renderer2.push("<!--[!-->");
805
- $$renderer2.push(`<p class="whitespace-pre-wrap">${escape_html(segment.content)}</p>`);
806
- }
807
- $$renderer2.push(`<!--]-->`);
808
- }
809
- $$renderer2.push(`<!--]-->`);
810
- }
811
- $$renderer2.push(`<!--]-->`);
812
- }
813
- $$renderer2.push(`<!--]--></div>`);
814
- } else {
815
- $$renderer2.push("<!--[!-->");
816
- }
817
- $$renderer2.push(`<!--]--></div>`);
818
- } else {
819
- $$renderer2.push("<!--[!-->");
820
- }
821
- $$renderer2.push(`<!--]-->`);
822
- }
823
- $$renderer2.push(`<!--]-->`);
824
- }
825
- $$renderer2.push(`<!--]-->`);
776
+ $$renderer2.push("<!--[-1-->");
777
+ $$renderer2.push(`<p class="whitespace-pre-wrap">${escape_html(segment.content)}</p>`);
826
778
  }
827
779
  $$renderer2.push(`<!--]-->`);
828
780
  }
@@ -830,9 +782,13 @@ function MessageItem($$renderer, $$props) {
830
782
  }
831
783
  $$renderer2.push(`<!--]-->`);
832
784
  }
833
- $$renderer2.push(`<!--]-->`);
785
+ $$renderer2.push(`<!--]--></div>`);
786
+ } else {
787
+ $$renderer2.push("<!--[-1-->");
834
788
  }
835
- $$renderer2.push(`<!--]-->`);
789
+ $$renderer2.push(`<!--]--></div>`);
790
+ } else {
791
+ $$renderer2.push("<!--[-1-->");
836
792
  }
837
793
  $$renderer2.push(`<!--]-->`);
838
794
  });
@@ -848,7 +804,7 @@ function MessageList($$renderer, $$props) {
848
804
  enableScroll = true,
849
805
  fullWidth = false
850
806
  } = $$props;
851
- const firstMeaningfulIndex = messages.findIndex((m) => m.type === "user" || m.type === "assistant" || m.type === "human");
807
+ const firstMeaningfulIndex = derived(() => messages.findIndex((m) => m.type === "user" || m.type === "assistant" || m.type === "human"));
852
808
  $$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`)}><!--[-->`);
853
809
  const each_array = ensure_array_like(messages);
854
810
  for (let i = 0, $$length = each_array.length; i < $$length; i++) {
@@ -856,7 +812,7 @@ function MessageList($$renderer, $$props) {
856
812
  MessageItem($$renderer2, {
857
813
  msg,
858
814
  sessionId,
859
- isFirst: i === 0 || i === firstMeaningfulIndex,
815
+ isFirst: i === 0 || i === firstMeaningfulIndex(),
860
816
  onDelete: onDeleteMessage,
861
817
  onEditTitle,
862
818
  onSplit: onSplitSession
@@ -872,7 +828,7 @@ function FloatingTooltip($$renderer, $$props) {
872
828
  children($$renderer2);
873
829
  $$renderer2.push(`<!----></div> `);
874
830
  {
875
- $$renderer2.push("<!--[!-->");
831
+ $$renderer2.push("<!--[-1-->");
876
832
  }
877
833
  $$renderer2.push(`<!--]-->`);
878
834
  });
@@ -880,7 +836,7 @@ function FloatingTooltip($$renderer, $$props) {
880
836
  function CommandTitle($$renderer, $$props) {
881
837
  $$renderer.component(($$renderer2) => {
882
838
  let { title, class: className = "" } = $$props;
883
- const parsed = () => {
839
+ const parsed = derived(() => () => {
884
840
  if (!title.startsWith("/")) return null;
885
841
  const spaceIndex = title.indexOf(" ");
886
842
  if (spaceIndex === -1) return { command: title, args: "" };
@@ -888,19 +844,19 @@ function CommandTitle($$renderer, $$props) {
888
844
  command: title.slice(0, spaceIndex),
889
845
  args: title.slice(spaceIndex + 1)
890
846
  };
891
- };
892
- if (parsed()) {
893
- $$renderer2.push("<!--[-->");
894
- $$renderer2.push(`<span${attr_class(clsx(className))}><span class="text-gh-accent">${escape_html(parsed().command)}</span>`);
895
- if (parsed().args) {
896
- $$renderer2.push("<!--[-->");
897
- $$renderer2.push(` <span class="text-gh-text-secondary">${escape_html(parsed().args)}</span>`);
847
+ });
848
+ if (parsed()()) {
849
+ $$renderer2.push("<!--[0-->");
850
+ $$renderer2.push(`<span${attr_class(clsx(className))}><span class="text-gh-accent">${escape_html(parsed()().command)}</span>`);
851
+ if (parsed()().args) {
852
+ $$renderer2.push("<!--[0-->");
853
+ $$renderer2.push(` <span class="text-gh-text-secondary">${escape_html(parsed()().args)}</span>`);
898
854
  } else {
899
- $$renderer2.push("<!--[!-->");
855
+ $$renderer2.push("<!--[-1-->");
900
856
  }
901
857
  $$renderer2.push(`<!--]--></span>`);
902
858
  } else {
903
- $$renderer2.push("<!--[!-->");
859
+ $$renderer2.push("<!--[-1-->");
904
860
  $$renderer2.push(`<span${attr_class(clsx(className))}>${escape_html(title)}</span>`);
905
861
  }
906
862
  $$renderer2.push(`<!--]-->`);
@@ -974,14 +930,14 @@ function ProjectTree($$renderer, $$props) {
974
930
  }
975
931
  return tooltip;
976
932
  };
977
- const sortedProjects = sortProjects(projects, {
933
+ const sortedProjects = derived(() => sortProjects(projects, {
978
934
  currentProjectName: store_get($$store_subs ??= {}, "$appConfig", appConfig).currentProjectName,
979
935
  homeDir: store_get($$store_subs ??= {}, "$appConfig", appConfig).homeDir
980
- });
936
+ }));
981
937
  let expandedSessions = selectedSession ? /* @__PURE__ */ new Set([selectedSession.id]) : /* @__PURE__ */ new Set();
982
938
  let draggedSession = null;
983
939
  let dropTargetProject = null;
984
- $$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> `);
940
+ $$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> `);
985
941
  $$renderer2.select(
986
942
  {
987
943
  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",
@@ -1001,19 +957,19 @@ function ProjectTree($$renderer, $$props) {
1001
957
  }
1002
958
  );
1003
959
  $$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"><!--[-->`);
1004
- const each_array_1 = ensure_array_like(sortedProjects);
960
+ const each_array_1 = ensure_array_like(sortedProjects());
1005
961
  for (let $$index_5 = 0, $$length = each_array_1.length; $$index_5 < $$length; $$index_5++) {
1006
962
  let project = each_array_1[$$index_5];
1007
963
  const isDropTarget = dropTargetProject === project.name;
1008
964
  $$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> `);
1009
965
  if (expandedProjects.has(project.name)) {
1010
- $$renderer2.push("<!--[-->");
966
+ $$renderer2.push("<!--[0-->");
1011
967
  $$renderer2.push(`<ul class="bg-gh-bg">`);
1012
968
  if (loadingProject === project.name) {
1013
- $$renderer2.push("<!--[-->");
969
+ $$renderer2.push("<!--[0-->");
1014
970
  $$renderer2.push(`<li class="py-2 px-8 text-gh-text-secondary text-sm">Loading...</li>`);
1015
971
  } else {
1016
- $$renderer2.push("<!--[!-->");
972
+ $$renderer2.push("<!--[-1-->");
1017
973
  $$renderer2.push(`<!--[-->`);
1018
974
  const each_array_2 = ensure_array_like(projectSessions.get(project.name) ?? []);
1019
975
  for (let $$index_4 = 0, $$length2 = each_array_2.length; $$index_4 < $$length2; $$index_4++) {
@@ -1028,10 +984,10 @@ function ProjectTree($$renderer, $$props) {
1028
984
  const hasSubItems = hasSessionSubItems(session);
1029
985
  $$renderer2.push(`<li${attr_class(`relative border-t border-gh-border-subtle group ${stringify(isSelected ? "bg-gh-accent/20 border-l-3 border-l-gh-accent" : "")} ${stringify(isDragging ? "opacity-50" : "")}`)} draggable="true"><div class="flex items-center">`);
1030
986
  if (hasSubItems) {
1031
- $$renderer2.push("<!--[-->");
987
+ $$renderer2.push("<!--[0-->");
1032
988
  $$renderer2.push(`<button class="flex-shrink-0 w-5 h-8 flex items-center justify-center bg-transparent border-none cursor-pointer text-gh-text-secondary text-xs ml-1 z-10 relative"${attr("title", isExpanded ? "Collapse" : "Expand")}>${escape_html(isExpanded ? "▼" : "▶")}</button>`);
1033
989
  } else {
1034
- $$renderer2.push("<!--[!-->");
990
+ $$renderer2.push("<!--[-1-->");
1035
991
  $$renderer2.push(`<span class="w-5 ml-1"></span>`);
1036
992
  }
1037
993
  $$renderer2.push(`<!--]--> `);
@@ -1043,24 +999,24 @@ function ProjectTree($$renderer, $$props) {
1043
999
  CommandTitle($$renderer3, { title: displayTitle });
1044
1000
  $$renderer3.push(`<!----></span> <span class="flex-shrink-0 flex items-center gap-2 text-xs text-gh-text-secondary"><span class="flex items-center gap-0.5"><span>${escape_html(TREE_ICONS.session.emoji)}</span><span>${escape_html(session.messageCount)}</span></span> `);
1045
1001
  if (sessionInfo.agents > 0) {
1046
- $$renderer3.push("<!--[-->");
1002
+ $$renderer3.push("<!--[0-->");
1047
1003
  $$renderer3.push(`<span class="flex items-center gap-0.5"><span>${escape_html(TREE_ICONS.agent.emoji)}</span><span>${escape_html(sessionInfo.agents)}</span></span>`);
1048
1004
  } else {
1049
- $$renderer3.push("<!--[!-->");
1005
+ $$renderer3.push("<!--[-1-->");
1050
1006
  }
1051
1007
  $$renderer3.push(`<!--]--> `);
1052
1008
  if (sessionInfo.todos > 0) {
1053
- $$renderer3.push("<!--[-->");
1009
+ $$renderer3.push("<!--[0-->");
1054
1010
  $$renderer3.push(`<span class="flex items-center gap-0.5"><span>${escape_html(TREE_ICONS["todos-group"].emoji)}</span><span>${escape_html(sessionInfo.todos)}</span></span>`);
1055
1011
  } else {
1056
- $$renderer3.push("<!--[!-->");
1012
+ $$renderer3.push("<!--[-1-->");
1057
1013
  }
1058
1014
  $$renderer3.push(`<!--]--></span></button>`);
1059
1015
  }
1060
1016
  });
1061
1017
  $$renderer2.push(`<!----> <div class="absolute right-0 top-0 h-full flex items-center gap-0.5 pr-2 opacity-0 group-hover:opacity-100 transition-opacity bg-gh-bg">`);
1062
1018
  if (onResumeSession) {
1063
- $$renderer2.push("<!--[-->");
1019
+ $$renderer2.push("<!--[0-->");
1064
1020
  TooltipButton($$renderer2, {
1065
1021
  class: "p-1 rounded hover:bg-gh-green/20 text-xs",
1066
1022
  onclick: (e) => onResumeSession(e, session),
@@ -1071,7 +1027,7 @@ function ProjectTree($$renderer, $$props) {
1071
1027
  $$slots: { default: true }
1072
1028
  });
1073
1029
  } else {
1074
- $$renderer2.push("<!--[!-->");
1030
+ $$renderer2.push("<!--[-1-->");
1075
1031
  }
1076
1032
  $$renderer2.push(`<!--]--> `);
1077
1033
  TooltipButton($$renderer2, {
@@ -1095,37 +1051,37 @@ function ProjectTree($$renderer, $$props) {
1095
1051
  });
1096
1052
  $$renderer2.push(`<!----></div></div> `);
1097
1053
  if (isExpanded && hasSubItems) {
1098
- $$renderer2.push("<!--[-->");
1054
+ $$renderer2.push("<!--[0-->");
1099
1055
  $$renderer2.push(`<ul class="bg-gh-bg-secondary/50 border-t border-gh-border-subtle text-xs">`);
1100
1056
  if (data?.summaries && data.summaries.length > 0) {
1101
- $$renderer2.push("<!--[-->");
1057
+ $$renderer2.push("<!--[0-->");
1102
1058
  $$renderer2.push(`<!--[-->`);
1103
1059
  const each_array_3 = ensure_array_like(data.summaries);
1104
1060
  for (let idx = 0, $$length3 = each_array_3.length; idx < $$length3; idx++) {
1105
1061
  let summary = each_array_3[idx];
1106
1062
  $$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">${escape_html(TREE_ICONS.summary.emoji)}</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> `);
1107
1063
  if (summary.timestamp) {
1108
- $$renderer2.push("<!--[-->");
1064
+ $$renderer2.push("<!--[0-->");
1109
1065
  $$renderer2.push(`<span class="pl-6 text-[10px] text-gh-text-secondary/70">${escape_html(new Date(summary.timestamp).toLocaleString())}</span>`);
1110
1066
  } else {
1111
- $$renderer2.push("<!--[!-->");
1067
+ $$renderer2.push("<!--[-1-->");
1112
1068
  }
1113
1069
  $$renderer2.push(`<!--]--></li>`);
1114
1070
  }
1115
1071
  $$renderer2.push(`<!--]-->`);
1116
1072
  } else {
1117
- $$renderer2.push("<!--[!-->");
1073
+ $$renderer2.push("<!--[-1-->");
1118
1074
  }
1119
1075
  $$renderer2.push(`<!--]--> `);
1120
1076
  if (data?.todos?.sessionTodos && data.todos.sessionTodos.length > 0) {
1121
- $$renderer2.push("<!--[-->");
1077
+ $$renderer2.push("<!--[0-->");
1122
1078
  $$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">${escape_html(TREE_ICONS["todos-group"].emoji)}</span> <span>Session Todos (${escape_html(data.todos.sessionTodos.length)})</span></li>`);
1123
1079
  } else {
1124
- $$renderer2.push("<!--[!-->");
1080
+ $$renderer2.push("<!--[-1-->");
1125
1081
  }
1126
1082
  $$renderer2.push(`<!--]--> `);
1127
1083
  if (data?.todos?.agentTodos) {
1128
- $$renderer2.push("<!--[-->");
1084
+ $$renderer2.push("<!--[0-->");
1129
1085
  $$renderer2.push(`<!--[-->`);
1130
1086
  const each_array_4 = ensure_array_like(data.todos.agentTodos);
1131
1087
  for (let $$index_2 = 0, $$length3 = each_array_4.length; $$index_2 < $$length3; $$index_2++) {
@@ -1134,11 +1090,11 @@ function ProjectTree($$renderer, $$props) {
1134
1090
  }
1135
1091
  $$renderer2.push(`<!--]-->`);
1136
1092
  } else {
1137
- $$renderer2.push("<!--[!-->");
1093
+ $$renderer2.push("<!--[-1-->");
1138
1094
  }
1139
1095
  $$renderer2.push(`<!--]--> `);
1140
1096
  if (data?.agents && data.agents.length > 0) {
1141
- $$renderer2.push("<!--[-->");
1097
+ $$renderer2.push("<!--[0-->");
1142
1098
  $$renderer2.push(`<!--[-->`);
1143
1099
  const each_array_5 = ensure_array_like(data.agents);
1144
1100
  for (let $$index_3 = 0, $$length3 = each_array_5.length; $$index_3 < $$length3; $$index_3++) {
@@ -1147,11 +1103,11 @@ function ProjectTree($$renderer, $$props) {
1147
1103
  }
1148
1104
  $$renderer2.push(`<!--]-->`);
1149
1105
  } else {
1150
- $$renderer2.push("<!--[!-->");
1106
+ $$renderer2.push("<!--[-1-->");
1151
1107
  }
1152
1108
  $$renderer2.push(`<!--]--></ul>`);
1153
1109
  } else {
1154
- $$renderer2.push("<!--[!-->");
1110
+ $$renderer2.push("<!--[-1-->");
1155
1111
  }
1156
1112
  $$renderer2.push(`<!--]--></li>`);
1157
1113
  }
@@ -1159,7 +1115,7 @@ function ProjectTree($$renderer, $$props) {
1159
1115
  }
1160
1116
  $$renderer2.push(`<!--]--></ul>`);
1161
1117
  } else {
1162
- $$renderer2.push("<!--[!-->");
1118
+ $$renderer2.push("<!--[-1-->");
1163
1119
  }
1164
1120
  $$renderer2.push(`<!--]--></li>`);
1165
1121
  }
@@ -1172,14 +1128,14 @@ function ScrollButtons($$renderer, $$props) {
1172
1128
  let { messages, class: className = "" } = $$props;
1173
1129
  const buttonClass = "p-1.5 text-sm rounded border border-gh-border hover:bg-gh-border-subtle text-gh-text-secondary hover:text-gh-text transition-colors bg-gh-bg";
1174
1130
  if (messages.length > 0) {
1175
- $$renderer2.push("<!--[-->");
1131
+ $$renderer2.push("<!--[0-->");
1176
1132
  $$renderer2.push(`<div${attr_class(`flex gap-0.5 ${stringify(className)}`, "svelte-12kovyu")}><button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l7-7 7 7M5 19l7-7 7 7"></path></svg> <span class="tooltip svelte-12kovyu">Top</span></button> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path></svg> <span class="tooltip svelte-12kovyu">Previous user message</span></button> `);
1177
1133
  {
1178
- $$renderer2.push("<!--[!-->");
1134
+ $$renderer2.push("<!--[-1-->");
1179
1135
  }
1180
1136
  $$renderer2.push(`<!--]--> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9l7 7 7-7"></path></svg> <span class="tooltip svelte-12kovyu">Next user message</span></button> <button${attr_class(`nav-btn ${stringify(buttonClass)}`, "svelte-12kovyu")}><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5l7 7 7-7M5 13l7 7 7-7"></path></svg> <span class="tooltip svelte-12kovyu">Bottom</span></button></div>`);
1181
1137
  } else {
1182
- $$renderer2.push("<!--[!-->");
1138
+ $$renderer2.push("<!--[-1-->");
1183
1139
  }
1184
1140
  $$renderer2.push(`<!--]-->`);
1185
1141
  });
@@ -1193,82 +1149,82 @@ function ValidationBadge($$renderer, $$props) {
1193
1149
  onRepair,
1194
1150
  onRepairProgress
1195
1151
  } = $$props;
1196
- const filteredChainErrors = chainErrors.filter((e) => e.type === "broken_chain" || e.type === "orphan_parent");
1197
- const hasChainErrors = filteredChainErrors.length > 0;
1198
- const hasProgressErrors = progressErrors.length > 0;
1199
- if (hasChainErrors) {
1200
- $$renderer2.push("<!--[-->");
1152
+ const filteredChainErrors = derived(() => chainErrors.filter((e) => e.type === "broken_chain" || e.type === "orphan_parent"));
1153
+ const hasChainErrors = derived(() => filteredChainErrors().length > 0);
1154
+ const hasProgressErrors = derived(() => progressErrors.length > 0);
1155
+ if (hasChainErrors()) {
1156
+ $$renderer2.push("<!--[0-->");
1201
1157
  $$renderer2.push(`<div class="relative group">`);
1202
1158
  if (onRepair) {
1203
- $$renderer2.push("<!--[-->");
1159
+ $$renderer2.push("<!--[0-->");
1204
1160
  $$renderer2.push(`<button class="text-xs px-2 py-0.5 rounded bg-red-900/30 text-red-400 border border-red-700 hover:bg-red-900/50 transition-colors flex items-center gap-1"${attr("disabled", isRepairing, true)}>`);
1205
1161
  if (isRepairing) {
1206
- $$renderer2.push("<!--[-->");
1162
+ $$renderer2.push("<!--[0-->");
1207
1163
  $$renderer2.push(`<span class="animate-spin">⟳</span>`);
1208
1164
  } else {
1209
- $$renderer2.push("<!--[!-->");
1165
+ $$renderer2.push("<!--[-1-->");
1210
1166
  $$renderer2.push(`⚠️`);
1211
1167
  }
1212
- $$renderer2.push(`<!--]--> ${escape_html(filteredChainErrors.length)} chain error${escape_html(filteredChainErrors.length > 1 ? "s" : "")} `);
1168
+ $$renderer2.push(`<!--]--> ${escape_html(filteredChainErrors().length)} chain error${escape_html(filteredChainErrors().length > 1 ? "s" : "")} `);
1213
1169
  if (!isRepairing) {
1214
- $$renderer2.push("<!--[-->");
1170
+ $$renderer2.push("<!--[0-->");
1215
1171
  $$renderer2.push(`- Repair`);
1216
1172
  } else {
1217
- $$renderer2.push("<!--[!-->");
1173
+ $$renderer2.push("<!--[-1-->");
1218
1174
  }
1219
1175
  $$renderer2.push(`<!--]--></button>`);
1220
1176
  } else {
1221
- $$renderer2.push("<!--[!-->");
1222
- $$renderer2.push(`<span class="text-xs px-2 py-0.5 rounded bg-red-900/30 text-red-400 border border-red-700">⚠️ ${escape_html(filteredChainErrors.length)} chain error${escape_html(filteredChainErrors.length > 1 ? "s" : "")}</span>`);
1177
+ $$renderer2.push("<!--[-1-->");
1178
+ $$renderer2.push(`<span class="text-xs px-2 py-0.5 rounded bg-red-900/30 text-red-400 border border-red-700">⚠️ ${escape_html(filteredChainErrors().length)} chain error${escape_html(filteredChainErrors().length > 1 ? "s" : "")}</span>`);
1223
1179
  }
1224
1180
  $$renderer2.push(`<!--]--> <div class="absolute left-0 top-full mt-1 z-50 hidden group-hover:block bg-gh-bg border border-gh-border rounded-lg shadow-xl p-2 min-w-[250px] max-w-[400px]"><div class="text-xs text-gh-text-secondary mb-1">Chain errors:</div> <ul class="text-xs space-y-1"><!--[-->`);
1225
- const each_array = ensure_array_like(filteredChainErrors);
1181
+ const each_array = ensure_array_like(filteredChainErrors());
1226
1182
  for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
1227
1183
  let error = each_array[$$index];
1228
1184
  $$renderer2.push(`<li class="text-red-400"><span class="text-gh-text-secondary">L${escape_html(error.line)}:</span> ${escape_html(error.type === "broken_chain" ? "Broken chain (null parentUuid)" : "Orphan parent")} `);
1229
1185
  if (error.type === "orphan_parent" && error.parentUuid) {
1230
- $$renderer2.push("<!--[-->");
1186
+ $$renderer2.push("<!--[0-->");
1231
1187
  $$renderer2.push(`<span class="text-gh-text-secondary">→ ${escape_html(error.parentUuid.slice(0, 8))}...</span>`);
1232
1188
  } else {
1233
- $$renderer2.push("<!--[!-->");
1189
+ $$renderer2.push("<!--[-1-->");
1234
1190
  }
1235
1191
  $$renderer2.push(`<!--]--></li>`);
1236
1192
  }
1237
1193
  $$renderer2.push(`<!--]--></ul> `);
1238
1194
  if (onRepair) {
1239
- $$renderer2.push("<!--[-->");
1195
+ $$renderer2.push("<!--[0-->");
1240
1196
  $$renderer2.push(`<div class="text-xs text-gh-text-secondary mt-2 pt-1 border-t border-gh-border">Click to auto-repair by linking to previous message</div>`);
1241
1197
  } else {
1242
- $$renderer2.push("<!--[!-->");
1198
+ $$renderer2.push("<!--[-1-->");
1243
1199
  }
1244
1200
  $$renderer2.push(`<!--]--></div></div>`);
1245
1201
  } else {
1246
- $$renderer2.push("<!--[!-->");
1202
+ $$renderer2.push("<!--[-1-->");
1247
1203
  }
1248
1204
  $$renderer2.push(`<!--]--> `);
1249
- if (hasProgressErrors) {
1250
- $$renderer2.push("<!--[-->");
1205
+ if (hasProgressErrors()) {
1206
+ $$renderer2.push("<!--[0-->");
1251
1207
  $$renderer2.push(`<div class="relative group">`);
1252
1208
  if (onRepairProgress) {
1253
- $$renderer2.push("<!--[-->");
1209
+ $$renderer2.push("<!--[0-->");
1254
1210
  $$renderer2.push(`<button class="text-xs px-2 py-0.5 rounded bg-red-900/30 text-red-400 border border-red-700 hover:bg-red-900/50 transition-colors flex items-center gap-1"${attr("disabled", isRepairing, true)}>`);
1255
1211
  if (isRepairing) {
1256
- $$renderer2.push("<!--[-->");
1212
+ $$renderer2.push("<!--[0-->");
1257
1213
  $$renderer2.push(`<span class="animate-spin">⟳</span>`);
1258
1214
  } else {
1259
- $$renderer2.push("<!--[!-->");
1215
+ $$renderer2.push("<!--[-1-->");
1260
1216
  $$renderer2.push(`⚠️`);
1261
1217
  }
1262
1218
  $$renderer2.push(`<!--]--> ${escape_html(progressErrors.length)} progress `);
1263
1219
  if (!isRepairing) {
1264
- $$renderer2.push("<!--[-->");
1220
+ $$renderer2.push("<!--[0-->");
1265
1221
  $$renderer2.push(`- Remove`);
1266
1222
  } else {
1267
- $$renderer2.push("<!--[!-->");
1223
+ $$renderer2.push("<!--[-1-->");
1268
1224
  }
1269
1225
  $$renderer2.push(`<!--]--></button>`);
1270
1226
  } else {
1271
- $$renderer2.push("<!--[!-->");
1227
+ $$renderer2.push("<!--[-1-->");
1272
1228
  $$renderer2.push(`<span class="text-xs px-2 py-0.5 rounded bg-red-900/30 text-red-400 border border-red-700">⚠️ ${escape_html(progressErrors.length)} progress</span>`);
1273
1229
  }
1274
1230
  $$renderer2.push(`<!--]--> <div class="absolute left-0 top-full mt-1 z-50 hidden group-hover:block bg-gh-bg border border-gh-border rounded-lg shadow-xl p-2 min-w-[200px] max-w-[350px]"><div class="text-xs text-gh-text-secondary mb-1">Progress messages (should be removed):</div> <ul class="text-xs space-y-1"><!--[-->`);
@@ -1279,14 +1235,14 @@ function ValidationBadge($$renderer, $$props) {
1279
1235
  }
1280
1236
  $$renderer2.push(`<!--]--></ul> `);
1281
1237
  if (onRepairProgress) {
1282
- $$renderer2.push("<!--[-->");
1238
+ $$renderer2.push("<!--[0-->");
1283
1239
  $$renderer2.push(`<div class="text-xs text-gh-text-secondary mt-2 pt-1 border-t border-gh-border">Click to remove all progress messages</div>`);
1284
1240
  } else {
1285
- $$renderer2.push("<!--[!-->");
1241
+ $$renderer2.push("<!--[-1-->");
1286
1242
  }
1287
1243
  $$renderer2.push(`<!--]--></div></div>`);
1288
1244
  } else {
1289
- $$renderer2.push("<!--[!-->");
1245
+ $$renderer2.push("<!--[-1-->");
1290
1246
  }
1291
1247
  $$renderer2.push(`<!--]-->`);
1292
1248
  });
@@ -1307,11 +1263,12 @@ function SessionViewer($$renderer, $$props) {
1307
1263
  onEditTitle,
1308
1264
  onSplitSession,
1309
1265
  enableScroll = true,
1266
+ externalScrollContainer = null,
1310
1267
  fullWidth = false
1311
1268
  } = $$props;
1312
- const displayTitle = getDisplayTitle(customTitle, currentSummary, session?.title, 50);
1313
- const chainResult = validateChain(messages);
1314
- const progressResult = validateProgressMessages(messages);
1269
+ const displayTitle = derived(() => getDisplayTitle(customTitle, currentSummary, session?.title, 50));
1270
+ const chainResult = derived(() => validateChain(messages));
1271
+ const progressResult = derived(() => validateProgressMessages(messages));
1315
1272
  let isRepairing = false;
1316
1273
  const handleRepairChain = async () => {
1317
1274
  if (!session || isRepairing) return;
@@ -1331,7 +1288,7 @@ function SessionViewer($$renderer, $$props) {
1331
1288
  if (!session || isRepairing) return;
1332
1289
  isRepairing = true;
1333
1290
  try {
1334
- for (const error of progressResult.errors) {
1291
+ for (const error of progressResult().errors) {
1335
1292
  const msg = messages[error.line - 1];
1336
1293
  if (msg?.uuid) {
1337
1294
  await deleteMessage(session.projectName, session.id, msg.uuid);
@@ -1395,39 +1352,41 @@ function SessionViewer($$renderer, $$props) {
1395
1352
  const handleSessionMessageDelete = (msg) => {
1396
1353
  handleMessageDeleteWithUndo(msg, false);
1397
1354
  };
1355
+ let internalScrollContainer = void 0;
1356
+ const scrollContainer = derived(() => externalScrollContainer ?? internalScrollContainer);
1398
1357
  $$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">`);
1399
1358
  if (backUrl) {
1400
- $$renderer2.push("<!--[-->");
1359
+ $$renderer2.push("<!--[0-->");
1401
1360
  $$renderer2.push(`<a${attr("href", backUrl)} class="text-gh-muted hover:text-gh-fg flex-shrink-0" title="Back to project"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path></svg></a>`);
1402
1361
  } else {
1403
- $$renderer2.push("<!--[!-->");
1362
+ $$renderer2.push("<!--[-1-->");
1404
1363
  }
1405
1364
  $$renderer2.push(`<!--]--> <div class="flex-1 min-w-[200px]">`);
1406
1365
  if (session) {
1407
- $$renderer2.push("<!--[-->");
1366
+ $$renderer2.push("<!--[0-->");
1408
1367
  $$renderer2.push(`<h2 class="text-base font-semibold">`);
1409
- CommandTitle($$renderer2, { title: truncate(displayTitle, 50) });
1368
+ CommandTitle($$renderer2, { title: truncate(displayTitle(), 50) });
1410
1369
  $$renderer2.push(`<!----></h2> <div class="flex items-center gap-2 mt-1"><button class="text-xs text-gh-text-secondary font-mono hover:text-gh-accent hover:underline cursor-pointer bg-transparent border-none p-0 text-left" title="Open session file in VSCode">${escape_html(session.id)}</button> `);
1411
1370
  ValidationBadge($$renderer2, {
1412
- chainErrors: chainResult.errors,
1413
- progressErrors: progressResult.errors,
1371
+ chainErrors: chainResult().errors,
1372
+ progressErrors: progressResult().errors,
1414
1373
  isRepairing,
1415
1374
  onRepair: handleRepairChain,
1416
1375
  onRepairProgress: handleRepairProgress
1417
1376
  });
1418
1377
  $$renderer2.push(`<!----></div>`);
1419
1378
  } else {
1420
- $$renderer2.push("<!--[!-->");
1379
+ $$renderer2.push("<!--[-1-->");
1421
1380
  $$renderer2.push(`<h2 class="text-base font-semibold">Messages</h2>`);
1422
1381
  }
1423
1382
  $$renderer2.push(`<!--]--></div> `);
1424
1383
  {
1425
- $$renderer2.push("<!--[-->");
1426
- ScrollButtons($$renderer2, { messages });
1384
+ $$renderer2.push("<!--[0-->");
1385
+ ScrollButtons($$renderer2, { messages, scrollContainer: scrollContainer() });
1427
1386
  }
1428
1387
  $$renderer2.push(`<!--]--></div> `);
1429
1388
  if (session) {
1430
- $$renderer2.push("<!--[-->");
1389
+ $$renderer2.push("<!--[0-->");
1431
1390
  $$renderer2.push(`<div class="flex border-b border-gh-border bg-gh-bg overflow-x-auto"><div class="flex-1 flex justify-center"><button${attr_class(`px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap ${stringify(
1432
1391
  "text-gh-accent border-b-2 border-gh-accent"
1433
1392
  )}`)}>💬 Messages (${escape_html(messages.length)})</button> <!--[-->`);
@@ -1438,48 +1397,44 @@ function SessionViewer($$renderer, $$props) {
1438
1397
  }
1439
1398
  $$renderer2.push(`<!--]--></div> `);
1440
1399
  if (todos.length > 0) {
1441
- $$renderer2.push("<!--[-->");
1400
+ $$renderer2.push("<!--[0-->");
1442
1401
  $$renderer2.push(`<button${attr_class(`px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap ${stringify("text-gh-text-secondary hover:text-gh-text hover:bg-gh-border-subtle")}`)}>✅ Todos (${escape_html(todos.length)})</button>`);
1443
1402
  } else {
1444
- $$renderer2.push("<!--[!-->");
1403
+ $$renderer2.push("<!--[-1-->");
1445
1404
  }
1446
1405
  $$renderer2.push(`<!--]--></div>`);
1447
1406
  } else {
1448
- $$renderer2.push("<!--[!-->");
1407
+ $$renderer2.push("<!--[-1-->");
1449
1408
  }
1450
1409
  $$renderer2.push(`<!--]--> <div${attr_class(`flex-1 ${stringify(enableScroll ? "overflow-y-auto" : "")}`)}>`);
1451
1410
  if (!session) {
1452
- $$renderer2.push("<!--[-->");
1411
+ $$renderer2.push("<!--[0-->");
1453
1412
  $$renderer2.push(`<div class="flex items-center justify-center h-full text-gh-text-secondary">Select a session to view</div>`);
1454
1413
  } else {
1455
- $$renderer2.push("<!--[!-->");
1456
- {
1457
- $$renderer2.push("<!--[-->");
1458
- if (messages.length === 0) {
1459
- $$renderer2.push("<!--[-->");
1460
- $$renderer2.push(`<div class="flex items-center justify-center h-full text-gh-text-secondary">No messages</div>`);
1461
- } else {
1462
- $$renderer2.push("<!--[!-->");
1463
- MessageList($$renderer2, {
1464
- sessionId: session.id,
1465
- messages,
1466
- onDeleteMessage: handleSessionMessageDelete,
1467
- onEditTitle,
1468
- onSplitSession,
1469
- enableScroll: false,
1470
- fullWidth: true
1471
- });
1472
- }
1473
- $$renderer2.push(`<!--]-->`);
1414
+ $$renderer2.push("<!--[1-->");
1415
+ if (messages.length === 0) {
1416
+ $$renderer2.push("<!--[0-->");
1417
+ $$renderer2.push(`<div class="flex items-center justify-center h-full text-gh-text-secondary">No messages</div>`);
1418
+ } else {
1419
+ $$renderer2.push("<!--[-1-->");
1420
+ MessageList($$renderer2, {
1421
+ sessionId: session.id,
1422
+ messages,
1423
+ onDeleteMessage: handleSessionMessageDelete,
1424
+ onEditTitle,
1425
+ onSplitSession,
1426
+ enableScroll: false,
1427
+ fullWidth: true
1428
+ });
1474
1429
  }
1475
1430
  $$renderer2.push(`<!--]-->`);
1476
1431
  }
1477
1432
  $$renderer2.push(`<!--]--></div> `);
1478
1433
  if (undoStack.length > 0) {
1479
- $$renderer2.push("<!--[-->");
1434
+ $$renderer2.push("<!--[0-->");
1480
1435
  $$renderer2.push(`<div class="fixed bottom-4 left-1/2 -translate-x-1/2 bg-neutral-500/20 border border-neutral-600 rounded-lg shadow-2xl px-4 py-3 flex items-center gap-4 z-50 backdrop-blur-sm"><span class="text-sm text-white">${escape_html(undoStack.length === 1 ? "Message deleted" : `${undoStack.length} messages deleted`)}</span> <span class="text-xs text-gh-text-secondary tabular-nums">${escape_html(undoCountdown)}s</span> <button class="px-3 py-1 text-sm font-medium text-gh-accent hover:bg-gh-border-subtle rounded transition-colors">Undo</button> <button class="px-2 py-1 text-sm text-gh-text-secondary hover:text-gh-text hover:bg-gh-border-subtle rounded transition-colors" title="Dismiss (already deleted)">✕</button></div>`);
1481
1436
  } else {
1482
- $$renderer2.push("<!--[!-->");
1437
+ $$renderer2.push("<!--[-1-->");
1483
1438
  }
1484
1439
  $$renderer2.push(`<!--]--></section>`);
1485
1440
  });
@@ -1634,7 +1589,7 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
1634
1589
  loading = true;
1635
1590
  const result = await splitSession(currentProjectName, currentSessionId, msg.uuid);
1636
1591
  if (result.success && result.newSessionId) {
1637
- const sessionDataList = await expandProject(currentProjectName);
1592
+ const sessionDataList = await expandProject(currentProjectName, { field: sortField, order: sortOrder });
1638
1593
  const sessions = [];
1639
1594
  const dataMap = /* @__PURE__ */ new Map();
1640
1595
  for (const data of sessionDataList) {
@@ -1652,6 +1607,11 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
1652
1607
  projectSessions = new Map(projectSessions);
1653
1608
  projectSessionData.set(currentProjectName, dataMap);
1654
1609
  projectSessionData = new Map(projectSessionData);
1610
+ const project = projects.find((p) => p.name === currentProjectName);
1611
+ if (project) {
1612
+ project.sessionCount = sessions.length;
1613
+ projects = [...projects];
1614
+ }
1655
1615
  messages = messages.slice(msgIndex);
1656
1616
  const updatedSession = sessions.find((s) => s.id === currentSessionId);
1657
1617
  if (updatedSession) {
@@ -1750,17 +1710,17 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
1750
1710
  });
1751
1711
  $$renderer3.push(`<!----></div> `);
1752
1712
  if (loading) {
1753
- $$renderer3.push("<!--[-->");
1713
+ $$renderer3.push("<!--[0-->");
1754
1714
  $$renderer3.push(`<div class="fixed bottom-4 right-4 bg-gh-accent text-white px-4 py-2 rounded">Loading...</div>`);
1755
1715
  } else {
1756
- $$renderer3.push("<!--[!-->");
1716
+ $$renderer3.push("<!--[-1-->");
1757
1717
  }
1758
1718
  $$renderer3.push(`<!--]--> `);
1759
1719
  if (error) {
1760
- $$renderer3.push("<!--[-->");
1720
+ $$renderer3.push("<!--[0-->");
1761
1721
  $$renderer3.push(`<div class="fixed bottom-4 right-4 bg-gh-red text-white px-4 py-2 rounded">${escape_html(error)}</div>`);
1762
1722
  } else {
1763
- $$renderer3.push("<!--[!-->");
1723
+ $$renderer3.push("<!--[-1-->");
1764
1724
  }
1765
1725
  $$renderer3.push(`<!--]--> `);
1766
1726
  Toast($$renderer3, {
@@ -1802,4 +1762,4 @@ Old messages (${oldMessagesCount}) will be moved to a new session.`, async () =>
1802
1762
  }
1803
1763
 
1804
1764
  export { _page as default };
1805
- //# sourceMappingURL=_page.svelte-C1-T5LLg.js.map
1765
+ //# sourceMappingURL=_page.svelte-DSpIiljH.js.map