@gatanot/qualia_web 0.1.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 (224) hide show
  1. package/build/client/_app/immutable/assets/0.BlmLthUu.css +1 -0
  2. package/build/client/_app/immutable/assets/0.BlmLthUu.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.BlmLthUu.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/2.C6F1hpzI.css +1 -0
  5. package/build/client/_app/immutable/assets/2.C6F1hpzI.css.br +0 -0
  6. package/build/client/_app/immutable/assets/2.C6F1hpzI.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/3.D8sLuVpx.css +1 -0
  8. package/build/client/_app/immutable/assets/3.D8sLuVpx.css.br +0 -0
  9. package/build/client/_app/immutable/assets/3.D8sLuVpx.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/4.1xWrYHn4.css +1 -0
  11. package/build/client/_app/immutable/assets/4.1xWrYHn4.css.br +0 -0
  12. package/build/client/_app/immutable/assets/4.1xWrYHn4.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/5.K6sy6bnZ.css +1 -0
  14. package/build/client/_app/immutable/assets/5.K6sy6bnZ.css.br +0 -0
  15. package/build/client/_app/immutable/assets/5.K6sy6bnZ.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/ChatInput.CmxPxwkj.css +1 -0
  17. package/build/client/_app/immutable/assets/ChatInput.CmxPxwkj.css.br +0 -0
  18. package/build/client/_app/immutable/assets/ChatInput.CmxPxwkj.css.gz +0 -0
  19. package/build/client/_app/immutable/assets/KaTeX_AMS-Regular.BQhdFMY1.woff2 +0 -0
  20. package/build/client/_app/immutable/assets/KaTeX_AMS-Regular.DMm9YOAa.woff +0 -0
  21. package/build/client/_app/immutable/assets/KaTeX_AMS-Regular.DRggAlZN.ttf +0 -0
  22. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Bold.ATXxdsX0.ttf +0 -0
  23. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Bold.BEiXGLvX.woff +0 -0
  24. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 +0 -0
  25. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Regular.CTRA-rTL.woff +0 -0
  26. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 +0 -0
  27. package/build/client/_app/immutable/assets/KaTeX_Caligraphic-Regular.wX97UBjC.ttf +0 -0
  28. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Bold.BdnERNNW.ttf +0 -0
  29. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Bold.BsDP51OF.woff +0 -0
  30. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Bold.CL6g_b3V.woff2 +0 -0
  31. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Regular.CB_wures.ttf +0 -0
  32. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Regular.CTYiF6lA.woff2 +0 -0
  33. package/build/client/_app/immutable/assets/KaTeX_Fraktur-Regular.Dxdc4cR9.woff +0 -0
  34. package/build/client/_app/immutable/assets/KaTeX_Main-Bold.Cx986IdX.woff2 +0 -0
  35. package/build/client/_app/immutable/assets/KaTeX_Main-Bold.Jm3AIy58.woff +0 -0
  36. package/build/client/_app/immutable/assets/KaTeX_Main-Bold.waoOVXN0.ttf +0 -0
  37. package/build/client/_app/immutable/assets/KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 +0 -0
  38. package/build/client/_app/immutable/assets/KaTeX_Main-BoldItalic.DzxPMmG6.ttf +0 -0
  39. package/build/client/_app/immutable/assets/KaTeX_Main-BoldItalic.SpSLRI95.woff +0 -0
  40. package/build/client/_app/immutable/assets/KaTeX_Main-Italic.3WenGoN9.ttf +0 -0
  41. package/build/client/_app/immutable/assets/KaTeX_Main-Italic.BMLOBm91.woff +0 -0
  42. package/build/client/_app/immutable/assets/KaTeX_Main-Italic.NWA7e6Wa.woff2 +0 -0
  43. package/build/client/_app/immutable/assets/KaTeX_Main-Regular.B22Nviop.woff2 +0 -0
  44. package/build/client/_app/immutable/assets/KaTeX_Main-Regular.Dr94JaBh.woff +0 -0
  45. package/build/client/_app/immutable/assets/KaTeX_Main-Regular.ypZvNtVU.ttf +0 -0
  46. package/build/client/_app/immutable/assets/KaTeX_Math-BoldItalic.B3XSjfu4.ttf +0 -0
  47. package/build/client/_app/immutable/assets/KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 +0 -0
  48. package/build/client/_app/immutable/assets/KaTeX_Math-BoldItalic.iY-2wyZ7.woff +0 -0
  49. package/build/client/_app/immutable/assets/KaTeX_Math-Italic.DA0__PXp.woff +0 -0
  50. package/build/client/_app/immutable/assets/KaTeX_Math-Italic.flOr_0UB.ttf +0 -0
  51. package/build/client/_app/immutable/assets/KaTeX_Math-Italic.t53AETM-.woff2 +0 -0
  52. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Bold.CFMepnvq.ttf +0 -0
  53. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Bold.D1sUS0GD.woff2 +0 -0
  54. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Bold.DbIhKOiC.woff +0 -0
  55. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Italic.C3H0VqGB.woff2 +0 -0
  56. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Italic.DN2j7dab.woff +0 -0
  57. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Italic.YYjJ1zSn.ttf +0 -0
  58. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Regular.BNo7hRIc.ttf +0 -0
  59. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Regular.CS6fqUqJ.woff +0 -0
  60. package/build/client/_app/immutable/assets/KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 +0 -0
  61. package/build/client/_app/immutable/assets/KaTeX_Script-Regular.C5JkGWo-.ttf +0 -0
  62. package/build/client/_app/immutable/assets/KaTeX_Script-Regular.D3wIWfF6.woff2 +0 -0
  63. package/build/client/_app/immutable/assets/KaTeX_Script-Regular.D5yQViql.woff +0 -0
  64. package/build/client/_app/immutable/assets/KaTeX_Size1-Regular.C195tn64.woff +0 -0
  65. package/build/client/_app/immutable/assets/KaTeX_Size1-Regular.Dbsnue_I.ttf +0 -0
  66. package/build/client/_app/immutable/assets/KaTeX_Size1-Regular.mCD8mA8B.woff2 +0 -0
  67. package/build/client/_app/immutable/assets/KaTeX_Size2-Regular.B7gKUWhC.ttf +0 -0
  68. package/build/client/_app/immutable/assets/KaTeX_Size2-Regular.Dy4dx90m.woff2 +0 -0
  69. package/build/client/_app/immutable/assets/KaTeX_Size2-Regular.oD1tc_U0.woff +0 -0
  70. package/build/client/_app/immutable/assets/KaTeX_Size3-Regular.CTq5MqoE.woff +0 -0
  71. package/build/client/_app/immutable/assets/KaTeX_Size3-Regular.DgpXs0kz.ttf +0 -0
  72. package/build/client/_app/immutable/assets/KaTeX_Size4-Regular.BF-4gkZK.woff +0 -0
  73. package/build/client/_app/immutable/assets/KaTeX_Size4-Regular.DWFBv043.ttf +0 -0
  74. package/build/client/_app/immutable/assets/KaTeX_Size4-Regular.Dl5lxZxV.woff2 +0 -0
  75. package/build/client/_app/immutable/assets/KaTeX_Typewriter-Regular.C0xS9mPB.woff +0 -0
  76. package/build/client/_app/immutable/assets/KaTeX_Typewriter-Regular.CO6r4hn1.woff2 +0 -0
  77. package/build/client/_app/immutable/assets/KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf +0 -0
  78. package/build/client/_app/immutable/chunks/B39M1lOz.js +3 -0
  79. package/build/client/_app/immutable/chunks/B39M1lOz.js.br +0 -0
  80. package/build/client/_app/immutable/chunks/B39M1lOz.js.gz +0 -0
  81. package/build/client/_app/immutable/chunks/BMcRbUT8.js +3 -0
  82. package/build/client/_app/immutable/chunks/BMcRbUT8.js.br +0 -0
  83. package/build/client/_app/immutable/chunks/BMcRbUT8.js.gz +0 -0
  84. package/build/client/_app/immutable/chunks/BN2zEB6w.js +1 -0
  85. package/build/client/_app/immutable/chunks/BN2zEB6w.js.br +0 -0
  86. package/build/client/_app/immutable/chunks/BN2zEB6w.js.gz +0 -0
  87. package/build/client/_app/immutable/chunks/BVDlhZK_.js +1 -0
  88. package/build/client/_app/immutable/chunks/BVDlhZK_.js.br +2 -0
  89. package/build/client/_app/immutable/chunks/BVDlhZK_.js.gz +0 -0
  90. package/build/client/_app/immutable/chunks/CxmPiQW9.js +1 -0
  91. package/build/client/_app/immutable/chunks/CxmPiQW9.js.br +0 -0
  92. package/build/client/_app/immutable/chunks/CxmPiQW9.js.gz +0 -0
  93. package/build/client/_app/immutable/chunks/DAIlYrs_.js +1 -0
  94. package/build/client/_app/immutable/chunks/DAIlYrs_.js.br +0 -0
  95. package/build/client/_app/immutable/chunks/DAIlYrs_.js.gz +0 -0
  96. package/build/client/_app/immutable/chunks/Ir23lSxH.js +329 -0
  97. package/build/client/_app/immutable/chunks/Ir23lSxH.js.br +0 -0
  98. package/build/client/_app/immutable/chunks/Ir23lSxH.js.gz +0 -0
  99. package/build/client/_app/immutable/chunks/gZTJ0hjf.js +1 -0
  100. package/build/client/_app/immutable/chunks/gZTJ0hjf.js.br +0 -0
  101. package/build/client/_app/immutable/chunks/gZTJ0hjf.js.gz +0 -0
  102. package/build/client/_app/immutable/chunks/idCMFvY6.js +1 -0
  103. package/build/client/_app/immutable/chunks/idCMFvY6.js.br +2 -0
  104. package/build/client/_app/immutable/chunks/idCMFvY6.js.gz +0 -0
  105. package/build/client/_app/immutable/chunks/kNaey6uv.js +1 -0
  106. package/build/client/_app/immutable/chunks/kNaey6uv.js.br +0 -0
  107. package/build/client/_app/immutable/chunks/kNaey6uv.js.gz +0 -0
  108. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  109. package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
  110. package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
  111. package/build/client/_app/immutable/entry/app.CAKAEcgA.js +2 -0
  112. package/build/client/_app/immutable/entry/app.CAKAEcgA.js.br +0 -0
  113. package/build/client/_app/immutable/entry/app.CAKAEcgA.js.gz +0 -0
  114. package/build/client/_app/immutable/entry/start.BSM2k8tg.js +1 -0
  115. package/build/client/_app/immutable/entry/start.BSM2k8tg.js.br +0 -0
  116. package/build/client/_app/immutable/entry/start.BSM2k8tg.js.gz +0 -0
  117. package/build/client/_app/immutable/nodes/0.fnpvsEAN.js +1 -0
  118. package/build/client/_app/immutable/nodes/0.fnpvsEAN.js.br +0 -0
  119. package/build/client/_app/immutable/nodes/0.fnpvsEAN.js.gz +0 -0
  120. package/build/client/_app/immutable/nodes/1.CLtaTeie.js +1 -0
  121. package/build/client/_app/immutable/nodes/1.CLtaTeie.js.br +0 -0
  122. package/build/client/_app/immutable/nodes/1.CLtaTeie.js.gz +0 -0
  123. package/build/client/_app/immutable/nodes/2.BwxFyRtn.js +1 -0
  124. package/build/client/_app/immutable/nodes/2.BwxFyRtn.js.br +0 -0
  125. package/build/client/_app/immutable/nodes/2.BwxFyRtn.js.gz +0 -0
  126. package/build/client/_app/immutable/nodes/3.D2KZBL5g.js +4 -0
  127. package/build/client/_app/immutable/nodes/3.D2KZBL5g.js.br +0 -0
  128. package/build/client/_app/immutable/nodes/3.D2KZBL5g.js.gz +0 -0
  129. package/build/client/_app/immutable/nodes/4.B6LN5K9i.js +1 -0
  130. package/build/client/_app/immutable/nodes/4.B6LN5K9i.js.br +0 -0
  131. package/build/client/_app/immutable/nodes/4.B6LN5K9i.js.gz +0 -0
  132. package/build/client/_app/immutable/nodes/5.CVHYq0o4.js +10 -0
  133. package/build/client/_app/immutable/nodes/5.CVHYq0o4.js.br +0 -0
  134. package/build/client/_app/immutable/nodes/5.CVHYq0o4.js.gz +0 -0
  135. package/build/client/_app/version.json +1 -0
  136. package/build/client/_app/version.json.br +0 -0
  137. package/build/client/_app/version.json.gz +0 -0
  138. package/build/client/robots.txt +3 -0
  139. package/build/client/robots.txt.br +0 -0
  140. package/build/client/robots.txt.gz +0 -0
  141. package/build/env.js +70 -0
  142. package/build/env.js.map +1 -0
  143. package/build/handler.js +17 -0
  144. package/build/handler.js.map +1 -0
  145. package/build/index.js +140 -0
  146. package/build/index.js.map +1 -0
  147. package/build/server/chunks/0-CF_dr3E0.js +9 -0
  148. package/build/server/chunks/0-CF_dr3E0.js.map +1 -0
  149. package/build/server/chunks/1-CVoEVbhQ.js +9 -0
  150. package/build/server/chunks/1-CVoEVbhQ.js.map +1 -0
  151. package/build/server/chunks/2-BzhQC8cX.js +38 -0
  152. package/build/server/chunks/2-BzhQC8cX.js.map +1 -0
  153. package/build/server/chunks/3-CukYFw9L.js +9 -0
  154. package/build/server/chunks/3-CukYFw9L.js.map +1 -0
  155. package/build/server/chunks/4-4e_Gaah7.js +9 -0
  156. package/build/server/chunks/4-4e_Gaah7.js.map +1 -0
  157. package/build/server/chunks/5-B4fCEv4c.js +9 -0
  158. package/build/server/chunks/5-B4fCEv4c.js.map +1 -0
  159. package/build/server/chunks/ChatInput-GWTgCE1t.js +122 -0
  160. package/build/server/chunks/ChatInput-GWTgCE1t.js.map +1 -0
  161. package/build/server/chunks/_layout.svelte-MrMdtdjr.js +232 -0
  162. package/build/server/chunks/_layout.svelte-MrMdtdjr.js.map +1 -0
  163. package/build/server/chunks/_page.svelte-CfQFFres.js +64 -0
  164. package/build/server/chunks/_page.svelte-CfQFFres.js.map +1 -0
  165. package/build/server/chunks/_page.svelte-CgTaVEr0.js +189 -0
  166. package/build/server/chunks/_page.svelte-CgTaVEr0.js.map +1 -0
  167. package/build/server/chunks/_page.svelte-DEDJBB4D.js +602 -0
  168. package/build/server/chunks/_page.svelte-DEDJBB4D.js.map +1 -0
  169. package/build/server/chunks/_page.svelte-OC4xDCWu.js +67 -0
  170. package/build/server/chunks/_page.svelte-OC4xDCWu.js.map +1 -0
  171. package/build/server/chunks/_server.ts-BG3v883h.js +115 -0
  172. package/build/server/chunks/_server.ts-BG3v883h.js.map +1 -0
  173. package/build/server/chunks/_server.ts-C1hU_FnX.js +28 -0
  174. package/build/server/chunks/_server.ts-C1hU_FnX.js.map +1 -0
  175. package/build/server/chunks/_server.ts-CJOrsy4y.js +30 -0
  176. package/build/server/chunks/_server.ts-CJOrsy4y.js.map +1 -0
  177. package/build/server/chunks/_server.ts-Co2FAQm2.js +43 -0
  178. package/build/server/chunks/_server.ts-Co2FAQm2.js.map +1 -0
  179. package/build/server/chunks/_server.ts-D6NGuqud.js +106 -0
  180. package/build/server/chunks/_server.ts-D6NGuqud.js.map +1 -0
  181. package/build/server/chunks/_server.ts-DaHUgm60.js +26 -0
  182. package/build/server/chunks/_server.ts-DaHUgm60.js.map +1 -0
  183. package/build/server/chunks/_server.ts-DiHyx5ij.js +64 -0
  184. package/build/server/chunks/_server.ts-DiHyx5ij.js.map +1 -0
  185. package/build/server/chunks/_server.ts-GB-Qo389.js +73 -0
  186. package/build/server/chunks/_server.ts-GB-Qo389.js.map +1 -0
  187. package/build/server/chunks/_server.ts-K359HUPL.js +32 -0
  188. package/build/server/chunks/_server.ts-K359HUPL.js.map +1 -0
  189. package/build/server/chunks/_server.ts-e4VKCo3M.js +54 -0
  190. package/build/server/chunks/_server.ts-e4VKCo3M.js.map +1 -0
  191. package/build/server/chunks/_server.ts-nr6qwbTw.js +42 -0
  192. package/build/server/chunks/_server.ts-nr6qwbTw.js.map +1 -0
  193. package/build/server/chunks/chat-confirm-BW2aJ2qz.js +5 -0
  194. package/build/server/chunks/chat-confirm-BW2aJ2qz.js.map +1 -0
  195. package/build/server/chunks/chat-steering-DTefLITL.js +5 -0
  196. package/build/server/chunks/chat-steering-DTefLITL.js.map +1 -0
  197. package/build/server/chunks/client-BoLIct8q.js +69 -0
  198. package/build/server/chunks/client-BoLIct8q.js.map +1 -0
  199. package/build/server/chunks/config-d3FC8naq.js +4907 -0
  200. package/build/server/chunks/config-d3FC8naq.js.map +1 -0
  201. package/build/server/chunks/error.svelte-BpxjjtfZ.js +65 -0
  202. package/build/server/chunks/error.svelte-BpxjjtfZ.js.map +1 -0
  203. package/build/server/chunks/gateway-DWcUFfHo.js +478 -0
  204. package/build/server/chunks/gateway-DWcUFfHo.js.map +1 -0
  205. package/build/server/chunks/handler-BAQYBQgy.js +1454 -0
  206. package/build/server/chunks/handler-BAQYBQgy.js.map +1 -0
  207. package/build/server/chunks/hooks.server-C6heBR7o.js +35 -0
  208. package/build/server/chunks/hooks.server-C6heBR7o.js.map +1 -0
  209. package/build/server/chunks/index.js-N7Sh42pC.js +11584 -0
  210. package/build/server/chunks/index.js-N7Sh42pC.js.map +1 -0
  211. package/build/server/chunks/manifest.js-D2rH2GXr.js +143 -0
  212. package/build/server/chunks/manifest.js-D2rH2GXr.js.map +1 -0
  213. package/build/server/chunks/markdown-BYqQ8bKF.js +78593 -0
  214. package/build/server/chunks/markdown-BYqQ8bKF.js.map +1 -0
  215. package/build/server/chunks/prompts-tcGD1LCs.js +37 -0
  216. package/build/server/chunks/prompts-tcGD1LCs.js.map +1 -0
  217. package/build/server/chunks/session-store-B1Aop0Qn.js +50 -0
  218. package/build/server/chunks/session-store-B1Aop0Qn.js.map +1 -0
  219. package/build/server/chunks/stores-D_6JNTkz.js +36 -0
  220. package/build/server/chunks/stores-D_6JNTkz.js.map +1 -0
  221. package/build/shims.js +33 -0
  222. package/build/shims.js.map +1 -0
  223. package/handler.d.ts +8 -0
  224. package/package.json +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_page.svelte-DEDJBB4D.js","sources":["../../../.svelte-kit/output/server/entries/pages/chat/_sessionId_/_page.svelte.js"],"sourcesContent":["import { H as attr, U as escape_html, a as ensure_array_like, c as store_get, d as html, i as derived, n as attr_class, u as unsubscribe_stores } from \"../../../../chunks/dev.js\";\nimport { n as goto } from \"../../../../chunks/client.js\";\nimport { t as page } from \"../../../../chunks/stores.js\";\nimport \"../../../../chunks/navigation.js\";\nimport { a as pendingFirstImages, i as forkSession, n as bumpSession, o as pendingFirstMessage, t as activeWorkspace } from \"../../../../chunks/session-store.js\";\nimport \"../../../../chunks/model-picker-state.svelte.js\";\nimport { n as EmptyState, t as ChatInput } from \"../../../../chunks/ChatInput.js\";\nimport { t as renderMarkdown } from \"../../../../chunks/markdown.js\";\n//#region src/lib/components/ToolCallCard.svelte\nfunction ToolCallCard($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tlet { name, args, result = void 0 } = $$props;\n\t\tlet expanded = false;\n\t\tlet done = derived(() => !!result);\n\t\tlet errored = derived(() => result ? !result.success : false);\n\t\tlet summary = derived(() => {\n\t\t\tconst command = args.command;\n\t\t\tif (command) return command.length > 60 ? command.slice(0, 60) + \"…\" : command;\n\t\t\tconst keys = Object.keys(args);\n\t\t\tif (keys.length === 1) {\n\t\t\t\tconst v = String(args[keys[0]]);\n\t\t\t\treturn v.length > 60 ? v.slice(0, 60) + \"…\" : v;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t});\n\t\t$$renderer.push(`<div${attr_class(\"tool-call svelte-87mzaw\", void 0, {\n\t\t\t\"tool-done\": done(),\n\t\t\t\"expanded\": expanded\n\t\t})}><div class=\"tool-header svelte-87mzaw\"><span class=\"material-symbols-rounded tool-icon svelte-87mzaw\">${escape_html(errored() ? \"warning\" : done() ? \"check_circle\" : \"pending\")}</span> <div class=\"tool-summary svelte-87mzaw\"><span class=\"tool-name svelte-87mzaw\">${escape_html(name)}</span> `);\n\t\tif (summary() && true) {\n\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t$$renderer.push(`<span class=\"tool-command svelte-87mzaw\">${escape_html(summary())}</span>`);\n\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t$$renderer.push(`<!--]--></div> <span class=\"material-symbols-rounded expand-icon svelte-87mzaw\">${escape_html(\"expand_more\")}</span></div> `);\n\t\t$$renderer.push(\"<!--[-1-->\");\n\t\t$$renderer.push(`<!--]--></div>`);\n\t});\n}\n//#endregion\n//#region src/lib/components/ConfirmInline.svelte\nfunction ConfirmInline($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tlet { confirmId, message, onresolve } = $$props;\n\t\t$$renderer.push(`<div class=\"confirm-inline svelte-ovag81\"><div class=\"confirm-header svelte-ovag81\"><span class=\"material-symbols-rounded confirm-icon svelte-ovag81\">gavel</span> <span class=\"confirm-label svelte-ovag81\">需要确认操作</span></div> <p class=\"confirm-message svelte-ovag81\">${escape_html(message)}</p> <div class=\"confirm-actions svelte-ovag81\"><button class=\"btn btn-outline svelte-ovag81\">拒绝</button> <button class=\"btn btn-primary svelte-ovag81\">允许</button></div></div>`);\n\t});\n}\n//#endregion\n//#region src/lib/components/ReasoningBlock.svelte\nfunction ReasoningBlock($$renderer, $$props) {\n\tlet { content = \"\", done = false } = $$props;\n\t$$renderer.push(`<div${attr_class(\"reasoning svelte-1okjtiv\", void 0, {\n\t\t\"expanded\": false,\n\t\t\"done\": done\n\t})}><div class=\"reasoning-header svelte-1okjtiv\"><span class=\"reasoning-label svelte-1okjtiv\">Thought</span> `);\n\tif (!done) {\n\t\t$$renderer.push(\"<!--[0-->\");\n\t\t$$renderer.push(`<span class=\"reasoning-dot svelte-1okjtiv\">●</span>`);\n\t} else $$renderer.push(\"<!--[-1-->\");\n\t$$renderer.push(`<!--]--> <span class=\"material-symbols-rounded expand-icon svelte-1okjtiv\">${escape_html(\"expand_more\")}</span></div> `);\n\t$$renderer.push(\"<!--[-1-->\");\n\t$$renderer.push(`<!--]--></div>`);\n}\n//#endregion\n//#region src/lib/components/MessageBubble.svelte\nfunction MessageBubble($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tlet { message, onconfirm, onrecovery, onrollback, onfork } = $$props;\n\t\tlet roleLabel = derived(() => message.role === \"error\" ? \"错误\" : \"Qualia\");\n\t\tconst htmlCache = /* @__PURE__ */ new Map();\n\t\tlet rollbackConfirm = false;\n\t\tfunction getBlockHtml(content) {\n\t\t\tconst cached = htmlCache.get(content);\n\t\t\tif (cached) return cached;\n\t\t\tconst html = renderMarkdown(content);\n\t\t\thtmlCache.set(content, html);\n\t\t\treturn html;\n\t\t}\n\t\tfunction isLiveBlock(block, i) {\n\t\t\tif (block.type !== \"text\") return false;\n\t\t\tif (message.done) return false;\n\t\t\treturn i === message.blocks.length - 1;\n\t\t}\n\t\tfunction handleConfirm(confirmId, approved) {\n\t\t\tonconfirm?.(confirmId, approved);\n\t\t}\n\t\t$$renderer.push(`<div${attr_class(\"message-row svelte-1e5n1dp\", void 0, {\n\t\t\t\"user\": message.role === \"user\",\n\t\t\t\"error\": message.role === \"error\"\n\t\t})}><div class=\"message-body svelte-1e5n1dp\">`);\n\t\tif (message.role !== \"user\") {\n\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t$$renderer.push(`<div class=\"message-role svelte-1e5n1dp\">${escape_html(roleLabel())}</div>`);\n\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t$$renderer.push(`<!--]--> <!--[-->`);\n\t\tconst each_array = ensure_array_like(message.blocks);\n\t\tfor (let i = 0, $$length = each_array.length; i < $$length; i++) {\n\t\t\tlet block = each_array[i];\n\t\t\tif (block.type === \"text\") {\n\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\tif (isLiveBlock(block, i)) {\n\t\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t\t$$renderer.push(`<div class=\"message-content svelte-1e5n1dp\">${escape_html(block.content)}</div>`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(\"<!--[-1-->\");\n\t\t\t\t\t$$renderer.push(`<div class=\"message-content markdown-body svelte-1e5n1dp\">${html(getBlockHtml(block.content))}</div>`);\n\t\t\t\t}\n\t\t\t\t$$renderer.push(`<!--]-->`);\n\t\t\t} else if (block.type === \"image\") {\n\t\t\t\t$$renderer.push(\"<!--[1-->\");\n\t\t\t\t$$renderer.push(`<div class=\"image-block svelte-1e5n1dp\"><img${attr(\"src\", block.url)} alt=\"上传图片\" class=\"svelte-1e5n1dp\"/></div>`);\n\t\t\t} else if (block.type === \"reasoning\") {\n\t\t\t\t$$renderer.push(\"<!--[2-->\");\n\t\t\t\tReasoningBlock($$renderer, {\n\t\t\t\t\tcontent: block.content,\n\t\t\t\t\tdone: message.done\n\t\t\t\t});\n\t\t\t} else if (block.type === \"tool\") {\n\t\t\t\t$$renderer.push(\"<!--[3-->\");\n\t\t\t\tToolCallCard($$renderer, {\n\t\t\t\t\tname: block.name,\n\t\t\t\t\targs: block.args,\n\t\t\t\t\tresult: block.result\n\t\t\t\t});\n\t\t\t} else if (block.type === \"confirm\") {\n\t\t\t\t$$renderer.push(\"<!--[4-->\");\n\t\t\t\tConfirmInline($$renderer, {\n\t\t\t\t\tconfirmId: block.confirmId,\n\t\t\t\t\tmessage: block.message,\n\t\t\t\t\tonresolve: handleConfirm\n\t\t\t\t});\n\t\t\t} else if (block.type === \"error_recovery\") {\n\t\t\t\t$$renderer.push(\"<!--[5-->\");\n\t\t\t\t$$renderer.push(`<div class=\"error-recovery svelte-1e5n1dp\"><p class=\"recovery-msg svelte-1e5n1dp\">${escape_html(block.message)}</p> <div class=\"recovery-actions svelte-1e5n1dp\"><button class=\"btn-recovery svelte-1e5n1dp\"><span class=\"material-symbols-rounded svelte-1e5n1dp\">refresh</span> 重试</button> <button class=\"btn-recovery btn-recovery-secondary svelte-1e5n1dp\"><span class=\"material-symbols-rounded svelte-1e5n1dp\">undo</span> 回退</button></div></div>`);\n\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]-->`);\n\t\t}\n\t\t$$renderer.push(`<!--]--> `);\n\t\tif (!message.done) {\n\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t$$renderer.push(`<span class=\"cursor svelte-1e5n1dp\">|</span>`);\n\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t$$renderer.push(`<!--]--> `);\n\t\tif (message.role === \"user\" && message.done) {\n\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t$$renderer.push(`<div class=\"msg-actions svelte-1e5n1dp\"><button class=\"action-btn svelte-1e5n1dp\" title=\"复制\"><span class=\"material-symbols-rounded svelte-1e5n1dp\">content_copy</span></button> <button class=\"action-btn svelte-1e5n1dp\" title=\"分叉\"><span class=\"material-symbols-rounded svelte-1e5n1dp\">call_split</span></button> <button${attr_class(\"action-btn svelte-1e5n1dp\", void 0, { \"confirm\": rollbackConfirm })} title=\"回退到此\"><span class=\"material-symbols-rounded svelte-1e5n1dp\">undo</span> `);\n\t\t\t$$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]--></button></div>`);\n\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t$$renderer.push(`<!--]--></div></div>`);\n\t});\n}\n//#endregion\n//#region src/routes/chat/[sessionId]/+page.svelte\nfunction _page($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tvar $$store_subs;\n\t\tlet sessionId = derived(() => store_get($$store_subs ??= {}, \"$page\", page).params.sessionId);\n\t\tlet messages = [];\n\t\tlet input = \"\";\n\t\tlet streaming = false;\n\t\tlet currentAssistant = null;\n\t\tlet frontendConfirms = /* @__PURE__ */ new Map();\n\t\tlet focusTrigger = 0;\n\t\tlet inputQueue = [];\n\t\tlet abortController = null;\n\t\tlet streamReader = null;\n\t\tlet nearBottom = true;\n\t\tlet lastUserMessage = \"\";\n\t\tlet lastUserImages = [];\n\t\tlet contextWindow = void 0;\n\t\tlet customIcon = false;\n\t\tconst cumulativeUsage = derived(() => {\n\t\t\tlet total = 0;\n\t\t\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\t\t\tconst msg = messages[i];\n\t\t\t\tif (msg.role === \"assistant\" && msg.usage) {\n\t\t\t\t\ttotal = msg.usage.total_tokens;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst pct = contextWindow && total > 0 ? (total / contextWindow * 100).toFixed(1) : null;\n\t\t\treturn {\n\t\t\t\ttotal,\n\t\t\t\tpct\n\t\t\t};\n\t\t});\n\t\tfunction scrollToBottom() {\n\t\t\trequestAnimationFrame(() => {});\n\t\t}\n\t\tfunction forceScrollToBottom() {\n\t\t\tnearBottom = true;\n\t\t\trequestAnimationFrame(() => {});\n\t\t}\n\t\tfunction finishStreaming() {\n\t\t\tif (currentAssistant) {\n\t\t\t\tcurrentAssistant.done = true;\n\t\t\t\tcurrentAssistant = null;\n\t\t\t}\n\t\t\tabortController = null;\n\t\t\tstreamReader = null;\n\t\t\tstreaming = false;\n\t\t\tfocusTrigger++;\n\t\t\tscrollToBottom();\n\t\t\tif (inputQueue.length > 0) sendMessage(inputQueue.shift());\n\t\t}\n\t\tfunction stopAI() {\n\t\t\tabortController?.abort();\n\t\t\tstreamReader?.cancel().catch(() => {});\n\t\t\tstreamReader = null;\n\t\t}\n\t\tfunction handleConfirm(confirmId, approved) {\n\t\t\tfor (const msg of messages) {\n\t\t\t\tconst idx = msg.blocks.findIndex((b) => b.type === \"confirm\" && b.confirmId === confirmId);\n\t\t\t\tif (idx !== -1) {\n\t\t\t\t\tmsg.blocks.splice(idx, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfetch(\"/api/confirm\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tconfirmId,\n\t\t\t\t\tapproved\n\t\t\t\t})\n\t\t\t});\n\t\t\tconst resolve = frontendConfirms.get(confirmId);\n\t\t\tif (resolve) {\n\t\t\t\tfrontendConfirms.delete(confirmId);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t}\n\t\tfunction handleRecovery(action) {\n\t\t\tconst recoveryMsg = messages.find((m) => m.blocks.some((b) => b.type === \"error_recovery\"));\n\t\t\tif (recoveryMsg) {\n\t\t\t\tconst idx = messages.indexOf(recoveryMsg);\n\t\t\t\tif (idx !== -1) messages.splice(idx, 1);\n\t\t\t}\n\t\t\tif (action === \"retry\") {\n\t\t\t\tif (lastUserMessage) sendMessage({\n\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\ttext: lastUserMessage,\n\t\t\t\t\timages: lastUserImages\n\t\t\t\t}, true);\n\t\t\t} else {\n\t\t\t\tinput = lastUserMessage;\n\t\t\t\tfocusTrigger++;\n\t\t\t}\n\t\t}\n\t\tasync function handleRollback(messageId) {\n\t\t\tif (streaming) {\n\t\t\t\tstopAI();\n\t\t\t\tawait new Promise((r) => setTimeout(r, 100));\n\t\t\t}\n\t\t\tconst idx = messages.findIndex((m) => m.id === messageId);\n\t\t\tif (idx === -1) return;\n\t\t\tconst rollbackText = messages[idx].blocks.filter((b) => b.type === \"text\").map((b) => b.content).join(\"\\n\");\n\t\t\tif (idx < messages.length - 1) messages.splice(idx + 1);\n\t\t\tmessages.splice(idx, 1);\n\t\t\tfetch(\"/api/messages\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\taction: \"deleteFrom\",\n\t\t\t\t\tsessionId: sessionId(),\n\t\t\t\t\tmessageId\n\t\t\t\t})\n\t\t\t}).catch(() => {});\n\t\t\tinput = rollbackText;\n\t\t\tfocusTrigger++;\n\t\t}\n\t\tasync function sendMessage(queued, skipUserMsg = false) {\n\t\t\tconst text = queued?.text?.trim();\n\t\t\tconst msgImages = queued?.images ?? [];\n\t\t\tif (!text || !queued) return;\n\t\t\tconst userMsgId = queued.id;\n\t\t\tif (streaming) {\n\t\t\t\tif (!skipUserMsg) {\n\t\t\t\t\tinputQueue.push({\n\t\t\t\t\t\tid: userMsgId,\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\timages: [...msgImages]\n\t\t\t\t\t});\n\t\t\t\t\tfetch(\"/api/steer\", {\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\t\tsessionId: sessionId(),\n\t\t\t\t\t\t\tmessageId: userMsgId,\n\t\t\t\t\t\t\tmessage: text\n\t\t\t\t\t\t})\n\t\t\t\t\t}).catch(() => {});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlastUserMessage = text;\n\t\t\tlastUserImages = [...msgImages];\n\t\t\tif (!skipUserMsg) {\n\t\t\t\tconst blocks = [];\n\t\t\t\tfor (const img of msgImages) blocks.push({\n\t\t\t\t\ttype: \"image\",\n\t\t\t\t\turl: img.url,\n\t\t\t\t\tdetail: img.detail\n\t\t\t\t});\n\t\t\t\tblocks.push({\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\tcontent: text\n\t\t\t\t});\n\t\t\t\tmessages.push({\n\t\t\t\t\tid: userMsgId,\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tblocks,\n\t\t\t\t\tdone: true\n\t\t\t\t});\n\t\t\t\tforceScrollToBottom();\n\t\t\t}\n\t\t\tstreaming = true;\n\t\t\tconst controller = new AbortController();\n\t\t\tabortController = controller;\n\t\t\tstreamReader = null;\n\t\t\ttry {\n\t\t\t\tconst body = {\n\t\t\t\t\tsessionId: sessionId(),\n\t\t\t\t\tmessage: text,\n\t\t\t\t\tworkspace: store_get($$store_subs ??= {}, \"$activeWorkspace\", activeWorkspace)\n\t\t\t\t};\n\t\t\t\tif (!skipUserMsg) body.clientMessageId = userMsgId;\n\t\t\t\tif (msgImages.length > 0) body.images = msgImages.map((img) => ({\n\t\t\t\t\turl: img.url,\n\t\t\t\t\tdetail: img.detail || \"auto\"\n\t\t\t\t}));\n\t\t\t\tconst res = await fetch(\"/api/chat\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\t\tbody: JSON.stringify(body),\n\t\t\t\t\tsignal: controller.signal\n\t\t\t\t});\n\t\t\t\tif (!res.ok) {\n\t\t\t\t\tconst err = await res.json().catch(() => ({ error: \"请求失败\" }));\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\trole: \"error\",\n\t\t\t\t\t\tblocks: [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tcontent: err.error || \"请求失败\"\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tdone: true\n\t\t\t\t\t});\n\t\t\t\t\tfinishStreaming();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst newSid = res.headers.get(\"X-Session-Id\");\n\t\t\t\tif (newSid && newSid !== sessionId()) {\n\t\t\t\t\tbumpSession(newSid);\n\t\t\t\t\tgoto(\"/chat/\" + newSid, { replaceState: true });\n\t\t\t\t\treturn;\n\t\t\t\t} else if (newSid) bumpSession(newSid);\n\t\t\t\tconst reader = res.body.getReader();\n\t\t\t\tstreamReader = reader;\n\t\t\t\tconst decoder = new TextDecoder();\n\t\t\t\tlet buffer = \"\";\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\tif (done) break;\n\t\t\t\t\tbuffer += decoder.decode(value, { stream: true });\n\t\t\t\t\tconst lines = buffer.split(\"\\n\");\n\t\t\t\t\tbuffer = lines.pop() || \"\";\n\t\t\t\t\tfor (const line of lines) {\n\t\t\t\t\t\tconst trimmed = line.trim();\n\t\t\t\t\t\tif (!trimmed || !trimmed.startsWith(\"data:\")) continue;\n\t\t\t\t\t\tconst data = trimmed.slice(5).trim();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait handleSSEEvent(JSON.parse(data));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfinishStreaming();\n\t\t\t} catch (e) {\n\t\t\t\tif (e.name === \"AbortError\") {\n\t\t\t\t\tif (currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant.done = true;\n\t\t\t\t\t\tcurrentAssistant = null;\n\t\t\t\t\t}\n\t\t\t\t\tabortController = null;\n\t\t\t\t\tstreamReader = null;\n\t\t\t\t\tstreaming = false;\n\t\t\t\t\tfocusTrigger++;\n\t\t\t\t\tif (inputQueue.length > 0) sendMessage(inputQueue.shift());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmessages.push({\n\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\trole: \"error\",\n\t\t\t\t\tblocks: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tcontent: e.message || \"连接失败\"\n\t\t\t\t\t}],\n\t\t\t\t\tdone: true\n\t\t\t\t});\n\t\t\t\tfinishStreaming();\n\t\t\t}\n\t\t}\n\t\tasync function handleFork(messageId) {\n\t\t\tif (streaming || !sessionId()) return;\n\t\t\tconst result = await forkSession(sessionId(), messageId);\n\t\t\tif (result) {\n\t\t\t\tgoto(\"/chat/\" + result.newSessionId, { replaceState: false });\n\t\t\t\tpendingFirstMessage.set(result.draftContent);\n\t\t\t\tpendingFirstImages.set([]);\n\t\t\t}\n\t\t}\n\t\tasync function handleSSEEvent(event) {\n\t\t\tswitch (event.type) {\n\t\t\t\tcase \"content\": {\n\t\t\t\t\tconst text = event.text;\n\t\t\t\t\tif (!currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tblocks: [{\n\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\tcontent: text\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst blocks = currentAssistant.blocks;\n\t\t\t\t\t\tconst lastBlock = blocks[blocks.length - 1];\n\t\t\t\t\t\tif (lastBlock && lastBlock.type === \"text\") lastBlock.content += text;\n\t\t\t\t\t\telse blocks.push({\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tcontent: text\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"reasoning\": {\n\t\t\t\t\tconst text = event.text;\n\t\t\t\t\tif (!currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tblocks: [{\n\t\t\t\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\t\t\t\tcontent: text\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst blocks = currentAssistant.blocks;\n\t\t\t\t\t\tconst lastBlock = blocks[blocks.length - 1];\n\t\t\t\t\t\tif (lastBlock && lastBlock.type === \"reasoning\") lastBlock.content += text;\n\t\t\t\t\t\telse blocks.push({\n\t\t\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\t\t\tcontent: text\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"tool_call\":\n\t\t\t\t\tif (!currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tblocks: [],\n\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentAssistant.blocks.push({\n\t\t\t\t\t\ttype: \"tool\",\n\t\t\t\t\t\tname: event.name,\n\t\t\t\t\t\targs: event.args\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tool_result\": {\n\t\t\t\t\tif (!currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tblocks: [],\n\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\t}\n\t\t\t\t\tconst blocks = currentAssistant.blocks;\n\t\t\t\t\tfor (let i = blocks.length - 1; i >= 0; i--) {\n\t\t\t\t\t\tconst block = blocks[i];\n\t\t\t\t\t\tif (block.type === \"tool\" && !block.result && block.name === event.name) {\n\t\t\t\t\t\t\tblock.result = {\n\t\t\t\t\t\t\t\tsuccess: event.success,\n\t\t\t\t\t\t\t\toutput: event.output\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"tool_execution_update\": {\n\t\t\t\t\tconst toolName = event.name;\n\t\t\t\t\tconst updateText = event.text;\n\t\t\t\t\tlet found = false;\n\t\t\t\t\tif (currentAssistant) {\n\t\t\t\t\t\tfor (let i = currentAssistant.blocks.length - 1; i >= 0; i--) {\n\t\t\t\t\t\t\tconst block = currentAssistant.blocks[i];\n\t\t\t\t\t\t\tif (block.type === \"tool\" && block.name === toolName) {\n\t\t\t\t\t\t\t\tif (!block.result) block.result = {\n\t\t\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\t\t\toutput: \"\"\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tblock.result = {\n\t\t\t\t\t\t\t\t\t...block.result,\n\t\t\t\t\t\t\t\t\toutput: block.result.output + updateText\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (found) messages = [...messages];\n\t\t\t\t\t}\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"confirm_required\": {\n\t\t\t\t\tconst confirmId = event.confirmId;\n\t\t\t\t\tconst reason = event.confirmation?.reason || \"需要确认此操作\";\n\t\t\t\t\tif (!currentAssistant) {\n\t\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\t\tblocks: [],\n\t\t\t\t\t\t\tdone: false\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentAssistant.blocks.push({\n\t\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\t\tconfirmId,\n\t\t\t\t\t\tmessage: reason\n\t\t\t\t\t});\n\t\t\t\t\tawait new Promise((resolve) => {\n\t\t\t\t\t\tfrontendConfirms.set(confirmId, resolve);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"error\":\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\trole: \"error\",\n\t\t\t\t\t\tblocks: [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\tcontent: event.message\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tdone: true\n\t\t\t\t\t});\n\t\t\t\t\tscrollToBottom();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"steering_consumed\": {\n\t\t\t\t\tconst msgId = event.messageId;\n\t\t\t\t\tconst idx = inputQueue.findIndex((q) => q.id === msgId);\n\t\t\t\t\tif (idx !== -1) inputQueue.splice(idx, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"forked\":\n\t\t\t\t\tif (event.newSessionId) {\n\t\t\t\t\t\tbumpSession(event.newSessionId);\n\t\t\t\t\t\tgoto(\"/chat/\" + event.newSessionId, { replaceState: true });\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"retrying\":\n\t\t\t\t\tif (currentAssistant) {\n\t\t\t\t\t\tconst idx = messages.indexOf(currentAssistant);\n\t\t\t\t\t\tif (idx !== -1) messages.splice(idx, 1);\n\t\t\t\t\t\tcurrentAssistant = null;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"retry_exhausted\":\n\t\t\t\t\tif (currentAssistant) {\n\t\t\t\t\t\tconst idx = messages.indexOf(currentAssistant);\n\t\t\t\t\t\tif (idx !== -1) messages.splice(idx, 1);\n\t\t\t\t\t\tcurrentAssistant = null;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentAssistant = {\n\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\tblocks: [{\n\t\t\t\t\t\t\ttype: \"error_recovery\",\n\t\t\t\t\t\t\tmessage: event.message\n\t\t\t\t\t\t}],\n\t\t\t\t\t\tdone: true\n\t\t\t\t\t};\n\t\t\t\t\tmessages.push(currentAssistant);\n\t\t\t\t\tcurrentAssistant = null;\n\t\t\t\t\tstreaming = false;\n\t\t\t\t\tfocusTrigger++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"done\":\n\t\t\t\t\tif (currentAssistant && event.usage) currentAssistant.usage = event.usage;\n\t\t\t\t\tif (event.contextWindow) contextWindow = event.contextWindow;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tlet $$settled = true;\n\t\tlet $$inner_renderer;\n\t\tfunction $$render_inner($$renderer) {\n\t\t\t$$renderer.push(`<div class=\"chat-container svelte-1ca3w4l\"><div${attr_class(\"messages svelte-1ca3w4l\", void 0, { \"welcome\": messages.length === 0 })}>`);\n\t\t\tif (messages.length === 0) {\n\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\tEmptyState($$renderer, { customIcon });\n\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]--> <!--[-->`);\n\t\t\tconst each_array = ensure_array_like(messages);\n\t\t\tfor (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {\n\t\t\t\tlet msg = each_array[$$index];\n\t\t\t\tMessageBubble($$renderer, {\n\t\t\t\t\tmessage: msg,\n\t\t\t\t\tonconfirm: handleConfirm,\n\t\t\t\t\tonrecovery: handleRecovery,\n\t\t\t\t\tonrollback: handleRollback,\n\t\t\t\t\tonfork: handleFork\n\t\t\t\t});\n\t\t\t}\n\t\t\t$$renderer.push(`<!--]--> `);\n\t\t\tif (cumulativeUsage().total > 0) {\n\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t$$renderer.push(`<div class=\"stats-line svelte-1ca3w4l\"><span class=\"stats-label svelte-1ca3w4l\">Token</span> <span class=\"stats-value svelte-1ca3w4l\">${escape_html(cumulativeUsage().total)}</span> `);\n\t\t\t\tif (contextWindow) {\n\t\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t\t$$renderer.push(`<span class=\"stats-sep svelte-1ca3w4l\">/</span> <span class=\"stats-max svelte-1ca3w4l\">${escape_html(contextWindow)}</span> `);\n\t\t\t\t\tif (cumulativeUsage().pct) {\n\t\t\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t\t\t$$renderer.push(`<span class=\"stats-pct svelte-1ca3w4l\">(${escape_html(cumulativeUsage().pct)}%)</span>`);\n\t\t\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t\t\t$$renderer.push(`<!--]-->`);\n\t\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t\t$$renderer.push(`<!--]--></div>`);\n\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]--></div> `);\n\t\t\tif (!nearBottom && streaming) {\n\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t$$renderer.push(`<button class=\"scroll-btn svelte-1ca3w4l\"><span class=\"material-symbols-rounded svelte-1ca3w4l\">arrow_downward</span></button>`);\n\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]--> <div class=\"input-anchor svelte-1ca3w4l\">`);\n\t\t\tChatInput($$renderer, {\n\t\t\t\tstreaming,\n\t\t\t\tqueueCount: inputQueue.length,\n\t\t\t\tonsend: (imgs) => {\n\t\t\t\t\tconst msg = {\n\t\t\t\t\t\tid: crypto.randomUUID(),\n\t\t\t\t\t\ttext: input,\n\t\t\t\t\t\timages: imgs\n\t\t\t\t\t};\n\t\t\t\t\tinput = \"\";\n\t\t\t\t\tfocusTrigger++;\n\t\t\t\t\tsendMessage(msg);\n\t\t\t\t},\n\t\t\t\tonstop: stopAI,\n\t\t\t\tfocusTrigger,\n\t\t\t\tget value() {\n\t\t\t\t\treturn input;\n\t\t\t\t},\n\t\t\t\tset value($$value) {\n\t\t\t\t\tinput = $$value;\n\t\t\t\t\t$$settled = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\t$$renderer.push(`<!----></div></div>`);\n\t\t}\n\t\tdo {\n\t\t\t$$settled = true;\n\t\t\t$$inner_renderer = $$renderer.copy();\n\t\t\t$$render_inner($$inner_renderer);\n\t\t} while (!$$settled);\n\t\t$$renderer.subsume($$inner_renderer);\n\t\tif ($$store_subs) unsubscribe_stores($$store_subs);\n\t});\n}\n//#endregion\nexport { _page as default };\n"],"names":[],"mappings":";;;;;;;;AAQA;AACA,SAAS,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE;AAC3C,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,KAAK;AACtC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO;AAC/C,EAAE,IAAI,QAAQ,GAAG,KAAK;AACtB,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;AACpC,EAAE,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,MAAM,GAAG,CAA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,IAAI,CAAC,YAAY,CAAC;AACvC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,kDAAkD,CAAC,CAAC;AACxE,GAAG,SAAS,CAAC,UAAU,EAAE;AACzB,IAAI,SAAS;AACb,IAAI,UAAU,EAAE,UAAU,CAAC,MAAM;AACjC,IAAI,MAAM,EAAE,CAAC,IAAI,KAAK;AACtB,KAAK,MAAM,GAAG,GAAG;AACjB,MAAM,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE;AAC7B,MAAM,IAAI,EAAE,KAAK;AACjB,MAAM,MAAM,EAAE;AACd,MAAM;AACN,KAAK,KAAK,GAAG,EAAE;AACf,KAAK,YAAY,EAAE;AACnB,KAAK,WAAW,CAAC,GAAG,CAAC;AACrB,IAAI,CAAC;AACL,IAAI,MAAM,EAAE,MAAM;AAClB,IAAI,YAAY;AAChB,IAAI,IAAI,KAAK,GAAG;AAChB,KAAK,OAAO,KAAK;AACjB,IAAI,CAAC;AACL,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE;AACvB,KAAK,KAAK,GAAG,OAAO;AACpB,KAAK,SAAS,GAAG,KAAK;AACtB,IAAI;AACJ,IAAI,CAAC;AACL,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;AACzC,EAAE;AACF,EAAE,GAAG;AACL,GAAG,SAAS,GAAG,IAAI;AACnB,GAAG,gBAAgB,GAAG,UAAU,CAAC,IAAI,EAAE;AACvC,GAAG,cAAc,CAAC,gBAAgB,CAAC;AACnC,EAAE,CAAC,QAAQ,CAAC,SAAS;AACrB,EAAE,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC;AACtC,EAAE,IAAI,YAAY,EAAE,kBAAkB,CAAC,YAAY,CAAC;AACpD,CAAC,CAAC,CAAC;AACH;;;;"}
@@ -0,0 +1,67 @@
1
+ import { d as store_get, u as unsubscribe_stores } from './index.js-N7Sh42pC.js';
2
+ import { g as goto } from './client-BoLIct8q.js';
3
+ import { c as createSession, a as activeWorkspace, p as pendingFirstMessage, b as pendingFirstImages } from './session-store-B1Aop0Qn.js';
4
+ import { E as EmptyState, C as ChatInput } from './ChatInput-GWTgCE1t.js';
5
+ import 'node:module';
6
+
7
+ //#region src/routes/+page.svelte
8
+ function _page($$renderer, $$props) {
9
+ $$renderer.component(($$renderer) => {
10
+ var $$store_subs;
11
+ let input = "";
12
+ let sending = false;
13
+ let showNoProviderHint = false;
14
+ let customIcon = false;
15
+ async function handleSend(msgImages) {
16
+ const text = input.trim();
17
+ if (!text || sending) return;
18
+ sending = true;
19
+ input = "";
20
+ showNoProviderHint = false;
21
+ const session = await createSession(store_get($$store_subs ??= {}, "$activeWorkspace", activeWorkspace));
22
+ if (!session) {
23
+ sending = false;
24
+ return;
25
+ }
26
+ pendingFirstMessage.set(text);
27
+ pendingFirstImages.set(msgImages);
28
+ goto("/chat/" + session.id);
29
+ }
30
+ let $$settled = true;
31
+ let $$inner_renderer;
32
+ function $$render_inner($$renderer) {
33
+ $$renderer.push(`<div class="root-page svelte-1uha8ag"><div class="welcome-area svelte-1uha8ag">`);
34
+ EmptyState($$renderer, { customIcon });
35
+ $$renderer.push(`<!----> <div class="input-anchor svelte-1uha8ag">`);
36
+ ChatInput($$renderer, {
37
+ streaming: false,
38
+ queueCount: 0,
39
+ onsend: handleSend,
40
+ onstop: () => {},
41
+ get value() {
42
+ return input;
43
+ },
44
+ set value($$value) {
45
+ input = $$value;
46
+ $$settled = false;
47
+ }
48
+ });
49
+ $$renderer.push(`<!----> `);
50
+ if (showNoProviderHint) {
51
+ $$renderer.push("<!--[0-->");
52
+ $$renderer.push(`<div class="no-provider-hint svelte-1uha8ag"><span class="material-symbols-rounded hint-icon svelte-1uha8ag">info</span> <span>尚未配置 AI 供应商,请先前往 <a href="/settings" class="hint-link svelte-1uha8ag">设置</a> 添加</span></div>`);
53
+ } else $$renderer.push("<!--[-1-->");
54
+ $$renderer.push(`<!--]--></div></div></div>`);
55
+ }
56
+ do {
57
+ $$settled = true;
58
+ $$inner_renderer = $$renderer.copy();
59
+ $$render_inner($$inner_renderer);
60
+ } while (!$$settled);
61
+ $$renderer.subsume($$inner_renderer);
62
+ if ($$store_subs) unsubscribe_stores($$store_subs);
63
+ });
64
+ }
65
+
66
+ export { _page as default };
67
+ //# sourceMappingURL=_page.svelte-OC4xDCWu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_page.svelte-OC4xDCWu.js","sources":["../../../.svelte-kit/output/server/entries/pages/_page.svelte.js"],"sourcesContent":["import { c as store_get, u as unsubscribe_stores } from \"../../chunks/dev.js\";\nimport { n as goto } from \"../../chunks/client.js\";\nimport \"../../chunks/navigation.js\";\nimport { a as pendingFirstImages, o as pendingFirstMessage, r as createSession, t as activeWorkspace } from \"../../chunks/session-store.js\";\nimport { n as EmptyState, t as ChatInput } from \"../../chunks/ChatInput.js\";\n//#region src/routes/+page.svelte\nfunction _page($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tvar $$store_subs;\n\t\tlet input = \"\";\n\t\tlet sending = false;\n\t\tlet showNoProviderHint = false;\n\t\tlet customIcon = false;\n\t\tasync function handleSend(msgImages) {\n\t\t\tconst text = input.trim();\n\t\t\tif (!text || sending) return;\n\t\t\tsending = true;\n\t\t\tinput = \"\";\n\t\t\tshowNoProviderHint = false;\n\t\t\tconst session = await createSession(store_get($$store_subs ??= {}, \"$activeWorkspace\", activeWorkspace));\n\t\t\tif (!session) {\n\t\t\t\tsending = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpendingFirstMessage.set(text);\n\t\t\tpendingFirstImages.set(msgImages);\n\t\t\tgoto(\"/chat/\" + session.id);\n\t\t}\n\t\tlet $$settled = true;\n\t\tlet $$inner_renderer;\n\t\tfunction $$render_inner($$renderer) {\n\t\t\t$$renderer.push(`<div class=\"root-page svelte-1uha8ag\"><div class=\"welcome-area svelte-1uha8ag\">`);\n\t\t\tEmptyState($$renderer, { customIcon });\n\t\t\t$$renderer.push(`<!----> <div class=\"input-anchor svelte-1uha8ag\">`);\n\t\t\tChatInput($$renderer, {\n\t\t\t\tstreaming: false,\n\t\t\t\tqueueCount: 0,\n\t\t\t\tonsend: handleSend,\n\t\t\t\tonstop: () => {},\n\t\t\t\tget value() {\n\t\t\t\t\treturn input;\n\t\t\t\t},\n\t\t\t\tset value($$value) {\n\t\t\t\t\tinput = $$value;\n\t\t\t\t\t$$settled = false;\n\t\t\t\t}\n\t\t\t});\n\t\t\t$$renderer.push(`<!----> `);\n\t\t\tif (showNoProviderHint) {\n\t\t\t\t$$renderer.push(\"<!--[0-->\");\n\t\t\t\t$$renderer.push(`<div class=\"no-provider-hint svelte-1uha8ag\"><span class=\"material-symbols-rounded hint-icon svelte-1uha8ag\">info</span> <span>尚未配置 AI 供应商,请先前往 <a href=\"/settings\" class=\"hint-link svelte-1uha8ag\">设置</a> 添加</span></div>`);\n\t\t\t} else $$renderer.push(\"<!--[-1-->\");\n\t\t\t$$renderer.push(`<!--]--></div></div></div>`);\n\t\t}\n\t\tdo {\n\t\t\t$$settled = true;\n\t\t\t$$inner_renderer = $$renderer.copy();\n\t\t\t$$render_inner($$inner_renderer);\n\t\t} while (!$$settled);\n\t\t$$renderer.subsume($$inner_renderer);\n\t\tif ($$store_subs) unsubscribe_stores($$store_subs);\n\t});\n}\n//#endregion\nexport { _page as default };\n"],"names":[],"mappings":";;;;;;AAKA;AACA,SAAS,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE;AACpC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,KAAK;AACtC,EAAE,IAAI,YAAY;AAClB,EAAE,IAAI,KAAK,GAAG,EAAE;AAChB,EAAE,IAAI,OAAO,GAAG,KAAK;AACrB,EAAE,IAAI,kBAAkB,GAAG,KAAK;AAChC,EAAE,IAAI,UAAU,GAAG,KAAK;AACxB,EAAE,eAAe,UAAU,CAAC,SAAS,EAAE;AACvC,GAAG,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE;AAC5B,GAAG,IAA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9B,GAAG,IAAI,kBAAkB,EAAE;AAC3B,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;AAChC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,2NAA2N,CAAC,CAAC;AAClP,GAAG,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;AACvC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,0BAA0B,CAAC,CAAC;AAChD,EAAE;AACF,EAAE,GAAG;AACL,GAAG,SAAS,GAAG,IAAI;AACnB,GAAG,gBAAgB,GAAG,UAAU,CAAC,IAAI,EAAE;AACvC,GAAG,cAAc,CAAC,gBAAgB,CAAC;AACnC,EAAE,CAAC,QAAQ,CAAC,SAAS;AACrB,EAAE,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC;AACtC,EAAE,IAAI,YAAY,EAAE,kBAAkB,CAAC,YAAY,CAAC;AACpD,CAAC,CAAC,CAAC;AACH;;;;"}
@@ -0,0 +1,115 @@
1
+ import { r as readConfig, b as getProviderForModel, d as getActiveModel, e as createProvider, c as createStorage, f as getContextWindow, T as ToolRegistry, C as CORE_TOOLS, S as SCHEDULING_TOOLS, h as createSearchHistoryTool, i as ContextBuilder, A as AgentLoop, j as AgentLogger, s as sessionLock } from './config-d3FC8naq.js';
2
+ import { p as pendingConfirms } from './chat-confirm-BW2aJ2qz.js';
3
+ import './chat-steering-DTefLITL.js';
4
+ import './prompts-tcGD1LCs.js';
5
+ import 'node:fs';
6
+ import 'node:path';
7
+ import 'node:fs/promises';
8
+ import 'node:crypto';
9
+ import 'node:child_process';
10
+ import 'node:os';
11
+ import './index.js-N7Sh42pC.js';
12
+ import 'node:module';
13
+ import 'fs';
14
+ import 'path';
15
+ import 'util';
16
+
17
+ //#region src/routes/api/chat/+server.ts
18
+ async function POST({ request }) {
19
+ try {
20
+ let { sessionId, message, images, clientMessageId, workspace } = await request.json();
21
+ if (!message?.trim()) return new Response(JSON.stringify({ error: "消息不能为空" }), {
22
+ status: 400,
23
+ headers: { "Content-Type": "application/json" }
24
+ });
25
+ const config = readConfig();
26
+ if (!config.activeModel) return new Response(JSON.stringify({ error: "未选择模型,请先在设置中配置供应商" }), {
27
+ status: 400,
28
+ headers: { "Content-Type": "application/json" }
29
+ });
30
+ const providerConfig = getProviderForModel(config.activeModel);
31
+ if (!providerConfig) return new Response(JSON.stringify({ error: "未找到对应模型的供应商配置" }), {
32
+ status: 400,
33
+ headers: { "Content-Type": "application/json" }
34
+ });
35
+ const model = getActiveModel();
36
+ if (!model) return new Response(JSON.stringify({ error: "未选择模型" }), {
37
+ status: 400,
38
+ headers: { "Content-Type": "application/json" }
39
+ });
40
+ const provider = createProvider({
41
+ ...providerConfig,
42
+ activeModel: model.id,
43
+ contextWindow: model.contextWindow
44
+ });
45
+ const storage = createStorage({ enabled: config.storageEnabled });
46
+ const contextWindow = getContextWindow();
47
+ const registry = new ToolRegistry();
48
+ for (const t of CORE_TOOLS) registry.register(t);
49
+ for (const t of SCHEDULING_TOOLS) registry.register(t);
50
+ registry.register(createSearchHistoryTool(storage));
51
+ const contextBuilder = new ContextBuilder();
52
+ const onConfirm = async (_conf, confirmId) => {
53
+ return new Promise((resolve) => {
54
+ pendingConfirms.set(confirmId, { resolve });
55
+ request.signal.addEventListener("abort", () => {
56
+ pendingConfirms.delete(confirmId);
57
+ resolve(false);
58
+ }, { once: true });
59
+ });
60
+ };
61
+ const agent = new AgentLoop(provider, storage, registry, onConfirm, request.signal, new AgentLogger(sessionId || "(new)"), config.compressionMode, config.compressionThreshold);
62
+ let sid = sessionId;
63
+ if (!sid) sid = (await storage.createSession(void 0, void 0, workspace)).id;
64
+ else if (!await storage.getSession(sid)) sid = (await storage.createSession(void 0, void 0, workspace)).id;
65
+ const imageContents = (images || []).map((img) => ({
66
+ type: "image_url",
67
+ image_url: {
68
+ url: img.url,
69
+ detail: img.detail || "auto"
70
+ }
71
+ }));
72
+ const storageContent = imageContents.length > 0 ? JSON.stringify([{
73
+ type: "text",
74
+ text: message
75
+ }, ...imageContents]) : message;
76
+ const buildResult = await contextBuilder.build(sid, message, imageContents, storage, contextWindow, config.systemPrompt);
77
+ const stream = new ReadableStream({ async start(controller) {
78
+ function send(event) {
79
+ controller.enqueue(`data: ${JSON.stringify(event)}\n\n`);
80
+ }
81
+ let release;
82
+ try {
83
+ release = await sessionLock.acquire(sid);
84
+ for await (const event of agent.run(sid, storageContent, buildResult, clientMessageId)) if (event.type === "done") send({
85
+ ...event,
86
+ contextWindow
87
+ });
88
+ else send(event);
89
+ } catch (e) {
90
+ send({
91
+ type: "error",
92
+ message: e.message || "未知错误"
93
+ });
94
+ } finally {
95
+ if (release) release();
96
+ }
97
+ controller.close();
98
+ } });
99
+ return new Response(stream, { headers: {
100
+ "Content-Type": "text/event-stream",
101
+ "Cache-Control": "no-cache, no-transform",
102
+ "Connection": "keep-alive",
103
+ "X-Accel-Buffering": "no",
104
+ "X-Session-Id": sid
105
+ } });
106
+ } catch (e) {
107
+ return new Response(JSON.stringify({ error: e.message }), {
108
+ status: 500,
109
+ headers: { "Content-Type": "application/json" }
110
+ });
111
+ }
112
+ }
113
+
114
+ export { POST };
115
+ //# sourceMappingURL=_server.ts-BG3v883h.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-BG3v883h.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/chat/_server.ts.js"],"sourcesContent":["import { A as createProvider, E as sessionLock, _ as SCHEDULING_TOOLS, a as getProviderForModel, f as AgentLogger, g as CORE_TOOLS, h as AgentLoop, i as getContextWindow, k as ToolRegistry, m as ContextBuilder, n as getActiveModel, o as readConfig, v as createSearchHistoryTool, x as createStorage } from \"../../../../chunks/config.js\";\nimport { t as pendingConfirms } from \"../../../../chunks/chat-confirm.js\";\n//#region src/routes/api/chat/+server.ts\nasync function POST({ request }) {\n\ttry {\n\t\tlet { sessionId, message, images, clientMessageId, workspace } = await request.json();\n\t\tif (!message?.trim()) return new Response(JSON.stringify({ error: \"消息不能为空\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tconst config = readConfig();\n\t\tif (!config.activeModel) return new Response(JSON.stringify({ error: \"未选择模型,请先在设置中配置供应商\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tconst providerConfig = getProviderForModel(config.activeModel);\n\t\tif (!providerConfig) return new Response(JSON.stringify({ error: \"未找到对应模型的供应商配置\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tconst model = getActiveModel();\n\t\tif (!model) return new Response(JSON.stringify({ error: \"未选择模型\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tconst provider = createProvider({\n\t\t\t...providerConfig,\n\t\t\tactiveModel: model.id,\n\t\t\tcontextWindow: model.contextWindow\n\t\t});\n\t\tconst storage = createStorage({ enabled: config.storageEnabled });\n\t\tconst contextWindow = getContextWindow();\n\t\tconst registry = new ToolRegistry();\n\t\tfor (const t of CORE_TOOLS) registry.register(t);\n\t\tfor (const t of SCHEDULING_TOOLS) registry.register(t);\n\t\tregistry.register(createSearchHistoryTool(storage));\n\t\tconst contextBuilder = new ContextBuilder();\n\t\tconst onConfirm = async (_conf, confirmId) => {\n\t\t\treturn new Promise((resolve) => {\n\t\t\t\tpendingConfirms.set(confirmId, { resolve });\n\t\t\t\trequest.signal.addEventListener(\"abort\", () => {\n\t\t\t\t\tpendingConfirms.delete(confirmId);\n\t\t\t\t\tresolve(false);\n\t\t\t\t}, { once: true });\n\t\t\t});\n\t\t};\n\t\tconst agent = new AgentLoop(provider, storage, registry, onConfirm, request.signal, new AgentLogger(sessionId || \"(new)\"), config.compressionMode, config.compressionThreshold);\n\t\tlet sid = sessionId;\n\t\tif (!sid) sid = (await storage.createSession(void 0, void 0, workspace)).id;\n\t\telse if (!await storage.getSession(sid)) sid = (await storage.createSession(void 0, void 0, workspace)).id;\n\t\tconst imageContents = (images || []).map((img) => ({\n\t\t\ttype: \"image_url\",\n\t\t\timage_url: {\n\t\t\t\turl: img.url,\n\t\t\t\tdetail: img.detail || \"auto\"\n\t\t\t}\n\t\t}));\n\t\tconst storageContent = imageContents.length > 0 ? JSON.stringify([{\n\t\t\ttype: \"text\",\n\t\t\ttext: message\n\t\t}, ...imageContents]) : message;\n\t\tconst buildResult = await contextBuilder.build(sid, message, imageContents, storage, contextWindow, config.systemPrompt);\n\t\tconst stream = new ReadableStream({ async start(controller) {\n\t\t\tfunction send(event) {\n\t\t\t\tcontroller.enqueue(`data: ${JSON.stringify(event)}\\n\\n`);\n\t\t\t}\n\t\t\tlet release;\n\t\t\ttry {\n\t\t\t\trelease = await sessionLock.acquire(sid);\n\t\t\t\tfor await (const event of agent.run(sid, storageContent, buildResult, clientMessageId)) if (event.type === \"done\") send({\n\t\t\t\t\t...event,\n\t\t\t\t\tcontextWindow\n\t\t\t\t});\n\t\t\t\telse send(event);\n\t\t\t} catch (e) {\n\t\t\t\tsend({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: e.message || \"未知错误\"\n\t\t\t\t});\n\t\t\t} finally {\n\t\t\t\tif (release) release();\n\t\t\t}\n\t\t\tcontroller.close();\n\t\t} });\n\t\treturn new Response(stream, { headers: {\n\t\t\t\"Content-Type\": \"text/event-stream\",\n\t\t\t\"Cache-Control\": \"no-cache, no-transform\",\n\t\t\t\"Connection\": \"keep-alive\",\n\t\t\t\"X-Accel-Buffering\": \"no\",\n\t\t\t\"X-Session-Id\": sid\n\t\t} });\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\n//#endregion\nexport { POST };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA;AACA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,CAAC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ACD;;;;"}
@@ -0,0 +1,28 @@
1
+ import { p as pendingConfirms } from './chat-confirm-BW2aJ2qz.js';
2
+
3
+ //#region src/routes/api/confirm/+server.ts
4
+ async function POST({ request }) {
5
+ try {
6
+ const { confirmId, approved } = await request.json();
7
+ if (!confirmId) return new Response(JSON.stringify({ error: "缺少 confirmId" }), {
8
+ status: 400,
9
+ headers: { "Content-Type": "application/json" }
10
+ });
11
+ const pending = pendingConfirms.get(confirmId);
12
+ if (!pending) return new Response(JSON.stringify({ error: "确认请求不存在或已过期" }), {
13
+ status: 404,
14
+ headers: { "Content-Type": "application/json" }
15
+ });
16
+ pendingConfirms.delete(confirmId);
17
+ pending.resolve(approved === true);
18
+ return new Response(JSON.stringify({ ok: true }), { headers: { "Content-Type": "application/json" } });
19
+ } catch (e) {
20
+ return new Response(JSON.stringify({ error: e.message }), {
21
+ status: 500,
22
+ headers: { "Content-Type": "application/json" }
23
+ });
24
+ }
25
+ }
26
+
27
+ export { POST };
28
+ //# sourceMappingURL=_server.ts-C1hU_FnX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-C1hU_FnX.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/confirm/_server.ts.js"],"sourcesContent":["import { t as pendingConfirms } from \"../../../../chunks/chat-confirm.js\";\n//#region src/routes/api/confirm/+server.ts\nasync function POST({ request }) {\n\ttry {\n\t\tconst { confirmId, approved } = await request.json();\n\t\tif (!confirmId) return new Response(JSON.stringify({ error: \"缺少 confirmId\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tconst pending = pendingConfirms.get(confirmId);\n\t\tif (!pending) return new Response(JSON.stringify({ error: \"确认请求不存在或已过期\" }), {\n\t\t\tstatus: 404,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tpendingConfirms.delete(confirmId);\n\t\tpending.resolve(approved === true);\n\t\treturn new Response(JSON.stringify({ ok: true }), { headers: { \"Content-Type\": \"application/json\" } });\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\n//#endregion\nexport { POST };\n"],"names":[],"mappings":";;AACA;AACA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,CAAC,IAAI;AACL,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AACtD,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,EAAE;AACjF,GAAG,MAAM,EAAE,GAAG;AACd,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AAChD,GAAG,CAAC;AACJ,EAAE,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC;AAChD,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE;AAC9E,GAAG,MAAM,EAAE,GAAG;AACd,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AAChD,GAAG,CAAC;AACJ,EAAE,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC;AACnC,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC;AACpC,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AACxG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;AACb,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE;AAC5D,GAAG,MAAM,EAAE,GAAG;AACd,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AAChD,GAAG,CAAC;AACJ,CAAC;AACD;;;;"}
@@ -0,0 +1,30 @@
1
+ import { p as runSummarizeJob } from './config-d3FC8naq.js';
2
+ import './chat-steering-DTefLITL.js';
3
+ import './prompts-tcGD1LCs.js';
4
+ import 'node:fs';
5
+ import 'node:path';
6
+ import 'node:fs/promises';
7
+ import 'node:crypto';
8
+ import 'node:child_process';
9
+ import 'node:os';
10
+ import './index.js-N7Sh42pC.js';
11
+ import 'node:module';
12
+ import 'fs';
13
+ import 'path';
14
+ import 'util';
15
+
16
+ //#region src/routes/api/summarize/+server.ts
17
+ async function POST({ request }) {
18
+ try {
19
+ const result = await runSummarizeJob((await request.json().catch(() => ({}))).force === true);
20
+ return new Response(JSON.stringify(result), { headers: { "Content-Type": "application/json" } });
21
+ } catch (e) {
22
+ return new Response(JSON.stringify({ error: e.message }), {
23
+ status: 500,
24
+ headers: { "Content-Type": "application/json" }
25
+ });
26
+ }
27
+ }
28
+
29
+ export { POST };
30
+ //# sourceMappingURL=_server.ts-CJOrsy4y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-CJOrsy4y.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/summarize/_server.ts.js"],"sourcesContent":["import { p as runSummarizeJob } from \"../../../../chunks/config.js\";\n//#region src/routes/api/summarize/+server.ts\nasync function POST({ request }) {\n\ttry {\n\t\tconst result = await runSummarizeJob((await request.json().catch(() => ({}))).force === true);\n\t\treturn new Response(JSON.stringify(result), { headers: { \"Content-Type\": \"application/json\" } });\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\n//#endregion\nexport { POST };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA;AACA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,CAAC,IAAI;AACL,EAAE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;AAC/F,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AAClG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;AACb,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE;AAC5D,GAAG,MAAM,EAAE,GAAG;AACd,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AAChD,GAAG,CAAC;AACJ,CAAC;AACD;;;;"}
@@ -0,0 +1,43 @@
1
+ import { readdirSync, statSync } from 'node:fs';
2
+ import { normalize, join } from 'node:path';
3
+
4
+ //#region src/routes/api/browse/+server.ts
5
+ async function POST({ request }) {
6
+ const { path = "" } = await request.json().catch(() => ({}));
7
+ let currentPath;
8
+ if (!path) currentPath = process.platform === "win32" ? process.cwd().slice(0, 3) : "/";
9
+ else {
10
+ currentPath = normalize(path);
11
+ if (currentPath === "." || !currentPath) currentPath = process.platform === "win32" ? process.cwd().slice(0, 3) : "/";
12
+ }
13
+ const parent = join(currentPath, "..");
14
+ const entries = [];
15
+ try {
16
+ const names = readdirSync(currentPath);
17
+ for (const name of names) {
18
+ if (name.startsWith(".")) continue;
19
+ try {
20
+ if (statSync(join(currentPath, name)).isDirectory()) entries.push({
21
+ name,
22
+ isDirectory: true
23
+ });
24
+ } catch {}
25
+ }
26
+ } catch {
27
+ return new Response(JSON.stringify({
28
+ error: "无法访问该路径",
29
+ path: currentPath,
30
+ entries: [],
31
+ parent
32
+ }), { headers: { "Content-Type": "application/json" } });
33
+ }
34
+ entries.sort((a, b) => a.name.localeCompare(b.name, "zh-CN"));
35
+ return new Response(JSON.stringify({
36
+ path: currentPath,
37
+ entries,
38
+ parent
39
+ }), { headers: { "Content-Type": "application/json" } });
40
+ }
41
+
42
+ export { POST };
43
+ //# sourceMappingURL=_server.ts-Co2FAQm2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-Co2FAQm2.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/browse/_server.ts.js"],"sourcesContent":["import { readdirSync, statSync } from \"node:fs\";\nimport { join, normalize } from \"node:path\";\n//#region src/routes/api/browse/+server.ts\nasync function POST({ request }) {\n\tconst { path = \"\" } = await request.json().catch(() => ({}));\n\tlet currentPath;\n\tif (!path) currentPath = process.platform === \"win32\" ? process.cwd().slice(0, 3) : \"/\";\n\telse {\n\t\tcurrentPath = normalize(path);\n\t\tif (currentPath === \".\" || !currentPath) currentPath = process.platform === \"win32\" ? process.cwd().slice(0, 3) : \"/\";\n\t}\n\tconst parent = join(currentPath, \"..\");\n\tconst entries = [];\n\ttry {\n\t\tconst names = readdirSync(currentPath);\n\t\tfor (const name of names) {\n\t\t\tif (name.startsWith(\".\")) continue;\n\t\t\ttry {\n\t\t\t\tif (statSync(join(currentPath, name)).isDirectory()) entries.push({\n\t\t\t\t\tname,\n\t\t\t\t\tisDirectory: true\n\t\t\t\t});\n\t\t\t} catch {}\n\t\t}\n\t} catch {\n\t\treturn new Response(JSON.stringify({\n\t\t\terror: \"无法访问该路径\",\n\t\t\tpath: currentPath,\n\t\t\tentries: [],\n\t\t\tparent\n\t\t}), { headers: { \"Content-Type\": \"application/json\" } });\n\t}\n\tentries.sort((a, b) => a.name.localeCompare(b.name, \"zh-CN\"));\n\treturn new Response(JSON.stringify({\n\t\tpath: currentPath,\n\t\tentries,\n\t\tparent\n\t}), { headers: { \"Content-Type\": \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AM;AACT,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACrC,GAAG,KAAK,EAAE,SAAS;AACnB,GAAG,IAAI,EAAE,WAAW;AACpB,GAAG,OAAO,EAAE,EAAE;AACd,GAAG;AACH,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AAC1D,CAAC;AACD,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACpC,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,OAAO;AACT,EAAE;AACF,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AACzD;;;;"}
@@ -0,0 +1,106 @@
1
+ import { c as createStorage, r as readConfig } from './config-d3FC8naq.js';
2
+ import './chat-steering-DTefLITL.js';
3
+ import './prompts-tcGD1LCs.js';
4
+ import 'node:fs';
5
+ import 'node:path';
6
+ import 'node:fs/promises';
7
+ import 'node:crypto';
8
+ import 'node:child_process';
9
+ import 'node:os';
10
+ import './index.js-N7Sh42pC.js';
11
+ import 'node:module';
12
+ import 'fs';
13
+ import 'path';
14
+ import 'util';
15
+
16
+ //#region src/routes/api/sessions/+server.ts
17
+ async function GET() {
18
+ try {
19
+ const sessions = await createStorage({ enabled: readConfig().storageEnabled }).listSessions();
20
+ return new Response(JSON.stringify(sessions), { headers: { "Content-Type": "application/json" } });
21
+ } catch (e) {
22
+ return new Response(JSON.stringify({ error: e.message }), {
23
+ status: 500,
24
+ headers: { "Content-Type": "application/json" }
25
+ });
26
+ }
27
+ }
28
+ async function POST({ request }) {
29
+ try {
30
+ const body = await request.json();
31
+ const { action } = body;
32
+ const storage = createStorage({ enabled: readConfig().storageEnabled });
33
+ switch (action) {
34
+ case "create": {
35
+ const { workspace } = body;
36
+ const session = await storage.createSession(void 0, void 0, workspace || "");
37
+ return new Response(JSON.stringify(session), { headers: { "Content-Type": "application/json" } });
38
+ }
39
+ case "fork": {
40
+ const { sessionId, messageId } = body;
41
+ if (!sessionId || !messageId) return new Response(JSON.stringify({ error: "缺少 sessionId 或 messageId" }), {
42
+ status: 400,
43
+ headers: { "Content-Type": "application/json" }
44
+ });
45
+ const parentSession = await storage.getSession(sessionId);
46
+ if (!parentSession) return new Response(JSON.stringify({ error: "会话不存在" }), {
47
+ status: 404,
48
+ headers: { "Content-Type": "application/json" }
49
+ });
50
+ const allMessages = await storage.getMessages(sessionId);
51
+ const targetMsg = allMessages.find((m) => m.id === messageId);
52
+ if (!targetMsg) return new Response(JSON.stringify({ error: "消息不存在" }), {
53
+ status: 404,
54
+ headers: { "Content-Type": "application/json" }
55
+ });
56
+ const beforeMessages = allMessages.filter((m) => m.seq < targetMsg.seq && m.role !== "system");
57
+ const newSession = await storage.createSession(`[分叉] ${parentSession.title}`, parentSession.memory_snapshot, parentSession.workspace);
58
+ for (const msg of beforeMessages) await storage.addMessage(newSession.id, {
59
+ session_id: newSession.id,
60
+ role: msg.role,
61
+ content: msg.content,
62
+ reasoning_content: msg.reasoning_content,
63
+ tool_calls: msg.tool_calls,
64
+ tool_call_id: msg.tool_call_id,
65
+ name: msg.name,
66
+ usage: msg.usage
67
+ });
68
+ return new Response(JSON.stringify({
69
+ newSessionId: newSession.id,
70
+ draftContent: targetMsg.content
71
+ }), { headers: { "Content-Type": "application/json" } });
72
+ }
73
+ case "setTitle": {
74
+ const { sessionId, title } = body;
75
+ await storage.setSessionTitle(sessionId, title);
76
+ return new Response(JSON.stringify({ ok: true }), { headers: { "Content-Type": "application/json" } });
77
+ }
78
+ case "delete": {
79
+ const { sessionId } = body;
80
+ await storage.deleteSession(sessionId);
81
+ return new Response(JSON.stringify({ ok: true }), { headers: { "Content-Type": "application/json" } });
82
+ }
83
+ case "getMessages": {
84
+ const { sessionId } = body;
85
+ const messages = await storage.getMessages(sessionId);
86
+ return new Response(JSON.stringify(messages), { headers: { "Content-Type": "application/json" } });
87
+ }
88
+ case "listWorkspaces": {
89
+ const workspaces = await storage.listWorkspaces();
90
+ return new Response(JSON.stringify(workspaces), { headers: { "Content-Type": "application/json" } });
91
+ }
92
+ default: return new Response(JSON.stringify({ error: "未知操作" }), {
93
+ status: 400,
94
+ headers: { "Content-Type": "application/json" }
95
+ });
96
+ }
97
+ } catch (e) {
98
+ return new Response(JSON.stringify({ error: e.message }), {
99
+ status: 500,
100
+ headers: { "Content-Type": "application/json" }
101
+ });
102
+ }
103
+ }
104
+
105
+ export { GET, POST };
106
+ //# sourceMappingURL=_server.ts-D6NGuqud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-D6NGuqud.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/sessions/_server.ts.js"],"sourcesContent":["import { o as readConfig, x as createStorage } from \"../../../../chunks/config.js\";\n//#region src/routes/api/sessions/+server.ts\nasync function GET() {\n\ttry {\n\t\tconst sessions = await createStorage({ enabled: readConfig().storageEnabled }).listSessions();\n\t\treturn new Response(JSON.stringify(sessions), { headers: { \"Content-Type\": \"application/json\" } });\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\nasync function POST({ request }) {\n\ttry {\n\t\tconst body = await request.json();\n\t\tconst { action } = body;\n\t\tconst storage = createStorage({ enabled: readConfig().storageEnabled });\n\t\tswitch (action) {\n\t\t\tcase \"create\": {\n\t\t\t\tconst { workspace } = body;\n\t\t\t\tconst session = await storage.createSession(void 0, void 0, workspace || \"\");\n\t\t\t\treturn new Response(JSON.stringify(session), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tcase \"fork\": {\n\t\t\t\tconst { sessionId, messageId } = body;\n\t\t\t\tif (!sessionId || !messageId) return new Response(JSON.stringify({ error: \"缺少 sessionId 或 messageId\" }), {\n\t\t\t\t\tstatus: 400,\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t\t});\n\t\t\t\tconst parentSession = await storage.getSession(sessionId);\n\t\t\t\tif (!parentSession) return new Response(JSON.stringify({ error: \"会话不存在\" }), {\n\t\t\t\t\tstatus: 404,\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t\t});\n\t\t\t\tconst allMessages = await storage.getMessages(sessionId);\n\t\t\t\tconst targetMsg = allMessages.find((m) => m.id === messageId);\n\t\t\t\tif (!targetMsg) return new Response(JSON.stringify({ error: \"消息不存在\" }), {\n\t\t\t\t\tstatus: 404,\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t\t});\n\t\t\t\tconst beforeMessages = allMessages.filter((m) => m.seq < targetMsg.seq && m.role !== \"system\");\n\t\t\t\tconst newSession = await storage.createSession(`[分叉] ${parentSession.title}`, parentSession.memory_snapshot, parentSession.workspace);\n\t\t\t\tfor (const msg of beforeMessages) await storage.addMessage(newSession.id, {\n\t\t\t\t\tsession_id: newSession.id,\n\t\t\t\t\trole: msg.role,\n\t\t\t\t\tcontent: msg.content,\n\t\t\t\t\treasoning_content: msg.reasoning_content,\n\t\t\t\t\ttool_calls: msg.tool_calls,\n\t\t\t\t\ttool_call_id: msg.tool_call_id,\n\t\t\t\t\tname: msg.name,\n\t\t\t\t\tusage: msg.usage\n\t\t\t\t});\n\t\t\t\treturn new Response(JSON.stringify({\n\t\t\t\t\tnewSessionId: newSession.id,\n\t\t\t\t\tdraftContent: targetMsg.content\n\t\t\t\t}), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tcase \"setTitle\": {\n\t\t\t\tconst { sessionId, title } = body;\n\t\t\t\tawait storage.setSessionTitle(sessionId, title);\n\t\t\t\treturn new Response(JSON.stringify({ ok: true }), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tconst { sessionId } = body;\n\t\t\t\tawait storage.deleteSession(sessionId);\n\t\t\t\treturn new Response(JSON.stringify({ ok: true }), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tcase \"getMessages\": {\n\t\t\t\tconst { sessionId } = body;\n\t\t\t\tconst messages = await storage.getMessages(sessionId);\n\t\t\t\treturn new Response(JSON.stringify(messages), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tcase \"listWorkspaces\": {\n\t\t\t\tconst workspaces = await storage.listWorkspaces();\n\t\t\t\treturn new Response(JSON.stringify(workspaces), { headers: { \"Content-Type\": \"application/json\" } });\n\t\t\t}\n\t\t\tdefault: return new Response(JSON.stringify({ error: \"未知操作\" }), {\n\t\t\t\tstatus: 400,\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t\t});\n\t\t}\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\n//#endregion\nexport { GET, POST };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA;AACA,eAAe,GAAG,GAAG;AACrB,CAAC,IAAI;AACL,EAAE,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,YAAY,EAAE;AAC/F,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AACpG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;AACb,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,C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I,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AACtG,GAAG;AACH,GAAG,KAAK,gBAAgB,EAAE;AAC1B,IAAI,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,cAAc,EAAE;AACrD,IAAI,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;AACxG,GAAG;AACH,GAAG,SAAS,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;AACnE,IAAI,MAAM,EAAE,GAAG;AACf,IAAI,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AACjD,IAAI,CAAC;AACL;AACA,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;AACb,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE;AAC5D,GAAG,MAAM,EAAE,GAAG;AACd,GAAG,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB;AAChD,GAAG,CAAC;AACJ,CAAC;AACD;;;;"}
@@ -0,0 +1,26 @@
1
+ import { p as pendingSteering } from './chat-steering-DTefLITL.js';
2
+
3
+ //#region src/routes/api/steer/+server.ts
4
+ async function POST({ request }) {
5
+ try {
6
+ const { sessionId, messageId, message } = await request.json();
7
+ if (!sessionId || !messageId || !message?.trim()) return new Response(JSON.stringify({ error: "缺少参数" }), {
8
+ status: 400,
9
+ headers: { "Content-Type": "application/json" }
10
+ });
11
+ if (!pendingSteering.has(sessionId)) pendingSteering.set(sessionId, []);
12
+ pendingSteering.get(sessionId).push({
13
+ messageId,
14
+ text: message
15
+ });
16
+ return new Response(JSON.stringify({ ok: true }), { headers: { "Content-Type": "application/json" } });
17
+ } catch (e) {
18
+ return new Response(JSON.stringify({ error: e.message }), {
19
+ status: 500,
20
+ headers: { "Content-Type": "application/json" }
21
+ });
22
+ }
23
+ }
24
+
25
+ export { POST };
26
+ //# sourceMappingURL=_server.ts-DaHUgm60.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_server.ts-DaHUgm60.js","sources":["../../../.svelte-kit/output/server/entries/endpoints/api/steer/_server.ts.js"],"sourcesContent":["import { t as pendingSteering } from \"../../../../chunks/chat-steering.js\";\n//#region src/routes/api/steer/+server.ts\nasync function POST({ request }) {\n\ttry {\n\t\tconst { sessionId, messageId, message } = await request.json();\n\t\tif (!sessionId || !messageId || !message?.trim()) return new Response(JSON.stringify({ error: \"缺少参数\" }), {\n\t\t\tstatus: 400,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t\tif (!pendingSteering.has(sessionId)) pendingSteering.set(sessionId, []);\n\t\tpendingSteering.get(sessionId).push({\n\t\t\tmessageId,\n\t\t\ttext: message\n\t\t});\n\t\treturn new Response(JSON.stringify({ ok: true }), { headers: { \"Content-Type\": \"application/json\" } });\n\t} catch (e) {\n\t\treturn new Response(JSON.stringify({ error: e.message }), {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n}\n//#endregion\nexport { POST };\n"],"names":[],"mappings":";;AACA;AACA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,CAAC,IAAI;AACL,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE;AAChE,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;AAC3G,GA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