@mcy2015/pi-web 0.17.1 → 0.17.2

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 (322) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +16 -15
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +4 -4
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error/page.js +2 -2
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page.js +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +5 -5
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -4
  22. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  23. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  24. package/.next/server/app/api/agent/[id]/lease/route.js +1 -1
  25. package/.next/server/app/api/agent/[id]/route.js +1 -1
  26. package/.next/server/app/api/agent/debug/route.js +2 -2
  27. package/.next/server/app/api/agent/new/route.js +1 -1
  28. package/.next/server/app/api/agent/running/route.js +1 -1
  29. package/.next/server/app/api/app-update/route.js +1 -1
  30. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  31. package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
  32. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  33. package/.next/server/app/api/auth/providers/route.js +1 -1
  34. package/.next/server/app/api/auto-title/route.js +2 -2
  35. package/.next/server/app/api/automations/route.js +2 -2
  36. package/.next/server/app/api/cache-miss-notices/route.js +1 -1
  37. package/.next/server/app/api/channels/route.js +2 -2
  38. package/.next/server/app/api/cwd/browse/route.js +1 -1
  39. package/.next/server/app/api/cwd/validate/route.js +1 -1
  40. package/.next/server/app/api/default-cwd/route.js +1 -1
  41. package/.next/server/app/api/file-index/route.js +1 -1
  42. package/.next/server/app/api/files/[...path]/route.js +1 -1
  43. package/.next/server/app/api/git/commit/route.js +1 -1
  44. package/.next/server/app/api/git/diff/route.js +2 -2
  45. package/.next/server/app/api/git/graph/route.js +1 -1
  46. package/.next/server/app/api/git/status/route.js +1 -1
  47. package/.next/server/app/api/home/route.js +1 -1
  48. package/.next/server/app/api/mcp/route.js +2 -2
  49. package/.next/server/app/api/mcp/sign-in/[flowId]/route.js +1 -1
  50. package/.next/server/app/api/mcp/sign-in/route.js +1 -1
  51. package/.next/server/app/api/mcp/test/route.js +1 -1
  52. package/.next/server/app/api/models/default/route.js +1 -1
  53. package/.next/server/app/api/models/enabled/route.js +1 -1
  54. package/.next/server/app/api/models/refresh/route.js +1 -1
  55. package/.next/server/app/api/models/route.js +1 -1
  56. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  57. package/.next/server/app/api/models-config/discover/route.js +1 -1
  58. package/.next/server/app/api/models-config/route.js +1 -1
  59. package/.next/server/app/api/models-config/test/route.js +1 -1
  60. package/.next/server/app/api/open-in-explorer/route.js +1 -1
  61. package/.next/server/app/api/plugins/check/route.js +1 -1
  62. package/.next/server/app/api/plugins/route.js +1 -1
  63. package/.next/server/app/api/project-trust/route.js +1 -1
  64. package/.next/server/app/api/provider-usage/query/route.js +1 -1
  65. package/.next/server/app/api/push/config/route.js +1 -1
  66. package/.next/server/app/api/push/subscribe/route.js +1 -1
  67. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  68. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  69. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  70. package/.next/server/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route.js +1 -1
  71. package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
  72. package/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  73. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  74. package/.next/server/app/api/sessions/[id]/share/route.js +1 -1
  75. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  76. package/.next/server/app/api/sessions/delete/route.js +1 -1
  77. package/.next/server/app/api/sessions/route.js +1 -1
  78. package/.next/server/app/api/sessions/search/route.js +1 -1
  79. package/.next/server/app/api/sessions/stats/route.js +1 -1
  80. package/.next/server/app/api/sessions/ui-state/route.js +1 -1
  81. package/.next/server/app/api/shares/route.js +1 -0
  82. package/.next/server/app/api/shares/route.js.nft.json +1 -0
  83. package/.next/server/app/api/shares/route_client-reference-manifest.js +1 -0
  84. package/.next/server/app/api/skills/check/route.js +1 -1
  85. package/.next/server/app/api/skills/content/route.js +1 -1
  86. package/.next/server/app/api/skills/install/route.js +1 -1
  87. package/.next/server/app/api/skills/route.js +1 -1
  88. package/.next/server/app/api/skills/search/route.js +1 -1
  89. package/.next/server/app/api/skills/update/route.js +1 -1
  90. package/.next/server/app/api/subagents/[id]/route.js +1 -1
  91. package/.next/server/app/api/subagents/profiles/route.js +1 -1
  92. package/.next/server/app/api/subagents/settings/route.js +1 -1
  93. package/.next/server/app/api/terminal/[id]/events/route.js +1 -1
  94. package/.next/server/app/api/terminal/[id]/route.js +1 -1
  95. package/.next/server/app/api/terminal/route.js +1 -1
  96. package/.next/server/app/api/tools/settings/route.js +1 -1
  97. package/.next/server/app/api/usage/route.js +1 -1
  98. package/.next/server/app/api/web-auth/route.js +1 -1
  99. package/.next/server/app/api/worktrees/route.js +1 -1
  100. package/.next/server/app/favicon.ico/route.js +1 -1
  101. package/.next/server/app/files/page.js +1 -1
  102. package/.next/server/app/files/page.js.nft.json +1 -1
  103. package/.next/server/app/files/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/files.html +1 -1
  105. package/.next/server/app/files.rsc +10 -10
  106. package/.next/server/app/files.segments/_full.segment.rsc +10 -10
  107. package/.next/server/app/files.segments/_tree.segment.rsc +4 -4
  108. package/.next/server/app/files.segments/files/__PAGE__.segment.rsc +10 -10
  109. package/.next/server/app/index.html +1 -1
  110. package/.next/server/app/index.rsc +11 -11
  111. package/.next/server/app/index.segments/__PAGE__.segment.rsc +11 -11
  112. package/.next/server/app/index.segments/_full.segment.rsc +11 -11
  113. package/.next/server/app/index.segments/_tree.segment.rsc +4 -4
  114. package/.next/server/app/login/page.js +1 -1
  115. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/login.html +1 -1
  117. package/.next/server/app/login.rsc +6 -6
  118. package/.next/server/app/login.segments/_full.segment.rsc +6 -6
  119. package/.next/server/app/login.segments/_tree.segment.rsc +4 -4
  120. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +6 -6
  121. package/.next/server/app/manifest.webmanifest/route.js +1 -1
  122. package/.next/server/app/page.js +7 -7
  123. package/.next/server/app/page.js.nft.json +1 -1
  124. package/.next/server/app/page_client-reference-manifest.js +1 -1
  125. package/.next/server/app/share/[code]/page.js +1 -1
  126. package/.next/server/app/share/[code]/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app-paths-manifest.json +16 -15
  128. package/.next/server/chunks/1795.js +1 -1
  129. package/.next/server/chunks/1975.js +1 -1
  130. package/.next/server/chunks/210.js +2 -2
  131. package/.next/server/chunks/2243.js +1 -1
  132. package/.next/server/chunks/{6277.js → 3314.js} +4 -4
  133. package/.next/server/middleware-build-manifest.js +1 -1
  134. package/.next/server/pages/404.html +1 -1
  135. package/.next/server/pages/500.html +1 -1
  136. package/.next/server/preview-props.json +3 -3
  137. package/.next/server/server-reference-manifest.json +1 -1
  138. package/.next/static/chunks/1278-876b99533141f279.js +1 -0
  139. package/.next/static/chunks/284-e1e783d9e5143323.js +1 -0
  140. package/.next/static/chunks/{9176-f11528109e7d83c1.js → 7676-b24da124462459f3.js} +4 -4
  141. package/.next/static/chunks/app/_global-error/{page-88c7e2580138ec1c.js → page-d609aac1f93b26f5.js} +1 -1
  142. package/.next/static/chunks/app/api/agent/[id]/bash-output/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
  143. package/.next/static/chunks/app/api/agent/[id]/events/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
  144. package/.next/static/chunks/app/api/agent/[id]/lease/{route-88c7e2580138ec1c.js → route-d609aac1f93b26f5.js} +1 -1
  145. package/.next/static/chunks/app/api/agent/[id]/route-d609aac1f93b26f5.js +1 -0
  146. package/.next/static/chunks/app/api/agent/debug/route-d609aac1f93b26f5.js +1 -0
  147. package/.next/static/chunks/app/api/agent/new/route-d609aac1f93b26f5.js +1 -0
  148. package/.next/static/chunks/app/api/agent/running/route-d609aac1f93b26f5.js +1 -0
  149. package/.next/static/chunks/app/api/app-update/route-d609aac1f93b26f5.js +1 -0
  150. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-d609aac1f93b26f5.js +1 -0
  151. package/.next/static/chunks/app/api/auth/login/[provider]/route-d609aac1f93b26f5.js +1 -0
  152. package/.next/static/chunks/app/api/auth/logout/[provider]/route-d609aac1f93b26f5.js +1 -0
  153. package/.next/static/chunks/app/api/auth/providers/route-d609aac1f93b26f5.js +1 -0
  154. package/.next/static/chunks/app/api/auto-title/route-d609aac1f93b26f5.js +1 -0
  155. package/.next/static/chunks/app/api/automations/route-d609aac1f93b26f5.js +1 -0
  156. package/.next/static/chunks/app/api/cache-miss-notices/route-d609aac1f93b26f5.js +1 -0
  157. package/.next/static/chunks/app/api/channels/route-d609aac1f93b26f5.js +1 -0
  158. package/.next/static/chunks/app/api/cwd/browse/route-d609aac1f93b26f5.js +1 -0
  159. package/.next/static/chunks/app/api/cwd/validate/route-d609aac1f93b26f5.js +1 -0
  160. package/.next/static/chunks/app/api/default-cwd/route-d609aac1f93b26f5.js +1 -0
  161. package/.next/static/chunks/app/api/file-index/route-d609aac1f93b26f5.js +1 -0
  162. package/.next/static/chunks/app/api/files/[...path]/route-d609aac1f93b26f5.js +1 -0
  163. package/.next/static/chunks/app/api/git/commit/route-d609aac1f93b26f5.js +1 -0
  164. package/.next/static/chunks/app/api/git/diff/route-d609aac1f93b26f5.js +1 -0
  165. package/.next/static/chunks/app/api/git/graph/route-d609aac1f93b26f5.js +1 -0
  166. package/.next/static/chunks/app/api/git/status/route-d609aac1f93b26f5.js +1 -0
  167. package/.next/static/chunks/app/api/home/route-d609aac1f93b26f5.js +1 -0
  168. package/.next/static/chunks/app/api/mcp/route-d609aac1f93b26f5.js +1 -0
  169. package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-d609aac1f93b26f5.js +1 -0
  170. package/.next/static/chunks/app/api/mcp/sign-in/route-d609aac1f93b26f5.js +1 -0
  171. package/.next/static/chunks/app/api/mcp/test/route-d609aac1f93b26f5.js +1 -0
  172. package/.next/static/chunks/app/api/models/default/route-d609aac1f93b26f5.js +1 -0
  173. package/.next/static/chunks/app/api/models/enabled/route-d609aac1f93b26f5.js +1 -0
  174. package/.next/static/chunks/app/api/models/refresh/route-d609aac1f93b26f5.js +1 -0
  175. package/.next/static/chunks/app/api/models/route-d609aac1f93b26f5.js +1 -0
  176. package/.next/static/chunks/app/api/models-config/catalog/route-d609aac1f93b26f5.js +1 -0
  177. package/.next/static/chunks/app/api/models-config/discover/route-d609aac1f93b26f5.js +1 -0
  178. package/.next/static/chunks/app/api/models-config/route-d609aac1f93b26f5.js +1 -0
  179. package/.next/static/chunks/app/api/models-config/test/route-d609aac1f93b26f5.js +1 -0
  180. package/.next/static/chunks/app/api/open-in-explorer/route-d609aac1f93b26f5.js +1 -0
  181. package/.next/static/chunks/app/api/plugins/check/route-d609aac1f93b26f5.js +1 -0
  182. package/.next/static/chunks/app/api/plugins/route-d609aac1f93b26f5.js +1 -0
  183. package/.next/static/chunks/app/api/project-trust/route-d609aac1f93b26f5.js +1 -0
  184. package/.next/static/chunks/app/api/provider-usage/query/route-d609aac1f93b26f5.js +1 -0
  185. package/.next/static/chunks/app/api/push/config/route-d609aac1f93b26f5.js +1 -0
  186. package/.next/static/chunks/app/api/push/subscribe/route-d609aac1f93b26f5.js +1 -0
  187. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-d609aac1f93b26f5.js +1 -0
  188. package/.next/static/chunks/app/api/sessions/[id]/context/route-d609aac1f93b26f5.js +1 -0
  189. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-d609aac1f93b26f5.js +1 -0
  190. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-d609aac1f93b26f5.js +1 -0
  191. package/.next/static/chunks/app/api/sessions/[id]/export/route-d609aac1f93b26f5.js +1 -0
  192. package/.next/static/chunks/app/api/sessions/[id]/fork/route-d609aac1f93b26f5.js +1 -0
  193. package/.next/static/chunks/app/api/sessions/[id]/route-d609aac1f93b26f5.js +1 -0
  194. package/.next/static/chunks/app/api/sessions/[id]/share/route-d609aac1f93b26f5.js +1 -0
  195. package/.next/static/chunks/app/api/sessions/[id]/state/route-d609aac1f93b26f5.js +1 -0
  196. package/.next/static/chunks/app/api/sessions/delete/route-d609aac1f93b26f5.js +1 -0
  197. package/.next/static/chunks/app/api/sessions/route-d609aac1f93b26f5.js +1 -0
  198. package/.next/static/chunks/app/api/sessions/search/route-d609aac1f93b26f5.js +1 -0
  199. package/.next/static/chunks/app/api/sessions/stats/route-d609aac1f93b26f5.js +1 -0
  200. package/.next/static/chunks/app/api/sessions/ui-state/route-d609aac1f93b26f5.js +1 -0
  201. package/.next/static/chunks/app/api/shares/route-d609aac1f93b26f5.js +1 -0
  202. package/.next/static/chunks/app/api/skills/check/route-d609aac1f93b26f5.js +1 -0
  203. package/.next/static/chunks/app/api/skills/content/route-d609aac1f93b26f5.js +1 -0
  204. package/.next/static/chunks/app/api/skills/install/route-d609aac1f93b26f5.js +1 -0
  205. package/.next/static/chunks/app/api/skills/route-d609aac1f93b26f5.js +1 -0
  206. package/.next/static/chunks/app/api/skills/search/route-d609aac1f93b26f5.js +1 -0
  207. package/.next/static/chunks/app/api/skills/update/route-d609aac1f93b26f5.js +1 -0
  208. package/.next/static/chunks/app/api/subagents/[id]/route-d609aac1f93b26f5.js +1 -0
  209. package/.next/static/chunks/app/api/subagents/profiles/route-d609aac1f93b26f5.js +1 -0
  210. package/.next/static/chunks/app/api/subagents/settings/route-d609aac1f93b26f5.js +1 -0
  211. package/.next/static/chunks/app/api/terminal/[id]/events/route-d609aac1f93b26f5.js +1 -0
  212. package/.next/static/chunks/app/api/terminal/[id]/route-d609aac1f93b26f5.js +1 -0
  213. package/.next/static/chunks/app/api/terminal/route-d609aac1f93b26f5.js +1 -0
  214. package/.next/static/chunks/app/api/tools/settings/route-d609aac1f93b26f5.js +1 -0
  215. package/.next/static/chunks/app/api/usage/route-d609aac1f93b26f5.js +1 -0
  216. package/.next/static/chunks/app/api/web-auth/route-d609aac1f93b26f5.js +1 -0
  217. package/.next/static/chunks/app/api/worktrees/route-d609aac1f93b26f5.js +1 -0
  218. package/.next/static/chunks/app/files/{page-40308d21a9d1a26a.js → page-352f61869d357327.js} +1 -1
  219. package/.next/static/chunks/app/{layout-eda1fa79c5ba3062.js → layout-4ca77cad75a0bfc8.js} +1 -1
  220. package/.next/static/chunks/app/manifest.webmanifest/route-d609aac1f93b26f5.js +1 -0
  221. package/.next/static/chunks/app/page-ebc3272cf64b5bd8.js +1457 -0
  222. package/.next/static/chunks/app/share/[code]/page-4fde087c2bde8c42.js +1 -0
  223. package/.next/static/chunks/next/dist/client/components/builtin/app-error-d609aac1f93b26f5.js +1 -0
  224. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d609aac1f93b26f5.js +1 -0
  225. package/.next/static/chunks/next/dist/client/components/builtin/not-found-d609aac1f93b26f5.js +1 -0
  226. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d609aac1f93b26f5.js +1 -0
  227. package/.next/static/chunks/{webpack-44982447a18652d3.js → webpack-5da211d332d8592e.js} +1 -1
  228. package/.next/static/css/{5739c029a2a29694.css → a14d8fc049aae12c.css} +1 -1
  229. package/.next/static/css/d53051ff70f97c47.css +1 -0
  230. package/.next/static/css/d948f02f49c0cac8.css +1 -0
  231. package/.next/static/xtVraug33Zuh6-oCFF6TA/_buildManifest.js +1 -0
  232. package/.next/trace +38 -208
  233. package/.next/trace-build +1 -1
  234. package/.next/types/app/api/shares/route.ts +355 -0
  235. package/.next/types/routes.d.ts +2 -1
  236. package/.next/types/validator.ts +10 -0
  237. package/package.json +1 -1
  238. package/.next/static/_884wk2ryoAjRUvJAc4GP/_buildManifest.js +0 -1
  239. package/.next/static/chunks/1278-21d0e32dd826a688.js +0 -1
  240. package/.next/static/chunks/8045-5d165548a0c7f7c5.js +0 -1
  241. package/.next/static/chunks/app/api/agent/[id]/route-88c7e2580138ec1c.js +0 -1
  242. package/.next/static/chunks/app/api/agent/debug/route-88c7e2580138ec1c.js +0 -1
  243. package/.next/static/chunks/app/api/agent/new/route-88c7e2580138ec1c.js +0 -1
  244. package/.next/static/chunks/app/api/agent/running/route-88c7e2580138ec1c.js +0 -1
  245. package/.next/static/chunks/app/api/app-update/route-88c7e2580138ec1c.js +0 -1
  246. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-88c7e2580138ec1c.js +0 -1
  247. package/.next/static/chunks/app/api/auth/login/[provider]/route-88c7e2580138ec1c.js +0 -1
  248. package/.next/static/chunks/app/api/auth/logout/[provider]/route-88c7e2580138ec1c.js +0 -1
  249. package/.next/static/chunks/app/api/auth/providers/route-88c7e2580138ec1c.js +0 -1
  250. package/.next/static/chunks/app/api/auto-title/route-88c7e2580138ec1c.js +0 -1
  251. package/.next/static/chunks/app/api/automations/route-88c7e2580138ec1c.js +0 -1
  252. package/.next/static/chunks/app/api/cache-miss-notices/route-88c7e2580138ec1c.js +0 -1
  253. package/.next/static/chunks/app/api/channels/route-88c7e2580138ec1c.js +0 -1
  254. package/.next/static/chunks/app/api/cwd/browse/route-88c7e2580138ec1c.js +0 -1
  255. package/.next/static/chunks/app/api/cwd/validate/route-88c7e2580138ec1c.js +0 -1
  256. package/.next/static/chunks/app/api/default-cwd/route-88c7e2580138ec1c.js +0 -1
  257. package/.next/static/chunks/app/api/file-index/route-88c7e2580138ec1c.js +0 -1
  258. package/.next/static/chunks/app/api/files/[...path]/route-88c7e2580138ec1c.js +0 -1
  259. package/.next/static/chunks/app/api/git/commit/route-88c7e2580138ec1c.js +0 -1
  260. package/.next/static/chunks/app/api/git/diff/route-88c7e2580138ec1c.js +0 -1
  261. package/.next/static/chunks/app/api/git/graph/route-88c7e2580138ec1c.js +0 -1
  262. package/.next/static/chunks/app/api/git/status/route-88c7e2580138ec1c.js +0 -1
  263. package/.next/static/chunks/app/api/home/route-88c7e2580138ec1c.js +0 -1
  264. package/.next/static/chunks/app/api/mcp/route-88c7e2580138ec1c.js +0 -1
  265. package/.next/static/chunks/app/api/mcp/sign-in/[flowId]/route-88c7e2580138ec1c.js +0 -1
  266. package/.next/static/chunks/app/api/mcp/sign-in/route-88c7e2580138ec1c.js +0 -1
  267. package/.next/static/chunks/app/api/mcp/test/route-88c7e2580138ec1c.js +0 -1
  268. package/.next/static/chunks/app/api/models/default/route-88c7e2580138ec1c.js +0 -1
  269. package/.next/static/chunks/app/api/models/enabled/route-88c7e2580138ec1c.js +0 -1
  270. package/.next/static/chunks/app/api/models/refresh/route-88c7e2580138ec1c.js +0 -1
  271. package/.next/static/chunks/app/api/models/route-88c7e2580138ec1c.js +0 -1
  272. package/.next/static/chunks/app/api/models-config/catalog/route-88c7e2580138ec1c.js +0 -1
  273. package/.next/static/chunks/app/api/models-config/discover/route-88c7e2580138ec1c.js +0 -1
  274. package/.next/static/chunks/app/api/models-config/route-88c7e2580138ec1c.js +0 -1
  275. package/.next/static/chunks/app/api/models-config/test/route-88c7e2580138ec1c.js +0 -1
  276. package/.next/static/chunks/app/api/open-in-explorer/route-88c7e2580138ec1c.js +0 -1
  277. package/.next/static/chunks/app/api/plugins/check/route-88c7e2580138ec1c.js +0 -1
  278. package/.next/static/chunks/app/api/plugins/route-88c7e2580138ec1c.js +0 -1
  279. package/.next/static/chunks/app/api/project-trust/route-88c7e2580138ec1c.js +0 -1
  280. package/.next/static/chunks/app/api/provider-usage/query/route-88c7e2580138ec1c.js +0 -1
  281. package/.next/static/chunks/app/api/push/config/route-88c7e2580138ec1c.js +0 -1
  282. package/.next/static/chunks/app/api/push/subscribe/route-88c7e2580138ec1c.js +0 -1
  283. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-88c7e2580138ec1c.js +0 -1
  284. package/.next/static/chunks/app/api/sessions/[id]/context/route-88c7e2580138ec1c.js +0 -1
  285. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-88c7e2580138ec1c.js +0 -1
  286. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/tool-result-image/route-88c7e2580138ec1c.js +0 -1
  287. package/.next/static/chunks/app/api/sessions/[id]/export/route-88c7e2580138ec1c.js +0 -1
  288. package/.next/static/chunks/app/api/sessions/[id]/fork/route-88c7e2580138ec1c.js +0 -1
  289. package/.next/static/chunks/app/api/sessions/[id]/route-88c7e2580138ec1c.js +0 -1
  290. package/.next/static/chunks/app/api/sessions/[id]/share/route-88c7e2580138ec1c.js +0 -1
  291. package/.next/static/chunks/app/api/sessions/[id]/state/route-88c7e2580138ec1c.js +0 -1
  292. package/.next/static/chunks/app/api/sessions/delete/route-88c7e2580138ec1c.js +0 -1
  293. package/.next/static/chunks/app/api/sessions/route-88c7e2580138ec1c.js +0 -1
  294. package/.next/static/chunks/app/api/sessions/search/route-88c7e2580138ec1c.js +0 -1
  295. package/.next/static/chunks/app/api/sessions/stats/route-88c7e2580138ec1c.js +0 -1
  296. package/.next/static/chunks/app/api/sessions/ui-state/route-88c7e2580138ec1c.js +0 -1
  297. package/.next/static/chunks/app/api/skills/check/route-88c7e2580138ec1c.js +0 -1
  298. package/.next/static/chunks/app/api/skills/content/route-88c7e2580138ec1c.js +0 -1
  299. package/.next/static/chunks/app/api/skills/install/route-88c7e2580138ec1c.js +0 -1
  300. package/.next/static/chunks/app/api/skills/route-88c7e2580138ec1c.js +0 -1
  301. package/.next/static/chunks/app/api/skills/search/route-88c7e2580138ec1c.js +0 -1
  302. package/.next/static/chunks/app/api/skills/update/route-88c7e2580138ec1c.js +0 -1
  303. package/.next/static/chunks/app/api/subagents/[id]/route-88c7e2580138ec1c.js +0 -1
  304. package/.next/static/chunks/app/api/subagents/profiles/route-88c7e2580138ec1c.js +0 -1
  305. package/.next/static/chunks/app/api/subagents/settings/route-88c7e2580138ec1c.js +0 -1
  306. package/.next/static/chunks/app/api/terminal/[id]/events/route-88c7e2580138ec1c.js +0 -1
  307. package/.next/static/chunks/app/api/terminal/[id]/route-88c7e2580138ec1c.js +0 -1
  308. package/.next/static/chunks/app/api/terminal/route-88c7e2580138ec1c.js +0 -1
  309. package/.next/static/chunks/app/api/tools/settings/route-88c7e2580138ec1c.js +0 -1
  310. package/.next/static/chunks/app/api/usage/route-88c7e2580138ec1c.js +0 -1
  311. package/.next/static/chunks/app/api/web-auth/route-88c7e2580138ec1c.js +0 -1
  312. package/.next/static/chunks/app/api/worktrees/route-88c7e2580138ec1c.js +0 -1
  313. package/.next/static/chunks/app/manifest.webmanifest/route-88c7e2580138ec1c.js +0 -1
  314. package/.next/static/chunks/app/page-73ec0dba1c5214c8.js +0 -1457
  315. package/.next/static/chunks/app/share/[code]/page-f4850ac677cd51a1.js +0 -1
  316. package/.next/static/chunks/next/dist/client/components/builtin/app-error-88c7e2580138ec1c.js +0 -1
  317. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-88c7e2580138ec1c.js +0 -1
  318. package/.next/static/chunks/next/dist/client/components/builtin/not-found-88c7e2580138ec1c.js +0 -1
  319. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-88c7e2580138ec1c.js +0 -1
  320. package/.next/static/css/83a179aa16591ae4.css +0 -1
  321. package/.next/static/css/c99d24fe85e139cc.css +0 -1
  322. /package/.next/static/{_884wk2ryoAjRUvJAc4GP → xtVraug33Zuh6-oCFF6TA}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[284],{1518:(e,t,n)=>{n.d(t,{O:()=>o,d:()=>i});let r=/^<skill name="([^"\n]+)" location="([^"\n]+)">\nReferences are relative to [^\n]+\.\n\n([\s\S]*)\n<\/skill>(?:\n\n([\s\S]+))?$/;function i(e){let t=e.match(r);if(!t)return null;let[,n,,,i]=t;return i?`/skill:${n} ${i}`:`/skill:${n}`}function o(e){let t=e.match(r);if(!t)return null;let n=t[4],i=void 0===n?9:11+n.length;return e.slice(e.indexOf("\n")+1,e.length-i)}},2849:(e,t,n)=>{n.d(t,{m:()=>$});var r=n(95155),i=n(12115),o=n(32316),l=n(21278),a=n(7834),s=n(19870),d=n(28999),c=n(35754),u=n(68925);let p=/^ {0,3}(`{3,}|~{3,})/,f=/^(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,h=/<[A-Za-z!/?]/,x=/`[^`]*`/g,g=/^ {0,3}\[[^\]]+\]:/,m=/^(`{3,}|~{3,})[ \t]*([^`\s]*)[^`]*$/;var y=n(8436),v=n(22408);let b="http://www.w3.org/2000/svg";function w(e,t){let n=t.parseFromString(e,"image/svg+xml");return n.getElementsByTagName("parsererror").length>0?null:n.documentElement}function j(e){let{code:t,isStreaming:n}=e,{t:o}=(0,l.s)(),[a,s]=(0,i.useState)(!0),[d,c]=(0,i.useState)(!1),[u,p]=(0,i.useState)(null),[f,h]=(0,i.useState)(null),x=a&&!n,g=(0,i.useMemo)(()=>{var e;let n,r;return x&&"u">typeof DOMParser?(e=new DOMParser,r=w(n=t,e),r?.localName!=="svg"||null!==r.namespaceURI||r.hasAttribute("xmlns")||(r=w(n=t.replace(/<svg(?=[\s/>])/,`<svg xmlns="${b}"`),e)),r?.localName==="svg"&&r.namespaceURI===b?n:null):void 0},[t,x]),m=(0,i.useMemo)(()=>g?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g)}`:null,[g]),y=(0,i.useMemo)(()=>(0,r.jsx)(v.hB,{isStreaming:n,previewVisible:x,onToggle:()=>s(e=>!e),title:x?o("i18n.showSvgSource"):o("i18n.previewSvg")}),[n,x,o]);if(!x)return(0,r.jsx)(v.NG,{code:t,lang:"svg",headerAction:y,isStreaming:n});let j=null!==m&&u!==m,k=e=>(0,r.jsx)("img",{src:m??void 0,alt:o("i18n.svgImage"),className:[e,f===m?"is-unsized":""].filter(Boolean).join(" "),onLoad:e=>{let{naturalWidth:t,naturalHeight:n}=e.currentTarget;t&&n||h(m)},onError:()=>p(m)});return(0,r.jsx)(v.wL,{lang:"svg",actions:(0,r.jsxs)(r.Fragment,{children:[j&&g&&(0,r.jsx)(v.fP,{onClick:()=>(0,v.Rb)(g,"image.svg")}),y]}),children:void 0===g?(0,r.jsx)("div",{className:"mermaid-block mermaid-block-loading"}):j?(0,r.jsxs)(r.Fragment,{children:[!d&&(0,r.jsx)("button",{type:"button",className:"mermaid-block mermaid-preview-button",title:o("i18n.openSvgViewer"),"aria-label":o("i18n.openSvgViewer"),onClick:()=>c(!0),children:k("svg-block-image")}),d&&(0,r.jsx)(v.nT,{title:o("i18n.svgImage"),label:o("i18n.svgViewer"),onClose:()=>c(!1),children:k("svg-zoom-image")})]}):(0,r.jsx)("div",{className:"mermaid-block mermaid-block-error",children:o("i18n.invalidSvg")})})}let k=(0,i.createContext)(!1);function S(e){let{src:t,alt:n,cwd:o,...l}=e,a=(0,i.useContext)(k);delete l.node;let u="string"==typeof t?t:void 0,p=u?(0,s.Vc)(u,o):null,f=p?`/api/files/${(0,d.HG)(p)}?type=read`:u,h=p??u?.split(/[?#]/,1)[0]??"",x=n?.trim()?n:void 0;if((0,c.EC)(h))return(0,r.jsx)("audio",{controls:!0,preload:"metadata",src:f,"aria-label":x});if((0,c.t9)(h))return(0,r.jsx)("video",{controls:!0,playsInline:!0,preload:"metadata",src:f,"aria-label":x});let g=(0,r.jsx)("img",{src:f,alt:n??"",loading:"lazy",...l});return!f||a?g:(0,r.jsx)(y.k,{src:f,alt:n??"",className:"markdown-image",children:g})}function C(e){let{source:t,children:n}=e,{t:o}=(0,l.s)(),[s,d]=(0,i.useState)(!1);return(0,r.jsxs)("div",{className:"markdown-math-display",children:[n,(0,r.jsx)("button",{type:"button",onClick:()=>{(0,a.D)(t).then(()=>{d(!0),setTimeout(()=>d(!1),1500)},()=>{})},className:"markdown-code-action markdown-math-copy",children:o(s?"i18n.copied":"i18n.copy")})]})}let M=(0,i.memo)(function(e){let{markdown:t,remarkPlugins:n,urlTransform:i,rehypePlugins:l,components:a}=e;return(0,r.jsx)(o.oz,{remarkPlugins:n,rehypePlugins:l,urlTransform:i,components:a,children:t})});function W(e,t,n){return"mermaid"===e?(0,r.jsx)(v.t,{code:t,isStreaming:n,defaultPreview:!0}):"svg"===e?(0,r.jsx)(j,{code:t,isStreaming:n}):(0,r.jsx)(v.NG,{code:t,lang:e,isStreaming:n})}let $=(0,i.memo)(function(e){let{children:t,className:n,isStreaming:o,cwd:l,onOpenFile:a,onNavigateLink:d,keepLineBreaks:c,keepTextLayout:y}=e,v=(0,i.useMemo)(()=>(0,u.Ep)(t),[t]),b=(0,i.useMemo)(()=>o?function(e){let t=e.split("\n");if(/^---[ \t]*\r?$/.test(t[0]))return[e];let n=[],r=[],i=null,o=!1,l=!1,a=!1;for(let s of t){let t=""===s.trim();!a||t||i||o||l||!(r.length>0)||/^[ \t]/.test(s)||f.test(s)||(n.push(r.join("\n")+"\n"),r=[]),r.push(s);let d=s.match(p);if(d){let e=d[1][0],t=d[1].length;i?e===i.marker&&t>=i.size&&/^[ \t]*\r?$/.test(s.slice(d[0].length))&&(i=null):i={marker:e,size:t}}else if(!i){if(g.test(s))return[e];let t=s.replace(x,"");h.test(t)&&(l=!0),(t.match(/\$\$/g)?.length??0)%2==1&&(o=!o)}a=t}return n.push(r.join("\n")),n}(v):[v],[o,v]),w=(0,i.useMemo)(()=>({code(e){let{className:t,children:n,...i}=e,l=t?.replace("language-","").toLowerCase()??"",a=String(n);return t?.includes("language-")||a.includes("\n")?W(l,a.replace(/\n$/,""),o):(0,r.jsx)("code",{className:"markdown-inline-code",...i,children:n})},pre(e){let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})},a(e){let{href:t,children:n,...i}=e;if(delete i.node,d&&t&&!(0,u.AA)(t)){let e=()=>d(t);return(0,r.jsx)(k.Provider,{value:!0,children:(0,r.jsx)("a",{...i,role:"link",tabIndex:0,onClick:e,onKeyDown:t=>{"Enter"===t.key&&e()},children:n})})}if(t?.startsWith("#"))return(0,r.jsx)(k.Provider,{value:!0,children:(0,r.jsx)("a",{href:t,...i,onClick:u.xq,children:n})});let o=a?(0,s.Vc)(t,l):null;return o&&a?(0,r.jsx)(k.Provider,{value:!0,children:(0,r.jsx)("a",{href:t,...i,onClick:e=>{if(!(0,s.pz)(e))return;let n=e.currentTarget.getAttribute("target");n&&"_self"!==n||(e.preventDefault(),a(o,(0,s.XJ)(t)??void 0))},children:n})}):(0,r.jsx)(k.Provider,{value:!0,children:(0,r.jsx)("a",{href:t,...i,target:"_blank",rel:"noopener noreferrer",children:n})})},img:e=>(0,r.jsx)(S,{cwd:l,...e}),ol(e){let{node:t,start:n,style:i,...o}=e,l=String(Math.abs((n??1)+Math.max(t?.children.filter(e=>"element"===e.type&&"li"===e.tagName).length??0,1)-1)).length;return(0,r.jsx)("ol",{start:n,style:{...i,"--ol-marker-digits":Math.max(l,2)},...o})},div(e){let{node:t,children:n,...i}=e,o=t?.properties?.dataMathSource;return"string"==typeof o?(0,r.jsx)(C,{source:o,children:n}):(0,r.jsx)("div",{...i,children:n})},table(e){let{children:t}=e;return(0,r.jsx)("div",{className:"markdown-table-frame",children:(0,r.jsx)("div",{className:"markdown-table-wrap",children:(0,r.jsx)("table",{children:t})})})}}),[l,o,a,d]);return(0,r.jsx)("div",{className:["markdown-body",o?"is-streaming":null,n].filter(Boolean).join(" "),children:b.map((e,t)=>{let n=o?function(e){if(e.includes("\r"))return null;let t=e.split("\n"),n=t[0].match(m);if(!n||/[\\&]/.test(n[2]))return null;let r=n[1][0],i=n[1].length,o=-1;for(let e=1;e<t.length;e+=1){let n=t[e].match(/^ {0,3}(`{3,}|~{3,})[ \t]*$/);if(n&&n[1][0]===r&&n[1].length>=i){o=e;break}}if(-1!==o&&t.slice(o+1).some(e=>""!==e.trim()))return null;let l=n[2].toLowerCase();if("math"===l)return null;let a=-1!==o?o:t.length>1&&""===t[t.length-1]?t.length-1:t.length;return{lang:l,code:t.slice(1,a).join("\n")}}(e):null;return n?(0,r.jsx)(i.Fragment,{children:W(n.lang,n.code,!0)},t):(0,r.jsx)(M,{markdown:e,remarkPlugins:y?u.Hm:c?u.$7:u.u_,urlTransform:a?u.t9:u.SG,rehypePlugins:d?u.o9:u.LO,components:w},t)})})})},6483:(e,t,n)=>{n.d(t,{G:()=>r});function r(e){return!!e&&"object"==typeof e&&"pi-web-subagent"===e.kind&&"string"==typeof e.sessionId}},8436:(e,t,n)=>{n.d(t,{k:()=>l});var r=n(95155),i=n(12115),o=n(21278);function l(e){let{src:t,alt:n="",children:l,className:a,style:s}=e,{t:d}=(0,o.s)(),c=d("chat.previewImage"),u=n.trim()?`${c}: ${n}`:c,[p,f]=(0,i.useState)(!1),h=(0,i.useRef)(null),x=(0,i.useRef)(null),g=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!p)return;let e=x.current;if(!e)return;let t=h.current,n=document.body.style.overflow;return document.body.style.overflow="hidden",e.showModal(),g.current?.focus({preventScroll:!0}),()=>{document.body.style.overflow=n,e.open&&e.close(),t?.isConnected&&t.focus({preventScroll:!0})}},[p]);let m=()=>{x.current?.open&&x.current.close(),f(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:h,type:"button",className:a,style:{display:"block",padding:0,border:"none",background:"none",color:"inherit",cursor:"zoom-in",...s},onClick:()=>f(!0),"aria-label":u,"aria-haspopup":"dialog","aria-expanded":p,title:c,children:l}),p&&(0,r.jsxs)("dialog",{ref:x,className:"image-preview-dialog","aria-label":d("chat.previewImage"),onCancel:e=>{e.preventDefault(),e.stopPropagation(),m()},onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),m())},onClick:e=>{e.target===e.currentTarget&&m()},children:[(0,r.jsx)("img",{className:"image-preview-image",src:t,alt:n}),(0,r.jsx)("button",{ref:g,type:"button",className:"image-preview-close",onClick:m,"aria-label":d("chat.close"),title:d("chat.close"),children:(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})]})]})}},11316:(e,t,n)=>{n.d(t,{n_:()=>l});let r=["pending","in_progress","completed"],i=["high","medium","low"];function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||"toolResult"!==n.role)continue;let l=n.toolName,a=n.details;if(("TodoWrite"===l||"TodoRead"===l)&&function(e){if(!o(e)||"pi-web-todo"!==e.kind||!Array.isArray(e.todos))return!1;for(let t of e.todos)if(null===function(e){if(!o(e)||"string"!=typeof e.content||"string"!=typeof e.status||!r.includes(e.status))return null;let t=e.priority;return null==t||"string"==typeof t&&i.includes(t)?{content:e.content,status:e.status,...null==t?{}:{priority:t}}:null}(t))return!1;return null!==function(e){if(!o(e))return null;let{total:t,pending:n,inProgress:r,completed:i}=e;return"number"==typeof t&&Number.isFinite(t)&&"number"==typeof n&&Number.isFinite(n)&&"number"==typeof r&&Number.isFinite(r)&&"number"==typeof i&&Number.isFinite(i)?{total:t,pending:n,inProgress:r,completed:i}:null}(e.counts)}(a))return{todos:a.todos.map(e=>({...e})),counts:{...a.counts}};if("todo"===l){let e=function(e){if(!o(e)||!Array.isArray(e.tasks))return null;let t=[];for(let n of e.tasks)o(n)&&"deleted"!==n.status&&"string"==typeof n.subject&&"string"==typeof n.status&&r.includes(n.status)&&t.push({content:n.subject,status:n.status});return{todos:t,counts:function(e){let t={total:e.length,pending:0,inProgress:0,completed:0};for(let n of e)"pending"===n.status?t.pending+=1:"in_progress"===n.status?t.inProgress+=1:t.completed+=1;return t}(t)}}(a);if(e)return e}}return null}},14667:(e,t,n)=>{function r(e){let t=e.toLowerCase();return"write"===t||t.startsWith("write_")||t.endsWith(".write")||t.endsWith("_write")}function i(e){let t=e.toLowerCase();return"edit"===t||t.startsWith("edit_")||t.endsWith(".edit")||t.endsWith("_edit")||t.includes("str_replace")||t.includes("replace_editor")}function o(e){let t=e.toLowerCase();return"apply_patch"===t||t.startsWith("apply_patch_")||t.endsWith(".apply_patch")||t.endsWith("_apply_patch")}function l(e){let t=e.toLowerCase();return"bash"===t||"shell"===t||"run_command"===t||"execute_command"===t||t.endsWith(".bash")||t.endsWith("_bash")}n.d(t,{V4:()=>r,Y2:()=>l,aP:()=>o,iG:()=>i})},19109:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(95155),i=n(12115);let o="pi-web:todo-panel-collapsed";function l(){try{return window.localStorage}catch{return null}}function a(e){let{status:t,color:n}=e;return(0,r.jsx)("span",{"aria-hidden":"true",className:"in_progress"===t?"animate-[pulse_1.5s_infinite] motion-reduce:animate-none":void 0,style:{flexShrink:0,width:14,textAlign:"center",fontFamily:"var(--font-mono)",lineHeight:"inherit",color:n},children:"completed"===t?"✓":"in_progress"===t?"◐":"○"})}function s(e){let t,{snapshot:n}=e,[s,d]=(0,i.useState)(()=>(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l();if(!e)return!0;try{return"false"!==e.getItem(o)}catch{return!0}})());if(!n||0===n.todos.length)return null;let{todos:c,counts:u}=n,p=c.find(e=>"in_progress"===e.status)??null,f=p?p.content:u.pending>0?(t=u.pending,`${t} remaining`):"All done",h=p?"in_progress":u.pending>0?"pending":"completed",x=`${u.completed}/${u.total}`;return(0,r.jsx)("div",{style:{padding:"0 16px",marginBottom:8},children:(0,r.jsxs)("div",{style:{maxWidth:"var(--chat-content-max-width, 820px)",margin:"0 auto"},children:[(0,r.jsxs)("button",{type:"button","aria-expanded":!s,"aria-label":`Todos ${x} \xb7 ${f}`,title:s?"Expand todos":"Collapse todos",onClick:()=>{let e=!s;d(e),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();if(t)try{t.setItem(o,String(e))}catch{}}(e)},style:{display:"flex",alignItems:"center",gap:7,width:"100%",minWidth:0,minHeight:24,padding:"2px 0",border:"none",background:"transparent",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},children:[(0,r.jsx)(a,{status:h,color:"var(--text-muted)"}),(0,r.jsx)("span",{"aria-hidden":"true",style:{flexShrink:0,fontFamily:"var(--font-mono)",color:"var(--text-dim)"},children:x}),(0,r.jsx)("span",{"aria-hidden":"true",style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,transform:s?"none":"rotate(90deg)",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"4 2.5 7.5 6 4 9.5"})})]}),!s&&(0,r.jsx)("ul",{style:{listStyle:"none",margin:"4px 0 0",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:7,background:"var(--bg-panel)",maxHeight:"min(240px, 30dvh)",overflowY:"auto",overscrollBehavior:"contain",display:"flex",flexDirection:"column",gap:4,minWidth:0},children:c.map((e,t)=>(0,r.jsxs)("li",{style:{display:"flex",alignItems:"flex-start",gap:7,minWidth:0,fontSize:12,lineHeight:1.5,color:"var(--text)"},children:[(0,r.jsx)(a,{status:e.status,color:"completed"===e.status?"var(--text-dim)":"var(--text-muted)"}),(0,r.jsx)("span",{style:{flex:1,minWidth:0,overflowWrap:"anywhere",color:"completed"===e.status?"var(--text-muted)":"var(--text)",textDecoration:"completed"===e.status?"line-through":void 0},children:e.content}),"high"===e.priority&&(0,r.jsx)("span",{title:"High priority",style:{flexShrink:0,marginTop:1,padding:"0 5px",border:"1px solid var(--accent)",borderRadius:999,color:"var(--accent)",fontSize:10,lineHeight:"16px",whiteSpace:"nowrap"},children:"high"})]},t))})]})})}},21813:(e,t,n)=>{n.d(t,{Dx:()=>eo});var r=n(95155),i=n(12115),o=n(32316),l=n(2849),a=n(21278),s=n(64738);function d(e){let{note:t,cwd:n,onOpenFile:i}=e,{t:o}=(0,a.s)(),d=[],c=t.usage?.totalTokens;void 0!==c&&c>0&&d.push((0,s.eX)(c));let u=(0,s.tb)(t.usage?.cost?.total??0);return u&&d.push(u),(0,r.jsx)("div",{style:{marginBottom:16},children:(0,r.jsxs)("div",{style:{border:"1px solid var(--border)",borderRadius:8,overflow:"hidden",background:"var(--bg)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderBottom:"1px solid var(--border)",background:"var(--bg-panel)",color:"var(--text-muted)",fontSize:12},children:[(0,r.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:650,flexShrink:0},children:"btw"}),(t.provider||t.model)&&(0,r.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.provider,t.model].filter(Boolean).join("/")}),d.length>0&&(0,r.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:d.join(" \xb7 ")})]}),(0,r.jsxs)("div",{style:{padding:"10px 12px",display:"flex",flexDirection:"column",gap:10},children:[""!==t.question&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:3},children:o("btw.question")}),(0,r.jsx)("div",{style:{color:"var(--text-muted)",fontSize:"calc(13px + var(--chat-font-size-offset, 0px))",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t.question})]}),""!==t.answer&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:3},children:o("btw.answer")}),(0,r.jsx)(l.m,{cwd:n,onOpenFile:i,children:t.answer})]})]})]})})}var c=n(8436);function u(e){let{active:t,size:n=14}=e;return(0,r.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0},children:[(0,r.jsx)("path",{d:"M9.5 2A5.5 5.5 0 0 0 4 7.5c0 1.7.78 3.21 2 4.21V14a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2.29c1.22-1 2-2.51 2-4.21A5.5 5.5 0 0 0 9.5 2z",stroke:t?"#d4a017":void 0,fill:t?"rgba(250, 204, 21, 0.18)":"none",style:{filter:t?"drop-shadow(0 0 2px rgba(250, 204, 21, 0.35))":"none"}}),(0,r.jsx)("line",{x1:"7",y1:"18",x2:"12",y2:"18"}),(0,r.jsx)("line",{x1:"8",y1:"21",x2:"11",y2:"21"})]})}var p=n(7834),f=n(31590);let h=/<(read-files|modified-files)>\s*([\s\S]*?)\s*<\/\1>/g,x=/(?:\r?\n){2,}((?:[ \t]*<(?:read-files|modified-files)>[ \t]*\r?\n[\s\S]*?\r?\n[ \t]*<\/(?:read-files|modified-files)>[ \t]*(?:\r?\n)?)+)\s*$/;function g(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function m(e){return"string"==typeof e&&""!==e?e:void 0}var y=n(48656),v=n(56038),b=n(40505),w=n(82490);function j(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&"string"==typeof e.oldText&&"string"==typeof e.newText}function k(e){if(""===e)return{lines:[],lastEnded:!1};let t=e.split(/\r\n|\r|\n/),n=t.length>1&&""===t[t.length-1];return n&&t.pop(),{lines:t,lastEnded:n}}function S(e,t,n,r){return e.lines[t]===n.lines[r]&&(t<e.lines.length-1||e.lastEnded)===(r<n.lines.length-1||n.lastEnded)}function C(e){if(e.length<=4e3)return e;let t=4e3,n=e.charCodeAt(t-1);return n>=55296&&n<=56319&&t--,`${e.slice(0,t)}…`}let M=()=>({lineNo:null,text:"",type:"empty"});var W=n(67803),$=n(14667);function I(e,t){return(t?.isError??!1)||(0,$.aP)(e.toolName)&&(0,W.FK)(t?.details)}function N(e){let{block:t,originalIndex:n}=e;return{kind:"block",block:t,originalIndex:n}}let z=new Set;var T=n(61958);let F=new Map,L=new Map;async function A(e){let t=Date.now(),n=F.get(e);if(n&&t-n.at<1e4)return n.value;let r=L.get(e);if(r)return r;let i=(async()=>{try{let t=await fetch(`/api/git/status?cwd=${encodeURIComponent(e)}`,{cache:"no-store"});if(!t.ok)throw Error(String(t.status));let n=await t.json(),r=new Map;if(n.isGitRepository)for(let e of n.files)(void 0!==e.additions||void 0!==e.deletions)&&r.set(e.filePath,{additions:e.additions??0,deletions:e.deletions??0});return r}catch{return null}finally{L.delete(e)}})();L.set(e,i);let o=await i;return F.set(e,{at:Date.now(),value:o}),o}function E(e){let t=F.get(e);return t&&Date.now()-t.at<1e4?t.value:void 0}var R=n(28999),O=n(30527);function B(e){let{files:t,onOpenFile:n,cwd:o}=e,{t:l}=(0,a.s)(),s=function(e){let[t,n]=(0,i.useState)(()=>e?E(e):void 0);return(0,i.useEffect)(()=>{if(!e)return void n(void 0);let t=E(e);if(void 0!==t)return void n(t);n(void 0);let r=!1;return A(e).then(e=>{r||n(e)}),()=>{r=!0}},[e]),t}(t.length>0?o:void 0);return 0===t.length?null:(0,r.jsx)("div",{"aria-label":l("chat.filesWritten"),style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:6,marginTop:6},children:t.map(e=>{let{filePath:t}=e,i=(0,R.WP)(t),o=s?.get(t);return(0,r.jsxs)("button",{type:"button",title:t,"aria-label":l("chat.openWrittenFile",{name:i}),onClick:()=>n?.(t),style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",fontSize:12,fontFamily:"var(--font-mono)",color:"var(--text)",background:"var(--bg-subtle)",border:"1px solid var(--border)",borderRadius:6,cursor:"pointer"},children:[(0,O.I3)(i,12),(0,r.jsx)("span",{children:i}),o&&(o.additions>0||o.deletions>0)&&(0,r.jsxs)("span",{"aria-hidden":"true",style:{fontSize:11,whiteSpace:"nowrap",color:"var(--text-dim)"},children:[(0,r.jsxs)("span",{style:{color:"#3fb950"},children:["+",o.additions]})," ",(0,r.jsxs)("span",{style:{color:"#f85149"},children:["−",o.deletions]})]})]},t)})})}var _=n(1518),D=n(6483),H=n(83236);let P={running:{icon:"…",color:"#d97706"},ok:{icon:"✓",color:"#16a34a"},error:{icon:"✗",color:"#f87171"},cancelled:{icon:"⊘",color:"var(--text-dim)"}};function G(e){let{call:t}=e,{t:n}=(0,a.s)(),i=P[t.status],o=(0,H.YH)(t.durationMs);return(0,r.jsxs)("li",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,minWidth:0},children:[(0,r.jsx)("span",{role:"img","aria-label":n(`codemode.status.${t.status}`),title:n(`codemode.status.${t.status}`),style:{color:i.color,width:12,flexShrink:0,textAlign:"center"},children:i.icon}),(0,r.jsx)("span",{style:{color:"var(--text-muted)",fontWeight:600,flexShrink:0},children:t.name}),t.args&&(0,r.jsx)("span",{style:{color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:t.args}),o&&(0,r.jsx)("span",{style:{color:"var(--text-dim)",flexShrink:0,marginLeft:"auto",fontVariantNumeric:"tabular-nums"},children:o}),void 0!==t.cost&&(0,r.jsx)("span",{style:{color:"var(--text-dim)",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:(0,H.tw)(t.cost)})]}),t.error&&(0,r.jsx)("div",{style:{color:"#f87171",paddingLeft:18,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:t.error})]})}function V(e){let{calls:t,omitted:n,isError:o}=e,{t:l}=(0,a.s)(),[s,d]=(0,i.useState)(!1);if(0===t.length&&0===n)return null;let c=s?0:Math.max(0,t.length-20),u=c>0?t.slice(c):t,p=(0,H.GB)(t);return(0,r.jsxs)("div",{style:{borderTop:o?"1px solid rgba(248,113,113,0.25)":"1px solid rgba(34,197,94,0.2)",background:"var(--bg-subtle)",padding:"6px 10px",fontFamily:"var(--font-mono)",fontSize:"calc(11.5px + var(--chat-font-size-offset, 0px))",lineHeight:1.5,display:"flex",flexDirection:"column",gap:3,minWidth:0},children:[(0,r.jsx)("div",{style:{color:"var(--text-dim)",fontFamily:"inherit",fontSize:11},children:l("codemode.calls")}),n>0&&(0,r.jsx)("div",{style:{color:"var(--text-dim)"},children:l("codemode.omittedCalls",{count:n})}),c>0&&(0,r.jsx)("button",{type:"button",onClick:()=>d(!0),style:{alignSelf:"flex-start",padding:0,border:"none",background:"none",color:"var(--accent)",cursor:"pointer",font:"inherit"},children:l("codemode.showEarlierCalls",{count:c})}),(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:3,minWidth:0},children:u.map((e,t)=>(0,r.jsx)(G,{call:e},e.id||`${c+t}`))}),null!==p&&(0,r.jsx)("div",{style:{color:"var(--text-dim)"},children:l("codemode.modelCost",{cost:(0,H.tw)(p)})})]})}function U(e){return"string"==typeof e?e.trim()?e:null:"number"==typeof e||"boolean"==typeof e?String(e):null}function Y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:", ";if(!Array.isArray(e))return U(e);if(0===e.length||!e.every(e=>null===e||"object"!=typeof e))return null;let n=e.map(U).filter(e=>null!==e);return n.length>0?n.join(t):null}var q=n(9701);function J(e,t){if(!e.startsWith("mcp__")||!("object"==typeof t&&null!==t&&!Array.isArray(t)))return null;let{server:n,tool:r}=t;return"string"==typeof n&&"string"==typeof r&&n&&r?{server:n,tool:r}:null}let K=new Map;var X=n(89594),Q=n(36690);let Z=/[\u3000-\u30ff\u3400-\u9fff\uf900-\ufaff\u{20000}-\u{2fa1f}\uac00-\ud7af]/u;function ee(e){let t=0,n=0;for(let r of e)Z.test(r)?t++:n++;return t+n/4}let et=new Map;function en(e){let{children:t,className:n,...o}=e,{t:s}=(0,a.s)(),[d,c]=(0,i.useState)(!1);if(t.length<=1e5)return(0,r.jsx)(l.m,{className:n,...o,children:t});if(!d){var u;return(0,r.jsxs)("button",{onClick:()=>c(!0),style:{display:"block",width:"100%",margin:"4px 0",padding:"7px 10px",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg-panel)",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},children:["⚠ ",s("i18n.largeMessageReveal",{size:(u=t.length)>=1e6?`${(u/1e6).toFixed(1)} MB`:u>=1e3?`${Math.round(u/1e3)} KB`:`${u} B`})]})}return(0,r.jsx)("div",{className:n,style:{maxHeight:420,overflow:"auto",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.5},children:(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"var(--font-mono)",color:"var(--text-muted)"},children:t})})}function er(e){if(!e)return null;let t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),i=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(r)return i;let o=t.toLocaleDateString([],{month:"short",day:"numeric",year:t.getFullYear()!==n.getFullYear()?"numeric":void 0});return`${o} ${i}`}function ei(e,t,n){if(t===n||"assistant"!==e.role)return!0;for(let r of e.content??[])if("toolCall"===r.type&&t?.get(r.toolCallId)!==n?.get(r.toolCallId))return!1;return!0}let eo=(0,i.memo)(function(e){let{message:t,isStreaming:n,toolResults:i,toolClocks:o,modelNames:l,cwd:a,onOpenFile:s,onOpenSubagent:c,onEnterSubagent:u,entryId:p,searchBlock:f,onFork:h,forking:x,onEditContent:y,onCancelEdit:v,isEditing:b,showTimestamp:w,prevTimestamp:j,sessionId:k,writtenFiles:S,turnDurationMs:C,onCompact:M,isCompacting:W,compactError:$}=e;if("user"===t.role)return(0,r.jsx)(el,{message:t,cwd:a,onOpenFile:s,entryId:p,onFork:h,forking:x,onEditContent:y,onCancelEdit:v,isEditing:b});if("assistant"===t.role)return(0,r.jsx)(es,{message:t,isStreaming:n,toolResults:i,toolClocks:o,modelNames:l,cwd:a,onOpenFile:s,onOpenSubagent:c,onEnterSubagent:u,showTimestamp:w,prevTimestamp:j,sessionId:k,entryId:p,searchBlock:f,writtenFiles:S,turnDurationMs:C,onCompact:M,isCompacting:W,compactError:$});if("toolResult"===t.role)return null;if("custom"===t.role){if("compaction"===t.customType)return(0,r.jsx)(eT,{message:t});if("btw-note"===t.customType){let e=function(e){if("object"!=typeof e||null===e)return null;let t="string"==typeof e.question?e.question:"",n="string"==typeof e.answer?e.answer:"";if(""===t&&""===n)return null;let r="object"==typeof e.usage&&null!==e.usage?e.usage:void 0,i=void 0!==r&&"object"==typeof r.cost&&null!==r.cost?r.cost:void 0;return{question:t,answer:n,provider:m(e.provider),model:m(e.model),api:m(e.api),thinkingLevel:m(e.thinkingLevel),timestamp:g(e.timestamp),usage:void 0===r?void 0:{input:g(r.input),output:g(r.output),cacheRead:g(r.cacheRead),cacheWrite:g(r.cacheWrite),reasoning:g(r.reasoning),totalTokens:g(r.totalTokens),cost:void 0===i?void 0:{total:g(i.total)}}}}(t.details);if(e)return(0,r.jsx)(d,{note:e,cwd:a,onOpenFile:s})}return(0,r.jsx)(eE,{message:t,cwd:a,onOpenFile:s})}return"bashExecution"===t.role?(0,r.jsx)(eq,{message:t,sessionId:k}):null},(e,t)=>e.message===t.message&&e.isStreaming===t.isStreaming&&ei(e.message,e.toolResults,t.toolResults)&&ei(e.message,e.toolClocks,t.toolClocks)&&e.modelNames===t.modelNames&&e.cwd===t.cwd&&e.onOpenFile===t.onOpenFile&&e.onOpenSubagent===t.onOpenSubagent&&e.onEnterSubagent===t.onEnterSubagent&&e.entryId===t.entryId&&e.searchBlock===t.searchBlock&&e.onFork===t.onFork&&e.forking===t.forking&&e.onEditContent===t.onEditContent&&e.onCancelEdit===t.onCancelEdit&&e.isEditing===t.isEditing&&e.showTimestamp===t.showTimestamp&&e.prevTimestamp===t.prevTimestamp&&e.writtenFiles===t.writtenFiles&&e.turnDurationMs===t.turnDurationMs&&e.sessionId===t.sessionId&&e.onCompact===t.onCompact&&e.isCompacting===t.isCompacting&&e.compactError===t.compactError);function el(e){let{message:t,cwd:n,onOpenFile:o,entryId:s,onFork:d,forking:u,onEditContent:f,onCancelEdit:h,isEditing:x}=e,{t:g}=(0,a.s)(),[m,y]=(0,i.useState)(!1),[v,b]=(0,i.useState)(!1),[w,j]=(0,i.useState)(!1),k=("string"==typeof t.content?t.content:t.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n")).replace(/\r\n?/g,"\n"),S="string"==typeof t.content?[]:t.content.filter(e=>"image"===e.type),C=(0,_.d)(k),M=C?.search(/\s/)??-1,W=C?-1===M?C:C.slice(0,M):"",$=C&&-1!==M?C.slice(M+1):"",I=er(t.timestamp),N=!!s&&!!d,z=C??k,T=C?function(e,t){if("string"==typeof e.content)return{...e,content:t};let n=[],r=!1;for(let i of e.content){if("text"!==i.type){n.push(i);continue}r||(n.push({...i,text:t}),r=!0)}return r||n.unshift({type:"text",text:t}),{...e,content:n}}(t,C):t,F=S.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:8*!!k},children:S.map((e,t)=>{let n=e.source?"base64"===e.source.type?`data:${e.source.media_type};base64,${e.source.data}`:e.source.url??"":e.data?`data:${e.mimeType};base64,${e.data}`:"";return(0,r.jsx)(c.k,{src:n,children:(0,r.jsx)("img",{src:n,alt:"",style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:"contain",display:"block",border:"1px solid rgba(59,130,246,0.15)"}})},t)})}),L=!!s&&!!f,A=!!x&&!!h;return(0,r.jsxs)("div",{style:{marginBottom:16,display:"flex",flexDirection:"column",alignItems:"flex-end"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[(0,r.jsx)("div",{style:{display:"flex",alignItems:"flex-end",gap:6,maxWidth:"85%"},children:(0,r.jsx)("div",{style:{flex:1,minWidth:0,background:x?"color-mix(in srgb, var(--accent) 14%, var(--user-bg))":"var(--user-bg)",border:x?"1px solid color-mix(in srgb, var(--accent) 62%, var(--user-bg))":"1px solid rgba(59,130,246,0.2)",boxShadow:x?"0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent)":void 0,borderRadius:12,padding:"8px 12px",fontSize:"calc(14px + var(--chat-font-size-offset, 0px))",lineHeight:1.6,color:"var(--text)",wordBreak:"break-word",maxHeight:300,overflowY:"auto"},children:C?(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[F,(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,flexWrap:"wrap"},children:[(0,r.jsxs)("button",{onClick:()=>j(e=>!e),title:g(w?"i18n.collapse":"i18n.expand"),"aria-expanded":w,style:{display:"flex",alignItems:"center",gap:6,flexShrink:0,padding:0,background:"none",border:"none",cursor:"pointer",color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"calc(13px + var(--chat-font-size-offset, 0px))",textAlign:"left"},children:[(0,r.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W}),(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,opacity:.75,transform:w?"rotate(180deg)":"none",transition:"transform 0.15s"},"aria-hidden":"true",children:(0,r.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),$&&(0,r.jsx)("span",{style:{color:"var(--text)",fontSize:"calc(14px + var(--chat-font-size-offset, 0px))",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",minWidth:0,flex:1},children:$})]}),w&&(0,r.jsx)(l.m,{className:"markdown-user-message",keepLineBreaks:!0,cwd:n,onOpenFile:o,children:(0,_.O)(k)??k})]}):(0,r.jsxs)(r.Fragment,{children:[F,k&&(0,r.jsx)(en,{className:"markdown-user-message",keepLineBreaks:!0,cwd:n,onOpenFile:o,children:k})]})})}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:6,marginTop:3},children:[(0,r.jsx)("div",{style:{display:"flex",gap:3,opacity:+!!m,pointerEvents:m?"auto":"none",transition:"opacity 0.12s"},children:(0,r.jsxs)("button",{onClick:()=>{(0,p.D)(z).then(()=>{b(!0),setTimeout(()=>b(!1),1500)},()=>{})},title:g("i18n.copyMessage"),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:v?"var(--accent)":"var(--text-dim)",cursor:"pointer",fontSize:11,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{v||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{v||(e.currentTarget.style.color="var(--text-dim)")},children:[v?(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,r.jsx)("span",{className:"message-action-label",children:g(v?"i18n.copied":"i18n.copy")})]})}),(N||L||A)&&(0,r.jsxs)("div",{style:{display:"flex",gap:3,opacity:m||u||A?1:0,pointerEvents:m||u||A?"auto":"none",transition:"opacity 0.12s"},children:[L&&!A&&(0,r.jsxs)("button",{onClick:()=>f(T,s),title:g("i18n.editFromHereTitle"),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:"var(--text-dim)",cursor:"pointer",fontSize:11,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{e.currentTarget.style.color="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-dim)"},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("polyline",{points:"15 10 20 15 15 20"}),(0,r.jsx)("path",{d:"M4 4v7a4 4 0 0 0 4 4h12"})]}),(0,r.jsx)("span",{className:"message-action-label",children:g("i18n.editFromHere")})]}),A&&(0,r.jsxs)("button",{type:"button",onClick:h,title:g("i18n.cancel"),"aria-label":g("i18n.cancel"),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:"var(--accent)",cursor:"pointer",fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})}),(0,r.jsx)("span",{className:"message-action-label",children:g("i18n.cancel")})]}),N&&(0,r.jsxs)("button",{onClick:()=>{d(s,T)},disabled:u,title:g(u?"i18n.creatingSession":"i18n.newSessionTitle"),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:u?"var(--accent)":"var(--text-dim)",cursor:u?"not-allowed":"pointer",fontSize:11,fontWeight:400,whiteSpace:"nowrap",transition:"color 0.12s"},onMouseEnter:e=>{u||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{u||(e.currentTarget.style.color="var(--text-dim)")},children:[(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,r.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,r.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,r.jsx)("span",{className:"message-action-label",children:g(u?"i18n.creating":"i18n.newSession")})]})]}),I&&(0,r.jsx)("span",{style:{fontSize:10,color:"var(--text-dim)"},children:I})]})]})}function ea(e){let{modelName:t,estimatedTokens:n=0,tps:i=null}=e,{t:o}=(0,a.s)(),l=null!==i?i>=50?"#53b3cb":i>=30?"#9bc53d":i>=15?"#f9c22e":"#e01a4f":void 0;return(0,r.jsxs)("div",{style:{fontSize:11,lineHeight:1.5,minHeight:"calc(1.5em + 2px)",color:"var(--text-dim)",marginBottom:4,display:"flex",alignItems:"center",gap:6,fontVariantNumeric:"tabular-nums"},children:[t&&(0,r.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),n>0&&(0,r.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,whiteSpace:"nowrap",color:"var(--text)"},title:o("i18n.estimatedTokens"),children:[(0,r.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:2,fontSize:11,fontWeight:400},children:[(0,r.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"5",y1:"1.5",x2:"5",y2:"8.5"}),(0,r.jsx)("polyline",{points:"2 6 5 8.5 8 6"})]}),(0,r.jsx)("span",{children:n})]}),null!==i&&(0,r.jsxs)("span",{style:{marginLeft:6,padding:"1px 6px",minWidth:"calc(8ch + 1px)",boxSizing:"content-box",textAlign:"center",borderRadius:4,background:l,color:"#fff",fontSize:11,fontWeight:400},children:[i.toFixed(1)," t/s"]})]})]})}function es(e){var t,n,o,l,s;let d,c,u,f,{message:h,isStreaming:x,toolResults:g,toolClocks:m,modelNames:b,cwd:w,onOpenFile:j,onOpenSubagent:k,onEnterSubagent:S,showTimestamp:C,prevTimestamp:M,sessionId:W,entryId:$,searchBlock:z,writtenFiles:T,turnDurationMs:F,onCompact:L,isCompacting:A,compactError:E}=e,{t:R}=(0,a.s)(),O=C?er(h.timestamp):null,_=(0,i.useMemo)(()=>(h.content??[]).map((e,t)=>({block:e,originalIndex:t})).filter(e=>{let{block:t}=e;return!(0,y.hh)(t,{isStreaming:x})}),[h.content,x]),D=(0,i.useMemo)(()=>_.map(e=>{let{block:t}=e;return t}),[_]),H=(0,i.useMemo)(()=>(function(e,t,n){if(n?.isStreaming)return e.map(N);for(let{block:n}of e)if("toolCall"===n.type&&!t?.get(n.toolCallId))return e.map(N);let r=n?.minGroupSize??3,i=[],o=[],l=()=>{if(0!==o.length){if(o.length>=r)i.push({kind:"toolCallGroup",toolName:o[0].block.toolName,firstOriginalIndex:o[0].originalIndex,items:o});else for(let{block:e,originalIndex:t}of o)i.push(N({block:e,originalIndex:t}));o=[]}};for(let{block:n,originalIndex:r}of e){if("toolCall"!==n.type){l(),i.push({kind:"block",block:n,originalIndex:r});continue}let e=t?.get(n.toolCallId),a=void 0!==e&&!I(n,e)&&!e.content.some(e=>"image"===e.type),s=o.length>0&&r===o[o.length-1].originalIndex+1&&n.toolName===o[o.length-1].block.toolName;a&&(0===o.length||s)?o.push({block:n,originalIndex:r}):(l(),a?o.push({block:n,originalIndex:r}):i.push(N({block:n,originalIndex:r})))}return l(),i})(_,g,{isStreaming:x}),[_,g,x]),P=(0,y.mc)(h,{isStreaming:x}),G=(0,y.oG)(h,{isStreaming:x}),V=(0,y.PC)(h,{isStreaming:x}),U=V&&!(0,y.D6)(h),[Y,q]=(0,i.useState)(!1),[J,Q]=(0,i.useState)(!1),Z=(0,i.useRef)(null),et="number"!=typeof h.timestamp?null:`${h.provider??""}/${h.model??""}@${h.timestamp}`,en=(0,i.useRef)(et);en.current=et;let[ei,eo]=(0,i.useState)(null),el=(0,i.useRef)(_);el.current=_;let es=(0,i.useRef)(new Map),ec=(0,i.useMemo)(()=>{if(!x)return es.current=new Map,0;let e=new Map,t=0;for(let{block:n,originalIndex:r}of _){let i="text"===n.type?n.text:"thinking"===n.type?n.thinking:"toolCall"===n.type?n.rawInput??JSON.stringify(n.input??{})??"":null;if(null===i)continue;let o=function(e,t){var n,r;if(!e||!t.startsWith(e.text))return ee(t);let i=e.tokens,o=e.text.length;return o>0&&o<t.length&&(n=e.text.charCodeAt(o-1))>=55296&&n<=56319&&(r=t.charCodeAt(o))>=56320&&r<=57343&&(i-=.25,o--),i+ee(t.slice(o))}(es.current.get(r),i);e.set(r,{text:i,tokens:o}),t+=o}return es.current=e,t},[_,x]),eu=(0,i.useRef)(ec);eu.current=ec;let ep=(0,i.useRef)(new Map),[eg,em]=(0,i.useState)(new Map),ey="assistant"===h.role?eh(h.durationMs):void 0,ev=(0,i.useMemo)(()=>{let e=ey??(h.timestamp&&M?h.timestamp-M:void 0);if(void 0===e)return;let t=Math.round(e/1e3);return t>0?t:void 0},[ey,h.timestamp,M]),eb=(0,i.useMemo)(()=>{let e=new Map;if(!g)return e;for(let[t,n]of g){let r=eh(n.durationMs)??(n.timestamp&&h.timestamp?n.timestamp-h.timestamp:void 0);void 0!==r&&r>=ex&&e.set(t,r)}return e},[g,h.timestamp]),ew=D.filter(e=>"text"===e.type).map(e=>e.text).join("\n"),ej=h.usage?(o=h.usage,d=[],o.input&&d.push({icon:"up",before:"↑",text:(0,X.Gg)(o.input)}),o.output&&d.push({icon:"down",before:"↓",text:(0,X.Gg)(o.output)}),o.cacheRead&&d.push({text:`R${(0,X.Gg)(o.cacheRead)}`}),o.cacheWrite&&d.push({text:`W${(0,X.Gg)(o.cacheWrite)}`}),o.cost?.total&&d.push({text:`$${o.cost.total.toFixed(4)}`}),d):[];if(G&&ej.unshift({text:R("chat.operationAborted")},...ej.length>0?[{text:"\xb7"}]:[]),void 0!==F){let e;ej.length>0&&ej.push({text:"\xb7"});let t=(0,v.J)(F);ej.push((l=R("chat.turnDuration",{time:t}),s=t,(e=l.indexOf(s))<0?{text:l}:{icon:"clock",before:l.slice(0,e),text:s,after:l.slice(e+s.length)}))}if((0,i.useEffect)(()=>{if(!x){let e=new Date().getTime();em(t=>{let n=new Map(t);for(let[t,r]of ep.current)n.has(t)||n.set(t,Math.round((e-r)/1e3));return n}),Z.current=null,eo(null);return}let e=setInterval(()=>{var e;let t,n=el.current,r=Date.now();n.forEach(e=>{let{originalIndex:t}=e;ep.current.has(t)||ep.current.set(t,r)}),em(e=>{let t=!1,i=new Map(e);for(let e=0;e<n.length-1;e++){let o=n[e].originalIndex,l=n[e+1].originalIndex;if(!i.has(o)&&ep.current.has(o)){let e=ep.current.get(o),n=ep.current.get(l)??r;i.set(o,Math.round((n-e)/1e3)),t=!0}}return t?i:e});let i=eu.current;if(0===i)return;Z.current??=function(e,t,n){let r=null===e?void 0:K.get(e);if(r)return r;let i={at:n,tokens:t};return null!==e&&(K.set(e,i),K.size>32&&K.delete(K.keys().next().value)),i}(en.current,i,r);let o=(e=Z.current,(t=(r-e.at)/1e3)>.5?(i-e.tokens)/t:null);null!==o&&eo(o)},300);return()=>clearInterval(e)},[x]),0===D.length&&!x&&!P&&!V&&!G)return null;let ek=e=>{let{block:t,originalIndex:n}=e;return(0,r.jsx)(ed,{block:t,searchTarget:t===z,toolResults:g,toolsNotRun:G||null!==P,isStreaming:x,streamingDuration:eg.get(n)??("thinking"===t.type?ev:void 0),toolCallDurations:eb,toolClocks:m,cwd:w,onOpenFile:j,onOpenSubagent:k,onEnterSubagent:S,sessionId:W,entryId:$,blockIndex:n},n)};return(0,r.jsxs)("div",{"data-message-role":"assistant","data-entry-id":$,style:{marginBottom:16},onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[(0,r.jsx)(ea,{modelName:h.provider?(t=h.provider,n=h.model,c=t.toLowerCase(),u=n.toLowerCase(),f=Object.entries(b??{}).flatMap(e=>{let[t,n]=e,r=t.indexOf(":");return r>0&&t.slice(0,r).toLowerCase()===c?[{id:t.slice(r+1).toLowerCase(),name:n}]:[]}),f.find(e=>e.id===u)?.name??f.find(e=>u.endsWith(`/${e.id}`))?.name??Object.entries(b??{}).find(e=>{let[t]=e;return t.toLowerCase()===u})?.[1]??`${t}/${n}`):void 0,estimatedTokens:x?Math.round(ec):0,tps:x?ei:null}),(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:H.map(e=>"block"===e.kind?ek(e):(0,r.jsx)(ef,{items:e.items,entryId:$,results:e.items.map(e=>{let{block:t}=e;return g?.get(t.toolCallId)}),forceExpanded:e.items.some(e=>{let{block:t}=e;return t===z}),children:e.items.map(ek)},`group-${e.firstOriginalIndex}`))}),P&&(0,r.jsxs)("div",{role:"alert",style:{marginTop:8*(D.length>0),padding:"7px 10px",border:"1px solid rgba(239,68,68,0.3)",borderRadius:6,background:"rgba(239,68,68,0.07)",color:"#ef4444",fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:["Error: ",P]}),V&&(0,r.jsxs)("div",{role:"alert",style:{marginTop:D.length>0||P?8:0,padding:"7px 10px",border:"1px solid rgba(234,179,8,0.3)",borderRadius:6,background:"rgba(234,179,8,0.07)",color:"#ca8a04",fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[R(U?"chat.truncatedWithoutAnswer":"chat.truncatedByOutputLimit"),U&&L&&(0,r.jsx)("button",{type:"button",onClick:L,disabled:A,style:{display:"block",marginTop:8,padding:"3px 8px",border:"1px solid currentColor",borderRadius:5,background:"transparent",color:"inherit",cursor:A?"default":"pointer",font:"inherit"},children:R(A?"chat.compacting":"chat.compactContext")}),U&&E&&(0,r.jsx)("div",{style:{marginTop:8,color:"#ef4444",whiteSpace:"pre-wrap"},children:E})]}),T&&T.length>0&&(0,r.jsx)(B,{files:T,onOpenFile:j,cwd:w}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[ej.length>0&&!x&&(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",columnGap:7,fontSize:11,color:"var(--text-dim)",fontVariantNumeric:"tabular-nums"},children:ej.map((e,t)=>(0,r.jsxs)(i.Fragment,{children:[t>0&&" ",(0,r.jsx)(eY,{part:e})]},t))}),ew&&!x&&(0,r.jsxs)("button",{onClick:()=>{(0,p.D)(ew).then(()=>{Q(!0),setTimeout(()=>Q(!1),1500)},()=>{})},title:R("i18n.copyMessage"),style:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",height:22,background:"none",border:"none",borderRadius:5,color:J?"var(--accent)":"var(--text-dim)",cursor:"pointer",fontSize:11,fontWeight:400,whiteSpace:"nowrap",opacity:+!!Y,pointerEvents:Y?"auto":"none",transition:"opacity 0.12s, color 0.12s"},onMouseEnter:e=>{J||(e.currentTarget.style.color="var(--accent)")},onMouseLeave:e=>{J||(e.currentTarget.style.color="var(--text-dim)")},children:[J?(0,r.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,r.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,r.jsx)("span",{className:"message-action-label",children:R(J?"i18n.copied":"i18n.copy")})]}),O&&!x&&(0,r.jsx)("span",{style:{fontSize:10,color:"var(--text-dim)",marginLeft:"auto",whiteSpace:"nowrap"},children:O})]})]})}function ed(e){let{block:t,searchTarget:n,toolResults:i,toolsNotRun:o,isStreaming:l,streamingDuration:a,toolCallDurations:s,toolClocks:d,cwd:c,onOpenFile:u,onOpenSubagent:p,onEnterSubagent:f,sessionId:h,entryId:x,blockIndex:g}=e;if("text"===t.type)return(0,r.jsx)("div",{"data-message-text":!0,"data-search-target":n||void 0,children:(0,r.jsx)(ec,{block:t,isStreaming:l,cwd:c,onOpenFile:u})});if("thinking"===t.type)return(0,r.jsx)(ep,{block:t,duration:a,sessionId:h,entryId:x,blockIndex:g});if("toolCall"===t.type){let e=i?.get(t.toolCallId),n=s?.get(t.toolCallId);return(0,r.jsx)(ey,{block:t,result:e,notRun:o,duration:n,clock:d?.get(t.toolCallId),onOpenSubagent:p,onEnterSubagent:f})}return null}function ec(e){let{block:t,isStreaming:n,cwd:i,onOpenFile:o}=e;return(0,r.jsx)(en,{isStreaming:n,cwd:i,onOpenFile:o,children:t.text})}function eu(e){let{text:t}=e,n=(0,i.useMemo)(()=>(0,y.SI)(t),[t]);return 1===n.length?t:n.map((e,t)=>(0,r.jsx)("div",{children:e.text},t))}function ep(e){let{block:t,duration:n,sessionId:l,entryId:s,blockIndex:d}=e,{t:c}=(0,a.s)(),[p,f]=(0,i.useState)(T.ql),[h,x]=(0,i.useState)(null),[g,m]=(0,i.useState)(!1),[v,b]=(0,i.useState)(null),w=`${l}:${s}:${d}`,[j,k]=(0,i.useState)(w);j!==w&&(k(w),x(null),m(!1),b(null));let S=(0,i.useRef)(c);S.current=c;let C=(0,y.de)(t.thinking);return(0,i.useEffect)(()=>{let e=()=>f((0,T.ql)());return window.addEventListener(T._i,e),()=>window.removeEventListener(T._i,e)},[]),(0,i.useEffect)(()=>{if(!p||!t.deferred||null!==h)return;if(!l||!s)return void b(S.current("i18n.thinkingUnavailable"));let e=!1;return m(!0),b(null),(function(e,t,n){let r=`${e}:${t}:${n}`,i=et.get(r);if(i)return et.delete(r),et.set(r,i),i;let o=fetch(`/api/sessions/${encodeURIComponent(e)}/entries/${encodeURIComponent(t)}/thinking?blockIndex=${n}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if("string"!=typeof t.thinking)throw Error("Invalid thinking response");return t.thinking}).catch(e=>{throw et.delete(r),e});if(et.set(r,o),et.size>100){let e=et.keys().next().value;e&&et.delete(e)}return o})(l,s,d).then(t=>{e||(x(t),m(!1))}).catch(t=>{e||(b(t instanceof Error?t.message:String(t)),m(!1))}),()=>{e=!0}},[p,t.deferred,h,l,s,d]),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,minWidth:0,border:"1px solid var(--border)",borderRadius:7,padding:"6px 10px",background:"var(--bg)",fontFamily:"var(--font-mono)",fontSize:"calc(11px + var(--chat-font-size-offset, 0px))",lineHeight:1.5},children:[(0,r.jsxs)("button",{type:"button","aria-expanded":p,"aria-label":`${c("i18n.thinking")}${C?`: ${C}`:""}`,title:c("i18n.thinking"),onClick:()=>f(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:6,width:p?14:"100%",flexShrink:+!p,minWidth:0,minHeight:"1.5em",padding:0,background:"transparent",border:"none",color:"var(--text-muted)",cursor:"pointer",font:"inherit",textAlign:"left"},children:[(0,r.jsx)(u,{active:p}),!p&&(0,r.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C?(0,r.jsx)(o.oz,{allowedElements:[],unwrapDisallowed:!0,skipHtml:!0,children:C}):"..."})]}),p&&(0,r.jsx)("div",{style:{flex:1,minWidth:0,color:v?"#f87171":"var(--text-muted)",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:g?c("i18n.loadingThinking"):v??(0,r.jsx)(eu,{text:(t.deferred?h:t.thinking)??""})}),void 0!==n&&(0,r.jsxs)("span",{style:{flexShrink:0,color:"var(--text-dim)",fontVariantNumeric:"tabular-nums"},children:[n,"s"]})]})}function ef(e){let{items:t,entryId:n,results:o,forceExpanded:l,children:s}=e,{t:d}=(0,a.s)(),[c,u]=(0,i.useState)(!1),p=c||!0===l,f=o?.find(e=>void 0!==e),h=J(t[0].block.toolName,f?.details);return(0,r.jsxs)("div",{"data-tool-call-group":!0,"data-group-key":`${n??""}:${t[0].originalIndex}`,style:{borderRadius:7,overflow:"hidden",fontSize:12,border:"1px solid rgba(34,197,94,0.25)",background:"rgba(34,197,94,0.04)"},children:[(0,r.jsxs)("button",{type:"button","aria-expanded":p,onClick:()=>u(!c),style:{display:"flex",alignItems:"center",gap:7,flex:1,minWidth:0,padding:"6px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},children:[(0,r.jsx)("span",{title:h?t[0].block.toolName:void 0,style:{color:"#16a34a",fontFamily:"var(--font-mono)",fontWeight:600,fontSize:11,flexShrink:0},children:h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{style:{fontWeight:500,opacity:.75},children:[h.server,"/"]}),h.tool]}):t[0].block.toolName}),(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontSize:11,flexShrink:0,fontVariantNumeric:"tabular-nums"},children:d("chat.toolCallGroupCount",{count:t.length})}),(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontFamily:"var(--font-mono)",fontSize:11,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d("chat.toolCallGroupAllOk")}),(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:p?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),p&&(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s})]})}function eh(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}let ex=100;function eg(e){let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t),r=Math.floor(n/60),i=n%60;return r<60?`${r}m ${i}s`:`${Math.floor(r/60)}h ${r%60}m ${i}s`}function em(e){let{clock:t}=e,n="startedAt"in t,[o,l]=(0,i.useState)(()=>performance.now());(0,i.useEffect)(()=>{if(!n)return;let e=window.setInterval(()=>l(performance.now()),1e3);return()=>window.clearInterval(e)},[n]);let a=(0,b.fI)(t,o);return a<ex?null:(0,r.jsx)("span",{style:{fontSize:11,color:"var(--text-dim)",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:eg(a)})}function ey(e){var t,n;let o,{block:l,result:s,notRun:d,duration:c,clock:u,onOpenSubagent:p,onEnterSubagent:f,resultFooter:h}=e,{t:x}=(0,a.s)(),[g,m]=(0,i.useState)(()=>{var e;return void 0!==(e=l.toolCallId)&&z.has(e)}),y=function(e){if(void 0!==e.rawInput||!(0,$.V4)(e.toolName))return null;let{content:t}=e.input;return"string"!=typeof t||""===t?null:Object.keys(e.input).every(e=>e_.has(e))?t:null}(l),v=y??(t=l).rawInput??JSON.stringify(t.input,null,2),b=void 0!==l.rawInput,N=(0,$.iG)(l.toolName),T=s&&!s.isError?function(e){let t=e.details;if(!eI(t))return null;let n="string"==typeof t.patch?t.patch:null;if(n)return{text:n};let r="string"==typeof t.diff?t.diff:null;return r?{text:r}:null}(s):null,F=T?.text,L=(0,i.useMemo)(()=>(function(e){if(!e)return null;let t=(0,w.yg)(e);return t?.length===1&&eS(t[0])||null})(F),[F]),A=function(e,t){if(!(0,$.aP)(e.toolName))return null;let n=(0,W.oC)((0,W.IN)(e.input,e.rawInput));if(n)return n;let r=t&&!t.isError?t.details:void 0;if(eI(r)){let e=(0,W.ND)(r.preview);if(e)return e}return null}(l,s),E=!g||!N||b||s||d?null:l.input,R=(0,i.useMemo)(()=>{let e=null===E?null:function(e){let t=function(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let t=e.edits;if("string"==typeof t)try{let e=JSON.parse(t);t=j(e)?[e]:e}catch{}else j(t)&&(t=[t]);let n=Array.isArray(t)?[...t]:[];return("string"==typeof e.oldText&&"string"==typeof e.newText&&n.push({oldText:e.oldText,newText:e.newText}),0!==n.length&&n.every(j))?n:null}(e);if(!t)return null;let n="string"==typeof e.path?e.path:"string"==typeof e.file_path?e.file_path:void 0,r=[],i=0,o=!1,l=e=>{let t=r[r.length-1];t?.type==="gap"?t.count=null===t.count||null===e?null:t.count+e:r.push({type:"gap",count:e})},a=(e,t)=>i>=1e3?(o||l(null),o=!0,!1):(r.push({type:"line",left:e,right:t}),i++,!0),s=e=>{let t={lineNo:null,text:C(e),type:"context"};return a(t,{...t})};for(let[e,n]of t.entries()){if(o)break;e>0&&l(null);let t=k(n.oldText),r=k(n.newText),i=t.lines,d=r.lines,c=0;for(;c<i.length&&c<d.length&&S(t,c,r,c);)c++;let u=i.length,p=d.length;for(;u>c&&p>c&&S(t,u-1,r,p-1);)u--,p--;let f=Math.max(0,c-4);f>0&&l(f);for(let e=f;e<c&&s(i[e]);e++);let h=Math.max(u-c,p-c);for(let e=0;e<h;e++){let t=c+e<u?i[c+e]:null,n=c+e<p?d[c+e]:null;if(!a(null===t?M():{lineNo:null,text:C(t),type:"removed"},null===n?M():{lineNo:null,text:C(n),type:"added"}))break}let x=i.length-u,g=Math.min(x,4);for(let e=0;e<g&&s(i[u+e]);e++);!o&&x>g&&l(x-g)}return r.some(e=>"line"===e.type)?{oldPath:n,newPath:n,rows:r}:null}(E);return e?[e]:null},[E]),O=(0,$.aP)(l.toolName)?(n=l,0===(o=(0,W.qC)((0,W.IN)(n.input,n.rawInput))).length?null:o.join(", ").slice(0,120)):null,B=l.toolName!==H.sp||b?null:(0,H.aG)(l.input),_=null===B?null:{code:B,...(0,H.or)(s?.details)},P=null!==_&&void 0!==s&&0===s.content.length,G=g&&null===y&&null===_&&null===A?function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return null;let t=Object.entries(e);if(0===t.length)return null;let n=[];for(let[e,r]of t){if(null!==r&&"string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r)return null;let t=null===r?"null":String(r);n.push({key:e,value:""===t?"(empty)":t,multiline:t.includes("\n")})}return n}(b?(0,q.o2)(l.rawInput):l.input):null,K=J(l.toolName,s?.details),X=s?_?(0,H.Y6)(s.content):s.content:[],Q=s?X.filter(e=>"text"===e.type).map(e=>e.text).join("\n"):null,Z=K&&null!==Q?function(e){let t=e.trim();if(t.length>2e5||!/^[[{]/.test(t))return e;try{let n=!1,r=JSON.parse(t,(e,t)=>("number"==typeof t&&(!Number.isFinite(t)||Number.isInteger(t)&&!Number.isSafeInteger(t))&&(n=!0),t));return n?e:JSON.stringify(r,null,2)}catch{return e}}(Q):Q,ee=eO(X),et=null!==Z&&("(no output)"===Z.trim()||""===Z.trim()),en=I(l,s),er=(0,D.G)(s?.details)?s.details:null,ei=_?_.calls.length+_.omitted:0;return(0,r.jsxs)("div",{style:{borderRadius:7,overflow:"hidden",fontSize:12,border:en?"1px solid rgba(248,113,113,0.45)":"1px solid rgba(34,197,94,0.25)",background:en?"rgba(248,113,113,0.05)":"rgba(34,197,94,0.04)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"stretch",minWidth:0},children:[(0,r.jsxs)("button",{onClick:()=>{var e;let t=!g;e=l.toolCallId,e&&(t?z.add(e):z.delete(e)),m(t)},style:{display:"flex",alignItems:"center",gap:7,flex:1,minWidth:0,padding:"6px 10px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:12,textAlign:"left"},children:[(0,r.jsx)("span",{title:K?l.toolName:void 0,style:{color:en?"#f87171":"#16a34a",fontFamily:"var(--font-mono)",fontWeight:600,fontSize:11,flexShrink:0},children:K?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{style:{fontWeight:500,opacity:.75},children:[K.server,"/"]}),K.tool]}):l.toolName}),(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontFamily:"var(--font-mono)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:b?x("chat.generatingToolInput"):O??(_?(0,H.wH)(_.code):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;if(!e||"object"!=typeof e||Array.isArray(e))return"";let r=e=>{if(e.length<=120)return e;let t=e.charCodeAt(119);return e.slice(0,t>=55296&&t<=56319?119:120)};if("grep"===n||"find"===n){let t=Y(e.pattern);if(null!==t)return r(t)}for(let t of["command","path","file_path"]){let n=Y(e[t],"command"===t?" ":", ");if(null!==n)return r(n)}if(t)return r(t);for(let t of["pattern","query"]){let n=Y(e[t]);if(null!==n)return r(n)}let i=Object.values(e);for(let e of i){let t=Y(e);if(null!==t)return r(t)}for(let e of i){let t=function e(t){if(Array.isArray(t)){let n=t.map(t=>U(t)??e(t)).filter(e=>null!==e);return n.length>0?n.join(", "):null}if(t&&"object"==typeof t)for(let n of Object.values(t)){let t=Y(n)??e(n);if(null!==t)return t}return null}(e);if(null!==t)return r(t)}return""}(l.input,L,l.toolName))}),ei>0&&(0,r.jsx)("span",{style:{fontSize:11,color:"var(--text-dim)",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:1===ei?x("codemode.callCountOne"):x("codemode.callCount",{count:ei})}),void 0!==c?(0,r.jsx)("span",{style:{fontSize:11,color:"var(--text-dim)",flexShrink:0,fontVariantNumeric:"tabular-nums"},children:eg(c)}):u&&(0,r.jsx)(em,{clock:u},"startedAt"in u?u.startedAt:"ended"),(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,transform:g?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]}),er&&(p||f)&&(0,r.jsxs)("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid var(--border)"},children:[f&&(0,r.jsx)("button",{type:"button",onClick:()=>f(er.sessionId,er.description||er.profile),title:x("subagent.enterTitle"),"aria-label":x("subagent.enterTitle"),style:{padding:"0 9px",display:"flex",alignItems:"center",border:"none",background:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:11,fontWeight:600,whiteSpace:"nowrap"},children:x("subagent.enter")}),p&&(0,r.jsx)("button",{type:"button",onClick:()=>p(er.sessionId,er.description||er.profile),title:x("subagent.openTab"),"aria-label":x("subagent.openTab"),style:{width:32,display:"grid",placeItems:"center",border:"none",borderLeft:f?"1px solid var(--border)":"none",background:"none",color:"var(--text-muted)",cursor:"pointer",flexShrink:0},children:(0,r.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"5",y:"7",width:"14",height:"11",rx:"2"}),(0,r.jsx)("path",{d:"M9 11h.01M15 11h.01M9 15h6M12 7V4M10 4h4"})]})})]})]}),g&&(b||!N||!s&&!d&&!R)&&!A&&(G?(0,r.jsx)("div",{style:{padding:"6px 10px 8px",background:"var(--bg-subtle)",borderTop:en?"1px solid rgba(248,113,113,0.25)":"1px solid rgba(34,197,94,0.2)"},children:(0,r.jsx)(eG,{fields:G})}):(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:"var(--text-muted)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.5,overflow:"auto",background:"var(--bg-subtle)",borderTop:en?"1px solid rgba(248,113,113,0.25)":"1px solid rgba(34,197,94,0.2)",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:_?_.code.replace(/\r/g,"").trimEnd():v})),g&&_&&(0,r.jsx)(V,{calls:_.calls,omitted:_.omitted,isError:en}),ee.length>0&&(0,r.jsx)(eN,{images:ee,isError:en}),R&&(0,r.jsx)("div",{style:{borderTop:"1px solid rgba(34,197,94,0.15)",background:"var(--bg)"},children:(0,r.jsx)(ew,{files:R})}),g&&A&&(0,r.jsx)("div",{style:{borderTop:"1px solid rgba(34,197,94,0.15)",background:"var(--bg)"},children:(0,r.jsx)(ew,{files:A})}),g&&s&&A&&en&&(0,r.jsx)(ez,{text:Z??"",isEmpty:et,isError:en}),g&&s&&!A&&!P&&(T?(0,r.jsx)(ev,{diff:T}):(!et||0===ee.length)&&(0,r.jsx)(ez,{text:Z??"",isEmpty:et,isError:en})),g&&s&&h]})}function ev(e){let{diff:t}=e;return(0,r.jsx)("div",{style:{borderTop:"1px solid rgba(34,197,94,0.15)",background:"var(--bg)"},children:(0,r.jsx)(eb,{text:t.text})})}function eb(e){let{text:t}=e,n=(0,i.useMemo)(()=>(0,w.yg)(t),[t]);return n?(0,r.jsx)(ew,{files:n}):(0,r.jsx)(e$,{text:t})}function ew(e){let{files:t}=e,n=(0,f.a)()?"stacked":"split";return(0,r.jsx)(ej,{files:t,layout:n})}function ej(e){let{files:t,layout:n}=e,{t:i}=(0,a.s)(),o=t.length>1;return(0,r.jsx)("div",{style:{maxHeight:560,overflowY:"auto",overflowX:"hidden",background:"var(--bg)"},children:t.map((e,t)=>(0,r.jsxs)("div",{style:{minWidth:0,borderTop:0===t?"none":"1px solid var(--border)",fontFamily:"var(--font-mono)",fontWeight:"var(--font-mono-weight)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.55},children:[o&&"split"===n&&(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",position:"sticky",top:0,zIndex:1,background:"var(--bg-panel)",borderBottom:"1px solid var(--border)"},children:[(0,r.jsx)(eM,{title:e.oldPath||i("i18n.before"),side:"left"}),(0,r.jsx)(eM,{title:e.newPath||i("i18n.after"),side:"right"})]}),o&&"stacked"===n&&eS(e)&&(0,r.jsx)("div",{title:eS(e),style:{position:"sticky",top:0,zIndex:1,padding:"5px 10px",color:"var(--text-dim)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:eS(e)}),"split"===n&&(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)"},children:e.rows.map((e,t)=>"hunk"===e.type?null:"gap"===e.type?(0,r.jsx)(ek,{gap:e},t):(0,r.jsxs)("div",{style:{display:"contents"},children:[(0,r.jsx)(eW,{cell:e.left,side:"left"}),(0,r.jsx)(eW,{cell:e.right,side:"right"})]},t))}),"stacked"===n&&(0,w.jB)(e).map((e,t)=>"gap"===e.type?(0,r.jsx)(ek,{gap:e},t):(0,r.jsx)(eC,{line:e},t))]},t))})}function ek(e){let{gap:t}=e,{t:n}=(0,a.s)();return(0,r.jsx)("div",{style:{gridColumn:"1 / -1",padding:"0 10px",color:"var(--text-dim)",background:"var(--bg-panel)",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)",userSelect:"none"},children:null===t.count?"⋯":`⋯ ${(0,w.WM)(t.count,n)}`})}function eS(e){return e.newPath&&"/dev/null"!==e.newPath?e.newPath:e.oldPath||e.newPath||""}function eC(e){let{line:t}=e;return(0,r.jsx)(eW,{side:"right",cell:{lineNo:"removed"===t.type?t.oldLineNo:t.newLineNo,text:t.text,type:t.type}})}function eM(e){let{title:t,side:n}=e;return(0,r.jsx)("div",{title:t,style:{padding:"5px 10px",color:"var(--text-dim)",borderRight:"left"===n?"1px solid var(--border)":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})}function eW(e){let{cell:t,side:n}=e,i="added"===t.type?"rgba(34,197,94,0.12)":"removed"===t.type?"rgba(248,113,113,0.13)":"empty"===t.type?"var(--bg-subtle)":"transparent",o="added"===t.type?"+":"removed"===t.type?"-":" ",l="added"===t.type?"#22c55e":"removed"===t.type?"#f87171":"var(--text-dim)";return(0,r.jsxs)("div",{style:{display:"flex",minWidth:0,background:i,borderRight:"left"===n?"1px solid var(--border)":"none"},children:[(0,r.jsx)("span",{style:{width:42,padding:"0 6px",textAlign:"right",color:"var(--text-dim)",userSelect:"none",background:"var(--bg-panel)",borderRight:"1px solid var(--border)",flexShrink:0},children:t.lineNo??""}),(0,r.jsx)("span",{style:{width:18,padding:"0 5px",color:l,userSelect:"none",fontWeight:"context"===t.type||"empty"===t.type?400:700,flexShrink:0},children:o}),(0,r.jsx)("span",{style:{flex:1,minWidth:0,padding:"0 10px 0 0",color:"empty"===t.type?"var(--text-dim)":"var(--text)",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:t.text||"\xa0"})]})}function e$(e){let{text:t}=e,n=t.split(/\r?\n/);return(0,r.jsx)("div",{style:{maxHeight:520,overflowY:"auto",overflowX:"hidden",fontFamily:"var(--font-mono)",fontWeight:"var(--font-mono-weight)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.55,minWidth:0},children:n.map((e,t)=>{let n=e.startsWith("@@")?"hunk":e.startsWith("+")&&!e.startsWith("+++")?"added":e.startsWith("-")&&!e.startsWith("---")?"removed":"context";return(0,r.jsxs)("div",{style:{display:"flex",background:"added"===n?"rgba(34,197,94,0.12)":"removed"===n?"rgba(248,113,113,0.13)":"hunk"===n?"rgba(96,165,250,0.12)":"transparent",borderLeft:"added"===n?"3px solid #22c55e":"removed"===n?"3px solid #f87171":"hunk"===n?"3px solid var(--accent)":"3px solid transparent"},children:[(0,r.jsx)("span",{style:{width:48,padding:"0 8px",color:"var(--text-dim)",background:"var(--bg-panel)",borderRight:"1px solid var(--border)",textAlign:"right",userSelect:"none",flexShrink:0},children:t+1}),(0,r.jsx)("span",{style:{padding:"0 10px",whiteSpace:"pre-wrap",overflowWrap:"anywhere",color:"added"===n?"#22c55e":"removed"===n?"#f87171":"hunk"===n?"var(--accent)":"var(--text)"},children:e||"\xa0"})]},t)})})}function eI(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function eN(e){let{images:t,isError:n}=e;return(0,r.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",padding:"10px",background:"var(--bg)",borderTop:`1px solid ${n?"rgba(248,113,113,0.3)":"rgba(34,197,94,0.15)"}`},children:t.map((e,t)=>{let n=eB(e);return n?(0,r.jsx)(c.k,{src:n,style:{maxWidth:"100%"},children:(0,r.jsx)("img",{src:n,alt:"",loading:"lazy",style:{display:"block",maxWidth:"min(100%, 720px)",maxHeight:520,borderRadius:6,objectFit:"contain",border:"1px solid var(--border)"}})},`${n}-${t}`):null})})}function ez(e){let{text:t,isEmpty:n,isError:i}=e,{t:o}=(0,a.s)();return(0,r.jsx)("div",{style:{borderTop:`1px solid ${i?"rgba(248,113,113,0.3)":"rgba(34,197,94,0.15)"}`,background:i?"rgba(248,113,113,0.04)":"var(--bg-subtle)"},children:(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",color:i?"#f87171":n?"var(--text-dim)":"var(--text-muted)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.5,overflow:"auto",maxHeight:400,background:"var(--bg)",whiteSpace:"pre-wrap",wordBreak:"break-all",fontStyle:n?"italic":"normal",opacity:n?.6:1},children:n?o("i18n.noOutput"):t})})}function eT(e){let{message:t}=e,{t:n}=(0,a.s)(),[o,l]=(0,i.useState)(!1),s=eR(t.content),d=er(t.timestamp),c=t.details?.tokensBefore,u=(0,X.YQ)(t).find(e=>"summary_cost"===e.kind&&"compaction"===e.source);return(0,r.jsx)("div",{style:{marginBottom:16},children:(0,r.jsxs)("div",{style:{border:"1px solid var(--border)",borderRadius:8,overflow:"hidden",background:"var(--bg)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderBottom:"1px solid var(--border)",background:"var(--bg-panel)",color:"var(--text-muted)"},children:[(0,r.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:650},children:"compaction"}),d&&(0,r.jsx)("span",{style:{marginLeft:"auto",color:"var(--text-dim)",fontSize:10},children:d})]}),(0,r.jsxs)("div",{style:{padding:"11px 13px 12px"},children:[(0,r.jsxs)("button",{type:"button","aria-expanded":o,title:n(o?"i18n.collapse":"i18n.expand"),onClick:()=>l(e=>!e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:0,border:"none",background:"transparent",color:"var(--text)",cursor:"pointer",font:"inherit",textAlign:"left"},children:[(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,marginTop:4,color:"var(--text-muted)",transform:o?"rotate(90deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"4 2.5 7.5 6 4 9.5"})}),(0,r.jsxs)("span",{style:{minWidth:0},children:[(0,r.jsx)("span",{style:{display:"block",fontSize:"calc(15px + var(--chat-font-size-offset, 0px))",fontWeight:700,lineHeight:1.35},children:n("i18n.conversationCompacted")}),"number"==typeof c&&Number.isFinite(c)&&(0,r.jsx)("span",{style:{display:"block",marginTop:3,color:"var(--text-muted)",fontSize:"calc(13px + var(--chat-font-size-offset, 0px))",lineHeight:1.5},children:n("i18n.compactedFromTokens",{tokens:c.toLocaleString()})}),u&&(0,r.jsx)("span",{style:{display:"block",marginTop:2,color:Q.lV,fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.5},children:(0,Q.Mb)(n,u)})]})]}),o&&(0,r.jsx)(eF,{summary:s})]})]})})}function eF(e){let{summary:t}=e,{t:n}=(0,a.s)(),o=(0,i.useMemo)(()=>{let e,n,r,i,o;return e=[],n=[],r=t.match(x),i=r?.[1]??"",o=r?.index===void 0?t:t.slice(0,r.index),i.replace(h,(t,r,i)=>{let o=i.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);return"read-files"===r?e.push(...o):n.push(...o),""}),{body:o.trim(),readFiles:e,modifiedFiles:n}},[t]);return(0,r.jsxs)("div",{style:{marginTop:10},children:[o.body?(0,r.jsx)(l.m,{className:"markdown-compaction-message",children:o.body}):(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontSize:12},children:n("i18n.noSummary")}),(0,r.jsx)(eL,{readFiles:o.readFiles,modifiedFiles:o.modifiedFiles})]})}function eL(e){let{readFiles:t,modifiedFiles:n}=e,{t:i}=(0,a.s)();if(0===t.length+n.length)return null;let o=[];return t.length>0&&o.push(`${t.length} read`),n.length>0&&o.push(`${n.length} modified`),(0,r.jsxs)("details",{className:"compaction-file-details",children:[(0,r.jsx)("summary",{children:i("i18n.fileContext",{details:o.join(", ")})}),n.length>0&&(0,r.jsx)(eA,{title:i("i18n.modifiedFiles"),files:n}),t.length>0&&(0,r.jsx)(eA,{title:i("i18n.readFiles"),files:t})]})}function eA(e){let{title:t,files:n}=e;return(0,r.jsxs)("div",{className:"compaction-file-section",children:[(0,r.jsx)("div",{className:"compaction-file-title",children:t}),(0,r.jsx)("ul",{className:"compaction-file-list",children:n.map(e=>(0,r.jsx)("li",{children:e},e))})]})}function eE(e){let{message:t,cwd:n,onOpenFile:o}=e,{t:s}=(0,a.s)(),[d,u]=(0,i.useState)(!0),[f,h]=(0,i.useState)(!1),[x,g]=(0,i.useState)(!1),m=eR(t.content),y=eO(t.content),v=void 0!==t.details,b=v?function(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}(t.details):"",w=t.customType||"extension",j=er(t.timestamp);return(0,r.jsx)("div",{style:{marginBottom:16},children:(0,r.jsxs)("div",{style:{border:"1px solid var(--border)",borderRadius:8,overflow:"hidden",background:"var(--bg)"},children:[(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderBottom:d?"1px solid var(--border)":"none",background:"var(--bg-panel)",color:"var(--text-muted)",fontSize:12},children:(0,r.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-expanded":d,title:s(d?"i18n.collapse":"i18n.expand"),style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1,padding:0,border:"none",background:"none",color:"inherit",cursor:"pointer",fontSize:"inherit",textAlign:"left"},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:11,fontWeight:650,flexShrink:0},children:w}),!d&&m&&(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:m.slice(0,300).replace(/\s+/g," ").trim()}),j&&(0,r.jsx)("span",{style:{marginLeft:"auto",color:"var(--text-dim)",fontSize:10,flexShrink:0},children:j}),(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"var(--text-dim)",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,transform:d?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,r.jsx)("polyline",{points:"2 3.5 5 6.5 8 3.5"})})]})}),d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:{padding:"6px 9px"},children:[y.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:8*!!m},children:y.map((e,t)=>{let n=eB(e);return n?(0,r.jsx)(c.k,{src:n,children:(0,r.jsx)("img",{src:n,alt:"",style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:"contain",display:"block",border:"1px solid var(--border)"}})},t):null})}),m?(0,r.jsx)(l.m,{className:"markdown-custom-message",keepTextLayout:!0,cwd:n,onOpenFile:o,children:m}):(0,r.jsx)("span",{style:{color:"var(--text-dim)",fontSize:12},children:s("i18n.noMessage")})]}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 9px",borderTop:"1px solid var(--border)",background:"var(--bg-subtle)"},children:[m||b?(0,r.jsx)("button",{onClick:()=>{(0,p.D)(m||b).then(()=>{g(!0),setTimeout(()=>g(!1),1500)},()=>{})},style:{padding:"3px 7px",border:"none",background:"none",color:x?"var(--accent)":"var(--text-dim)",cursor:"pointer",fontSize:11},children:s(x?"i18n.copied":"i18n.copy")}):null,v&&(0,r.jsx)("button",{onClick:()=>h(e=>!e),style:{marginLeft:"auto",padding:"3px 7px",border:"none",background:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:11},children:s(f?"i18n.hideDetails":"i18n.showDetails")})]}),v&&f&&(0,r.jsx)("pre",{style:{margin:0,padding:"9px 10px",borderTop:"1px solid var(--border)",background:"var(--bg)",color:"var(--text-muted)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:360,overflow:"auto",fontFamily:"var(--font-mono)"},children:b})]})]})})}function eR(e){return"string"==typeof e?e:e.filter(e=>"text"===e.type).map(e=>e.text).join("\n")}function eO(e){return"string"==typeof e?[]:e.filter(e=>"image"===e.type)}function eB(e){return e.source?"base64"===e.source.type?`data:${e.source.media_type};base64,${e.source.data}`:e.source.url??"":e.data?`data:${e.mimeType};base64,${e.data}`:""}let e_=new Set(["path","file_path","content"]),eD={padding:"4px 12px 4px 0",color:"var(--text-dim)",fontSize:"calc(11px + var(--chat-font-size-offset, 0px))",whiteSpace:"nowrap",verticalAlign:"top"},eH={padding:"4px 0",color:"var(--text-muted)",fontSize:"calc(12px + var(--chat-font-size-offset, 0px))",fontFamily:"var(--font-mono)",overflowWrap:"anywhere"},eP={margin:0,padding:"8px 10px",maxHeight:260,overflow:"auto",border:"1px solid var(--border)",borderRadius:6,background:"var(--bg)",font:"inherit",lineHeight:1.5,whiteSpace:"pre-wrap"};function eG(e){let{fields:t}=e;return(0,r.jsx)("table",{style:{borderCollapse:"collapse"},children:(0,r.jsx)("tbody",{children:t.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{style:eD,children:e.key}),(0,r.jsx)("td",{style:eH,children:e.multiline?(0,r.jsx)("pre",{style:eP,children:e.value}):e.value})]},e.key))})})}let eV={up:"M6 10.5V1.5M2.5 5 6 1.5 9.5 5",down:"M6 1.5v9M2.5 7 6 10.5 9.5 7",clock:"M6 1.25a4.75 4.75 0 1 0 0 9.5 4.75 4.75 0 1 0 0-9.5M6 3.5V6l1.75 1"},eU={fontSize:0};function eY(e){let{part:t}=e;return t.icon?(0,r.jsxs)("span",{children:[t.before&&(0,r.jsx)("span",{style:eU,children:t.before}),(0,r.jsx)("svg",{width:"clock"===t.icon?10:9,height:"clock"===t.icon?10:9,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{display:"inline",verticalAlign:"clock"===t.icon?"-0.1em":"-0.05em",marginRight:"clock"===t.icon?3:1},children:(0,r.jsx)("path",{d:eV[t.icon]})}),t.text,t.after&&(0,r.jsx)("span",{style:eU,children:t.after})]}):(0,r.jsx)("span",{children:t.text})}function eq(e){let{message:t,sessionId:n}=e,{t:o}=(0,a.s)(),[l,s]=(0,i.useState)(null),[d,c]=(0,i.useState)(!1),[u,p]=(0,i.useState)(null),f=!t.output&&void 0===t.exitCode&&!t.cancelled,h=t.cancelled||void 0!==t.exitCode&&0!==t.exitCode,x=n&&t.fullOutputPath?`/api/agent/${encodeURIComponent(n)}/bash-output?path=${encodeURIComponent(t.fullOutputPath)}`:null,g=null!==l,m=l??t.output;async function y(){if(x){c(!0),p(null);try{let e=await fetch(x),t=await e.json().catch(()=>null);t?.success?s(t.data?.output??""):p(o(413===e.status?"chat.fullOutputTooLarge":"chat.fullOutputUnavailable"))}catch{p(o("chat.fullOutputUnavailable"))}finally{c(!1)}}}let v=t.excludeFromContext?"bash (local)":"bash",b={type:"toolCall",toolCallId:`bash-${t.timestamp??""}`,toolName:v,input:{command:t.command}},w=f?void 0:{role:"toolResult",toolCallId:b.toolCallId,toolName:v,content:m?[{type:"text",text:m}]:[],isError:h,timestamp:t.timestamp},j={color:"var(--accent)",fontSize:11,textDecoration:"underline"},k=t.truncated&&x?(0,r.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"2px 10px",padding:"5px 10px",fontSize:11,color:"var(--text-dim)",borderTop:`1px solid ${h?"rgba(248,113,113,0.3)":"rgba(34,197,94,0.15)"}`},children:[(0,r.jsx)("span",{role:"status",children:u??o(g?"chat.fullOutputShown":"chat.outputTruncated")}),!g&&(0,r.jsx)("button",{type:"button",onClick:y,disabled:d,style:{...j,background:"none",border:"none",cursor:d?"default":"pointer",padding:0},children:d?o("chat.loadingFullOutput"):o("chat.viewFullOutput")}),(0,r.jsx)("a",{href:`${x}&download=1`,style:j,children:o("chat.downloadFullOutput")})]}):null;return(0,r.jsx)("div",{style:{margin:"6px 0"},children:(0,r.jsx)(ey,{block:b,result:w,resultFooter:k})})}},31590:(e,t,n)=>{n.d(t,{a:()=>f,n:()=>h});var r=n(12115);let i="(max-width: 640px)",o="(max-width: 480px)";function l(e,t){if(!window.matchMedia)return()=>{};let n=window.matchMedia(e);return n.addEventListener("change",t),()=>n.removeEventListener("change",t)}function a(e){return!!window.matchMedia&&window.matchMedia(e).matches}let s=e=>l(i,e),d=()=>a(i),c=e=>l(o,e),u=()=>a(o);function p(){return!1}function f(){return(0,r.useSyncExternalStore)(s,d,p)}function h(){return(0,r.useSyncExternalStore)(c,u,p)}},36690:(e,t,n)=>{n.d(t,{Mb:()=>d,YL:()=>c,lV:()=>a,yt:()=>u});var r=n(95155),i=n(12115),o=n(21278),l=n(89594);let a="#d97706";function s(e,t){let n=(0,l.be)(t);return n?e("transcriptNotice.costSuffix",{cost:n}):""}function d(e,t){switch(t.kind){case"cache_miss":{let n={tokens:(0,l.Gg)(t.missedTokens),cost:s(e,t.missedCost)};if(t.modelChanged)return e("transcriptNotice.cacheMissModelSwitch",n);if(void 0!==t.idleMinutes)return e("transcriptNotice.cacheMissIdle",{...n,minutes:t.idleMinutes});return e("transcriptNotice.cacheMiss",n)}case"cache_warm":return e("transcriptNotice.cacheWarmed",{note:t.note?e("transcriptNotice.cacheWarmedNote",{note:t.note}):"",cost:(0,l.w7)(t.cost)});case"summary_cost":return e("compaction"===t.source?"transcriptNotice.compactionCost":"transcriptNotice.branchSummaryCost",{tokens:(0,l.Gg)(t.tokens),cost:s(e,t.cost)});case"thinking_dropped":return e(1===t.count?"transcriptNotice.thinkingDroppedOne":"transcriptNotice.thinkingDropped",{count:t.count})}}function c(e,t){let n={count:t.count,tokens:(0,l.Gg)(t.missedTokens),cost:s(e,t.missedCost)};return e(1===t.count?"transcriptNotice.foldCacheMiss":"transcriptNotice.foldCacheMisses",n)}let u=(0,i.memo)(function(e){let{notices:t}=e,{t:n}=(0,o.s)(),i=t.filter(e=>"summary_cost"!==e.kind||"compaction"!==e.source);return 0===i.length?null:(0,r.jsx)("div",{className:"transcript-notices",style:{display:"flex",flexDirection:"column",gap:2,margin:"-6px 0 12px"},children:i.map((e,t)=>{let i="cache_warm"!==e.kind;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,fontSize:12,lineHeight:1.5,color:i?a:"var(--text-dim)",overflowWrap:"anywhere"},children:[i&&(0,r.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{flexShrink:0,marginTop:3},children:[(0,r.jsx)("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"}),(0,r.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,r.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),(0,r.jsx)("span",{children:d(n,e)})]},t)})})})},40505:(e,t,n)=>{n.d(t,{E:()=>a,HP:()=>r,Ho:()=>o,fI:()=>s,vx:()=>l});let r=new Map;function i(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function o(e,t,n){let r=t.toolCallId;if("string"!=typeof r||"string"==typeof t.parentToolCallId&&""!==t.parentToolCallId)return e;if("tool_execution_start"===t.type){if(e.has(r))return e;let o=new Map(e);return o.set(r,{startedAt:n-(i(t.elapsedMs)??0)}),o}if("tool_execution_end"===t.type){let n=i(t.durationMs);if(void 0===n)return l(e,r);let o=new Map(e);return o.set(r,{durationMs:n}),o}return e}function l(e,t){if(!e.has(t))return e;let n=new Map(e);return n.delete(t),n}function a(e){let t=new Map([...e].filter(e=>{let[,t]=e;return"durationMs"in t}));return t.size===e.size?e:t.size?t:r}function s(e,t){return"durationMs"in e?e.durationMs:Math.max(0,t-e.startedAt)}},48656:(e,t,n)=>{function r(e){return e.trimStart().match(/^[^\r\n]{0,240}/u)?.[0].trimEnd()??""}function i(e){let t=[],n=0;for(;e.length-n>8e3;){let r=n+8e3,i=r+8e3,o=e.slice(r,i+1),l=o.indexOf("\n");for(;l>=0&&/\n\r?$/.test(e.slice(r+l-2,r+l));)l=o.indexOf("\n",l+1);if(l>=0){let i=r+l;if(i===e.length-1)break;t.push({text:e.slice(n,i),lineBreak:!0}),n=i+1}else if(e.length>i){let r=e.charCodeAt(i-1),o=r>=55296&&r<=56319?i-1:i;t.push({text:e.slice(n,o),lineBreak:!1}),n=o}else break}return t.push({text:e.slice(n),lineBreak:!1}),t}function o(e){return"custom"===e.role&&!e.display}function l(e){return"user"===e.role||"custom"===e.role&&!o(e)&&("compaction"===e.customType||"pi-web:subagent-notification"===e.customType||"subagent-notification"===e.customType)}function a(e){return"user"===e.role||"assistant"===e.role||"toolResult"===e.role}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.map(l);for(let i=0;i<e.length;){var r;if(a(e[i])){i+=1;continue}let l=i+1;for(;l<e.length&&!a(e[l]);)l+=1;let s=e[l];if((s?"assistant"===s.role:!0===t.openTail)&&(r=e[i-1],r?.role==="assistant"&&("stop"===r.stopReason||"aborted"===r.stopReason))&&!n.slice(i,l).includes(!0)){let t=-1;for(let n=l-1;n>=i;n--){if("custom"!==e[n].role){if(-1!==t)break;continue}if(-1===t&&(t=n),!o(e[n])){t=n;break}}-1!==t&&(n[t]=!0)}i=l}return n}function d(e,t){return"assistant"===e.role||t&&!o(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"thinking"===e.type&&!e.deferred&&!t.isStreaming&&""===e.thinking.trim()}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e.content??[]).filter(e=>!c(e,t))}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.isStreaming||"error"!==e.stopReason?null:e.errorMessage?.trim()||"Unknown provider error"}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!t.isStreaming&&"aborted"===e.stopReason}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!t.isStreaming&&"length"===e.stopReason}function x(e){return(e.content??[]).some(e=>"text"===e.type?e.text.trim().length>0:"image"===e.type||"toolCall"===e.type)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=u(e,t),r=n.findLastIndex(e=>"text"!==e.type&&"image"!==e.type);return -1===r?{answerBlocks:n,processBlocks:[]}:{answerBlocks:n.slice(r+1),processBlocks:n.slice(0,r+1)}}function m(e){return e.filter(e=>"toolCall"===e.type).length}function y(e){return(e?.content??[]).some(e=>"image"===e.type||"text"===e.type&&e.text.trim().length>0)}n.d(t,{D6:()=>x,Io:()=>s,Kj:()=>b,OP:()=>v,PC:()=>h,SI:()=>i,TC:()=>u,_q:()=>m,dQ:()=>g,de:()=>r,hh:()=>c,mc:()=>p,nR:()=>d,oG:()=>f,sE:()=>y,zZ:()=>o});let v=20;function b(e){return e.replace(/\n+$/,"").split("\n").slice(-v).join("\n")}},56038:(e,t,n)=>{function r(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function i(e,t,n){let i,o,l,a=r(e[t]?.timestamp);if(void 0===a)return;for(let i=t+1;i<n&&"custom"===e[i].role;i++){let t=r(e[i].timestamp);void 0!==t&&(a=Math.max(a,t))}let s=!1,d=0;for(let a=t+1;a<n;a++){let t=e[a];if("assistant"===t.role){var c;void 0!==o&&void 0!==l&&(d+=Math.max(0,l-o)),o=l=void 0;let e=function(e){if("assistant"!==e.role)return;let t=r(e.timestamp),n=r(e.durationMs);return void 0!==t&&void 0!==n?t+n:void 0}(t);s=void 0!==e,void 0!==e&&(i=Math.max(i??e,e)),void 0!==e&&"assistant"===(c=t).role&&("stop"===c.stopReason||"length"===c.stopReason)&&(o=i)}else if("toolResult"===t.role){let e=r(t.timestamp);void 0!==e&&(i=Math.max(i??e,e))}else if(void 0!==o){let e=r(t.timestamp);void 0!==e&&(l=Math.max(l??e,e))}}if(s&&void 0!==i)return Math.max(0,i-a-d)}function o(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m ${r}s`}n.d(t,{G:()=>i,J:()=>o})},61958:(e,t,n)=>{n.d(t,{_i:()=>i,kF:()=>l,ql:()=>o});let r="pi-thinking-expanded",i="pi-thinking-expanded-changed";function o(){try{return"true"===window.localStorage.getItem(r)}catch{return!1}}function l(e){try{window.localStorage.setItem(r,String(e))}catch{return}window.dispatchEvent(new Event(i))}},64738:(e,t,n)=>{function r(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function i(e){return e>0?e>=.01?`$${e.toFixed(2)}`:"<$0.01":null}function o(e,t){if(!e)return t("session.noUsage");let n=i(e.cost);return[t(1===e.totalMessages?"session.usageSummaryOne":"session.usageSummary",{messages:e.totalMessages,tokens:r(e.tokens.total)}),...n?[n]:[]].join(" \xb7 ")}function l(e){if(e<=0)return"0s";let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}n.d(t,{C$:()=>o,eX:()=>r,ik:()=>l,tb:()=>i})},67803:(e,t,n)=>{function r(e){let t=[];for(let n of e.matchAll(/^\*\*\* (?:Add|Delete|Update) File: (.+)$/gm)){let e=(n[1]??"").trim();e&&!t.includes(e)&&t.push(e)}return t}function i(e,t){if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e.input;if("string"==typeof t&&t.length>0)return t}return"string"==typeof t?t:""}function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){if(!o(e)||!o(e.result))return!1;let t=e.result.failures;return Array.isArray(t)&&t.length>0}function a(e){if(!o(e)||!o(e.result))return null;let t=e.result.appliedFiles;return Array.isArray(t)?t.filter(e=>"string"==typeof e&&e.length>0):null}function s(){let e=[],t=[],n=[],r=()=>({lineNo:null,text:"",type:"empty"}),i=()=>{let i=Math.max(t.length,n.length);for(let o=0;o<i;o++)e.push({type:"line",left:t[o]??r(),right:n[o]??r()});t=[],n=[]};return{rows:e,context(t,n){i(),e.push({type:"line",left:{lineNo:n,text:t,type:"context"},right:{lineNo:n,text:t,type:"context"}})},removed(e,n){t.push({lineNo:n,text:e,type:"removed"})},added(e,t){n.push({lineNo:t,text:e,type:"added"})},gap(){i(),e.length>0&&"gap"!==e[e.length-1].type&&e.push({type:"gap",count:null})},finish(){i(),e.length>0&&"gap"===e[e.length-1].type&&e.pop()}}}function d(e){if(!e.includes("*** Begin Patch")&&!/\*\*\* (?:Add|Delete|Update) File: /.test(e))return null;let t=[],n=null,r=null,i=null;for(let o of e.split(/\r?\n/)){let e=o.match(/^\*\*\* (Add|Delete|Update) File: (.+)$/);if(e){let o=e[1]?.toLowerCase()??"update",l=(e[2]??"").trim();n?.finish(),i=o,r={oldPath:"add"===o?void 0:l,newPath:"delete"===o?void 0:l,rows:(n=s()).rows},t.push(r);continue}if(/^\*\*\* Move to: /.test(o)){let e=o.replace(/^\*\*\* Move to: /,"").trim();r&&"update"===i&&(r.newPath=e);continue}if(!n||!r)continue;let l=n;if(!o.startsWith("*** ")){if("update"===i&&o.startsWith("@@")){l.gap();continue}if("update"===i){let e=o[0],t=o.slice(1);"+"===e?l.added(t,null):"-"===e?l.removed(t,null):" "===e?l.context(t,null):""!==o&&l.context(o,null)}else if("add"===i){if(""===o)continue;n.added(o.startsWith("+")?o.slice(1):o,null)}else if("delete"===i){if(""===o)continue;n.removed(o.startsWith("-")?o.slice(1):o,null)}}}n?.finish();let o=t.filter(e=>e.rows.length>0);return o.length>0?o:null}function c(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let t=e.files;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!e||"object"!=typeof e||Array.isArray(e)||"string"!=typeof e.filePath||"string"!=typeof e.diff)continue;let t=s();for(let n of e.diff.split(/\r?\n/)){let e=n.match(/^([+\- ])\s*(\d+) (.*)$/);if(!e)continue;let[,r,i,o]=e,l=Number(i);"+"===r?t.added(o,l):"-"===r?t.removed(o,l):t.context(o,l)}t.finish();let r="add"===e.operation,i="delete"===e.operation;n.push({oldPath:r?void 0:e.filePath,newPath:i?void 0:e.movePath??e.filePath,rows:t.rows})}let r=n.filter(e=>e.rows.length>0);return r.length>0?r:null}n.d(t,{FK:()=>l,IN:()=>i,ND:()=>c,dc:()=>a,oC:()=>d,qC:()=>r})},83236:(e,t,n)=>{n.d(t,{GB:()=>f,Y6:()=>c,YH:()=>u,aG:()=>a,ky:()=>x,or:()=>s,sp:()=>r,tw:()=>p,wH:()=>h});let r="codemode",i=new Set(["running","ok","error","cancelled"]);function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}function a(e){return o(e)&&"string"==typeof e.code?e.code:null}function s(e){if(!o(e)||!Array.isArray(e.calls))return{calls:[],omitted:0};let t=e.calls.flatMap(e=>{let t=function(e){if(!o(e)||"string"!=typeof e.name)return null;let t="string"==typeof e.status&&i.has(e.status)?e.status:"ok",n=l(e.durationMs),r=l(e.cost);return{id:"string"==typeof e.id?e.id:"",name:e.name,args:"string"==typeof e.args?e.args:"",status:t,...void 0!==n?{durationMs:n}:{},..."string"==typeof e.error&&e.error?{error:e.error}:{},...void 0!==r&&r>0?{cost:r}:{}}}(e);return t?[t]:[]}),n=l(e.omittedCalls);return{calls:t,omitted:void 0!==n&&n>0?Math.floor(n):0}}let d=/^Script (completed|failed)\nWall time ([\d.]+) seconds\nOutput:\n$/;function c(e){let[t,...n]=e;return t?.type==="text"&&"string"==typeof t.text&&d.test(t.text)?n:[...e]}function u(e){return void 0===e?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function p(e){return`$${e>=.01?e.toFixed(2):e.toPrecision(2)}`}function f(e){let t=e.filter(e=>void 0!==e.cost);return t.length>1?t.reduce((e,t)=>e+(t.cost??0),0):null}function h(e){for(let t of e.split(/\r?\n/)){let e=t.trim();if(e&&!e.startsWith("// @options:"))return e}return""}function x(e){if(!o(e))return null;let{calls:t}=s(e.details),n=t.findLast(e=>"running"===e.status)??t.at(-1);if(!n)return null;let r=n.args.length>120?`${n.args.slice(0,117)}...`:n.args;return r?`${n.name} ${r}`:n.name}},89594:(e,t,n)=>{n.d(t,{Gg:()=>l,Uv:()=>d,YQ:()=>i,be:()=>a,mO:()=>o,w7:()=>s});let r="transcriptNotices";function i(e){if("object"!=typeof e||null===e)return[];let t=e[r];return Array.isArray(t)?t:[]}function o(e,t){return t&&0!==t.length?{...e,[r]:[...t]}:e}function l(e){return e<1e3?e.toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:e<1e7?`${(e/1e6).toFixed(1)}M`:`${Math.round(e/1e6)}M`}function a(e){return e>=.01?`$${e.toFixed(2)}`:void 0}function s(e){return`$${e.toFixed(6).replace(/(\.\d{3}\d*?)0+$/,"$1")}`}function d(e){let t;for(let n of e)for(let e of i(n))"cache_miss"===e.kind&&(t??={count:0,missedTokens:0,missedCost:0},t.count+=1,t.missedTokens+=e.missedTokens,t.missedCost+=e.missedCost);return t}}}]);