xaq-cli 0.0.0 → 0.1.0-nightly.71

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 (227) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +79 -0
  3. package/dist/admin-5gThRwgj.js +162 -0
  4. package/dist/admin-5gThRwgj.js.map +1 -0
  5. package/dist/admin-Btrm8mCd.js +218 -0
  6. package/dist/admin-Btrm8mCd.js.map +1 -0
  7. package/dist/admin-CWofnT_Q.js +2 -0
  8. package/dist/api-BFpElwqK.js +89 -0
  9. package/dist/api-BFpElwqK.js.map +1 -0
  10. package/dist/audit-BB7jK9Z5.js +2 -0
  11. package/dist/audit-BVYknW2i.js +79 -0
  12. package/dist/audit-BVYknW2i.js.map +1 -0
  13. package/dist/auth-CXmBdMqw.js +2 -0
  14. package/dist/auth-D-GmwNv-.js +550 -0
  15. package/dist/auth-D-GmwNv-.js.map +1 -0
  16. package/dist/brand--ZB8jTn1.js +32 -0
  17. package/dist/brand--ZB8jTn1.js.map +1 -0
  18. package/dist/bus-Cz0flS37.js +12 -0
  19. package/dist/bus-Cz0flS37.js.map +1 -0
  20. package/dist/bus-OKIGut72.js +2 -0
  21. package/dist/cli.js +234 -0
  22. package/dist/cli.js.map +1 -0
  23. package/dist/commands-BNVLjYXA.js +167 -0
  24. package/dist/commands-BNVLjYXA.js.map +1 -0
  25. package/dist/commands-CdA6-WE7.js +112 -0
  26. package/dist/commands-CdA6-WE7.js.map +1 -0
  27. package/dist/config-C9XmYZWO.js +94 -0
  28. package/dist/config-C9XmYZWO.js.map +1 -0
  29. package/dist/config-CNVi0v5t.js +2 -0
  30. package/dist/connect-TtJ9n0Rw.js +362 -0
  31. package/dist/connect-TtJ9n0Rw.js.map +1 -0
  32. package/dist/content-C1lKMxFS.js +1170 -0
  33. package/dist/content-C1lKMxFS.js.map +1 -0
  34. package/dist/content-worker.js +28 -0
  35. package/dist/content-worker.js.map +1 -0
  36. package/dist/crypto-fv2fj3S8.js +75 -0
  37. package/dist/crypto-fv2fj3S8.js.map +1 -0
  38. package/dist/db-BEUEUPyP.js +561 -0
  39. package/dist/db-BEUEUPyP.js.map +1 -0
  40. package/dist/db-Q5BQuwga.js +2 -0
  41. package/dist/errors-FbMS3QBo.js +39 -0
  42. package/dist/errors-FbMS3QBo.js.map +1 -0
  43. package/dist/filter-Ck6OMxvu.js +158 -0
  44. package/dist/filter-Ck6OMxvu.js.map +1 -0
  45. package/dist/hermes-CKyzt1mH.js +3 -0
  46. package/dist/hermes-DHnDTYJp.js +1023 -0
  47. package/dist/hermes-DHnDTYJp.js.map +1 -0
  48. package/dist/import-DsN5NZT3.js +910 -0
  49. package/dist/import-DsN5NZT3.js.map +1 -0
  50. package/dist/instance-CwWbFbJ8.js +2 -0
  51. package/dist/instance-Dj9TpJB2.js +195 -0
  52. package/dist/instance-Dj9TpJB2.js.map +1 -0
  53. package/dist/listen-B9iO7HgQ.js +1568 -0
  54. package/dist/listen-B9iO7HgQ.js.map +1 -0
  55. package/dist/listen-CXVKG9XD.js +2 -0
  56. package/dist/manage-Bo6COB4p.js +477 -0
  57. package/dist/manage-Bo6COB4p.js.map +1 -0
  58. package/dist/manage-DoXqvjnU.js +2 -0
  59. package/dist/mcpheader-B8c5YO1B.js +2 -0
  60. package/dist/mcpheader-C9H4vudu.js +185 -0
  61. package/dist/mcpheader-C9H4vudu.js.map +1 -0
  62. package/dist/mcpsetup-BnHudwpq.js +2 -0
  63. package/dist/mcpsetup-DXXo2qjf.js +1053 -0
  64. package/dist/mcpsetup-DXXo2qjf.js.map +1 -0
  65. package/dist/node-check-CjTk6VNL.js +24 -0
  66. package/dist/node-check-CjTk6VNL.js.map +1 -0
  67. package/dist/paths-d-C2kdjo.js +2 -0
  68. package/dist/paths-yzOKD6ow.js +46 -0
  69. package/dist/paths-yzOKD6ow.js.map +1 -0
  70. package/dist/profile-CcMZ4hn7.js +2 -0
  71. package/dist/profile-NmMKAczz.js +222 -0
  72. package/dist/profile-NmMKAczz.js.map +1 -0
  73. package/dist/prompt-CKMQx_MJ.js +114 -0
  74. package/dist/prompt-CKMQx_MJ.js.map +1 -0
  75. package/dist/recipes-C7TIDlRj.js +3 -0
  76. package/dist/recipes-DG_-doGq.js +314 -0
  77. package/dist/recipes-DG_-doGq.js.map +1 -0
  78. package/dist/send-Dk-t8ia-.js +108 -0
  79. package/dist/send-Dk-t8ia-.js.map +1 -0
  80. package/dist/server-CDqDp1q3.js +20640 -0
  81. package/dist/server-CDqDp1q3.js.map +1 -0
  82. package/dist/service-BVn3soZZ.js +766 -0
  83. package/dist/service-BVn3soZZ.js.map +1 -0
  84. package/dist/service-BaWGPmSd.js +2 -0
  85. package/dist/service-C7jfo-Ex.js +457 -0
  86. package/dist/service-C7jfo-Ex.js.map +1 -0
  87. package/dist/service-DxDyKDQ-.js +2 -0
  88. package/dist/settings-B5qSHxRM.js +134 -0
  89. package/dist/settings-B5qSHxRM.js.map +1 -0
  90. package/dist/settings-DQvZaMN1.js +2 -0
  91. package/dist/setup-token-CwuSzfLK.js +48 -0
  92. package/dist/setup-token-CwuSzfLK.js.map +1 -0
  93. package/dist/skill/SKILL.md +445 -0
  94. package/dist/skill-1UQj3qgW.js +69 -0
  95. package/dist/skill-1UQj3qgW.js.map +1 -0
  96. package/dist/skill-pelq18JQ.js +2 -0
  97. package/dist/ssrf-BlVpGZ7C.js +181 -0
  98. package/dist/ssrf-BlVpGZ7C.js.map +1 -0
  99. package/dist/types-BhJDbSzE.js +135 -0
  100. package/dist/types-BhJDbSzE.js.map +1 -0
  101. package/dist/ui-B8Sd4Y7Y.js +81 -0
  102. package/dist/ui-B8Sd4Y7Y.js.map +1 -0
  103. package/dist/urls-Dp8pBGMU.js +2 -0
  104. package/dist/urls-U_LfYV61.js +27 -0
  105. package/dist/urls-U_LfYV61.js.map +1 -0
  106. package/dist/version-BxH7OuWD.js +20 -0
  107. package/dist/version-BxH7OuWD.js.map +1 -0
  108. package/dist/web/assets/_agentId-DonOCOlC.js +1 -0
  109. package/dist/web/assets/_app-B7t5lEia.js +1 -0
  110. package/dist/web/assets/_app-DMTGqYpM.js +65 -0
  111. package/dist/web/assets/_connectionId-DR5vFXOg.js +1 -0
  112. package/dist/web/assets/_webhookId-LfUlsULp.js +1 -0
  113. package/dist/web/assets/account-status-CEszs13C.js +1 -0
  114. package/dist/web/assets/accounts-5m7aiXuZ.js +1 -0
  115. package/dist/web/assets/accounts-list-YfJzThZa.js +1 -0
  116. package/dist/web/assets/activity-DOIe7SAg.js +1 -0
  117. package/dist/web/assets/add-connection-C8JR-13R.js +1 -0
  118. package/dist/web/assets/agent-create-form-CPxnPYH4.js +1 -0
  119. package/dist/web/assets/agents-B2Qj5KxT.js +1 -0
  120. package/dist/web/assets/approvals-BGaVaoFy.js +1 -0
  121. package/dist/web/assets/approve._id-BLrQnzPM.js +1 -0
  122. package/dist/web/assets/arrow-left-DZVAXoKj.js +1 -0
  123. package/dist/web/assets/arrow-right-C2zcqRr2.js +1 -0
  124. package/dist/web/assets/attention-gO9Nw5uW.js +1 -0
  125. package/dist/web/assets/audit-BPXXre8S.js +1 -0
  126. package/dist/web/assets/audit-bits-CGyIprzK.js +1 -0
  127. package/dist/web/assets/bell-ring-ig3zn1iS.js +1 -0
  128. package/dist/web/assets/bot-Zk76q_39.js +1 -0
  129. package/dist/web/assets/calendar-notice-DsCfq3VJ.js +1 -0
  130. package/dist/web/assets/calendar-plus-Cycfkk0y.js +1 -0
  131. package/dist/web/assets/calendar-setup-Pn61Wj1n.js +2 -0
  132. package/dist/web/assets/card-GSO5o-Ug.js +1 -0
  133. package/dist/web/assets/check-check-Ds1bPIGv.js +1 -0
  134. package/dist/web/assets/checkbox-B937U-Fd.js +1 -0
  135. package/dist/web/assets/chevron-right-Cqh4mDk1.js +1 -0
  136. package/dist/web/assets/chips-input-2xWDofmE.js +1 -0
  137. package/dist/web/assets/choice-cards-CgAIqBGX.js +1 -0
  138. package/dist/web/assets/circle-x-DcU-0zVh.js +1 -0
  139. package/dist/web/assets/command-khhto70y.js +1 -0
  140. package/dist/web/assets/common-BPZV8TFb.js +1 -0
  141. package/dist/web/assets/connect-agent-guide-CJdw31p2.js +1 -0
  142. package/dist/web/assets/connect-host-lr2c3xWh.js +6 -0
  143. package/dist/web/assets/connection-row-DYx_5o0c.js +1 -0
  144. package/dist/web/assets/connections-C4NOFb5R.js +1 -0
  145. package/dist/web/assets/data-table-kW1pkRB5.js +1 -0
  146. package/dist/web/assets/empty-DzTDioBP.js +1 -0
  147. package/dist/web/assets/events-C9zJnPKK.js +1 -0
  148. package/dist/web/assets/eye-B9gT1QSq.js +1 -0
  149. package/dist/web/assets/eye-off-Diktqz_g.js +1 -0
  150. package/dist/web/assets/field-C6ejurju.js +1 -0
  151. package/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  152. package/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  153. package/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  154. package/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  155. package/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  156. package/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  157. package/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  158. package/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  159. package/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  160. package/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  161. package/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  162. package/dist/web/assets/get-started-C38bq1gZ.js +2 -0
  163. package/dist/web/assets/hidden-chars-Dr9TxfvF.js +1 -0
  164. package/dist/web/assets/index-DGzo3kGh.js +11 -0
  165. package/dist/web/assets/index-zKOCQLGX.css +2 -0
  166. package/dist/web/assets/input-CWwJgozn.js +1 -0
  167. package/dist/web/assets/input-group-HG8OXcJ4.js +1 -0
  168. package/dist/web/assets/label-multi-select-sH8mllw8.js +1 -0
  169. package/dist/web/assets/labels-B5UqVwFo.js +1 -0
  170. package/dist/web/assets/laptop-BxJ4Nbj7.js +1 -0
  171. package/dist/web/assets/last-call-D-O5O94z.js +1 -0
  172. package/dist/web/assets/listener-handled-HNCuVrQ7.js +1 -0
  173. package/dist/web/assets/login-DaeKclcf.js +1 -0
  174. package/dist/web/assets/mail-C5fm2pTC.js +1 -0
  175. package/dist/web/assets/mcp-call-UoOTPFyh.js +1 -0
  176. package/dist/web/assets/mcp-call-card-Cr-OEDX2.js +3 -0
  177. package/dist/web/assets/message-square-quote-se8Bf3RP.js +1 -0
  178. package/dist/web/assets/mutations-CLPqJ6cj.js +1 -0
  179. package/dist/web/assets/network-igNw0VVx.js +1 -0
  180. package/dist/web/assets/pairing-XjuaVr2u.js +1 -0
  181. package/dist/web/assets/pairing-notifier-KPzOEZSO.js +1 -0
  182. package/dist/web/assets/paperclip-znS4iTrg.js +1 -0
  183. package/dist/web/assets/password-input-DV3aqcNf.js +1 -0
  184. package/dist/web/assets/pause-o-dK3khK.js +1 -0
  185. package/dist/web/assets/pencil-DkPFAhEq.js +1 -0
  186. package/dist/web/assets/play-DvCHND93.js +1 -0
  187. package/dist/web/assets/plug-CXAniEiR.js +1 -0
  188. package/dist/web/assets/plug-zap-BwR-l5wb.js +1 -0
  189. package/dist/web/assets/plus-B_TUslu3.js +1 -0
  190. package/dist/web/assets/preload-helper-Cc_aKyUb.js +1 -0
  191. package/dist/web/assets/public-url-rF2Xjyel.js +1 -0
  192. package/dist/web/assets/queries-Cv3nXx0U.js +42 -0
  193. package/dist/web/assets/refresh-cw-Ch5FNrby.js +1 -0
  194. package/dist/web/assets/revealed-keys-C_9NtJPY.js +1 -0
  195. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  196. package/dist/web/assets/rotate-ccw-B-mzPDk0.js +1 -0
  197. package/dist/web/assets/search-CTVKGomS.js +1 -0
  198. package/dist/web/assets/select-Bb806bpq.js +1 -0
  199. package/dist/web/assets/send-DuMVuYs1.js +1 -0
  200. package/dist/web/assets/settings-BWauhfFf.js +1 -0
  201. package/dist/web/assets/setup-B7bNKQOp.js +1 -0
  202. package/dist/web/assets/sheet-CYPwpUsH.js +1 -0
  203. package/dist/web/assets/shield-alert-CSYB-ThV.js +1 -0
  204. package/dist/web/assets/shield-check-BulpsYqK.js +1 -0
  205. package/dist/web/assets/sparkles-CUTiob4K.js +1 -0
  206. package/dist/web/assets/stamp-BNXUGNa3.js +1 -0
  207. package/dist/web/assets/step-url-51aMNak-.js +1 -0
  208. package/dist/web/assets/stream-Du7fY5_Y.js +1 -0
  209. package/dist/web/assets/tag-I5_-1jFL.js +1 -0
  210. package/dist/web/assets/terminal-BvxDFTJc.js +1 -0
  211. package/dist/web/assets/test-email-button-DYi7V_6X.js +1 -0
  212. package/dist/web/assets/toggle-group-Bdo1gmQ1.js +1 -0
  213. package/dist/web/assets/trash-Ci0aICEl.js +1 -0
  214. package/dist/web/assets/use-delivery-speed-BBh7W2q6.js +1 -0
  215. package/dist/web/assets/use-label-names-BXicesnP.js +1 -0
  216. package/dist/web/assets/use-sign-out-CPrY_oVO.js +1 -0
  217. package/dist/web/assets/useInfiniteQuery-DJLIM8yJ.js +1 -0
  218. package/dist/web/assets/useQuery-MrTwwNy5.js +1 -0
  219. package/dist/web/assets/useRouterState-D4OBK8l5.js +1 -0
  220. package/dist/web/assets/webhook-DjeeZiNC.js +1 -0
  221. package/dist/web/assets/webhook-bits-jw-y2D3u.js +1 -0
  222. package/dist/web/assets/webhook-sheet-B8h0skDe.js +34 -0
  223. package/dist/web/assets/webhooks-Cfsdpoyd.js +1 -0
  224. package/dist/web/assets/x-MF2TZ9aG.js +1 -0
  225. package/dist/web/favicon.svg +1 -0
  226. package/dist/web/index.html +27 -0
  227. package/package.json +98 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,D as n,Ht as r,M as i,N as a,T as o,Ut as s,Wt as c,_t as l,a as u,ft as d,gt as f,i as p,n as m,t as h,w as g,yt as _}from"./queries-Cv3nXx0U.js";import{t as v}from"./useQuery-MrTwwNy5.js";import{t as y}from"./x-MF2TZ9aG.js";import{c as b,i as x,n as ee,o as te,s as S,t as ne}from"./select-Bb806bpq.js";import{r as re,t as ie}from"./label-multi-select-sH8mllw8.js";import{a as ae,o as C,r as w,t as T}from"./card-GSO5o-Ug.js";import{n as E,t as oe}from"./message-square-quote-se8Bf3RP.js";import{F as D,L as O,c as k,d as A,f as se,i as ce,u as j,x as M}from"./common-BPZV8TFb.js";import{n as N,t as le}from"./shield-check-BulpsYqK.js";import{n as P,t as ue}from"./send-DuMVuYs1.js";import{t as de}from"./laptop-BxJ4Nbj7.js";import{t as fe}from"./search-CTVKGomS.js";import{t as F}from"./stamp-BNXUGNa3.js";import{t as pe}from"./terminal-BvxDFTJc.js";import{t as me}from"./checkbox-B937U-Fd.js";import{a as I,i as L,n as R,o as z,r as he,s as B,t as V}from"./field-C6ejurju.js";import{t as ge}from"./choice-cards-CgAIqBGX.js";import{n as H,t as _e}from"./chips-input-2xWDofmE.js";import{n as U,t as W}from"./toggle-group-Bdo1gmQ1.js";import{A as G,G as ve,H as ye,Ot as be,P as xe,it as Se,kt as Ce,q as we}from"./index-DGzo3kGh.js";import{a as Te,i as Ee,n as De,o as Oe,r as ke,s as Ae,t as je}from"./mutations-CLPqJ6cj.js";import{n as Me,t as K}from"./input-CWwJgozn.js";import{n as Ne}from"./pairing-notifier-KPzOEZSO.js";import{f as q,i as Pe,o as Fe,s as J}from"./labels-B5UqVwFo.js";import{n as Ie,t as Le}from"./account-status-CEszs13C.js";import{n as Y}from"./hidden-chars-Dr9TxfvF.js";var Re={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Re.node;var ze=l(Re),Be={name:`calendar-check`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]};Be.node;var Ve=l(Be),He={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};He.node;var Ue=l(He),We={name:`shield-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]};We.node;var Ge=l(We),Ke={name:`shield-plus`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9 12h6`,key:`1c52cq`}],[`path`,{d:`M12 9v6`,key:`199k2o`}]]};Ke.node;var qe=l(Ke),X=e(c(),1),Z={capabilities:[`read`,`draft`,`send`],labelScope:null,sendMode:`draft_only`,allowTo:[],replyOnly:!1,maxSendsPerHour:null,maxSendsPerDay:null,calendarScope:null,calendarWriteMode:`approval`},Je=[{id:`drafts`,label:`Read and draft (recommended)`,description:`Reads mail; anything it sends becomes a Gmail draft for you to review and send.`,capabilities:[`read`,`draft`,`send`],sendMode:`draft_only`},{id:`read`,label:`Read only`,description:`Search and read mail, and receive events. Can't draft, send or change anything.`,capabilities:[`read`],sendMode:`draft_only`},{id:`approval`,label:`Send with my approval`,description:`Reads and organizes mail; each send waits in Approvals until you approve it.`,capabilities:[`read`,`draft`,`send`,`organize`],sendMode:`approval`},{id:`full`,label:`Full access`,description:`Reads, organizes, trashes and sends directly. Only for agents you fully trust.`,capabilities:[`read`,`draft`,`send`,`organize`,`trash`],sendMode:`direct`}];function Ye(e,t=Z){return{...Z,capabilities:[...e.capabilities,...t.capabilities.filter(we)],sendMode:e.sendMode,calendarScope:t.calendarScope,calendarWriteMode:t.calendarWriteMode}}function Xe(e){return{capabilities:e.capabilities,labelScope:e.labelScope,sendMode:e.sendMode,allowTo:e.allowTo,replyOnly:e.replyOnly,maxSendsPerHour:e.maxSendsPerHour,maxSendsPerDay:e.maxSendsPerDay,calendarScope:e.calendarScope,calendarWriteMode:e.calendarWriteMode}}var Ze=(e,t)=>({...t,accountId:e}),Qe=e=>e.capabilities.includes(`calendar.write`)?e.calendarWriteMode:`none`;function $e(e,t){let n=e.capabilities.filter(e=>e!==`calendar.write`);return t===`none`?{capabilities:n,calendarWriteMode:e.calendarWriteMode}:{capabilities:[...n,`calendar.write`],calendarWriteMode:t}}var et=e=>e.capabilities.some(we);function tt(e){if(/\s/.test(e))return`no spaces allowed`;let t=e.split(`@`);return t.length!==2||!t[0]||!t[1]?`use name@domain or *@domain`:!/^[a-z0-9*][a-z0-9.*-]*\.[a-z*]{2,}$/i.test(t[1])&&t[1]!==`*`?`the domain doesn't look right`:null}var nt=(e,t)=>JSON.stringify(rt(e))===JSON.stringify(rt(t));function rt(e){return{...e,capabilities:[...e.capabilities].sort(),labelScope:e.labelScope?[...e.labelScope].sort():null,allowTo:[...e.allowTo].sort(),calendarScope:e.calendarScope?[...e.calendarScope].sort():null}}function it(e){return e.capabilities.length?e.labelScope&&e.labelScope.length===0?`Pick at least one label, or allow the whole mailbox.`:et(e)&&e.calendarScope&&e.calendarScope.length===0?`Pick at least one calendar, or allow every calendar.`:e.maxSendsPerHour===0||e.maxSendsPerDay===0?`Send limits must be at least 1 (leave empty for no limit).`:null:`Choose at least one capability.`}var Q=s(),at=[`none`,`approval`,`direct`],ot={none:ze,approval:F,direct:Ve},st=e=>e===`none`?Pe:Fe[e];function ct({value:e,onChange:t}){return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{type:`single`,variant:`outline`,size:`sm`,value:e,onValueChange:e=>e&&t(e),"aria-label":`Calendar writes`,className:`flex-wrap`,children:at.map(e=>{let t=ot[e];return(0,Q.jsxs)(U,{value:e,children:[(0,Q.jsx)(t,{}),` `,st(e).label]},e)})}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:st(e).description})]})}var lt=e=>e.length<2?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`;function ut(e){return[dt(e),ft(e)].filter(Boolean).join(`. `)||`No access`}function dt(e){let t=new Set(e.capabilities),n=t.has(`send`)&&e.sendMode!==`draft_only`,r=[];return t.has(`read`)&&r.push(`read`),(t.has(`draft`)||t.has(`send`)&&!n)&&r.push(`save drafts`),t.has(`organize`)&&r.push(`organize`),t.has(`trash`)&&r.push(`trash`),n&&r.push(e.sendMode===`approval`?`send once you approve`:`send`),r.length?r.length===1&&r[0]===`read`?`Can read; can't change or send anything`:`Can ${lt(r)}${n?``:`; can't send`}`:null}function ft(e){let t=e.capabilities.includes(`calendar.read`),n=e.capabilities.includes(`calendar.write`);if(!t&&!n)return null;let r=e.calendarScope?.length,i=r===void 0?`every calendar`:`${r} calendar${r===1?``:`s`}`,a=(e.calendarWriteMode??`approval`)===`approval`;return n?t?a?`Can read ${i}; writes need your approval`:`Can read and change ${i}`:`Can create events on ${i}${a?` once you approve`:``}; can't read or change existing ones`:`Can read ${i}; can't change events`}function pt({accountId:e,value:t,onChange:n}){return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(W,{type:`single`,variant:`outline`,size:`sm`,value:t===null?`all`:`labels`,onValueChange:e=>e&&n(e===`all`?null:t??[]),"aria-label":`Label scope`,children:[(0,Q.jsx)(U,{value:`all`,children:`Whole mailbox`}),(0,Q.jsx)(U,{value:`labels`,children:`Only some labels`})]}),t!==null&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ie,{accountIds:[e],value:t,onChange:n}),t.length===0&&(0,Q.jsx)(`p`,{className:`text-xs text-warning`,children:`Pick at least one label, or the agent won't see any mail.`})]})]})}var mt=[`draft_only`,`approval`,`direct`],ht={direct:ue,draft_only:Ue,approval:F};function gt({value:e,onChange:t,disabled:n}){return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{type:`single`,variant:`outline`,size:`sm`,value:e,disabled:n,onValueChange:e=>e&&t(e),"aria-label":`Send mode`,className:`flex-wrap`,children:mt.map(e=>{let t=ht[e];return(0,Q.jsxs)(U,{value:e,children:[(0,Q.jsx)(t,{}),` `,q[e].label]},e)})}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:q[e].description})]})}function _t(e){let t=[],n=dt(e);n&&t.push(n),n&&e.labelScope&&t.push(`${e.labelScope.length} label${e.labelScope.length===1?``:`s`}`),e.allowTo.length&&t.push(`${e.allowTo.length} allowed recipient${e.allowTo.length===1?``:`s`}`),n&&e.replyOnly&&t.push(`replies only`);let r=ft(e);return r&&t.push(r),t.length?t:[`No access`]}function vt({agentId:e,account:t,grant:r,defaultOpen:i}){let o=r?Xe(r):null,[s,c]=(0,X.useState)(o),[l,u]=(0,X.useState)(!!i&&!!r),[f,p]=(0,X.useState)(o);JSON.stringify(o)!==JSON.stringify(f)&&(p(o),(!s||f&&nt(s,f))&&c(o));let m=`/api/agents/${encodeURIComponent(e)}/grants/${encodeURIComponent(t.id)}`,_=je({mutationFn:e=>n(m,{method:`PUT`,body:Ze(t.id,e)}),invalidate:[h.agents],success:r?`Permissions for ${t.email} saved`:`${t.email} access granted`,errorTitle:`Couldn't save permissions`,onSuccess:e=>c(Xe(e))}),v=je({mutationFn:()=>n(m,{method:`DELETE`}),invalidate:[h.agents],success:`Access to ${t.email} removed`,errorTitle:!1,onSuccess:()=>{c(null),u(!1)}}),y=!!s&&(!o||!nt(s,o)),x=e=>c(t=>({...t??Z,...e})),[ee,te]=(0,X.useState)(!1),S=s?ee?`Add or clear the recipient you're typing first.`:it(s):null;return(0,Q.jsxs)(T,{className:`gap-0 py-0`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,Q.jsx)(Le,{email:t.email,className:`size-8`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:t.email}),t.status!==`active`&&(0,Q.jsx)(Ie,{status:t.status}),y&&o&&(0,Q.jsx)(O,{variant:`outline`,className:`border-warning/50 text-xs font-normal`,children:`Unsaved changes`})]}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:o?_t(o).join(` · `):s?`New access, not saved yet`:`No access`})]}),s?(0,Q.jsxs)(a,{variant:`ghost`,size:`sm`,onClick:()=>u(!l),"aria-expanded":l,children:[l?`Collapse`:`Edit`,(0,Q.jsx)(b,{className:d(`transition-transform`,l&&`rotate-180`)})]}):(0,Q.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>{c({...Z}),u(!0)},children:[(0,Q.jsx)(qe,{}),` Grant access`]})]}),s&&l&&(0,Q.jsx)(`div`,{className:`border-t p-4`,children:(0,Q.jsxs)(L,{children:[(0,Q.jsx)(yt,{idPrefix:t.id,accountId:t.id,value:s,onChange:x,onPendingChange:te}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-t pt-4`,children:[o?(0,Q.jsxs)(a,{variant:`ghost`,className:`text-destructive hover:text-destructive`,onClick:()=>Se({title:`Remove access to ${t.email}?`,description:`The agent immediately loses every capability on this mailbox, and its webhooks stop receiving events from it.`,confirmLabel:`Remove access`,destructive:!0,onConfirm:()=>v.mutateAsync()}),children:[(0,Q.jsx)(Ge,{}),` Remove access`]}):(0,Q.jsx)(`span`,{}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(y||!o)&&(0,Q.jsx)(a,{variant:`ghost`,onClick:()=>{c(o),o||u(!1)},children:o?`Discard changes`:`Cancel`}),S&&y&&(0,Q.jsx)(`span`,{className:`self-center text-xs text-warning`,children:S}),(0,Q.jsxs)(a,{disabled:!y||_.isPending||!!S,onClick:()=>_.mutate(s),children:[_.isPending&&(0,Q.jsx)(g,{}),o?`Save permissions`:`Grant access`]})]})]})]})})]})}function yt({idPrefix:e,accountId:t,value:n,onChange:r,onPendingChange:i}){let o=r,s=t=>`${e}-${t}`,c=n.capabilities.includes(`send`),l=n.capabilities.includes(`calendar.read`),u=n.capabilities.includes(`calendar.write`),f=et(n),p=n.capabilities.some(e=>ve.includes(e)),m=(e,t)=>o({capabilities:ye.filter(r=>r===e?t:n.capabilities.includes(r))});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(B,{children:[(0,Q.jsx)(z,{variant:`label`,children:`Capabilities`}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ve.map(e=>(0,Q.jsx)(bt,{capability:e,checked:n.capabilities.includes(e),onChange:t=>m(e,t)},e))}),p&&!n.capabilities.includes(`read`)&&(0,Q.jsx)(R,{className:`text-warning`,children:`Without Read, the agent can't search or open messages, so most actions will fail.`})]}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(z,{variant:`label`,children:`Which mail it can see`}),(0,Q.jsx)(R,{children:`Scoping works per thread: the agent sees a whole thread as soon as any message in it carries one of these labels, including replies from outside that join the thread later. Searches are limited to the same scope.`}),(0,Q.jsx)(pt,{accountId:t,value:n.labelScope,onChange:e=>o({labelScope:e})})]}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(z,{variant:`label`,children:`Calendar`}),(0,Q.jsx)(R,{children:`Separate from mail access: an agent can have either, both or neither.`}),f&&(0,Q.jsx)(xt,{accountId:t}),(0,Q.jsx)(bt,{capability:`calendar.read`,checked:l,onChange:e=>m(`calendar.read`,e)}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(I,{children:`Changes to events`}),(0,Q.jsx)(ct,{value:Qe(n),onChange:e=>o($e(n,e))}),u&&!l&&(0,Q.jsxs)(R,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-warning`,children:[(0,Q.jsx)(`span`,{children:`Without Calendar: read, writes only let the agent create events. Changing, deleting or answering existing ones needs read too.`}),(0,Q.jsx)(a,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>m(`calendar.read`,!0),children:`Turn on read`})]})]}),(0,Q.jsxs)(V,{"data-disabled":!f,children:[(0,Q.jsx)(I,{children:`Which calendars`}),(0,Q.jsx)(re,{accountId:t,value:n.calendarScope,onChange:e=>o({calendarScope:e}),disabled:!f})]})]}),(0,Q.jsxs)(B,{disabled:!c&&!u,className:d(!c&&!u&&`opacity-60`),children:[(0,Q.jsx)(z,{variant:`label`,children:`Sending`}),!c&&(0,Q.jsx)(R,{children:u?`Turn on the Send capability to configure how mail sending works. The recipients and limits below also cover calendar invitations.`:`Turn on the Send capability to configure how sending works.`}),(0,Q.jsx)(gt,{value:n.sendMode,onChange:e=>o({sendMode:e}),disabled:!c}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(I,{htmlFor:s(`allow`),children:`Allowed recipients`}),(0,Q.jsx)(_e,{id:s(`allow`),value:n.allowTo,onChange:e=>o({allowTo:e}),placeholder:`Anyone. Add addresses or *@company.com`,validate:tt,onPendingChange:i,"aria-describedby":s(`allow-hint`)}),(0,Q.jsxs)(R,{id:s(`allow-hint`),children:[`Leave empty to allow any recipient. Use exact addresses or globs like `,(0,Q.jsx)(`code`,{className:`font-mono`,children:`*@yourcompany.com`}),`. Every to, cc and bcc address must match`,u&&`, and so must every guest Google would email about a calendar change and the organizer of an invitation it answers with a comment`,`.`]})]}),(0,Q.jsxs)(V,{orientation:`horizontal`,children:[(0,Q.jsx)(H,{id:s(`reply`),checked:n.replyOnly,onCheckedChange:e=>o({replyOnly:e})}),(0,Q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Q.jsx)(I,{htmlFor:s(`reply`),children:`Replies only`}),(0,Q.jsxs)(R,{children:[`Only allow replying inside threads the agent can already see; no new conversations.`,u&&` It can't add guests to calendar events either.`]})]})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsx)(St,{id:s(`hour`),label:`Max sends per hour`,value:n.maxSendsPerHour,onChange:e=>o({maxSendsPerHour:e})}),(0,Q.jsx)(St,{id:s(`day`),label:`Max sends per day`,value:n.maxSendsPerDay,onChange:e=>o({maxSendsPerDay:e})})]}),u&&(0,Q.jsx)(R,{children:`Calendar changes that email guests count as one send each.`})]})]})}function bt({capability:e,checked:t,onChange:n}){return(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-2.5 has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/50 has-[[data-state=checked]]:bg-muted/40`,children:[(0,Q.jsx)(me,{className:`mt-0.5`,checked:t,onCheckedChange:e=>n(e===!0)}),(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium`,children:J[e].label}),(0,Q.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:J[e].description})]})]})}function xt({accountId:e}){let t=v(m.accounts()).data?.find(t=>t.id===e),n=t?t.calendar?.status??`not_granted`:null;return n!==`not_granted`&&n!==`api_disabled`?null:(0,Q.jsxs)(`p`,{className:`rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-xs`,children:[n===`not_granted`?`${t.email} hasn't added Google Calendar yet, so calendar tools fail for it until you add it on `:`The Google Calendar API is turned off in your Cloud project, so calendar tools fail until you turn it on from `,(0,Q.jsx)(_,{to:`/accounts`,className:`font-medium underline underline-offset-4`,children:`Accounts`}),`.`]})}function St({id:e,label:t,value:n,onChange:r}){return(0,Q.jsxs)(V,{children:[(0,Q.jsx)(I,{htmlFor:e,children:t}),(0,Q.jsx)(K,{id:e,inputMode:`numeric`,placeholder:`No limit`,value:n??``,onChange:e=>{let t=e.target.value.replace(/\D/g,``);r(t?Math.min(1e5,Number(t)):null)},"aria-invalid":n===0}),n===0&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Use at least 1, or leave empty for no limit.`})]})}var Ct=e=>e.allAgents?e.levelDefault:`none`,wt={capabilities:[`read`],labelScope:null,sendMode:`draft_only`,allowTo:[],replyOnly:!1,maxSendsPerHour:null,maxSendsPerDay:null,calendarScope:null,calendarWriteMode:`approval`};function Tt(e){let t=[],n=e.requested.capabilities??[];for(let e of n)e!==`read`&&e!==`draft`&&t.push(J[e].label);return e.requested.sendMode&&e.requested.sendMode!==`draft_only`&&t.push(q[e.requested.sendMode].label),n.includes(`calendar.write`)&&e.requested.calendarWriteMode===`direct`&&t.push(`Calendar writes: Direct`),t}function Et(e,t){let n=t.find(t=>t.userCode===e&&t.status===`pending`);if(n)return{kind:`pending`,p:n};let r=t.find(t=>t.userCode===e);return r?.status===`approved`?{kind:`approved`,p:r}:r?.status===`denied`?{kind:`denied`,p:r}:{kind:`gone`}}function Dt(e){return e?.trim()?`The agent's terminal shows that it was denied, with your note.`:`The agent's terminal shows that it was denied.`}var Ot=e=>(e&&e in G?G[e]:e)||null;function $(e){let t=e.toUpperCase().replace(/[^A-Z0-9]/g,``).slice(0,8);return t.length>4?`${t.slice(0,4)}-${t.slice(4)}`:t}function kt({at:e}){let t=D(1e3),n=Date.parse(e)-t;return n<=0?(0,Q.jsx)(`span`,{className:`text-critical`,children:`Expired`}):(0,Q.jsxs)(`span`,{className:d(`tabular`,n<12e4&&`font-medium text-warning`),children:[`Expires in `,M(n)]})}function At({p:e}){let t=Ot(e.client.tool),n=[...[{icon:de,label:`Host`,value:[e.client.hostname,e.client.platform].filter(Boolean).join(` · `)||null},{icon:pe,label:`Tool`,value:[t,e.client.version&&`CLI ${e.client.version}`].filter(Boolean).join(` · `)||null}].map(e=>({...e,node:e.value?(0,Q.jsx)(`span`,{className:`font-mono text-[13px] break-all`,children:(0,Q.jsx)(Y,{text:e.value})}):null})),{icon:N,label:`From`,node:(0,Q.jsxs)(`span`,{className:`text-[13px]`,children:[(0,Q.jsx)(`span`,{className:`font-mono`,children:e.ip??`unknown address`}),(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· requested `,(0,Q.jsx)(A,{date:e.createdAt})]})]})}];return(0,Q.jsx)(`dl`,{className:`space-y-2 text-sm`,children:n.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,Q.jsxs)(`dt`,{className:`flex w-16 shrink-0 items-center gap-1.5 self-center text-muted-foreground`,children:[(0,Q.jsx)(e.icon,{className:`size-3.5`}),` `,e.label]}),(0,Q.jsx)(`dd`,{className:`min-w-0`,children:e.node??(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`not given`})})]},e.label))})}function jt({p:e,accounts:t}){let n=e.requested,r=new Set(t.map(e=>e.email.toLowerCase())),i=[];return n.accounts?.length&&i.push([`Accounts`,n.accounts.map((e,t)=>(0,Q.jsxs)(`span`,{children:[t>0&&`, `,e,!r.has(e.toLowerCase())&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` (not connected)`})]},e))]),n.capabilities?.length&&i.push([`Capabilities`,n.capabilities.map(e=>J[e].label).join(`, `)]),n.sendMode&&i.push([`Sending`,q[n.sendMode].label]),n.calendarWriteMode&&i.push([`Calendar writes`,Fe[n.calendarWriteMode].label]),(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-muted/30 p-3`,children:[(0,Q.jsx)(k,{children:`Asked for`}),i.length?(0,Q.jsx)(`dl`,{className:`grid grid-cols-[6.5rem_1fr] gap-y-1 text-sm`,children:i.map(([e,t])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`min-w-0 break-words`,children:t})]},e))}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing specific. You decide what it gets.`}),n.reason&&(0,Q.jsxs)(`div`,{className:`flex gap-2 border-t pt-2 text-sm`,children:[(0,Q.jsx)(oe,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:(0,Q.jsx)(Y,{text:n.reason})})]})]})}function Mt({p:e,accounts:o,highlighted:s,onApprove:c}){let l=(0,X.useRef)(null),[u,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(``),_=r(),[v,b]=(0,X.useState)(!1);(0,X.useEffect)(()=>{s&&l.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[s]);let x=async()=>{b(!0);try{await n(`/api/pairings/${encodeURIComponent(e.id)}/deny`,{body:p.trim()?{note:p.trim()}:{}}),i.success(`Denied ${e.name}`,{description:Dt(p)}),_.invalidateQueries({queryKey:h.pairings})}catch(e){t(e,`Couldn't deny the request`)}finally{b(!1)}};return(0,Q.jsxs)(T,{ref:l,className:d(`scroll-mt-24 transition-shadow`,s&&`ring-2 ring-chart-1/60`),children:[(0,Q.jsx)(C,{className:`gap-3`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-base font-semibold break-words`,children:(0,Q.jsx)(Y,{text:e.name})}),(0,Q.jsx)(O,{variant:`outline`,className:`font-normal text-muted-foreground`,children:`self-reported by the agent`}),s&&(0,Q.jsx)(O,{className:`bg-chart-1 font-normal text-white`,children:s===`found`?`Matches the code you entered`:`Opened from a link`})]}),e.description&&(0,Q.jsx)(`p`,{className:`text-sm break-words whitespace-pre-wrap text-muted-foreground`,children:(0,Q.jsx)(Y,{text:e.description})})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(E,{className:`size-3.5`}),(0,Q.jsx)(kt,{at:e.expiresAt})]})]})}),(0,Q.jsxs)(w,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,Q.jsx)(At,{p:e}),(0,Q.jsx)(jt,{p:e,accounts:o})]}),u&&(0,Q.jsx)(w,{className:`pt-4`,children:(0,Q.jsxs)(V,{children:[(0,Q.jsx)(I,{htmlFor:`deny-${e.id}`,children:`Note for the agent (optional)`}),(0,Q.jsx)(Me,{id:`deny-${e.id}`,autoFocus:!0,rows:2,value:p,maxLength:500,onChange:e=>m(e.target.value),placeholder:`e.g. Ask in #ops first, or use the shared triage agent.`})]})}),(0,Q.jsxs)(ae,{className:`flex-wrap justify-between gap-3 border-t`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(P,{className:`size-3.5 shrink-0`}),`To approve, you'll type the code shown in the agent's terminal. If you didn't just run `,(0,Q.jsx)(`code`,{className:`font-mono`,children:`connect`}),` yourself, deny this request.`]}),(0,Q.jsx)(`div`,{className:`flex gap-2`,children:u?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:()=>f(!1),disabled:v,children:`Cancel`}),(0,Q.jsxs)(a,{variant:`destructive`,onClick:()=>void x(),disabled:v,children:[v?(0,Q.jsx)(g,{}):(0,Q.jsx)(y,{}),` Deny request`]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(a,{variant:`outline`,onClick:()=>f(!0),children:[(0,Q.jsx)(y,{}),` Deny`]}),(0,Q.jsxs)(a,{onClick:c,children:[(0,Q.jsx)(le,{}),` Review and approve`]})]})})]})]})}function Nt({pending:e,onFound:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null);return(0,Q.jsxs)(`form`,{onSubmit:i=>{i.preventDefault();let a=$(n);if(a.length<9)return o(`Codes have 8 characters, like K7QM-2XPD.`);let s=e.find(e=>e.userCode===a);if(!s)return o(`No waiting request has this code. Codes last 10 minutes; if it expired, run connect again.`);o(null),r(``),t(s)},className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`find-code`,className:`text-sm font-medium`,children:`Have a code from your agent's terminal?`}),(0,Q.jsxs)(`div`,{className:`flex max-w-md gap-2`,children:[(0,Q.jsx)(K,{id:`find-code`,value:n,onChange:e=>{r($(e.target.value)),o(null)},placeholder:`XXXX-XXXX`,autoComplete:`off`,spellCheck:!1,className:`font-mono tracking-widest uppercase`,"aria-invalid":!!i,"aria-describedby":`find-code-error`}),(0,Q.jsxs)(a,{type:`submit`,variant:`outline`,children:[(0,Q.jsx)(fe,{}),` Find request`]})]}),i&&(0,Q.jsx)(`p`,{id:`find-code-error`,className:`text-sm text-destructive`,children:i})]})}var Pt={on:!1,preset:`read`,fields:wt},Ft=e=>Je.find(t=>t.id===e),It=[{value:`read`,title:`Read only`,description:`Search and read mail. Can't change or send anything. No calendar access (choose Custom to add it).`,badge:(0,Q.jsx)(O,{variant:`secondary`,children:`Default`})},{value:`drafts`,title:`Read and draft`,description:`Anything it sends becomes a Gmail draft for you to send. No calendar access (choose Custom to add it).`},{value:`approval`,title:`Send with my approval`,description:`Each send waits in Approvals until you approve it. No calendar access (choose Custom to add it).`},{value:`custom`,title:`Custom`,description:`Pick capabilities, labels, calendars, recipients and limits.`}];function Lt({p:e,accounts:t,onOpenChange:n,onApproved:r}){let[i,a]=(0,X.useState)(null),o=!!e||!!i,s=()=>{a(null),n(!1)};return(0,Q.jsx)(De,{open:o,onOpenChange:e=>!e&&s(),children:(0,Q.jsx)(ke,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-2xl`,onInteractOutside:e=>e.preventDefault(),children:i?(0,Q.jsx)(Rt,{agent:i.agent,onClose:s}):e?(0,Q.jsx)(Bt,{p:e,accounts:t,onApproved:t=>{a({agent:t,request:e}),r?.(t)},onCancel:s},e.id):null})})}function Rt({agent:e,onClose:t}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-4 text-center`,children:[(0,Q.jsx)(`span`,{className:`flex size-12 items-center justify-center rounded-full bg-success/15 text-success`,children:(0,Q.jsx)(Ce,{className:`size-6`})}),(0,Q.jsxs)(Ae,{className:`text-lg`,children:[e.name,` is approved`]}),(0,Q.jsx)(Ee,{className:`max-w-md`,children:`The agent's terminal will receive its key automatically. The key is never shown here. If the terminal was closed, the key expires unused and the agent is removed.`})]}),(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(a,{variant:`outline`,asChild:!0,children:(0,Q.jsx)(_,{to:`/agents/$agentId`,params:{agentId:e.id},onClick:t,children:`Open agent`})}),(0,Q.jsx)(a,{onClick:t,children:`Done`})]})]})}function zt(){return(0,Q.jsxs)(Q.Fragment,{children:[`Typing it proves the request comes from a terminal you can see, so nobody can get access by sending you a link. If you didn't just run`,` `,(0,Q.jsx)(`code`,{className:`font-mono`,children:`connect`}),` yourself, deny it.`]})}function Bt({p:e,accounts:t,onApproved:i,onCancel:s,onDeny:c,denying:l,inline:b}){let re=r(),[ie,ae]=(0,X.useState)(``),[C,w]=(0,X.useState)(null),T=(0,X.useRef)(null);(0,X.useEffect)(()=>{C&&T.current?.focus()},[C]);let[E,oe]=(0,X.useState)(e.name),D=t.filter(e=>e.status!==`paused`),[A,se]=(0,X.useState)(()=>Object.fromEntries(D.map(e=>[e.id,{on:D.filter(e=>e.status===`active`).length===1&&e.status===`active`,preset:`read`,fields:{...wt}}]))),[j,M]=(0,X.useState)(null),[N,le]=(0,X.useState)(!1),[P,ue]=(0,X.useState)(!1),[de,fe]=(0,X.useState)({}),F=xe(),pe=v({...m.connections(),enabled:F}),L=F?pe.data??[]:[],[z,B]=(0,X.useState)({}),H=e=>z[e.id]??Ct(e),_e=L.some(e=>H(e)!==`none`),U=Tt(e),W=D.filter(e=>A[e.id]?.on),G=!W.length&&!_e?L.length?`Choose at least one account or connection.`:`Choose at least one account.`:W.some(e=>de[e.id]&&A[e.id].preset===`custom`)?`Add or clear the recipient you're typing first.`:W.map(e=>it(A[e.id].fields)).find(Boolean)??null,ve=async t=>{t.preventDefault();let r=$(ie);if(r.length<9)return w(`Type the full 8-character code from the agent's terminal.`);if(r!==e.userCode)return w(`That's not this request's code. If your terminal shows a different code, this request isn't from your agent: deny it.`);if(G)return M(Error(G));ue(!0),M(null);try{let t=await n(`/api/pairings/${encodeURIComponent(e.id)}/approve`,{body:{userCode:r,name:E.trim()||e.name,grants:W.map(e=>Ze(e.id,A[e.id].fields)),...L.length?{connections:L.map(e=>({connectionId:e.id,level:H(e)}))}:{}}});for(let e of[h.pairings,h.agents,h.setupState,h.overview,h.connections])re.invalidateQueries({queryKey:e});i(t)}catch(e){e instanceof o&&e.code===`user_code_mismatch`?w(e.message):(M(e),e instanceof o&&(e.status===409||e.status===404)&&(le(!0),re.invalidateQueries({queryKey:h.pairings})))}finally{ue(!1)}},ye=b?`div`:Te;return(0,Q.jsxs)(`form`,{onSubmit:e=>void ve(e),className:b?`space-y-5`:`contents`,noValidate:!0,children:[!b&&(0,Q.jsxs)(Oe,{children:[(0,Q.jsx)(Ae,{children:`Approve agent access`}),(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(`span`,{className:`font-medium text-foreground`,children:(0,Q.jsx)(Y,{text:e.name})}),` `,(0,Q.jsx)(`span`,{className:`rounded border px-1 text-xs`,children:`self-reported`}),` from `,(0,Q.jsx)(`span`,{className:`font-mono`,children:e.ip??`an unknown address`}),` `,`wants access. Nothing is granted until you confirm the code. `,(0,Q.jsx)(kt,{at:e.expiresAt}),`.`]})]}),(0,Q.jsxs)(V,{"data-invalid":!!C,children:[(0,Q.jsx)(I,{htmlFor:`pairing-code-${e.id}`,children:`Code from your agent's terminal`}),(0,Q.jsx)(K,{id:`pairing-code-${e.id}`,ref:T,autoFocus:!b,autoComplete:`off`,spellCheck:!1,value:ie,onChange:e=>{ae($(e.target.value)),w(null)},placeholder:`XXXX-XXXX`,className:`h-12 max-w-64 text-center font-mono text-2xl tracking-[0.2em] uppercase md:text-2xl`,"aria-invalid":!!C}),C?(0,Q.jsx)(he,{children:C}):(0,Q.jsx)(R,{children:(0,Q.jsx)(zt,{})})]}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(I,{htmlFor:`pairing-name-${e.id}`,children:`Agent name`}),(0,Q.jsx)(K,{id:`pairing-name-${e.id}`,value:E,maxLength:80,onChange:e=>oe(e.target.value)})]}),(0,Q.jsx)(jt,{p:e,accounts:t}),U.length>0&&(0,Q.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-sm`,children:[(0,Q.jsx)(be,{className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,Q.jsxs)(`span`,{children:[`It asked for more (`,U.join(`, `),`). Access below starts at `,(0,Q.jsx)(`span`,{className:`font-medium`,children:`Read`}),` with sending as`,` `,(0,Q.jsx)(`span`,{className:`font-medium`,children:`Draft only`}),` and no calendar access; add more only if you trust this agent`,U.some(e=>e.startsWith(`Calendar`))&&` (Custom has the calendar settings)`,`.`]})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(k,{children:`What it gets`}),D.length===0?L.length?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Gmail account is connected. That's fine: choose its connections below.`}):(0,Q.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No Gmail account is connected yet. `,(0,Q.jsx)(_,{to:`/accounts`,className:`font-medium text-foreground underline`,children:`Connect one`}),` first.`]}):D.map(e=>{let t=A[e.id]??Pt,n=t=>se(n=>({...n,[e.id]:{...n[e.id]??Pt,...t}}));return(0,Q.jsxs)(`div`,{className:d(`rounded-lg border`,t.on&&`bg-card`),children:[(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 p-3`,children:[(0,Q.jsx)(me,{checked:t.on,onCheckedChange:e=>n({on:e===!0})}),(0,Q.jsx)(Le,{email:e.email,className:`size-7`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.email}),e.status!==`active`&&(0,Q.jsx)(Ie,{status:e.status})]}),t.on&&(0,Q.jsxs)(`div`,{className:`space-y-4 border-t p-3`,children:[(0,Q.jsx)(ge,{columns:2,"aria-label":`Access to ${e.email}`,value:t.preset,choices:It,onChange:e=>{let r=Ft(e);n({preset:e,fields:r?Ye(r,t.fields):t.fields})}}),t.preset!==`custom`&&et(t.fields)&&(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Plus calendar: `,ft(t.fields),`. Change it under Custom.`]}),t.preset===`custom`&&(0,Q.jsx)(`div`,{className:`space-y-6 rounded-lg border p-3`,children:(0,Q.jsx)(yt,{idPrefix:`pair-${e.id}`,accountId:e.id,value:t.fields,onChange:e=>n({fields:{...t.fields,...e}}),onPendingChange:t=>fe(n=>({...n,[e.id]:t}))})})]})]},e.id)})]}),L.length>0&&(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(k,{children:`Connections`}),L.map(e=>(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border p-3 sm:flex-row sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm font-medium`,children:[e.name,e.status===`disabled`&&(0,Q.jsx)(O,{variant:`outline`,children:`Turned off`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u[H(e)].description})]}),(0,Q.jsxs)(ne,{value:H(e),onValueChange:t=>B(n=>({...n,[e.id]:t})),children:[(0,Q.jsx)(te,{className:`w-full sm:w-60`,"aria-label":`Access to ${e.name}`,children:(0,Q.jsx)(S,{})}),(0,Q.jsx)(ee,{children:p.map(e=>(0,Q.jsx)(x,{value:e,children:u[e].label},e))})]})]},e.id))]}),j!=null&&(0,Q.jsx)(ce,{error:j,title:`Couldn't approve`}),(0,Q.jsxs)(ye,{className:b?`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`:void 0,children:[c?(0,Q.jsxs)(a,{type:`button`,variant:`outline`,onClick:c,disabled:P||l,children:[l?(0,Q.jsx)(g,{}):(0,Q.jsx)(y,{}),` Deny`]}):(0,Q.jsx)(a,{type:`button`,variant:`ghost`,onClick:s,children:`Cancel`}),G&&!N&&(0,Q.jsx)(`span`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:G}),(0,Q.jsxs)(a,{type:`submit`,disabled:P||l||N||!!G,className:b?`h-auto min-h-9 whitespace-normal`:void 0,children:[P?(0,Q.jsx)(g,{}):(0,Q.jsx)(f,{}),` Approve and send key to terminal`]})]})]})}var Vt={approved:`good`,denied:`idle`,expired:`idle`,pending:`warn`};function Ht({items:e}){let t=v(m.agents());return e.length?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(k,{children:`Recent requests`}),(0,Q.jsx)(T,{className:`gap-0 py-0`,children:(0,Q.jsx)(`ul`,{className:`divide-y`,children:e.map(e=>{let n=e.agentId&&t.data?.some(t=>t.id===e.agentId);return(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-4 py-3 text-sm`,children:[(0,Q.jsx)(se,{tone:Vt[e.status],children:e.status[0].toUpperCase()+e.status.slice(1)}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:n?(0,Q.jsx)(_,{to:`/agents/$agentId`,params:{agentId:e.agentId},className:`hover:underline`,children:(0,Q.jsx)(Y,{text:e.name})}):(0,Q.jsx)(Y,{text:e.name})}),e.decisionNote&&(0,Q.jsxs)(`span`,{className:`max-w-xs truncate text-muted-foreground`,children:[`“`,(0,Q.jsx)(Y,{text:e.decisionNote}),`”`]}),(0,Q.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.ip}),(0,Q.jsx)(A,{date:e.decidedAt??e.expiresAt,className:`text-xs text-muted-foreground`})]},e.id)})})})]}):null}function Ut({onApproved:e,className:t}){let n=v({...m.pairings(`pending`),refetchInterval:5e3}),r=v(m.accounts()),i=D(5e3),[a,o]=(0,X.useState)(null);Ne();let s=(n.data??[]).filter(e=>Date.parse(e.expiresAt)>i);return(0,Q.jsxs)(`div`,{className:d(`space-y-3`,t),children:[(0,Q.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`flex items-center gap-2 text-sm`,children:a&&!s.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ce,{className:`size-4 text-success`}),(0,Q.jsxs)(`span`,{children:[a.name,` is approved. Its key went to the terminal.`,` `,(0,Q.jsx)(_,{to:`/agents/$agentId`,params:{agentId:a.id},className:`font-medium underline underline-offset-4`,children:`Open agent`})]})]}):s.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{tone:`warn`,pulse:!0}),(0,Q.jsx)(`span`,{className:`font-medium`,children:s.length===1?`A request is waiting for you`:`${s.length} requests are waiting for you`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{tone:`idle`,pulse:!0}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Waiting for a request. It shows up here as soon as you run the command.`})]})}),r.data&&s.map(t=>(0,Q.jsx)(Wt,{p:t,accounts:r.data,onApproved:t=>{o(t),e?.(t)}},t.id))]})}function Wt({p:e,accounts:i,onApproved:a}){let o=r(),[s,c]=(0,X.useState)(!1),l=async()=>{c(!0);try{await n(`/api/pairings/${encodeURIComponent(e.id)}/deny`,{body:{}}),await o.invalidateQueries({queryKey:h.pairings})}catch(e){t(e,`Couldn't deny the request`)}finally{c(!1)}};return(0,Q.jsxs)(`section`,{"aria-labelledby":`pairing-${e.id}`,className:`rounded-xl border bg-card`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 border-b p-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[(0,Q.jsxs)(`h3`,{id:`pairing-${e.id}`,className:`flex flex-wrap items-center gap-2 font-semibold break-words`,children:[(0,Q.jsx)(Y,{text:e.name}),(0,Q.jsx)(O,{variant:`outline`,className:`font-normal text-muted-foreground`,children:`self-reported by the agent`})]}),(0,Q.jsx)(At,{p:e})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(E,{className:`size-3.5`}),(0,Q.jsx)(kt,{at:e.expiresAt})]})]}),(0,Q.jsx)(`div`,{className:`p-4`,children:(0,Q.jsx)(Bt,{p:e,accounts:i,inline:!0,onApproved:a,onDeny:()=>void l(),denying:s})})]})}export{Ht as a,vt as c,Ze as d,Ye as f,Ut as i,ut as l,Lt as n,Dt as o,Mt as r,Et as s,Nt as t,Je as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{M as t,Wt as n,bt as r}from"./queries-Cv3nXx0U.js";import{t as i}from"./useRouterState-D4OBK8l5.js";import{n as a}from"./stream-Du7fY5_Y.js";var o=e(n(),1),s=0;function c(){(0,o.useEffect)(()=>(s++,()=>void s--),[])}function l(){let e=r(),n=i({select:e=>e.location.pathname}),c=(0,o.useRef)(new Set);return a(r=>{r.kind!==`pairing`||r.data.status!==`pending`||c.current.has(r.data.id)||(c.current.add(r.data.id),!(n.startsWith(`/approvals`)||s>0)&&t(`${r.data.name} is asking for access`,{description:r.data.client.hostname?`From ${r.data.client.hostname}. Approve it with the code in its terminal.`:`Approve it with the code in its terminal.`,duration:15e3,action:{label:`Review`,onClick:()=>void e({to:`/approvals`,search:{tab:`access`}})}}))}),null}export{c as n,l as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ut as t,Wt as n,ft as r}from"./queries-Cv3nXx0U.js";import{t as i}from"./eye-off-Diktqz_g.js";import{t as a}from"./eye-B9gT1QSq.js";import{i as o,n as s,r as c,t as l}from"./input-group-HG8OXcJ4.js";var u=e(n(),1),d=t();function f({className:e,...t}){let[n,r]=(0,u.useState)(!1);return(0,d.jsxs)(l,{className:e,children:[(0,d.jsx)(o,{type:n?`text`:`password`,...t}),(0,d.jsx)(s,{align:`inline-end`,children:(0,d.jsx)(c,{size:`icon-xs`,"aria-label":n?`Hide password`:`Show password`,onClick:()=>r(!n),children:n?(0,d.jsx)(i,{}):(0,d.jsx)(a,{})})})]})}function p(e){if(!e)return{score:0,label:``,hint:`Use at least 10 characters. A short passphrase of random words works well.`};let t=[/[a-z]/,/[A-Z]/,/\d/,/[^A-Za-z0-9]/].filter(t=>t.test(e)).length,n=Math.min(4,Math.floor(e.length/4))+t-1;(/^(.)\1+$/.test(e)||/^(password|letmein|qwerty|123456|admin)/i.test(e))&&(n=0),/(.)\1{3,}/.test(e)&&--n,e.length<10&&(n=Math.min(n,1));let r=Math.max(1,Math.min(4,Math.round(n/1.75)));return{score:r,...{1:{label:`Too weak`,hint:e.length<10?`Use at least 10 characters.`:`Avoid common words and repeats.`},2:{label:`Fair`,hint:`Longer is stronger: add a few more words or characters.`},3:{label:`Good`,hint:`Solid. Store it in your password manager.`},4:{label:`Strong`,hint:`Great. Store it in your password manager.`}}[r]}}function m({password:e}){let{score:t,label:n,hint:i}=p(e),a=[`bg-muted`,`bg-critical`,`bg-warning`,`bg-chart-1`,`bg-success`][t];return(0,d.jsxs)(`div`,{className:`space-y-1.5`,"aria-live":`polite`,children:[(0,d.jsx)(`div`,{className:`flex gap-1`,"aria-hidden":!0,children:[1,2,3,4].map(e=>(0,d.jsx)(`div`,{className:r(`h-1 flex-1 rounded-full transition-colors`,e<=t?a:`bg-muted`)},e))}),(0,d.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[n&&(0,d.jsxs)(`span`,{className:`font-medium text-foreground`,children:[n,`. `]}),i]})]})}export{m as n,f as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{_t as e}from"./queries-Cv3nXx0U.js";var t={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as t,Ft as n,It as r,Lt as i,Mt as a,Nt as o,Rt as s,Ut as c,Wt as l,bt as u,xt as d,yt as f}from"./queries-Cv3nXx0U.js";var p=c(),m=e(l(),1),h=m.use,g=m.useLayoutEffect,_=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,a=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=o:this.parentRoute||s();let c=a?o:t?.path;c&&c!==`/`&&(c=r(c));let l=t?.id||c,u=a?o:n((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(l??``));c===`__root__`&&(c=`/`);let d=u===`__root__`?`/`:c===void 0?this.parentRoute.fullPath:n(this.parentRoute.fullPath+`/`+c);this._path=c,this._id=u,this._fullPath=d,this._to=i(d)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>a({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},v=class extends _{constructor(e){super(e)}};function y(e){return d({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function b(e){let{select:t,...n}=e;return d({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function x(e){return d({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function S(e){return d({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function C(e){return d({...e,select:t=>e.select?e.select(t.context):t.context})}var w=class extends _{constructor(e){super(e),this.useMatch=e=>d({...e,from:this.id}),this.useRouteContext=e=>C({...e,from:this.id}),this.useSearch=e=>S({...e,from:this.id}),this.useParams=e=>x({...e,from:this.id}),this.useLoaderDeps=e=>b({...e,from:this.id}),this.useLoaderData=e=>y({...e,from:this.id}),this.useNavigate=()=>u({from:this.fullPath}),this.Link=m.forwardRef((e,t)=>(0,p.jsx)(f,{ref:t,from:this.fullPath,...e}))}};function T(e){return new w(e)}function E(){return e=>O(e)}var D=class extends v{constructor(e){super(e),this.useMatch=e=>d({...e,from:this.id}),this.useRouteContext=e=>C({...e,from:this.id}),this.useSearch=e=>S({...e,from:this.id}),this.useParams=e=>x({...e,from:this.id}),this.useLoaderDeps=e=>b({...e,from:this.id}),this.useLoaderData=e=>y({...e,from:this.id}),this.useNavigate=()=>u({from:this.fullPath}),this.Link=m.forwardRef((e,t)=>(0,p.jsx)(f,{ref:t,from:this.fullPath,...e}))}};function O(e){return new D(e)}function k(e){return e=>{let t=T(e);return t.isRoot=!1,t}}function A(e,n){let r,i,a,o=()=>(r||=(a=void 0,e().then(e=>{r=void 0,s.preload=void 0,i=e[n??`default`]}).catch(e=>{r=void 0,a=e})),r),s=function(e){if(a){if(t(a)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${a.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw a}if(!i){if(h)h(o());else throw o()}return m.createElement(i,e)};return s.preload=o,s}var j=`modulepreload`,M=function(e){return`/`+e},N={},P=function(e){return e.pathname.endsWith(`.css`)},F=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},I=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=M(t,n);let r=s(t),i=P(r);return F(N,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:j,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{g as a,E as i,A as n,k as r,I as t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./index-DGzo3kGh.js";function t(e){let t=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(e);return t?t.slice(1).map(Number):null}var n=[`.lan`,`.local`,`.home`,`.internal`,`.home.arpa`,`.localdomain`,`.corp`,`.intranet`,`.private`,`.test`,`.example`,`.invalid`,`.localhost`],r=new Set([`localhost`,`127.0.0.1`,`::1`]),i=e=>e.hostname.replace(/^\[|\]$/g,``).toLowerCase(),a=e=>e===`localhost`||e.endsWith(`.localhost`)||e===`::1`||t(e)?.[0]===127;function o(e){let r=i(e);if(a(r))return`loopback`;let o=t(r);return o&&o[0]===100&&o[1]>=64&&o[1]<=127||/^fd7a:115c:a1e0:/.test(r)?`tailscale`:t(r)||r.includes(`:`)?`ip`:!r.includes(`.`)||n.some(e=>r.endsWith(e))?`private-name`:`public-name`}function s(t){let n;try{n=new URL(t.trim())}catch{return null}if(n.protocol!==`http:`&&n.protocol!==`https:`)return null;let a=e(n.href),s=o(n),c=r.has(i(n)),l=n.protocol===`http:`?c?`direct`:`paste`:c||s===`public-name`?`direct`:`rejected`;return{url:n,transport:a,host:s,google:l}}function c(e,t){return{google:e.host===`loopback`&&t?[`bad`,`Won't work from this browser: Google would send you back to localhost on the computer you're browsing from, not to the server.`]:e.google===`direct`?[`good`,`Works directly: Google sends you straight back here.`]:e.google===`paste`?[`warn`,`One extra step: Google only returns to https or localhost addresses, so after signing in you copy the address you land on and paste it here.`]:[`bad`,`Won't work: Google refuses https addresses on a raw IP or a private name (like .lan or .local). Use a real domain, a *.ts.net name or localhost through an SSH tunnel.`],agents:e.transport===`loopback`?[`info`,`Only agents on the same machine as xaq can reach it.`]:e.transport===`tailscale`?[`good`,`Agents on your tailnet can connect (Tailscale encrypts the traffic).`]:e.transport===`https`?[`good`,`Agents anywhere that can reach this address can connect.`]:[`warn`,`Agents on other machines refuse plain http unless you add --insecure, because their key would cross the network unencrypted. Prefer an SSH tunnel, Tailscale or https.`]}}function l(e,n){let r=s(e);if(!r)return`Address`;if(e===n&&r.host!==`loopback`)return`Address in your browser`;switch(r.host){case`loopback`:return e===n?`This computer (your browser's address)`:`This computer only`;case`tailscale`:return`Tailscale`;case`ip`:{let e=t(r.url.hostname);return e&&(e[0]===10||e[0]===172&&e[1]>=16&&e[1]<=31||e[0]===192&&e[1]===168||e[0]===169&&e[1]===254)?`Your local network`:`Public IP`}default:return`Network name`}}var u=e=>s(e)?.host===`loopback`;function d(e,t){let n=s(e);return n&&n.host===`loopback`&&n.google===`direct`&&n.url.port===t?{url:n.url.origin,fromBrowser:!0}:{url:`http://localhost:${t}`,fromBrowser:!1}}function f(e,t){let n=globalThis.location?.origin??``;for(let r of[...e,n,t])try{let e=new URL(r).port;if(e)return e}catch{}return`8425`}function p(e){let t;try{t=new URL(e.trim())}catch{return`Enter a full URL, e.g. https://mail.example.com or http://localhost:8425`}if(t.protocol!==`http:`&&t.protocol!==`https:`)return`Use http or https.`;if(t.search||t.hash)return`Leave out any ?query or #fragment.`}function m(e,t){let n=s(e),r=s(t);return!n||!r||n.host!==`loopback`||r.host!==`loopback`||r.google!==`direct`||n.url.origin===r.url.origin||n.url.protocol!==r.url.protocol||n.url.port!==r.url.port?null:r.url.origin}export{d as a,c,u as i,s as n,m as o,f as r,p as s,l as t};