@aitne/dashboard 0.1.9 → 0.1.10

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 (599) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +269 -295
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/prerender-manifest.json +24 -0
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.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.nft.json +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 +15 -15
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  20. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  21. package/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  22. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  23. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  24. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  25. package/.next/server/app/activity/page.js.nft.json +1 -1
  26. package/.next/server/app/activity/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/activity.html +1 -1
  28. package/.next/server/app/activity.rsc +28 -27
  29. package/.next/server/app/activity.segments/_full.segment.rsc +28 -27
  30. package/.next/server/app/activity.segments/_head.segment.rsc +4 -4
  31. package/.next/server/app/activity.segments/_index.segment.rsc +10 -10
  32. package/.next/server/app/activity.segments/_tree.segment.rsc +2 -2
  33. package/.next/server/app/activity.segments/activity/__PAGE__.segment.rsc +4 -4
  34. package/.next/server/app/activity.segments/activity.segment.rsc +4 -4
  35. package/.next/server/app/agents/[slug]/executions/page.js.nft.json +1 -1
  36. package/.next/server/app/agents/[slug]/executions/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/agents/[slug]/page.js.nft.json +1 -1
  38. package/.next/server/app/agents/[slug]/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/agents/page.js.nft.json +1 -1
  40. package/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  41. package/.next/server/app/agents.html +1 -1
  42. package/.next/server/app/agents.rsc +17 -17
  43. package/.next/server/app/agents.segments/_full.segment.rsc +17 -17
  44. package/.next/server/app/agents.segments/_head.segment.rsc +4 -4
  45. package/.next/server/app/agents.segments/_index.segment.rsc +10 -10
  46. package/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
  47. package/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +4 -4
  48. package/.next/server/app/agents.segments/agents.segment.rsc +3 -3
  49. package/.next/server/app/analytics/page.js.nft.json +1 -1
  50. package/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/analytics.html +1 -1
  52. package/.next/server/app/analytics.rsc +23 -24
  53. package/.next/server/app/analytics.segments/_full.segment.rsc +23 -24
  54. package/.next/server/app/analytics.segments/_head.segment.rsc +4 -4
  55. package/.next/server/app/analytics.segments/_index.segment.rsc +10 -10
  56. package/.next/server/app/analytics.segments/_tree.segment.rsc +2 -2
  57. package/.next/server/app/analytics.segments/analytics/__PAGE__.segment.rsc +4 -4
  58. package/.next/server/app/analytics.segments/analytics.segment.rsc +4 -4
  59. package/.next/server/app/browser-tasks/[id]/page.js.nft.json +1 -1
  60. package/.next/server/app/browser-tasks/[id]/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/browser-tasks/page.js.nft.json +1 -1
  62. package/.next/server/app/browser-tasks/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app/browser-tasks.html +1 -1
  64. package/.next/server/app/browser-tasks.rsc +17 -17
  65. package/.next/server/app/browser-tasks.segments/_full.segment.rsc +17 -17
  66. package/.next/server/app/browser-tasks.segments/_head.segment.rsc +4 -4
  67. package/.next/server/app/browser-tasks.segments/_index.segment.rsc +10 -10
  68. package/.next/server/app/browser-tasks.segments/_tree.segment.rsc +2 -2
  69. package/.next/server/app/browser-tasks.segments/browser-tasks/__PAGE__.segment.rsc +4 -4
  70. package/.next/server/app/browser-tasks.segments/browser-tasks.segment.rsc +3 -3
  71. package/.next/server/app/chat/page.js.nft.json +1 -1
  72. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/chat.html +1 -1
  74. package/.next/server/app/chat.rsc +17 -17
  75. package/.next/server/app/chat.segments/_full.segment.rsc +17 -17
  76. package/.next/server/app/chat.segments/_head.segment.rsc +4 -4
  77. package/.next/server/app/chat.segments/_index.segment.rsc +10 -10
  78. package/.next/server/app/chat.segments/_tree.segment.rsc +2 -2
  79. package/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +4 -4
  80. package/.next/server/app/chat.segments/chat.segment.rsc +3 -3
  81. package/.next/server/app/connections/calendar/page.js.nft.json +1 -1
  82. package/.next/server/app/connections/calendar/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/connections/calendar.html +1 -1
  84. package/.next/server/app/connections/calendar.rsc +18 -18
  85. package/.next/server/app/connections/calendar.segments/_full.segment.rsc +18 -18
  86. package/.next/server/app/connections/calendar.segments/_head.segment.rsc +4 -4
  87. package/.next/server/app/connections/calendar.segments/_index.segment.rsc +10 -10
  88. package/.next/server/app/connections/calendar.segments/_tree.segment.rsc +2 -2
  89. package/.next/server/app/connections/calendar.segments/connections/calendar/__PAGE__.segment.rsc +4 -4
  90. package/.next/server/app/connections/calendar.segments/connections/calendar.segment.rsc +3 -3
  91. package/.next/server/app/connections/calendar.segments/connections.segment.rsc +4 -4
  92. package/.next/server/app/connections/journal/page.js.nft.json +1 -1
  93. package/.next/server/app/connections/journal/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/connections/journal.html +1 -1
  95. package/.next/server/app/connections/journal.rsc +16 -16
  96. package/.next/server/app/connections/journal.segments/_full.segment.rsc +16 -16
  97. package/.next/server/app/connections/journal.segments/_head.segment.rsc +4 -4
  98. package/.next/server/app/connections/journal.segments/_index.segment.rsc +10 -10
  99. package/.next/server/app/connections/journal.segments/_tree.segment.rsc +2 -2
  100. package/.next/server/app/connections/journal.segments/connections/journal/__PAGE__.segment.rsc +2 -2
  101. package/.next/server/app/connections/journal.segments/connections/journal.segment.rsc +3 -3
  102. package/.next/server/app/connections/journal.segments/connections.segment.rsc +4 -4
  103. package/.next/server/app/connections/knowledge/page.js.nft.json +1 -1
  104. package/.next/server/app/connections/knowledge/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/connections/knowledge.html +1 -1
  106. package/.next/server/app/connections/knowledge.rsc +18 -18
  107. package/.next/server/app/connections/knowledge.segments/_full.segment.rsc +18 -18
  108. package/.next/server/app/connections/knowledge.segments/_head.segment.rsc +4 -4
  109. package/.next/server/app/connections/knowledge.segments/_index.segment.rsc +10 -10
  110. package/.next/server/app/connections/knowledge.segments/_tree.segment.rsc +2 -2
  111. package/.next/server/app/connections/knowledge.segments/connections/knowledge/__PAGE__.segment.rsc +4 -4
  112. package/.next/server/app/connections/knowledge.segments/connections/knowledge.segment.rsc +3 -3
  113. package/.next/server/app/connections/knowledge.segments/connections.segment.rsc +4 -4
  114. package/.next/server/app/connections/mail/page.js.nft.json +1 -1
  115. package/.next/server/app/connections/mail/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/connections/mail.html +1 -1
  117. package/.next/server/app/connections/mail.rsc +18 -18
  118. package/.next/server/app/connections/mail.segments/_full.segment.rsc +18 -18
  119. package/.next/server/app/connections/mail.segments/_head.segment.rsc +4 -4
  120. package/.next/server/app/connections/mail.segments/_index.segment.rsc +10 -10
  121. package/.next/server/app/connections/mail.segments/_tree.segment.rsc +2 -2
  122. package/.next/server/app/connections/mail.segments/connections/mail/__PAGE__.segment.rsc +4 -4
  123. package/.next/server/app/connections/mail.segments/connections/mail.segment.rsc +3 -3
  124. package/.next/server/app/connections/mail.segments/connections.segment.rsc +4 -4
  125. package/.next/server/app/connections/mcp/page.js.nft.json +1 -1
  126. package/.next/server/app/connections/mcp/page_client-reference-manifest.js +1 -1
  127. package/.next/server/app/connections/mcp.html +1 -1
  128. package/.next/server/app/connections/mcp.rsc +18 -18
  129. package/.next/server/app/connections/mcp.segments/_full.segment.rsc +18 -18
  130. package/.next/server/app/connections/mcp.segments/_head.segment.rsc +4 -4
  131. package/.next/server/app/connections/mcp.segments/_index.segment.rsc +10 -10
  132. package/.next/server/app/connections/mcp.segments/_tree.segment.rsc +2 -2
  133. package/.next/server/app/connections/mcp.segments/connections/mcp/__PAGE__.segment.rsc +4 -4
  134. package/.next/server/app/connections/mcp.segments/connections/mcp.segment.rsc +3 -3
  135. package/.next/server/app/connections/mcp.segments/connections.segment.rsc +4 -4
  136. package/.next/server/app/connections/messaging/page.js.nft.json +1 -1
  137. package/.next/server/app/connections/messaging/page_client-reference-manifest.js +1 -1
  138. package/.next/server/app/connections/messaging.html +1 -1
  139. package/.next/server/app/connections/messaging.rsc +18 -18
  140. package/.next/server/app/connections/messaging.segments/_full.segment.rsc +18 -18
  141. package/.next/server/app/connections/messaging.segments/_head.segment.rsc +4 -4
  142. package/.next/server/app/connections/messaging.segments/_index.segment.rsc +10 -10
  143. package/.next/server/app/connections/messaging.segments/_tree.segment.rsc +2 -2
  144. package/.next/server/app/connections/messaging.segments/connections/messaging/__PAGE__.segment.rsc +4 -4
  145. package/.next/server/app/connections/messaging.segments/connections/messaging.segment.rsc +3 -3
  146. package/.next/server/app/connections/messaging.segments/connections.segment.rsc +4 -4
  147. package/.next/server/app/connections/page.js.nft.json +1 -1
  148. package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  149. package/.next/server/app/connections/repositories/page.js.nft.json +1 -1
  150. package/.next/server/app/connections/repositories/page_client-reference-manifest.js +1 -1
  151. package/.next/server/app/connections/repositories.html +1 -1
  152. package/.next/server/app/connections/repositories.rsc +18 -18
  153. package/.next/server/app/connections/repositories.segments/_full.segment.rsc +18 -18
  154. package/.next/server/app/connections/repositories.segments/_head.segment.rsc +4 -4
  155. package/.next/server/app/connections/repositories.segments/_index.segment.rsc +10 -10
  156. package/.next/server/app/connections/repositories.segments/_tree.segment.rsc +2 -2
  157. package/.next/server/app/connections/repositories.segments/connections/repositories/__PAGE__.segment.rsc +4 -4
  158. package/.next/server/app/connections/repositories.segments/connections/repositories.segment.rsc +3 -3
  159. package/.next/server/app/connections/repositories.segments/connections.segment.rsc +4 -4
  160. package/.next/server/app/connections/routines/page.js.nft.json +1 -1
  161. package/.next/server/app/connections/routines/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/connections/routines.html +1 -1
  163. package/.next/server/app/connections/routines.rsc +16 -16
  164. package/.next/server/app/connections/routines.segments/_full.segment.rsc +16 -16
  165. package/.next/server/app/connections/routines.segments/_head.segment.rsc +4 -4
  166. package/.next/server/app/connections/routines.segments/_index.segment.rsc +10 -10
  167. package/.next/server/app/connections/routines.segments/_tree.segment.rsc +2 -2
  168. package/.next/server/app/connections/routines.segments/connections/routines/__PAGE__.segment.rsc +2 -2
  169. package/.next/server/app/connections/routines.segments/connections/routines.segment.rsc +3 -3
  170. package/.next/server/app/connections/routines.segments/connections.segment.rsc +4 -4
  171. package/.next/server/app/connections.html +1 -1
  172. package/.next/server/app/connections.rsc +16 -16
  173. package/.next/server/app/connections.segments/_full.segment.rsc +16 -16
  174. package/.next/server/app/connections.segments/_head.segment.rsc +4 -4
  175. package/.next/server/app/connections.segments/_index.segment.rsc +10 -10
  176. package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
  177. package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +2 -2
  178. package/.next/server/app/connections.segments/connections.segment.rsc +4 -4
  179. package/.next/server/app/conversations/[id]/page.js.nft.json +1 -1
  180. package/.next/server/app/conversations/[id]/page_client-reference-manifest.js +1 -1
  181. package/.next/server/app/conversations/page.js.nft.json +1 -1
  182. package/.next/server/app/conversations/page_client-reference-manifest.js +1 -1
  183. package/.next/server/app/conversations.html +1 -1
  184. package/.next/server/app/conversations.rsc +15 -15
  185. package/.next/server/app/conversations.segments/_full.segment.rsc +15 -15
  186. package/.next/server/app/conversations.segments/_head.segment.rsc +4 -4
  187. package/.next/server/app/conversations.segments/_index.segment.rsc +10 -10
  188. package/.next/server/app/conversations.segments/_tree.segment.rsc +2 -2
  189. package/.next/server/app/conversations.segments/conversations/__PAGE__.segment.rsc +2 -2
  190. package/.next/server/app/conversations.segments/conversations.segment.rsc +3 -3
  191. package/.next/server/app/docs/[[...slug]]/page.js.nft.json +1 -1
  192. package/.next/server/app/docs/[[...slug]]/page_client-reference-manifest.js +1 -1
  193. package/.next/server/app/finance/page.js.nft.json +1 -1
  194. package/.next/server/app/finance/page_client-reference-manifest.js +1 -1
  195. package/.next/server/app/finance.html +1 -1
  196. package/.next/server/app/finance.rsc +17 -17
  197. package/.next/server/app/finance.segments/_full.segment.rsc +17 -17
  198. package/.next/server/app/finance.segments/_head.segment.rsc +4 -4
  199. package/.next/server/app/finance.segments/_index.segment.rsc +10 -10
  200. package/.next/server/app/finance.segments/_tree.segment.rsc +2 -2
  201. package/.next/server/app/finance.segments/finance/__PAGE__.segment.rsc +4 -4
  202. package/.next/server/app/finance.segments/finance.segment.rsc +3 -3
  203. package/.next/server/app/git/page.js.nft.json +1 -1
  204. package/.next/server/app/git/page_client-reference-manifest.js +1 -1
  205. package/.next/server/app/git.html +1 -1
  206. package/.next/server/app/git.rsc +17 -17
  207. package/.next/server/app/git.segments/_full.segment.rsc +17 -17
  208. package/.next/server/app/git.segments/_head.segment.rsc +4 -4
  209. package/.next/server/app/git.segments/_index.segment.rsc +10 -10
  210. package/.next/server/app/git.segments/_tree.segment.rsc +2 -2
  211. package/.next/server/app/git.segments/git/__PAGE__.segment.rsc +4 -4
  212. package/.next/server/app/git.segments/git.segment.rsc +3 -3
  213. package/.next/server/app/health/page.js.nft.json +1 -1
  214. package/.next/server/app/health/page_client-reference-manifest.js +1 -1
  215. package/.next/server/app/health.html +1 -1
  216. package/.next/server/app/health.rsc +17 -17
  217. package/.next/server/app/health.segments/_full.segment.rsc +17 -17
  218. package/.next/server/app/health.segments/_head.segment.rsc +4 -4
  219. package/.next/server/app/health.segments/_index.segment.rsc +10 -10
  220. package/.next/server/app/health.segments/_tree.segment.rsc +2 -2
  221. package/.next/server/app/health.segments/health/__PAGE__.segment.rsc +4 -4
  222. package/.next/server/app/health.segments/health.segment.rsc +3 -3
  223. package/.next/server/app/index.html +1 -1
  224. package/.next/server/app/index.rsc +17 -17
  225. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  226. package/.next/server/app/index.segments/_full.segment.rsc +17 -17
  227. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  228. package/.next/server/app/index.segments/_index.segment.rsc +10 -10
  229. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  230. package/.next/server/app/knowledge/page.js.nft.json +1 -1
  231. package/.next/server/app/knowledge/page_client-reference-manifest.js +1 -1
  232. package/.next/server/app/knowledge.html +1 -1
  233. package/.next/server/app/knowledge.rsc +18 -18
  234. package/.next/server/app/knowledge.segments/_full.segment.rsc +18 -18
  235. package/.next/server/app/knowledge.segments/_head.segment.rsc +4 -4
  236. package/.next/server/app/knowledge.segments/_index.segment.rsc +10 -10
  237. package/.next/server/app/knowledge.segments/_tree.segment.rsc +2 -2
  238. package/.next/server/app/knowledge.segments/knowledge/__PAGE__.segment.rsc +4 -4
  239. package/.next/server/app/knowledge.segments/knowledge.segment.rsc +4 -4
  240. package/.next/server/app/page.js.nft.json +1 -1
  241. package/.next/server/app/page_client-reference-manifest.js +1 -1
  242. package/.next/server/app/reading/page.js.nft.json +1 -1
  243. package/.next/server/app/reading/page_client-reference-manifest.js +1 -1
  244. package/.next/server/app/reading.html +1 -1
  245. package/.next/server/app/reading.rsc +17 -17
  246. package/.next/server/app/reading.segments/_full.segment.rsc +17 -17
  247. package/.next/server/app/reading.segments/_head.segment.rsc +4 -4
  248. package/.next/server/app/reading.segments/_index.segment.rsc +10 -10
  249. package/.next/server/app/reading.segments/_tree.segment.rsc +2 -2
  250. package/.next/server/app/reading.segments/reading/__PAGE__.segment.rsc +4 -4
  251. package/.next/server/app/reading.segments/reading.segment.rsc +3 -3
  252. package/.next/server/app/schedule/page.js.nft.json +1 -1
  253. package/.next/server/app/schedule/page_client-reference-manifest.js +1 -1
  254. package/.next/server/app/schedule.html +1 -1
  255. package/.next/server/app/schedule.rsc +17 -17
  256. package/.next/server/app/schedule.segments/_full.segment.rsc +17 -17
  257. package/.next/server/app/schedule.segments/_head.segment.rsc +4 -4
  258. package/.next/server/app/schedule.segments/_index.segment.rsc +10 -10
  259. package/.next/server/app/schedule.segments/_tree.segment.rsc +2 -2
  260. package/.next/server/app/schedule.segments/schedule/__PAGE__.segment.rsc +4 -4
  261. package/.next/server/app/schedule.segments/schedule.segment.rsc +3 -3
  262. package/.next/server/app/settings/advanced/page.js.nft.json +1 -1
  263. package/.next/server/app/settings/advanced/page_client-reference-manifest.js +1 -1
  264. package/.next/server/app/settings/advanced.html +1 -1
  265. package/.next/server/app/settings/advanced.rsc +18 -18
  266. package/.next/server/app/settings/advanced.segments/_full.segment.rsc +18 -18
  267. package/.next/server/app/settings/advanced.segments/_head.segment.rsc +4 -4
  268. package/.next/server/app/settings/advanced.segments/_index.segment.rsc +10 -10
  269. package/.next/server/app/settings/advanced.segments/_tree.segment.rsc +2 -2
  270. package/.next/server/app/settings/advanced.segments/settings/advanced/__PAGE__.segment.rsc +4 -4
  271. package/.next/server/app/settings/advanced.segments/settings/advanced.segment.rsc +3 -3
  272. package/.next/server/app/settings/advanced.segments/settings.segment.rsc +4 -4
  273. package/.next/server/app/settings/backends/page.js.nft.json +1 -1
  274. package/.next/server/app/settings/backends/page_client-reference-manifest.js +1 -1
  275. package/.next/server/app/settings/backends.html +1 -1
  276. package/.next/server/app/settings/backends.rsc +16 -16
  277. package/.next/server/app/settings/backends.segments/_full.segment.rsc +16 -16
  278. package/.next/server/app/settings/backends.segments/_head.segment.rsc +4 -4
  279. package/.next/server/app/settings/backends.segments/_index.segment.rsc +10 -10
  280. package/.next/server/app/settings/backends.segments/_tree.segment.rsc +2 -2
  281. package/.next/server/app/settings/backends.segments/settings/backends/__PAGE__.segment.rsc +2 -2
  282. package/.next/server/app/settings/backends.segments/settings/backends.segment.rsc +3 -3
  283. package/.next/server/app/settings/backends.segments/settings.segment.rsc +4 -4
  284. package/.next/server/app/settings/commands/page.js.nft.json +1 -1
  285. package/.next/server/app/settings/commands/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/settings/commands.html +1 -1
  287. package/.next/server/app/settings/commands.rsc +18 -18
  288. package/.next/server/app/settings/commands.segments/_full.segment.rsc +18 -18
  289. package/.next/server/app/settings/commands.segments/_head.segment.rsc +4 -4
  290. package/.next/server/app/settings/commands.segments/_index.segment.rsc +10 -10
  291. package/.next/server/app/settings/commands.segments/_tree.segment.rsc +2 -2
  292. package/.next/server/app/settings/commands.segments/settings/commands/__PAGE__.segment.rsc +4 -4
  293. package/.next/server/app/settings/commands.segments/settings/commands.segment.rsc +3 -3
  294. package/.next/server/app/settings/commands.segments/settings.segment.rsc +4 -4
  295. package/.next/server/app/settings/connections/page.js.nft.json +1 -1
  296. package/.next/server/app/settings/connections/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app/settings/connections.html +1 -1
  298. package/.next/server/app/settings/connections.rsc +16 -16
  299. package/.next/server/app/settings/connections.segments/_full.segment.rsc +16 -16
  300. package/.next/server/app/settings/connections.segments/_head.segment.rsc +4 -4
  301. package/.next/server/app/settings/connections.segments/_index.segment.rsc +10 -10
  302. package/.next/server/app/settings/connections.segments/_tree.segment.rsc +2 -2
  303. package/.next/server/app/settings/connections.segments/settings/connections/__PAGE__.segment.rsc +2 -2
  304. package/.next/server/app/settings/connections.segments/settings/connections.segment.rsc +3 -3
  305. package/.next/server/app/settings/connections.segments/settings.segment.rsc +4 -4
  306. package/.next/server/app/settings/integrations/browser-history/page.js.nft.json +1 -1
  307. package/.next/server/app/settings/integrations/browser-history/page_client-reference-manifest.js +1 -1
  308. package/.next/server/app/settings/integrations/browser-history-managed/b4/page.js.nft.json +1 -1
  309. package/.next/server/app/settings/integrations/browser-history-managed/b4/page_client-reference-manifest.js +1 -1
  310. package/.next/server/app/settings/integrations/browser-history-managed/b4.html +1 -1
  311. package/.next/server/app/settings/integrations/browser-history-managed/b4.rsc +18 -18
  312. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/_full.segment.rsc +18 -18
  313. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/_head.segment.rsc +4 -4
  314. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/_index.segment.rsc +10 -10
  315. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/_tree.segment.rsc +2 -2
  316. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/settings/integrations/browser-history-managed/b4/__PAGE__.segment.rsc +4 -4
  317. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/settings/integrations/browser-history-managed/b4.segment.rsc +3 -3
  318. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/settings/integrations/browser-history-managed.segment.rsc +3 -3
  319. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/settings/integrations.segment.rsc +3 -3
  320. package/.next/server/app/settings/integrations/browser-history-managed/b4.segments/settings.segment.rsc +4 -4
  321. package/.next/server/app/settings/integrations/browser-history-managed/page.js.nft.json +1 -1
  322. package/.next/server/app/settings/integrations/browser-history-managed/page_client-reference-manifest.js +1 -1
  323. package/.next/server/app/settings/integrations/browser-history-managed.html +1 -1
  324. package/.next/server/app/settings/integrations/browser-history-managed.rsc +18 -18
  325. package/.next/server/app/settings/integrations/browser-history-managed.segments/_full.segment.rsc +18 -18
  326. package/.next/server/app/settings/integrations/browser-history-managed.segments/_head.segment.rsc +4 -4
  327. package/.next/server/app/settings/integrations/browser-history-managed.segments/_index.segment.rsc +10 -10
  328. package/.next/server/app/settings/integrations/browser-history-managed.segments/_tree.segment.rsc +2 -2
  329. package/.next/server/app/settings/integrations/browser-history-managed.segments/settings/integrations/browser-history-managed/__PAGE__.segment.rsc +4 -4
  330. package/.next/server/app/settings/integrations/browser-history-managed.segments/settings/integrations/browser-history-managed.segment.rsc +3 -3
  331. package/.next/server/app/settings/integrations/browser-history-managed.segments/settings/integrations.segment.rsc +3 -3
  332. package/.next/server/app/settings/integrations/browser-history-managed.segments/settings.segment.rsc +4 -4
  333. package/.next/server/app/settings/integrations/browser-history.html +1 -1
  334. package/.next/server/app/settings/integrations/browser-history.rsc +18 -18
  335. package/.next/server/app/settings/integrations/browser-history.segments/_full.segment.rsc +18 -18
  336. package/.next/server/app/settings/integrations/browser-history.segments/_head.segment.rsc +4 -4
  337. package/.next/server/app/settings/integrations/browser-history.segments/_index.segment.rsc +10 -10
  338. package/.next/server/app/settings/integrations/browser-history.segments/_tree.segment.rsc +2 -2
  339. package/.next/server/app/settings/integrations/browser-history.segments/settings/integrations/browser-history/__PAGE__.segment.rsc +4 -4
  340. package/.next/server/app/settings/integrations/browser-history.segments/settings/integrations/browser-history.segment.rsc +3 -3
  341. package/.next/server/app/settings/integrations/browser-history.segments/settings/integrations.segment.rsc +3 -3
  342. package/.next/server/app/settings/integrations/browser-history.segments/settings.segment.rsc +4 -4
  343. package/.next/server/app/settings/journal/page.js.nft.json +1 -1
  344. package/.next/server/app/settings/journal/page_client-reference-manifest.js +1 -1
  345. package/.next/server/app/settings/journal.html +1 -1
  346. package/.next/server/app/settings/journal.rsc +18 -18
  347. package/.next/server/app/settings/journal.segments/_full.segment.rsc +18 -18
  348. package/.next/server/app/settings/journal.segments/_head.segment.rsc +4 -4
  349. package/.next/server/app/settings/journal.segments/_index.segment.rsc +10 -10
  350. package/.next/server/app/settings/journal.segments/_tree.segment.rsc +2 -2
  351. package/.next/server/app/settings/journal.segments/settings/journal/__PAGE__.segment.rsc +4 -4
  352. package/.next/server/app/settings/journal.segments/settings/journal.segment.rsc +3 -3
  353. package/.next/server/app/settings/journal.segments/settings.segment.rsc +4 -4
  354. package/.next/server/app/settings/lessons/page/app-paths-manifest.json +3 -0
  355. package/.next/server/app/settings/lessons/page/build-manifest.json +18 -0
  356. package/.next/server/app/settings/lessons/page/next-font-manifest.json +6 -0
  357. package/.next/server/app/settings/lessons/page/react-loadable-manifest.json +8 -0
  358. package/.next/server/app/settings/lessons/page/server-reference-manifest.json +4 -0
  359. package/.next/server/app/settings/lessons/page.js +16 -0
  360. package/.next/server/app/settings/lessons/page.js.nft.json +1 -0
  361. package/.next/server/app/settings/lessons/page_client-reference-manifest.js +3 -0
  362. package/.next/server/app/settings/lessons.html +1 -0
  363. package/.next/server/app/settings/lessons.meta +16 -0
  364. package/.next/server/app/settings/lessons.rsc +27 -0
  365. package/.next/server/app/settings/lessons.segments/_full.segment.rsc +27 -0
  366. package/.next/server/app/settings/lessons.segments/_head.segment.rsc +6 -0
  367. package/.next/server/app/settings/lessons.segments/_index.segment.rsc +11 -0
  368. package/.next/server/app/settings/lessons.segments/_tree.segment.rsc +2 -0
  369. package/.next/server/app/settings/lessons.segments/settings/lessons/__PAGE__.segment.rsc +9 -0
  370. package/.next/server/app/settings/lessons.segments/settings/lessons.segment.rsc +5 -0
  371. package/.next/server/app/settings/lessons.segments/settings.segment.rsc +5 -0
  372. package/.next/server/app/settings/management/page.js.nft.json +1 -1
  373. package/.next/server/app/settings/management/page_client-reference-manifest.js +1 -1
  374. package/.next/server/app/settings/management.html +1 -1
  375. package/.next/server/app/settings/management.rsc +18 -18
  376. package/.next/server/app/settings/management.segments/_full.segment.rsc +18 -18
  377. package/.next/server/app/settings/management.segments/_head.segment.rsc +4 -4
  378. package/.next/server/app/settings/management.segments/_index.segment.rsc +10 -10
  379. package/.next/server/app/settings/management.segments/_tree.segment.rsc +2 -2
  380. package/.next/server/app/settings/management.segments/settings/management/__PAGE__.segment.rsc +4 -4
  381. package/.next/server/app/settings/management.segments/settings/management.segment.rsc +3 -3
  382. package/.next/server/app/settings/management.segments/settings.segment.rsc +4 -4
  383. package/.next/server/app/settings/messaging/page.js.nft.json +1 -1
  384. package/.next/server/app/settings/messaging/page_client-reference-manifest.js +1 -1
  385. package/.next/server/app/settings/messaging.html +1 -1
  386. package/.next/server/app/settings/messaging.rsc +16 -16
  387. package/.next/server/app/settings/messaging.segments/_full.segment.rsc +16 -16
  388. package/.next/server/app/settings/messaging.segments/_head.segment.rsc +4 -4
  389. package/.next/server/app/settings/messaging.segments/_index.segment.rsc +10 -10
  390. package/.next/server/app/settings/messaging.segments/_tree.segment.rsc +2 -2
  391. package/.next/server/app/settings/messaging.segments/settings/messaging/__PAGE__.segment.rsc +2 -2
  392. package/.next/server/app/settings/messaging.segments/settings/messaging.segment.rsc +3 -3
  393. package/.next/server/app/settings/messaging.segments/settings.segment.rsc +4 -4
  394. package/.next/server/app/settings/models/page.js.nft.json +1 -1
  395. package/.next/server/app/settings/models/page_client-reference-manifest.js +1 -1
  396. package/.next/server/app/settings/models.html +1 -1
  397. package/.next/server/app/settings/models.rsc +18 -18
  398. package/.next/server/app/settings/models.segments/_full.segment.rsc +18 -18
  399. package/.next/server/app/settings/models.segments/_head.segment.rsc +4 -4
  400. package/.next/server/app/settings/models.segments/_index.segment.rsc +10 -10
  401. package/.next/server/app/settings/models.segments/_tree.segment.rsc +2 -2
  402. package/.next/server/app/settings/models.segments/settings/models/__PAGE__.segment.rsc +4 -4
  403. package/.next/server/app/settings/models.segments/settings/models.segment.rsc +3 -3
  404. package/.next/server/app/settings/models.segments/settings.segment.rsc +4 -4
  405. package/.next/server/app/settings/page.js.nft.json +1 -1
  406. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  407. package/.next/server/app/settings/processes/page.js.nft.json +1 -1
  408. package/.next/server/app/settings/processes/page_client-reference-manifest.js +1 -1
  409. package/.next/server/app/settings/processes.html +1 -1
  410. package/.next/server/app/settings/processes.rsc +16 -16
  411. package/.next/server/app/settings/processes.segments/_full.segment.rsc +16 -16
  412. package/.next/server/app/settings/processes.segments/_head.segment.rsc +4 -4
  413. package/.next/server/app/settings/processes.segments/_index.segment.rsc +10 -10
  414. package/.next/server/app/settings/processes.segments/_tree.segment.rsc +2 -2
  415. package/.next/server/app/settings/processes.segments/settings/processes/__PAGE__.segment.rsc +2 -2
  416. package/.next/server/app/settings/processes.segments/settings/processes.segment.rsc +3 -3
  417. package/.next/server/app/settings/processes.segments/settings.segment.rsc +4 -4
  418. package/.next/server/app/settings/routines/page.js.nft.json +1 -1
  419. package/.next/server/app/settings/routines/page_client-reference-manifest.js +1 -1
  420. package/.next/server/app/settings/routines.html +1 -1
  421. package/.next/server/app/settings/routines.rsc +18 -18
  422. package/.next/server/app/settings/routines.segments/_full.segment.rsc +18 -18
  423. package/.next/server/app/settings/routines.segments/_head.segment.rsc +4 -4
  424. package/.next/server/app/settings/routines.segments/_index.segment.rsc +10 -10
  425. package/.next/server/app/settings/routines.segments/_tree.segment.rsc +2 -2
  426. package/.next/server/app/settings/routines.segments/settings/routines/__PAGE__.segment.rsc +4 -4
  427. package/.next/server/app/settings/routines.segments/settings/routines.segment.rsc +3 -3
  428. package/.next/server/app/settings/routines.segments/settings.segment.rsc +4 -4
  429. package/.next/server/app/settings/schedule/page.js.nft.json +1 -1
  430. package/.next/server/app/settings/schedule/page_client-reference-manifest.js +1 -1
  431. package/.next/server/app/settings/schedule.html +1 -1
  432. package/.next/server/app/settings/schedule.rsc +18 -18
  433. package/.next/server/app/settings/schedule.segments/_full.segment.rsc +18 -18
  434. package/.next/server/app/settings/schedule.segments/_head.segment.rsc +4 -4
  435. package/.next/server/app/settings/schedule.segments/_index.segment.rsc +10 -10
  436. package/.next/server/app/settings/schedule.segments/_tree.segment.rsc +2 -2
  437. package/.next/server/app/settings/schedule.segments/settings/schedule/__PAGE__.segment.rsc +4 -4
  438. package/.next/server/app/settings/schedule.segments/settings/schedule.segment.rsc +3 -3
  439. package/.next/server/app/settings/schedule.segments/settings.segment.rsc +4 -4
  440. package/.next/server/app/settings/self-learning/page.js.nft.json +1 -1
  441. package/.next/server/app/settings/self-learning/page_client-reference-manifest.js +1 -1
  442. package/.next/server/app/settings/self-learning.html +1 -1
  443. package/.next/server/app/settings/self-learning.rsc +18 -18
  444. package/.next/server/app/settings/self-learning.segments/_full.segment.rsc +18 -18
  445. package/.next/server/app/settings/self-learning.segments/_head.segment.rsc +4 -4
  446. package/.next/server/app/settings/self-learning.segments/_index.segment.rsc +10 -10
  447. package/.next/server/app/settings/self-learning.segments/_tree.segment.rsc +2 -2
  448. package/.next/server/app/settings/self-learning.segments/settings/self-learning/__PAGE__.segment.rsc +4 -4
  449. package/.next/server/app/settings/self-learning.segments/settings/self-learning.segment.rsc +3 -3
  450. package/.next/server/app/settings/self-learning.segments/settings.segment.rsc +4 -4
  451. package/.next/server/app/settings/wiki/page.js.nft.json +1 -1
  452. package/.next/server/app/settings/wiki/page_client-reference-manifest.js +1 -1
  453. package/.next/server/app/settings/wiki/timeline/page.js.nft.json +1 -1
  454. package/.next/server/app/settings/wiki/timeline/page_client-reference-manifest.js +1 -1
  455. package/.next/server/app/settings/wiki/timeline.html +1 -1
  456. package/.next/server/app/settings/wiki/timeline.rsc +16 -16
  457. package/.next/server/app/settings/wiki/timeline.segments/_full.segment.rsc +16 -16
  458. package/.next/server/app/settings/wiki/timeline.segments/_head.segment.rsc +4 -4
  459. package/.next/server/app/settings/wiki/timeline.segments/_index.segment.rsc +10 -10
  460. package/.next/server/app/settings/wiki/timeline.segments/_tree.segment.rsc +2 -2
  461. package/.next/server/app/settings/wiki/timeline.segments/settings/wiki/timeline/__PAGE__.segment.rsc +2 -2
  462. package/.next/server/app/settings/wiki/timeline.segments/settings/wiki/timeline.segment.rsc +3 -3
  463. package/.next/server/app/settings/wiki/timeline.segments/settings/wiki.segment.rsc +3 -3
  464. package/.next/server/app/settings/wiki/timeline.segments/settings.segment.rsc +4 -4
  465. package/.next/server/app/settings/wiki.html +1 -1
  466. package/.next/server/app/settings/wiki.rsc +18 -18
  467. package/.next/server/app/settings/wiki.segments/_full.segment.rsc +18 -18
  468. package/.next/server/app/settings/wiki.segments/_head.segment.rsc +4 -4
  469. package/.next/server/app/settings/wiki.segments/_index.segment.rsc +10 -10
  470. package/.next/server/app/settings/wiki.segments/_tree.segment.rsc +2 -2
  471. package/.next/server/app/settings/wiki.segments/settings/wiki/__PAGE__.segment.rsc +4 -4
  472. package/.next/server/app/settings/wiki.segments/settings/wiki.segment.rsc +3 -3
  473. package/.next/server/app/settings/wiki.segments/settings.segment.rsc +4 -4
  474. package/.next/server/app/settings.html +1 -1
  475. package/.next/server/app/settings.rsc +18 -18
  476. package/.next/server/app/settings.segments/_full.segment.rsc +18 -18
  477. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  478. package/.next/server/app/settings.segments/_index.segment.rsc +10 -10
  479. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  480. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  481. package/.next/server/app/settings.segments/settings.segment.rsc +4 -4
  482. package/.next/server/app/setup/page.js.nft.json +1 -1
  483. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  484. package/.next/server/app/setup.html +1 -1
  485. package/.next/server/app/setup.rsc +17 -17
  486. package/.next/server/app/setup.segments/_full.segment.rsc +17 -17
  487. package/.next/server/app/setup.segments/_head.segment.rsc +4 -4
  488. package/.next/server/app/setup.segments/_index.segment.rsc +10 -10
  489. package/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
  490. package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +4 -4
  491. package/.next/server/app/setup.segments/setup.segment.rsc +3 -3
  492. package/.next/server/app/trip/page.js.nft.json +1 -1
  493. package/.next/server/app/trip/page_client-reference-manifest.js +1 -1
  494. package/.next/server/app/trip.html +1 -1
  495. package/.next/server/app/trip.rsc +17 -17
  496. package/.next/server/app/trip.segments/_full.segment.rsc +17 -17
  497. package/.next/server/app/trip.segments/_head.segment.rsc +4 -4
  498. package/.next/server/app/trip.segments/_index.segment.rsc +10 -10
  499. package/.next/server/app/trip.segments/_tree.segment.rsc +2 -2
  500. package/.next/server/app/trip.segments/trip/__PAGE__.segment.rsc +4 -4
  501. package/.next/server/app/trip.segments/trip.segment.rsc +3 -3
  502. package/.next/server/app/wiki/page.js.nft.json +1 -1
  503. package/.next/server/app/wiki/page_client-reference-manifest.js +1 -1
  504. package/.next/server/app/wiki/timeline/page.js.nft.json +1 -1
  505. package/.next/server/app/wiki/timeline/page_client-reference-manifest.js +1 -1
  506. package/.next/server/app/wiki/timeline.html +1 -1
  507. package/.next/server/app/wiki/timeline.rsc +17 -17
  508. package/.next/server/app/wiki/timeline.segments/_full.segment.rsc +17 -17
  509. package/.next/server/app/wiki/timeline.segments/_head.segment.rsc +4 -4
  510. package/.next/server/app/wiki/timeline.segments/_index.segment.rsc +10 -10
  511. package/.next/server/app/wiki/timeline.segments/_tree.segment.rsc +2 -2
  512. package/.next/server/app/wiki/timeline.segments/wiki/timeline/__PAGE__.segment.rsc +4 -4
  513. package/.next/server/app/wiki/timeline.segments/wiki/timeline.segment.rsc +3 -3
  514. package/.next/server/app/wiki/timeline.segments/wiki.segment.rsc +3 -3
  515. package/.next/server/app/wiki.html +1 -1
  516. package/.next/server/app/wiki.rsc +17 -17
  517. package/.next/server/app/wiki.segments/_full.segment.rsc +17 -17
  518. package/.next/server/app/wiki.segments/_head.segment.rsc +4 -4
  519. package/.next/server/app/wiki.segments/_index.segment.rsc +10 -10
  520. package/.next/server/app/wiki.segments/_tree.segment.rsc +2 -2
  521. package/.next/server/app/wiki.segments/wiki/__PAGE__.segment.rsc +4 -4
  522. package/.next/server/app/wiki.segments/wiki.segment.rsc +3 -3
  523. package/.next/server/app-paths-manifest.json +1 -0
  524. package/.next/server/chunks/0z~i_next_dist_esm_build_templates_app-route_0o_o_hp.js +1 -1
  525. package/.next/server/chunks/ssr/0juq_dashboard__next-internal_server_app_settings_lessons_page_actions_0_yqadq.js +3 -0
  526. package/.next/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0h7ji04.js +4 -0
  527. package/.next/server/chunks/ssr/[root-of-the-server]__03yuq_v._.js +7 -0
  528. package/.next/server/chunks/ssr/[root-of-the-server]__0kvyeu1._.js +3 -0
  529. package/.next/server/chunks/ssr/[root-of-the-server]__0znkqrs._.js +3 -0
  530. package/.next/server/chunks/ssr/{_0cvy_5o._.js → _00_--i0._.js} +2 -2
  531. package/.next/server/chunks/ssr/_00ej8j9._.js +3 -0
  532. package/.next/server/chunks/ssr/{_0n.cr_p._.js → _04jkn8c._.js} +2 -2
  533. package/.next/server/chunks/ssr/_09-o1vq._.js +3 -0
  534. package/.next/server/chunks/ssr/_0cccma-._.js +3 -0
  535. package/.next/server/chunks/ssr/{_0pigg8p._.js → _0evcd7w._.js} +2 -2
  536. package/.next/server/chunks/ssr/{_0klzava._.js → _0jrxrig._.js} +2 -2
  537. package/.next/server/chunks/ssr/_0nvpv18._.js +3 -0
  538. package/.next/server/chunks/ssr/{_0s4udmt._.js → _0o~hk.m._.js} +2 -2
  539. package/.next/server/chunks/ssr/_0pdbiu.._.js +9 -0
  540. package/.next/server/chunks/ssr/_0r25vcp._.js +3 -0
  541. package/.next/server/chunks/ssr/_0tf7hjz._.js +3 -0
  542. package/.next/server/chunks/ssr/_0xmdrbq._.js +3 -0
  543. package/.next/server/chunks/ssr/_0y-w3is._.js +3 -0
  544. package/.next/server/chunks/ssr/_0zz58.-._.js +1 -1
  545. package/.next/server/chunks/ssr/{_03qiunv._.js → _0~fi8o-._.js} +2 -2
  546. package/.next/server/chunks/ssr/_10s6iy.._.js +3 -0
  547. package/.next/server/chunks/ssr/{_03~tfh5._.js → _11pdc0s._.js} +2 -2
  548. package/.next/server/chunks/ssr/packages_dashboard_src_0uxs9-.._.js +1 -1
  549. package/.next/server/chunks/ssr/packages_dashboard_src_0z~3g5n._.js +3 -0
  550. package/.next/server/chunks/ssr/packages_shared_dist_index_0kuvow-.js +1 -1
  551. package/.next/server/middleware/middleware-manifest.json +1 -1
  552. package/.next/server/middleware-build-manifest.js +3 -3
  553. package/.next/server/middleware-manifest.json +1 -1
  554. package/.next/server/pages/404.html +1 -1
  555. package/.next/server/pages/500.html +1 -1
  556. package/.next/static/chunks/0-dw-4a8vg9m8.js +1 -0
  557. package/.next/static/chunks/0.za~0o8~5n1~.css +1 -0
  558. package/.next/static/chunks/0.~7m9beb0bmp.js +11 -0
  559. package/.next/static/chunks/{0ndazhatbfzo7.js → 02k085x_j4_bz.js} +1 -1
  560. package/.next/static/chunks/05xugzf8sfrxt.js +1 -0
  561. package/.next/static/chunks/073hnld9_qq5g.js +1 -0
  562. package/.next/static/chunks/{0ym9.va55pvtp.js → 0e3ds9mkx7.~v.js} +1 -1
  563. package/.next/static/chunks/{0m04i2v9cb~qe.js → 0fri59ogcsfbl.js} +1 -1
  564. package/.next/static/chunks/{0ytubabo8p3y0.js → 0j15hn~z~i56..js} +1 -1
  565. package/.next/static/chunks/{0z8eq-9fm5tni.js → 0mfem_s.3s4r-.js} +1 -1
  566. package/.next/static/chunks/{159r5abwjgz~a.js → 0t.xvj-t_vtrp.js} +1 -1
  567. package/.next/static/chunks/0vivqt8njmkpv.js +1 -0
  568. package/.next/static/chunks/{15pljj6~je.kw.js → 0v~gg~hn-8_k2.js} +1 -1
  569. package/.next/static/chunks/{0n6_wx41s~.c6.js → 0~7d6m~du_b.d.js} +1 -1
  570. package/.next/static/chunks/{17ncd9sikwfzz.js → 0~nct--xt2~bi.js} +1 -1
  571. package/.next/static/chunks/17b2~cmid8qeu.js +3 -0
  572. package/.next/static/chunks/{0105cq0xp5_hx.js → 17rcecfesskxn.js} +1 -1
  573. package/.next/types/routes.d.ts +2 -1
  574. package/.next/types/validator.ts +9 -0
  575. package/package.json +2 -2
  576. package/.next/server/chunks/ssr/[root-of-the-server]__0.tf.7i._.js +0 -7
  577. package/.next/server/chunks/ssr/[root-of-the-server]__0j8z8rh._.js +0 -3
  578. package/.next/server/chunks/ssr/_06pec-y._.js +0 -9
  579. package/.next/server/chunks/ssr/_07fm8yg._.js +0 -3
  580. package/.next/server/chunks/ssr/_0b--0p5._.js +0 -3
  581. package/.next/server/chunks/ssr/_0bz7.8y._.js +0 -3
  582. package/.next/server/chunks/ssr/_0erbggi._.js +0 -3
  583. package/.next/server/chunks/ssr/_0gp2p2l._.js +0 -3
  584. package/.next/server/chunks/ssr/_0jbimd_._.js +0 -3
  585. package/.next/server/chunks/ssr/_0nnu1fp._.js +0 -3
  586. package/.next/server/chunks/ssr/_0qu5la9._.js +0 -3
  587. package/.next/server/chunks/ssr/_0vn~fot._.js +0 -3
  588. package/.next/server/chunks/ssr/_0x._qd7._.js +0 -3
  589. package/.next/server/chunks/ssr/_0yh7rb_._.js +0 -3
  590. package/.next/static/chunks/01eo9jrlkjy03.js +0 -3
  591. package/.next/static/chunks/0_31fedlksujg.js +0 -1
  592. package/.next/static/chunks/0flms4gevti3_.js +0 -1
  593. package/.next/static/chunks/0mjh8s01-3c7z.css +0 -1
  594. package/.next/static/chunks/0obgpq3wenu4s.js +0 -11
  595. package/.next/static/chunks/0yh77irip2zjn.js +0 -1
  596. package/.next/static/chunks/1763zl5q3pn~0.js +0 -1
  597. /package/.next/static/{buq5uD5wcoRL2KUVTM1i7 → i_QR0WWkZFeICcOMbfuUs}/_buildManifest.js +0 -0
  598. /package/.next/static/{buq5uD5wcoRL2KUVTM1i7 → i_QR0WWkZFeICcOMbfuUs}/_clientMiddlewareManifest.js +0 -0
  599. /package/.next/static/{buq5uD5wcoRL2KUVTM1i7 → i_QR0WWkZFeICcOMbfuUs}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52387,e=>{"use strict";let t=(0,e.i(77379).default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],52387)},76176,e=>{"use strict";e.i(18446);var t=e.i(38082);let a={claude:"Claude Code",codex:"OpenAI Codex",gemini:"Gemini CLI",opencode:"OpenCode"},n=new Set(["opencode"]);function s(e){return n.has(e)}let i={gemini:{badgeLabel:"Vendor deprecation",shortSuffix:" (deprecated)",reason:"Google announced Gemini CLI will stop serving free, Pro, and Ultra requests on 2026-06-18 in favor of Antigravity CLI. Standard / Enterprise licenses keep access. Avoid binding new processes to Gemini if you rely on consumer-tier auth."}},r={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},l={claude:["#7C2D12","#B54B2D","#E15B40","#F97316","#FDBA74"],codex:["#86198F","#A21CAF","#D946EF","#E879F9","#F5D0FE"],gemini:["#1E3A8A","#1D4ED8","#1C69FF","#60A5FA","#93C5FD"],opencode:["#7C2D12","#C2410C","#FF7300","#F59E0B","#FCD34D"]},o=["#6b7280","#9ca3af","#4b5563","#374151"],c={claude:"orange",codex:"pink",gemini:"blue",opencode:"orange"},d={"routine.morning_routine":"Morning Routine","routine.evening_review":"Evening Review","routine.weekly_review":"Weekly Review","routine.monthly_review":"Monthly Review","routine.hourly_check":"Hourly Check","routine.roadmap_refresh":"Roadmap Refresh","message.dm":"Direct Messages","message.mention":"Mentions","dashboard.chat":"Dashboard Chat","agent.task":"Scheduled Tasks","calendar.change":"Calendar Events",gmail_classify:"Gmail Classification","github.pull_request.review_requested":"GitHub Review Requests","github.assigned":"GitHub Assignments","github.security_alert":"GitHub Security Alerts","github.workflow_run.failed":"GitHub CI Failures","wiki.ingest_url":"Wiki URL Ingest","wiki.compile":"Wiki Compile","wiki.ask":"Wiki Ask"};function u(e){let t;if(!e)return[];try{t=JSON.parse(e)}catch{return[]}if(!t||"object"!=typeof t)return[];let a=[];for(let[e,n]of Object.entries(t))n&&"object"==typeof n&&a.push({modelId:e,inputTokens:"number"==typeof n.inputTokens?n.inputTokens:0,outputTokens:"number"==typeof n.outputTokens?n.outputTokens:0,costUsd:"number"==typeof n.costUsd?n.costUsd:0});return a.sort((e,t)=>t.costUsd-e.costUsd)}function h(e){if(!e)return null;let t=e.toLowerCase();return/^[a-z0-9_.-]+\/[a-z0-9_.-]+/.test(t)?"opencode":t.includes("claude")||t.includes("sonnet")||t.includes("opus")||t.includes("haiku")?"claude":t.includes("gemini")?"gemini":t.includes("gpt")||t.includes("codex")||t.includes("o3")||t.includes("o4")?"codex":null}e.s(["BACKEND_BADGE_VARIANTS",0,c,"BACKEND_COLORS",0,{claude:"#E15B40",codex:"#D946EF",gemini:"#1C69FF",opencode:"#FF7300"},"BACKEND_LABELS",0,a,"BACKEND_PROVIDER_LABELS",0,{claude:"Claude (Anthropic)",codex:"ChatGPT (OpenAI)",gemini:"Gemini (Google)",opencode:"OpenCode (sst/opencode)"},"BACKEND_PROVIDER_SHORT",0,{claude:"Claude",codex:"ChatGPT",gemini:"Gemini",opencode:"OpenCode"},"BACKEND_WEB_SEARCH_DESCRIPTIONS",0,{claude:"Lets the agent call Anthropic's built-in WebSearch tool.",codex:"Lets the agent call OpenAI's web_search tool. Works in safe (sandbox) mode — the tool runs at OpenAI, not as a local shell command.",gemini:"Lets the agent call Gemini's google_web_search tool.",opencode:"Lets the agent call the configured OpenCode provider's web-search tool when the OpenCode runtime is enabled."},"CHART_CATEGORY_PALETTE",0,["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#ef4444","#22c55e"],"UI_PREVIEW_ONLY_BADGE_SUFFIX",0," (coming soon)","UI_PREVIEW_ONLY_REASON",0,"Coming soon — OpenCode is wired internally but not yet ready for selection in this release. The card stays visible so you can see what is on the roadmap.","assignModelColors",0,function(e){let t=new Map;for(let a of e){if(!a)continue;let e=h(a)??"other",n=t.get(e)??[];n.push(a),t.set(e,n)}let a={};for(let[e,n]of t){n.sort((e,t)=>e.localeCompare(t));let t="other"===e?o:l[e],s=n.length;n.forEach((e,n)=>{let i;i=s>=t.length?n%t.length:1===s?Math.floor(t.length/2):Math.floor((n+.5)*t.length/s),a[e]=t[i]})}return a},"detectBackendFromModel",0,h,"formatModelName",0,function(e){return e?e.replace(/^[a-z0-9_.-]+\//i,"").replace(/^claude-/,"Claude ").replace(/^gpt-/,"GPT-").replace(/^gemini-/,"Gemini ").replace(/-/g," ").replace(/\bpreview\b/gi,"(preview)").replace(/\bpro\b/gi,"Pro").replace(/\bflash\b/gi,"Flash").replace(/\blite\b/gi,"Lite").replace(/\bmini\b/gi,"Mini").replace(/\bcodex\b/gi,"Codex").replace(/\bopus\b/gi,"Opus").replace(/\bsonnet\b/gi,"Sonnet").replace(/\bhaiku\b/gi,"Haiku").replace(/\s+/g," ").trim():"Not set"},"formatShortModelName",0,function(e){if(!e)return"unknown";if("opus"===e)return"Opus";if("sonnet"===e)return"Sonnet";let t=e.replace(/^[a-z0-9_.-]+\//i,""),a=t.replace(/-\d{8,}$/,"").replace(/^claude-/,"").replace(/(\d+)-(\d+)(?![-\d])/g,"$1.$2").replace(/-/g," ");return t.startsWith("gpt-")&&(a=`GPT-${a.replace(/^gpt\s*/i,"")}`),t.startsWith("gemini-")&&(a=a.replace(/^gemini\s*/i,"Gemini ")),a.replace(/\bopus\b/gi,"Opus").replace(/\bsonnet\b/gi,"Sonnet").replace(/\bhaiku\b/gi,"Haiku").replace(/\bpro\b/gi,"Pro").replace(/\bflash\b/gi,"Flash").replace(/\blite\b/gi,"Lite").replace(/\bmini\b/gi,"Mini").replace(/\s+/g," ").trim()},"getBackendDeprecation",0,function(e){return i[e]??null},"getBackendLabel",0,function(e){return a[e]},"getBackendShortLabel",0,function(e){return r[e]},"getProcessGroup",0,function(e){return e.startsWith("wiki.")?"Wiki":e.startsWith("message.")||e.startsWith("dashboard.")?"Conversation":e.startsWith("routine.")?"Routines":e.startsWith("git.")||e.startsWith("github.")?"Git & GitHub":e.startsWith("calendar.")||"gmail_classify"===e?"Integrations":"Tasks"},"getProcessLabel",0,function(e){return d[e]??e},"isBackendSelectionDisabled",0,function(e){return!(0,t.isRuntimeAvailableBackendId)(e)||s(e)},"isUiPreviewOnlyBackend",0,s,"modelBadgeVariant",0,function(e){if(!e)return"gray";let t=h(e);return t?c[t]:"gray"},"parseModelUsage",0,u,"pickDisplayModel",0,function(e,t){let a=u(t);return a.length>0&&a[0]?a[0].modelId:e??null}])},99758,e=>{"use strict";let t=(0,e.i(77379).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],99758)},24756,e=>{"use strict";var t=e.i(14260),a=e.i(65268);e.s(["useBackends",0,function(e){return(0,t.useQuery)({queryKey:["backends"],queryFn:()=>a.api.get("/backends"),enabled:e?.enabled??!0,staleTime:6e4})}])},74490,e=>{"use strict";var t=e.i(54710),a=e.i(81471);let n=(0,e.i(94237).cva)("rounded-xl border p-5 shadow-[0_1px_3px_rgb(0_0_0/0.04)]",{variants:{tone:{default:"border-border bg-card",warning:"border-amber-200 bg-amber-50/50 dark:border-amber-900 dark:bg-amber-950/30",success:"border-emerald-200 bg-emerald-50/50 dark:border-emerald-900 dark:bg-emerald-950/30",error:"border-red-200 bg-red-50/50 dark:border-red-900 dark:bg-red-950/30"},interactive:{true:"transition-shadow duration-150 hover:shadow-[0_4px_6px_rgb(0_0_0/0.06)]",false:""}},defaultVariants:{tone:"default",interactive:!1}});e.s(["Card",0,function({className:e,tone:s,interactive:i,...r}){return(0,t.jsx)("div",{className:(0,a.cn)(n({tone:s,interactive:i}),e),...r})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("mb-3 flex items-center justify-between",e),...n})},"CardStatLabel",0,function({className:e,...n}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-sm font-medium text-muted-foreground",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold text-foreground",e),...n})},"CardValue",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("text-3xl font-bold text-foreground",e),...n})}])},90925,e=>{"use strict";let t=(0,e.i(77379).default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],90925)},21682,e=>{"use strict";let t=(0,e.i(77379).default)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],21682)},7663,e=>{"use strict";let t=(0,e.i(77379).default)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],7663)},59134,e=>{"use strict";let t=(0,e.i(77379).default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],59134)},70986,e=>{"use strict";var t=e.i(34416),a=e.i(91967),n=e.i(9413),s=e.i(36567),i=e.i(18731),r=e.i(22353),l=e.i(85565),o=e.i(90816),c=e.i(11207),d=e.i(54710),u="Collapsible",[h,m]=(0,n.createContextScope)(u),[p,x]=h(u),g=t.forwardRef((e,a)=>{let{__scopeCollapsible:n,open:i,defaultOpen:r,disabled:o,onOpenChange:h,...m}=e,[x,g]=(0,s.useControllableState)({prop:i,defaultProp:r??!1,onChange:h,caller:u});return(0,d.jsx)(p,{scope:n,disabled:o,contentId:(0,c.useId)(),open:x,onOpenToggle:t.useCallback(()=>g(e=>!e),[g]),children:(0,d.jsx)(l.Primitive.div,{"data-state":k(x),"data-disabled":o?"":void 0,...m,ref:a})})});g.displayName=u;var f="CollapsibleTrigger",b=t.forwardRef((e,t)=>{let{__scopeCollapsible:n,...s}=e,i=x(f,n);return(0,d.jsx)(l.Primitive.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":k(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:t,onClick:(0,a.composeEventHandlers)(e.onClick,i.onOpenToggle)})});b.displayName=f;var y="CollapsibleContent",v=t.forwardRef((e,t)=>{let{forceMount:a,...n}=e,s=x(y,e.__scopeCollapsible);return(0,d.jsx)(o.Presence,{present:a||s.open,children:({present:e})=>(0,d.jsx)(j,{...n,ref:t,present:e})})});v.displayName=y;var j=t.forwardRef((e,a)=>{let{__scopeCollapsible:n,present:s,children:o,...c}=e,u=x(y,n),[h,m]=t.useState(s),p=t.useRef(null),g=(0,r.useComposedRefs)(a,p),f=t.useRef(0),b=f.current,v=t.useRef(0),j=v.current,w=u.open||h,N=t.useRef(w),C=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.useLayoutEffect)(()=>{let e=p.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,N.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),m(s)}},[u.open,s]),(0,d.jsx)(l.Primitive.div,{"data-state":k(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...c,ref:g,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:w&&o})});function k(e){return e?"open":"closed"}e.s(["Collapsible",0,g,"CollapsibleContent",0,v,"CollapsibleTrigger",0,b],70986)},87040,e=>{"use strict";var t=e.i(14260),a=e.i(65268);e.s(["useProcessConfig",0,function(e){return(0,t.useQuery)({queryKey:["process-config"],queryFn:()=>a.api.get("/process-config"),enabled:e?.enabled??!0,staleTime:6e4})}])},85631,e=>{"use strict";var t=e.i(54710),a=e.i(81471);e.s(["ConnectionsSectionHeader",0,function({title:e,description:n,healthy:s,total:i,attention:r,actions:l}){let o=i>0&&s===i,c=i>0&&0===s;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[i>0&&(0,t.jsxs)("span",{className:(0,a.cn)("text-xs font-medium tabular-nums",o?"text-emerald-600 dark:text-emerald-400":c?"text-muted-foreground":"text-amber-600 dark:text-amber-400"),children:[s,"/",i," connected"]}),l]})]}),n&&(0,t.jsx)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:n}),r&&(0,t.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:r})]})}])},40974,e=>{"use strict";let t=(0,e.i(77379).default)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,t],40974)},75750,e=>{"use strict";let t=(0,e.i(77379).default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],75750)},67490,e=>{"use strict";var t=e.i(14260),a=e.i(57415),n=e.i(95486),s=e.i(65268);e.s(["useIntegrationProbeLive",0,function(){let e=(0,n.useQueryClient)();return(0,a.useMutation)({mutationFn:e=>{let{key:t}=e,a={};return"liveProbe"in e?(a.liveProbe=!0,e.backend&&(a.backend=e.backend)):(a.backend=e.backend,a.tools=e.tools),s.api.post(`/integrations/${t}/probe`,a)},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:["integration-probe",a.key]}),e.invalidateQueries({queryKey:["health"]})}})},"useIntegrations",0,function(){return(0,t.useQuery)({queryKey:["integrations"],queryFn:()=>s.api.get("/integrations"),staleTime:3e4})},"useNativeUnboundActions",0,function(e={}){let a=e.sinceHours??168;return(0,t.useQuery)({queryKey:["agent-actions","native_unbound",a],queryFn:async()=>{let e=new URLSearchParams({since:new Date(Date.now()-60*a*6e4).toISOString(),limit:"50"});e.append("kind","integration.native_unbound");let t=await s.api.get(`/agent/actions?${e.toString()}`),n=[];for(let e of t.actions)if(e.detail)try{let t=JSON.parse(e.detail);if("string"!=typeof t.key)continue;n.push({id:e.id,key:t.key,priorNativeBackend:t.priorNativeBackend??null,newMainBackend:t.newMainBackend??null,priorDeniedTools:t.priorDeniedTools??[],startedAt:e.startedAt})}catch{continue}return n},staleTime:6e4})},"usePatchIntegration",0,function(){let e=(0,n.useQueryClient)();return(0,a.useMutation)({mutationFn:({key:e,body:t})=>s.api.patch(`/integrations/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:["integrations"]}),e.invalidateQueries({queryKey:["health"]})}})},"useProxyModels",0,function(e){return(0,t.useQuery)({queryKey:["proxy-models",e??null],queryFn:()=>s.api.get(`/integrations/proxy-models/${e}`),enabled:null!=e,staleTime:6e4})},"useRecentProxyCalls",0,function(e,a={}){let{limit:n,enabled:i=!0}=a;return(0,t.useQuery)({queryKey:["recent-proxy-calls",e,n??null],queryFn:()=>{let t=void 0!==n?`?limit=${n}`:"";return s.api.get(`/integrations/${e}/recent-proxy-calls${t}`)},enabled:i&&null!==e,staleTime:1e4})}])},32220,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(95486),s=e.i(19660),i=e.i(72740),r=e.i(21682),l=e.i(7663),o=e.i(75750),c=e.i(74490),d=e.i(20014),u=e.i(48467),h=e.i(79634),m=e.i(10427),p=e.i(65268),x=e.i(24756),g=e.i(87040),f=e.i(76176);e.s(["ProcessModelCard",0,function({processKey:e,title:b="AI Model",description:y}){let v=(0,n.useQueryClient)(),{data:j}=(0,x.useBackends)(),{data:k}=(0,g.useProcessConfig)(),[w,N]=(0,a.useState)(!1),[C,A]=(0,a.useState)(null),[S,I]=(0,a.useState)(null),[E,M]=(0,a.useState)(!1),[T,F]=(0,a.useState)(null),R=k?.configs.find(t=>t.processKey===e),_=new Map((j?.backends??[]).map(e=>[e.id,e])),B=(j?.backends??[]).filter(e=>e.enabled);if(!j||!k||!R)return null;let D=_.get(R.mainBackend),O=D?.models.find(e=>e.modelId===R.mainModel)?.label??(0,f.formatModelName)(R.mainModel),P=C?_.get(C):null,L=P?.models??[];async function G(){if(C&&S){M(!0),F(null);try{await p.api.put(`/process-config/${e}`,{mainBackend:C,mainModel:S,fallbackBackend:R.fallbackBackend,fallbackModel:R.fallbackModel,maxTurns:R.maxTurns,maxBudgetUsd:R.maxBudgetUsd}),await v.invalidateQueries({queryKey:["process-config"]}),F({type:"success",message:"Saved"}),N(!1)}catch(t){let e=t instanceof p.ApiError?t.body:null;F({type:"error",message:"string"==typeof e?.error?e.error:t instanceof Error?t.message:"Save failed"})}finally{M(!1)}}}return(0,t.jsxs)(c.Card,{children:[(0,t.jsxs)(c.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Bot,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(c.CardTitle,{className:"text-base",children:b}),"user"===R.updatedBy&&(0,t.jsx)(u.Badge,{variant:"blue",className:"text-xs",children:"Custom"})]}),!w&&(0,t.jsxs)(d.Button,{variant:"ghost",size:"sm",onClick:function(){A(R.mainBackend),I(R.mainModel),F(null),N(!0)},className:"h-8",children:[(0,t.jsx)(r.Pencil,{className:"h-3.5 w-3.5"}),"Edit"]})]}),!w&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)(u.Badge,{variant:f.BACKEND_BADGE_VARIANTS[R.mainBackend],children:(0,f.getBackendLabel)(R.mainBackend)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:O}),(0,t.jsx)(u.Badge,{variant:"high"===R.defaultTier?"purple":"medium"===R.defaultTier?"blue":"default",className:"text-xs",children:R.defaultTier})]}),y&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y})]}),w&&(0,t.jsxs)("div",{className:"mt-1 space-y-3",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Backend"}),(0,t.jsxs)(m.Select,{value:C??"",onValueChange:e=>(function(e){var t,a;let n,s=_.get(e);if(!s)return;A(e);let i=(t=s.models,a=R.defaultTier,(n=t.filter(e=>e.tier===a)).length>0?n:t);I(i[0]?.modelId??s.models[0]?.modelId??"")})(e),children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsx)(m.SelectContent,{children:B.map(e=>{let a=(0,f.isUiPreviewOnlyBackend)(e.id);return(0,t.jsxs)(m.SelectItem,{value:e.id,disabled:a,children:[(0,f.getBackendLabel)(e.id),a?f.UI_PREVIEW_ONLY_BADGE_SUFFIX:""]},e.id)})})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Model"}),(0,t.jsxs)(m.Select,{value:S??"",onValueChange:e=>I(e),children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsx)(m.SelectContent,{children:L.map(e=>(0,t.jsx)(m.SelectItem,{value:e.modelId,children:e.label},e.modelId))})]})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",onClick:function(){N(!1),A(null),I(null)},disabled:E,children:[(0,t.jsx)(o.XCircle,{className:"h-3.5 w-3.5"}),"Cancel"]}),(0,t.jsxs)(d.Button,{size:"sm",onClick:()=>{G()},disabled:E||!S,children:[E?(0,t.jsx)(i.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(l.Save,{className:"h-3.5 w-3.5"}),"Save"]})]})]}),T&&(0,t.jsx)(h.Alert,{variant:"success"===T.type?"success":"error",className:"mt-3",children:T.message})]})}])},86567,6423,86704,29472,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(45958),s=e.i(52387),i=e.i(20014),r=e.i(90826),l=e.i(81187),o=e.i(89883),c=e.i(90925),d=e.i(65268),u=e.i(8652),h=e.i(48467),m=e.i(79634),p=e.i(81471),x=e.i(14260),g=e.i(95486);function f(e,t){return(0,x.useQuery)({queryKey:["mail-health",e],queryFn:()=>d.api.get(`/mail/${encodeURIComponent(e)}/health`),refetchInterval:1e4,enabled:t})}function b(){let e=(0,g.useQueryClient)();return()=>{e.invalidateQueries({queryKey:["mail-providers"]}),e.invalidateQueries({queryKey:["mail-accounts"]}),e.invalidateQueries({queryKey:["mail-health"]})}}async function y(e,t,a){let n=new Set(e);a?n.add(t):n.delete(t);let s=["gmail","outlook","yahoo","icloud"].filter(e=>n.has(e));return await d.api.patch("/mail/providers",{enabledKinds:s}),s}e.s(["toggleProviderEnabled",0,y,"useInvalidateMail",0,b,"useMailAccountHealth",0,f,"useMailAccounts",0,function(){return(0,x.useQuery)({queryKey:["mail-accounts"],queryFn:()=>d.api.get("/mail/accounts"),refetchInterval:1e4})},"useMailProviders",0,function(){return(0,x.useQuery)({queryKey:["mail-providers"],queryFn:()=>d.api.get("/mail/providers"),refetchInterval:3e4})}],6423);let v={healthy:{variant:"green",label:"Healthy"},requires_consent:{variant:"amber",label:"Re-authenticate"},degraded:{variant:"red",label:"Degraded"}};function j({account:e,highlight:n=!1,hideActive:s=!1,hideHealth:l=!1,onReauthenticate:u,isLastOfKind:p=!1,onAfterRemove:x}){let g=(0,a.useRef)(null),y=(0,r.useConfirm)(),N=b(),[C,A]=(0,a.useState)(!1),[S,I]=(0,a.useState)(null);(0,a.useEffect)(()=>{n&&g.current&&g.current.scrollIntoView({behavior:"smooth",block:"center"})},[n]);let E=f(e.id,!l).data??null,M="yahoo"===e.kind||"icloud"===e.kind,[T,F]=(0,a.useState)(!1),R=async()=>{I(null),A(!0);try{await d.api.patch(`/mail/accounts/${encodeURIComponent(e.id)}`,{active:!e.active}),N()}catch(e){I(e instanceof Error?e.message:"Failed to update")}finally{A(!1)}},_=async()=>{if(await y({title:`Remove ${e.email}?`,description:"Local credentials are revoked and the account is removed from this app. The mailbox itself is untouched at the provider."+(p?" This is the last account of its kind, so the provider will also be disabled — re-authenticate and toggle Enable to bring it back.":""),confirmLabel:"Remove",variant:"destructive"})){I(null),A(!0);try{await d.api.delete(`/mail/accounts/${encodeURIComponent(e.id)}`),x&&await x(),N()}catch(e){I(e instanceof Error?e.message:"Failed to remove")}finally{A(!1)}}},B=v[e.authStatus],D=l||!e.idleEnabled?null:E?.idleFallbackUntilUtc?{label:"polling (IDLE down)",variant:"amber"}:{label:"IDLE",variant:"green"};return(0,t.jsxs)("div",{ref:g,id:`account-${e.id}`,className:"rounded-md border p-3 transition-colors "+(n?"border-amber-400 ring-1 ring-amber-300/60":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(o.Mail,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.email}),e.label&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.label,")"]}),(0,t.jsx)(h.Badge,{variant:B.variant,children:B.label}),D&&(0,t.jsx)(h.Badge,{variant:D.variant,children:D.label})]}),!l&&(0,t.jsx)(w,{health:E})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)("label",{className:"flex items-center gap-1 text-xs cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.active,disabled:C,onChange:()=>void R(),className:"h-3.5 w-3.5 rounded border-border"}),"Active"]}),"requires_consent"===e.authStatus&&(M?(0,t.jsx)(i.Button,{size:"sm",variant:"outline",disabled:C,onClick:()=>F(e=>!e),className:"h-7 text-xs px-2",children:T?"Cancel":"Re-authenticate"}):u&&(0,t.jsx)(i.Button,{size:"sm",variant:"outline",disabled:C,onClick:()=>void u(),className:"h-7 text-xs px-2",children:"Re-authenticate"})),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void _(),disabled:C,className:"h-7 px-2",title:"Remove account",children:(0,t.jsx)(c.Trash2,{className:"h-3.5 w-3.5"})})]})]}),S&&(0,t.jsx)(m.Alert,{variant:"error",className:"mt-2",children:S}),M&&T&&(0,t.jsx)(k,{accountId:e.id,onSuccess:()=>{F(!1),N()}})]})}function k({accountId:e,onSuccess:n}){let[s,r]=(0,a.useState)(""),[l,o]=(0,a.useState)(!1),[c,h]=(0,a.useState)(null),p=async()=>{o(!0),h(null);try{await d.api.post(`/config/mail/app-password/${encodeURIComponent(e)}/refresh`,{appPassword:s.trim()}),r(""),n()}catch(e){h(e instanceof Error?e.message:"Failed to refresh")}finally{o(!1)}};return(0,t.jsxs)("div",{className:"mt-2 rounded-md border border-amber-200 bg-amber-50/50 p-3 dark:border-amber-900 dark:bg-amber-950/30 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-foreground",children:"Generate a new app password at the provider, paste it here, and the daemon will swap it in place — the polling cursor and account ID stay intact."}),(0,t.jsx)(u.Input,{type:"password",value:s,onChange:e=>r(e.target.value),placeholder:"paste new app password",className:"h-8 text-xs"}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void p(),disabled:l||0===s.trim().length,className:"h-7 text-xs px-3",children:l?"Verifying…":"Update password"})}),c&&(0,t.jsx)(m.Alert,{variant:"error",children:c})]})}function w({health:e}){if(!e)return(0,t.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:"Waiting for first poll…"});let a=e.lastPollAtUtc,n=null!=a&&Date.now()-(0,p.parseUtcDate)(a).getTime()>9e5;return(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:["last poll:"," ",a?(0,t.jsxs)("span",{title:(0,p.formatAbsoluteTime)(a),className:n?"text-amber-600 dark:text-amber-400":void 0,children:[(0,p.formatRelativeTime)(a),n?" · stale":""]}):(0,t.jsx)("span",{children:"never"})]}),e.consecutiveErrorCount>0&&(0,t.jsxs)("span",{className:"text-amber-600 dark:text-amber-400",children:[e.consecutiveErrorCount," consecutive errors"]}),e.lastError&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400 max-w-full truncate",title:e.lastError,children:[(0,t.jsx)(l.AlertTriangle,{className:"h-3 w-3 shrink-0"}),e.lastError]})]})}var N=e.i(74490),C=e.i(57628);let A={"not-connected":{variant:"gray",label:"Not connected"},"needs-setup":{variant:"gray",label:"Needs setup"},disabled:{variant:"amber",label:"Ready to enable"},enabled:{variant:"green",label:"Enabled"},attention:{variant:"red",label:"Needs attention"}};function S(e){return e.accounts.some(e=>"healthy"!==e.authStatus)?"attention":0===e.accounts.length?e.awaitingProviderSetup?"needs-setup":"not-connected":e.enabled?"enabled":"disabled"}function I(e){let a=A[e.status],n="attention"===e.status?"warning":"enabled"===e.status?"success":"default";return(0,t.jsxs)(N.Card,{tone:n,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(o.Mail,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground truncate",children:e.name})]}),(0,t.jsx)(h.Badge,{variant:a.variant,children:a.label})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.description}),(0,t.jsx)("div",{className:"mt-3 space-y-3",children:e.setupSection}),e.accountsSection&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.Separator,{className:"my-4"}),(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Authenticated accounts"}),(0,t.jsx)("div",{className:"space-y-2",children:e.accountsSection})]}),(0,t.jsx)(C.Separator,{className:"my-4"}),(0,t.jsx)(E,{toggle:e.enableToggle})]})}function E({toggle:e}){let[n,s]=(0,a.useState)(null),i=async t=>{s(null);try{await e.onChange(t)}catch(e){s(e instanceof Error?e.message:"Failed to update")}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm select-none "+(e.disabled||e.busy?"cursor-not-allowed opacity-60":"cursor-pointer"),title:e.disabled?e.disabledReason:void 0,children:[(0,t.jsx)("input",{type:"checkbox",checked:e.enabled,disabled:e.disabled||e.busy,onChange:e=>void i(e.target.checked),className:"h-4 w-4 rounded border-border"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Enable for the agent"}),e.busy&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"saving…"})]}),e.disabled&&e.disabledReason&&(0,t.jsx)("p",{className:"mt-1 ml-6 text-xs text-muted-foreground",children:e.disabledReason}),!e.disabled&&e.explainer&&(0,t.jsx)("p",{className:"mt-1 ml-6 text-xs text-muted-foreground",children:e.explainer}),n&&(0,t.jsx)(m.Alert,{variant:"error",className:"mt-2",children:n})]})}e.s(["GmailCard",0,function({accounts:e,enabledKinds:l,focusAccountId:o,hideExternalGoogleLink:c=!1}){let d=b(),u=(0,r.useConfirm)(),[h,m]=(0,a.useState)(!1),p=l.includes("gmail"),x=S({accounts:e,enabled:p}),g=async e=>{if(e||await u({title:"Disable Gmail for the agent?",description:"This stops the unified mail poller from observing Gmail — receipts, travel bookings, and Kindle highlights will not be classified until you re-enable Gmail. Tokens stay in the keychain and the integration resumes the moment you flip the switch back on.",confirmLabel:"Disable Gmail",variant:"destructive"})){m(!0);try{await y(l,"gmail",e),d()}finally{m(!1)}}};return(0,t.jsx)(I,{name:"Gmail / Google Workspace",description:(0,t.jsx)(t.Fragment,{children:"Authenticated through your existing Google connection (it is shared with Calendar). Manage Google OAuth on the Connections page."}),status:x,setupSection:0===e.length?(0,t.jsxs)("div",{className:"rounded-md border border-dashed border-border p-3 text-xs",children:[(0,t.jsx)("p",{className:"text-foreground font-medium mb-1",children:"No Gmail account connected yet."}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:c?"Switch the Mode above to Direct and complete the Google connection step on this page — the daemon detects your Gmail address from the OAuth response and registers it here.":"Authenticate Google in Connections — the daemon detects your Gmail address from the OAuth response and registers it here."}),!c&&(0,t.jsx)(n.default,{href:"/connections/calendar#google",children:(0,t.jsxs)(i.Button,{size:"sm",variant:"outline",className:"h-7 text-xs px-3",children:["Open Google connection",(0,t.jsx)(s.ExternalLink,{className:"ml-1 h-3 w-3"})]})})]}):c?null:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Re-authentication, scope changes, or revoking access live on the"," ",(0,t.jsx)(n.default,{href:"/connections/calendar#google",className:"underline underline-offset-2",children:"Google connection card"}),"."]}),accountsSection:e.length>0?e.map(a=>(0,t.jsx)(j,{account:a,highlight:o===a.id,hideActive:!0,hideHealth:!0,isLastOfKind:1===e.length,onAfterRemove:async()=>{1===e.length&&p&&await y(l,"gmail",!1)}},a.id)):void 0,enableToggle:{enabled:p,disabled:0===e.length,disabledReason:0===e.length?"Connect a Google account first.":void 0,busy:h,onChange:g,explainer:"When enabled, the legacy Gmail poller observes your inbox and the agent can read, draft, and send messages."}})}],86567),e.i(18446);var M=e.i(49445);function T({index:e,title:a,completed:n=!1,disabled:s=!1,children:i}){return(0,t.jsxs)("div",{className:"rounded-md border border-dashed p-3 "+(s?"border-border opacity-50":n?"border-emerald-300 dark:border-emerald-800":"border-border"),children:[(0,t.jsxs)("p",{className:"text-xs font-semibold text-foreground mb-2",children:["Step ",e,": ",a,n&&(0,t.jsx)("span",{className:"ml-2 text-emerald-600 dark:text-emerald-400",children:"✓"})]}),i]})}e.s(["OutlookCard",0,function({accounts:e,enabledKinds:n,focusAccountId:l}){let o=b(),c=(0,r.useConfirm)(),h=n.includes("outlook"),p=(0,x.useQuery)({queryKey:["outlook-client-config"],queryFn:()=>d.api.get("/config/mail/outlook/client-config"),staleTime:3e4}),g=p.data?.configured===!0,f=S({accounts:e,enabled:h,awaitingProviderSetup:!g}),[v,k]=(0,a.useState)(!1),[w,N]=(0,a.useState)(""),[C,A]=(0,a.useState)("common"),[E,F]=(0,a.useState)(""),[R,_]=(0,a.useState)(!1),[B,D]=(0,a.useState)(null),[O,P]=(0,a.useState)(null),[L,G]=(0,a.useState)(null),[q,K]=(0,a.useState)(!1),U=async e=>{K(!0);try{await y(n,"outlook",e),o()}finally{K(!1)}},W=async()=>{_(!0),D(null);try{await d.api.put("/config/mail/outlook/client-config",{clientId:w.trim(),tenant:C.trim()||"common"}),await p.refetch(),k(!1)}catch(e){D(e instanceof Error?e.message:"Failed to save client config")}finally{_(!1)}},z=async()=>{if(await c({title:"Reset Azure app registration?",description:"Existing Outlook accounts keep working until their tokens expire. You'll need to re-enter the client ID before adding new accounts.",confirmLabel:"Reset",variant:"destructive"})){_(!0),D(null);try{await d.api.delete("/config/mail/outlook/client-config"),await p.refetch()}catch(e){D(e instanceof Error?e.message:"Failed to reset")}finally{_(!1)}}},$=async()=>{if(await c({title:"Open Microsoft sign-in?",description:"The daemon will open your browser to sign in to Microsoft. macOS or Windows may show a one-time firewall prompt — accept it so the loopback callback can complete.",confirmLabel:"Continue"})){_(!0),D(null),P(null);try{await d.api.post("/mail/accounts",{kind:"outlook",label:E.trim()||void 0}),P("Outlook account authenticated. Toggle the switch below to start using it."),F(""),o()}catch(e){D(e instanceof Error?e.message:"OAuth failed")}finally{_(!1)}}},H=async()=>{_(!0),D(null),P(null),G(null);try{let e=await fetch("/api/mail/accounts/device-code",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"outlook",label:E.trim()||void 0})});if(!e.ok||!e.body)throw Error(`HTTP ${e.status}`);let t=e.body.getReader(),a=new TextDecoder,n="";for(;;){let{value:e,done:s}=await t.read();if(s)break;let i=(n+=a.decode(e,{stream:!0})).split("\n\n");for(let e of(n=i.pop()??"",i)){let t=e.split("\n"),a="",n="";for(let e of t)e.startsWith("event:")&&(a=e.slice(6).trim()),e.startsWith("data:")&&(n+=e.slice(5).trim());if(a){if("prompt"===a)G(JSON.parse(n));else if("completed"===a)P("Outlook account authenticated. Toggle the switch below to start using it."),G(null),F(""),o();else if("failed"===a){let e=JSON.parse(n);throw Error(e.message??"device-code failed")}}}}}catch(e){D(e instanceof Error?e.message:"Device-code OAuth failed"),G(null)}finally{_(!1)}},V=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T,{index:1,title:"Register an Azure app (one-time)",completed:g,children:[!g&&!v&&(0,t.jsxs)("div",{className:"space-y-3 text-xs",children:[(0,t.jsxs)("p",{className:"text-muted-foreground",children:["One-time setup: you'll tell Microsoft that the ",M.APP_NAME,"daemon on your computer is allowed to read and send mail on your behalf. Follow every sub-step — two of them are easy to miss and will make sign-in fail with ",(0,t.jsx)("code",{children:"server_error"})," later."]}),(0,t.jsxs)("ol",{className:"list-decimal list-outside pl-4 space-y-2 text-muted-foreground",children:[(0,t.jsxs)("li",{children:["Open the"," ",(0,t.jsxs)("a",{href:"https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",target:"_blank",rel:"noreferrer",className:"underline inline-flex items-center gap-0.5",children:["Azure portal — App registrations"," ",(0,t.jsx)(s.ExternalLink,{className:"h-3 w-3"})]}),". Sign in with the Microsoft account you want the agent to use."]}),(0,t.jsxs)("li",{children:["Click ",(0,t.jsx)("strong",{children:"+ New registration"})," at the top of the page."]}),(0,t.jsxs)("li",{children:["Fill in the form:",(0,t.jsxs)("ul",{className:"list-disc list-outside pl-4 mt-1 space-y-1",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Name"}),": anything, e.g. ",(0,t.jsx)("code",{children:M.APP_NAME}),"."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Supported account types"}),": pick"," ",(0,t.jsx)("em",{children:"Accounts in any organizational directory (Any Microsoft Entra ID tenant – Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"}),"."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Redirect URI"}),": in the left-hand dropdown choose ",(0,t.jsx)("code",{children:"Public client/native (mobile & desktop)"})," ",(0,t.jsx)("strong",{children:"— not"})," ",(0,t.jsx)("code",{children:"Web"}),". Then type"," ",(0,t.jsx)("code",{children:"http://127.0.0.1/callback"})," in the box on the right."]})]}),(0,t.jsxs)("p",{className:"mt-1 rounded-md border border-amber-400/60 bg-amber-400/10 px-2 py-1 text-amber-700 dark:text-amber-300",children:["⚠ Trap #1: if you leave ",(0,t.jsx)("code",{children:"Web"})," selected, Microsoft will later return ",(0,t.jsx)("code",{children:"Authorization failed: server_error"}),". Use the Public client/native option."]})]}),(0,t.jsxs)("li",{children:["Click ",(0,t.jsx)("strong",{children:"Register"})," at the bottom of the form."]}),(0,t.jsxs)("li",{children:["You'll land on the ",(0,t.jsx)("em",{children:"Overview"})," page. Copy the value labelled ",(0,t.jsx)("strong",{children:"Application (client) ID"}),"— you'll paste it into the form below in a moment."]}),(0,t.jsxs)("li",{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"Authentication"}),". Scroll to the very bottom, find ",(0,t.jsx)("em",{children:"Advanced settings"})," →"," ",(0,t.jsx)("strong",{children:"Allow public client flows"}),", flip the toggle to"," ",(0,t.jsx)("strong",{children:"Yes"}),", then click ",(0,t.jsx)("strong",{children:"Save"})," at the top of the page.",(0,t.jsxs)("p",{className:"mt-1 rounded-md border border-amber-400/60 bg-amber-400/10 px-2 py-1 text-amber-700 dark:text-amber-300",children:["⚠ Trap #2: this toggle is off by default. Without it sign-in also fails with ",(0,t.jsx)("code",{children:"server_error"}),"."]})]}),(0,t.jsxs)("li",{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"API permissions"})," →"," ",(0,t.jsx)("strong",{children:"+ Add a permission"})," →"," ",(0,t.jsx)("strong",{children:"Microsoft Graph"})," →"," ",(0,t.jsx)("strong",{children:"Delegated permissions"}),". Use the search box to find and tick each of:",(0,t.jsxs)("ul",{className:"list-disc list-outside pl-4 mt-1",children:[(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"offline_access"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"User.Read"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"Mail.ReadWrite"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"Mail.Send"})})]}),"Then click ",(0,t.jsx)("strong",{children:"Add permissions"})," at the bottom."]}),(0,t.jsxs)("li",{children:["(Work/school tenant only) If your org requires admin consent for these scopes, click ",(0,t.jsx)("strong",{children:"Grant admin consent"}),". Personal Microsoft accounts don't need this step."]}),(0,t.jsxs)("li",{children:["Come back here and click ",(0,t.jsx)("strong",{children:"I have a client ID"}),". Paste the Application (client) ID you copied in step 5; leave Tenant as ",(0,t.jsx)("code",{children:"common"})," unless your admin told you otherwise."]})]}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>k(!0),className:"h-7 text-xs px-3",children:"I have a client ID"})]}),v&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-client-id",children:"Application (client) ID"}),(0,t.jsx)(u.Input,{id:"outlook-client-id",value:w,onChange:e=>N(e.target.value),placeholder:"00000000-0000-0000-0000-000000000000",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-tenant",children:["Tenant (default ",(0,t.jsx)("code",{children:"common"}),")"]}),(0,t.jsx)(u.Input,{id:"outlook-tenant",value:C,onChange:e=>A(e.target.value),placeholder:"common / organizations / <tenant-guid>",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void W(),disabled:R||0===w.trim().length,className:"h-7 text-xs px-3",children:R?"Saving…":"Save"}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>k(!1),disabled:R,className:"h-7 text-xs px-3",children:"Cancel"})]})]}),g&&!v&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Application ID:"," ",(0,t.jsx)("code",{className:"font-mono",children:p.data?.clientId})," ","(tenant ",(0,t.jsx)("code",{children:p.data?.tenant}),")."," ",(0,t.jsx)("button",{type:"button",className:"underline",onClick:()=>void z(),disabled:R,children:"reset"})]})]}),(0,t.jsx)(T,{index:2,title:"Authenticate an Outlook account",disabled:!g,children:g?(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-label",children:"Label (optional)"}),(0,t.jsx)(u.Input,{id:"outlook-label",value:E,onChange:e=>F(e.target.value),placeholder:"work, personal, …",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void $(),disabled:R,className:"h-7 text-xs px-3",children:R?"Waiting for consent…":"Authenticate (browser)"}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void H(),disabled:R,className:"h-7 text-xs px-3",title:"Use if the daemon runs headless (SSH / WSL)",children:"Authenticate (device code)"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"The browser flow may trigger a one-time macOS / Windows firewall prompt — accept it so the loopback callback can complete."})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Save the client ID first."})}),L&&(0,t.jsx)(m.Alert,{variant:"warning",children:(0,t.jsxs)("div",{className:"text-xs",children:["Visit"," ",(0,t.jsx)("a",{href:L.verificationUri,target:"_blank",rel:"noreferrer",className:"underline",children:L.verificationUri})," ","and enter code"," ",(0,t.jsx)("code",{className:"font-mono",children:L.userCode}),". Expires in ",Math.round(L.expiresIn/60)," min."]})}),O&&(0,t.jsx)(m.Alert,{variant:"success",children:O}),B&&(0,t.jsx)(m.Alert,{variant:"error",children:B})]});return(0,t.jsx)(I,{name:"Outlook / Microsoft 365",description:(0,t.jsx)(t.Fragment,{children:"One-time Azure app registration, then connect as many Outlook / outlook.com / Microsoft 365 accounts as you need."}),status:f,setupSection:V,accountsSection:e.length>0?e.map(a=>(0,t.jsx)(j,{account:a,highlight:l===a.id,onReauthenticate:()=>void $(),isLastOfKind:1===e.length,onAfterRemove:async()=>{1===e.length&&h&&await y(n,"outlook",!1)}},a.id)):void 0,enableToggle:{enabled:h,disabled:0===e.length,disabledReason:0===e.length?"Authenticate an Outlook account first.":void 0,busy:q,onChange:U,explainer:"When enabled, the agent observes your Outlook inbox via Microsoft Graph and can read, draft, and send messages."}})}],86704);let F={yahoo:{name:"Yahoo Mail",description:"App-password login over IMAP/SMTP. Generate the password in Yahoo Account Security, paste it once, and the daemon stores it in the OS keychain.",setupUrl:"https://login.yahoo.com/account/security",setupLabel:"Yahoo Account Security",passwordLabel:"Yahoo app password",defaultDomain:"yahoo.com",prerequisite:"Yahoo requires two-step verification on the account before it lets you create app passwords. If you haven't enabled it yet, turn it on first from the same Account Security page.",passwordSteps:[(0,t.jsxs)(t.Fragment,{children:["Open the"," ",(0,t.jsx)("strong",{children:"Yahoo Account Security"})," page and sign in with the Yahoo account you want to connect."]}),(0,t.jsxs)(t.Fragment,{children:["Scroll to ",(0,t.jsx)("strong",{children:"Other ways to sign in"})," and click"," ",(0,t.jsx)("strong",{children:"Generate and manage app passwords"}),". (If the link is missing, enable two-step verification first.)"]}),(0,t.jsxs)(t.Fragment,{children:["In the ",(0,t.jsx)("em",{children:"App name"})," field type ",(0,t.jsx)("code",{children:M.APP_NAME})," (any name works; this is just a label Yahoo shows in your account), then click ",(0,t.jsx)("strong",{children:"Generate password"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Yahoo shows a 16-character password with spaces. Copy it exactly as shown — ",(0,t.jsx)("strong",{children:"do not type it by hand"}),". Spaces are part of the password."]}),(0,t.jsx)(t.Fragment,{children:"Paste it into the password field below, then click Authenticate."})],passwordHint:"16 characters from Yahoo, spaces included. Do not retype — paste."},icloud:{name:"iCloud Mail",description:"App-specific-password login over IMAP/SMTP. Create the password in Apple Account → Sign-In and Security, paste it once, and the daemon stores it in the OS keychain.",setupUrl:"https://account.apple.com",setupLabel:"Apple Account",passwordLabel:"Apple app-specific password",defaultDomain:"icloud.com",prerequisite:"Apple only allows app-specific passwords on Apple IDs that have two-factor authentication turned on. If your Apple ID doesn't have 2FA yet, enable it first at appleid.apple.com.",passwordSteps:[(0,t.jsxs)(t.Fragment,{children:["Open ",(0,t.jsx)("strong",{children:"Apple Account"})," and sign in with the Apple ID whose iCloud mailbox you want to connect."]}),(0,t.jsxs)(t.Fragment,{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"Sign-In and Security"}),", then click ",(0,t.jsx)("strong",{children:"App-Specific Passwords"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Click ",(0,t.jsx)("strong",{children:"+ Generate an app-specific password"}),". Apple may ask you to re-enter your Apple ID password."]}),(0,t.jsxs)(t.Fragment,{children:["In the label field type ",(0,t.jsx)("code",{children:M.APP_NAME})," (any name works), then click ",(0,t.jsx)("strong",{children:"Create"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Apple shows a 19-character password in the form"," ",(0,t.jsx)("code",{children:"xxxx-xxxx-xxxx-xxxx"}),". Copy it exactly —"," ",(0,t.jsx)("strong",{children:"the dashes are required"}),"."]}),(0,t.jsx)(t.Fragment,{children:"Paste it into the password field below, then click Authenticate."})],passwordHint:"Format: xxxx-xxxx-xxxx-xxxx. Dashes are required — paste, don't retype."}};e.s(["ImapCard",0,function({kind:e,accounts:n,enabledKinds:r,focusAccountId:l}){let o=b(),c=F[e],h=r.includes(e),p=S({accounts:n,enabled:h}),[x,g]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[k,w]=(0,a.useState)(""),[N,C]=(0,a.useState)(!1),[A,E]=(0,a.useState)(null),[M,T]=(0,a.useState)(null),[R,_]=(0,a.useState)(!1),B=async t=>{_(!0);try{await y(r,e,t),o()}finally{_(!1)}},D=async()=>{C(!0),E(null),T(null);try{await d.api.post("/config/mail/app-password",{kind:e,email:`${x.trim()}@${c.defaultDomain}`,appPassword:f.trim(),label:k.trim()||void 0}),T(`${c.name} authenticated. Toggle the switch below to start using it.`),g(""),v(""),w(""),o()}catch(e){E(e instanceof Error?e.message:"Failed to connect")}finally{C(!1)}},O=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"rounded-md border border-dashed border-border p-3 text-xs space-y-2",children:[(0,t.jsx)("p",{className:"text-foreground font-medium",children:"Step 1: Generate an app password"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:[c.prerequisite," ",(0,t.jsxs)("a",{href:c.setupUrl,target:"_blank",rel:"noreferrer",className:"underline inline-flex items-center gap-0.5",children:["Open ",c.setupLabel," ",(0,t.jsx)(s.ExternalLink,{className:"h-3 w-3"})]}),"."]}),(0,t.jsx)("ol",{className:"list-decimal list-outside pl-4 space-y-1 text-muted-foreground",children:c.passwordSteps.map((e,a)=>(0,t.jsx)("li",{children:e},a))})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:"Step 2: Authenticate the account"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-email`,children:"Account email"}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(u.Input,{id:`${e}-email`,value:x,onChange:e=>g(e.target.value),placeholder:"username",className:"h-8 text-xs rounded-r-none"}),(0,t.jsxs)("span",{className:"inline-flex h-8 items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-xs text-muted-foreground select-none",children:["@",c.defaultDomain]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-app-password`,children:c.passwordLabel}),(0,t.jsx)(u.Input,{id:`${e}-app-password`,type:"password",value:f,onChange:e=>v(e.target.value),placeholder:"paste generated password",className:"h-8 text-xs"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:c.passwordHint})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-label`,children:"Label (optional)"}),(0,t.jsx)(u.Input,{id:`${e}-label`,value:k,onChange:e=>w(e.target.value),placeholder:"personal, family, …",className:"h-8 text-xs"})]}),(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void D(),disabled:N||0===x.trim().length||0===f.trim().length,className:"h-7 text-xs px-3",children:N?"Authenticating…":"Authenticate"})]}),M&&(0,t.jsx)(m.Alert,{variant:"success",children:M}),A&&(0,t.jsx)(m.Alert,{variant:"error",children:A})]});return(0,t.jsx)(I,{name:c.name,description:c.description,status:p,setupSection:O,accountsSection:n.length>0?n.map(a=>(0,t.jsx)(j,{account:a,highlight:l===a.id,isLastOfKind:1===n.length,onAfterRemove:async()=>{1===n.length&&h&&await y(r,e,!1)}},a.id)):void 0,enableToggle:{enabled:h,disabled:0===n.length,disabledReason:0===n.length?`Authenticate a ${c.name} account first.`:void 0,busy:R,onChange:B,explainer:`When enabled, the agent observes your ${c.name} inbox via IMAP IDLE and can read, draft, and send messages.`}})}],29472)},91653,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(79634),s=e.i(86567),i=e.i(86704),r=e.i(29472),l=e.i(6423),o=e.i(85631),c=e.i(32077),d=e.i(32220);e.s(["default",0,function(){let e=(0,l.useMailAccounts)(),u=(0,l.useMailProviders)(),h=function(){let[e,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=()=>{let e=window.location.hash.replace(/^#/,"");t(e.length>0?e:null)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e}(),m=e.data?.accounts??[],p=u.data?.enabledKinds??[],x=function(e){let t={gmail:[],outlook:[],yahoo:[],icloud:[]};for(let a of e)t[a.kind].push(a);return t}(m),g=e.isLoading||u.isLoading,f=e.error??u.error,b=m.filter(e=>e.active&&p.includes(e.kind)).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ConnectionsSectionHeader,{title:"Mail",description:"Connect each mail provider in two steps: authenticate, then flip the provider's enable switch. Once enabled, the per-account Active toggle lets you mute a single mailbox without disabling the whole provider.",healthy:b,total:m.length}),f&&(0,t.jsxs)(n.Alert,{variant:"error",children:["Couldn't load mail data:"," ",f instanceof Error?f.message:"unknown error"]}),g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(c.IntegrationCard,{integrationKey:"gmail",gmailAccountCount:x.gmail.length}),(0,t.jsx)(d.ProcessModelCard,{processKey:"gmail_classify",title:"Gmail Classification Model",description:"Classifies each incoming Gmail message and decides how the agent should respond. Light-tier (Haiku 4.5 / gpt-5.4-mini) handles this well at low cost."}),(0,t.jsx)(s.GmailCard,{accounts:x.gmail,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(c.IntegrationCard,{integrationKey:"outlook_mail"}),(0,t.jsx)(i.OutlookCard,{accounts:x.outlook,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(r.ImapCard,{kind:"yahoo",accounts:x.yahoo,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(r.ImapCard,{kind:"icloud",accounts:x.icloud,enabledKinds:p,focusAccountId:h})]})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52387,e=>{"use strict";let t=(0,e.i(77379).default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],52387)},70986,e=>{"use strict";var t=e.i(34416),a=e.i(91967),n=e.i(9413),s=e.i(36567),i=e.i(18731),r=e.i(22353),l=e.i(85565),o=e.i(90816),c=e.i(11207),d=e.i(54710),u="Collapsible",[h,m]=(0,n.createContextScope)(u),[p,x]=h(u),g=t.forwardRef((e,a)=>{let{__scopeCollapsible:n,open:i,defaultOpen:r,disabled:o,onOpenChange:h,...m}=e,[x,g]=(0,s.useControllableState)({prop:i,defaultProp:r??!1,onChange:h,caller:u});return(0,d.jsx)(p,{scope:n,disabled:o,contentId:(0,c.useId)(),open:x,onOpenToggle:t.useCallback(()=>g(e=>!e),[g]),children:(0,d.jsx)(l.Primitive.div,{"data-state":k(x),"data-disabled":o?"":void 0,...m,ref:a})})});g.displayName=u;var f="CollapsibleTrigger",b=t.forwardRef((e,t)=>{let{__scopeCollapsible:n,...s}=e,i=x(f,n);return(0,d.jsx)(l.Primitive.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":k(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:t,onClick:(0,a.composeEventHandlers)(e.onClick,i.onOpenToggle)})});b.displayName=f;var y="CollapsibleContent",v=t.forwardRef((e,t)=>{let{forceMount:a,...n}=e,s=x(y,e.__scopeCollapsible);return(0,d.jsx)(o.Presence,{present:a||s.open,children:({present:e})=>(0,d.jsx)(j,{...n,ref:t,present:e})})});v.displayName=y;var j=t.forwardRef((e,a)=>{let{__scopeCollapsible:n,present:s,children:o,...c}=e,u=x(y,n),[h,m]=t.useState(s),p=t.useRef(null),g=(0,r.useComposedRefs)(a,p),f=t.useRef(0),b=f.current,v=t.useRef(0),j=v.current,w=u.open||h,N=t.useRef(w),C=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.useLayoutEffect)(()=>{let e=p.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,N.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),m(s)}},[u.open,s]),(0,d.jsx)(l.Primitive.div,{"data-state":k(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...c,ref:g,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:w&&o})});function k(e){return e?"open":"closed"}e.s(["Collapsible",0,g,"CollapsibleContent",0,v,"CollapsibleTrigger",0,b],70986)},76176,e=>{"use strict";e.i(18446);var t=e.i(38082);let a={claude:"Claude Code",codex:"OpenAI Codex",gemini:"Gemini CLI",opencode:"OpenCode"},n=new Set(["opencode"]);function s(e){return n.has(e)}let i={gemini:{badgeLabel:"Vendor deprecation",shortSuffix:" (deprecated)",reason:"Google announced Gemini CLI will stop serving free, Pro, and Ultra requests on 2026-06-18 in favor of Antigravity CLI. Standard / Enterprise licenses keep access. Avoid binding new processes to Gemini if you rely on consumer-tier auth."}},r={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},l={claude:["#7C2D12","#B54B2D","#E15B40","#F97316","#FDBA74"],codex:["#86198F","#A21CAF","#D946EF","#E879F9","#F5D0FE"],gemini:["#1E3A8A","#1D4ED8","#1C69FF","#60A5FA","#93C5FD"],opencode:["#7C2D12","#C2410C","#FF7300","#F59E0B","#FCD34D"]},o=["#6b7280","#9ca3af","#4b5563","#374151"],c={claude:"orange",codex:"pink",gemini:"blue",opencode:"orange"},d={"routine.morning_routine":"Morning Routine","routine.evening_review":"Evening Review","routine.weekly_review":"Weekly Review","routine.monthly_review":"Monthly Review","routine.hourly_check":"Hourly Check","routine.roadmap_refresh":"Roadmap Refresh","message.dm":"Direct Messages","message.mention":"Mentions","dashboard.chat":"Dashboard Chat","agent.task":"Scheduled Tasks","calendar.change":"Calendar Events",gmail_classify:"Gmail Classification","github.pull_request.review_requested":"GitHub Review Requests","github.assigned":"GitHub Assignments","github.security_alert":"GitHub Security Alerts","github.workflow_run.failed":"GitHub CI Failures","wiki.ingest_url":"Wiki URL Ingest","wiki.compile":"Wiki Compile","wiki.ask":"Wiki Ask"};function u(e){let t;if(!e)return[];try{t=JSON.parse(e)}catch{return[]}if(!t||"object"!=typeof t)return[];let a=[];for(let[e,n]of Object.entries(t))n&&"object"==typeof n&&a.push({modelId:e,inputTokens:"number"==typeof n.inputTokens?n.inputTokens:0,outputTokens:"number"==typeof n.outputTokens?n.outputTokens:0,costUsd:"number"==typeof n.costUsd?n.costUsd:0});return a.sort((e,t)=>t.costUsd-e.costUsd)}function h(e){if(!e)return null;let t=e.toLowerCase();return/^[a-z0-9_.-]+\/[a-z0-9_.-]+/.test(t)?"opencode":t.includes("claude")||t.includes("sonnet")||t.includes("opus")||t.includes("haiku")?"claude":t.includes("gemini")?"gemini":t.includes("gpt")||t.includes("codex")||t.includes("o3")||t.includes("o4")?"codex":null}e.s(["BACKEND_BADGE_VARIANTS",0,c,"BACKEND_COLORS",0,{claude:"#E15B40",codex:"#D946EF",gemini:"#1C69FF",opencode:"#FF7300"},"BACKEND_LABELS",0,a,"BACKEND_PROVIDER_LABELS",0,{claude:"Claude (Anthropic)",codex:"ChatGPT (OpenAI)",gemini:"Gemini (Google)",opencode:"OpenCode (sst/opencode)"},"BACKEND_PROVIDER_SHORT",0,{claude:"Claude",codex:"ChatGPT",gemini:"Gemini",opencode:"OpenCode"},"BACKEND_WEB_SEARCH_DESCRIPTIONS",0,{claude:"Lets the agent call Anthropic's built-in WebSearch tool.",codex:"Lets the agent call OpenAI's web_search tool. Works in safe (sandbox) mode — the tool runs at OpenAI, not as a local shell command.",gemini:"Lets the agent call Gemini's google_web_search tool.",opencode:"Lets the agent call the configured OpenCode provider's web-search tool when the OpenCode runtime is enabled."},"CHART_CATEGORY_PALETTE",0,["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#ef4444","#22c55e"],"UI_PREVIEW_ONLY_BADGE_SUFFIX",0," (coming soon)","UI_PREVIEW_ONLY_REASON",0,"Coming soon — OpenCode is wired internally but not yet ready for selection in this release. The card stays visible so you can see what is on the roadmap.","assignModelColors",0,function(e){let t=new Map;for(let a of e){if(!a)continue;let e=h(a)??"other",n=t.get(e)??[];n.push(a),t.set(e,n)}let a={};for(let[e,n]of t){n.sort((e,t)=>e.localeCompare(t));let t="other"===e?o:l[e],s=n.length;n.forEach((e,n)=>{let i;i=s>=t.length?n%t.length:1===s?Math.floor(t.length/2):Math.floor((n+.5)*t.length/s),a[e]=t[i]})}return a},"detectBackendFromModel",0,h,"formatModelName",0,function(e){return e?e.replace(/^[a-z0-9_.-]+\//i,"").replace(/^claude-/,"Claude ").replace(/^gpt-/,"GPT-").replace(/^gemini-/,"Gemini ").replace(/-/g," ").replace(/\bpreview\b/gi,"(preview)").replace(/\bpro\b/gi,"Pro").replace(/\bflash\b/gi,"Flash").replace(/\blite\b/gi,"Lite").replace(/\bmini\b/gi,"Mini").replace(/\bcodex\b/gi,"Codex").replace(/\bopus\b/gi,"Opus").replace(/\bsonnet\b/gi,"Sonnet").replace(/\bhaiku\b/gi,"Haiku").replace(/\s+/g," ").trim():"Not set"},"formatShortModelName",0,function(e){if(!e)return"unknown";if("opus"===e)return"Opus";if("sonnet"===e)return"Sonnet";let t=e.replace(/^[a-z0-9_.-]+\//i,""),a=t.replace(/-\d{8,}$/,"").replace(/^claude-/,"").replace(/(\d+)-(\d+)(?![-\d])/g,"$1.$2").replace(/-/g," ");return t.startsWith("gpt-")&&(a=`GPT-${a.replace(/^gpt\s*/i,"")}`),t.startsWith("gemini-")&&(a=a.replace(/^gemini\s*/i,"Gemini ")),a.replace(/\bopus\b/gi,"Opus").replace(/\bsonnet\b/gi,"Sonnet").replace(/\bhaiku\b/gi,"Haiku").replace(/\bpro\b/gi,"Pro").replace(/\bflash\b/gi,"Flash").replace(/\blite\b/gi,"Lite").replace(/\bmini\b/gi,"Mini").replace(/\s+/g," ").trim()},"getBackendDeprecation",0,function(e){return i[e]??null},"getBackendLabel",0,function(e){return a[e]},"getBackendShortLabel",0,function(e){return r[e]},"getProcessGroup",0,function(e){return e.startsWith("wiki.")?"Wiki":e.startsWith("message.")||e.startsWith("dashboard.")?"Conversation":e.startsWith("routine.")?"Routines":e.startsWith("git.")||e.startsWith("github.")?"Git & GitHub":e.startsWith("calendar.")||"gmail_classify"===e?"Integrations":"Tasks"},"getProcessLabel",0,function(e){return d[e]??e},"isBackendSelectionDisabled",0,function(e){return!(0,t.isRuntimeAvailableBackendId)(e)||s(e)},"isUiPreviewOnlyBackend",0,s,"modelBadgeVariant",0,function(e){if(!e)return"gray";let t=h(e);return t?c[t]:"gray"},"parseModelUsage",0,u,"pickDisplayModel",0,function(e,t){let a=u(t);return a.length>0&&a[0]?a[0].modelId:e??null}])},59134,e=>{"use strict";let t=(0,e.i(77379).default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],59134)},99758,e=>{"use strict";let t=(0,e.i(77379).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],99758)},74490,e=>{"use strict";var t=e.i(54710),a=e.i(81471);let n=(0,e.i(94237).cva)("rounded-xl border p-5 shadow-[0_1px_3px_rgb(0_0_0/0.04)]",{variants:{tone:{default:"border-border bg-card",warning:"border-amber-200 bg-amber-50/50 dark:border-amber-900 dark:bg-amber-950/30",success:"border-emerald-200 bg-emerald-50/50 dark:border-emerald-900 dark:bg-emerald-950/30",error:"border-red-200 bg-red-50/50 dark:border-red-900 dark:bg-red-950/30"},interactive:{true:"transition-shadow duration-150 hover:shadow-[0_4px_6px_rgb(0_0_0/0.06)]",false:""}},defaultVariants:{tone:"default",interactive:!1}});e.s(["Card",0,function({className:e,tone:s,interactive:i,...r}){return(0,t.jsx)("div",{className:(0,a.cn)(n({tone:s,interactive:i}),e),...r})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("mb-3 flex items-center justify-between",e),...n})},"CardStatLabel",0,function({className:e,...n}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-sm font-medium text-muted-foreground",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold text-foreground",e),...n})},"CardValue",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("text-3xl font-bold text-foreground",e),...n})}])},90925,e=>{"use strict";let t=(0,e.i(77379).default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],90925)},21682,e=>{"use strict";let t=(0,e.i(77379).default)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],21682)},7663,e=>{"use strict";let t=(0,e.i(77379).default)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,t],7663)},24756,e=>{"use strict";var t=e.i(14260),a=e.i(65268);e.s(["useBackends",0,function(e){return(0,t.useQuery)({queryKey:["backends"],queryFn:()=>a.api.get("/backends"),enabled:e?.enabled??!0,staleTime:6e4})}])},87040,e=>{"use strict";var t=e.i(14260),a=e.i(65268);e.s(["useProcessConfig",0,function(e){return(0,t.useQuery)({queryKey:["process-config"],queryFn:()=>a.api.get("/process-config"),enabled:e?.enabled??!0,staleTime:6e4})}])},85631,e=>{"use strict";var t=e.i(54710),a=e.i(81471);e.s(["ConnectionsSectionHeader",0,function({title:e,description:n,healthy:s,total:i,attention:r,actions:l}){let o=i>0&&s===i,c=i>0&&0===s;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[i>0&&(0,t.jsxs)("span",{className:(0,a.cn)("text-xs font-medium tabular-nums",o?"text-emerald-600 dark:text-emerald-400":c?"text-muted-foreground":"text-amber-600 dark:text-amber-400"),children:[s,"/",i," connected"]}),l]})]}),n&&(0,t.jsx)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:n}),r&&(0,t.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:r})]})}])},40974,e=>{"use strict";let t=(0,e.i(77379).default)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,t],40974)},75750,e=>{"use strict";let t=(0,e.i(77379).default)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],75750)},67490,e=>{"use strict";var t=e.i(14260),a=e.i(57415),n=e.i(95486),s=e.i(65268);e.s(["useIntegrationProbeLive",0,function(){let e=(0,n.useQueryClient)();return(0,a.useMutation)({mutationFn:e=>{let{key:t}=e,a={};return"liveProbe"in e?(a.liveProbe=!0,e.backend&&(a.backend=e.backend)):(a.backend=e.backend,a.tools=e.tools),s.api.post(`/integrations/${t}/probe`,a)},onSuccess:(t,a)=>{e.invalidateQueries({queryKey:["integration-probe",a.key]}),e.invalidateQueries({queryKey:["health"]})}})},"useIntegrations",0,function(){return(0,t.useQuery)({queryKey:["integrations"],queryFn:()=>s.api.get("/integrations"),staleTime:3e4})},"useNativeUnboundActions",0,function(e={}){let a=e.sinceHours??168;return(0,t.useQuery)({queryKey:["agent-actions","native_unbound",a],queryFn:async()=>{let e=new URLSearchParams({since:new Date(Date.now()-60*a*6e4).toISOString(),limit:"50"});e.append("kind","integration.native_unbound");let t=await s.api.get(`/agent/actions?${e.toString()}`),n=[];for(let e of t.actions)if(e.detail)try{let t=JSON.parse(e.detail);if("string"!=typeof t.key)continue;n.push({id:e.id,key:t.key,priorNativeBackend:t.priorNativeBackend??null,newMainBackend:t.newMainBackend??null,priorDeniedTools:t.priorDeniedTools??[],startedAt:e.startedAt})}catch{continue}return n},staleTime:6e4})},"usePatchIntegration",0,function(){let e=(0,n.useQueryClient)();return(0,a.useMutation)({mutationFn:({key:e,body:t})=>s.api.patch(`/integrations/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:["integrations"]}),e.invalidateQueries({queryKey:["health"]})}})},"useProxyModels",0,function(e){return(0,t.useQuery)({queryKey:["proxy-models",e??null],queryFn:()=>s.api.get(`/integrations/proxy-models/${e}`),enabled:null!=e,staleTime:6e4})},"useRecentProxyCalls",0,function(e,a={}){let{limit:n,enabled:i=!0}=a;return(0,t.useQuery)({queryKey:["recent-proxy-calls",e,n??null],queryFn:()=>{let t=void 0!==n?`?limit=${n}`:"";return s.api.get(`/integrations/${e}/recent-proxy-calls${t}`)},enabled:i&&null!==e,staleTime:1e4})}])},32220,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(95486),s=e.i(19660),i=e.i(72740),r=e.i(21682),l=e.i(7663),o=e.i(75750),c=e.i(74490),d=e.i(20014),u=e.i(48467),h=e.i(79634),m=e.i(10427),p=e.i(65268),x=e.i(24756),g=e.i(87040),f=e.i(76176);e.s(["ProcessModelCard",0,function({processKey:e,title:b="AI Model",description:y}){let v=(0,n.useQueryClient)(),{data:j}=(0,x.useBackends)(),{data:k}=(0,g.useProcessConfig)(),[w,N]=(0,a.useState)(!1),[C,A]=(0,a.useState)(null),[S,I]=(0,a.useState)(null),[E,M]=(0,a.useState)(!1),[T,F]=(0,a.useState)(null),R=k?.configs.find(t=>t.processKey===e),_=new Map((j?.backends??[]).map(e=>[e.id,e])),B=(j?.backends??[]).filter(e=>e.enabled);if(!j||!k||!R)return null;let D=_.get(R.mainBackend),O=D?.models.find(e=>e.modelId===R.mainModel)?.label??(0,f.formatModelName)(R.mainModel),P=C?_.get(C):null,L=P?.models??[];async function G(){if(C&&S){M(!0),F(null);try{await p.api.put(`/process-config/${e}`,{mainBackend:C,mainModel:S,fallbackBackend:R.fallbackBackend,fallbackModel:R.fallbackModel,maxTurns:R.maxTurns,maxBudgetUsd:R.maxBudgetUsd}),await v.invalidateQueries({queryKey:["process-config"]}),F({type:"success",message:"Saved"}),N(!1)}catch(t){let e=t instanceof p.ApiError?t.body:null;F({type:"error",message:"string"==typeof e?.error?e.error:t instanceof Error?t.message:"Save failed"})}finally{M(!1)}}}return(0,t.jsxs)(c.Card,{children:[(0,t.jsxs)(c.CardHeader,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Bot,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(c.CardTitle,{className:"text-base",children:b}),"user"===R.updatedBy&&(0,t.jsx)(u.Badge,{variant:"blue",className:"text-xs",children:"Custom"})]}),!w&&(0,t.jsxs)(d.Button,{variant:"ghost",size:"sm",onClick:function(){A(R.mainBackend),I(R.mainModel),F(null),N(!0)},className:"h-8",children:[(0,t.jsx)(r.Pencil,{className:"h-3.5 w-3.5"}),"Edit"]})]}),!w&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)(u.Badge,{variant:f.BACKEND_BADGE_VARIANTS[R.mainBackend],children:(0,f.getBackendLabel)(R.mainBackend)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:O}),(0,t.jsx)(u.Badge,{variant:"high"===R.defaultTier?"purple":"medium"===R.defaultTier?"blue":"default",className:"text-xs",children:R.defaultTier})]}),y&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y})]}),w&&(0,t.jsxs)("div",{className:"mt-1 space-y-3",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Backend"}),(0,t.jsxs)(m.Select,{value:C??"",onValueChange:e=>(function(e){var t,a;let n,s=_.get(e);if(!s)return;A(e);let i=(t=s.models,a=R.defaultTier,(n=t.filter(e=>e.tier===a)).length>0?n:t);I(i[0]?.modelId??s.models[0]?.modelId??"")})(e),children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsx)(m.SelectContent,{children:B.map(e=>{let a=(0,f.isUiPreviewOnlyBackend)(e.id);return(0,t.jsxs)(m.SelectItem,{value:e.id,disabled:a,children:[(0,f.getBackendLabel)(e.id),a?f.UI_PREVIEW_ONLY_BADGE_SUFFIX:""]},e.id)})})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Model"}),(0,t.jsxs)(m.Select,{value:S??"",onValueChange:e=>I(e),children:[(0,t.jsx)(m.SelectTrigger,{children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsx)(m.SelectContent,{children:L.map(e=>(0,t.jsx)(m.SelectItem,{value:e.modelId,children:e.label},e.modelId))})]})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsxs)(d.Button,{variant:"outline",size:"sm",onClick:function(){N(!1),A(null),I(null)},disabled:E,children:[(0,t.jsx)(o.XCircle,{className:"h-3.5 w-3.5"}),"Cancel"]}),(0,t.jsxs)(d.Button,{size:"sm",onClick:()=>{G()},disabled:E||!S,children:[E?(0,t.jsx)(i.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(l.Save,{className:"h-3.5 w-3.5"}),"Save"]})]})]}),T&&(0,t.jsx)(h.Alert,{variant:"success"===T.type?"success":"error",className:"mt-3",children:T.message})]})}])},86567,6423,86704,29472,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(45958),s=e.i(52387),i=e.i(20014),r=e.i(90826),l=e.i(81187),o=e.i(89883),c=e.i(90925),d=e.i(65268),u=e.i(8652),h=e.i(48467),m=e.i(79634),p=e.i(81471),x=e.i(14260),g=e.i(95486);function f(e,t){return(0,x.useQuery)({queryKey:["mail-health",e],queryFn:()=>d.api.get(`/mail/${encodeURIComponent(e)}/health`),refetchInterval:1e4,enabled:t})}function b(){let e=(0,g.useQueryClient)();return()=>{e.invalidateQueries({queryKey:["mail-providers"]}),e.invalidateQueries({queryKey:["mail-accounts"]}),e.invalidateQueries({queryKey:["mail-health"]})}}async function y(e,t,a){let n=new Set(e);a?n.add(t):n.delete(t);let s=["gmail","outlook","yahoo","icloud"].filter(e=>n.has(e));return await d.api.patch("/mail/providers",{enabledKinds:s}),s}e.s(["toggleProviderEnabled",0,y,"useInvalidateMail",0,b,"useMailAccountHealth",0,f,"useMailAccounts",0,function(){return(0,x.useQuery)({queryKey:["mail-accounts"],queryFn:()=>d.api.get("/mail/accounts"),refetchInterval:1e4})},"useMailProviders",0,function(){return(0,x.useQuery)({queryKey:["mail-providers"],queryFn:()=>d.api.get("/mail/providers"),refetchInterval:3e4})}],6423);let v={healthy:{variant:"green",label:"Healthy"},requires_consent:{variant:"amber",label:"Re-authenticate"},degraded:{variant:"red",label:"Degraded"}};function j({account:e,highlight:n=!1,hideActive:s=!1,hideHealth:l=!1,onReauthenticate:u,isLastOfKind:p=!1,onAfterRemove:x}){let g=(0,a.useRef)(null),y=(0,r.useConfirm)(),N=b(),[C,A]=(0,a.useState)(!1),[S,I]=(0,a.useState)(null);(0,a.useEffect)(()=>{n&&g.current&&g.current.scrollIntoView({behavior:"smooth",block:"center"})},[n]);let E=f(e.id,!l).data??null,M="yahoo"===e.kind||"icloud"===e.kind,[T,F]=(0,a.useState)(!1),R=async()=>{I(null),A(!0);try{await d.api.patch(`/mail/accounts/${encodeURIComponent(e.id)}`,{active:!e.active}),N()}catch(e){I(e instanceof Error?e.message:"Failed to update")}finally{A(!1)}},_=async()=>{if(await y({title:`Remove ${e.email}?`,description:"Local credentials are revoked and the account is removed from this app. The mailbox itself is untouched at the provider."+(p?" This is the last account of its kind, so the provider will also be disabled — re-authenticate and toggle Enable to bring it back.":""),confirmLabel:"Remove",variant:"destructive"})){I(null),A(!0);try{await d.api.delete(`/mail/accounts/${encodeURIComponent(e.id)}`),x&&await x(),N()}catch(e){I(e instanceof Error?e.message:"Failed to remove")}finally{A(!1)}}},B=v[e.authStatus],D=l||!e.idleEnabled?null:E?.idleFallbackUntilUtc?{label:"polling (IDLE down)",variant:"amber"}:{label:"IDLE",variant:"green"};return(0,t.jsxs)("div",{ref:g,id:`account-${e.id}`,className:"rounded-md border p-3 transition-colors "+(n?"border-amber-400 ring-1 ring-amber-300/60":"border-border"),children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(o.Mail,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.email}),e.label&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.label,")"]}),(0,t.jsx)(h.Badge,{variant:B.variant,children:B.label}),D&&(0,t.jsx)(h.Badge,{variant:D.variant,children:D.label})]}),!l&&(0,t.jsx)(w,{health:E})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)("label",{className:"flex items-center gap-1 text-xs cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.active,disabled:C,onChange:()=>void R(),className:"h-3.5 w-3.5 rounded border-border"}),"Active"]}),"requires_consent"===e.authStatus&&(M?(0,t.jsx)(i.Button,{size:"sm",variant:"outline",disabled:C,onClick:()=>F(e=>!e),className:"h-7 text-xs px-2",children:T?"Cancel":"Re-authenticate"}):u&&(0,t.jsx)(i.Button,{size:"sm",variant:"outline",disabled:C,onClick:()=>void u(),className:"h-7 text-xs px-2",children:"Re-authenticate"})),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void _(),disabled:C,className:"h-7 px-2",title:"Remove account",children:(0,t.jsx)(c.Trash2,{className:"h-3.5 w-3.5"})})]})]}),S&&(0,t.jsx)(m.Alert,{variant:"error",className:"mt-2",children:S}),M&&T&&(0,t.jsx)(k,{accountId:e.id,onSuccess:()=>{F(!1),N()}})]})}function k({accountId:e,onSuccess:n}){let[s,r]=(0,a.useState)(""),[l,o]=(0,a.useState)(!1),[c,h]=(0,a.useState)(null),p=async()=>{o(!0),h(null);try{await d.api.post(`/config/mail/app-password/${encodeURIComponent(e)}/refresh`,{appPassword:s.trim()}),r(""),n()}catch(e){h(e instanceof Error?e.message:"Failed to refresh")}finally{o(!1)}};return(0,t.jsxs)("div",{className:"mt-2 rounded-md border border-amber-200 bg-amber-50/50 p-3 dark:border-amber-900 dark:bg-amber-950/30 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-foreground",children:"Generate a new app password at the provider, paste it here, and the daemon will swap it in place — the polling cursor and account ID stay intact."}),(0,t.jsx)(u.Input,{type:"password",value:s,onChange:e=>r(e.target.value),placeholder:"paste new app password",className:"h-8 text-xs"}),(0,t.jsx)("div",{className:"flex gap-2",children:(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void p(),disabled:l||0===s.trim().length,className:"h-7 text-xs px-3",children:l?"Verifying…":"Update password"})}),c&&(0,t.jsx)(m.Alert,{variant:"error",children:c})]})}function w({health:e}){if(!e)return(0,t.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:"Waiting for first poll…"});let a=e.lastPollAtUtc,n=null!=a&&Date.now()-(0,p.parseUtcDate)(a).getTime()>9e5;return(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:["last poll:"," ",a?(0,t.jsxs)("span",{title:(0,p.formatAbsoluteTime)(a),className:n?"text-amber-600 dark:text-amber-400":void 0,children:[(0,p.formatRelativeTime)(a),n?" · stale":""]}):(0,t.jsx)("span",{children:"never"})]}),e.consecutiveErrorCount>0&&(0,t.jsxs)("span",{className:"text-amber-600 dark:text-amber-400",children:[e.consecutiveErrorCount," consecutive errors"]}),e.lastError&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400 max-w-full truncate",title:e.lastError,children:[(0,t.jsx)(l.AlertTriangle,{className:"h-3 w-3 shrink-0"}),e.lastError]})]})}var N=e.i(74490),C=e.i(57628);let A={"not-connected":{variant:"gray",label:"Not connected"},"needs-setup":{variant:"gray",label:"Needs setup"},disabled:{variant:"amber",label:"Ready to enable"},enabled:{variant:"green",label:"Enabled"},attention:{variant:"red",label:"Needs attention"}};function S(e){return e.accounts.some(e=>"healthy"!==e.authStatus)?"attention":0===e.accounts.length?e.awaitingProviderSetup?"needs-setup":"not-connected":e.enabled?"enabled":"disabled"}function I(e){let a=A[e.status],n="attention"===e.status?"warning":"enabled"===e.status?"success":"default";return(0,t.jsxs)(N.Card,{tone:n,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(o.Mail,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground truncate",children:e.name})]}),(0,t.jsx)(h.Badge,{variant:a.variant,children:a.label})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.description}),(0,t.jsx)("div",{className:"mt-3 space-y-3",children:e.setupSection}),e.accountsSection&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.Separator,{className:"my-4"}),(0,t.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Authenticated accounts"}),(0,t.jsx)("div",{className:"space-y-2",children:e.accountsSection})]}),(0,t.jsx)(C.Separator,{className:"my-4"}),(0,t.jsx)(E,{toggle:e.enableToggle})]})}function E({toggle:e}){let[n,s]=(0,a.useState)(null),i=async t=>{s(null);try{await e.onChange(t)}catch(e){s(e instanceof Error?e.message:"Failed to update")}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm select-none "+(e.disabled||e.busy?"cursor-not-allowed opacity-60":"cursor-pointer"),title:e.disabled?e.disabledReason:void 0,children:[(0,t.jsx)("input",{type:"checkbox",checked:e.enabled,disabled:e.disabled||e.busy,onChange:e=>void i(e.target.checked),className:"h-4 w-4 rounded border-border"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Enable for the agent"}),e.busy&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"saving…"})]}),e.disabled&&e.disabledReason&&(0,t.jsx)("p",{className:"mt-1 ml-6 text-xs text-muted-foreground",children:e.disabledReason}),!e.disabled&&e.explainer&&(0,t.jsx)("p",{className:"mt-1 ml-6 text-xs text-muted-foreground",children:e.explainer}),n&&(0,t.jsx)(m.Alert,{variant:"error",className:"mt-2",children:n})]})}e.s(["GmailCard",0,function({accounts:e,enabledKinds:l,focusAccountId:o,hideExternalGoogleLink:c=!1}){let d=b(),u=(0,r.useConfirm)(),[h,m]=(0,a.useState)(!1),p=l.includes("gmail"),x=S({accounts:e,enabled:p}),g=async e=>{if(e||await u({title:"Disable Gmail for the agent?",description:"This stops the unified mail poller from observing Gmail — receipts, travel bookings, and Kindle highlights will not be classified until you re-enable Gmail. Tokens stay in the keychain and the integration resumes the moment you flip the switch back on.",confirmLabel:"Disable Gmail",variant:"destructive"})){m(!0);try{await y(l,"gmail",e),d()}finally{m(!1)}}};return(0,t.jsx)(I,{name:"Gmail / Google Workspace",description:(0,t.jsx)(t.Fragment,{children:"Authenticated through your existing Google connection (it is shared with Calendar). Manage Google OAuth on the Connections page."}),status:x,setupSection:0===e.length?(0,t.jsxs)("div",{className:"rounded-md border border-dashed border-border p-3 text-xs",children:[(0,t.jsx)("p",{className:"text-foreground font-medium mb-1",children:"No Gmail account connected yet."}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:c?"Switch the Mode above to Direct and complete the Google connection step on this page — the daemon detects your Gmail address from the OAuth response and registers it here.":"Authenticate Google in Connections — the daemon detects your Gmail address from the OAuth response and registers it here."}),!c&&(0,t.jsx)(n.default,{href:"/connections/calendar#google",children:(0,t.jsxs)(i.Button,{size:"sm",variant:"outline",className:"h-7 text-xs px-3",children:["Open Google connection",(0,t.jsx)(s.ExternalLink,{className:"ml-1 h-3 w-3"})]})})]}):c?null:(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Re-authentication, scope changes, or revoking access live on the"," ",(0,t.jsx)(n.default,{href:"/connections/calendar#google",className:"underline underline-offset-2",children:"Google connection card"}),"."]}),accountsSection:e.length>0?e.map(a=>(0,t.jsx)(j,{account:a,highlight:o===a.id,hideActive:!0,hideHealth:!0,isLastOfKind:1===e.length,onAfterRemove:async()=>{1===e.length&&p&&await y(l,"gmail",!1)}},a.id)):void 0,enableToggle:{enabled:p,disabled:0===e.length,disabledReason:0===e.length?"Connect a Google account first.":void 0,busy:h,onChange:g,explainer:"When enabled, the legacy Gmail poller observes your inbox and the agent can read, draft, and send messages."}})}],86567),e.i(18446);var M=e.i(49445);function T({index:e,title:a,completed:n=!1,disabled:s=!1,children:i}){return(0,t.jsxs)("div",{className:"rounded-md border border-dashed p-3 "+(s?"border-border opacity-50":n?"border-emerald-300 dark:border-emerald-800":"border-border"),children:[(0,t.jsxs)("p",{className:"text-xs font-semibold text-foreground mb-2",children:["Step ",e,": ",a,n&&(0,t.jsx)("span",{className:"ml-2 text-emerald-600 dark:text-emerald-400",children:"✓"})]}),i]})}e.s(["OutlookCard",0,function({accounts:e,enabledKinds:n,focusAccountId:l}){let o=b(),c=(0,r.useConfirm)(),h=n.includes("outlook"),p=(0,x.useQuery)({queryKey:["outlook-client-config"],queryFn:()=>d.api.get("/config/mail/outlook/client-config"),staleTime:3e4}),g=p.data?.configured===!0,f=S({accounts:e,enabled:h,awaitingProviderSetup:!g}),[v,k]=(0,a.useState)(!1),[w,N]=(0,a.useState)(""),[C,A]=(0,a.useState)("common"),[E,F]=(0,a.useState)(""),[R,_]=(0,a.useState)(!1),[B,D]=(0,a.useState)(null),[O,P]=(0,a.useState)(null),[L,G]=(0,a.useState)(null),[q,K]=(0,a.useState)(!1),U=async e=>{K(!0);try{await y(n,"outlook",e),o()}finally{K(!1)}},W=async()=>{_(!0),D(null);try{await d.api.put("/config/mail/outlook/client-config",{clientId:w.trim(),tenant:C.trim()||"common"}),await p.refetch(),k(!1)}catch(e){D(e instanceof Error?e.message:"Failed to save client config")}finally{_(!1)}},z=async()=>{if(await c({title:"Reset Azure app registration?",description:"Existing Outlook accounts keep working until their tokens expire. You'll need to re-enter the client ID before adding new accounts.",confirmLabel:"Reset",variant:"destructive"})){_(!0),D(null);try{await d.api.delete("/config/mail/outlook/client-config"),await p.refetch()}catch(e){D(e instanceof Error?e.message:"Failed to reset")}finally{_(!1)}}},$=async()=>{if(await c({title:"Open Microsoft sign-in?",description:"The daemon will open your browser to sign in to Microsoft. macOS or Windows may show a one-time firewall prompt — accept it so the loopback callback can complete.",confirmLabel:"Continue"})){_(!0),D(null),P(null);try{await d.api.post("/mail/accounts",{kind:"outlook",label:E.trim()||void 0}),P("Outlook account authenticated. Toggle the switch below to start using it."),F(""),o()}catch(e){D(e instanceof Error?e.message:"OAuth failed")}finally{_(!1)}}},H=async()=>{_(!0),D(null),P(null),G(null);try{let e=await fetch("/api/mail/accounts/device-code",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:"outlook",label:E.trim()||void 0})});if(!e.ok||!e.body)throw Error(`HTTP ${e.status}`);let t=e.body.getReader(),a=new TextDecoder,n="";for(;;){let{value:e,done:s}=await t.read();if(s)break;let i=(n+=a.decode(e,{stream:!0})).split("\n\n");for(let e of(n=i.pop()??"",i)){let t=e.split("\n"),a="",n="";for(let e of t)e.startsWith("event:")&&(a=e.slice(6).trim()),e.startsWith("data:")&&(n+=e.slice(5).trim());if(a){if("prompt"===a)G(JSON.parse(n));else if("completed"===a)P("Outlook account authenticated. Toggle the switch below to start using it."),G(null),F(""),o();else if("failed"===a){let e=JSON.parse(n);throw Error(e.message??"device-code failed")}}}}}catch(e){D(e instanceof Error?e.message:"Device-code OAuth failed"),G(null)}finally{_(!1)}},V=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T,{index:1,title:"Register an Azure app (one-time)",completed:g,children:[!g&&!v&&(0,t.jsxs)("div",{className:"space-y-3 text-xs",children:[(0,t.jsxs)("p",{className:"text-muted-foreground",children:["One-time setup: you'll tell Microsoft that the ",M.APP_NAME,"daemon on your computer is allowed to read and send mail on your behalf. Follow every sub-step — two of them are easy to miss and will make sign-in fail with ",(0,t.jsx)("code",{children:"server_error"})," later."]}),(0,t.jsxs)("ol",{className:"list-decimal list-outside pl-4 space-y-2 text-muted-foreground",children:[(0,t.jsxs)("li",{children:["Open the"," ",(0,t.jsxs)("a",{href:"https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",target:"_blank",rel:"noreferrer",className:"underline inline-flex items-center gap-0.5",children:["Azure portal — App registrations"," ",(0,t.jsx)(s.ExternalLink,{className:"h-3 w-3"})]}),". Sign in with the Microsoft account you want the agent to use."]}),(0,t.jsxs)("li",{children:["Click ",(0,t.jsx)("strong",{children:"+ New registration"})," at the top of the page."]}),(0,t.jsxs)("li",{children:["Fill in the form:",(0,t.jsxs)("ul",{className:"list-disc list-outside pl-4 mt-1 space-y-1",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Name"}),": anything, e.g. ",(0,t.jsx)("code",{children:M.APP_NAME}),"."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Supported account types"}),": pick"," ",(0,t.jsx)("em",{children:"Accounts in any organizational directory (Any Microsoft Entra ID tenant – Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)"}),"."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:"Redirect URI"}),": in the left-hand dropdown choose ",(0,t.jsx)("code",{children:"Public client/native (mobile & desktop)"})," ",(0,t.jsx)("strong",{children:"— not"})," ",(0,t.jsx)("code",{children:"Web"}),". Then type"," ",(0,t.jsx)("code",{children:"http://127.0.0.1/callback"})," in the box on the right."]})]}),(0,t.jsxs)("p",{className:"mt-1 rounded-md border border-amber-400/60 bg-amber-400/10 px-2 py-1 text-amber-700 dark:text-amber-300",children:["⚠ Trap #1: if you leave ",(0,t.jsx)("code",{children:"Web"})," selected, Microsoft will later return ",(0,t.jsx)("code",{children:"Authorization failed: server_error"}),". Use the Public client/native option."]})]}),(0,t.jsxs)("li",{children:["Click ",(0,t.jsx)("strong",{children:"Register"})," at the bottom of the form."]}),(0,t.jsxs)("li",{children:["You'll land on the ",(0,t.jsx)("em",{children:"Overview"})," page. Copy the value labelled ",(0,t.jsx)("strong",{children:"Application (client) ID"}),"— you'll paste it into the form below in a moment."]}),(0,t.jsxs)("li",{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"Authentication"}),". Scroll to the very bottom, find ",(0,t.jsx)("em",{children:"Advanced settings"})," →"," ",(0,t.jsx)("strong",{children:"Allow public client flows"}),", flip the toggle to"," ",(0,t.jsx)("strong",{children:"Yes"}),", then click ",(0,t.jsx)("strong",{children:"Save"})," at the top of the page.",(0,t.jsxs)("p",{className:"mt-1 rounded-md border border-amber-400/60 bg-amber-400/10 px-2 py-1 text-amber-700 dark:text-amber-300",children:["⚠ Trap #2: this toggle is off by default. Without it sign-in also fails with ",(0,t.jsx)("code",{children:"server_error"}),"."]})]}),(0,t.jsxs)("li",{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"API permissions"})," →"," ",(0,t.jsx)("strong",{children:"+ Add a permission"})," →"," ",(0,t.jsx)("strong",{children:"Microsoft Graph"})," →"," ",(0,t.jsx)("strong",{children:"Delegated permissions"}),". Use the search box to find and tick each of:",(0,t.jsxs)("ul",{className:"list-disc list-outside pl-4 mt-1",children:[(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"offline_access"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"User.Read"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"Mail.ReadWrite"})}),(0,t.jsx)("li",{children:(0,t.jsx)("code",{children:"Mail.Send"})})]}),"Then click ",(0,t.jsx)("strong",{children:"Add permissions"})," at the bottom."]}),(0,t.jsxs)("li",{children:["(Work/school tenant only) If your org requires admin consent for these scopes, click ",(0,t.jsx)("strong",{children:"Grant admin consent"}),". Personal Microsoft accounts don't need this step."]}),(0,t.jsxs)("li",{children:["Come back here and click ",(0,t.jsx)("strong",{children:"I have a client ID"}),". Paste the Application (client) ID you copied in step 5; leave Tenant as ",(0,t.jsx)("code",{children:"common"})," unless your admin told you otherwise."]})]}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>k(!0),className:"h-7 text-xs px-3",children:"I have a client ID"})]}),v&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-client-id",children:"Application (client) ID"}),(0,t.jsx)(u.Input,{id:"outlook-client-id",value:w,onChange:e=>N(e.target.value),placeholder:"00000000-0000-0000-0000-000000000000",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-tenant",children:["Tenant (default ",(0,t.jsx)("code",{children:"common"}),")"]}),(0,t.jsx)(u.Input,{id:"outlook-tenant",value:C,onChange:e=>A(e.target.value),placeholder:"common / organizations / <tenant-guid>",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void W(),disabled:R||0===w.trim().length,className:"h-7 text-xs px-3",children:R?"Saving…":"Save"}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>k(!1),disabled:R,className:"h-7 text-xs px-3",children:"Cancel"})]})]}),g&&!v&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Application ID:"," ",(0,t.jsx)("code",{className:"font-mono",children:p.data?.clientId})," ","(tenant ",(0,t.jsx)("code",{children:p.data?.tenant}),")."," ",(0,t.jsx)("button",{type:"button",className:"underline",onClick:()=>void z(),disabled:R,children:"reset"})]})]}),(0,t.jsx)(T,{index:2,title:"Authenticate an Outlook account",disabled:!g,children:g?(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:"outlook-label",children:"Label (optional)"}),(0,t.jsx)(u.Input,{id:"outlook-label",value:E,onChange:e=>F(e.target.value),placeholder:"work, personal, …",className:"h-8 text-xs"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void $(),disabled:R,className:"h-7 text-xs px-3",children:R?"Waiting for consent…":"Authenticate (browser)"}),(0,t.jsx)(i.Button,{size:"sm",variant:"outline",onClick:()=>void H(),disabled:R,className:"h-7 text-xs px-3",title:"Use if the daemon runs headless (SSH / WSL)",children:"Authenticate (device code)"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"The browser flow may trigger a one-time macOS / Windows firewall prompt — accept it so the loopback callback can complete."})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Save the client ID first."})}),L&&(0,t.jsx)(m.Alert,{variant:"warning",children:(0,t.jsxs)("div",{className:"text-xs",children:["Visit"," ",(0,t.jsx)("a",{href:L.verificationUri,target:"_blank",rel:"noreferrer",className:"underline",children:L.verificationUri})," ","and enter code"," ",(0,t.jsx)("code",{className:"font-mono",children:L.userCode}),". Expires in ",Math.round(L.expiresIn/60)," min."]})}),O&&(0,t.jsx)(m.Alert,{variant:"success",children:O}),B&&(0,t.jsx)(m.Alert,{variant:"error",children:B})]});return(0,t.jsx)(I,{name:"Outlook / Microsoft 365",description:(0,t.jsx)(t.Fragment,{children:"One-time Azure app registration, then connect as many Outlook / outlook.com / Microsoft 365 accounts as you need."}),status:f,setupSection:V,accountsSection:e.length>0?e.map(a=>(0,t.jsx)(j,{account:a,highlight:l===a.id,onReauthenticate:()=>void $(),isLastOfKind:1===e.length,onAfterRemove:async()=>{1===e.length&&h&&await y(n,"outlook",!1)}},a.id)):void 0,enableToggle:{enabled:h,disabled:0===e.length,disabledReason:0===e.length?"Authenticate an Outlook account first.":void 0,busy:q,onChange:U,explainer:"When enabled, the agent observes your Outlook inbox via Microsoft Graph and can read, draft, and send messages."}})}],86704);let F={yahoo:{name:"Yahoo Mail",description:"App-password login over IMAP/SMTP. Generate the password in Yahoo Account Security, paste it once, and the daemon stores it in the OS keychain.",setupUrl:"https://login.yahoo.com/account/security",setupLabel:"Yahoo Account Security",passwordLabel:"Yahoo app password",defaultDomain:"yahoo.com",prerequisite:"Yahoo requires two-step verification on the account before it lets you create app passwords. If you haven't enabled it yet, turn it on first from the same Account Security page.",passwordSteps:[(0,t.jsxs)(t.Fragment,{children:["Open the"," ",(0,t.jsx)("strong",{children:"Yahoo Account Security"})," page and sign in with the Yahoo account you want to connect."]}),(0,t.jsxs)(t.Fragment,{children:["Scroll to ",(0,t.jsx)("strong",{children:"Other ways to sign in"})," and click"," ",(0,t.jsx)("strong",{children:"Generate and manage app passwords"}),". (If the link is missing, enable two-step verification first.)"]}),(0,t.jsxs)(t.Fragment,{children:["In the ",(0,t.jsx)("em",{children:"App name"})," field type ",(0,t.jsx)("code",{children:M.APP_NAME})," (any name works; this is just a label Yahoo shows in your account), then click ",(0,t.jsx)("strong",{children:"Generate password"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Yahoo shows a 16-character password with spaces. Copy it exactly as shown — ",(0,t.jsx)("strong",{children:"do not type it by hand"}),". Spaces are part of the password."]}),(0,t.jsx)(t.Fragment,{children:"Paste it into the password field below, then click Authenticate."})],passwordHint:"16 characters from Yahoo, spaces included. Do not retype — paste."},icloud:{name:"iCloud Mail",description:"App-specific-password login over IMAP/SMTP. Create the password in Apple Account → Sign-In and Security, paste it once, and the daemon stores it in the OS keychain.",setupUrl:"https://account.apple.com",setupLabel:"Apple Account",passwordLabel:"Apple app-specific password",defaultDomain:"icloud.com",prerequisite:"Apple only allows app-specific passwords on Apple IDs that have two-factor authentication turned on. If your Apple ID doesn't have 2FA yet, enable it first at appleid.apple.com.",passwordSteps:[(0,t.jsxs)(t.Fragment,{children:["Open ",(0,t.jsx)("strong",{children:"Apple Account"})," and sign in with the Apple ID whose iCloud mailbox you want to connect."]}),(0,t.jsxs)(t.Fragment,{children:["In the left sidebar click ",(0,t.jsx)("strong",{children:"Sign-In and Security"}),", then click ",(0,t.jsx)("strong",{children:"App-Specific Passwords"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Click ",(0,t.jsx)("strong",{children:"+ Generate an app-specific password"}),". Apple may ask you to re-enter your Apple ID password."]}),(0,t.jsxs)(t.Fragment,{children:["In the label field type ",(0,t.jsx)("code",{children:M.APP_NAME})," (any name works), then click ",(0,t.jsx)("strong",{children:"Create"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Apple shows a 19-character password in the form"," ",(0,t.jsx)("code",{children:"xxxx-xxxx-xxxx-xxxx"}),". Copy it exactly —"," ",(0,t.jsx)("strong",{children:"the dashes are required"}),"."]}),(0,t.jsx)(t.Fragment,{children:"Paste it into the password field below, then click Authenticate."})],passwordHint:"Format: xxxx-xxxx-xxxx-xxxx. Dashes are required — paste, don't retype."}};e.s(["ImapCard",0,function({kind:e,accounts:n,enabledKinds:r,focusAccountId:l}){let o=b(),c=F[e],h=r.includes(e),p=S({accounts:n,enabled:h}),[x,g]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[k,w]=(0,a.useState)(""),[N,C]=(0,a.useState)(!1),[A,E]=(0,a.useState)(null),[M,T]=(0,a.useState)(null),[R,_]=(0,a.useState)(!1),B=async t=>{_(!0);try{await y(r,e,t),o()}finally{_(!1)}},D=async()=>{C(!0),E(null),T(null);try{await d.api.post("/config/mail/app-password",{kind:e,email:`${x.trim()}@${c.defaultDomain}`,appPassword:f.trim(),label:k.trim()||void 0}),T(`${c.name} authenticated. Toggle the switch below to start using it.`),g(""),v(""),w(""),o()}catch(e){E(e instanceof Error?e.message:"Failed to connect")}finally{C(!1)}},O=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"rounded-md border border-dashed border-border p-3 text-xs space-y-2",children:[(0,t.jsx)("p",{className:"text-foreground font-medium",children:"Step 1: Generate an app password"}),(0,t.jsxs)("p",{className:"text-muted-foreground",children:[c.prerequisite," ",(0,t.jsxs)("a",{href:c.setupUrl,target:"_blank",rel:"noreferrer",className:"underline inline-flex items-center gap-0.5",children:["Open ",c.setupLabel," ",(0,t.jsx)(s.ExternalLink,{className:"h-3 w-3"})]}),"."]}),(0,t.jsx)("ol",{className:"list-decimal list-outside pl-4 space-y-1 text-muted-foreground",children:c.passwordSteps.map((e,a)=>(0,t.jsx)("li",{children:e},a))})]}),(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-foreground",children:"Step 2: Authenticate the account"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-email`,children:"Account email"}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(u.Input,{id:`${e}-email`,value:x,onChange:e=>g(e.target.value),placeholder:"username",className:"h-8 text-xs rounded-r-none"}),(0,t.jsxs)("span",{className:"inline-flex h-8 items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-xs text-muted-foreground select-none",children:["@",c.defaultDomain]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-app-password`,children:c.passwordLabel}),(0,t.jsx)(u.Input,{id:`${e}-app-password`,type:"password",value:f,onChange:e=>v(e.target.value),placeholder:"paste generated password",className:"h-8 text-xs"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:c.passwordHint})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground mb-1",htmlFor:`${e}-label`,children:"Label (optional)"}),(0,t.jsx)(u.Input,{id:`${e}-label`,value:k,onChange:e=>w(e.target.value),placeholder:"personal, family, …",className:"h-8 text-xs"})]}),(0,t.jsx)(i.Button,{size:"sm",onClick:()=>void D(),disabled:N||0===x.trim().length||0===f.trim().length,className:"h-7 text-xs px-3",children:N?"Authenticating…":"Authenticate"})]}),M&&(0,t.jsx)(m.Alert,{variant:"success",children:M}),A&&(0,t.jsx)(m.Alert,{variant:"error",children:A})]});return(0,t.jsx)(I,{name:c.name,description:c.description,status:p,setupSection:O,accountsSection:n.length>0?n.map(a=>(0,t.jsx)(j,{account:a,highlight:l===a.id,isLastOfKind:1===n.length,onAfterRemove:async()=>{1===n.length&&h&&await y(r,e,!1)}},a.id)):void 0,enableToggle:{enabled:h,disabled:0===n.length,disabledReason:0===n.length?`Authenticate a ${c.name} account first.`:void 0,busy:R,onChange:B,explainer:`When enabled, the agent observes your ${c.name} inbox via IMAP IDLE and can read, draft, and send messages.`}})}],29472)},91653,e=>{"use strict";var t=e.i(54710),a=e.i(34416),n=e.i(79634),s=e.i(86567),i=e.i(86704),r=e.i(29472),l=e.i(6423),o=e.i(85631),c=e.i(32077),d=e.i(32220);e.s(["default",0,function(){let e=(0,l.useMailAccounts)(),u=(0,l.useMailProviders)(),h=function(){let[e,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=()=>{let e=window.location.hash.replace(/^#/,"");t(e.length>0?e:null)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e}(),m=e.data?.accounts??[],p=u.data?.enabledKinds??[],x=function(e){let t={gmail:[],outlook:[],yahoo:[],icloud:[]};for(let a of e)t[a.kind].push(a);return t}(m),g=e.isLoading||u.isLoading,f=e.error??u.error,b=m.filter(e=>e.active&&p.includes(e.kind)).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ConnectionsSectionHeader,{title:"Mail",description:"Connect each mail provider in two steps: authenticate, then flip the provider's enable switch. Once enabled, the per-account Active toggle lets you mute a single mailbox without disabling the whole provider.",healthy:b,total:m.length}),f&&(0,t.jsxs)(n.Alert,{variant:"error",children:["Couldn't load mail data:"," ",f instanceof Error?f.message:"unknown error"]}),g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(c.IntegrationCard,{integrationKey:"gmail",gmailAccountCount:x.gmail.length}),(0,t.jsx)(d.ProcessModelCard,{processKey:"gmail_classify",title:"Gmail Classification Model",description:"Classifies each incoming Gmail message and decides how the agent should respond. Light-tier (Haiku 4.5 / gpt-5.4-mini) handles this well at low cost."}),(0,t.jsx)(s.GmailCard,{accounts:x.gmail,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(c.IntegrationCard,{integrationKey:"outlook_mail"}),(0,t.jsx)(i.OutlookCard,{accounts:x.outlook,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(r.ImapCard,{kind:"yahoo",accounts:x.yahoo,enabledKinds:p,focusAccountId:h}),(0,t.jsx)(r.ImapCard,{kind:"icloud",accounts:x.icloud,enabledKinds:p,focusAccountId:h})]})]})}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74490,e=>{"use strict";var t=e.i(54710),a=e.i(81471);let s=(0,e.i(94237).cva)("rounded-xl border p-5 shadow-[0_1px_3px_rgb(0_0_0/0.04)]",{variants:{tone:{default:"border-border bg-card",warning:"border-amber-200 bg-amber-50/50 dark:border-amber-900 dark:bg-amber-950/30",success:"border-emerald-200 bg-emerald-50/50 dark:border-emerald-900 dark:bg-emerald-950/30",error:"border-red-200 bg-red-50/50 dark:border-red-900 dark:bg-red-950/30"},interactive:{true:"transition-shadow duration-150 hover:shadow-[0_4px_6px_rgb(0_0_0/0.06)]",false:""}},defaultVariants:{tone:"default",interactive:!1}});e.s(["Card",0,function({className:e,tone:r,interactive:i,...n}){return(0,t.jsx)("div",{className:(0,a.cn)(s({tone:r,interactive:i}),e),...n})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("mb-3 flex items-center justify-between",e),...s})},"CardStatLabel",0,function({className:e,...s}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-sm font-medium text-muted-foreground",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold text-foreground",e),...s})},"CardValue",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("text-3xl font-bold text-foreground",e),...s})}])},39982,e=>{"use strict";var t=e.i(54710),a=e.i(81471);e.s(["PageHeader",0,function({title:e,description:s,icon:r,badge:i,actions:n,children:l,className:o}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex flex-col gap-1",o),children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r&&(0,t.jsx)(r,{className:"h-5 w-5 text-muted-foreground"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e}),i]}),n&&(0,t.jsx)("div",{className:"flex items-center gap-2",children:n})]}),s&&(0,t.jsx)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:s}),l]})}])},21682,e=>{"use strict";let t=(0,e.i(77379).default)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],21682)},70986,e=>{"use strict";var t=e.i(34416),a=e.i(91967),s=e.i(9413),r=e.i(36567),i=e.i(18731),n=e.i(22353),l=e.i(85565),o=e.i(90816),d=e.i(11207),c=e.i(54710),u="Collapsible",[m,x]=(0,s.createContextScope)(u),[p,h]=m(u),g=t.forwardRef((e,a)=>{let{__scopeCollapsible:s,open:i,defaultOpen:n,disabled:o,onOpenChange:m,...x}=e,[h,g]=(0,r.useControllableState)({prop:i,defaultProp:n??!1,onChange:m,caller:u});return(0,c.jsx)(p,{scope:s,disabled:o,contentId:(0,d.useId)(),open:h,onOpenToggle:t.useCallback(()=>g(e=>!e),[g]),children:(0,c.jsx)(l.Primitive.div,{"data-state":w(h),"data-disabled":o?"":void 0,...x,ref:a})})});g.displayName=u;var f="CollapsibleTrigger",y=t.forwardRef((e,t)=>{let{__scopeCollapsible:s,...r}=e,i=h(f,s);return(0,c.jsx)(l.Primitive.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:(0,a.composeEventHandlers)(e.onClick,i.onOpenToggle)})});y.displayName=f;var b="CollapsibleContent",v=t.forwardRef((e,t)=>{let{forceMount:a,...s}=e,r=h(b,e.__scopeCollapsible);return(0,c.jsx)(o.Presence,{present:a||r.open,children:({present:e})=>(0,c.jsx)(j,{...s,ref:t,present:e})})});v.displayName=b;var j=t.forwardRef((e,a)=>{let{__scopeCollapsible:s,present:r,children:o,...d}=e,u=h(b,s),[m,x]=t.useState(r),p=t.useRef(null),g=(0,n.useComposedRefs)(a,p),f=t.useRef(0),y=f.current,v=t.useRef(0),j=v.current,N=u.open||m,k=t.useRef(N),C=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.useLayoutEffect)(()=>{let e=p.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,k.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),x(r)}},[u.open,r]),(0,c.jsx)(l.Primitive.div,{"data-state":w(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!N,...d,ref:g,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:N&&o})});function w(e){return e?"open":"closed"}e.s(["Collapsible",0,g,"CollapsibleContent",0,v,"CollapsibleTrigger",0,y],70986)},90925,e=>{"use strict";let t=(0,e.i(77379).default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],90925)},60168,e=>{"use strict";let t=(0,e.i(77379).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],60168)},99758,e=>{"use strict";let t=(0,e.i(77379).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],99758)},55575,e=>{"use strict";let t=(0,e.i(77379).default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],55575)},66127,e=>{"use strict";var t=e.i(65268);async function a({title:e,defaultPath:s}){let r=await t.api.post("/system/pick-directory",{title:e,...s?{defaultPath:s}:{}});if("selected"===r.status&&r.path)return r.path;if("cancelled"===r.status)return null;throw Error(r.message??"Folder picker is unavailable.")}e.s(["pickDirectoryFromDesktop",0,a])},25795,e=>{"use strict";let t=(0,e.i(77379).default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],25795)},82239,e=>{"use strict";var t=e.i(54710),a=e.i(25795),s=e.i(10628);e.s(["RestartRequiredBadge",0,function(){return(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsx)(s.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-amber-100 px-1 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:[(0,t.jsx)(a.RotateCcw,{className:"h-2.5 w-2.5"}),"restart"]})}),(0,t.jsx)(s.TooltipContent,{side:"top",className:"max-w-[220px] text-xs",children:"Changing this value requires a daemon restart to take effect."})]})}])},49681,e=>{"use strict";var t=e.i(54710),a=e.i(7771),s=e.i(95486),r=e.i(8011),i=e.i(10628),n=e.i(81471);e.s(["DocsHelpInline",0,function({docId:e,anchor:l=null,label:o,className:d}){let c=(0,s.useQueryClient)(),u=o??"Help";return(0,t.jsx)(i.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),(0,r.openDocsHelpSlideover)(c,{docId:e,anchor:l,autoFocusComposer:!1})},className:(0,n.cn)("inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 transition hover:bg-accent hover:text-foreground",d),"aria-label":`Open help — ${u}`,"data-testid":"docs-help-inline",children:(0,t.jsx)(a.HelpCircle,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),(0,t.jsx)(i.TooltipContent,{side:"top",children:(0,t.jsx)("span",{children:u})})]})})}])},88,e=>{"use strict";var t=e.i(54710),a=e.i(34416),s=e.i(99758),r=e.i(55575),i=e.i(21682),n=e.i(60168),l=e.i(25795),o=e.i(90925),d=e.i(36451);e.i(18446);var c=e.i(28444),u=e.i(48467),m=e.i(20014),x=e.i(74490),p=e.i(8652),h=e.i(82239),g=e.i(49681),f=e.i(66127),y=e.i(36413);let b=new Set(c.RESTART_REQUIRED_KEY_TUPLE);function v(e){return null===e?"":String(e)}e.s(["ConfigSection",0,function({title:e,children:a,helpDocId:s,helpAnchor:r}){return(0,t.jsxs)(x.Card,{children:[(0,t.jsx)(x.CardHeader,{children:(0,t.jsxs)(x.CardTitle,{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{children:e}),s&&(0,t.jsx)(g.DocsHelpInline,{docId:s,anchor:r??null,label:e})]})}),(0,t.jsx)("div",{className:"space-y-0.5 [&>p]:max-w-prose",children:a})]})},"EditableArrayField",0,function({label:e,values:s,configKey:i,variant:l="gray",placeholder:o="Add item...",directoryPicker:c,modified:x,onSave:g}){let y=b.has(i),[v,j]=(0,a.useState)(""),[w,N]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),T=async()=>{let e=v.trim();if(!(!e||s.includes(e))){N(!0),C(null);try{await g(i,[...s,e]),j("")}catch{}finally{N(!1)}}},R=async e=>{N(!0);try{await g(i,s.filter(t=>t!==e))}finally{N(!1)}},S=async()=>{if(c){N(!0),C(null);try{let e=await (0,f.pickDirectoryFromDesktop)({title:c.title,defaultPath:v.trim()||c.defaultPath});if(!e)return;if(s.includes(e)){j(e),C("That directory is already in the list.");return}await g(i,[...s,e]),j("")}catch(e){C(e instanceof Error?e.message:"Folder picker is unavailable.")}finally{N(!1)}}};return(0,t.jsxs)("div",{className:`py-2${x?" border-l-2 border-blue-500 pl-2 -ml-1 rounded":""}`,"data-config-key":i,children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mb-2 inline-flex items-center gap-1.5",children:[e,y&&(0,t.jsx)(h.RestartRequiredBadge,{}),x&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[s.map(e=>(0,t.jsxs)(u.Badge,{variant:l,className:"gap-1 pr-1",children:[e,(0,t.jsx)("button",{onClick:()=>R(e),disabled:w,className:"ml-0.5 rounded-sm hover:bg-black/10 dark:hover:bg-white/10 p-0.5 transition-colors",children:(0,t.jsx)(d.X,{className:"h-3 w-3"})})]},e)),0===s.length&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground italic",children:"No items"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.Input,{value:v,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key&&T()},placeholder:o,className:"max-w-[320px]",disabled:w}),c&&(0,t.jsxs)(m.Button,{size:"sm",variant:"outline",onClick:S,disabled:w,children:[(0,t.jsx)(r.FolderOpen,{className:"h-3.5 w-3.5 mr-1"}),c.buttonLabel??"Choose"]}),(0,t.jsxs)(m.Button,{size:"sm",variant:"outline",onClick:T,disabled:!v.trim()||w,children:[(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5 mr-1"}),"Add"]})]}),k&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive",children:k})]})},"EditableBooleanField",0,function({label:e,value:s,configKey:r,description:i,modified:n,defaultValue:o,onSave:d}){let[c,u]=(0,a.useState)(!1),x=b.has(r),p=void 0!==o&&s===o,g=async()=>{u(!0);try{await d(r,!s)}finally{u(!1)}},f=async()=>{if(void 0!==o){u(!0);try{await d(r,o)}finally{u(!1)}}};return(0,t.jsx)("div",{className:`py-1.5 group${n?" border-l-2 border-blue-500 pl-2 -ml-1 rounded":""}`,"data-config-key":r,children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e,x&&(0,t.jsx)(h.RestartRequiredBadge,{}),n&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"}),void 0!==o&&!p&&!n&&(0,t.jsxs)("button",{type:"button",onClick:f,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(l.RotateCcw,{className:"h-2.5 w-2.5"}),"reset"]})]}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:i})]}),(0,t.jsx)(m.Button,{variant:s?"default":"outline",size:"sm",onClick:g,disabled:c,children:s?"Enabled":"Disabled"})]})})},"EditableField",0,function({label:e,value:r,configKey:n,type:c="text",suffix:u,description:x,min:g,max:f,nullable:j=!1,emptyLabel:w="Not set",modified:N,defaultValue:k,onSave:C}){let T=b.has(n),[R,S]=(0,a.useState)(!1),[D,B]=(0,a.useState)(v(r)),[E,A]=(0,a.useState)(!1),[M,F]=(0,a.useState)(null),L=(0,a.useRef)(null),$=(0,y.useDiscardGeneration)(),P=(0,a.useRef)($);(0,a.useEffect)(()=>{$!==P.current&&(P.current=$,S(!1),F(null))},[$]),(0,a.useEffect)(()=>{R&&L.current?.focus()},[R]),(0,a.useEffect)(()=>{R||B(v(r))},[r,R]);let q=void 0!==k&&r===k,O=async e=>{if(e.stopPropagation(),void 0!==k){A(!0);try{await C(n,k)}finally{A(!1)}}},_=async e=>{e.stopPropagation(),A(!0);try{await C(n,null)}finally{A(!1)}},I=async()=>{let e=D.trim(),t=j&&""===e?null:"number"===c?Number(D):D;if(t===r)return void S(!1);if(null!==t&&"number"===c&&(void 0!==g||void 0!==f)&&(void 0!==g&&t<g||void 0!==f&&t>f))return void F(`Must be ${g??""}–${f??""}`);F(null),A(!0);try{await C(n,t),S(!1)}catch{}finally{A(!1)}};return R?(0,t.jsxs)("div",{className:"py-1.5","data-config-key":n,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground shrink-0 min-w-[140px] inline-flex items-center gap-1.5",children:[e,T&&(0,t.jsx)(h.RestartRequiredBadge,{})]}),(0,t.jsx)(p.Input,{ref:L,type:c,value:D,onChange:e=>{B(e.target.value),F(null)},onKeyDown:e=>{"Enter"===e.key&&I(),"Escape"===e.key&&(B(v(r)),S(!1))},className:"max-w-[240px]",disabled:E,min:g,max:f}),u&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),(0,t.jsx)(m.Button,{size:"sm",variant:"ghost",onClick:I,disabled:E,className:"h-7 w-7 p-0",children:(0,t.jsx)(s.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(m.Button,{size:"sm",variant:"ghost",onClick:()=>{B(v(r)),F(null),S(!1)},className:"h-7 w-7 p-0",children:(0,t.jsx)(d.X,{className:"h-3.5 w-3.5"})})]}),M&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-1 ml-[148px]",children:M}),x&&!M&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-[148px]",children:x})]}):(0,t.jsxs)("div",{className:`py-1.5 group cursor-pointer rounded px-1 -mx-1 hover:bg-muted/50 transition-colors${N?" border-l-2 border-blue-500 pl-2":""}`,"data-config-key":n,onClick:()=>S(!0),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e,T&&(0,t.jsx)(h.RestartRequiredBadge,{})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[N&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"}),void 0!==k&&!q&&!N&&(0,t.jsxs)("button",{type:"button",onClick:O,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(l.RotateCcw,{className:"h-2.5 w-2.5"}),"reset"]}),j&&null!==r&&!N&&(0,t.jsxs)("button",{type:"button",onClick:_,title:`Clear — sets ${e} to ${w}`,className:"text-[10px] text-muted-foreground hover:text-destructive transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(o.Trash2,{className:"h-2.5 w-2.5"}),"clear"]}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:null===r?w:"$"===u?`$${r}`:u?`${r} ${u}`:String(r)}),(0,t.jsx)(i.Pencil,{className:"h-3 w-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:x})]})}])},54879,e=>{"use strict";let t=(0,e.i(77379).default)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",0,t],54879)},34409,e=>{"use strict";var t=e.i(54710),a=e.i(34416),s=e.i(81187),r=e.i(59546),i=e.i(96263),n=e.i(77379);let l=(0,n.default)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),o=(0,n.default)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);var d=e.i(72740);let c=(0,n.default)("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);var u=e.i(25795),m=e.i(90925),x=e.i(54879),p=e.i(95486),h=e.i(14260);e.i(18446);var g=e.i(17900),f=e.i(65268),y=e.i(88423),b=e.i(13451),v=e.i(36413),j=e.i(20014),w=e.i(74490),N=e.i(39982),k=e.i(70986),C=e.i(10427),T=e.i(57628),R=e.i(90826),S=e.i(81471),D=e.i(88),B=e.i(94328);function E(){let e=(0,p.useQueryClient)(),s=(0,R.useConfirm)(),[r,i]=(0,a.useState)(!1),[n,l]=(0,a.useState)(!1),[o,u]=(0,a.useState)(null),[m,x]=(0,a.useState)(null),{data:y}=(0,h.useQuery)({queryKey:["voice-status"],queryFn:async()=>{try{return await f.api.get("/voice/status")}catch(e){if(n)return{enabled:!1,installing:!0,installed:!0,modelOnDisk:!1,modelSizeBytes:0,modelDir:"",status:"running",error:null,startedAt:null,finishedAt:null,model:"onnx-community/whisper-large-v3-turbo",progress:null,primaryLanguage:null,suggestedPrimaryLanguage:"en"};throw e}},refetchInterval:e=>{let t=e.state.data;return!!(n||t?.installing||t?.status==="running")&&1500},refetchOnWindowFocus:!1});(0,a.useEffect)(()=>{if(!y)return;let e=y.primaryLanguage??y.suggestedPrimaryLanguage;x(t=>t??e)},[y?.primaryLanguage,y?.suggestedPrimaryLanguage,y]),(0,a.useEffect)(()=>{n&&y?.enabled&&(l(!1),e.invalidateQueries({queryKey:["config"]}))},[n,y?.enabled,e]),(0,a.useEffect)(()=>{y?.status!=="ready"||y.enabled||l(!0)},[y?.status,y?.enabled]);let b=async()=>{u(null),i(!0);try{await f.api.post("/voice/install",{primaryLanguage:m}),await e.invalidateQueries({queryKey:["voice-status"]})}catch(e){u(e instanceof f.ApiError?e.message:"Install failed")}finally{i(!1)}},v=async()=>{if(await s({title:"Delete the local Whisper model?",description:'Removes the on-disk Whisper weights (~800 MB). Voice mode stays enabled — click "Upgrade & install" afterwards to download the model again. Use this when an install attempt failed and the dashboard is stuck on an error banner.',confirmLabel:"Delete model",variant:"destructive"})){u(null),i(!0);try{await f.api.delete("/voice/model"),await e.invalidateQueries({queryKey:["voice-status"]})}catch(e){u(e instanceof f.ApiError?e.message:"Deleting voice model failed")}finally{i(!1)}}},N=async t=>{u(null),i(!0);try{await f.api.patch("/config",{voiceTranscriptionPrimaryLanguage:t}),x(t),await e.invalidateQueries({queryKey:["voice-status"]}),await e.invalidateQueries({queryKey:["config"]})}catch(e){u(e instanceof f.ApiError?e.message:"Saving primary language failed")}finally{i(!1)}},k=y?.enabled??!1,T=r||(y?.installing??!1)||n,D=y?.progress??null,B=o??y?.error??null,E=k&&y?.modelOnDisk===!1&&!T,M=(0,a.useMemo)(()=>{let e=new Set(g.VOICE_LANGUAGE_TOP.map(e=>e.code)),t=g.VOICE_LANGUAGE_FULL.filter(t=>!e.has(t.code)).slice().sort((e,t)=>e.englishName.localeCompare(t.englishName));return{top:g.VOICE_LANGUAGE_TOP,more:t}},[]),F=e=>(0,t.jsxs)(C.Select,{value:m??void 0,onValueChange:e=>x(e),disabled:T,children:[(0,t.jsx)(C.SelectTrigger,{id:e,className:"w-full max-w-sm",children:(0,t.jsx)(C.SelectValue,{placeholder:"Select language…"})}),(0,t.jsxs)(C.SelectContent,{children:[M.top.length>0&&(0,t.jsxs)(C.SelectGroup,{children:[(0,t.jsx)(C.SelectLabel,{children:"Common"}),M.top.map(e=>(0,t.jsxs)(C.SelectItem,{value:e.code,children:[e.nativeName,e.nativeName!==e.englishName&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ",e.englishName]})]},e.code))]}),M.more.length>0&&(0,t.jsxs)(C.SelectGroup,{children:[(0,t.jsx)(C.SelectLabel,{children:"More languages"}),M.more.map(e=>(0,t.jsxs)(C.SelectItem,{value:e.code,children:[e.nativeName,e.nativeName!==e.englishName&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ",e.englishName]})]},e.code))]})]})]});return(0,t.jsxs)(w.Card,{children:[(0,t.jsx)(w.CardHeader,{children:(0,t.jsxs)(w.CardTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),"Voice Mode"]})}),(0,t.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Transcribe inbound voice messages (Telegram voice / WhatsApp PTT / Discord audio / Slack audio file) locally with Whisper before they reach the agent. Audio bytes never leave the host. See"," ",(0,t.jsx)("code",{children:"docs/design/appendices/voice-transcription.md"})," for implementation details."]}),(0,t.jsx)(A,{status:y,modelOnDisk:y?.modelOnDisk??!1,upgradeAvailable:E,installing:T,waitingForRestart:n,onDelete:v,deleteDisabled:r}),B&&(0,t.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:B}),E&&(0,t.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2 text-xs",children:[(0,t.jsx)("p",{className:"font-medium text-amber-700 dark:text-amber-400",children:"Upgrade voice model"}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["The configured model"," ",(0,t.jsx)("code",{children:y?.model})," is not yet downloaded — likely because a package update changed the default. Click"," ",(0,t.jsx)("strong",{children:"Upgrade & install"})," below to fetch it. Inbound voice will keep using the previous model until then."]})]}),!k&&!T&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"voice-primary-language",className:"text-sm font-medium",children:"Your primary spoken language"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Used as the fallback when Whisper's automatic language detection fails on a clip. Other languages are still transcribed correctly when detected — this only kicks in when detection is uncertain."})]}),F("voice-primary-language")]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm",children:["Status:"," ",(0,t.jsx)("span",{className:"font-medium",children:T?n?"Restarting daemon to apply…":D?.phase==="ready"?"Finalizing…":D?.currentFile?`Downloading ${D.currentFile}…`:"Starting model download…":k?E?"Enabled (upgrade available)":"Enabled":"Disabled"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:k?"Inbound audio is transcribed locally before it reaches the agent. You can change your primary language below at any time.":"Turning this on downloads the Whisper weights (~800 MB), then auto-restarts the daemon so the transcriber picks up the new flag. First download takes a minute or two, depending on your connection."})]}),(0,t.jsx)(j.Button,{size:"sm",variant:k&&!E?"outline":"default",onClick:b,disabled:r||T||k&&!E||null===m,children:T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Loader2,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Working…"]}):E?"Upgrade & install":k?"Enabled":"Enable & install"})]}),k&&!T&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"voice-primary-language-live",className:"text-sm font-medium",children:"Primary spoken language"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Saved changes apply to the next inbound voice attachment — no daemon restart needed."})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[F("voice-primary-language-live"),(0,t.jsx)(j.Button,{size:"sm",variant:"outline",disabled:r||null===m||m===y?.primaryLanguage,onClick:()=>{m&&N(m)},children:"Save"})]})]}),T&&!n&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:(0,S.cn)("h-full bg-primary transition-[width] duration-200",(!D||0===D.percent)&&"animate-pulse"),style:{width:`${Math.min(100,Math.max(D?.percent??0,D?2:8))}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{children:[D&&D.totalBytes>0?`${L(D.loadedBytes)} / ${L(D.totalBytes)}`:"Contacting Hugging Face…",D&&D.filesDownloaded>0&&(0,t.jsxs)(t.Fragment,{children:[" · ",D.filesDownloaded," file",1===D.filesDownloaded?"":"s"," complete"]})]}),(0,t.jsx)("span",{children:D&&D.percent>0?`${Math.round(D.percent)}%`:""})]})]})]})]})}function A({status:e,modelOnDisk:a,upgradeAvailable:i,installing:n,waitingForRestart:c,onDelete:u,deleteDisabled:x}){let p=e?.model??"onnx-community/whisper-large-v3-turbo",h=e?.modelSizeBytes??0,g=e?.modelDir??null,f=n?"installing":i?"upgrade":a?"installed":"missing",y={installing:{container:"border-border bg-muted/30",pill:"bg-muted text-foreground",iconBg:"text-muted-foreground"},upgrade:{container:"border-amber-500/40 bg-amber-500/5",pill:"bg-amber-500/15 text-amber-700 dark:text-amber-400",iconBg:"text-amber-600 dark:text-amber-400"},installed:{container:"border-emerald-500/40 bg-emerald-500/5",pill:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",iconBg:"text-emerald-600 dark:text-emerald-400"},missing:{container:"border-border bg-muted/30",pill:"bg-muted text-muted-foreground",iconBg:"text-muted-foreground"}}[f],b="installing"===f?(0,t.jsx)(d.Loader2,{className:(0,S.cn)("h-4 w-4 animate-spin",y.iconBg)}):"installed"===f?(0,t.jsx)(r.CheckCircle2,{className:(0,S.cn)("h-4 w-4",y.iconBg)}):"upgrade"===f?(0,t.jsx)(s.AlertTriangle,{className:(0,S.cn)("h-4 w-4",y.iconBg)}):(0,t.jsx)(l,{className:(0,S.cn)("h-4 w-4",y.iconBg)}),v="installed"===f&&h>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 tabular-nums",children:[(0,t.jsx)(o,{className:"h-3 w-3"}),L(h)," on disk"]}):"upgrade"===f?(0,t.jsx)("span",{children:"Configured model is not on disk yet."}):"installing"===f?(0,t.jsx)("span",{children:"Downloading weights from Hugging Face…"}):(0,t.jsxs)("span",{children:["Click ",(0,t.jsx)("strong",{children:"Enable & install"})," below to download (~800 MB)."]});return(0,t.jsx)("div",{className:(0,S.cn)("rounded-md border px-3 py-2.5",y.container),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5",children:b}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:(0,S.cn)("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",y.pill),children:"installing"===f?c?"Restarting":"Installing":"installed"===f?"Installed":"upgrade"===f?"Upgrade available":"Not installed"}),(0,t.jsx)("code",{className:"break-all text-xs",children:p})]}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:v}),g&&"installed"===f&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground/70 font-mono break-all",children:g})]}),!n&&("installed"===f||"upgrade"===f)&&(0,t.jsxs)(j.Button,{size:"sm",variant:"ghost",onClick:u,disabled:x,className:"h-7 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(m.Trash2,{className:"h-3 w-3 mr-1"}),"Delete"]})]})})}async function M(e){switch(e){case"reset-config":return f.api.post("/system/reset-config");case"purge-history":return f.api.post("/system/purge-history");case"reinstall-context":return f.api.post("/system/reinstall-context",{confirm:"CLEAN"});case"factory-reset":return f.api.post("/system/factory-reset")}}function F(e,t){switch(e){case"reset-config":t.invalidateQueries({queryKey:["config"]});return;case"purge-history":t.invalidateQueries({queryKey:["conversations"]}),t.invalidateQueries({queryKey:["events"]}),t.invalidateQueries({queryKey:["cost"]});return;case"reinstall-context":t.invalidateQueries({queryKey:["context"]}),t.invalidateQueries({queryKey:["setup-status"]});return;case"factory-reset":t.invalidateQueries();return}}function L(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`}function $(){let[e,r]=(0,a.useState)(!1),[n,l]=(0,a.useState)(null),[o,d]=(0,a.useState)(null),[c,h]=(0,a.useState)(null),g=(0,R.useConfirm)(),y=(0,p.useQueryClient)(),b=async(e,t)=>{if(await g({title:t.title,description:t.description,confirmLabel:t.confirmLabel,variant:"destructive"})&&(!t.doubleConfirm||await g({title:t.doubleConfirm.title,description:t.doubleConfirm.description,confirmLabel:t.doubleConfirm.confirmLabel,variant:"destructive",requireText:t.doubleConfirm.requireText}))){l(e),d(null),h(null);try{let a=await M(e);F(e,y),h(t.successMessage(a))}catch(e){d(e instanceof f.ApiError?e.message:"Request failed")}finally{l(null)}}};return(0,t.jsx)(k.Collapsible,{open:e,onOpenChange:r,children:(0,t.jsxs)(w.Card,{className:"border-destructive/40",children:[(0,t.jsx)(k.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)(w.CardHeader,{className:"cursor-pointer select-none",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.ChevronRight,{className:(0,S.cn)("h-4 w-4 text-destructive transition-transform",e&&"rotate-90")}),(0,t.jsx)(s.AlertTriangle,{className:"h-4 w-4 text-destructive"}),(0,t.jsx)(w.CardTitle,{className:"text-destructive",children:"Danger Zone"})]})})}),(0,t.jsx)(k.CollapsibleContent,{children:(0,t.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground max-w-prose",children:"Destructive actions that cannot be undone. Each action requires confirmation before executing."}),o&&(0,t.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:o}),c&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:c}),(0,t.jsx)(P,{title:"Reset all config to defaults",description:"Restores every runtime setting to its factory default. Bootstrap values in .env (API port, data directory, log level) and integration credentials are preserved.",icon:(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reset config",busy:"reset-config"===n,disabled:null!==n,onClick:()=>b("reset-config",{title:"Reset all config to defaults?",description:"Restores every runtime setting in the database to its factory default. Bootstrap values in .env (API port, data directory, log level) and integration credentials are preserved.",confirmLabel:"Reset config",successMessage:e=>`Cleared ${e.cleared??0} runtime setting(s).`})}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Delete all sessions and history",description:"Permanently removes all non-active conversation sessions, messages, action logs, observations, notification logs, MD snapshots, and scheduled tasks. The active session is preserved.",icon:(0,t.jsx)(m.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Delete history",busy:"purge-history"===n,disabled:null!==n,onClick:()=>b("purge-history",{title:"Delete all sessions and history?",description:"Permanently removes every non-active conversation session, message, action log, observation, notification log, MD snapshot, and scheduled task. The active session is preserved.",confirmLabel:"Delete history",successMessage:e=>`Deleted ${e.deletedSessions??0} session(s), ${e.deletedMessages??0} message(s), ${e.deletedActions??0} action(s).`})}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Reinstall context",description:"Writes a tarball backup first, then wipes context/ (including policies/management.md) and md_file_snapshots. Conversation history, settings, and credentials are preserved. Restart the daemon to re-seed the vault from templates.",icon:(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reinstall context",busy:"reinstall-context"===n,disabled:null!==n,onClick:()=>(async()=>{l("reinstall-context"),d(null),h(null);try{let e,t=await f.api.get("/system/reinstall-context/plan");if(!await g({title:"Clean reinstall of context/ (B-007)?",description:(e=t.ancillaryDirs.length>0?`Ancillary caches to remove: ${t.ancillaryDirs.join(", ")}.`:"No ancillary caches are scheduled for removal.",[`This will remove ${t.fileCount} file(s) (${L(t.totalBytes)}) from ${t.contextDir}, clear ${t.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,e,`Backup tarball path: ${t.backupPath}`].join(" ")),confirmLabel:"Continue",variant:"destructive"})||!await g({title:"Type CLEAN to confirm",description:`Backup tarball: ${t.backupPath}. Proceed to remove ${t.fileCount} file(s) and clear ${t.snapshotRowCount} snapshot row(s).`,confirmLabel:"Reinstall context",variant:"destructive",requireText:"CLEAN"}))return;let a=await M("reinstall-context");F("reinstall-context",y),h(`Reinstalled. Removed ${a.filesDeleted??0} file(s), cleared ${a.snapshotRowsDeleted??0} snapshot row(s). Backup at ${a.backupPath??t.backupPath}.`)}catch(e){d(e instanceof f.ApiError?e.message:"Request failed")}finally{l(null)}})()}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Factory reset",description:"Wipe everything: history, settings, context, credentials, encrypted blobs, attachments, session workdirs, backups, caches, user skills, integrations, backend configs, mail accounts, and recurring schedules. The SQLite DB is compacted afterward.",icon:(0,t.jsx)(x.Zap,{className:"h-3.5 w-3.5 mr-1"}),label:"Factory reset",busy:"factory-reset"===n,disabled:null!==n,onClick:()=>b("factory-reset",{title:"Factory reset — really?",description:"Wipes everything on this device: conversation history, action logs, runtime settings, context files (including policies/management.md), keychain secrets, encrypted blobs, uploaded attachments, session and skill-optimizer workdirs, all backups, caches, user skills, the managed Codex Azure config, the Whisper model cache, and every user-data table (backends, mail accounts, recurring schedules, receipts, books, travel bookings, runtime state, auth telemetry). The SQLite DB is compacted afterward; restart the daemon to re-bootstrap observers and adapters.",confirmLabel:"Continue",doubleConfirm:{title:"Final confirmation",description:"There is no undo. Type the confirmation phrase below to proceed.",confirmLabel:"Factory reset",requireText:"RESET EVERYTHING"},successMessage:e=>{let t="string"==typeof e.status?e.status:"reset",a=Array.isArray(e.errors)?e.errors.length:0,s=Array.isArray(e.adapterReloadErrors)?e.adapterReloadErrors.length:0;return"reset_with_errors"===t||a>0||s>0?`Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${a} reset step warning(s), ${s} adapter reload warning(s).)`:"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters."}})})]})})]})})}function P({title:e,description:a,icon:s,label:r,busy:i,disabled:n,onClick:l}){return(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]}),(0,t.jsxs)(j.Button,{variant:"destructive",size:"sm",onClick:l,disabled:n,className:"shrink-0",children:[s,i?"Working...":r]})]})}e.s(["default",0,function(){let{data:e}=(0,y.useConfig)(),{toast:s,showToast:r}=(0,b.useSaveConfig)(),{deferSaveFor:i,dv:n,dirtyFields:l,clearDirtyKeys:o}=(0,v.useDirtyFields)(),d=(0,p.useQueryClient)(),c=(0,R.useConfirm)(),[m,x]=(0,a.useState)(!1),h=async()=>{if(await c({title:"Reset disallowed tools to defaults?",description:"This will restore the default safety tool list, replacing any customizations.",confirmLabel:"Reset",variant:"destructive"})){x(!0);try{await f.api.post("/config/reset-safety"),d.invalidateQueries({queryKey:["config"]}),o(["disallowedTools","allowedToolsOverride"]),r("success","Safety tools reset to defaults")}finally{x(!1)}}};if(!e)return(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."});let g=i(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.PageHeader,{title:"Advanced",description:"Power-user knobs and safety settings. Most of these are low-level — read each description carefully before saving."}),(0,t.jsx)(B.SettingsToast,{toast:s}),(0,t.jsxs)(w.Card,{children:[(0,t.jsx)(w.CardHeader,{children:(0,t.jsx)(w.CardTitle,{children:"Safety — Tool Policy"})}),(0,t.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Guardrails applied to every backend’s tool calls, enforced before each call runs. Entries are either a plain tool name (",(0,t.jsx)("code",{children:"Write"}),", ",(0,t.jsx)("code",{children:"WebFetch"}),") or a tool name with an argument pattern in parentheses (",(0,t.jsx)("code",{children:"Bash(rm -rf *)"}),") to match only specific invocations."," ",(0,t.jsx)("strong",{children:"Disallowed wins over allowed"})," — any match in the disallowed list blocks the call even if the allowed override would otherwise permit it. The per-backend Safe / Allow toggle lives in"," ",(0,t.jsx)("strong",{children:"Models & Cost → Execution Mode"}),"."]}),(0,t.jsx)(D.EditableArrayField,{label:"Disallowed Tools",values:n("disallowedTools",e.disallowedTools),configKey:"disallowedTools",variant:"red",placeholder:"e.g. Bash(rm -rf *)",modified:l.has("disallowedTools"),onSave:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:"Tools the agent is forbidden from calling. The defaults block destructive shell commands and dangerous file operations. Use Reset to Defaults below to restore them after experimenting."}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(D.EditableArrayField,{label:"Allowed Tools Override",values:n("allowedToolsOverride",e.allowedTools),configKey:"allowedToolsOverride",variant:"green",placeholder:"e.g. Bash(git push)",modified:l.has("allowedToolsOverride"),onSave:g}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground -mt-1",children:["Narrow exceptions to the disallowed list. Use this to permit a specific safe invocation of an otherwise-blocked tool — for example, allow ",(0,t.jsx)("code",{children:"Bash(git push)"})," while keeping arbitrary"," ",(0,t.jsx)("code",{children:"Bash"})," blocked."]}),(0,t.jsx)(T.Separator,{}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:h,disabled:m,children:[(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),m?"Resetting...":"Reset to Defaults"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Restores the built-in disallowed-tool list and"," ",(0,t.jsx)("strong",{children:"clears the allowed override list"}),", replacing any customizations in both. Use this when your safety config has drifted and you want a clean slate."]})]})]}),(0,t.jsx)(E,{}),(0,t.jsx)($,{})]})}],34409)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74490,e=>{"use strict";var t=e.i(54710),a=e.i(81471);let s=(0,e.i(94237).cva)("rounded-xl border p-5 shadow-[0_1px_3px_rgb(0_0_0/0.04)]",{variants:{tone:{default:"border-border bg-card",warning:"border-amber-200 bg-amber-50/50 dark:border-amber-900 dark:bg-amber-950/30",success:"border-emerald-200 bg-emerald-50/50 dark:border-emerald-900 dark:bg-emerald-950/30",error:"border-red-200 bg-red-50/50 dark:border-red-900 dark:bg-red-950/30"},interactive:{true:"transition-shadow duration-150 hover:shadow-[0_4px_6px_rgb(0_0_0/0.06)]",false:""}},defaultVariants:{tone:"default",interactive:!1}});e.s(["Card",0,function({className:e,tone:r,interactive:i,...n}){return(0,t.jsx)("div",{className:(0,a.cn)(s({tone:r,interactive:i}),e),...n})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("mb-3 flex items-center justify-between",e),...s})},"CardStatLabel",0,function({className:e,...s}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-sm font-medium text-muted-foreground",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("h3",{className:(0,a.cn)("text-lg font-semibold text-foreground",e),...s})},"CardValue",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("text-3xl font-bold text-foreground",e),...s})}])},39982,e=>{"use strict";var t=e.i(54710),a=e.i(81471);e.s(["PageHeader",0,function({title:e,description:s,icon:r,badge:i,actions:n,children:l,className:o}){return(0,t.jsxs)("header",{className:(0,a.cn)("flex flex-col gap-1",o),children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[r&&(0,t.jsx)(r,{className:"h-5 w-5 text-muted-foreground"}),(0,t.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e}),i]}),n&&(0,t.jsx)("div",{className:"flex items-center gap-2",children:n})]}),s&&(0,t.jsx)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:s}),l]})}])},70986,e=>{"use strict";var t=e.i(34416),a=e.i(91967),s=e.i(9413),r=e.i(36567),i=e.i(18731),n=e.i(22353),l=e.i(85565),o=e.i(90816),d=e.i(11207),c=e.i(54710),u="Collapsible",[m,x]=(0,s.createContextScope)(u),[p,h]=m(u),g=t.forwardRef((e,a)=>{let{__scopeCollapsible:s,open:i,defaultOpen:n,disabled:o,onOpenChange:m,...x}=e,[h,g]=(0,r.useControllableState)({prop:i,defaultProp:n??!1,onChange:m,caller:u});return(0,c.jsx)(p,{scope:s,disabled:o,contentId:(0,d.useId)(),open:h,onOpenToggle:t.useCallback(()=>g(e=>!e),[g]),children:(0,c.jsx)(l.Primitive.div,{"data-state":w(h),"data-disabled":o?"":void 0,...x,ref:a})})});g.displayName=u;var f="CollapsibleTrigger",y=t.forwardRef((e,t)=>{let{__scopeCollapsible:s,...r}=e,i=h(f,s);return(0,c.jsx)(l.Primitive.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:(0,a.composeEventHandlers)(e.onClick,i.onOpenToggle)})});y.displayName=f;var b="CollapsibleContent",v=t.forwardRef((e,t)=>{let{forceMount:a,...s}=e,r=h(b,e.__scopeCollapsible);return(0,c.jsx)(o.Presence,{present:a||r.open,children:({present:e})=>(0,c.jsx)(j,{...s,ref:t,present:e})})});v.displayName=b;var j=t.forwardRef((e,a)=>{let{__scopeCollapsible:s,present:r,children:o,...d}=e,u=h(b,s),[m,x]=t.useState(r),p=t.useRef(null),g=(0,n.useComposedRefs)(a,p),f=t.useRef(0),y=f.current,v=t.useRef(0),j=v.current,N=u.open||m,k=t.useRef(N),C=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,i.useLayoutEffect)(()=>{let e=p.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,k.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),x(r)}},[u.open,r]),(0,c.jsx)(l.Primitive.div,{"data-state":w(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!N,...d,ref:g,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:N&&o})});function w(e){return e?"open":"closed"}e.s(["Collapsible",0,g,"CollapsibleContent",0,v,"CollapsibleTrigger",0,y],70986)},21682,e=>{"use strict";let t=(0,e.i(77379).default)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],21682)},90925,e=>{"use strict";let t=(0,e.i(77379).default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],90925)},60168,e=>{"use strict";let t=(0,e.i(77379).default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],60168)},99758,e=>{"use strict";let t=(0,e.i(77379).default)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],99758)},55575,e=>{"use strict";let t=(0,e.i(77379).default)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],55575)},66127,e=>{"use strict";var t=e.i(65268);async function a({title:e,defaultPath:s}){let r=await t.api.post("/system/pick-directory",{title:e,...s?{defaultPath:s}:{}});if("selected"===r.status&&r.path)return r.path;if("cancelled"===r.status)return null;throw Error(r.message??"Folder picker is unavailable.")}e.s(["pickDirectoryFromDesktop",0,a])},25795,e=>{"use strict";let t=(0,e.i(77379).default)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],25795)},82239,e=>{"use strict";var t=e.i(54710),a=e.i(25795),s=e.i(10628);e.s(["RestartRequiredBadge",0,function(){return(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsx)(s.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-amber-100 px-1 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:[(0,t.jsx)(a.RotateCcw,{className:"h-2.5 w-2.5"}),"restart"]})}),(0,t.jsx)(s.TooltipContent,{side:"top",className:"max-w-[220px] text-xs",children:"Changing this value requires a daemon restart to take effect."})]})}])},49681,e=>{"use strict";var t=e.i(54710),a=e.i(7771),s=e.i(95486),r=e.i(8011),i=e.i(10628),n=e.i(81471);e.s(["DocsHelpInline",0,function({docId:e,anchor:l=null,label:o,className:d}){let c=(0,s.useQueryClient)(),u=o??"Help";return(0,t.jsx)(i.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(i.Tooltip,{children:[(0,t.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),(0,r.openDocsHelpSlideover)(c,{docId:e,anchor:l,autoFocusComposer:!1})},className:(0,n.cn)("inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 transition hover:bg-accent hover:text-foreground",d),"aria-label":`Open help — ${u}`,"data-testid":"docs-help-inline",children:(0,t.jsx)(a.HelpCircle,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),(0,t.jsx)(i.TooltipContent,{side:"top",children:(0,t.jsx)("span",{children:u})})]})})}])},88,e=>{"use strict";var t=e.i(54710),a=e.i(34416),s=e.i(99758),r=e.i(55575),i=e.i(21682),n=e.i(60168),l=e.i(25795),o=e.i(90925),d=e.i(36451);e.i(18446);var c=e.i(28444),u=e.i(48467),m=e.i(20014),x=e.i(74490),p=e.i(8652),h=e.i(82239),g=e.i(49681),f=e.i(66127),y=e.i(36413);let b=new Set(c.RESTART_REQUIRED_KEY_TUPLE);function v(e){return null===e?"":String(e)}e.s(["ConfigSection",0,function({title:e,children:a,helpDocId:s,helpAnchor:r}){return(0,t.jsxs)(x.Card,{children:[(0,t.jsx)(x.CardHeader,{children:(0,t.jsxs)(x.CardTitle,{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{children:e}),s&&(0,t.jsx)(g.DocsHelpInline,{docId:s,anchor:r??null,label:e})]})}),(0,t.jsx)("div",{className:"space-y-0.5 [&>p]:max-w-prose",children:a})]})},"EditableArrayField",0,function({label:e,values:s,configKey:i,variant:l="gray",placeholder:o="Add item...",directoryPicker:c,modified:x,onSave:g}){let y=b.has(i),[v,j]=(0,a.useState)(""),[w,N]=(0,a.useState)(!1),[k,C]=(0,a.useState)(null),T=async()=>{let e=v.trim();if(!(!e||s.includes(e))){N(!0),C(null);try{await g(i,[...s,e]),j("")}catch{}finally{N(!1)}}},R=async e=>{N(!0);try{await g(i,s.filter(t=>t!==e))}finally{N(!1)}},S=async()=>{if(c){N(!0),C(null);try{let e=await (0,f.pickDirectoryFromDesktop)({title:c.title,defaultPath:v.trim()||c.defaultPath});if(!e)return;if(s.includes(e)){j(e),C("That directory is already in the list.");return}await g(i,[...s,e]),j("")}catch(e){C(e instanceof Error?e.message:"Folder picker is unavailable.")}finally{N(!1)}}};return(0,t.jsxs)("div",{className:`py-2${x?" border-l-2 border-blue-500 pl-2 -ml-1 rounded":""}`,"data-config-key":i,children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mb-2 inline-flex items-center gap-1.5",children:[e,y&&(0,t.jsx)(h.RestartRequiredBadge,{}),x&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[s.map(e=>(0,t.jsxs)(u.Badge,{variant:l,className:"gap-1 pr-1",children:[e,(0,t.jsx)("button",{onClick:()=>R(e),disabled:w,className:"ml-0.5 rounded-sm hover:bg-black/10 dark:hover:bg-white/10 p-0.5 transition-colors",children:(0,t.jsx)(d.X,{className:"h-3 w-3"})})]},e)),0===s.length&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground italic",children:"No items"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.Input,{value:v,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key&&T()},placeholder:o,className:"max-w-[320px]",disabled:w}),c&&(0,t.jsxs)(m.Button,{size:"sm",variant:"outline",onClick:S,disabled:w,children:[(0,t.jsx)(r.FolderOpen,{className:"h-3.5 w-3.5 mr-1"}),c.buttonLabel??"Choose"]}),(0,t.jsxs)(m.Button,{size:"sm",variant:"outline",onClick:T,disabled:!v.trim()||w,children:[(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5 mr-1"}),"Add"]})]}),k&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive",children:k})]})},"EditableBooleanField",0,function({label:e,value:s,configKey:r,description:i,modified:n,defaultValue:o,onSave:d}){let[c,u]=(0,a.useState)(!1),x=b.has(r),p=void 0!==o&&s===o,g=async()=>{u(!0);try{await d(r,!s)}finally{u(!1)}},f=async()=>{if(void 0!==o){u(!0);try{await d(r,o)}finally{u(!1)}}};return(0,t.jsx)("div",{className:`py-1.5 group${n?" border-l-2 border-blue-500 pl-2 -ml-1 rounded":""}`,"data-config-key":r,children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e,x&&(0,t.jsx)(h.RestartRequiredBadge,{}),n&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"}),void 0!==o&&!p&&!n&&(0,t.jsxs)("button",{type:"button",onClick:f,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(l.RotateCcw,{className:"h-2.5 w-2.5"}),"reset"]})]}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:i})]}),(0,t.jsx)(m.Button,{variant:s?"default":"outline",size:"sm",onClick:g,disabled:c,children:s?"Enabled":"Disabled"})]})})},"EditableField",0,function({label:e,value:r,configKey:n,type:c="text",suffix:u,description:x,min:g,max:f,nullable:j=!1,emptyLabel:w="Not set",modified:N,defaultValue:k,onSave:C}){let T=b.has(n),[R,S]=(0,a.useState)(!1),[D,B]=(0,a.useState)(v(r)),[E,A]=(0,a.useState)(!1),[M,F]=(0,a.useState)(null),L=(0,a.useRef)(null),$=(0,y.useDiscardGeneration)(),P=(0,a.useRef)($);(0,a.useEffect)(()=>{$!==P.current&&(P.current=$,S(!1),F(null))},[$]),(0,a.useEffect)(()=>{R&&L.current?.focus()},[R]),(0,a.useEffect)(()=>{R||B(v(r))},[r,R]);let q=void 0!==k&&r===k,O=async e=>{if(e.stopPropagation(),void 0!==k){A(!0);try{await C(n,k)}finally{A(!1)}}},_=async e=>{e.stopPropagation(),A(!0);try{await C(n,null)}finally{A(!1)}},I=async()=>{let e=D.trim(),t=j&&""===e?null:"number"===c?Number(D):D;if(t===r)return void S(!1);if(null!==t&&"number"===c&&(void 0!==g||void 0!==f)&&(void 0!==g&&t<g||void 0!==f&&t>f))return void F(`Must be ${g??""}–${f??""}`);F(null),A(!0);try{await C(n,t),S(!1)}catch{}finally{A(!1)}};return R?(0,t.jsxs)("div",{className:"py-1.5","data-config-key":n,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground shrink-0 min-w-[140px] inline-flex items-center gap-1.5",children:[e,T&&(0,t.jsx)(h.RestartRequiredBadge,{})]}),(0,t.jsx)(p.Input,{ref:L,type:c,value:D,onChange:e=>{B(e.target.value),F(null)},onKeyDown:e=>{"Enter"===e.key&&I(),"Escape"===e.key&&(B(v(r)),S(!1))},className:"max-w-[240px]",disabled:E,min:g,max:f}),u&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),(0,t.jsx)(m.Button,{size:"sm",variant:"ghost",onClick:I,disabled:E,className:"h-7 w-7 p-0",children:(0,t.jsx)(s.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(m.Button,{size:"sm",variant:"ghost",onClick:()=>{B(v(r)),F(null),S(!1)},className:"h-7 w-7 p-0",children:(0,t.jsx)(d.X,{className:"h-3.5 w-3.5"})})]}),M&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-1 ml-[148px]",children:M}),x&&!M&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 ml-[148px]",children:x})]}):(0,t.jsxs)("div",{className:`py-1.5 group cursor-pointer rounded px-1 -mx-1 hover:bg-muted/50 transition-colors${N?" border-l-2 border-blue-500 pl-2":""}`,"data-config-key":n,onClick:()=>S(!0),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e,T&&(0,t.jsx)(h.RestartRequiredBadge,{})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[N&&(0,t.jsx)("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"modified"}),void 0!==k&&!q&&!N&&(0,t.jsxs)("button",{type:"button",onClick:O,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(l.RotateCcw,{className:"h-2.5 w-2.5"}),"reset"]}),j&&null!==r&&!N&&(0,t.jsxs)("button",{type:"button",onClick:_,title:`Clear — sets ${e} to ${w}`,className:"text-[10px] text-muted-foreground hover:text-destructive transition-colors inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:[(0,t.jsx)(o.Trash2,{className:"h-2.5 w-2.5"}),"clear"]}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:null===r?w:"$"===u?`$${r}`:u?`${r} ${u}`:String(r)}),(0,t.jsx)(i.Pencil,{className:"h-3 w-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:x})]})}])},54879,e=>{"use strict";let t=(0,e.i(77379).default)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",0,t],54879)},34409,e=>{"use strict";var t=e.i(54710),a=e.i(34416),s=e.i(81187),r=e.i(59546),i=e.i(96263),n=e.i(77379);let l=(0,n.default)("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),o=(0,n.default)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);var d=e.i(72740);let c=(0,n.default)("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);var u=e.i(25795),m=e.i(90925),x=e.i(54879),p=e.i(95486),h=e.i(14260);e.i(18446);var g=e.i(17900),f=e.i(65268),y=e.i(88423),b=e.i(13451),v=e.i(36413),j=e.i(20014),w=e.i(74490),N=e.i(39982),k=e.i(70986),C=e.i(10427),T=e.i(57628),R=e.i(90826),S=e.i(81471),D=e.i(88),B=e.i(94328);function E(){let e=(0,p.useQueryClient)(),s=(0,R.useConfirm)(),[r,i]=(0,a.useState)(!1),[n,l]=(0,a.useState)(!1),[o,u]=(0,a.useState)(null),[m,x]=(0,a.useState)(null),{data:y}=(0,h.useQuery)({queryKey:["voice-status"],queryFn:async()=>{try{return await f.api.get("/voice/status")}catch(e){if(n)return{enabled:!1,installing:!0,installed:!0,modelOnDisk:!1,modelSizeBytes:0,modelDir:"",status:"running",error:null,startedAt:null,finishedAt:null,model:"onnx-community/whisper-large-v3-turbo",progress:null,primaryLanguage:null,suggestedPrimaryLanguage:"en"};throw e}},refetchInterval:e=>{let t=e.state.data;return!!(n||t?.installing||t?.status==="running")&&1500},refetchOnWindowFocus:!1});(0,a.useEffect)(()=>{if(!y)return;let e=y.primaryLanguage??y.suggestedPrimaryLanguage;x(t=>t??e)},[y?.primaryLanguage,y?.suggestedPrimaryLanguage,y]),(0,a.useEffect)(()=>{n&&y?.enabled&&(l(!1),e.invalidateQueries({queryKey:["config"]}))},[n,y?.enabled,e]),(0,a.useEffect)(()=>{y?.status!=="ready"||y.enabled||l(!0)},[y?.status,y?.enabled]);let b=async()=>{u(null),i(!0);try{await f.api.post("/voice/install",{primaryLanguage:m}),await e.invalidateQueries({queryKey:["voice-status"]})}catch(e){u(e instanceof f.ApiError?e.message:"Install failed")}finally{i(!1)}},v=async()=>{if(await s({title:"Delete the local Whisper model?",description:'Removes the on-disk Whisper weights (~800 MB). Voice mode stays enabled — click "Upgrade & install" afterwards to download the model again. Use this when an install attempt failed and the dashboard is stuck on an error banner.',confirmLabel:"Delete model",variant:"destructive"})){u(null),i(!0);try{await f.api.delete("/voice/model"),await e.invalidateQueries({queryKey:["voice-status"]})}catch(e){u(e instanceof f.ApiError?e.message:"Deleting voice model failed")}finally{i(!1)}}},N=async t=>{u(null),i(!0);try{await f.api.patch("/config",{voiceTranscriptionPrimaryLanguage:t}),x(t),await e.invalidateQueries({queryKey:["voice-status"]}),await e.invalidateQueries({queryKey:["config"]})}catch(e){u(e instanceof f.ApiError?e.message:"Saving primary language failed")}finally{i(!1)}},k=y?.enabled??!1,T=r||(y?.installing??!1)||n,D=y?.progress??null,B=o??y?.error??null,E=k&&y?.modelOnDisk===!1&&!T,M=(0,a.useMemo)(()=>{let e=new Set(g.VOICE_LANGUAGE_TOP.map(e=>e.code)),t=g.VOICE_LANGUAGE_FULL.filter(t=>!e.has(t.code)).slice().sort((e,t)=>e.englishName.localeCompare(t.englishName));return{top:g.VOICE_LANGUAGE_TOP,more:t}},[]),F=e=>(0,t.jsxs)(C.Select,{value:m??void 0,onValueChange:e=>x(e),disabled:T,children:[(0,t.jsx)(C.SelectTrigger,{id:e,className:"w-full max-w-sm",children:(0,t.jsx)(C.SelectValue,{placeholder:"Select language…"})}),(0,t.jsxs)(C.SelectContent,{children:[M.top.length>0&&(0,t.jsxs)(C.SelectGroup,{children:[(0,t.jsx)(C.SelectLabel,{children:"Common"}),M.top.map(e=>(0,t.jsxs)(C.SelectItem,{value:e.code,children:[e.nativeName,e.nativeName!==e.englishName&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ",e.englishName]})]},e.code))]}),M.more.length>0&&(0,t.jsxs)(C.SelectGroup,{children:[(0,t.jsx)(C.SelectLabel,{children:"More languages"}),M.more.map(e=>(0,t.jsxs)(C.SelectItem,{value:e.code,children:[e.nativeName,e.nativeName!==e.englishName&&(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ",e.englishName]})]},e.code))]})]})]});return(0,t.jsxs)(w.Card,{children:[(0,t.jsx)(w.CardHeader,{children:(0,t.jsxs)(w.CardTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(c,{className:"h-4 w-4"}),"Voice Mode"]})}),(0,t.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Transcribe inbound voice messages (Telegram voice / WhatsApp PTT / Discord audio / Slack audio file) locally with Whisper before they reach the agent. Audio bytes never leave the host. See"," ",(0,t.jsx)("code",{children:"docs/design/appendices/voice-transcription.md"})," for implementation details."]}),(0,t.jsx)(A,{status:y,modelOnDisk:y?.modelOnDisk??!1,upgradeAvailable:E,installing:T,waitingForRestart:n,onDelete:v,deleteDisabled:r}),B&&(0,t.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:B}),E&&(0,t.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2 text-xs",children:[(0,t.jsx)("p",{className:"font-medium text-amber-700 dark:text-amber-400",children:"Upgrade voice model"}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["The configured model"," ",(0,t.jsx)("code",{children:y?.model})," is not yet downloaded — likely because a package update changed the default. Click"," ",(0,t.jsx)("strong",{children:"Upgrade & install"})," below to fetch it. Inbound voice will keep using the previous model until then."]})]}),!k&&!T&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"voice-primary-language",className:"text-sm font-medium",children:"Your primary spoken language"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Used as the fallback when Whisper's automatic language detection fails on a clip. Other languages are still transcribed correctly when detected — this only kicks in when detection is uncertain."})]}),F("voice-primary-language")]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm",children:["Status:"," ",(0,t.jsx)("span",{className:"font-medium",children:T?n?"Restarting daemon to apply…":D?.phase==="ready"?"Finalizing…":D?.currentFile?`Downloading ${D.currentFile}…`:"Starting model download…":k?E?"Enabled (upgrade available)":"Enabled":"Disabled"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:k?"Inbound audio is transcribed locally before it reaches the agent. You can change your primary language below at any time.":"Turning this on downloads the Whisper weights (~800 MB), then auto-restarts the daemon so the transcriber picks up the new flag. First download takes a minute or two, depending on your connection."})]}),(0,t.jsx)(j.Button,{size:"sm",variant:k&&!E?"outline":"default",onClick:b,disabled:r||T||k&&!E||null===m,children:T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.Loader2,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Working…"]}):E?"Upgrade & install":k?"Enabled":"Enable & install"})]}),k&&!T&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"voice-primary-language-live",className:"text-sm font-medium",children:"Primary spoken language"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Saved changes apply to the next inbound voice attachment — no daemon restart needed."})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[F("voice-primary-language-live"),(0,t.jsx)(j.Button,{size:"sm",variant:"outline",disabled:r||null===m||m===y?.primaryLanguage,onClick:()=>{m&&N(m)},children:"Save"})]})]}),T&&!n&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("div",{className:(0,S.cn)("h-full bg-primary transition-[width] duration-200",(!D||0===D.percent)&&"animate-pulse"),style:{width:`${Math.min(100,Math.max(D?.percent??0,D?2:8))}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{children:[D&&D.totalBytes>0?`${L(D.loadedBytes)} / ${L(D.totalBytes)}`:"Contacting Hugging Face…",D&&D.filesDownloaded>0&&(0,t.jsxs)(t.Fragment,{children:[" · ",D.filesDownloaded," file",1===D.filesDownloaded?"":"s"," complete"]})]}),(0,t.jsx)("span",{children:D&&D.percent>0?`${Math.round(D.percent)}%`:""})]})]})]})]})}function A({status:e,modelOnDisk:a,upgradeAvailable:i,installing:n,waitingForRestart:c,onDelete:u,deleteDisabled:x}){let p=e?.model??"onnx-community/whisper-large-v3-turbo",h=e?.modelSizeBytes??0,g=e?.modelDir??null,f=n?"installing":i?"upgrade":a?"installed":"missing",y={installing:{container:"border-border bg-muted/30",pill:"bg-muted text-foreground",iconBg:"text-muted-foreground"},upgrade:{container:"border-amber-500/40 bg-amber-500/5",pill:"bg-amber-500/15 text-amber-700 dark:text-amber-400",iconBg:"text-amber-600 dark:text-amber-400"},installed:{container:"border-emerald-500/40 bg-emerald-500/5",pill:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",iconBg:"text-emerald-600 dark:text-emerald-400"},missing:{container:"border-border bg-muted/30",pill:"bg-muted text-muted-foreground",iconBg:"text-muted-foreground"}}[f],b="installing"===f?(0,t.jsx)(d.Loader2,{className:(0,S.cn)("h-4 w-4 animate-spin",y.iconBg)}):"installed"===f?(0,t.jsx)(r.CheckCircle2,{className:(0,S.cn)("h-4 w-4",y.iconBg)}):"upgrade"===f?(0,t.jsx)(s.AlertTriangle,{className:(0,S.cn)("h-4 w-4",y.iconBg)}):(0,t.jsx)(l,{className:(0,S.cn)("h-4 w-4",y.iconBg)}),v="installed"===f&&h>0?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 tabular-nums",children:[(0,t.jsx)(o,{className:"h-3 w-3"}),L(h)," on disk"]}):"upgrade"===f?(0,t.jsx)("span",{children:"Configured model is not on disk yet."}):"installing"===f?(0,t.jsx)("span",{children:"Downloading weights from Hugging Face…"}):(0,t.jsxs)("span",{children:["Click ",(0,t.jsx)("strong",{children:"Enable & install"})," below to download (~800 MB)."]});return(0,t.jsx)("div",{className:(0,S.cn)("rounded-md border px-3 py-2.5",y.container),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5",children:b}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:(0,S.cn)("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",y.pill),children:"installing"===f?c?"Restarting":"Installing":"installed"===f?"Installed":"upgrade"===f?"Upgrade available":"Not installed"}),(0,t.jsx)("code",{className:"break-all text-xs",children:p})]}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:v}),g&&"installed"===f&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground/70 font-mono break-all",children:g})]}),!n&&("installed"===f||"upgrade"===f)&&(0,t.jsxs)(j.Button,{size:"sm",variant:"ghost",onClick:u,disabled:x,className:"h-7 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(m.Trash2,{className:"h-3 w-3 mr-1"}),"Delete"]})]})})}async function M(e){switch(e){case"reset-config":return f.api.post("/system/reset-config");case"purge-history":return f.api.post("/system/purge-history");case"reinstall-context":return f.api.post("/system/reinstall-context",{confirm:"CLEAN"});case"factory-reset":return f.api.post("/system/factory-reset")}}function F(e,t){switch(e){case"reset-config":t.invalidateQueries({queryKey:["config"]});return;case"purge-history":t.invalidateQueries({queryKey:["conversations"]}),t.invalidateQueries({queryKey:["events"]}),t.invalidateQueries({queryKey:["cost"]});return;case"reinstall-context":t.invalidateQueries({queryKey:["context"]}),t.invalidateQueries({queryKey:["setup-status"]});return;case"factory-reset":t.invalidateQueries();return}}function L(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(1)} GB`}function $(){let[e,r]=(0,a.useState)(!1),[n,l]=(0,a.useState)(null),[o,d]=(0,a.useState)(null),[c,h]=(0,a.useState)(null),g=(0,R.useConfirm)(),y=(0,p.useQueryClient)(),b=async(e,t)=>{if(await g({title:t.title,description:t.description,confirmLabel:t.confirmLabel,variant:"destructive"})&&(!t.doubleConfirm||await g({title:t.doubleConfirm.title,description:t.doubleConfirm.description,confirmLabel:t.doubleConfirm.confirmLabel,variant:"destructive",requireText:t.doubleConfirm.requireText}))){l(e),d(null),h(null);try{let a=await M(e);F(e,y),h(t.successMessage(a))}catch(e){d(e instanceof f.ApiError?e.message:"Request failed")}finally{l(null)}}};return(0,t.jsx)(k.Collapsible,{open:e,onOpenChange:r,children:(0,t.jsxs)(w.Card,{className:"border-destructive/40",children:[(0,t.jsx)(k.CollapsibleTrigger,{asChild:!0,children:(0,t.jsx)(w.CardHeader,{className:"cursor-pointer select-none",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.ChevronRight,{className:(0,S.cn)("h-4 w-4 text-destructive transition-transform",e&&"rotate-90")}),(0,t.jsx)(s.AlertTriangle,{className:"h-4 w-4 text-destructive"}),(0,t.jsx)(w.CardTitle,{className:"text-destructive",children:"Danger Zone"})]})})}),(0,t.jsx)(k.CollapsibleContent,{children:(0,t.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground max-w-prose",children:"Destructive actions that cannot be undone. Each action requires confirmation before executing."}),o&&(0,t.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:o}),c&&(0,t.jsx)("p",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:c}),(0,t.jsx)(P,{title:"Reset all config to defaults",description:"Restores every runtime setting to its factory default. Bootstrap values in .env (API port, data directory, log level) and integration credentials are preserved.",icon:(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reset config",busy:"reset-config"===n,disabled:null!==n,onClick:()=>b("reset-config",{title:"Reset all config to defaults?",description:"Restores every runtime setting in the database to its factory default. Bootstrap values in .env (API port, data directory, log level) and integration credentials are preserved.",confirmLabel:"Reset config",successMessage:e=>`Cleared ${e.cleared??0} runtime setting(s).`})}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Delete all sessions and history",description:"Permanently removes all non-active conversation sessions, messages, action logs, observations, notification logs, MD snapshots, and scheduled tasks. The active session is preserved.",icon:(0,t.jsx)(m.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Delete history",busy:"purge-history"===n,disabled:null!==n,onClick:()=>b("purge-history",{title:"Delete all sessions and history?",description:"Permanently removes every non-active conversation session, message, action log, observation, notification log, MD snapshot, and scheduled task. The active session is preserved.",confirmLabel:"Delete history",successMessage:e=>`Deleted ${e.deletedSessions??0} session(s), ${e.deletedMessages??0} message(s), ${e.deletedActions??0} action(s).`})}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Reinstall context",description:"Writes a tarball backup first, then wipes context/ (including policies/management.md) and md_file_snapshots. Conversation history, settings, and credentials are preserved. Restart the daemon to re-seed the vault from templates.",icon:(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reinstall context",busy:"reinstall-context"===n,disabled:null!==n,onClick:()=>(async()=>{l("reinstall-context"),d(null),h(null);try{let e,t=await f.api.get("/system/reinstall-context/plan");if(!await g({title:"Clean reinstall of context/ (B-007)?",description:(e=t.ancillaryDirs.length>0?`Ancillary caches to remove: ${t.ancillaryDirs.join(", ")}.`:"No ancillary caches are scheduled for removal.",[`This will remove ${t.fileCount} file(s) (${L(t.totalBytes)}) from ${t.contextDir}, clear ${t.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,e,`Backup tarball path: ${t.backupPath}`].join(" ")),confirmLabel:"Continue",variant:"destructive"})||!await g({title:"Type CLEAN to confirm",description:`Backup tarball: ${t.backupPath}. Proceed to remove ${t.fileCount} file(s) and clear ${t.snapshotRowCount} snapshot row(s).`,confirmLabel:"Reinstall context",variant:"destructive",requireText:"CLEAN"}))return;let a=await M("reinstall-context");F("reinstall-context",y),h(`Reinstalled. Removed ${a.filesDeleted??0} file(s), cleared ${a.snapshotRowsDeleted??0} snapshot row(s). Backup at ${a.backupPath??t.backupPath}.`)}catch(e){d(e instanceof f.ApiError?e.message:"Request failed")}finally{l(null)}})()}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(P,{title:"Factory reset",description:"Wipe everything: history, settings, context, credentials, encrypted blobs, attachments, session workdirs, backups, caches, user skills, integrations, backend configs, mail accounts, and recurring schedules. The SQLite DB is compacted afterward.",icon:(0,t.jsx)(x.Zap,{className:"h-3.5 w-3.5 mr-1"}),label:"Factory reset",busy:"factory-reset"===n,disabled:null!==n,onClick:()=>b("factory-reset",{title:"Factory reset — really?",description:"Wipes everything on this device: conversation history, action logs, runtime settings, context files (including policies/management.md), keychain secrets, encrypted blobs, uploaded attachments, session and skill-optimizer workdirs, all backups, caches, user skills, the managed Codex Azure config, the Whisper model cache, and every user-data table (backends, mail accounts, recurring schedules, receipts, books, travel bookings, runtime state, auth telemetry). The SQLite DB is compacted afterward; restart the daemon to re-bootstrap observers and adapters.",confirmLabel:"Continue",doubleConfirm:{title:"Final confirmation",description:"There is no undo. Type the confirmation phrase below to proceed.",confirmLabel:"Factory reset",requireText:"RESET EVERYTHING"},successMessage:e=>{let t="string"==typeof e.status?e.status:"reset",a=Array.isArray(e.errors)?e.errors.length:0,s=Array.isArray(e.adapterReloadErrors)?e.adapterReloadErrors.length:0;return"reset_with_errors"===t||a>0||s>0?`Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${a} reset step warning(s), ${s} adapter reload warning(s).)`:"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters."}})})]})})]})})}function P({title:e,description:a,icon:s,label:r,busy:i,disabled:n,onClick:l}){return(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]}),(0,t.jsxs)(j.Button,{variant:"destructive",size:"sm",onClick:l,disabled:n,className:"shrink-0",children:[s,i?"Working...":r]})]})}e.s(["default",0,function(){let{data:e}=(0,y.useConfig)(),{toast:s,showToast:r}=(0,b.useSaveConfig)(),{deferSaveFor:i,dv:n,dirtyFields:l,clearDirtyKeys:o}=(0,v.useDirtyFields)(),d=(0,p.useQueryClient)(),c=(0,R.useConfirm)(),[m,x]=(0,a.useState)(!1),h=async()=>{if(await c({title:"Reset disallowed tools to defaults?",description:"This will restore the default safety tool list, replacing any customizations.",confirmLabel:"Reset",variant:"destructive"})){x(!0);try{await f.api.post("/config/reset-safety"),d.invalidateQueries({queryKey:["config"]}),o(["disallowedTools","allowedToolsOverride"]),r("success","Safety tools reset to defaults")}finally{x(!1)}}};if(!e)return(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."});let g=i(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.PageHeader,{title:"Advanced",description:"Power-user knobs and safety settings. Most of these are low-level — read each description carefully before saving."}),(0,t.jsx)(B.SettingsToast,{toast:s}),(0,t.jsxs)(w.Card,{children:[(0,t.jsx)(w.CardHeader,{children:(0,t.jsx)(w.CardTitle,{children:"Safety — Tool Policy"})}),(0,t.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Guardrails applied to every backend’s tool calls, enforced before each call runs. Entries are either a plain tool name (",(0,t.jsx)("code",{children:"Write"}),", ",(0,t.jsx)("code",{children:"WebFetch"}),") or a tool name with an argument pattern in parentheses (",(0,t.jsx)("code",{children:"Bash(rm -rf *)"}),") to match only specific invocations."," ",(0,t.jsx)("strong",{children:"Disallowed wins over allowed"})," — any match in the disallowed list blocks the call even if the allowed override would otherwise permit it. The per-backend Safe / Allow toggle lives in"," ",(0,t.jsx)("strong",{children:"Models & Cost → Execution Mode"}),"."]}),(0,t.jsx)(D.EditableArrayField,{label:"Disallowed Tools",values:n("disallowedTools",e.disallowedTools),configKey:"disallowedTools",variant:"red",placeholder:"e.g. Bash(rm -rf *)",modified:l.has("disallowedTools"),onSave:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:"Tools the agent is forbidden from calling. The defaults block destructive shell commands and dangerous file operations. Use Reset to Defaults below to restore them after experimenting."}),(0,t.jsx)(T.Separator,{}),(0,t.jsx)(D.EditableArrayField,{label:"Allowed Tools Override",values:n("allowedToolsOverride",e.allowedTools),configKey:"allowedToolsOverride",variant:"green",placeholder:"e.g. Bash(git push)",modified:l.has("allowedToolsOverride"),onSave:g}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground -mt-1",children:["Narrow exceptions to the disallowed list. Use this to permit a specific safe invocation of an otherwise-blocked tool — for example, allow ",(0,t.jsx)("code",{children:"Bash(git push)"})," while keeping arbitrary"," ",(0,t.jsx)("code",{children:"Bash"})," blocked."]}),(0,t.jsx)(T.Separator,{}),(0,t.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:h,disabled:m,children:[(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),m?"Resetting...":"Reset to Defaults"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Restores the built-in disallowed-tool list and"," ",(0,t.jsx)("strong",{children:"clears the allowed override list"}),", replacing any customizations in both. Use this when your safety config has drifted and you want a clean slate."]})]})]}),(0,t.jsx)(E,{}),(0,t.jsx)($,{})]})}],34409)}]);