@aitne/dashboard 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/diagnostics/route-bundle-stats.json +210 -247
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +14 -14
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/activity/page.js.nft.json +1 -1
  24. package/.next/server/app/activity/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/activity.html +1 -1
  26. package/.next/server/app/activity.rsc +27 -26
  27. package/.next/server/app/activity.segments/_full.segment.rsc +27 -26
  28. package/.next/server/app/activity.segments/_head.segment.rsc +4 -4
  29. package/.next/server/app/activity.segments/_index.segment.rsc +9 -9
  30. package/.next/server/app/activity.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/activity.segments/activity/__PAGE__.segment.rsc +4 -4
  32. package/.next/server/app/activity.segments/activity.segment.rsc +4 -4
  33. package/.next/server/app/analytics/page.js.nft.json +1 -1
  34. package/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/analytics.html +1 -1
  36. package/.next/server/app/analytics.rsc +22 -23
  37. package/.next/server/app/analytics.segments/_full.segment.rsc +22 -23
  38. package/.next/server/app/analytics.segments/_head.segment.rsc +4 -4
  39. package/.next/server/app/analytics.segments/_index.segment.rsc +9 -9
  40. package/.next/server/app/analytics.segments/_tree.segment.rsc +1 -1
  41. package/.next/server/app/analytics.segments/analytics/__PAGE__.segment.rsc +4 -4
  42. package/.next/server/app/analytics.segments/analytics.segment.rsc +4 -4
  43. package/.next/server/app/api/[...path]/route.js +1 -1
  44. package/.next/server/app/api/[...path]/route.js.nft.json +1 -1
  45. package/.next/server/app/chat/page.js.nft.json +1 -1
  46. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/chat.html +1 -1
  48. package/.next/server/app/chat.rsc +16 -16
  49. package/.next/server/app/chat.segments/_full.segment.rsc +16 -16
  50. package/.next/server/app/chat.segments/_head.segment.rsc +4 -4
  51. package/.next/server/app/chat.segments/_index.segment.rsc +9 -9
  52. package/.next/server/app/chat.segments/_tree.segment.rsc +1 -1
  53. package/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +4 -4
  54. package/.next/server/app/chat.segments/chat.segment.rsc +3 -3
  55. package/.next/server/app/connections/calendar/page.js.nft.json +1 -1
  56. package/.next/server/app/connections/calendar/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/connections/calendar.html +1 -1
  58. package/.next/server/app/connections/calendar.rsc +17 -17
  59. package/.next/server/app/connections/calendar.segments/_full.segment.rsc +17 -17
  60. package/.next/server/app/connections/calendar.segments/_head.segment.rsc +4 -4
  61. package/.next/server/app/connections/calendar.segments/_index.segment.rsc +9 -9
  62. package/.next/server/app/connections/calendar.segments/_tree.segment.rsc +1 -1
  63. package/.next/server/app/connections/calendar.segments/connections/calendar/__PAGE__.segment.rsc +4 -4
  64. package/.next/server/app/connections/calendar.segments/connections/calendar.segment.rsc +3 -3
  65. package/.next/server/app/connections/calendar.segments/connections.segment.rsc +4 -4
  66. package/.next/server/app/connections/journal/page.js.nft.json +1 -1
  67. package/.next/server/app/connections/journal/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/connections/journal.html +1 -1
  69. package/.next/server/app/connections/journal.rsc +15 -15
  70. package/.next/server/app/connections/journal.segments/_full.segment.rsc +15 -15
  71. package/.next/server/app/connections/journal.segments/_head.segment.rsc +4 -4
  72. package/.next/server/app/connections/journal.segments/_index.segment.rsc +9 -9
  73. package/.next/server/app/connections/journal.segments/_tree.segment.rsc +1 -1
  74. package/.next/server/app/connections/journal.segments/connections/journal/__PAGE__.segment.rsc +2 -2
  75. package/.next/server/app/connections/journal.segments/connections/journal.segment.rsc +3 -3
  76. package/.next/server/app/connections/journal.segments/connections.segment.rsc +4 -4
  77. package/.next/server/app/connections/knowledge/page.js.nft.json +1 -1
  78. package/.next/server/app/connections/knowledge/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/connections/knowledge.html +1 -1
  80. package/.next/server/app/connections/knowledge.rsc +17 -17
  81. package/.next/server/app/connections/knowledge.segments/_full.segment.rsc +17 -17
  82. package/.next/server/app/connections/knowledge.segments/_head.segment.rsc +4 -4
  83. package/.next/server/app/connections/knowledge.segments/_index.segment.rsc +9 -9
  84. package/.next/server/app/connections/knowledge.segments/_tree.segment.rsc +1 -1
  85. package/.next/server/app/connections/knowledge.segments/connections/knowledge/__PAGE__.segment.rsc +4 -4
  86. package/.next/server/app/connections/knowledge.segments/connections/knowledge.segment.rsc +3 -3
  87. package/.next/server/app/connections/knowledge.segments/connections.segment.rsc +4 -4
  88. package/.next/server/app/connections/mail/page.js.nft.json +1 -1
  89. package/.next/server/app/connections/mail/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/connections/mail.html +1 -1
  91. package/.next/server/app/connections/mail.rsc +17 -17
  92. package/.next/server/app/connections/mail.segments/_full.segment.rsc +17 -17
  93. package/.next/server/app/connections/mail.segments/_head.segment.rsc +4 -4
  94. package/.next/server/app/connections/mail.segments/_index.segment.rsc +9 -9
  95. package/.next/server/app/connections/mail.segments/_tree.segment.rsc +1 -1
  96. package/.next/server/app/connections/mail.segments/connections/mail/__PAGE__.segment.rsc +4 -4
  97. package/.next/server/app/connections/mail.segments/connections/mail.segment.rsc +3 -3
  98. package/.next/server/app/connections/mail.segments/connections.segment.rsc +4 -4
  99. package/.next/server/app/connections/mcp/page.js.nft.json +1 -1
  100. package/.next/server/app/connections/mcp/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/connections/mcp.html +1 -1
  102. package/.next/server/app/connections/mcp.rsc +17 -17
  103. package/.next/server/app/connections/mcp.segments/_full.segment.rsc +17 -17
  104. package/.next/server/app/connections/mcp.segments/_head.segment.rsc +4 -4
  105. package/.next/server/app/connections/mcp.segments/_index.segment.rsc +9 -9
  106. package/.next/server/app/connections/mcp.segments/_tree.segment.rsc +1 -1
  107. package/.next/server/app/connections/mcp.segments/connections/mcp/__PAGE__.segment.rsc +4 -4
  108. package/.next/server/app/connections/mcp.segments/connections/mcp.segment.rsc +3 -3
  109. package/.next/server/app/connections/mcp.segments/connections.segment.rsc +4 -4
  110. package/.next/server/app/connections/messaging/page.js.nft.json +1 -1
  111. package/.next/server/app/connections/messaging/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/connections/messaging.html +1 -1
  113. package/.next/server/app/connections/messaging.rsc +17 -17
  114. package/.next/server/app/connections/messaging.segments/_full.segment.rsc +17 -17
  115. package/.next/server/app/connections/messaging.segments/_head.segment.rsc +4 -4
  116. package/.next/server/app/connections/messaging.segments/_index.segment.rsc +9 -9
  117. package/.next/server/app/connections/messaging.segments/_tree.segment.rsc +1 -1
  118. package/.next/server/app/connections/messaging.segments/connections/messaging/__PAGE__.segment.rsc +4 -4
  119. package/.next/server/app/connections/messaging.segments/connections/messaging.segment.rsc +3 -3
  120. package/.next/server/app/connections/messaging.segments/connections.segment.rsc +4 -4
  121. package/.next/server/app/connections/page.js.nft.json +1 -1
  122. package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  123. package/.next/server/app/connections/repositories/page.js.nft.json +1 -1
  124. package/.next/server/app/connections/repositories/page_client-reference-manifest.js +1 -1
  125. package/.next/server/app/connections/repositories.html +1 -1
  126. package/.next/server/app/connections/repositories.rsc +17 -17
  127. package/.next/server/app/connections/repositories.segments/_full.segment.rsc +17 -17
  128. package/.next/server/app/connections/repositories.segments/_head.segment.rsc +4 -4
  129. package/.next/server/app/connections/repositories.segments/_index.segment.rsc +9 -9
  130. package/.next/server/app/connections/repositories.segments/_tree.segment.rsc +1 -1
  131. package/.next/server/app/connections/repositories.segments/connections/repositories/__PAGE__.segment.rsc +4 -4
  132. package/.next/server/app/connections/repositories.segments/connections/repositories.segment.rsc +3 -3
  133. package/.next/server/app/connections/repositories.segments/connections.segment.rsc +4 -4
  134. package/.next/server/app/connections/routines/page.js.nft.json +1 -1
  135. package/.next/server/app/connections/routines/page_client-reference-manifest.js +1 -1
  136. package/.next/server/app/connections/routines.html +1 -1
  137. package/.next/server/app/connections/routines.rsc +15 -15
  138. package/.next/server/app/connections/routines.segments/_full.segment.rsc +15 -15
  139. package/.next/server/app/connections/routines.segments/_head.segment.rsc +4 -4
  140. package/.next/server/app/connections/routines.segments/_index.segment.rsc +9 -9
  141. package/.next/server/app/connections/routines.segments/_tree.segment.rsc +1 -1
  142. package/.next/server/app/connections/routines.segments/connections/routines/__PAGE__.segment.rsc +2 -2
  143. package/.next/server/app/connections/routines.segments/connections/routines.segment.rsc +3 -3
  144. package/.next/server/app/connections/routines.segments/connections.segment.rsc +4 -4
  145. package/.next/server/app/connections.html +1 -1
  146. package/.next/server/app/connections.rsc +15 -15
  147. package/.next/server/app/connections.segments/_full.segment.rsc +15 -15
  148. package/.next/server/app/connections.segments/_head.segment.rsc +4 -4
  149. package/.next/server/app/connections.segments/_index.segment.rsc +9 -9
  150. package/.next/server/app/connections.segments/_tree.segment.rsc +1 -1
  151. package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +2 -2
  152. package/.next/server/app/connections.segments/connections.segment.rsc +4 -4
  153. package/.next/server/app/conversations/[id]/page.js.nft.json +1 -1
  154. package/.next/server/app/conversations/[id]/page_client-reference-manifest.js +1 -1
  155. package/.next/server/app/conversations/page.js.nft.json +1 -1
  156. package/.next/server/app/conversations/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/conversations.html +1 -1
  158. package/.next/server/app/conversations.rsc +14 -14
  159. package/.next/server/app/conversations.segments/_full.segment.rsc +14 -14
  160. package/.next/server/app/conversations.segments/_head.segment.rsc +4 -4
  161. package/.next/server/app/conversations.segments/_index.segment.rsc +9 -9
  162. package/.next/server/app/conversations.segments/_tree.segment.rsc +1 -1
  163. package/.next/server/app/conversations.segments/conversations/__PAGE__.segment.rsc +2 -2
  164. package/.next/server/app/conversations.segments/conversations.segment.rsc +3 -3
  165. package/.next/server/app/docs/[[...slug]]/page.js.nft.json +1 -1
  166. package/.next/server/app/docs/[[...slug]]/page_client-reference-manifest.js +1 -1
  167. package/.next/server/app/finance/page.js.nft.json +1 -1
  168. package/.next/server/app/finance/page_client-reference-manifest.js +1 -1
  169. package/.next/server/app/finance.html +1 -1
  170. package/.next/server/app/finance.rsc +16 -16
  171. package/.next/server/app/finance.segments/_full.segment.rsc +16 -16
  172. package/.next/server/app/finance.segments/_head.segment.rsc +4 -4
  173. package/.next/server/app/finance.segments/_index.segment.rsc +9 -9
  174. package/.next/server/app/finance.segments/_tree.segment.rsc +1 -1
  175. package/.next/server/app/finance.segments/finance/__PAGE__.segment.rsc +4 -4
  176. package/.next/server/app/finance.segments/finance.segment.rsc +3 -3
  177. package/.next/server/app/git/page.js.nft.json +1 -1
  178. package/.next/server/app/git/page_client-reference-manifest.js +1 -1
  179. package/.next/server/app/git.html +1 -1
  180. package/.next/server/app/git.rsc +16 -16
  181. package/.next/server/app/git.segments/_full.segment.rsc +16 -16
  182. package/.next/server/app/git.segments/_head.segment.rsc +4 -4
  183. package/.next/server/app/git.segments/_index.segment.rsc +9 -9
  184. package/.next/server/app/git.segments/_tree.segment.rsc +1 -1
  185. package/.next/server/app/git.segments/git/__PAGE__.segment.rsc +4 -4
  186. package/.next/server/app/git.segments/git.segment.rsc +3 -3
  187. package/.next/server/app/health/page.js.nft.json +1 -1
  188. package/.next/server/app/health/page_client-reference-manifest.js +1 -1
  189. package/.next/server/app/health.html +1 -1
  190. package/.next/server/app/health.rsc +16 -16
  191. package/.next/server/app/health.segments/_full.segment.rsc +16 -16
  192. package/.next/server/app/health.segments/_head.segment.rsc +4 -4
  193. package/.next/server/app/health.segments/_index.segment.rsc +9 -9
  194. package/.next/server/app/health.segments/_tree.segment.rsc +1 -1
  195. package/.next/server/app/health.segments/health/__PAGE__.segment.rsc +4 -4
  196. package/.next/server/app/health.segments/health.segment.rsc +3 -3
  197. package/.next/server/app/index.html +1 -1
  198. package/.next/server/app/index.rsc +16 -16
  199. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  200. package/.next/server/app/index.segments/_full.segment.rsc +16 -16
  201. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  202. package/.next/server/app/index.segments/_index.segment.rsc +9 -9
  203. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  204. package/.next/server/app/knowledge/page.js.nft.json +1 -1
  205. package/.next/server/app/knowledge/page_client-reference-manifest.js +1 -1
  206. package/.next/server/app/knowledge.html +1 -1
  207. package/.next/server/app/knowledge.rsc +17 -17
  208. package/.next/server/app/knowledge.segments/_full.segment.rsc +17 -17
  209. package/.next/server/app/knowledge.segments/_head.segment.rsc +4 -4
  210. package/.next/server/app/knowledge.segments/_index.segment.rsc +9 -9
  211. package/.next/server/app/knowledge.segments/_tree.segment.rsc +1 -1
  212. package/.next/server/app/knowledge.segments/knowledge/__PAGE__.segment.rsc +4 -4
  213. package/.next/server/app/knowledge.segments/knowledge.segment.rsc +4 -4
  214. package/.next/server/app/page.js.nft.json +1 -1
  215. package/.next/server/app/page_client-reference-manifest.js +1 -1
  216. package/.next/server/app/reading/page.js.nft.json +1 -1
  217. package/.next/server/app/reading/page_client-reference-manifest.js +1 -1
  218. package/.next/server/app/reading.html +1 -1
  219. package/.next/server/app/reading.rsc +16 -16
  220. package/.next/server/app/reading.segments/_full.segment.rsc +16 -16
  221. package/.next/server/app/reading.segments/_head.segment.rsc +4 -4
  222. package/.next/server/app/reading.segments/_index.segment.rsc +9 -9
  223. package/.next/server/app/reading.segments/_tree.segment.rsc +1 -1
  224. package/.next/server/app/reading.segments/reading/__PAGE__.segment.rsc +4 -4
  225. package/.next/server/app/reading.segments/reading.segment.rsc +3 -3
  226. package/.next/server/app/schedule/page.js.nft.json +1 -1
  227. package/.next/server/app/schedule/page_client-reference-manifest.js +1 -1
  228. package/.next/server/app/schedule.html +1 -1
  229. package/.next/server/app/schedule.rsc +16 -16
  230. package/.next/server/app/schedule.segments/_full.segment.rsc +16 -16
  231. package/.next/server/app/schedule.segments/_head.segment.rsc +4 -4
  232. package/.next/server/app/schedule.segments/_index.segment.rsc +9 -9
  233. package/.next/server/app/schedule.segments/_tree.segment.rsc +1 -1
  234. package/.next/server/app/schedule.segments/schedule/__PAGE__.segment.rsc +4 -4
  235. package/.next/server/app/schedule.segments/schedule.segment.rsc +3 -3
  236. package/.next/server/app/settings/advanced/page.js.nft.json +1 -1
  237. package/.next/server/app/settings/advanced/page_client-reference-manifest.js +1 -1
  238. package/.next/server/app/settings/advanced.html +1 -1
  239. package/.next/server/app/settings/advanced.rsc +17 -17
  240. package/.next/server/app/settings/advanced.segments/_full.segment.rsc +17 -17
  241. package/.next/server/app/settings/advanced.segments/_head.segment.rsc +4 -4
  242. package/.next/server/app/settings/advanced.segments/_index.segment.rsc +9 -9
  243. package/.next/server/app/settings/advanced.segments/_tree.segment.rsc +1 -1
  244. package/.next/server/app/settings/advanced.segments/settings/advanced/__PAGE__.segment.rsc +4 -4
  245. package/.next/server/app/settings/advanced.segments/settings/advanced.segment.rsc +3 -3
  246. package/.next/server/app/settings/advanced.segments/settings.segment.rsc +4 -4
  247. package/.next/server/app/settings/backends/page.js.nft.json +1 -1
  248. package/.next/server/app/settings/backends/page_client-reference-manifest.js +1 -1
  249. package/.next/server/app/settings/backends.html +1 -1
  250. package/.next/server/app/settings/backends.rsc +15 -15
  251. package/.next/server/app/settings/backends.segments/_full.segment.rsc +15 -15
  252. package/.next/server/app/settings/backends.segments/_head.segment.rsc +4 -4
  253. package/.next/server/app/settings/backends.segments/_index.segment.rsc +9 -9
  254. package/.next/server/app/settings/backends.segments/_tree.segment.rsc +1 -1
  255. package/.next/server/app/settings/backends.segments/settings/backends/__PAGE__.segment.rsc +2 -2
  256. package/.next/server/app/settings/backends.segments/settings/backends.segment.rsc +3 -3
  257. package/.next/server/app/settings/backends.segments/settings.segment.rsc +4 -4
  258. package/.next/server/app/settings/commands/page.js.nft.json +1 -1
  259. package/.next/server/app/settings/commands/page_client-reference-manifest.js +1 -1
  260. package/.next/server/app/settings/commands.html +1 -1
  261. package/.next/server/app/settings/commands.rsc +17 -17
  262. package/.next/server/app/settings/commands.segments/_full.segment.rsc +17 -17
  263. package/.next/server/app/settings/commands.segments/_head.segment.rsc +4 -4
  264. package/.next/server/app/settings/commands.segments/_index.segment.rsc +9 -9
  265. package/.next/server/app/settings/commands.segments/_tree.segment.rsc +1 -1
  266. package/.next/server/app/settings/commands.segments/settings/commands/__PAGE__.segment.rsc +4 -4
  267. package/.next/server/app/settings/commands.segments/settings/commands.segment.rsc +3 -3
  268. package/.next/server/app/settings/commands.segments/settings.segment.rsc +4 -4
  269. package/.next/server/app/settings/connections/page.js.nft.json +1 -1
  270. package/.next/server/app/settings/connections/page_client-reference-manifest.js +1 -1
  271. package/.next/server/app/settings/connections.html +1 -1
  272. package/.next/server/app/settings/connections.rsc +15 -15
  273. package/.next/server/app/settings/connections.segments/_full.segment.rsc +15 -15
  274. package/.next/server/app/settings/connections.segments/_head.segment.rsc +4 -4
  275. package/.next/server/app/settings/connections.segments/_index.segment.rsc +9 -9
  276. package/.next/server/app/settings/connections.segments/_tree.segment.rsc +1 -1
  277. package/.next/server/app/settings/connections.segments/settings/connections/__PAGE__.segment.rsc +2 -2
  278. package/.next/server/app/settings/connections.segments/settings/connections.segment.rsc +3 -3
  279. package/.next/server/app/settings/connections.segments/settings.segment.rsc +4 -4
  280. package/.next/server/app/settings/journal/page.js.nft.json +1 -1
  281. package/.next/server/app/settings/journal/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/settings/journal.html +1 -1
  283. package/.next/server/app/settings/journal.rsc +17 -17
  284. package/.next/server/app/settings/journal.segments/_full.segment.rsc +17 -17
  285. package/.next/server/app/settings/journal.segments/_head.segment.rsc +4 -4
  286. package/.next/server/app/settings/journal.segments/_index.segment.rsc +9 -9
  287. package/.next/server/app/settings/journal.segments/_tree.segment.rsc +1 -1
  288. package/.next/server/app/settings/journal.segments/settings/journal/__PAGE__.segment.rsc +4 -4
  289. package/.next/server/app/settings/journal.segments/settings/journal.segment.rsc +3 -3
  290. package/.next/server/app/settings/journal.segments/settings.segment.rsc +4 -4
  291. package/.next/server/app/settings/management/page.js.nft.json +1 -1
  292. package/.next/server/app/settings/management/page_client-reference-manifest.js +1 -1
  293. package/.next/server/app/settings/management.html +1 -1
  294. package/.next/server/app/settings/management.rsc +17 -17
  295. package/.next/server/app/settings/management.segments/_full.segment.rsc +17 -17
  296. package/.next/server/app/settings/management.segments/_head.segment.rsc +4 -4
  297. package/.next/server/app/settings/management.segments/_index.segment.rsc +9 -9
  298. package/.next/server/app/settings/management.segments/_tree.segment.rsc +1 -1
  299. package/.next/server/app/settings/management.segments/settings/management/__PAGE__.segment.rsc +4 -4
  300. package/.next/server/app/settings/management.segments/settings/management.segment.rsc +3 -3
  301. package/.next/server/app/settings/management.segments/settings.segment.rsc +4 -4
  302. package/.next/server/app/settings/messaging/page.js.nft.json +1 -1
  303. package/.next/server/app/settings/messaging/page_client-reference-manifest.js +1 -1
  304. package/.next/server/app/settings/messaging.html +1 -1
  305. package/.next/server/app/settings/messaging.rsc +15 -15
  306. package/.next/server/app/settings/messaging.segments/_full.segment.rsc +15 -15
  307. package/.next/server/app/settings/messaging.segments/_head.segment.rsc +4 -4
  308. package/.next/server/app/settings/messaging.segments/_index.segment.rsc +9 -9
  309. package/.next/server/app/settings/messaging.segments/_tree.segment.rsc +1 -1
  310. package/.next/server/app/settings/messaging.segments/settings/messaging/__PAGE__.segment.rsc +2 -2
  311. package/.next/server/app/settings/messaging.segments/settings/messaging.segment.rsc +3 -3
  312. package/.next/server/app/settings/messaging.segments/settings.segment.rsc +4 -4
  313. package/.next/server/app/settings/models/page.js.nft.json +1 -1
  314. package/.next/server/app/settings/models/page_client-reference-manifest.js +1 -1
  315. package/.next/server/app/settings/models.html +1 -1
  316. package/.next/server/app/settings/models.rsc +17 -17
  317. package/.next/server/app/settings/models.segments/_full.segment.rsc +17 -17
  318. package/.next/server/app/settings/models.segments/_head.segment.rsc +4 -4
  319. package/.next/server/app/settings/models.segments/_index.segment.rsc +9 -9
  320. package/.next/server/app/settings/models.segments/_tree.segment.rsc +1 -1
  321. package/.next/server/app/settings/models.segments/settings/models/__PAGE__.segment.rsc +4 -4
  322. package/.next/server/app/settings/models.segments/settings/models.segment.rsc +3 -3
  323. package/.next/server/app/settings/models.segments/settings.segment.rsc +4 -4
  324. package/.next/server/app/settings/page.js.nft.json +1 -1
  325. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  326. package/.next/server/app/settings/processes/page.js.nft.json +1 -1
  327. package/.next/server/app/settings/processes/page_client-reference-manifest.js +1 -1
  328. package/.next/server/app/settings/processes.html +1 -1
  329. package/.next/server/app/settings/processes.rsc +15 -15
  330. package/.next/server/app/settings/processes.segments/_full.segment.rsc +15 -15
  331. package/.next/server/app/settings/processes.segments/_head.segment.rsc +4 -4
  332. package/.next/server/app/settings/processes.segments/_index.segment.rsc +9 -9
  333. package/.next/server/app/settings/processes.segments/_tree.segment.rsc +1 -1
  334. package/.next/server/app/settings/processes.segments/settings/processes/__PAGE__.segment.rsc +2 -2
  335. package/.next/server/app/settings/processes.segments/settings/processes.segment.rsc +3 -3
  336. package/.next/server/app/settings/processes.segments/settings.segment.rsc +4 -4
  337. package/.next/server/app/settings/routines/page.js.nft.json +1 -1
  338. package/.next/server/app/settings/routines/page_client-reference-manifest.js +1 -1
  339. package/.next/server/app/settings/routines.html +1 -1
  340. package/.next/server/app/settings/routines.rsc +17 -17
  341. package/.next/server/app/settings/routines.segments/_full.segment.rsc +17 -17
  342. package/.next/server/app/settings/routines.segments/_head.segment.rsc +4 -4
  343. package/.next/server/app/settings/routines.segments/_index.segment.rsc +9 -9
  344. package/.next/server/app/settings/routines.segments/_tree.segment.rsc +1 -1
  345. package/.next/server/app/settings/routines.segments/settings/routines/__PAGE__.segment.rsc +4 -4
  346. package/.next/server/app/settings/routines.segments/settings/routines.segment.rsc +3 -3
  347. package/.next/server/app/settings/routines.segments/settings.segment.rsc +4 -4
  348. package/.next/server/app/settings/schedule/page.js.nft.json +1 -1
  349. package/.next/server/app/settings/schedule/page_client-reference-manifest.js +1 -1
  350. package/.next/server/app/settings/schedule.html +1 -1
  351. package/.next/server/app/settings/schedule.rsc +17 -17
  352. package/.next/server/app/settings/schedule.segments/_full.segment.rsc +17 -17
  353. package/.next/server/app/settings/schedule.segments/_head.segment.rsc +4 -4
  354. package/.next/server/app/settings/schedule.segments/_index.segment.rsc +9 -9
  355. package/.next/server/app/settings/schedule.segments/_tree.segment.rsc +1 -1
  356. package/.next/server/app/settings/schedule.segments/settings/schedule/__PAGE__.segment.rsc +4 -4
  357. package/.next/server/app/settings/schedule.segments/settings/schedule.segment.rsc +3 -3
  358. package/.next/server/app/settings/schedule.segments/settings.segment.rsc +4 -4
  359. package/.next/server/app/settings/self-learning/page.js.nft.json +1 -1
  360. package/.next/server/app/settings/self-learning/page_client-reference-manifest.js +1 -1
  361. package/.next/server/app/settings/self-learning.html +1 -1
  362. package/.next/server/app/settings/self-learning.rsc +17 -17
  363. package/.next/server/app/settings/self-learning.segments/_full.segment.rsc +17 -17
  364. package/.next/server/app/settings/self-learning.segments/_head.segment.rsc +4 -4
  365. package/.next/server/app/settings/self-learning.segments/_index.segment.rsc +9 -9
  366. package/.next/server/app/settings/self-learning.segments/_tree.segment.rsc +1 -1
  367. package/.next/server/app/settings/self-learning.segments/settings/self-learning/__PAGE__.segment.rsc +4 -4
  368. package/.next/server/app/settings/self-learning.segments/settings/self-learning.segment.rsc +3 -3
  369. package/.next/server/app/settings/self-learning.segments/settings.segment.rsc +4 -4
  370. package/.next/server/app/settings.html +1 -1
  371. package/.next/server/app/settings.rsc +17 -17
  372. package/.next/server/app/settings.segments/_full.segment.rsc +17 -17
  373. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  374. package/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  375. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  376. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  377. package/.next/server/app/settings.segments/settings.segment.rsc +4 -4
  378. package/.next/server/app/setup/page.js.nft.json +1 -1
  379. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  380. package/.next/server/app/setup.html +1 -1
  381. package/.next/server/app/setup.rsc +16 -16
  382. package/.next/server/app/setup.segments/_full.segment.rsc +16 -16
  383. package/.next/server/app/setup.segments/_head.segment.rsc +4 -4
  384. package/.next/server/app/setup.segments/_index.segment.rsc +9 -9
  385. package/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
  386. package/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +4 -4
  387. package/.next/server/app/setup.segments/setup.segment.rsc +3 -3
  388. package/.next/server/app/trip/page.js.nft.json +1 -1
  389. package/.next/server/app/trip/page_client-reference-manifest.js +1 -1
  390. package/.next/server/app/trip.html +1 -1
  391. package/.next/server/app/trip.rsc +16 -16
  392. package/.next/server/app/trip.segments/_full.segment.rsc +16 -16
  393. package/.next/server/app/trip.segments/_head.segment.rsc +4 -4
  394. package/.next/server/app/trip.segments/_index.segment.rsc +9 -9
  395. package/.next/server/app/trip.segments/_tree.segment.rsc +1 -1
  396. package/.next/server/app/trip.segments/trip/__PAGE__.segment.rsc +4 -4
  397. package/.next/server/app/trip.segments/trip.segment.rsc +3 -3
  398. package/.next/server/chunks/05w9_next_dist_esm_build_templates_app-route_0~eezk6.js +3 -3
  399. package/.next/server/chunks/05w9_next_dist_esm_build_templates_app-route_0~eezk6.js.map +1 -1
  400. package/.next/server/chunks/{[root-of-the-server]__0j~awob._.js → [root-of-the-server]__0dwxuh7._.js} +1 -1
  401. package/.next/server/chunks/{[root-of-the-server]__04-hp3j._.js → [root-of-the-server]__0k7lkv6._.js} +2 -2
  402. package/.next/server/chunks/ssr/{[root-of-the-server]__0t26ngg._.js → [root-of-the-server]__0ngitfo._.js} +2 -2
  403. package/.next/server/chunks/ssr/{[root-of-the-server]__0t26ngg._.js.map → [root-of-the-server]__0ngitfo._.js.map} +1 -1
  404. package/.next/server/chunks/ssr/{_0pvc7ao._.js → _0370l.6._.js} +2 -2
  405. package/.next/server/chunks/ssr/{_0pvc7ao._.js.map → _0370l.6._.js.map} +1 -1
  406. package/.next/server/chunks/ssr/_04kt9.8._.js +3 -0
  407. package/.next/server/chunks/ssr/_04kt9.8._.js.map +1 -0
  408. package/.next/server/chunks/ssr/_060itkv._.js +3 -0
  409. package/.next/server/chunks/ssr/_060itkv._.js.map +1 -0
  410. package/.next/server/chunks/ssr/{_0pydxc8._.js → _083cqy.._.js} +2 -2
  411. package/.next/server/chunks/ssr/_083cqy.._.js.map +1 -0
  412. package/.next/server/chunks/ssr/{_0lm8td~._.js → _08mbdt1._.js} +2 -2
  413. package/.next/server/chunks/ssr/_08mbdt1._.js.map +1 -0
  414. package/.next/server/chunks/ssr/_0938p.1._.js +3 -0
  415. package/.next/server/chunks/ssr/_0938p.1._.js.map +1 -0
  416. package/.next/server/chunks/ssr/_0ff5qav._.js +3 -0
  417. package/.next/server/chunks/ssr/_0ff5qav._.js.map +1 -0
  418. package/.next/server/chunks/ssr/_0g2e834._.js +3 -0
  419. package/.next/server/chunks/ssr/_0g2e834._.js.map +1 -0
  420. package/.next/server/chunks/ssr/_0gp8d.p._.js +3 -0
  421. package/.next/server/chunks/ssr/_0gp8d.p._.js.map +1 -0
  422. package/.next/server/chunks/ssr/_0k2j6-t._.js +3 -0
  423. package/.next/server/chunks/ssr/_0k2j6-t._.js.map +1 -0
  424. package/.next/server/chunks/ssr/_0kq5x2k._.js +3 -0
  425. package/.next/server/chunks/ssr/_0kq5x2k._.js.map +1 -0
  426. package/.next/server/chunks/ssr/_0mk7dqt._.js +3 -0
  427. package/.next/server/chunks/ssr/_0mk7dqt._.js.map +1 -0
  428. package/.next/server/chunks/ssr/_0qgn2wv._.js +3 -0
  429. package/.next/server/chunks/ssr/_0qgn2wv._.js.map +1 -0
  430. package/.next/server/chunks/ssr/_0t-2u_i._.js +3 -0
  431. package/.next/server/chunks/ssr/_0t-2u_i._.js.map +1 -0
  432. package/.next/server/chunks/ssr/_0vn5_62._.js +5 -0
  433. package/.next/server/chunks/ssr/_0vn5_62._.js.map +1 -0
  434. package/.next/server/chunks/ssr/{_01aim8_._.js → _0z1gdb3._.js} +2 -2
  435. package/.next/server/chunks/ssr/{_01aim8_._.js.map → _0z1gdb3._.js.map} +1 -1
  436. package/.next/server/chunks/ssr/_0~4ta0s._.js +3 -0
  437. package/.next/server/chunks/ssr/_0~4ta0s._.js.map +1 -0
  438. package/.next/server/chunks/ssr/_0~5r_8s._.js +3 -0
  439. package/.next/server/chunks/ssr/_0~5r_8s._.js.map +1 -0
  440. package/.next/server/chunks/ssr/_13mk_9n._.js.map +1 -1
  441. package/.next/server/chunks/ssr/packages_dashboard_src_0uxs9-.._.js +1 -1
  442. package/.next/server/chunks/ssr/packages_dashboard_src_0uxs9-.._.js.map +1 -1
  443. package/.next/server/chunks/ssr/packages_dashboard_src_app_settings_advanced_page_tsx_0o~_885._.js +1 -1
  444. package/.next/server/chunks/ssr/packages_dashboard_src_app_settings_advanced_page_tsx_0o~_885._.js.map +1 -1
  445. package/.next/server/chunks/ssr/packages_shared_dist_index_0kuvow-.js +2 -2
  446. package/.next/server/chunks/ssr/packages_shared_dist_index_0kuvow-.js.map +1 -1
  447. package/.next/server/middleware/middleware-manifest.json +1 -1
  448. package/.next/server/middleware-build-manifest.js +3 -3
  449. package/.next/server/middleware-manifest.json +1 -1
  450. package/.next/server/pages/404.html +1 -1
  451. package/.next/server/pages/500.html +1 -1
  452. package/.next/static/chunks/00qqwuw5id.21.js +1 -0
  453. package/.next/static/chunks/0_yam4jvco3~t.js +1 -0
  454. package/.next/static/chunks/{107sryfaib58g.js → 0kjwfju1fsjkk.js} +1 -1
  455. package/.next/static/chunks/0yt4prt55bas4.js +11 -0
  456. package/.next/static/chunks/{0v2k5twh.h_g2.js → 10_4_2h602xzk.js} +3 -3
  457. package/.next/trace +2 -2
  458. package/.next/trace-build +1 -1
  459. package/package.json +11 -11
  460. package/.next/server/chunks/ssr/_0-v4eqm._.js +0 -3
  461. package/.next/server/chunks/ssr/_0-v4eqm._.js.map +0 -1
  462. package/.next/server/chunks/ssr/_03ay~a6._.js +0 -3
  463. package/.next/server/chunks/ssr/_03ay~a6._.js.map +0 -1
  464. package/.next/server/chunks/ssr/_05ul8c5._.js +0 -3
  465. package/.next/server/chunks/ssr/_05ul8c5._.js.map +0 -1
  466. package/.next/server/chunks/ssr/_0_1u-~q._.js +0 -3
  467. package/.next/server/chunks/ssr/_0_1u-~q._.js.map +0 -1
  468. package/.next/server/chunks/ssr/_0ax_-cr._.js +0 -3
  469. package/.next/server/chunks/ssr/_0ax_-cr._.js.map +0 -1
  470. package/.next/server/chunks/ssr/_0czapf~._.js +0 -3
  471. package/.next/server/chunks/ssr/_0czapf~._.js.map +0 -1
  472. package/.next/server/chunks/ssr/_0dlwb-j._.js +0 -3
  473. package/.next/server/chunks/ssr/_0dlwb-j._.js.map +0 -1
  474. package/.next/server/chunks/ssr/_0dvtdxd._.js +0 -3
  475. package/.next/server/chunks/ssr/_0dvtdxd._.js.map +0 -1
  476. package/.next/server/chunks/ssr/_0h-sc1p._.js +0 -3
  477. package/.next/server/chunks/ssr/_0h-sc1p._.js.map +0 -1
  478. package/.next/server/chunks/ssr/_0k_zx~4._.js +0 -3
  479. package/.next/server/chunks/ssr/_0k_zx~4._.js.map +0 -1
  480. package/.next/server/chunks/ssr/_0kqlqn5._.js +0 -5
  481. package/.next/server/chunks/ssr/_0kqlqn5._.js.map +0 -1
  482. package/.next/server/chunks/ssr/_0lm8td~._.js.map +0 -1
  483. package/.next/server/chunks/ssr/_0pydxc8._.js.map +0 -1
  484. package/.next/server/chunks/ssr/_115_o9h._.js +0 -3
  485. package/.next/server/chunks/ssr/_115_o9h._.js.map +0 -1
  486. package/.next/static/chunks/07k3fjq54671q.js +0 -1
  487. package/.next/static/chunks/0o6q9amhembht.js +0 -1
  488. package/.next/static/chunks/0pbah5-djvzuh.js +0 -11
  489. package/.next/static/chunks/0sz8178y9b-~6.js +0 -1
  490. package/LICENSE +0 -21
  491. /package/.next/server/chunks/{[root-of-the-server]__0j~awob._.js.map → [root-of-the-server]__0dwxuh7._.js.map} +0 -0
  492. /package/.next/server/chunks/{[root-of-the-server]__04-hp3j._.js.map → [root-of-the-server]__0k7lkv6._.js.map} +0 -0
  493. /package/.next/static/{BS7xnS8j09zEzTFQ8HuEd → BoJYg5-EvFL480WsH6xGD}/_buildManifest.js +0 -0
  494. /package/.next/static/{BS7xnS8j09zEzTFQ8HuEd → BoJYg5-EvFL480WsH6xGD}/_clientMiddlewareManifest.js +0 -0
  495. /package/.next/static/{BS7xnS8j09zEzTFQ8HuEd → BoJYg5-EvFL480WsH6xGD}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[94085,a=>{"use strict";var b=a.i(81673),c=a.i(76015),d=a.i(32307),e=a.i(42732),f=a.i(92241);let g=(0,a.i(5423).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 h=a.i(70297),i=a.i(96336),j=a.i(14859),k=a.i(81130),l=a.i(62588),m=a.i(59974),n=a.i(54150),o=a.i(78933),p=a.i(92379),q=a.i(21218),r=a.i(30400),s=a.i(57216),t=a.i(23780),u=a.i(28314),v=a.i(48558),w=a.i(56295),x=a.i(74345);function y(){let a=(0,k.useQueryClient)(),[d,e]=(0,c.useState)(!1),[h,i]=(0,c.useState)(!1),[j,n]=(0,c.useState)(null),{data:o}=(0,l.useQuery)({queryKey:["voice-status"],queryFn:async()=>{try{return await m.api.get("/voice/status")}catch(a){if(h)return{enabled:!1,installing:!0,installed:!0,status:"running",error:null,startedAt:null,finishedAt:null,model:"Xenova/whisper-small",progress:null};throw a}},refetchInterval:a=>{let b=a.state.data;return!!(h||b?.installing||b?.status==="running")&&1500},refetchOnWindowFocus:!1});(0,c.useEffect)(()=>{h&&o?.enabled&&(i(!1),a.invalidateQueries({queryKey:["config"]}))},[h,o?.enabled,a]),(0,c.useEffect)(()=>{o?.status!=="ready"||o.enabled||i(!0)},[o?.status,o?.enabled]);let p=async()=>{n(null),e(!0);try{await m.api.post("/voice/install"),await a.invalidateQueries({queryKey:["voice-status"]})}catch(a){n(a instanceof m.ApiError?a.message:"Install failed")}finally{e(!1)}},s=o?.enabled??!1,t=d||(o?.installing??!1)||h,u=o?.progress??null,w=j??o?.error??null;return(0,b.jsxs)(r.Card,{children:[(0,b.jsx)(r.CardHeader,{children:(0,b.jsxs)(r.CardTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(g,{className:"h-4 w-4"}),"Voice Mode"]})}),(0,b.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,b.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. Default off — no model is downloaded until you turn it on. Model:"," ",(0,b.jsx)("code",{children:o?.model??"Xenova/whisper-small"})," (~244 MB). See"," ",(0,b.jsx)("code",{children:"docs/design/appendices/voice-transcription.md"})," for implementation details."]}),w&&(0,b.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:w}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("p",{className:"text-sm",children:["Status:"," ",(0,b.jsx)("span",{className:"font-medium",children:t?h?"Restarting daemon to apply…":u?.phase==="ready"?"Finalizing…":u?.currentFile?`Downloading ${u.currentFile}…`:"Starting model download…":s?"Enabled":"Disabled"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Turning this on downloads the Whisper weights (~244 MB), then auto-restarts the daemon so the transcriber initializes with the new flag. The first download takes a minute or two depending on your connection."})]}),(0,b.jsx)(q.Button,{size:"sm",variant:s?"outline":"default",onClick:p,disabled:d||t||s,children:t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Loader2,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Working…"]}):s?"Enabled":"Enable & install"})]}),t&&!h&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",children:(0,b.jsx)("div",{className:(0,v.cn)("h-full bg-primary transition-[width] duration-200",(!u||0===u.percent)&&"animate-pulse"),style:{width:`${Math.min(100,Math.max(u?.percent??0,u?2:8))}%`}})}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums",children:[(0,b.jsxs)("span",{children:[u&&u.totalBytes>0?`${B(u.loadedBytes)} / ${B(u.totalBytes)}`:"Contacting Hugging Face…",u&&u.filesDownloaded>0&&(0,b.jsxs)(b.Fragment,{children:[" · ",u.filesDownloaded," file",1===u.filesDownloaded?"":"s"," complete"]})]}),(0,b.jsx)("span",{children:u&&u.percent>0?`${Math.round(u.percent)}%`:""})]})]})]})]})}async function z(a){switch(a){case"reset-config":return m.api.post("/system/reset-config");case"purge-history":return m.api.post("/system/purge-history");case"wipe-context":return m.api.post("/system/wipe-context");case"reinstall-context":return m.api.post("/system/reinstall-context",{confirm:"CLEAN"});case"factory-reset":return m.api.post("/system/factory-reset")}}function A(a,b){switch(a){case"reset-config":b.invalidateQueries({queryKey:["config"]});return;case"purge-history":b.invalidateQueries({queryKey:["conversations"]}),b.invalidateQueries({queryKey:["events"]}),b.invalidateQueries({queryKey:["cost"]});return;case"wipe-context":case"reinstall-context":b.invalidateQueries({queryKey:["context"]}),b.invalidateQueries({queryKey:["setup-status"]});return;case"factory-reset":b.invalidateQueries();return}}function B(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(1)} GB`}function C(){let[a,f]=(0,c.useState)(!1),[g,l]=(0,c.useState)(null),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(null),w=(0,u.useConfirm)(),x=(0,k.useQueryClient)(),y=async(a,b)=>{if(await w({title:b.title,description:b.description,confirmLabel:b.confirmLabel,variant:"destructive"})&&(!b.doubleConfirm||await w({title:b.doubleConfirm.title,description:b.doubleConfirm.description,confirmLabel:b.doubleConfirm.confirmLabel,variant:"destructive",requireText:b.doubleConfirm.requireText}))){l(a),o(null),q(null);try{let c=await z(a);A(a,x),q(b.successMessage(c))}catch(a){o(a instanceof m.ApiError?a.message:"Request failed")}finally{l(null)}}};return(0,b.jsx)(s.Collapsible,{open:a,onOpenChange:f,children:(0,b.jsxs)(r.Card,{className:"border-destructive/40",children:[(0,b.jsx)(s.CollapsibleTrigger,{asChild:!0,children:(0,b.jsx)(r.CardHeader,{className:"cursor-pointer select-none",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.ChevronRight,{className:(0,v.cn)("h-4 w-4 text-destructive transition-transform",a&&"rotate-90")}),(0,b.jsx)(d.AlertTriangle,{className:"h-4 w-4 text-destructive"}),(0,b.jsx)(r.CardTitle,{className:"text-destructive",children:"Danger Zone"})]})})}),(0,b.jsx)(s.CollapsibleContent,{children:(0,b.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground max-w-prose",children:"Destructive actions that cannot be undone. Each action requires confirmation before executing."}),n&&(0,b.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:n}),p&&(0,b.jsx)("p",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:p}),(0,b.jsx)(D,{title:"Reset all config to defaults",description:"Restores every runtime setting to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.",icon:(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reset config",busy:"reset-config"===g,disabled:null!==g,onClick:()=>y("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) and integration credentials are not affected.",confirmLabel:"Reset config",successMessage:a=>`Cleared ${a.cleared??0} runtime setting(s).`})}),(0,b.jsx)(t.Separator,{}),(0,b.jsx)(D,{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,b.jsx)(i.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Delete history",busy:"purge-history"===g,disabled:null!==g,onClick:()=>y("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:a=>`Deleted ${a.deletedSessions??0} session(s), ${a.deletedMessages??0} message(s), ${a.deletedActions??0} action(s).`})}),(0,b.jsx)(t.Separator,{}),(0,b.jsx)(D,{title:"Wipe context files",description:"Deletes every file under the active primary vault and fallback context directory, including rules/management.md. Runtime settings, credentials, history, and integrations are preserved.",icon:(0,b.jsx)(i.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Wipe context",busy:"wipe-context"===g,disabled:null!==g,onClick:()=>y("wipe-context",{title:"Wipe all context files?",description:"Deletes every file under the active primary vault and fallback context directory — including rules/management.md, so the daemon will re-enter rules setup. Runtime settings, credentials, history, and integrations are preserved.",confirmLabel:"Wipe context",successMessage:a=>`Removed ${a.removed??0} context entr(y/ies).`})}),(0,b.jsx)(t.Separator,{}),(0,b.jsx)(D,{title:"Reinstall context (B-007 clean)",description:"Safer alternative to Wipe context: writes a tarball backup first, then wipes context/ + md_file_snapshots. Conversation history and other SQLite tables are preserved. Restart the daemon to re-seed the vault from templates.",icon:(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reinstall context",busy:"reinstall-context"===g,disabled:null!==g,onClick:()=>(async()=>{l("reinstall-context"),o(null),q(null);try{let a,b=await m.api.get("/system/reinstall-context/plan");if(!await w({title:"Clean reinstall of context/ (B-007)?",description:(a=b.ancillaryDirs.length>0?`Ancillary caches to remove: ${b.ancillaryDirs.join(", ")}.`:"No ancillary caches are scheduled for removal.",[`This will remove ${b.fileCount} file(s) (${B(b.totalBytes)}) from ${b.contextDir}, clear ${b.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,a,`Backup tarball path: ${b.backupPath}`].join(" ")),confirmLabel:"Continue",variant:"destructive"})||!await w({title:"Type CLEAN to confirm",description:`Backup tarball: ${b.backupPath}. Proceed to remove ${b.fileCount} file(s) and clear ${b.snapshotRowCount} snapshot row(s).`,confirmLabel:"Reinstall context",variant:"destructive",requireText:"CLEAN"}))return;let c=await z("reinstall-context");A("reinstall-context",x),q(`Reinstalled. Removed ${c.filesDeleted??0} file(s), cleared ${c.snapshotRowsDeleted??0} snapshot row(s). Backup at ${c.backupPath??b.backupPath}.`)}catch(a){o(a instanceof m.ApiError?a.message:"Request failed")}finally{l(null)}})()}),(0,b.jsx)(t.Separator,{}),(0,b.jsx)(D,{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,b.jsx)(j.Zap,{className:"h-3.5 w-3.5 mr-1"}),label:"Factory reset",busy:"factory-reset"===g,disabled:null!==g,onClick:()=>y("factory-reset",{title:"Factory reset — really?",description:"This clears EVERYTHING on this device: conversation history, action logs, runtime settings, context files (including rules/management.md), keychain secrets, encrypted blobs, uploaded attachments, session workdirs, backups, caches, user skills, integrations.md, and every user-data table — backends, mail accounts, recurring schedules, receipts, books + reading highlights, travel bookings, parse failures, runtime state, auth telemetry. The daemon compacts the SQLite DB afterward. Restart it 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:a=>{let b="string"==typeof a.status?a.status:"reset",c=Array.isArray(a.errors)?a.errors.length:0,d=Array.isArray(a.adapterReloadErrors)?a.adapterReloadErrors.length:0;return"reset_with_errors"===b||c>0||d>0?`Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${c} reset step warning(s), ${d} adapter reload warning(s).)`:"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters."}})})]})})]})})}function D({title:a,description:c,icon:d,label:e,busy:f,disabled:g,onClick:h}){return(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"text-sm font-medium",children:a}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]}),(0,b.jsxs)(q.Button,{variant:"destructive",size:"sm",onClick:h,disabled:g,className:"shrink-0",children:[d,f?"Working...":e]})]})}a.s(["default",0,function(){let{data:a}=(0,n.useConfig)(),{df:d}=(0,n.useConfigDefaults)(),{toast:e,showToast:f}=(0,o.useSaveConfig)(),{deferSaveFor:g,dv:i,dirtyFields:j,clearDirtyKeys:l}=(0,p.useDirtyFields)(),s=(0,k.useQueryClient)(),v=(0,u.useConfirm)(),[z,A]=(0,c.useState)(!1),B=async()=>{if(await v({title:"Reset disallowed tools to defaults?",description:"This will restore the default safety tool list, replacing any customizations.",confirmLabel:"Reset",variant:"destructive"})){A(!0);try{await m.api.post("/config/reset-safety"),s.invalidateQueries({queryKey:["config"]}),l(["disallowedTools","allowedToolsOverride"]),f("success","Safety tools reset to defaults")}finally{A(!1)}}};if(!a)return(0,b.jsx)("div",{className:"text-muted-foreground",children:"Loading..."});let D=g(a);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Advanced"}),(0,b.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-muted-foreground",children:"Power-user knobs and safety settings. Most of these are low-level — read each description carefully before saving."})]}),(0,b.jsx)(x.SettingsToast,{toast:e}),(0,b.jsxs)(r.Card,{children:[(0,b.jsx)(r.CardHeader,{children:(0,b.jsx)(r.CardTitle,{children:"Safety — Tool Policy"})}),(0,b.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Guardrails applied to every Claude Code tool call, enforced by the SDK before the tool runs. Entries are either a plain tool name (",(0,b.jsx)("code",{children:"Write"}),", ",(0,b.jsx)("code",{children:"WebFetch"}),") or a tool name with an argument pattern in parentheses (",(0,b.jsx)("code",{children:"Bash(rm -rf *)"}),") to match only specific invocations."," ",(0,b.jsx)("strong",{children:"Disallowed wins over allowed"})," — any match in the disallowed list blocks the call even if allowed override covers it. Per-backend Allow-mode toggle has moved to"," ",(0,b.jsx)("strong",{children:"Settings → Models & Cost"})," so each backend can be flipped independently."]}),(0,b.jsx)(w.EditableArrayField,{label:"Disallowed Tools",values:i("disallowedTools",a.disallowedTools),configKey:"disallowedTools",variant:"red",placeholder:"e.g. Bash(rm -rf *)",modified:j.has("disallowedTools"),onSave:D}),(0,b.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 known-dangerous file operations. Use Reset to Defaults below to restore them after experimenting."}),(0,b.jsx)(t.Separator,{}),(0,b.jsx)(w.EditableArrayField,{label:"Allowed Tools Override",values:i("allowedToolsOverride",a.allowedTools),configKey:"allowedToolsOverride",variant:"green",placeholder:"e.g. Bash(git push)",modified:j.has("allowedToolsOverride"),onSave:D}),(0,b.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 (e.g. allow"," ",(0,b.jsx)("code",{children:"Bash(git push)"})," while keeping arbitrary ",(0,b.jsx)("code",{children:"Bash"})," ","blocked)."]}),(0,b.jsx)(t.Separator,{}),(0,b.jsxs)(q.Button,{variant:"outline",size:"sm",onClick:B,disabled:z,children:[(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),z?"Resetting...":"Reset to Defaults"]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Restores the built-in disallowed-tool list and"," ",(0,b.jsx)("strong",{children:"also clears the allowed override list"}),", replacing any customizations in both. Use this if your safety config has drifted and you want a clean slate."]})]})]}),(0,b.jsx)(y,{}),(0,b.jsxs)(w.ConfigSection,{title:"Polling Intervals",children:[(0,b.jsx)("p",{className:"pb-2 text-xs text-muted-foreground",children:"How often each observer polls its source for changes. Lower values mean faster detection but more I/O. Changes apply immediately — no restart required."}),(0,b.jsx)(w.EditableField,{label:"Obsidian Debounce",value:i("obsidianDebounceSeconds",a.obsidianDebounceSeconds),configKey:"obsidianDebounceSeconds",type:"number",suffix:"sec",modified:j.has("obsidianDebounceSeconds"),defaultValue:d("obsidianDebounceSeconds"),description:"Seconds to wait after a vault file change before recording it as an observation. Prevents rapid-fire edits from flooding the observation queue.",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Scheduler Poll Interval",value:i("schedulePollIntervalSeconds",a.schedulePollIntervalSeconds),configKey:"schedulePollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("schedulePollIntervalSeconds"),defaultValue:d("schedulePollIntervalSeconds"),description:"Seconds between scheduler wake-ups that look for pending work. Lower values make recurring tasks fire closer to their target time.",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Git Poll Interval",value:i("gitPollIntervalSeconds",a.gitPollIntervalSeconds),configKey:"gitPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("gitPollIntervalSeconds"),defaultValue:d("gitPollIntervalSeconds"),description:"Seconds between Git lifecycle checks in watched repos. Default 3600 (1 hour).",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Notion Poll Interval",value:i("notionPollIntervalSeconds",a.notionPollIntervalSeconds),configKey:"notionPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("notionPollIntervalSeconds"),defaultValue:d("notionPollIntervalSeconds"),description:"Seconds between Notion database sync checks. Raising this above ~600 may require adjusting NOTION_WRITE_TTL_MS in the daemon. Default 300 (5 min).",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Calendar Poll Interval",value:i("calendarPollIntervalSeconds",a.calendarPollIntervalSeconds),configKey:"calendarPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("calendarPollIntervalSeconds"),defaultValue:d("calendarPollIntervalSeconds"),description:"Seconds between Google Calendar event sync checks. Default 300 (5 min).",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Gmail Poll Interval",value:i("gmailPollIntervalSeconds",a.gmailPollIntervalSeconds),configKey:"gmailPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("gmailPollIntervalSeconds"),defaultValue:d("gmailPollIntervalSeconds"),description:"Seconds between Gmail inbox scans for travel bookings and receipt attachments. Requires restart because the poller interval is fixed at startup.",onSave:D})]}),(0,b.jsxs)(w.ConfigSection,{title:"History Injection",children:[(0,b.jsx)("p",{className:"pb-2 text-xs text-muted-foreground",children:"Controls how much prior conversation context is injected into new sessions. Higher values preserve continuity across sessions; lower values save tokens."}),(0,b.jsx)(w.EditableField,{label:"Max Messages",value:i("historyInjectionMaxMessages",a.historyInjectionMaxMessages),configKey:"historyInjectionMaxMessages",type:"number",modified:j.has("historyInjectionMaxMessages"),defaultValue:d("historyInjectionMaxMessages"),description:"Maximum number of prior messages to include when opening a new session in an existing conversation thread.",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Max Tokens",value:i("historyInjectionMaxTokens",a.historyInjectionMaxTokens),configKey:"historyInjectionMaxTokens",type:"number",modified:j.has("historyInjectionMaxTokens"),defaultValue:d("historyInjectionMaxTokens"),description:"Token budget for injected history. Messages are trimmed oldest-first to stay within this limit.",onSave:D}),(0,b.jsx)(w.EditableBooleanField,{label:"Strict DM Staleness",value:i("dmStalenessStrict",a.dmStalenessStrict),configKey:"dmStalenessStrict",modified:j.has("dmStalenessStrict"),defaultValue:d("dmStalenessStrict"),description:"When enabled, every prompt-context write invalidates active DM sessions. Leave off to allow append-only logs and derived indexes to stay quiet.",onSave:D})]}),(0,b.jsxs)(w.ConfigSection,{title:"Infrastructure",children:[(0,b.jsx)(w.EditableField,{label:"API Port",value:i("apiPort",a.apiPort),configKey:"apiPort",type:"number",modified:j.has("apiPort"),defaultValue:d("apiPort"),description:"Local TCP port the Hono daemon listens on. Requires a daemon restart to take effect. Changing this will break integrations that reference the old port.",onSave:D}),(0,b.jsx)(w.EditableBooleanField,{label:"Disable Auth Probes",value:i("authProbeDisabled",a.authProbeDisabled),configKey:"authProbeDisabled",modified:j.has("authProbeDisabled"),defaultValue:d("authProbeDisabled"),description:"When enabled, the periodic auth health probe (checkAll) becomes a no-op. Use this to suppress probe traffic if you know a backend is intentionally offline.",onSave:D}),(0,b.jsx)(w.EditableField,{label:"Auth Preflight Freshness",value:i("authPreflightFreshnessMs",a.authPreflightFreshnessMs),configKey:"authPreflightFreshnessMs",type:"number",suffix:"ms",modified:j.has("authPreflightFreshnessMs"),defaultValue:d("authPreflightFreshnessMs"),description:"How long an expired or missing backend-auth result stays fresh for preflight routing. Set to 0 to disable the cache and always re-check.",onSave:D})]}),(0,b.jsx)(C,{})]})}],94085)}];
1
+ module.exports=[94085,a=>{"use strict";var b=a.i(81673),c=a.i(76015),d=a.i(32307),e=a.i(42732),f=a.i(92241);let g=(0,a.i(5423).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 h=a.i(70297),i=a.i(96336),j=a.i(14859),k=a.i(81130),l=a.i(62588);a.i(70010);var m=a.i(35875),n=a.i(59974),o=a.i(54150),p=a.i(78933),q=a.i(92379),r=a.i(21218),s=a.i(30400),t=a.i(57216),u=a.i(47696),v=a.i(23780),w=a.i(28314),x=a.i(48558),y=a.i(56295),z=a.i(74345);function A(){let a=(0,k.useQueryClient)(),[d,e]=(0,c.useState)(!1),[h,i]=(0,c.useState)(!1),[j,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(null),{data:t}=(0,l.useQuery)({queryKey:["voice-status"],queryFn:async()=>{try{return await n.api.get("/voice/status")}catch(a){if(h)return{enabled:!1,installing:!0,installed:!0,modelOnDisk:!1,status:"running",error:null,startedAt:null,finishedAt:null,model:"onnx-community/whisper-large-v3-turbo",progress:null,primaryLanguage:null,suggestedPrimaryLanguage:"en"};throw a}},refetchInterval:a=>{let b=a.state.data;return!!(h||b?.installing||b?.status==="running")&&1500},refetchOnWindowFocus:!1});(0,c.useEffect)(()=>{if(!t)return;let a=t.primaryLanguage??t.suggestedPrimaryLanguage;q(b=>b??a)},[t?.primaryLanguage,t?.suggestedPrimaryLanguage,t]),(0,c.useEffect)(()=>{h&&t?.enabled&&(i(!1),a.invalidateQueries({queryKey:["config"]}))},[h,t?.enabled,a]),(0,c.useEffect)(()=>{t?.status!=="ready"||t.enabled||i(!0)},[t?.status,t?.enabled]);let v=async()=>{o(null),e(!0);try{await n.api.post("/voice/install",{primaryLanguage:p}),await a.invalidateQueries({queryKey:["voice-status"]})}catch(a){o(a instanceof n.ApiError?a.message:"Install failed")}finally{e(!1)}},w=async b=>{o(null),e(!0);try{await n.api.patch("/config",{voiceTranscriptionPrimaryLanguage:b}),q(b),await a.invalidateQueries({queryKey:["voice-status"]}),await a.invalidateQueries({queryKey:["config"]})}catch(a){o(a instanceof n.ApiError?a.message:"Saving primary language failed")}finally{e(!1)}},y=t?.enabled??!1,z=d||(t?.installing??!1)||h,A=t?.progress??null,B=j??t?.error??null,C=y&&t?.modelOnDisk===!1&&!z,E=(0,c.useMemo)(()=>{let a=new Set(m.VOICE_LANGUAGE_TOP.map(a=>a.code)),b=m.VOICE_LANGUAGE_FULL.filter(b=>!a.has(b.code)).slice().sort((a,b)=>a.englishName.localeCompare(b.englishName));return{top:m.VOICE_LANGUAGE_TOP,more:b}},[]),F=a=>(0,b.jsxs)(u.Select,{value:p??void 0,onValueChange:a=>q(a),disabled:z,children:[(0,b.jsx)(u.SelectTrigger,{id:a,className:"w-full max-w-sm",children:(0,b.jsx)(u.SelectValue,{placeholder:"Select language…"})}),(0,b.jsxs)(u.SelectContent,{children:[E.top.length>0&&(0,b.jsxs)(u.SelectGroup,{children:[(0,b.jsx)(u.SelectLabel,{children:"Common"}),E.top.map(a=>(0,b.jsxs)(u.SelectItem,{value:a.code,children:[a.nativeName,a.nativeName!==a.englishName&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ",a.englishName]})]},a.code))]}),E.more.length>0&&(0,b.jsxs)(u.SelectGroup,{children:[(0,b.jsx)(u.SelectLabel,{children:"More languages"}),E.more.map(a=>(0,b.jsxs)(u.SelectItem,{value:a.code,children:[a.nativeName,a.nativeName!==a.englishName&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ",a.englishName]})]},a.code))]})]})]});return(0,b.jsxs)(s.Card,{children:[(0,b.jsx)(s.CardHeader,{children:(0,b.jsxs)(s.CardTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(g,{className:"h-4 w-4"}),"Voice Mode"]})}),(0,b.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,b.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. Default off — no model is downloaded until you turn it on. Model:"," ",(0,b.jsx)("code",{children:t?.model??"onnx-community/whisper-large-v3-turbo"})," ","(~800 MB). See"," ",(0,b.jsx)("code",{children:"docs/design/appendices/voice-transcription.md"})," for implementation details."]}),B&&(0,b.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:B}),C&&(0,b.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2 text-xs",children:[(0,b.jsx)("p",{className:"font-medium text-amber-700 dark:text-amber-400",children:"Upgrade voice model"}),(0,b.jsxs)("p",{className:"text-muted-foreground mt-0.5",children:["The configured model"," ",(0,b.jsx)("code",{children:t?.model})," is not yet downloaded — likely because a package update changed the default. Click"," ",(0,b.jsx)("strong",{children:"Upgrade & install"})," below to fetch it. Inbound voice will keep using the previous model until then."]})]}),!y&&!z&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:"voice-primary-language",className:"text-sm font-medium",children:"Your primary spoken language"}),(0,b.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,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("p",{className:"text-sm",children:["Status:"," ",(0,b.jsx)("span",{className:"font-medium",children:z?h?"Restarting daemon to apply…":A?.phase==="ready"?"Finalizing…":A?.currentFile?`Downloading ${A.currentFile}…`:"Starting model download…":y?C?"Enabled (upgrade available)":"Enabled":"Disabled"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:y?"Inbound audio is transcribed locally before it reaches the agent. Change your primary language at any time below.":"Turning this on downloads the Whisper weights (~800 MB), then auto-restarts the daemon so the transcriber initializes with the new flag. The first download takes a minute or two depending on your connection."})]}),(0,b.jsx)(r.Button,{size:"sm",variant:y&&!C?"outline":"default",onClick:v,disabled:d||z||y&&!C||null===p,children:z?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Loader2,{className:"h-3.5 w-3.5 mr-1 animate-spin"}),"Working…"]}):C?"Upgrade & install":y?"Enabled":"Enable & install"})]}),y&&!z&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{htmlFor:"voice-primary-language-live",className:"text-sm font-medium",children:"Primary spoken language"}),(0,b.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,b.jsxs)("div",{className:"flex items-center gap-2",children:[F("voice-primary-language-live"),(0,b.jsx)(r.Button,{size:"sm",variant:"outline",disabled:d||null===p||p===t?.primaryLanguage,onClick:()=>{p&&w(p)},children:"Save"})]})]}),z&&!h&&(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-muted",children:(0,b.jsx)("div",{className:(0,x.cn)("h-full bg-primary transition-[width] duration-200",(!A||0===A.percent)&&"animate-pulse"),style:{width:`${Math.min(100,Math.max(A?.percent??0,A?2:8))}%`}})}),(0,b.jsxs)("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums",children:[(0,b.jsxs)("span",{children:[A&&A.totalBytes>0?`${D(A.loadedBytes)} / ${D(A.totalBytes)}`:"Contacting Hugging Face…",A&&A.filesDownloaded>0&&(0,b.jsxs)(b.Fragment,{children:[" · ",A.filesDownloaded," file",1===A.filesDownloaded?"":"s"," complete"]})]}),(0,b.jsx)("span",{children:A&&A.percent>0?`${Math.round(A.percent)}%`:""})]})]})]})]})}async function B(a){switch(a){case"reset-config":return n.api.post("/system/reset-config");case"purge-history":return n.api.post("/system/purge-history");case"wipe-context":return n.api.post("/system/wipe-context");case"reinstall-context":return n.api.post("/system/reinstall-context",{confirm:"CLEAN"});case"factory-reset":return n.api.post("/system/factory-reset")}}function C(a,b){switch(a){case"reset-config":b.invalidateQueries({queryKey:["config"]});return;case"purge-history":b.invalidateQueries({queryKey:["conversations"]}),b.invalidateQueries({queryKey:["events"]}),b.invalidateQueries({queryKey:["cost"]});return;case"wipe-context":case"reinstall-context":b.invalidateQueries({queryKey:["context"]}),b.invalidateQueries({queryKey:["setup-status"]});return;case"factory-reset":b.invalidateQueries();return}}function D(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:a<0x40000000?`${(a/1048576).toFixed(1)} MB`:`${(a/0x40000000).toFixed(1)} GB`}function E(){let[a,f]=(0,c.useState)(!1),[g,l]=(0,c.useState)(null),[m,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(null),r=(0,w.useConfirm)(),u=(0,k.useQueryClient)(),y=async(a,b)=>{if(await r({title:b.title,description:b.description,confirmLabel:b.confirmLabel,variant:"destructive"})&&(!b.doubleConfirm||await r({title:b.doubleConfirm.title,description:b.doubleConfirm.description,confirmLabel:b.doubleConfirm.confirmLabel,variant:"destructive",requireText:b.doubleConfirm.requireText}))){l(a),o(null),q(null);try{let c=await B(a);C(a,u),q(b.successMessage(c))}catch(a){o(a instanceof n.ApiError?a.message:"Request failed")}finally{l(null)}}};return(0,b.jsx)(t.Collapsible,{open:a,onOpenChange:f,children:(0,b.jsxs)(s.Card,{className:"border-destructive/40",children:[(0,b.jsx)(t.CollapsibleTrigger,{asChild:!0,children:(0,b.jsx)(s.CardHeader,{className:"cursor-pointer select-none",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.ChevronRight,{className:(0,x.cn)("h-4 w-4 text-destructive transition-transform",a&&"rotate-90")}),(0,b.jsx)(d.AlertTriangle,{className:"h-4 w-4 text-destructive"}),(0,b.jsx)(s.CardTitle,{className:"text-destructive",children:"Danger Zone"})]})})}),(0,b.jsx)(t.CollapsibleContent,{children:(0,b.jsxs)("div",{className:"space-y-4 pb-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground max-w-prose",children:"Destructive actions that cannot be undone. Each action requires confirmation before executing."}),m&&(0,b.jsx)("p",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:m}),p&&(0,b.jsx)("p",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:p}),(0,b.jsx)(F,{title:"Reset all config to defaults",description:"Restores every runtime setting to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.",icon:(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reset config",busy:"reset-config"===g,disabled:null!==g,onClick:()=>y("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) and integration credentials are not affected.",confirmLabel:"Reset config",successMessage:a=>`Cleared ${a.cleared??0} runtime setting(s).`})}),(0,b.jsx)(v.Separator,{}),(0,b.jsx)(F,{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,b.jsx)(i.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Delete history",busy:"purge-history"===g,disabled:null!==g,onClick:()=>y("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:a=>`Deleted ${a.deletedSessions??0} session(s), ${a.deletedMessages??0} message(s), ${a.deletedActions??0} action(s).`})}),(0,b.jsx)(v.Separator,{}),(0,b.jsx)(F,{title:"Wipe context files",description:"Deletes every file under the active primary vault and fallback context directory, including rules/management.md. Runtime settings, credentials, history, and integrations are preserved.",icon:(0,b.jsx)(i.Trash2,{className:"h-3.5 w-3.5 mr-1"}),label:"Wipe context",busy:"wipe-context"===g,disabled:null!==g,onClick:()=>y("wipe-context",{title:"Wipe all context files?",description:"Deletes every file under the active primary vault and fallback context directory — including rules/management.md, so the daemon will re-enter rules setup. Runtime settings, credentials, history, and integrations are preserved.",confirmLabel:"Wipe context",successMessage:a=>`Removed ${a.removed??0} context entr(y/ies).`})}),(0,b.jsx)(v.Separator,{}),(0,b.jsx)(F,{title:"Reinstall context (B-007 clean)",description:"Safer alternative to Wipe context: writes a tarball backup first, then wipes context/ + md_file_snapshots. Conversation history and other SQLite tables are preserved. Restart the daemon to re-seed the vault from templates.",icon:(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),label:"Reinstall context",busy:"reinstall-context"===g,disabled:null!==g,onClick:()=>(async()=>{l("reinstall-context"),o(null),q(null);try{let a,b=await n.api.get("/system/reinstall-context/plan");if(!await r({title:"Clean reinstall of context/ (B-007)?",description:(a=b.ancillaryDirs.length>0?`Ancillary caches to remove: ${b.ancillaryDirs.join(", ")}.`:"No ancillary caches are scheduled for removal.",[`This will remove ${b.fileCount} file(s) (${D(b.totalBytes)}) from ${b.contextDir}, clear ${b.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,a,`Backup tarball path: ${b.backupPath}`].join(" ")),confirmLabel:"Continue",variant:"destructive"})||!await r({title:"Type CLEAN to confirm",description:`Backup tarball: ${b.backupPath}. Proceed to remove ${b.fileCount} file(s) and clear ${b.snapshotRowCount} snapshot row(s).`,confirmLabel:"Reinstall context",variant:"destructive",requireText:"CLEAN"}))return;let c=await B("reinstall-context");C("reinstall-context",u),q(`Reinstalled. Removed ${c.filesDeleted??0} file(s), cleared ${c.snapshotRowsDeleted??0} snapshot row(s). Backup at ${c.backupPath??b.backupPath}.`)}catch(a){o(a instanceof n.ApiError?a.message:"Request failed")}finally{l(null)}})()}),(0,b.jsx)(v.Separator,{}),(0,b.jsx)(F,{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,b.jsx)(j.Zap,{className:"h-3.5 w-3.5 mr-1"}),label:"Factory reset",busy:"factory-reset"===g,disabled:null!==g,onClick:()=>y("factory-reset",{title:"Factory reset — really?",description:"This clears EVERYTHING on this device: conversation history, action logs, runtime settings, context files (including rules/management.md), keychain secrets, encrypted blobs, uploaded attachments, session workdirs, backups, caches, user skills, integrations.md, and every user-data table — backends, mail accounts, recurring schedules, receipts, books + reading highlights, travel bookings, parse failures, runtime state, auth telemetry. The daemon compacts the SQLite DB afterward. Restart it 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:a=>{let b="string"==typeof a.status?a.status:"reset",c=Array.isArray(a.errors)?a.errors.length:0,d=Array.isArray(a.adapterReloadErrors)?a.adapterReloadErrors.length:0;return"reset_with_errors"===b||c>0||d>0?`Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${c} reset step warning(s), ${d} adapter reload warning(s).)`:"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters."}})})]})})]})})}function F({title:a,description:c,icon:d,label:e,busy:f,disabled:g,onClick:h}){return(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"text-sm font-medium",children:a}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]}),(0,b.jsxs)(r.Button,{variant:"destructive",size:"sm",onClick:h,disabled:g,className:"shrink-0",children:[d,f?"Working...":e]})]})}a.s(["default",0,function(){let{data:a}=(0,o.useConfig)(),{df:d}=(0,o.useConfigDefaults)(),{toast:e,showToast:f}=(0,p.useSaveConfig)(),{deferSaveFor:g,dv:i,dirtyFields:j,clearDirtyKeys:l}=(0,q.useDirtyFields)(),m=(0,k.useQueryClient)(),t=(0,w.useConfirm)(),[u,x]=(0,c.useState)(!1),B=async()=>{if(await t({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 n.api.post("/config/reset-safety"),m.invalidateQueries({queryKey:["config"]}),l(["disallowedTools","allowedToolsOverride"]),f("success","Safety tools reset to defaults")}finally{x(!1)}}};if(!a)return(0,b.jsx)("div",{className:"text-muted-foreground",children:"Loading..."});let C=g(a);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Advanced"}),(0,b.jsx)("p",{className:"mt-1 max-w-3xl text-sm text-muted-foreground",children:"Power-user knobs and safety settings. Most of these are low-level — read each description carefully before saving."})]}),(0,b.jsx)(z.SettingsToast,{toast:e}),(0,b.jsxs)(s.Card,{children:[(0,b.jsx)(s.CardHeader,{children:(0,b.jsx)(s.CardTitle,{children:"Safety — Tool Policy"})}),(0,b.jsxs)("div",{className:"space-y-3 [&>p]:max-w-prose",children:[(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Guardrails applied to every Claude Code tool call, enforced by the SDK before the tool runs. Entries are either a plain tool name (",(0,b.jsx)("code",{children:"Write"}),", ",(0,b.jsx)("code",{children:"WebFetch"}),") or a tool name with an argument pattern in parentheses (",(0,b.jsx)("code",{children:"Bash(rm -rf *)"}),") to match only specific invocations."," ",(0,b.jsx)("strong",{children:"Disallowed wins over allowed"})," — any match in the disallowed list blocks the call even if allowed override covers it. Per-backend Allow-mode toggle has moved to"," ",(0,b.jsx)("strong",{children:"Settings → Models & Cost"})," so each backend can be flipped independently."]}),(0,b.jsx)(y.EditableArrayField,{label:"Disallowed Tools",values:i("disallowedTools",a.disallowedTools),configKey:"disallowedTools",variant:"red",placeholder:"e.g. Bash(rm -rf *)",modified:j.has("disallowedTools"),onSave:C}),(0,b.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 known-dangerous file operations. Use Reset to Defaults below to restore them after experimenting."}),(0,b.jsx)(v.Separator,{}),(0,b.jsx)(y.EditableArrayField,{label:"Allowed Tools Override",values:i("allowedToolsOverride",a.allowedTools),configKey:"allowedToolsOverride",variant:"green",placeholder:"e.g. Bash(git push)",modified:j.has("allowedToolsOverride"),onSave:C}),(0,b.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 (e.g. allow"," ",(0,b.jsx)("code",{children:"Bash(git push)"})," while keeping arbitrary ",(0,b.jsx)("code",{children:"Bash"})," ","blocked)."]}),(0,b.jsx)(v.Separator,{}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:B,disabled:u,children:[(0,b.jsx)(h.RotateCcw,{className:"h-3.5 w-3.5 mr-1"}),u?"Resetting...":"Reset to Defaults"]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Restores the built-in disallowed-tool list and"," ",(0,b.jsx)("strong",{children:"also clears the allowed override list"}),", replacing any customizations in both. Use this if your safety config has drifted and you want a clean slate."]})]})]}),(0,b.jsx)(A,{}),(0,b.jsxs)(y.ConfigSection,{title:"Polling Intervals",children:[(0,b.jsx)("p",{className:"pb-2 text-xs text-muted-foreground",children:"How often each observer polls its source for changes. Lower values mean faster detection but more I/O. Changes apply immediately — no restart required."}),(0,b.jsx)(y.EditableField,{label:"Obsidian Debounce",value:i("obsidianDebounceSeconds",a.obsidianDebounceSeconds),configKey:"obsidianDebounceSeconds",type:"number",suffix:"sec",modified:j.has("obsidianDebounceSeconds"),defaultValue:d("obsidianDebounceSeconds"),description:"Seconds to wait after a vault file change before recording it as an observation. Prevents rapid-fire edits from flooding the observation queue.",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Scheduler Poll Interval",value:i("schedulePollIntervalSeconds",a.schedulePollIntervalSeconds),configKey:"schedulePollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("schedulePollIntervalSeconds"),defaultValue:d("schedulePollIntervalSeconds"),description:"Seconds between scheduler wake-ups that look for pending work. Lower values make recurring tasks fire closer to their target time.",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Git Poll Interval",value:i("gitPollIntervalSeconds",a.gitPollIntervalSeconds),configKey:"gitPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("gitPollIntervalSeconds"),defaultValue:d("gitPollIntervalSeconds"),description:"Seconds between Git lifecycle checks in watched repos. Default 3600 (1 hour).",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Notion Poll Interval",value:i("notionPollIntervalSeconds",a.notionPollIntervalSeconds),configKey:"notionPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("notionPollIntervalSeconds"),defaultValue:d("notionPollIntervalSeconds"),description:"Seconds between Notion database sync checks. Raising this above ~600 may require adjusting NOTION_WRITE_TTL_MS in the daemon. Default 300 (5 min).",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Calendar Poll Interval",value:i("calendarPollIntervalSeconds",a.calendarPollIntervalSeconds),configKey:"calendarPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("calendarPollIntervalSeconds"),defaultValue:d("calendarPollIntervalSeconds"),description:"Seconds between Google Calendar event sync checks. Default 300 (5 min).",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Gmail Poll Interval",value:i("gmailPollIntervalSeconds",a.gmailPollIntervalSeconds),configKey:"gmailPollIntervalSeconds",type:"number",suffix:"sec",modified:j.has("gmailPollIntervalSeconds"),defaultValue:d("gmailPollIntervalSeconds"),description:"Seconds between Gmail inbox scans for travel bookings and receipt attachments. Requires restart because the poller interval is fixed at startup.",onSave:C})]}),(0,b.jsxs)(y.ConfigSection,{title:"History Injection",children:[(0,b.jsx)("p",{className:"pb-2 text-xs text-muted-foreground",children:"Controls how much prior conversation context is injected into new sessions. Higher values preserve continuity across sessions; lower values save tokens."}),(0,b.jsx)(y.EditableField,{label:"Max Messages",value:i("historyInjectionMaxMessages",a.historyInjectionMaxMessages),configKey:"historyInjectionMaxMessages",type:"number",modified:j.has("historyInjectionMaxMessages"),defaultValue:d("historyInjectionMaxMessages"),description:"Maximum number of prior messages to include when opening a new session in an existing conversation thread.",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Max Tokens",value:i("historyInjectionMaxTokens",a.historyInjectionMaxTokens),configKey:"historyInjectionMaxTokens",type:"number",modified:j.has("historyInjectionMaxTokens"),defaultValue:d("historyInjectionMaxTokens"),description:"Token budget for injected history. Messages are trimmed oldest-first to stay within this limit.",onSave:C}),(0,b.jsx)(y.EditableBooleanField,{label:"Strict DM Staleness",value:i("dmStalenessStrict",a.dmStalenessStrict),configKey:"dmStalenessStrict",modified:j.has("dmStalenessStrict"),defaultValue:d("dmStalenessStrict"),description:"When enabled, every prompt-context write invalidates active DM sessions. Leave off to allow append-only logs and derived indexes to stay quiet.",onSave:C})]}),(0,b.jsxs)(y.ConfigSection,{title:"Infrastructure",children:[(0,b.jsx)(y.EditableField,{label:"API Port",value:i("apiPort",a.apiPort),configKey:"apiPort",type:"number",modified:j.has("apiPort"),defaultValue:d("apiPort"),description:"Local TCP port the Hono daemon listens on. Requires a daemon restart to take effect. Changing this will break integrations that reference the old port.",onSave:C}),(0,b.jsx)(y.EditableBooleanField,{label:"Disable Auth Probes",value:i("authProbeDisabled",a.authProbeDisabled),configKey:"authProbeDisabled",modified:j.has("authProbeDisabled"),defaultValue:d("authProbeDisabled"),description:"When enabled, the periodic auth health probe (checkAll) becomes a no-op. Use this to suppress probe traffic if you know a backend is intentionally offline.",onSave:C}),(0,b.jsx)(y.EditableField,{label:"Auth Preflight Freshness",value:i("authPreflightFreshnessMs",a.authPreflightFreshnessMs),configKey:"authPreflightFreshnessMs",type:"number",suffix:"ms",modified:j.has("authPreflightFreshnessMs"),defaultValue:d("authPreflightFreshnessMs"),description:"How long an expired or missing backend-auth result stays fresh for preflight routing. Set to 0 to disable the cache and always re-check.",onSave:C})]}),(0,b.jsx)(E,{})]})}],94085)}];
2
2
 
3
3
  //# sourceMappingURL=packages_dashboard_src_app_settings_advanced_page_tsx_0o~_885._.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/dashboard/src/app/settings/advanced/page.tsx","../../../../../../node_modules/.pnpm/lucide-react%400.468.0_react%4019.2.4/node_modules/lucide-react/src/icons/mic.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { AlertTriangle, ChevronRight, Loader2, Mic, RotateCcw, Trash2, Zap } from \"lucide-react\";\nimport { useQueryClient, useQuery, type QueryClient } from \"@tanstack/react-query\";\nimport { api, ApiError } from \"@/lib/api-client\";\nimport type { ReinstallContextPlanResponse } from \"@/lib/api-types\";\nimport { useConfig, useConfigDefaults } from \"@/lib/hooks/use-config\";\nimport { useSaveConfig } from \"@/lib/hooks/use-save-config\";\nimport { useDirtyFields } from \"@/lib/hooks/use-dirty-fields\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { useConfirm } from \"@/components/shared/confirm-dialog\";\nimport { cn } from \"@/lib/utils\";\nimport {\n ConfigSection,\n EditableArrayField,\n EditableBooleanField,\n EditableField,\n} from \"@/components/settings/editors\";\nimport { SettingsToast } from \"@/components/settings/settings-navigation\";\n\nexport default function AdvancedSettingsPage() {\n const { data: config } = useConfig();\n const { df } = useConfigDefaults();\n // toast + showToast for non-config actions (reset safety)\n const { toast, showToast } = useSaveConfig();\n // deferSave / dv for the standard fields\n const { deferSaveFor, dv, dirtyFields, clearDirtyKeys } = useDirtyFields();\n const queryClient = useQueryClient();\n const confirmDialog = useConfirm();\n const [resetting, setResetting] = useState(false);\n\n const handleResetSafety = async () => {\n const ok = await confirmDialog({\n title: \"Reset disallowed tools to defaults?\",\n description:\n \"This will restore the default safety tool list, replacing any customizations.\",\n confirmLabel: \"Reset\",\n variant: \"destructive\",\n });\n if (!ok) return;\n setResetting(true);\n try {\n await api.post(\"/config/reset-safety\");\n queryClient.invalidateQueries({ queryKey: [\"config\"] });\n // Clear any dirty entries for the reset keys so they don't overwrite\n // the fresh defaults when the user clicks Save in the save bar.\n clearDirtyKeys([\"disallowedTools\", \"allowedToolsOverride\"]);\n showToast(\"success\", \"Safety tools reset to defaults\");\n } finally {\n setResetting(false);\n }\n };\n\n if (!config) {\n return <div className=\"text-muted-foreground\">Loading...</div>;\n }\n\n const deferSave = deferSaveFor(config);\n\n return (\n <>\n <div>\n <h1 className=\"text-2xl font-semibold text-foreground\">Advanced</h1>\n <p className=\"mt-1 max-w-3xl text-sm text-muted-foreground\">\n Power-user knobs and safety settings. Most of these are low-level — read\n each description carefully before saving.\n </p>\n </div>\n\n {/* Toast for immediate-save actions (reset safety) */}\n <SettingsToast toast={toast} />\n\n <Card>\n <CardHeader>\n <CardTitle>Safety — Tool Policy</CardTitle>\n </CardHeader>\n <div className=\"space-y-3 [&>p]:max-w-prose\">\n <p className=\"text-xs text-muted-foreground\">\n Guardrails applied to every Claude Code tool call, enforced by the SDK\n before the tool runs. Entries are either a plain tool name (\n <code>Write</code>, <code>WebFetch</code>) or a tool name with an\n argument pattern in parentheses (<code>Bash(rm -rf *)</code>) to match\n only specific invocations.{\" \"}\n <strong>Disallowed wins over allowed</strong> — any match in the\n disallowed list blocks the call even if allowed override covers it.\n Per-backend Allow-mode toggle has moved to{\" \"}\n <strong>Settings → Models &amp; Cost</strong> so each backend can be\n flipped independently.\n </p>\n <EditableArrayField\n label=\"Disallowed Tools\"\n values={dv(\"disallowedTools\", config.disallowedTools)}\n configKey=\"disallowedTools\"\n variant=\"red\"\n placeholder=\"e.g. Bash(rm -rf *)\"\n modified={dirtyFields.has(\"disallowedTools\")}\n onSave={deferSave}\n />\n <p className=\"text-xs text-muted-foreground -mt-1\">\n Tools the agent is forbidden from calling. The defaults block destructive\n shell commands and known-dangerous file operations. Use Reset to Defaults\n below to restore them after experimenting.\n </p>\n\n <Separator />\n\n <EditableArrayField\n label=\"Allowed Tools Override\"\n values={dv(\"allowedToolsOverride\", config.allowedTools)}\n configKey=\"allowedToolsOverride\"\n variant=\"green\"\n placeholder=\"e.g. Bash(git push)\"\n modified={dirtyFields.has(\"allowedToolsOverride\")}\n onSave={deferSave}\n />\n <p className=\"text-xs text-muted-foreground -mt-1\">\n Narrow exceptions to the disallowed list — use this to permit a specific\n safe invocation of an otherwise-blocked tool (e.g. allow{\" \"}\n <code>Bash(git push)</code> while keeping arbitrary <code>Bash</code>{\" \"}\n blocked).\n </p>\n\n <Separator />\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleResetSafety}\n disabled={resetting}\n >\n <RotateCcw className=\"h-3.5 w-3.5 mr-1\" />\n {resetting ? \"Resetting...\" : \"Reset to Defaults\"}\n </Button>\n <p className=\"text-xs text-muted-foreground\">\n Restores the built-in disallowed-tool list and{\" \"}\n <strong>also clears the allowed override list</strong>, replacing any\n customizations in both. Use this if your safety config has drifted and\n you want a clean slate.\n </p>\n </div>\n </Card>\n\n <VoiceModeSection />\n\n <ConfigSection title=\"Polling Intervals\">\n <p className=\"pb-2 text-xs text-muted-foreground\">\n How often each observer polls its source for changes. Lower values mean\n faster detection but more I/O. Changes apply immediately — no restart\n required.\n </p>\n <EditableField\n label=\"Obsidian Debounce\"\n value={dv(\"obsidianDebounceSeconds\", config.obsidianDebounceSeconds)}\n configKey=\"obsidianDebounceSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"obsidianDebounceSeconds\")}\n defaultValue={df(\"obsidianDebounceSeconds\")}\n description=\"Seconds to wait after a vault file change before recording it as an observation. Prevents rapid-fire edits from flooding the observation queue.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Scheduler Poll Interval\"\n value={dv(\"schedulePollIntervalSeconds\", config.schedulePollIntervalSeconds)}\n configKey=\"schedulePollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"schedulePollIntervalSeconds\")}\n defaultValue={df(\"schedulePollIntervalSeconds\")}\n description=\"Seconds between scheduler wake-ups that look for pending work. Lower values make recurring tasks fire closer to their target time.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Git Poll Interval\"\n value={dv(\"gitPollIntervalSeconds\", config.gitPollIntervalSeconds)}\n configKey=\"gitPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"gitPollIntervalSeconds\")}\n defaultValue={df(\"gitPollIntervalSeconds\")}\n description=\"Seconds between Git lifecycle checks in watched repos. Default 3600 (1 hour).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Notion Poll Interval\"\n value={dv(\"notionPollIntervalSeconds\", config.notionPollIntervalSeconds)}\n configKey=\"notionPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"notionPollIntervalSeconds\")}\n defaultValue={df(\"notionPollIntervalSeconds\")}\n description=\"Seconds between Notion database sync checks. Raising this above ~600 may require adjusting NOTION_WRITE_TTL_MS in the daemon. Default 300 (5 min).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Calendar Poll Interval\"\n value={dv(\"calendarPollIntervalSeconds\", config.calendarPollIntervalSeconds)}\n configKey=\"calendarPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"calendarPollIntervalSeconds\")}\n defaultValue={df(\"calendarPollIntervalSeconds\")}\n description=\"Seconds between Google Calendar event sync checks. Default 300 (5 min).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Gmail Poll Interval\"\n value={dv(\"gmailPollIntervalSeconds\", config.gmailPollIntervalSeconds)}\n configKey=\"gmailPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"gmailPollIntervalSeconds\")}\n defaultValue={df(\"gmailPollIntervalSeconds\")}\n description=\"Seconds between Gmail inbox scans for travel bookings and receipt attachments. Requires restart because the poller interval is fixed at startup.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <ConfigSection title=\"History Injection\">\n <p className=\"pb-2 text-xs text-muted-foreground\">\n Controls how much prior conversation context is injected into new sessions.\n Higher values preserve continuity across sessions; lower values save tokens.\n </p>\n <EditableField\n label=\"Max Messages\"\n value={dv(\"historyInjectionMaxMessages\", config.historyInjectionMaxMessages)}\n configKey=\"historyInjectionMaxMessages\"\n type=\"number\"\n modified={dirtyFields.has(\"historyInjectionMaxMessages\")}\n defaultValue={df(\"historyInjectionMaxMessages\")}\n description=\"Maximum number of prior messages to include when opening a new session in an existing conversation thread.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Max Tokens\"\n value={dv(\"historyInjectionMaxTokens\", config.historyInjectionMaxTokens)}\n configKey=\"historyInjectionMaxTokens\"\n type=\"number\"\n modified={dirtyFields.has(\"historyInjectionMaxTokens\")}\n defaultValue={df(\"historyInjectionMaxTokens\")}\n description=\"Token budget for injected history. Messages are trimmed oldest-first to stay within this limit.\"\n onSave={deferSave}\n />\n <EditableBooleanField\n label=\"Strict DM Staleness\"\n value={dv(\"dmStalenessStrict\", config.dmStalenessStrict)}\n configKey=\"dmStalenessStrict\"\n modified={dirtyFields.has(\"dmStalenessStrict\")}\n defaultValue={df(\"dmStalenessStrict\")}\n description=\"When enabled, every prompt-context write invalidates active DM sessions. Leave off to allow append-only logs and derived indexes to stay quiet.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <ConfigSection title=\"Infrastructure\">\n <EditableField\n label=\"API Port\"\n value={dv(\"apiPort\", config.apiPort)}\n configKey=\"apiPort\"\n type=\"number\"\n modified={dirtyFields.has(\"apiPort\")}\n defaultValue={df(\"apiPort\")}\n description=\"Local TCP port the Hono daemon listens on. Requires a daemon restart to take effect. Changing this will break integrations that reference the old port.\"\n onSave={deferSave}\n />\n <EditableBooleanField\n label=\"Disable Auth Probes\"\n value={dv(\"authProbeDisabled\", config.authProbeDisabled)}\n configKey=\"authProbeDisabled\"\n modified={dirtyFields.has(\"authProbeDisabled\")}\n defaultValue={df(\"authProbeDisabled\")}\n description=\"When enabled, the periodic auth health probe (checkAll) becomes a no-op. Use this to suppress probe traffic if you know a backend is intentionally offline.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Auth Preflight Freshness\"\n value={dv(\"authPreflightFreshnessMs\", config.authPreflightFreshnessMs)}\n configKey=\"authPreflightFreshnessMs\"\n type=\"number\"\n suffix=\"ms\"\n modified={dirtyFields.has(\"authPreflightFreshnessMs\")}\n defaultValue={df(\"authPreflightFreshnessMs\")}\n description=\"How long an expired or missing backend-auth result stays fresh for preflight routing. Set to 0 to disable the cache and always re-check.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <DangerZone />\n </>\n );\n}\n\ninterface VoiceInstallProgress {\n phase: \"initializing\" | \"downloading\" | \"loading\" | \"ready\";\n currentFile: string | null;\n loadedBytes: number;\n totalBytes: number;\n percent: number;\n filesDownloaded: number;\n}\n\ninterface VoiceStatusResponse {\n enabled: boolean;\n installing: boolean;\n installed: boolean;\n status: \"idle\" | \"running\" | \"ready\" | \"error\";\n error: string | null;\n startedAt: number | null;\n finishedAt: number | null;\n model: string;\n progress: VoiceInstallProgress | null;\n}\n\n/**\n * Voice Mode card. Toggling on triggers `POST /api/voice/install`, which\n * downloads the Whisper model and then auto-restarts the daemon so the\n * `voiceTranscriptionEnabled` flag is observed at boot. Polls\n * `/api/voice/status` every 2s while installing or while waiting for the\n * daemon to come back up.\n *\n * See docs/design/appendices/voice-transcription.md for the workflow + model.\n */\nfunction VoiceModeSection() {\n const queryClient = useQueryClient();\n const [busy, setBusy] = useState(false);\n const [waitingForRestart, setWaitingForRestart] = useState(false);\n const [actionError, setActionError] = useState<string | null>(null);\n\n const { data: status } = useQuery<VoiceStatusResponse>({\n queryKey: [\"voice-status\"],\n queryFn: async () => {\n try {\n return await api.get<VoiceStatusResponse>(\"/voice/status\");\n } catch (err) {\n // While the daemon is restarting, /api/voice/status will fail. Surface\n // a synthetic \"installing\" snapshot so the UI keeps polling.\n if (waitingForRestart) {\n return {\n enabled: false,\n installing: true,\n installed: true,\n status: \"running\",\n error: null,\n startedAt: null,\n finishedAt: null,\n model: \"Xenova/whisper-small\",\n progress: null,\n };\n }\n throw err;\n }\n },\n refetchInterval: (query) => {\n const data = query.state.data;\n if (waitingForRestart) return 1500;\n if (data?.installing || data?.status === \"running\") return 1500;\n return false;\n },\n refetchOnWindowFocus: false,\n });\n\n // When the daemon comes back from a restart and reports enabled=true, drop\n // the waiting flag so the UI settles.\n useEffect(() => {\n if (waitingForRestart && status?.enabled) {\n setWaitingForRestart(false);\n queryClient.invalidateQueries({ queryKey: [\"config\"] });\n }\n }, [waitingForRestart, status?.enabled, queryClient]);\n\n // After install succeeds the route returns status=\"ready\" and triggers a\n // restart ~250ms later. Flip into \"waiting for restart\" mode so the polling\n // tolerates the brief window where /api/voice/status returns 5xx.\n useEffect(() => {\n if (status?.status === \"ready\" && !status.enabled) {\n setWaitingForRestart(true);\n }\n }, [status?.status, status?.enabled]);\n\n const handleEnable = async () => {\n setActionError(null);\n setBusy(true);\n try {\n await api.post(\"/voice/install\");\n // The route is fire-and-forget. Force an immediate refetch so the\n // query latches onto status=\"running\" — without this, refetchInterval\n // is evaluated against the stale `installing=false` snapshot from the\n // initial load and stays disabled, leaving the UI frozen with no\n // visible signal that the download is happening.\n await queryClient.invalidateQueries({ queryKey: [\"voice-status\"] });\n } catch (err) {\n setActionError(err instanceof ApiError ? err.message : \"Install failed\");\n } finally {\n setBusy(false);\n }\n };\n\n const enabled = status?.enabled ?? false;\n const installing = busy || (status?.installing ?? false) || waitingForRestart;\n const progress = status?.progress ?? null;\n const errorMessage = actionError ?? status?.error ?? null;\n\n return (\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Mic className=\"h-4 w-4\" />\n Voice Mode\n </CardTitle>\n </CardHeader>\n <div className=\"space-y-3 [&>p]:max-w-prose\">\n <p className=\"text-xs text-muted-foreground\">\n Transcribe inbound voice messages (Telegram voice / WhatsApp PTT /\n Discord audio / Slack audio file) locally with Whisper before they\n reach the agent. Audio bytes never leave the host. Default off — no\n model is downloaded until you turn it on. Model:{\" \"}\n <code>{status?.model ?? \"Xenova/whisper-small\"}</code> (~244 MB).\n See{\" \"}\n <code>docs/design/appendices/voice-transcription.md</code> for\n implementation details.\n </p>\n\n {errorMessage && (\n <p className=\"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive\">\n {errorMessage}\n </p>\n )}\n\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <p className=\"text-sm\">\n Status:{\" \"}\n <span className=\"font-medium\">\n {installing\n ? waitingForRestart\n ? \"Restarting daemon to apply…\"\n : progress?.phase === \"ready\"\n ? \"Finalizing…\"\n : progress?.currentFile\n ? `Downloading ${progress.currentFile}…`\n : \"Starting model download…\"\n : enabled\n ? \"Enabled\"\n : \"Disabled\"}\n </span>\n </p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Turning this on downloads the Whisper weights (~244 MB), then\n auto-restarts the daemon so the transcriber initializes with the\n new flag. The first download takes a minute or two depending on\n your connection.\n </p>\n </div>\n <Button\n size=\"sm\"\n variant={enabled ? \"outline\" : \"default\"}\n onClick={handleEnable}\n disabled={busy || installing || enabled}\n >\n {installing ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 mr-1 animate-spin\" />\n Working…\n </>\n ) : enabled ? (\n \"Enabled\"\n ) : (\n \"Enable & install\"\n )}\n </Button>\n </div>\n\n {installing && !waitingForRestart && (\n <div className=\"space-y-1.5\">\n <div className=\"h-1.5 w-full overflow-hidden rounded-full bg-muted\">\n <div\n className={cn(\n \"h-full bg-primary transition-[width] duration-200\",\n (!progress || progress.percent === 0) && \"animate-pulse\",\n )}\n style={{\n width: `${Math.min(100, Math.max(progress?.percent ?? 0, progress ? 2 : 8))}%`,\n }}\n />\n </div>\n <div className=\"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums\">\n <span>\n {progress && progress.totalBytes > 0\n ? `${formatBytes(progress.loadedBytes)} / ${formatBytes(progress.totalBytes)}`\n : \"Contacting Hugging Face…\"}\n {progress && progress.filesDownloaded > 0 && (\n <> · {progress.filesDownloaded} file{progress.filesDownloaded === 1 ? \"\" : \"s\"} complete</>\n )}\n </span>\n <span>\n {progress && progress.percent > 0\n ? `${Math.round(progress.percent)}%`\n : \"\"}\n </span>\n </div>\n </div>\n )}\n </div>\n </Card>\n );\n}\n\ntype DangerAction =\n | \"reset-config\"\n | \"purge-history\"\n | \"wipe-context\"\n | \"reinstall-context\"\n | \"factory-reset\";\n\nasync function runDangerAction(\n action: DangerAction,\n): Promise<Record<string, unknown>> {\n switch (action) {\n case \"reset-config\":\n return api.post(\"/system/reset-config\");\n case \"purge-history\":\n return api.post(\"/system/purge-history\");\n case \"wipe-context\":\n return api.post(\"/system/wipe-context\");\n case \"reinstall-context\":\n return api.post(\"/system/reinstall-context\", { confirm: \"CLEAN\" });\n case \"factory-reset\":\n return api.post(\"/system/factory-reset\");\n }\n}\n\nfunction invalidateAfter(action: DangerAction, qc: QueryClient): void {\n switch (action) {\n case \"reset-config\":\n qc.invalidateQueries({ queryKey: [\"config\"] });\n return;\n case \"purge-history\":\n qc.invalidateQueries({ queryKey: [\"conversations\"] });\n qc.invalidateQueries({ queryKey: [\"events\"] });\n qc.invalidateQueries({ queryKey: [\"cost\"] });\n return;\n case \"wipe-context\":\n case \"reinstall-context\":\n qc.invalidateQueries({ queryKey: [\"context\"] });\n qc.invalidateQueries({ queryKey: [\"setup-status\"] });\n return;\n case \"factory-reset\":\n qc.invalidateQueries();\n return;\n }\n}\n\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n}\n\nfunction describeReinstallPlan(plan: ReinstallContextPlanResponse): string {\n const ancillary =\n plan.ancillaryDirs.length > 0\n ? `Ancillary caches to remove: ${plan.ancillaryDirs.join(\", \")}.`\n : \"No ancillary caches are scheduled for removal.\";\n return [\n `This will remove ${plan.fileCount} file(s) (${formatBytes(plan.totalBytes)}) from ${plan.contextDir}, clear ${plan.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,\n ancillary,\n `Backup tarball path: ${plan.backupPath}`,\n ].join(\" \");\n}\n\nfunction DangerZone() {\n const [open, setOpen] = useState(false);\n const [busy, setBusy] = useState<DangerAction | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const confirm = useConfirm();\n const queryClient = useQueryClient();\n\n const runAction = async (\n action: DangerAction,\n opts: {\n title: string;\n description: string;\n confirmLabel: string;\n doubleConfirm?: {\n title: string;\n description: string;\n confirmLabel: string;\n requireText?: string;\n };\n successMessage: (result: Record<string, unknown>) => string;\n },\n ): Promise<void> => {\n const ok = await confirm({\n title: opts.title,\n description: opts.description,\n confirmLabel: opts.confirmLabel,\n variant: \"destructive\",\n });\n if (!ok) return;\n if (opts.doubleConfirm) {\n const ok2 = await confirm({\n title: opts.doubleConfirm.title,\n description: opts.doubleConfirm.description,\n confirmLabel: opts.doubleConfirm.confirmLabel,\n variant: \"destructive\",\n requireText: opts.doubleConfirm.requireText,\n });\n if (!ok2) return;\n }\n\n setBusy(action);\n setError(null);\n setNotice(null);\n try {\n const result = await runDangerAction(action);\n invalidateAfter(action, queryClient);\n setNotice(opts.successMessage(result));\n } catch (err) {\n setError(err instanceof ApiError ? err.message : \"Request failed\");\n } finally {\n setBusy(null);\n }\n };\n\n const handleResetConfig = () =>\n runAction(\"reset-config\", {\n title: \"Reset all config to defaults?\",\n description:\n \"Restores every runtime setting in the database to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.\",\n confirmLabel: \"Reset config\",\n successMessage: (r) => `Cleared ${r.cleared ?? 0} runtime setting(s).`,\n });\n\n const handlePurgeHistory = () =>\n runAction(\"purge-history\", {\n title: \"Delete all sessions and history?\",\n description:\n \"Permanently removes every non-active conversation session, message, action log, observation, notification log, MD snapshot, and scheduled task. The active session is preserved.\",\n confirmLabel: \"Delete history\",\n successMessage: (r) =>\n `Deleted ${r.deletedSessions ?? 0} session(s), ${r.deletedMessages ?? 0} message(s), ${r.deletedActions ?? 0} action(s).`,\n });\n\n const handleWipeContext = () =>\n runAction(\"wipe-context\", {\n title: \"Wipe all context files?\",\n description:\n \"Deletes every file under the active primary vault and fallback context directory — including rules/management.md, so the daemon will re-enter rules setup. Runtime settings, credentials, history, and integrations are preserved.\",\n confirmLabel: \"Wipe context\",\n successMessage: (r) => `Removed ${r.removed ?? 0} context entr(y/ies).`,\n });\n\n const handleReinstallContext = () =>\n (async () => {\n setBusy(\"reinstall-context\");\n setError(null);\n setNotice(null);\n try {\n const plan = await api.get<ReinstallContextPlanResponse>(\"/system/reinstall-context/plan\");\n const ok = await confirm({\n title: \"Clean reinstall of context/ (B-007)?\",\n description: describeReinstallPlan(plan),\n confirmLabel: \"Continue\",\n variant: \"destructive\",\n });\n if (!ok) return;\n\n const ok2 = await confirm({\n title: \"Type CLEAN to confirm\",\n description:\n `Backup tarball: ${plan.backupPath}. Proceed to remove ${plan.fileCount} file(s) and clear ${plan.snapshotRowCount} snapshot row(s).`,\n confirmLabel: \"Reinstall context\",\n variant: \"destructive\",\n requireText: \"CLEAN\",\n });\n if (!ok2) return;\n\n const result = await runDangerAction(\"reinstall-context\");\n invalidateAfter(\"reinstall-context\", queryClient);\n setNotice(\n `Reinstalled. Removed ${result.filesDeleted ?? 0} file(s), cleared ${result.snapshotRowsDeleted ?? 0} snapshot row(s). Backup at ${result.backupPath ?? plan.backupPath}.`,\n );\n } catch (err) {\n setError(err instanceof ApiError ? err.message : \"Request failed\");\n } finally {\n setBusy(null);\n }\n })();\n\n const handleFactoryReset = () =>\n runAction(\"factory-reset\", {\n title: \"Factory reset — really?\",\n description:\n \"This clears EVERYTHING on this device: conversation history, action logs, runtime settings, context files (including rules/management.md), keychain secrets, encrypted blobs, uploaded attachments, session workdirs, backups, caches, user skills, integrations.md, and every user-data table — backends, mail accounts, recurring schedules, receipts, books + reading highlights, travel bookings, parse failures, runtime state, auth telemetry. The daemon compacts the SQLite DB afterward. Restart it to re-bootstrap observers and adapters.\",\n confirmLabel: \"Continue\",\n doubleConfirm: {\n title: \"Final confirmation\",\n description:\n \"There is no undo. Type the confirmation phrase below to proceed.\",\n confirmLabel: \"Factory reset\",\n requireText: \"RESET EVERYTHING\",\n },\n successMessage: (r) => {\n const status = typeof r.status === \"string\" ? r.status : \"reset\";\n const errs = Array.isArray(r.errors) ? (r.errors as unknown[]).length : 0;\n const reloadErrs = Array.isArray(r.adapterReloadErrors)\n ? (r.adapterReloadErrors as unknown[]).length\n : 0;\n if (status === \"reset_with_errors\" || errs > 0 || reloadErrs > 0) {\n return `Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${errs} reset step warning(s), ${reloadErrs} adapter reload warning(s).)`;\n }\n return \"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters.\";\n },\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <Card className=\"border-destructive/40\">\n <CollapsibleTrigger asChild>\n <CardHeader className=\"cursor-pointer select-none\">\n <div className=\"flex items-center gap-2\">\n <ChevronRight\n className={cn(\n \"h-4 w-4 text-destructive transition-transform\",\n open && \"rotate-90\",\n )}\n />\n <AlertTriangle className=\"h-4 w-4 text-destructive\" />\n <CardTitle className=\"text-destructive\">Danger Zone</CardTitle>\n </div>\n </CardHeader>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"space-y-4 pb-1\">\n <p className=\"text-xs text-muted-foreground max-w-prose\">\n Destructive actions that cannot be undone. Each action requires\n confirmation before executing.\n </p>\n\n {error && (\n <p className=\"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive\">\n {error}\n </p>\n )}\n {notice && (\n <p className=\"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground\">\n {notice}\n </p>\n )}\n\n <DangerRow\n title=\"Reset all config to defaults\"\n description=\"Restores every runtime setting to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.\"\n icon={<RotateCcw className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Reset config\"\n busy={busy === \"reset-config\"}\n disabled={busy !== null}\n onClick={handleResetConfig}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Delete all sessions and history\"\n description=\"Permanently removes all non-active conversation sessions, messages, action logs, observations, notification logs, MD snapshots, and scheduled tasks. The active session is preserved.\"\n icon={<Trash2 className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Delete history\"\n busy={busy === \"purge-history\"}\n disabled={busy !== null}\n onClick={handlePurgeHistory}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Wipe context files\"\n description=\"Deletes every file under the active primary vault and fallback context directory, including rules/management.md. Runtime settings, credentials, history, and integrations are preserved.\"\n icon={<Trash2 className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Wipe context\"\n busy={busy === \"wipe-context\"}\n disabled={busy !== null}\n onClick={handleWipeContext}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Reinstall context (B-007 clean)\"\n description=\"Safer alternative to Wipe context: writes a tarball backup first, then wipes context/ + md_file_snapshots. Conversation history and other SQLite tables are preserved. Restart the daemon to re-seed the vault from templates.\"\n icon={<RotateCcw className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Reinstall context\"\n busy={busy === \"reinstall-context\"}\n disabled={busy !== null}\n onClick={handleReinstallContext}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Factory reset\"\n 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.\"\n icon={<Zap className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Factory reset\"\n busy={busy === \"factory-reset\"}\n disabled={busy !== null}\n onClick={handleFactoryReset}\n />\n </div>\n </CollapsibleContent>\n </Card>\n </Collapsible>\n );\n}\n\nfunction DangerRow({\n title,\n description,\n icon,\n label,\n busy,\n disabled,\n onClick,\n}: {\n title: string;\n description: string;\n icon: ReactNode;\n label: string;\n busy: boolean;\n disabled: boolean;\n onClick: () => void;\n}) {\n return (\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{title}</p>\n <p className=\"text-xs text-muted-foreground\">{description}</p>\n </div>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={onClick}\n disabled={disabled}\n className=\"shrink-0\"\n >\n {icon}\n {busy ? \"Working...\" : label}\n </Button>\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mic\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMmEzIDMgMCAwIDAtMyAzdjdhMyAzIDAgMCAwIDYgMFY1YTMgMyAwIDAgMC0zLTNaIiAvPgogIDxwYXRoIGQ9Ik0xOSAxMHYyYTcgNyAwIDAgMS0xNCAwdi0yIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTkiIHkyPSIyMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/mic\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Mic = createLucideIcon('Mic', [\n ['path', { d: 'M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z', key: '131961' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2', key: '1vc78b' }],\n ['line', { x1: '12', x2: '12', y1: '19', y2: '22', key: 'x3vr5v' }],\n]);\n\nexport default Mic;\n"],"names":[],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,WCUM,CAAA,CAAA,CAAA,CAAA,CAAA,AAAM,UAAA,OAAA,EAAiB,KAAO,CAAA,CAClC,AADkC,CACjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAE,AAAF,EAAK,CAAwD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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AY,GAAG,CAAC,qBAC1B,aAAc,EAAG,qBACjB,YAAY,kJACZ,OAAQ,OAIZ,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,aAAa,CAAA,CAAC,MAAM,2BACnB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CACZ,MAAM,WACN,MAAO,EAAG,UAAW,EAAO,OAAO,EACnC,UAAU,UACV,KAAK,SACL,SAAU,EAAY,GAAG,CAAC,WAC1B,aAAc,EAAG,WACjB,YAAY,0JACZ,OAAQ,IAEV,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,oBAAoB,CAAA,CACnB,MAAM,sBACN,MAAO,EAAG,oBAAqB,EAAO,iBAAiB,EACvD,UAAU,oBACV,SAAU,EAAY,GAAG,CAAC,qBAC1B,aAAc,EAAG,qBACjB,YAAY,8JACZ,OAAQ,IAEV,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CACZ,MAAM,2BACN,MAAO,EAAG,2BAA4B,EAAO,wBAAwB,EACrE,UAAU,2BACV,KAAK,SACL,OAAO,KACP,SAAU,EAAY,GAAG,CAAC,4BAC1B,aAAc,EAAG,4BACjB,YAAY,2IACZ,OAAQ,OAIZ,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAA,KAGP","ignoreList":[1]}
1
+ {"version":3,"sources":["../../../../../../packages/dashboard/src/app/settings/advanced/page.tsx","../../../../../../node_modules/.pnpm/lucide-react%400.468.0_react%4019.2.4/node_modules/lucide-react/src/icons/mic.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useState, type ReactNode } from \"react\";\nimport { AlertTriangle, ChevronRight, Loader2, Mic, RotateCcw, Trash2, Zap } from \"lucide-react\";\nimport { useQueryClient, useQuery, type QueryClient } from \"@tanstack/react-query\";\nimport { VOICE_LANGUAGE_FULL, VOICE_LANGUAGE_TOP } from \"@aitne/shared\";\nimport { api, ApiError } from \"@/lib/api-client\";\nimport type { ReinstallContextPlanResponse } from \"@/lib/api-types\";\nimport { useConfig, useConfigDefaults } from \"@/lib/hooks/use-config\";\nimport { useSaveConfig } from \"@/lib/hooks/use-save-config\";\nimport { useDirtyFields } from \"@/lib/hooks/use-dirty-fields\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { useConfirm } from \"@/components/shared/confirm-dialog\";\nimport { cn } from \"@/lib/utils\";\nimport {\n ConfigSection,\n EditableArrayField,\n EditableBooleanField,\n EditableField,\n} from \"@/components/settings/editors\";\nimport { SettingsToast } from \"@/components/settings/settings-navigation\";\n\nexport default function AdvancedSettingsPage() {\n const { data: config } = useConfig();\n const { df } = useConfigDefaults();\n // toast + showToast for non-config actions (reset safety)\n const { toast, showToast } = useSaveConfig();\n // deferSave / dv for the standard fields\n const { deferSaveFor, dv, dirtyFields, clearDirtyKeys } = useDirtyFields();\n const queryClient = useQueryClient();\n const confirmDialog = useConfirm();\n const [resetting, setResetting] = useState(false);\n\n const handleResetSafety = async () => {\n const ok = await confirmDialog({\n title: \"Reset disallowed tools to defaults?\",\n description:\n \"This will restore the default safety tool list, replacing any customizations.\",\n confirmLabel: \"Reset\",\n variant: \"destructive\",\n });\n if (!ok) return;\n setResetting(true);\n try {\n await api.post(\"/config/reset-safety\");\n queryClient.invalidateQueries({ queryKey: [\"config\"] });\n // Clear any dirty entries for the reset keys so they don't overwrite\n // the fresh defaults when the user clicks Save in the save bar.\n clearDirtyKeys([\"disallowedTools\", \"allowedToolsOverride\"]);\n showToast(\"success\", \"Safety tools reset to defaults\");\n } finally {\n setResetting(false);\n }\n };\n\n if (!config) {\n return <div className=\"text-muted-foreground\">Loading...</div>;\n }\n\n const deferSave = deferSaveFor(config);\n\n return (\n <>\n <div>\n <h1 className=\"text-2xl font-semibold text-foreground\">Advanced</h1>\n <p className=\"mt-1 max-w-3xl text-sm text-muted-foreground\">\n Power-user knobs and safety settings. Most of these are low-level — read\n each description carefully before saving.\n </p>\n </div>\n\n {/* Toast for immediate-save actions (reset safety) */}\n <SettingsToast toast={toast} />\n\n <Card>\n <CardHeader>\n <CardTitle>Safety — Tool Policy</CardTitle>\n </CardHeader>\n <div className=\"space-y-3 [&>p]:max-w-prose\">\n <p className=\"text-xs text-muted-foreground\">\n Guardrails applied to every Claude Code tool call, enforced by the SDK\n before the tool runs. Entries are either a plain tool name (\n <code>Write</code>, <code>WebFetch</code>) or a tool name with an\n argument pattern in parentheses (<code>Bash(rm -rf *)</code>) to match\n only specific invocations.{\" \"}\n <strong>Disallowed wins over allowed</strong> — any match in the\n disallowed list blocks the call even if allowed override covers it.\n Per-backend Allow-mode toggle has moved to{\" \"}\n <strong>Settings → Models &amp; Cost</strong> so each backend can be\n flipped independently.\n </p>\n <EditableArrayField\n label=\"Disallowed Tools\"\n values={dv(\"disallowedTools\", config.disallowedTools)}\n configKey=\"disallowedTools\"\n variant=\"red\"\n placeholder=\"e.g. Bash(rm -rf *)\"\n modified={dirtyFields.has(\"disallowedTools\")}\n onSave={deferSave}\n />\n <p className=\"text-xs text-muted-foreground -mt-1\">\n Tools the agent is forbidden from calling. The defaults block destructive\n shell commands and known-dangerous file operations. Use Reset to Defaults\n below to restore them after experimenting.\n </p>\n\n <Separator />\n\n <EditableArrayField\n label=\"Allowed Tools Override\"\n values={dv(\"allowedToolsOverride\", config.allowedTools)}\n configKey=\"allowedToolsOverride\"\n variant=\"green\"\n placeholder=\"e.g. Bash(git push)\"\n modified={dirtyFields.has(\"allowedToolsOverride\")}\n onSave={deferSave}\n />\n <p className=\"text-xs text-muted-foreground -mt-1\">\n Narrow exceptions to the disallowed list — use this to permit a specific\n safe invocation of an otherwise-blocked tool (e.g. allow{\" \"}\n <code>Bash(git push)</code> while keeping arbitrary <code>Bash</code>{\" \"}\n blocked).\n </p>\n\n <Separator />\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleResetSafety}\n disabled={resetting}\n >\n <RotateCcw className=\"h-3.5 w-3.5 mr-1\" />\n {resetting ? \"Resetting...\" : \"Reset to Defaults\"}\n </Button>\n <p className=\"text-xs text-muted-foreground\">\n Restores the built-in disallowed-tool list and{\" \"}\n <strong>also clears the allowed override list</strong>, replacing any\n customizations in both. Use this if your safety config has drifted and\n you want a clean slate.\n </p>\n </div>\n </Card>\n\n <VoiceModeSection />\n\n <ConfigSection title=\"Polling Intervals\">\n <p className=\"pb-2 text-xs text-muted-foreground\">\n How often each observer polls its source for changes. Lower values mean\n faster detection but more I/O. Changes apply immediately — no restart\n required.\n </p>\n <EditableField\n label=\"Obsidian Debounce\"\n value={dv(\"obsidianDebounceSeconds\", config.obsidianDebounceSeconds)}\n configKey=\"obsidianDebounceSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"obsidianDebounceSeconds\")}\n defaultValue={df(\"obsidianDebounceSeconds\")}\n description=\"Seconds to wait after a vault file change before recording it as an observation. Prevents rapid-fire edits from flooding the observation queue.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Scheduler Poll Interval\"\n value={dv(\"schedulePollIntervalSeconds\", config.schedulePollIntervalSeconds)}\n configKey=\"schedulePollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"schedulePollIntervalSeconds\")}\n defaultValue={df(\"schedulePollIntervalSeconds\")}\n description=\"Seconds between scheduler wake-ups that look for pending work. Lower values make recurring tasks fire closer to their target time.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Git Poll Interval\"\n value={dv(\"gitPollIntervalSeconds\", config.gitPollIntervalSeconds)}\n configKey=\"gitPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"gitPollIntervalSeconds\")}\n defaultValue={df(\"gitPollIntervalSeconds\")}\n description=\"Seconds between Git lifecycle checks in watched repos. Default 3600 (1 hour).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Notion Poll Interval\"\n value={dv(\"notionPollIntervalSeconds\", config.notionPollIntervalSeconds)}\n configKey=\"notionPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"notionPollIntervalSeconds\")}\n defaultValue={df(\"notionPollIntervalSeconds\")}\n description=\"Seconds between Notion database sync checks. Raising this above ~600 may require adjusting NOTION_WRITE_TTL_MS in the daemon. Default 300 (5 min).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Calendar Poll Interval\"\n value={dv(\"calendarPollIntervalSeconds\", config.calendarPollIntervalSeconds)}\n configKey=\"calendarPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"calendarPollIntervalSeconds\")}\n defaultValue={df(\"calendarPollIntervalSeconds\")}\n description=\"Seconds between Google Calendar event sync checks. Default 300 (5 min).\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Gmail Poll Interval\"\n value={dv(\"gmailPollIntervalSeconds\", config.gmailPollIntervalSeconds)}\n configKey=\"gmailPollIntervalSeconds\"\n type=\"number\"\n suffix=\"sec\"\n modified={dirtyFields.has(\"gmailPollIntervalSeconds\")}\n defaultValue={df(\"gmailPollIntervalSeconds\")}\n description=\"Seconds between Gmail inbox scans for travel bookings and receipt attachments. Requires restart because the poller interval is fixed at startup.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <ConfigSection title=\"History Injection\">\n <p className=\"pb-2 text-xs text-muted-foreground\">\n Controls how much prior conversation context is injected into new sessions.\n Higher values preserve continuity across sessions; lower values save tokens.\n </p>\n <EditableField\n label=\"Max Messages\"\n value={dv(\"historyInjectionMaxMessages\", config.historyInjectionMaxMessages)}\n configKey=\"historyInjectionMaxMessages\"\n type=\"number\"\n modified={dirtyFields.has(\"historyInjectionMaxMessages\")}\n defaultValue={df(\"historyInjectionMaxMessages\")}\n description=\"Maximum number of prior messages to include when opening a new session in an existing conversation thread.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Max Tokens\"\n value={dv(\"historyInjectionMaxTokens\", config.historyInjectionMaxTokens)}\n configKey=\"historyInjectionMaxTokens\"\n type=\"number\"\n modified={dirtyFields.has(\"historyInjectionMaxTokens\")}\n defaultValue={df(\"historyInjectionMaxTokens\")}\n description=\"Token budget for injected history. Messages are trimmed oldest-first to stay within this limit.\"\n onSave={deferSave}\n />\n <EditableBooleanField\n label=\"Strict DM Staleness\"\n value={dv(\"dmStalenessStrict\", config.dmStalenessStrict)}\n configKey=\"dmStalenessStrict\"\n modified={dirtyFields.has(\"dmStalenessStrict\")}\n defaultValue={df(\"dmStalenessStrict\")}\n description=\"When enabled, every prompt-context write invalidates active DM sessions. Leave off to allow append-only logs and derived indexes to stay quiet.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <ConfigSection title=\"Infrastructure\">\n <EditableField\n label=\"API Port\"\n value={dv(\"apiPort\", config.apiPort)}\n configKey=\"apiPort\"\n type=\"number\"\n modified={dirtyFields.has(\"apiPort\")}\n defaultValue={df(\"apiPort\")}\n description=\"Local TCP port the Hono daemon listens on. Requires a daemon restart to take effect. Changing this will break integrations that reference the old port.\"\n onSave={deferSave}\n />\n <EditableBooleanField\n label=\"Disable Auth Probes\"\n value={dv(\"authProbeDisabled\", config.authProbeDisabled)}\n configKey=\"authProbeDisabled\"\n modified={dirtyFields.has(\"authProbeDisabled\")}\n defaultValue={df(\"authProbeDisabled\")}\n description=\"When enabled, the periodic auth health probe (checkAll) becomes a no-op. Use this to suppress probe traffic if you know a backend is intentionally offline.\"\n onSave={deferSave}\n />\n <EditableField\n label=\"Auth Preflight Freshness\"\n value={dv(\"authPreflightFreshnessMs\", config.authPreflightFreshnessMs)}\n configKey=\"authPreflightFreshnessMs\"\n type=\"number\"\n suffix=\"ms\"\n modified={dirtyFields.has(\"authPreflightFreshnessMs\")}\n defaultValue={df(\"authPreflightFreshnessMs\")}\n description=\"How long an expired or missing backend-auth result stays fresh for preflight routing. Set to 0 to disable the cache and always re-check.\"\n onSave={deferSave}\n />\n </ConfigSection>\n\n <DangerZone />\n </>\n );\n}\n\ninterface VoiceInstallProgress {\n phase: \"initializing\" | \"downloading\" | \"loading\" | \"ready\";\n currentFile: string | null;\n loadedBytes: number;\n totalBytes: number;\n percent: number;\n filesDownloaded: number;\n}\n\ninterface VoiceStatusResponse {\n enabled: boolean;\n installing: boolean;\n installed: boolean;\n /**\n * `true` when the configured Whisper model is materialized on disk. Goes\n * `false` after a package upgrade switches the default model — used to\n * surface the \"Upgrade voice model\" CTA without forcing a manual toggle.\n */\n modelOnDisk: boolean;\n status: \"idle\" | \"running\" | \"ready\" | \"error\";\n error: string | null;\n startedAt: number | null;\n finishedAt: number | null;\n model: string;\n progress: VoiceInstallProgress | null;\n primaryLanguage: string | null;\n suggestedPrimaryLanguage: string;\n // Whisper's full language registry is imported directly from\n // @aitne/shared — see VOICE_LANGUAGE_TOP / VOICE_LANGUAGE_FULL — so\n // the status payload does not duplicate it on every 1.5s poll.\n}\n\n/**\n * Voice Mode card. Toggling on triggers `POST /api/voice/install`, which\n * downloads the Whisper model and then auto-restarts the daemon so the\n * `voiceTranscriptionEnabled` flag is observed at boot. Polls\n * `/api/voice/status` every 2s while installing or while waiting for the\n * daemon to come back up.\n *\n * See docs/design/appendices/voice-transcription.md for the workflow + model.\n */\nfunction VoiceModeSection() {\n const queryClient = useQueryClient();\n const [busy, setBusy] = useState(false);\n const [waitingForRestart, setWaitingForRestart] = useState(false);\n const [actionError, setActionError] = useState<string | null>(null);\n // Local picker state — initialized from the server's locale suggestion or\n // the previously persisted setting once /voice/status loads.\n const [pickerLanguage, setPickerLanguage] = useState<string | null>(null);\n\n const { data: status } = useQuery<VoiceStatusResponse>({\n queryKey: [\"voice-status\"],\n queryFn: async () => {\n try {\n return await api.get<VoiceStatusResponse>(\"/voice/status\");\n } catch (err) {\n // While the daemon is restarting, /api/voice/status will fail. Surface\n // a synthetic \"installing\" snapshot so the UI keeps polling.\n if (waitingForRestart) {\n return {\n enabled: false,\n installing: true,\n installed: true,\n modelOnDisk: false,\n status: \"running\",\n error: null,\n startedAt: null,\n finishedAt: null,\n model: \"onnx-community/whisper-large-v3-turbo\",\n progress: null,\n primaryLanguage: null,\n suggestedPrimaryLanguage: \"en\",\n };\n }\n throw err;\n }\n },\n refetchInterval: (query) => {\n const data = query.state.data;\n if (waitingForRestart) return 1500;\n if (data?.installing || data?.status === \"running\") return 1500;\n return false;\n },\n refetchOnWindowFocus: false,\n });\n\n // Seed the picker from server-side suggestion / existing setting. Runs\n // each time those upstream values change so a re-fetch after install\n // round-trips the persisted value back into the dropdown.\n useEffect(() => {\n if (!status) return;\n const initial = status.primaryLanguage ?? status.suggestedPrimaryLanguage;\n setPickerLanguage((prev) => prev ?? initial);\n }, [status?.primaryLanguage, status?.suggestedPrimaryLanguage, status]);\n\n // When the daemon comes back from a restart and reports enabled=true, drop\n // the waiting flag so the UI settles.\n useEffect(() => {\n if (waitingForRestart && status?.enabled) {\n setWaitingForRestart(false);\n queryClient.invalidateQueries({ queryKey: [\"config\"] });\n }\n }, [waitingForRestart, status?.enabled, queryClient]);\n\n // After install succeeds the route returns status=\"ready\" and triggers a\n // restart ~250ms later. Flip into \"waiting for restart\" mode so the polling\n // tolerates the brief window where /api/voice/status returns 5xx.\n useEffect(() => {\n if (status?.status === \"ready\" && !status.enabled) {\n setWaitingForRestart(true);\n }\n }, [status?.status, status?.enabled]);\n\n const handleEnable = async () => {\n setActionError(null);\n setBusy(true);\n try {\n await api.post(\"/voice/install\", {\n primaryLanguage: pickerLanguage,\n });\n // The route is fire-and-forget. Force an immediate refetch so the\n // query latches onto status=\"running\" — without this, refetchInterval\n // is evaluated against the stale `installing=false` snapshot from the\n // initial load and stays disabled, leaving the UI frozen with no\n // visible signal that the download is happening.\n await queryClient.invalidateQueries({ queryKey: [\"voice-status\"] });\n } catch (err) {\n setActionError(err instanceof ApiError ? err.message : \"Install failed\");\n } finally {\n setBusy(false);\n }\n };\n\n const handleSavePrimaryLanguage = async (next: string) => {\n setActionError(null);\n setBusy(true);\n try {\n // Direct config PATCH — same hot-reloadable knob the transcriber\n // reads via getter, so this takes effect on the next inbound voice\n // attachment without a daemon restart.\n await api.patch(\"/config\", { voiceTranscriptionPrimaryLanguage: next });\n setPickerLanguage(next);\n await queryClient.invalidateQueries({ queryKey: [\"voice-status\"] });\n await queryClient.invalidateQueries({ queryKey: [\"config\"] });\n } catch (err) {\n setActionError(\n err instanceof ApiError ? err.message : \"Saving primary language failed\",\n );\n } finally {\n setBusy(false);\n }\n };\n\n const enabled = status?.enabled ?? false;\n const installing = busy || (status?.installing ?? false) || waitingForRestart;\n const progress = status?.progress ?? null;\n const errorMessage = actionError ?? status?.error ?? null;\n const upgradeAvailable =\n enabled && status?.modelOnDisk === false && !installing;\n\n // Render order in the picker: top languages first, then \"More languages\"\n // group with the rest, sorted by English name. Both arrays are static\n // (imported from @aitne/shared) — `useMemo` runs once per mount.\n const languageGroups = useMemo(() => {\n const topCodes = new Set(VOICE_LANGUAGE_TOP.map((l) => l.code));\n const more = VOICE_LANGUAGE_FULL\n .filter((l) => !topCodes.has(l.code))\n .slice()\n .sort((a, b) => a.englishName.localeCompare(b.englishName));\n return { top: VOICE_LANGUAGE_TOP, more };\n }, []);\n\n // The picker is shown in two places, so factor the JSX. The select is\n // disabled while installing/restarting so the operator cannot mutate\n // the value mid-flight.\n const renderLanguagePicker = (id: string) => (\n <Select\n value={pickerLanguage ?? undefined}\n onValueChange={(v) => setPickerLanguage(v)}\n disabled={installing}\n >\n <SelectTrigger id={id} className=\"w-full max-w-sm\">\n <SelectValue placeholder=\"Select language…\" />\n </SelectTrigger>\n <SelectContent>\n {languageGroups.top.length > 0 && (\n <SelectGroup>\n <SelectLabel>Common</SelectLabel>\n {languageGroups.top.map((l) => (\n <SelectItem key={l.code} value={l.code}>\n {l.nativeName}\n {l.nativeName !== l.englishName && (\n <span className=\"text-muted-foreground\"> · {l.englishName}</span>\n )}\n </SelectItem>\n ))}\n </SelectGroup>\n )}\n {languageGroups.more.length > 0 && (\n <SelectGroup>\n <SelectLabel>More languages</SelectLabel>\n {languageGroups.more.map((l) => (\n <SelectItem key={l.code} value={l.code}>\n {l.nativeName}\n {l.nativeName !== l.englishName && (\n <span className=\"text-muted-foreground\"> · {l.englishName}</span>\n )}\n </SelectItem>\n ))}\n </SelectGroup>\n )}\n </SelectContent>\n </Select>\n );\n\n return (\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Mic className=\"h-4 w-4\" />\n Voice Mode\n </CardTitle>\n </CardHeader>\n <div className=\"space-y-3 [&>p]:max-w-prose\">\n <p className=\"text-xs text-muted-foreground\">\n Transcribe inbound voice messages (Telegram voice / WhatsApp PTT /\n Discord audio / Slack audio file) locally with Whisper before they\n reach the agent. Audio bytes never leave the host. Default off — no\n model is downloaded until you turn it on. Model:{\" \"}\n <code>{status?.model ?? \"onnx-community/whisper-large-v3-turbo\"}</code>\n {\" \"}(~800 MB). See{\" \"}\n <code>docs/design/appendices/voice-transcription.md</code> for\n implementation details.\n </p>\n\n {errorMessage && (\n <p className=\"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive\">\n {errorMessage}\n </p>\n )}\n\n {upgradeAvailable && (\n <div className=\"rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2 text-xs\">\n <p className=\"font-medium text-amber-700 dark:text-amber-400\">\n Upgrade voice model\n </p>\n <p className=\"text-muted-foreground mt-0.5\">\n The configured model{\" \"}\n <code>{status?.model}</code> is not yet downloaded — likely\n because a package update changed the default. Click{\" \"}\n <strong>Upgrade & install</strong> below to fetch it.\n Inbound voice will keep using the previous model until then.\n </p>\n </div>\n )}\n\n {!enabled && !installing && (\n <div className=\"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3\">\n <div>\n <label\n htmlFor=\"voice-primary-language\"\n className=\"text-sm font-medium\"\n >\n Your primary spoken language\n </label>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Used as the fallback when Whisper&apos;s automatic language\n detection fails on a clip. Other languages are still\n transcribed correctly when detected — this only kicks in\n when detection is uncertain.\n </p>\n </div>\n {renderLanguagePicker(\"voice-primary-language\")}\n </div>\n )}\n\n <div className=\"flex items-center justify-between gap-4\">\n <div>\n <p className=\"text-sm\">\n Status:{\" \"}\n <span className=\"font-medium\">\n {installing\n ? waitingForRestart\n ? \"Restarting daemon to apply…\"\n : progress?.phase === \"ready\"\n ? \"Finalizing…\"\n : progress?.currentFile\n ? `Downloading ${progress.currentFile}…`\n : \"Starting model download…\"\n : enabled\n ? upgradeAvailable\n ? \"Enabled (upgrade available)\"\n : \"Enabled\"\n : \"Disabled\"}\n </span>\n </p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {enabled\n ? \"Inbound audio is transcribed locally before it reaches the agent. Change your primary language at any time below.\"\n : \"Turning this on downloads the Whisper weights (~800 MB), then auto-restarts the daemon so the transcriber initializes with the new flag. The first download takes a minute or two depending on your connection.\"}\n </p>\n </div>\n <Button\n size=\"sm\"\n variant={enabled && !upgradeAvailable ? \"outline\" : \"default\"}\n onClick={handleEnable}\n disabled={\n busy\n || installing\n || (enabled && !upgradeAvailable)\n || pickerLanguage === null\n }\n >\n {installing ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 mr-1 animate-spin\" />\n Working…\n </>\n ) : upgradeAvailable ? (\n \"Upgrade & install\"\n ) : enabled ? (\n \"Enabled\"\n ) : (\n \"Enable & install\"\n )}\n </Button>\n </div>\n\n {enabled && !installing && (\n <div className=\"space-y-2 rounded-md border border-border bg-muted/30 px-3 py-3\">\n <div>\n <label\n htmlFor=\"voice-primary-language-live\"\n className=\"text-sm font-medium\"\n >\n Primary spoken language\n </label>\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n Saved changes apply to the next inbound voice attachment —\n no daemon restart needed.\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n {renderLanguagePicker(\"voice-primary-language-live\")}\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={\n busy\n || pickerLanguage === null\n || pickerLanguage === status?.primaryLanguage\n }\n onClick={() => {\n if (pickerLanguage) void handleSavePrimaryLanguage(pickerLanguage);\n }}\n >\n Save\n </Button>\n </div>\n </div>\n )}\n\n {installing && !waitingForRestart && (\n <div className=\"space-y-1.5\">\n <div className=\"h-1.5 w-full overflow-hidden rounded-full bg-muted\">\n <div\n className={cn(\n \"h-full bg-primary transition-[width] duration-200\",\n (!progress || progress.percent === 0) && \"animate-pulse\",\n )}\n style={{\n width: `${Math.min(100, Math.max(progress?.percent ?? 0, progress ? 2 : 8))}%`,\n }}\n />\n </div>\n <div className=\"flex items-center justify-between text-[11px] text-muted-foreground tabular-nums\">\n <span>\n {progress && progress.totalBytes > 0\n ? `${formatBytes(progress.loadedBytes)} / ${formatBytes(progress.totalBytes)}`\n : \"Contacting Hugging Face…\"}\n {progress && progress.filesDownloaded > 0 && (\n <> · {progress.filesDownloaded} file{progress.filesDownloaded === 1 ? \"\" : \"s\"} complete</>\n )}\n </span>\n <span>\n {progress && progress.percent > 0\n ? `${Math.round(progress.percent)}%`\n : \"\"}\n </span>\n </div>\n </div>\n )}\n </div>\n </Card>\n );\n}\n\ntype DangerAction =\n | \"reset-config\"\n | \"purge-history\"\n | \"wipe-context\"\n | \"reinstall-context\"\n | \"factory-reset\";\n\nasync function runDangerAction(\n action: DangerAction,\n): Promise<Record<string, unknown>> {\n switch (action) {\n case \"reset-config\":\n return api.post(\"/system/reset-config\");\n case \"purge-history\":\n return api.post(\"/system/purge-history\");\n case \"wipe-context\":\n return api.post(\"/system/wipe-context\");\n case \"reinstall-context\":\n return api.post(\"/system/reinstall-context\", { confirm: \"CLEAN\" });\n case \"factory-reset\":\n return api.post(\"/system/factory-reset\");\n }\n}\n\nfunction invalidateAfter(action: DangerAction, qc: QueryClient): void {\n switch (action) {\n case \"reset-config\":\n qc.invalidateQueries({ queryKey: [\"config\"] });\n return;\n case \"purge-history\":\n qc.invalidateQueries({ queryKey: [\"conversations\"] });\n qc.invalidateQueries({ queryKey: [\"events\"] });\n qc.invalidateQueries({ queryKey: [\"cost\"] });\n return;\n case \"wipe-context\":\n case \"reinstall-context\":\n qc.invalidateQueries({ queryKey: [\"context\"] });\n qc.invalidateQueries({ queryKey: [\"setup-status\"] });\n return;\n case \"factory-reset\":\n qc.invalidateQueries();\n return;\n }\n}\n\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n}\n\nfunction describeReinstallPlan(plan: ReinstallContextPlanResponse): string {\n const ancillary =\n plan.ancillaryDirs.length > 0\n ? `Ancillary caches to remove: ${plan.ancillaryDirs.join(\", \")}.`\n : \"No ancillary caches are scheduled for removal.\";\n return [\n `This will remove ${plan.fileCount} file(s) (${formatBytes(plan.totalBytes)}) from ${plan.contextDir}, clear ${plan.snapshotRowCount} snapshot row(s), and then re-run setup on the next daemon start.`,\n ancillary,\n `Backup tarball path: ${plan.backupPath}`,\n ].join(\" \");\n}\n\nfunction DangerZone() {\n const [open, setOpen] = useState(false);\n const [busy, setBusy] = useState<DangerAction | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const confirm = useConfirm();\n const queryClient = useQueryClient();\n\n const runAction = async (\n action: DangerAction,\n opts: {\n title: string;\n description: string;\n confirmLabel: string;\n doubleConfirm?: {\n title: string;\n description: string;\n confirmLabel: string;\n requireText?: string;\n };\n successMessage: (result: Record<string, unknown>) => string;\n },\n ): Promise<void> => {\n const ok = await confirm({\n title: opts.title,\n description: opts.description,\n confirmLabel: opts.confirmLabel,\n variant: \"destructive\",\n });\n if (!ok) return;\n if (opts.doubleConfirm) {\n const ok2 = await confirm({\n title: opts.doubleConfirm.title,\n description: opts.doubleConfirm.description,\n confirmLabel: opts.doubleConfirm.confirmLabel,\n variant: \"destructive\",\n requireText: opts.doubleConfirm.requireText,\n });\n if (!ok2) return;\n }\n\n setBusy(action);\n setError(null);\n setNotice(null);\n try {\n const result = await runDangerAction(action);\n invalidateAfter(action, queryClient);\n setNotice(opts.successMessage(result));\n } catch (err) {\n setError(err instanceof ApiError ? err.message : \"Request failed\");\n } finally {\n setBusy(null);\n }\n };\n\n const handleResetConfig = () =>\n runAction(\"reset-config\", {\n title: \"Reset all config to defaults?\",\n description:\n \"Restores every runtime setting in the database to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.\",\n confirmLabel: \"Reset config\",\n successMessage: (r) => `Cleared ${r.cleared ?? 0} runtime setting(s).`,\n });\n\n const handlePurgeHistory = () =>\n runAction(\"purge-history\", {\n title: \"Delete all sessions and history?\",\n description:\n \"Permanently removes every non-active conversation session, message, action log, observation, notification log, MD snapshot, and scheduled task. The active session is preserved.\",\n confirmLabel: \"Delete history\",\n successMessage: (r) =>\n `Deleted ${r.deletedSessions ?? 0} session(s), ${r.deletedMessages ?? 0} message(s), ${r.deletedActions ?? 0} action(s).`,\n });\n\n const handleWipeContext = () =>\n runAction(\"wipe-context\", {\n title: \"Wipe all context files?\",\n description:\n \"Deletes every file under the active primary vault and fallback context directory — including rules/management.md, so the daemon will re-enter rules setup. Runtime settings, credentials, history, and integrations are preserved.\",\n confirmLabel: \"Wipe context\",\n successMessage: (r) => `Removed ${r.removed ?? 0} context entr(y/ies).`,\n });\n\n const handleReinstallContext = () =>\n (async () => {\n setBusy(\"reinstall-context\");\n setError(null);\n setNotice(null);\n try {\n const plan = await api.get<ReinstallContextPlanResponse>(\"/system/reinstall-context/plan\");\n const ok = await confirm({\n title: \"Clean reinstall of context/ (B-007)?\",\n description: describeReinstallPlan(plan),\n confirmLabel: \"Continue\",\n variant: \"destructive\",\n });\n if (!ok) return;\n\n const ok2 = await confirm({\n title: \"Type CLEAN to confirm\",\n description:\n `Backup tarball: ${plan.backupPath}. Proceed to remove ${plan.fileCount} file(s) and clear ${plan.snapshotRowCount} snapshot row(s).`,\n confirmLabel: \"Reinstall context\",\n variant: \"destructive\",\n requireText: \"CLEAN\",\n });\n if (!ok2) return;\n\n const result = await runDangerAction(\"reinstall-context\");\n invalidateAfter(\"reinstall-context\", queryClient);\n setNotice(\n `Reinstalled. Removed ${result.filesDeleted ?? 0} file(s), cleared ${result.snapshotRowsDeleted ?? 0} snapshot row(s). Backup at ${result.backupPath ?? plan.backupPath}.`,\n );\n } catch (err) {\n setError(err instanceof ApiError ? err.message : \"Request failed\");\n } finally {\n setBusy(null);\n }\n })();\n\n const handleFactoryReset = () =>\n runAction(\"factory-reset\", {\n title: \"Factory reset — really?\",\n description:\n \"This clears EVERYTHING on this device: conversation history, action logs, runtime settings, context files (including rules/management.md), keychain secrets, encrypted blobs, uploaded attachments, session workdirs, backups, caches, user skills, integrations.md, and every user-data table — backends, mail accounts, recurring schedules, receipts, books + reading highlights, travel bookings, parse failures, runtime state, auth telemetry. The daemon compacts the SQLite DB afterward. Restart it to re-bootstrap observers and adapters.\",\n confirmLabel: \"Continue\",\n doubleConfirm: {\n title: \"Final confirmation\",\n description:\n \"There is no undo. Type the confirmation phrase below to proceed.\",\n confirmLabel: \"Factory reset\",\n requireText: \"RESET EVERYTHING\",\n },\n successMessage: (r) => {\n const status = typeof r.status === \"string\" ? r.status : \"reset\";\n const errs = Array.isArray(r.errors) ? (r.errors as unknown[]).length : 0;\n const reloadErrs = Array.isArray(r.adapterReloadErrors)\n ? (r.adapterReloadErrors as unknown[]).length\n : 0;\n if (status === \"reset_with_errors\" || errs > 0 || reloadErrs > 0) {\n return `Factory reset finished with warnings. Restart the daemon to re-bootstrap observers and adapters. (${errs} reset step warning(s), ${reloadErrs} adapter reload warning(s).)`;\n }\n return \"Factory reset complete. Restart the daemon to re-bootstrap observers and adapters.\";\n },\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen}>\n <Card className=\"border-destructive/40\">\n <CollapsibleTrigger asChild>\n <CardHeader className=\"cursor-pointer select-none\">\n <div className=\"flex items-center gap-2\">\n <ChevronRight\n className={cn(\n \"h-4 w-4 text-destructive transition-transform\",\n open && \"rotate-90\",\n )}\n />\n <AlertTriangle className=\"h-4 w-4 text-destructive\" />\n <CardTitle className=\"text-destructive\">Danger Zone</CardTitle>\n </div>\n </CardHeader>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"space-y-4 pb-1\">\n <p className=\"text-xs text-muted-foreground max-w-prose\">\n Destructive actions that cannot be undone. Each action requires\n confirmation before executing.\n </p>\n\n {error && (\n <p className=\"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive\">\n {error}\n </p>\n )}\n {notice && (\n <p className=\"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground\">\n {notice}\n </p>\n )}\n\n <DangerRow\n title=\"Reset all config to defaults\"\n description=\"Restores every runtime setting to its factory default. Bootstrap values in .env (API port) and integration credentials are not affected.\"\n icon={<RotateCcw className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Reset config\"\n busy={busy === \"reset-config\"}\n disabled={busy !== null}\n onClick={handleResetConfig}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Delete all sessions and history\"\n description=\"Permanently removes all non-active conversation sessions, messages, action logs, observations, notification logs, MD snapshots, and scheduled tasks. The active session is preserved.\"\n icon={<Trash2 className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Delete history\"\n busy={busy === \"purge-history\"}\n disabled={busy !== null}\n onClick={handlePurgeHistory}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Wipe context files\"\n description=\"Deletes every file under the active primary vault and fallback context directory, including rules/management.md. Runtime settings, credentials, history, and integrations are preserved.\"\n icon={<Trash2 className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Wipe context\"\n busy={busy === \"wipe-context\"}\n disabled={busy !== null}\n onClick={handleWipeContext}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Reinstall context (B-007 clean)\"\n description=\"Safer alternative to Wipe context: writes a tarball backup first, then wipes context/ + md_file_snapshots. Conversation history and other SQLite tables are preserved. Restart the daemon to re-seed the vault from templates.\"\n icon={<RotateCcw className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Reinstall context\"\n busy={busy === \"reinstall-context\"}\n disabled={busy !== null}\n onClick={handleReinstallContext}\n />\n\n <Separator />\n\n <DangerRow\n title=\"Factory reset\"\n 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.\"\n icon={<Zap className=\"h-3.5 w-3.5 mr-1\" />}\n label=\"Factory reset\"\n busy={busy === \"factory-reset\"}\n disabled={busy !== null}\n onClick={handleFactoryReset}\n />\n </div>\n </CollapsibleContent>\n </Card>\n </Collapsible>\n );\n}\n\nfunction DangerRow({\n title,\n description,\n icon,\n label,\n busy,\n disabled,\n onClick,\n}: {\n title: string;\n description: string;\n icon: ReactNode;\n label: string;\n busy: boolean;\n disabled: boolean;\n onClick: () => void;\n}) {\n return (\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{title}</p>\n <p className=\"text-xs text-muted-foreground\">{description}</p>\n </div>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={onClick}\n disabled={disabled}\n className=\"shrink-0\"\n >\n {icon}\n {busy ? \"Working...\" : label}\n </Button>\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Mic\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMmEzIDMgMCAwIDAtMyAzdjdhMyAzIDAgMCAwIDYgMFY1YTMgMyAwIDAgMC0zLTNaIiAvPgogIDxwYXRoIGQ9Ik0xOSAxMHYyYTcgNyAwIDAgMS0xNCAwdi0yIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTkiIHkyPSIyMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/mic\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Mic = createLucideIcon('Mic', [\n ['path', { d: 'M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z', key: '131961' }],\n ['path', { d: 'M19 10v2a7 7 0 0 1-14 0v-2', key: '1vc78b' }],\n ['line', { x1: '12', x2: '12', y1: '19', y2: '22', key: 'x3vr5v' }],\n]);\n\nexport default Mic;\n"],"names":["key"],"mappings":"wDAEA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,OAAA,EAAA,EAAA,CAAA,CAAA,WCUM,CAAA,CAAA,AAAM,CAAN,AAAM,CAAN,CAAA,AAAM,UAAA,OAAA,EAAiB,KAAO,CAAA,CAAA,AAClC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAE,AAAF,EAAK,CAAwD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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