dorkos 0.114.0 → 0.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/bin/cli.js +39739 -38935
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-mErbIY0l.js → AboutPage-Cz8ijNrK.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-AlI4F82u.js → ActivityErrorState-BzmfwxSZ.js} +1 -1
  6. package/dist/client/assets/ActivityPage-BK7T3OiI.js +1 -0
  7. package/dist/client/assets/{ActivityRow-Baqdr6cP.js → ActivityRow-Ig5atv15.js} +1 -1
  8. package/dist/client/assets/AdapterIcon-BXPv5J8h.js +1 -0
  9. package/dist/client/assets/{AdapterSetupWizard-BL70qy2J.js → AdapterSetupWizard-BEziztL3.js} +2 -2
  10. package/dist/client/assets/AgentOptionRow-BqFQvFeN.js +1 -0
  11. package/dist/client/assets/AgentPicker-dCfEIsU-.js +1 -0
  12. package/dist/client/assets/{AgentRequestCard-CcMh6JyE.js → AgentRequestCard-BAhfGJxx.js} +3 -3
  13. package/dist/client/assets/AppearancePage-7qHhFeEv.js +1 -0
  14. package/dist/client/assets/ApplyToOverridesDialog-jqOFh0d1.js +1 -0
  15. package/dist/client/assets/AttentionSignalRow-3CgglXkd.js +1 -0
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-DHr_AhUv.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMKtHI0D.js} +3 -3
  17. package/dist/client/assets/BindingDialog-DSBxRyzA.js +1 -0
  18. package/dist/client/assets/{BlintzCanvas-Bq4e7n__.js → BlintzCanvas-CyRuqAJV.js} +1 -1
  19. package/dist/client/assets/{CanvasCsvContent-OR226CLS.js → CanvasCsvContent-Bd1c6TGx.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-DelYwSH8.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-BExIu4RY.js +2 -0
  22. package/dist/client/assets/ChatAppsOff-SWemSaUp.js +6 -0
  23. package/dist/client/assets/{CodeMirrorDiff-D7BWMOim.js → CodeMirrorDiff-0WF4ITRZ.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorEditor-BodwsIG7.js → CodeMirrorEditor-Bg7wC_Q8.js} +1 -1
  25. package/dist/client/assets/CommitmentList-CTvEGUV3.js +1 -0
  26. package/dist/client/assets/{CommitmentsPage-DL_jJQbw.js → CommitmentsPage-C68etoLe.js} +1 -1
  27. package/dist/client/assets/ConnectionAccessLists-9oeVn_GK.js +1 -0
  28. package/dist/client/assets/ConnectionsPage-CJOY4-kp.js +6 -0
  29. package/dist/client/assets/ConventionPage-DD-f5o6y.js +11 -0
  30. package/dist/client/assets/{ExtensionPageRoute-CzXGvVRm.js → ExtensionPageRoute-C6fW17AG.js} +2 -2
  31. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BV3h0rFa.js → FloatingTanStackRouterDevtools-CqogiFob-Zccd0fv6.js} +1 -1
  32. package/dist/client/assets/HandlePage-DOxlquWl.js +1 -0
  33. package/dist/client/assets/HeartbeatPage-cJM6NuTD.js +1 -0
  34. package/dist/client/assets/KeyEntry-K5k_3TfU.js +6 -0
  35. package/dist/client/assets/{LexicalField-Cc6wFZAZ.js → LexicalField-DB5V20zv.js} +2 -2
  36. package/dist/client/assets/{ManagesPage-BxHSb65X.js → ManagesPage-Cj0-hwfr.js} +1 -1
  37. package/dist/client/assets/{Marketplace-EgG6JmBG.js → Marketplace-eWEtLmd9.js} +2 -2
  38. package/dist/client/assets/{MarketplaceSourcesView-D9kq9hl6.js → MarketplaceSourcesView-B1h70C20.js} +1 -1
  39. package/dist/client/assets/{McpAppFrame-6zxszx9A.js → McpAppFrame-BaJ_r-QR.js} +2 -2
  40. package/dist/client/assets/McpSigninBody-Coaq5Fkf.js +1 -0
  41. package/dist/client/assets/{Model3dViewer-CgeJ2v-F.js → Model3dViewer-cKa-Jnbl.js} +1 -1
  42. package/dist/client/assets/NamePage-W7Frb1yy.js +1 -0
  43. package/dist/client/assets/{NewDirectMessageMenu-BnBO4aGI.js → NewDirectMessageMenu-C4zNIv9x.js} +1 -1
  44. package/dist/client/assets/{NotificationsPage-C5aRITCd.js → NotificationsPage-gKNClvNU.js} +1 -1
  45. package/dist/client/assets/{OpenMeshSwitch-UKMQeS7-.js → OpenMeshSwitch-RzB2u6-Q.js} +2 -2
  46. package/dist/client/assets/OperatorIdentityForm-B_78Vqh8.js +1 -0
  47. package/dist/client/assets/PermissionHistory-DrtlA4YM.js +1 -0
  48. package/dist/client/assets/PermissionsPage-O7kUVaQv.js +1 -0
  49. package/dist/client/assets/{PersonalityPopover-vLDfndfo.js → PersonalityPopover-DiNuuoWu.js} +1 -1
  50. package/dist/client/assets/PhotoPage-DdBke3yj.js +1 -0
  51. package/dist/client/assets/PresetPicker-BUFwg8RS.js +19 -0
  52. package/dist/client/assets/{PreviewRefusedNotice-Dh3SCC_A.js → PreviewRefusedNotice-DXZp669C.js} +1 -1
  53. package/dist/client/assets/ProfileFields-BCfMzNcT.js +1 -0
  54. package/dist/client/assets/ProfilePanelContainer-BzC2MGdi.js +1 -0
  55. package/dist/client/assets/ProfileRolePicker-f0FKXLtu.js +1 -0
  56. package/dist/client/assets/PromptSuggestionChips-EgeMFibt.js +1 -0
  57. package/dist/client/assets/ReportsToPopover-CQ4Xxslu.js +1 -0
  58. package/dist/client/assets/RoomSurface-oDbc6jnO.js +44 -0
  59. package/dist/client/assets/{RoomsPage-pPw8vrsB.js → RoomsPage-D_EbiSZ3.js} +1 -1
  60. package/dist/client/assets/RunsOnPopover-LtmmbIsD.js +1 -0
  61. package/dist/client/assets/RuntimeConnectFlow-Kv2ytk2m.js +1 -0
  62. package/dist/client/assets/RuntimeSetupDialog-CiWxlcPc.js +1 -0
  63. package/dist/client/assets/{SessionsPage-BASybh9v.js → SessionsPage-1rDO0SGV.js} +1 -1
  64. package/dist/client/assets/SettingsDialog-_ctp2AfE.js +12 -0
  65. package/dist/client/assets/SkillsPage-gPuQHKps.js +1 -0
  66. package/dist/client/assets/TaskDialogWrapper-BPFpCgsN.js +1 -0
  67. package/dist/client/assets/TasksEmptyState-D0Jlzmed.js +3 -0
  68. package/dist/client/assets/TasksPage-DvGfg5Bk.js +1 -0
  69. package/dist/client/assets/{ToolsPage-C3xfGWdb.js → ToolsPage-B0qZ85pR.js} +2 -2
  70. package/dist/client/assets/{TopologyGraph-D7Ik1Xt6.js → TopologyGraph-q1ammgpG.js} +3 -3
  71. package/dist/client/assets/TourHost-Dc8qw1Ef.js +1 -0
  72. package/dist/client/assets/{UnlinkDialog-TTK5Z_QD.js → UnlinkDialog-DXdrLsGV.js} +1 -1
  73. package/dist/client/assets/{WidgetErrorCard-D--KcgW1.js → WidgetErrorCard-ChDNC060.js} +23 -23
  74. package/dist/client/assets/_shell-BxPza3Lx.js +88 -0
  75. package/dist/client/assets/{_shell._home-CzpVyTzo.js → _shell._home-DjGunhLV.js} +1 -1
  76. package/dist/client/assets/_shell._home.activity-B014dET1.js +1 -0
  77. package/dist/client/assets/_shell._home.index-DEmtTHZg.js +3 -0
  78. package/dist/client/assets/_shell._home.tasks-CnDEbUOd.js +1 -0
  79. package/dist/client/assets/_shell._home.workspaces-AQtMUWuu.js +1 -0
  80. package/dist/client/assets/{_shell.channels-CCGSs0Bn.js → _shell.channels-C8NOhmJd.js} +4 -4
  81. package/dist/client/assets/_shell.connections-Bxe0wxOB.js +1 -0
  82. package/dist/client/assets/{_shell.feedback-requests-C6alx2ox.js → _shell.feedback-requests-C6ku9F5_.js} +2 -2
  83. package/dist/client/assets/_shell.marketplace-CEnzWFmI.js +1 -0
  84. package/dist/client/assets/_shell.marketplace_.sources-BZq1d2ih.js +1 -0
  85. package/dist/client/assets/_shell.session-Dn0C0mEZ.js +66 -0
  86. package/dist/client/assets/{_shell.team-BIwJNdkd.js → _shell.team-DoLdOMoC.js} +4 -4
  87. package/dist/client/assets/_shell.x._extensionId-DhE3OYMF.js +1 -0
  88. package/dist/client/assets/_shell.x._extensionId_._-DhE3OYMF.js +1 -0
  89. package/dist/client/assets/access-copy-CBGtcTk0.js +1 -0
  90. package/dist/client/assets/{agent-browser-CO5haI5Y.js → agent-browser-DbcLtsAx.js} +1 -1
  91. package/dist/client/assets/{banner-Dh5mO27l.js → banner-rPsz3suJ.js} +2 -2
  92. package/dist/client/assets/{card-CKZCX8ol.js → card-BqN3lfJn.js} +1 -1
  93. package/dist/client/assets/command-ZTLTCj0l.js +1 -0
  94. package/dist/client/assets/cpu-D70xMHl2.js +11 -0
  95. package/dist/client/assets/dead-letter-reasons-DtBHju9v.js +1 -0
  96. package/dist/client/assets/empty-state-yl1dLwLN.js +1 -0
  97. package/dist/client/assets/execution-config-BbBEe6FO.js +1 -0
  98. package/dist/client/assets/{file-CMPbZedq.js → file-CGg2M6ED.js} +1 -1
  99. package/dist/client/assets/{file-exclamation-point-emLeXvmw.js → file-exclamation-point-DZrVsShR.js} +1 -1
  100. package/dist/client/assets/{file-text-9a0DChCq.js → file-text-BYq_4IAt.js} +1 -1
  101. package/dist/client/assets/{find-latest-widget-fence--3kWMT1F.js → find-latest-widget-fence-CWs9nr10.js} +3 -3
  102. package/dist/client/assets/form-vPuXuaYT.js +1 -0
  103. package/dist/client/assets/format-cron-D02Tnupo.js +1 -0
  104. package/dist/client/assets/{git-branch-hfu8isLA.js → git-branch-DbjXDO_F.js} +1 -1
  105. package/dist/client/assets/{heart-SRafwnSd.js → heart-Dblp_miM.js} +1 -1
  106. package/dist/client/assets/{highlighted-body-KPVGNVTW-Dxwd3mxT.js → highlighted-body-KPVGNVTW-CaMXMak-.js} +1 -1
  107. package/dist/client/assets/index-B-WvQ24u.js +23 -0
  108. package/dist/client/assets/{index-Ch41JOI2.js → index-BKuzoeSn.js} +1 -1
  109. package/dist/client/assets/{index-DdsKmfEH.js → index-BOL391En.js} +1 -1
  110. package/dist/client/assets/{index-DLZi_nae.js → index-BPqkuMIa.js} +1 -1
  111. package/dist/client/assets/{index-BTXBESRm.js → index-BPwUl0Bz.js} +1 -1
  112. package/dist/client/assets/{index-DIlV08Vw.js → index-BV0tZnYg.js} +1 -1
  113. package/dist/client/assets/{index-3GDQSKet.js → index-BW98owO8.js} +1 -1
  114. package/dist/client/assets/{index-BTreBsWa.js → index-Bd23EYYT.js} +2 -2
  115. package/dist/client/assets/{index-BYp9xcmS.js → index-BdVOtoFr.js} +1 -1
  116. package/dist/client/assets/{index-CpYs0Lli.js → index-Bi7Um5RU.js} +1 -1
  117. package/dist/client/assets/{index-BRGOMmOM.js → index-BiIbMZ6d.js} +36 -36
  118. package/dist/client/assets/{index-C7BTAdSc.js → index-BxqUb-n7.js} +1 -1
  119. package/dist/client/assets/{index-DmTI5Hye.js → index-BzczIyv5.js} +1 -1
  120. package/dist/client/assets/index-C6NUjpzQ.js +38 -0
  121. package/dist/client/assets/{index-D67aFWxz.js → index-C88NZagl.js} +1 -1
  122. package/dist/client/assets/{index-BDfoFNcA.js → index-CHvi6xUU.js} +1 -1
  123. package/dist/client/assets/{index-CbFo-7kM.js → index-CMWMhbec.js} +1 -1
  124. package/dist/client/assets/{index-BB18IeC2.js → index-CN9fywRC.js} +1 -1
  125. package/dist/client/assets/{index-iD0epmn3.js → index-CRZXSh_q.js} +1 -1
  126. package/dist/client/assets/{index-YswfjpmW.js → index-CWNsRK97.js} +1 -1
  127. package/dist/client/assets/index-CaLw69VE.js +1 -0
  128. package/dist/client/assets/index-CdKpQ1hI.js +1018 -0
  129. package/dist/client/assets/{index-Cp7oifSs.js → index-CrK4rKAq.js} +1 -1
  130. package/dist/client/assets/{index-D_Wc_qTa.js → index-D16KF-iC.js} +3 -3
  131. package/dist/client/assets/index-D6m2SWHr.js +1 -0
  132. package/dist/client/assets/index-DDYi817r.js +1 -0
  133. package/dist/client/assets/{index-BokDvdOG.js → index-Db2EOzA3.js} +1 -1
  134. package/dist/client/assets/index-DdbHrvr0.js +1 -0
  135. package/dist/client/assets/index-Dg_bax15.js +17 -0
  136. package/dist/client/assets/index-DwUdUliR.js +1 -0
  137. package/dist/client/assets/{index-D0Nd2LA-.js → index-DzeYt-GT.js} +1 -1
  138. package/dist/client/assets/{index-lJc8v0Z3.js → index-Gq3gqBhY.js} +1 -1
  139. package/dist/client/assets/index-O_HMols_.js +1 -0
  140. package/dist/client/assets/{index-Cow815Qa.js → index-P5j6zmcN.js} +1 -1
  141. package/dist/client/assets/{index-BNn3-chz.js → index-XE46wAj9.js} +1 -1
  142. package/dist/client/assets/{index-C4nEz6I-.js → index-Z8YcKwIB.js} +1 -1
  143. package/dist/client/assets/{index-DFEF2MFy.css → index-kktlr1TJ.css} +1 -1
  144. package/dist/client/assets/{index-CAlXjm0N.js → index-lNMJBFB0.js} +1 -1
  145. package/dist/client/assets/{index-DX7V94qe.js → index-oWLYcpm4.js} +1 -1
  146. package/dist/client/assets/{index-DRqEM5Wb.js → index-vRc1D4KI.js} +1 -1
  147. package/dist/client/assets/inline-code-Cvn43Gqu.js +1 -0
  148. package/dist/client/assets/{layers-Cy8Tme6i.js → layers-Bmz62WF4.js} +1 -1
  149. package/dist/client/assets/{lightbulb-tNm7gLYi.js → lightbulb-CAd6slmc.js} +1 -1
  150. package/dist/client/assets/link-2-C0mn8T24.js +6 -0
  151. package/dist/client/assets/list-runtime-types-DxwGcKLx.js +1 -0
  152. package/dist/client/assets/{markdown-content-CoK3F0c0.js → markdown-content-1-B7PdbY.js} +1 -1
  153. package/dist/client/assets/{mention-pill-Bgs_yujj.js → mention-pill-D_-KXznh.js} +1 -1
  154. package/dist/client/assets/{message-square-off-CF2Bzen3.js → message-square-off-Di7kQvfe.js} +1 -1
  155. package/dist/client/assets/more-details-C6UGVeDE.js +1 -0
  156. package/dist/client/assets/{owner-notice-cgCWG4hG.js → owner-notice-CudDDBX4.js} +1 -1
  157. package/dist/client/assets/{package-DE8sQpId.js → package-D2eMoFCI.js} +1 -1
  158. package/dist/client/assets/{page-container-BoXmmBSs.js → page-container-CDHAACRA.js} +1 -1
  159. package/dist/client/assets/{paperclip-IgDeVFea.js → paperclip-p0W24D54.js} +1 -1
  160. package/dist/client/assets/path-input-j04LMj9z.js +1 -0
  161. package/dist/client/assets/primer-trigger-DkCcHf2Q.js +3 -0
  162. package/dist/client/assets/profile-errors-CqflLCzu.js +1 -0
  163. package/dist/client/assets/progress-BcuH4Eod.js +6 -0
  164. package/dist/client/assets/query-error-state-CEZs7dhg.js +1 -0
  165. package/dist/client/assets/{radio-BzTkFBDD.js → radio-DGWfQ5Rf.js} +1 -1
  166. package/dist/client/assets/registry-ChxwU0f4.js +1 -0
  167. package/dist/client/assets/relay-trace-schemas-y0nd8fzi.js +6 -0
  168. package/dist/client/assets/{room-files-source-CIIDTSTA.js → room-files-source-C1TCg4W_.js} +2 -2
  169. package/dist/client/assets/{rotate-ccw-clock-CGcSqHnk.js → rotate-ccw-clock-DcBojy-0.js} +1 -1
  170. package/dist/client/assets/{rotate-cw-DaduzRfP.js → rotate-cw-D0vUyeR2.js} +1 -1
  171. package/dist/client/assets/runtime-connect-Dn0T5YWv.js +1 -0
  172. package/dist/client/assets/{scroll-area-DW0-Liri.js → scroll-area-CQ9lO56h.js} +1 -1
  173. package/dist/client/assets/{search-x-Sme5ElYi.js → search-x-EJGj73JB.js} +2 -2
  174. package/dist/client/assets/settings-for-runtime-BoOa-ZFG.js +1 -0
  175. package/dist/client/assets/shield-check-Bp58y9u7.js +6 -0
  176. package/dist/client/assets/{shield-x-Bh5xap8N.js → shield-x-jF_NCCvp.js} +1 -1
  177. package/dist/client/assets/soul-file-Cag2i87x.js +1 -0
  178. package/dist/client/assets/{table-BEtvgYmW.js → table-D89CWVJX.js} +1 -1
  179. package/dist/client/assets/terminal-BUhNMZAt.js +6 -0
  180. package/dist/client/assets/trust-posture-15DMDZTA.js +1 -0
  181. package/dist/client/assets/unplug-opnrSXAi.js +6 -0
  182. package/dist/client/assets/unverified-catalog-notice-DHM5Coia.js +1 -0
  183. package/dist/client/assets/use-adapter-catalog-ClMqVelU.js +1 -0
  184. package/dist/client/assets/use-bindings-Ch6UUBvz.js +1 -0
  185. package/dist/client/assets/use-composer-prefs-Qn7KRpYe.js +1 -0
  186. package/dist/client/assets/{use-connector-management-Cohvs7jD.js → use-connector-management-dX_4x0d3.js} +1 -1
  187. package/dist/client/assets/use-deep-link-scroll-BV2fY4gy.js +1 -0
  188. package/dist/client/assets/use-delete-binding-BklxjB_c.js +1 -0
  189. package/dist/client/assets/{use-dev-links-DRnLdl--.js → use-dev-links-D4Bqam6F.js} +1 -1
  190. package/dist/client/assets/use-external-adapter-catalog-nHiD8BKZ.js +1 -0
  191. package/dist/client/assets/use-full-activity-feed-vYU7wQWT.js +1 -0
  192. package/dist/client/assets/use-is-below-desktop-G-mTu2Ga.js +1 -0
  193. package/dist/client/assets/{use-jump-back-in-CkFErfWY.js → use-jump-back-in-BVunjzyr.js} +3 -3
  194. package/dist/client/assets/use-mesh-topology-NaUKSKol.js +1 -0
  195. package/dist/client/assets/use-mounted-ref-BWpQ8f91.js +1 -0
  196. package/dist/client/assets/use-notification-prefs-qO1zRRFN.js +1 -0
  197. package/dist/client/assets/{use-panel-tab-placements-AFrWTQ0a.js → use-panel-tab-placements-Db6p2vLD.js} +1 -1
  198. package/dist/client/assets/use-pending-read-DUqJZUza.js +1 -0
  199. package/dist/client/assets/use-personality-commit-DUEKxHt_.js +1 -0
  200. package/dist/client/assets/{use-promo-activation-Dxt-1yuT.js → use-promo-activation-CnGaw39P.js} +2 -2
  201. package/dist/client/assets/use-promo-dismissals-bkSHhGhj.js +1 -0
  202. package/dist/client/assets/{use-pulse-freshness-DRRM5Hza.js → use-pulse-freshness-Oc_1gs-Y.js} +1 -1
  203. package/dist/client/assets/use-relay-config-Ba-S4wxY.js +1 -0
  204. package/dist/client/assets/{use-room-follow-claim-huRfaa4e.js → use-room-follow-claim-DqE5b95Z.js} +1 -1
  205. package/dist/client/assets/{use-roving-tab-list-BZIBAGgJ.js → use-roving-tab-list-DnMqliqf.js} +1 -1
  206. package/dist/client/assets/{use-session-canvas-CZIsr9qL.js → use-session-canvas-OdljtBE8.js} +4 -4
  207. package/dist/client/assets/{use-session-diagnostics-C41hV7rK.js → use-session-diagnostics-CtjxsM8_.js} +4 -4
  208. package/dist/client/assets/use-unclaimed-chats-5RCD5wIp.js +1 -0
  209. package/dist/client/assets/use-update-config-xkznZMHr.js +1 -0
  210. package/dist/client/assets/useMutationState-Mjr_y4xX.js +1 -0
  211. package/dist/client/index.html +2 -2
  212. package/dist/server/index.js +11367 -9690
  213. package/dist/server/index.js.map +2 -2
  214. package/package.json +4 -4
  215. package/dist/client/assets/ActivityPage-CHUqb-8c.js +0 -1
  216. package/dist/client/assets/AdapterIcon-C_fBZXHQ.js +0 -1
  217. package/dist/client/assets/AppearancePage-t9SnSRs-.js +0 -1
  218. package/dist/client/assets/AttentionSignalRow-jlgWaSSd.js +0 -1
  219. package/dist/client/assets/CanvasFileContent-BejM-9Wg.js +0 -2
  220. package/dist/client/assets/CanvasModel3dContent-BD-eCVsX.js +0 -2
  221. package/dist/client/assets/CommitmentList-YVb3yTvO.js +0 -1
  222. package/dist/client/assets/ConnectionAccessLists-BPsgToSR.js +0 -1
  223. package/dist/client/assets/ConnectionsPage-D7vlYnjf.js +0 -6
  224. package/dist/client/assets/ConventionPage-BR7I3AdE.js +0 -11
  225. package/dist/client/assets/HandlePage-B33P0oh0.js +0 -1
  226. package/dist/client/assets/HeartbeatPage-CfjZuvtQ.js +0 -1
  227. package/dist/client/assets/McpSigninBody-DBWSc6bm.js +0 -1
  228. package/dist/client/assets/NamePage-MfybpnwN.js +0 -1
  229. package/dist/client/assets/OperatorIdentityForm-DH2au7QU.js +0 -1
  230. package/dist/client/assets/PermissionsPage-BgLLmdg2.js +0 -1
  231. package/dist/client/assets/PhotoPage-BgyB3B2_.js +0 -1
  232. package/dist/client/assets/PromptSuggestionChips-EO_0zbzq.js +0 -1
  233. package/dist/client/assets/ReportsToPopover-C9Ceg1AW.js +0 -1
  234. package/dist/client/assets/RoomSurface-B8ec3_at.js +0 -44
  235. package/dist/client/assets/RunsOnPopover-CJoSj8w7.js +0 -1
  236. package/dist/client/assets/RuntimeSetupDialog-Cqn_Grel.js +0 -1
  237. package/dist/client/assets/SkillsPage-DL0909et.js +0 -1
  238. package/dist/client/assets/TasksPage-BwUW6dia.js +0 -1
  239. package/dist/client/assets/TourHost-Db0fxAXo.js +0 -1
  240. package/dist/client/assets/_shell-CGWsN6Gs.js +0 -88
  241. package/dist/client/assets/_shell._home.activity-BbWquOK0.js +0 -1
  242. package/dist/client/assets/_shell._home.index-Cg0nRFMN.js +0 -3
  243. package/dist/client/assets/_shell._home.tasks-BpoOVihw.js +0 -1
  244. package/dist/client/assets/_shell._home.workspaces-DVF1rM3t.js +0 -1
  245. package/dist/client/assets/_shell.connections-0_34lXIQ.js +0 -1
  246. package/dist/client/assets/_shell.marketplace-Dp-p8E3V.js +0 -1
  247. package/dist/client/assets/_shell.marketplace_.sources-SN2Fb1eb.js +0 -1
  248. package/dist/client/assets/_shell.session-Bt3jdQdD.js +0 -66
  249. package/dist/client/assets/_shell.x._extensionId-Bjn-MKsP.js +0 -1
  250. package/dist/client/assets/_shell.x._extensionId_._-Bjn-MKsP.js +0 -1
  251. package/dist/client/assets/index-BBQMqcO_.js +0 -1
  252. package/dist/client/assets/index-BUVKya1M.js +0 -23
  253. package/dist/client/assets/index-C3xuhmPa.js +0 -38
  254. package/dist/client/assets/index-C63bLSO4.js +0 -1099
  255. package/dist/client/assets/index-CTxEG5rD.js +0 -1
  256. package/dist/client/assets/index-CkknQ52Q.js +0 -17
  257. package/dist/client/assets/index-DLNwEM2Q.js +0 -1
  258. package/dist/client/assets/index-DX-j3Ul0.js +0 -1
  259. package/dist/client/assets/index-g_5oOlG6.js +0 -1
  260. package/dist/client/assets/index-t7gsOfUI.js +0 -1
  261. package/dist/client/assets/kickoff-xkt4LpIP.js +0 -3
  262. package/dist/client/assets/soul-file-NcuTUIiB.js +0 -1
  263. package/dist/client/assets/use-delete-binding-C19umm_i.js +0 -1
  264. package/dist/client/assets/use-external-adapter-catalog-BOn9aj72.js +0 -1
  265. package/dist/client/assets/use-full-activity-feed-BpQANbns.js +0 -1
  266. package/dist/client/assets/use-is-below-desktop-5LlietdR.js +0 -1
  267. package/dist/client/assets/use-mesh-topology-CIsDeAY0.js +0 -1
  268. package/dist/client/assets/use-pending-read-Dol8yvIx.js +0 -1
  269. package/dist/client/assets/use-personality-commit-fUtuc2lC.js +0 -1
  270. package/dist/client/assets/use-unclaimed-chats-BMlFQ2v1.js +0 -1
@@ -1 +1 @@
1
- {"version":1,"controllerSHA256":"b5957e9d31bd8bc477c07e058b31d45c65fa68f8c02aae56c13be9731ee4888e","nativeManifestSHA256":"19fb0607902e9c30bc693f3a8f7e80601f6ccfd090ffa412a5a38614e6eb7c00","platform":"darwin","arch":"arm64","availability":"available","workers":[{"name":"darwin-journal-worker.mjs","sha256":"739958b3515b48dda8cf40366aa6e34cf65366662c96dba1c951f38bc2f97603","bytes":88486},{"name":"darwin-supervisor-worker.mjs","sha256":"83b9b1e6d8969f5f909b43ebcf2d3ae6830601908bd2e4e4b2747d9ee7e55b77","bytes":74686}]}
1
+ {"version":1,"controllerSHA256":"7fb9b9b61dff5333e98924933fad0b6ac2d6a85240d290eab49600ea6ee4221a","nativeManifestSHA256":"19fb0607902e9c30bc693f3a8f7e80601f6ccfd090ffa412a5a38614e6eb7c00","platform":"darwin","arch":"arm64","availability":"available","workers":[{"name":"darwin-journal-worker.mjs","sha256":"739958b3515b48dda8cf40366aa6e34cf65366662c96dba1c951f38bc2f97603","bytes":88486},{"name":"darwin-supervisor-worker.mjs","sha256":"83b9b1e6d8969f5f909b43ebcf2d3ae6830601908bd2e4e4b2747d9ee7e55b77","bytes":74686}]}
@@ -1 +1 @@
1
- {"schemaVersion":1,"controllerSHA256":"b5957e9d31bd8bc477c07e058b31d45c65fa68f8c02aae56c13be9731ee4888e","verifierSHA256":"5cb8f248a264a0602757ad2c0971c1b1e84bcf3185a2b8d706230d2cfac0703c"}
1
+ {"schemaVersion":1,"controllerSHA256":"7fb9b9b61dff5333e98924933fad0b6ac2d6a85240d290eab49600ea6ee4221a","verifierSHA256":"5cb8f248a264a0602757ad2c0971c1b1e84bcf3185a2b8d706230d2cfac0703c"}
@@ -1 +1 @@
1
- import{b as N,d as v,j as e,e as w,r as d,X as C,I as k,B as D,f as S}from"./index-C63bLSO4.js";function j({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(p=>p!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(C,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(k,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"Capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function b({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,p]=d.useState(t),[m,f]=d.useState(null);s!==t&&(p(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=m?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:m}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function R({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(b,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"A name can’t be empty, so the old one was kept.";o({displayName:n})}}),e.jsx(b,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," has no description yet."]})}export{R as AboutPage};
1
+ import{b as N,d as v,j as e,e as w,r as d,X as C,I as k,B as D,f as S}from"./index-CdKpQ1hI.js";function j({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(p=>p!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(C,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(k,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"Capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function b({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,p]=d.useState(t),[m,f]=d.useState(null);s!==t&&(p(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=m?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:m}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function R({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(b,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"A name can’t be empty, so the old one was kept.";o({displayName:n})}}),e.jsx(b,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," has no description yet."]})}export{R as AboutPage};
@@ -1 +1 @@
1
- import{ev as x,ae as o,as as u,ew as f,j as a,Z as c,aw as p,B as y}from"./index-C63bLSO4.js";const g=["Today","Yesterday","This week","Earlier"];function A(e,s){const t=new Map;for(const r of e){const n=h(new Date(r.occurredAt),s),i=t.get(n)??[];i.push(r),t.set(n,i)}return g.filter(r=>t.has(r)).map(r=>({label:r,items:t.get(r)}))}function h(e,s){const t=new Date(s);t.setHours(0,0,0,0);const r=new Date(t);r.setDate(r.getDate()-1);const n=new Date(t);return n.setDate(n.getDate()-n.getDay()),e>=t?"Today":e>=r?"Yesterday":e>=n?"This week":"Earlier"}const T={person:"user",external:"user",agent:"agent",system:"system"};function k(e){return e.source.sessionId?x({session:e.source.sessionId}):null}function w(e){return{id:e.id,occurredAt:e.at,actorType:T[e.actor.kind],actorLabel:e.actor.name,summary:e.summary,linkPath:k(e)}}const d=["audit"],l=50;function m(e){return e.pages.flatMap(s=>s.events.map(w))}function E(e={}){const s=o();return u({queryKey:[...d,"list",e],queryFn:({pageParam:t})=>s.listAuditEvents({...e,limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function P(e){const s=o();return u({queryKey:[...d,"timeline",e],queryFn:e===null?f:({pageParam:t})=>s.getAccountTimeline(e,{limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function j({label:e,className:s}){return a.jsx("div",{"data-slot":"activity-group-header",className:c("sticky top-0 z-10 -mx-4 px-4 py-2 sm:-mx-6 sm:px-6","bg-background/95 backdrop-blur-sm",s),children:a.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wider uppercase",children:e})})}function D({onRetry:e,className:s}){return a.jsxs("div",{"data-slot":"activity-error-state",className:c("flex flex-col items-center justify-center gap-3 py-16 text-center",s),children:[a.jsx("div",{className:"bg-destructive/10 rounded-xl p-3",children:a.jsx(p,{className:"text-destructive size-6","aria-hidden":"true"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-foreground text-sm font-medium",children:"Couldn’t load your activity"}),a.jsx("p",{className:"text-muted-foreground max-w-xs text-xs",children:"The DorkOS server didn’t answer. Check that it’s running."})]}),a.jsx(y,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}export{D as A,j as a,E as b,A as g,P as u};
1
+ import{eq as x,a8 as o,aB as u,er as f,j as a,Q as c,a7 as p,B as y}from"./index-CdKpQ1hI.js";const g=["Today","Yesterday","This week","Earlier"];function A(e,s){const t=new Map;for(const r of e){const n=h(new Date(r.occurredAt),s),i=t.get(n)??[];i.push(r),t.set(n,i)}return g.filter(r=>t.has(r)).map(r=>({label:r,items:t.get(r)}))}function h(e,s){const t=new Date(s);t.setHours(0,0,0,0);const r=new Date(t);r.setDate(r.getDate()-1);const n=new Date(t);return n.setDate(n.getDate()-n.getDay()),e>=t?"Today":e>=r?"Yesterday":e>=n?"This week":"Earlier"}const T={person:"user",external:"user",agent:"agent",system:"system"};function k(e){return e.source.sessionId?x({session:e.source.sessionId}):null}function w(e){return{id:e.id,occurredAt:e.at,actorType:T[e.actor.kind],actorLabel:e.actor.name,summary:e.summary,linkPath:k(e)}}const d=["audit"],l=50;function m(e){return e.pages.flatMap(s=>s.events.map(w))}function E(e={}){const s=o();return u({queryKey:[...d,"list",e],queryFn:({pageParam:t})=>s.listAuditEvents({...e,limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function P(e){const s=o();return u({queryKey:[...d,"timeline",e],queryFn:e===null?f:({pageParam:t})=>s.getAccountTimeline(e,{limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function j({label:e,className:s}){return a.jsx("div",{"data-slot":"activity-group-header",className:c("sticky top-0 z-10 -mx-4 px-4 py-2 sm:-mx-6 sm:px-6","bg-background/95 backdrop-blur-sm",s),children:a.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wider uppercase",children:e})})}function D({onRetry:e,className:s}){return a.jsxs("div",{"data-slot":"activity-error-state",className:c("flex flex-col items-center justify-center gap-3 py-16 text-center",s),children:[a.jsx("div",{className:"bg-destructive/10 rounded-xl p-3",children:a.jsx(p,{className:"text-destructive size-6","aria-hidden":"true"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-foreground text-sm font-medium",children:"Couldn’t load your activity"}),a.jsx("p",{className:"text-muted-foreground max-w-xs text-xs",children:"The DorkOS server didn’t answer. Check that it’s running."})]}),a.jsx(y,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}export{D as A,j as a,E as b,A as g,P as u};
@@ -0,0 +1 @@
1
+ import{r as c,j as e,e as d,A as u,B as j,x as v}from"./index-CdKpQ1hI.js";import{E as g}from"./empty-state-yl1dLwLN.js";import{T as N,a as A}from"./table-D89CWVJX.js";import{u as b,g as w,A as E,a as T}from"./ActivityErrorState-BzmfwxSZ.js";import{A as B}from"./ActivityRow-Ig5atv15.js";function I({member:i}){var n;const r=((n=i.agent)==null?void 0:n.manifestId)??null,{data:l,isLoading:x,isError:m,refetch:p,isFetchingNextPage:o,hasNextPage:h,fetchNextPage:f}=b(r),s=c.useMemo(()=>l??[],[l]),y=c.useMemo(()=>w(s,new Date),[s]);return r===null?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-activity",children:e.jsx("p",{className:"text-muted-foreground text-xs",children:"Activity is kept per agent."})}):x?e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 px-4 py-3","data-slot":"profile-activity","aria-busy":"true",children:[e.jsx(d,{className:"h-3 w-16"}),Array.from({length:5}).map((t,a)=>e.jsx(d,{className:"h-4 w-full"},a))]}):m&&s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-2","data-slot":"profile-activity",children:e.jsx(E,{onRetry:()=>void p()})}):s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-8","data-slot":"profile-activity",children:e.jsx(g,{icon:u,headline:"Nothing on record yet",description:`What ${i.displayName} does shows up here.`})}):e.jsxs("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-activity",children:[y.map(t=>e.jsxs("section",{children:[e.jsx(T,{label:t.label}),e.jsx(N,{children:e.jsx(A,{children:t.items.map(a=>e.jsx(B,{item:a,compact:!0},a.id))})})]},t.label)),h&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>void f(),disabled:o,className:"gap-2",children:[o&&e.jsx(v,{size:"xs"}),"Load 50 more"]})})]})}export{I as ActivityPage};
@@ -1 +1 @@
1
- import{b5 as x,cU as d,j as e,aa as u,Z as l,bY as m,cV as g,B as h}from"./index-C63bLSO4.js";import{b as f,c}from"./table-BEtvgYmW.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},b={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:d,text:"text-neutral-500"},tasks:{icon:x,text:"text-purple-500"}};function p({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=b[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(p,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
1
+ import{bf as d,db as x,j as e,a5 as u,Q as l,cd as m,dc as g,B as h}from"./index-CdKpQ1hI.js";import{b as f,c}from"./table-D89CWVJX.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},b={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:x,text:"text-neutral-500"},tasks:{icon:d,text:"text-purple-500"}};function p({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=b[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(p,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
@@ -0,0 +1 @@
1
+ import{bL as n,bM as r,j as c,bN as s,aY as A}from"./index-CdKpQ1hI.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${r}`,stopping:`${n.warning} ${r}`,reconnecting:`${n.warning} ${r}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:i,adapterType:a,size:t=16,className:o}){const e=s[i??""]??s[a??""];return e?c.jsx(e,{size:t,className:o}):c.jsx(A,{className:o,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
@@ -1,2 +1,2 @@
1
- import{ae as be,af as Ne,ag as ze,ah as Ee,j as e,cz as qe,cA as Te,r as m,cB as ie,gX as $e,cC as oe,gY as le,ad as Me,cD as ce,cE as de,gZ as ue,di as he,cF as pe,bo as K,a3 as X,g_ as me,g$ as We,Z as U,d_ as Z,d$ as J,e0 as ee,e1 as se,e2 as te,I as re,e6 as xe,$ as Ve,bn as De,B as k,h0 as Se,e8 as Pe,e5 as ae,F as ke,ba as Re,b9 as Oe,aw as _e,eU as ge,h1 as Le,h2 as Ge,h3 as Ue,h4 as Ie,h5 as He,h6 as Qe,h7 as Ye,h8 as Ke,gm as Xe,dz as Ze,h9 as Je,cT as G,ez as es,eA as ss,eB as ts,eC as rs,eD as as,eE as ns,ha as je,hb as Q}from"./index-C63bLSO4.js";import{M as I}from"./markdown-content-CoK3F0c0.js";function Cs(s={}){const t=be(),a=Ne();return ze({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...Ee]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=m.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",x=h==="***",y=()=>{if(x){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs($e,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx(Me,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(X.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,w;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return x?e.jsx(xe,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(xe,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:U("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(Z,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(J,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(w=s.options)==null?void 0:w.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx(We,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!x&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(X.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(qe,{children:e.jsx(Te,{children:n.map(o=>a(o))})})]},l??"__default")})})}const fe=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?fe:fe.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(m.Fragment,{children:[i>0&&e.jsx("div",{className:U("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:U("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(Ve,{className:"size-3"}):i+1}),e.jsx("span",{className:U("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(De,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(I,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(Pe,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:x=>a(x.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:x=>x.values,children:x=>e.jsx(ls,{fields:r,allValues:x,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,w)=>d.handleChange(w),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:x})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Re,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(_e,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function ms({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function xs({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return m.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(Z,{value:t,onValueChange:a,children:[e.jsx(J,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(Z,{value:r,onValueChange:o=>l(o),children:[e.jsx(J,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(Le,{open:s,onOpenChange:t,children:e.jsxs(Ge,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ue,{children:[e.jsxs(Ie,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(He,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(I,{content:r})})]})})}function Ce(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function js(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
2
- `):t:s.valueShape==="json-object"&&typeof t=="object"?JSON.stringify(t,null,2):t}function fs(s,t){const a=s.setupSteps;if(!a||a.length===0)return s.configFields;const r=a[t];if(!r)return s.configFields;const l=s.configFields.filter(i=>r.fields.includes(i.key));return t!==a.length-1?l:[...l,...Ce(s)]}const ys="Advanced";function Y(s){const t={};for(const[a,r]of Object.entries(s)){const l=a.split(".");let i=t;for(let n=0;n<l.length-1;n++){const o=l[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[l[l.length-1]]=r}return t}function ve(s,t){const a=t.split(".");let r=s;for(const l of a){if(r==null||typeof r!="object")return;r=r[l]}return r}function vs(s,t){const a={};for(const r of s.configFields){const l=t?ve(t,r.key):void 0;l!==void 0&&r.type!=="password"?a[r.key]=js(r,l):r.type==="password"&&t&&ve(t,r.key)!==void 0?a[r.key]="***":r.default!==void 0?a[r.key]=r.default:a[r.key]=r.type==="boolean"?!1:""}return a}function bs(s,t=[]){const a=s.type;if(!t.includes(a))return a;let r=2;for(;t.includes(`${a}-${r}`);)r++;return`${a}-${r}`}function Ns({manifest:s,existingInstance:t,existingAdapterIds:a=[],onOpenChange:r}){const l=!!t,[i,n]=m.useState(t?"configure":"agent"),[o,v]=m.useState(!1),[h]=m.useState(()=>(t==null?void 0:t.id)??bs(s,a)),[x,y]=m.useState(()=>{var p;return((p=t==null?void 0:t.config)==null?void 0:p.label)??""}),[d,b]=m.useState(0),[N,w]=m.useState(""),[c,P]=m.useState(""),[$,R]=m.useState("per-chat"),q=Qe(),z=Ye(),S=Ke(),M=Xe(),{data:F}=Ze(),C=be(),E=Ne(),T=(F==null?void 0:F.agents)??[],B=s.setupSteps&&s.setupSteps.length>0,f=Je({defaultValues:vs(s,t==null?void 0:t.config),validators:{onSubmit:({value:p})=>{const g={};for(const u of s.configFields)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const j=p[u.key];(j==null||j==="")&&(g[u.key]=`${u.label} is required`)}return Object.keys(g).length>0?{fields:g}:void 0}},onSubmit:async()=>{}}),W=m.useMemo(()=>{const p=new Set(Ce(s).map(g=>g.key));return fs(s,d).map(g=>p.has(g.key)&&!g.section?{...g,section:ys}:g)},[s,d]),O=m.useCallback(()=>{const p=f.state.values;let g=!0;for(const u of W)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const j=p[u.key];(j==null||j==="")&&(f.setFieldMeta(u.key,A=>({...A,isTouched:!0,errors:[`${u.label} is required`],errorMap:{onSubmit:`${u.label} is required`}})),g=!1)}return g},[f,W]),_=m.useCallback(()=>{if(i==="agent"){if(!c)return;n("configure");return}if(i==="configure"){if(!O())return;if(B&&s.setupSteps&&d<s.setupSteps.length-1){b(u=>u+1);return}const g=f.state.values;n("test"),S.mutate({type:s.type,config:Y(g)},{onSuccess:u=>{u.botUsername&&(w(u.botUsername),x||y(`@${u.botUsername}`))}})}else i==="test"&&n("confirm")},[i,c,B,s,d,O,f,S,x]),V=m.useCallback(()=>{i==="test"?(n("configure"),S.reset()):i==="confirm"?n("test"):i==="configure"&&(B&&d>0?b(p=>p-1):l||n("agent"))},[i,B,d,S,l]),D=m.useCallback(async p=>{try{return await C.removeRelayAdapter(p),!0}catch{return!1}finally{E.invalidateQueries({queryKey:["relay"]})}},[C,E]),H=m.useCallback(()=>{const p=f.state.values,g=Y(p),u=x?{...g,label:x}:g;if(l&&t){z.mutate({id:t.id,config:u},{onSuccess:()=>r(!1)});return}if(!c){n("agent");return}q.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{M.mutate({adapterId:h,agentId:c,sessionStrategy:$,label:""},{onSuccess:()=>{var A;const j=((A=T.find(L=>L.id===c))==null?void 0:A.name)??c;G.success(`${s.displayName} is connected`,{description:`Messages here go to ${j}.`}),r(!1)},onError:j=>{n("agent"),D(h).then(A=>{A?G.error("Nothing was set up",{description:`${s.displayName} couldn’t be linked to an agent, so it wasn’t saved. ${j.message}`}):G.error("Couldn’t finish undoing",{description:`${s.displayName} was added with no agent to answer it. Remove it from Messaging. ${j.message}`})})}})},onError:j=>{var A,L,ne;(A=j.message)!=null&&A.includes("timed out")?G.error(`Couldn’t reach ${s.displayName}`,{description:"Check your token and network, then try again."}):((L=j.message)!=null&&L.includes("duplicate")||(ne=j.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[f,l,t,z,q,M,s,h,x,c,$,T,D,r]),we=m.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),w(""),P(""),R("per-chat"),v(!1),f.reset(),S.reset()),r(p)},[r,f,S,l]),Ae=m.useCallback(()=>{S.mutate({type:s.type,config:Y(f.state.values)})},[S,s.type,f]),Fe=q.isPending||z.isPending||M.isPending,Be=B&&s.setupSteps?s.setupSteps[d]:void 0;return{step:i,isEditMode:l,adapterId:h,label:x,setLabel:y,botUsername:N,guideOpen:o,setGuideOpen:v,form:f,visibleFields:W,bindAgentId:c,setBindAgentId:P,bindStrategy:$,setBindStrategy:R,agentOptions:T,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:_,handleBack:V,handleSave:H,handleOpenChange:we,handleRetryTest:Ae}}function ws({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var _;const i=Ns({manifest:a,existingInstance:r,existingAdapterIds:l,onOpenChange:t}),{step:n,isEditMode:o,adapterId:v,label:h,setLabel:x,botUsername:y,guideOpen:d,setGuideOpen:b,form:N,visibleFields:w,bindAgentId:c,setBindAgentId:P,bindStrategy:$,setBindStrategy:R,agentOptions:q,isSaving:z,hasSetupSteps:S,setupStepIndex:M,currentSetupStep:F,testConnection:C,handleContinue:E,handleBack:T,handleSave:B,handleOpenChange:f,handleRetryTest:W}=i,O={agent:"Pick who answers messages here.",configure:(F==null?void 0:F.description)??"Fill in the settings this needs.",test:"Checking the connection…",confirm:"Check it over, then save."}[n];return e.jsxs(m.Fragment,{children:[e.jsx(es,{open:s,onOpenChange:f,children:e.jsxs(ss,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(ts,{children:[e.jsx(rs,{children:o?`Edit ${a.displayName}`:`Add ${a.displayName}`}),e.jsx(as,{children:O})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto py-2",children:[e.jsx(ds,{current:n,showAgentStep:!o}),e.jsx(K,{mode:"wait",children:e.jsxs(X.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(xs,{agentOptions:q,agentId:c,onAgentIdChange:P,strategy:$,onStrategyChange:R}),n==="configure"&&e.jsx(us,{manifest:a,label:h,onLabelChange:x,fields:w,form:N,currentSetupStep:F,hasSetupGuide:!!a.setupGuide,onOpenGuide:()=>b(!0)}),n==="test"&&e.jsx(hs,{isPending:C.isPending,isSuccess:C.isSuccess,isError:C.isError,errorMessage:(_=C.error)==null?void 0:_.message,botUsername:y,onRetry:W}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var D;return e.jsx(ms,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((D=q.find(H=>H.id===c))==null?void 0:D.name)||c})}})]},n)})]}),e.jsxs(ns,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:T,disabled:z,children:[e.jsx(je,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?M>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:T,children:[e.jsx(je,{className:"mr-1 size-4"}),"Back"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),n==="agent"&&e.jsxs(k,{onClick:E,disabled:!c,children:["Continue",e.jsx(Q,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Q,{className:"ml-1 size-4"})]}),n==="test"&&!C.isPending&&!C.isSuccess&&e.jsx(k,{variant:"ghost",onClick:E,children:"Skip"}),n==="test"&&C.isSuccess&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Q,{className:"ml-1 size-4"})]}),n==="confirm"&&e.jsxs(k,{onClick:B,disabled:z,children:[z&&e.jsx(ke,{className:"mr-2"}),o?"Save changes":"Connect"]})]})]})]})}),a.setupGuide&&e.jsx(gs,{open:d,onOpenChange:b,title:a.displayName,content:a.setupGuide})]})}export{ws as A,Cs as u};
1
+ import{a8 as be,aa as Ne,ab as ze,j as e,bm as Ee,bn as qe,r as m,cZ as ie,gS as Te,c_ as oe,gD as le,a6 as We,Y as ce,Z as de,gT as ue,$ as he,a0 as pe,bF as Z,W as K,gU as me,gV as $e,Q as U,dW as X,dX as J,dY as ee,dZ as se,d_ as te,I as re,e2 as xe,R as Me,bE as Ve,B as k,gW as Se,e3 as De,e1 as ae,x as ke,bk as Pe,bj as Re,a7 as _e,ar as ge,gX as Oe,gY as Le,gZ as Ge,g_ as Ue,g$ as Ie,cB as Qe,ae as G,eu as Ye,ev as He,ew as Ze,ex as Ke,ey as Xe,ez as Je,h0 as fe,h1 as Y}from"./index-CdKpQ1hI.js";import{B as es}from"./use-bindings-Ch6UUBvz.js";import{M as I}from"./markdown-content-1-B7PdbY.js";import{a as ss,b as ts,c as rs}from"./use-adapter-catalog-ClMqVelU.js";import{u as as}from"./form-vPuXuaYT.js";import{a as ns}from"./BindingDialog-DSBxRyzA.js";import"./relay-trace-schemas-y0nd8fzi.js";function zs(s={}){const t=be(),a=Ne();return ze({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...es]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=m.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",x=h==="***",y=()=>{if(x){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs(Te,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx(We,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(Z,{children:d&&e.jsx(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,C;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return x?e.jsx(xe,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(xe,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:U("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(X,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(J,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(C=s.options)==null?void 0:C.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx($e,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!x&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(I,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(Z,{children:d&&e.jsx(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(me,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(Ee,{children:e.jsx(qe,{children:n.map(o=>a(o))})})]},l??"__default")})})}const je=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?je:je.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(m.Fragment,{children:[i>0&&e.jsx("div",{className:U("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:U("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(Me,{className:"size-3"}):i+1}),e.jsx("span",{className:U("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(Ve,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(I,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(De,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:x=>a(x.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:x=>x.values,children:x=>e.jsx(ls,{fields:r,allValues:x,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,C)=>d.handleChange(C),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:x})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Pe,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Re,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(_e,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function ms({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function xs({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return m.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(X,{value:t,onValueChange:a,children:[e.jsx(J,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(X,{value:r,onValueChange:o=>l(o),children:[e.jsx(J,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(Oe,{open:s,onOpenChange:t,children:e.jsxs(Le,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ge,{children:[e.jsxs(Ue,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(Ie,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(I,{content:r})})]})})}function we(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function fs(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
2
+ `):t:s.valueShape==="json-object"&&typeof t=="object"?JSON.stringify(t,null,2):t}function js(s,t){const a=s.setupSteps;if(!a||a.length===0)return s.configFields;const r=a[t];if(!r)return s.configFields;const l=s.configFields.filter(i=>r.fields.includes(i.key));return t!==a.length-1?l:[...l,...we(s)]}const ys="Advanced";function H(s){const t={};for(const[a,r]of Object.entries(s)){const l=a.split(".");let i=t;for(let n=0;n<l.length-1;n++){const o=l[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[l[l.length-1]]=r}return t}function ve(s,t){const a=t.split(".");let r=s;for(const l of a){if(r==null||typeof r!="object")return;r=r[l]}return r}function vs(s,t){const a={};for(const r of s.configFields){const l=t?ve(t,r.key):void 0;l!==void 0&&r.type!=="password"?a[r.key]=fs(r,l):r.type==="password"&&t&&ve(t,r.key)!==void 0?a[r.key]="***":r.default!==void 0?a[r.key]=r.default:a[r.key]=r.type==="boolean"?!1:""}return a}function bs(s,t=[]){const a=s.type;if(!t.includes(a))return a;let r=2;for(;t.includes(`${a}-${r}`);)r++;return`${a}-${r}`}function Ns({manifest:s,existingInstance:t,existingAdapterIds:a=[],onOpenChange:r}){const l=!!t,[i,n]=m.useState(t?"configure":"agent"),[o,v]=m.useState(!1),[h]=m.useState(()=>(t==null?void 0:t.id)??bs(s,a)),[x,y]=m.useState(()=>{var p;return((p=t==null?void 0:t.config)==null?void 0:p.label)??""}),[d,b]=m.useState(0),[N,C]=m.useState(""),[c,P]=m.useState(""),[W,R]=m.useState("per-chat"),q=ss(),z=ts(),S=rs(),$=ns(),{data:F}=Qe(),w=be(),E=Ne(),T=(F==null?void 0:F.agents)??[],B=s.setupSteps&&s.setupSteps.length>0,j=as({defaultValues:vs(s,t==null?void 0:t.config),validators:{onSubmit:({value:p})=>{const g={};for(const u of s.configFields)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(g[u.key]=`${u.label} is required`)}return Object.keys(g).length>0?{fields:g}:void 0}},onSubmit:async()=>{}}),M=m.useMemo(()=>{const p=new Set(we(s).map(g=>g.key));return js(s,d).map(g=>p.has(g.key)&&!g.section?{...g,section:ys}:g)},[s,d]),_=m.useCallback(()=>{const p=j.state.values;let g=!0;for(const u of M)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(j.setFieldMeta(u.key,A=>({...A,isTouched:!0,errors:[`${u.label} is required`],errorMap:{onSubmit:`${u.label} is required`}})),g=!1)}return g},[j,M]),O=m.useCallback(()=>{if(i==="agent"){if(!c)return;n("configure");return}if(i==="configure"){if(!_())return;if(B&&s.setupSteps&&d<s.setupSteps.length-1){b(u=>u+1);return}const g=j.state.values;n("test"),S.mutate({type:s.type,config:H(g)},{onSuccess:u=>{u.botUsername&&(C(u.botUsername),x||y(`@${u.botUsername}`))}})}else i==="test"&&n("confirm")},[i,c,B,s,d,_,j,S,x]),V=m.useCallback(()=>{i==="test"?(n("configure"),S.reset()):i==="confirm"?n("test"):i==="configure"&&(B&&d>0?b(p=>p-1):l||n("agent"))},[i,B,d,S,l]),D=m.useCallback(async p=>{try{return await w.removeRelayAdapter(p),!0}catch{return!1}finally{E.invalidateQueries({queryKey:["relay"]})}},[w,E]),Q=m.useCallback(()=>{const p=j.state.values,g=H(p),u=x?{...g,label:x}:g;if(l&&t){z.mutate({id:t.id,config:u},{onSuccess:()=>r(!1)});return}if(!c){n("agent");return}q.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{$.mutate({adapterId:h,agentId:c,sessionStrategy:W,label:""},{onSuccess:()=>{var A;const f=((A=T.find(L=>L.id===c))==null?void 0:A.name)??c;G.success(`${s.displayName} is connected`,{description:`Messages here go to ${f}.`}),r(!1)},onError:f=>{n("agent"),D(h).then(A=>{A?G.error("Nothing was set up",{description:`${s.displayName} couldn’t be linked to an agent, so it wasn’t saved. ${f.message}`}):G.error("Couldn’t finish undoing",{description:`${s.displayName} was added with no agent to answer it. Remove it from Messaging. ${f.message}`})})}})},onError:f=>{var A,L,ne;(A=f.message)!=null&&A.includes("timed out")?G.error(`Couldn’t reach ${s.displayName}`,{description:"Check your token and network, then try again."}):((L=f.message)!=null&&L.includes("duplicate")||(ne=f.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[j,l,t,z,q,$,s,h,x,c,W,T,D,r]),Ce=m.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),C(""),P(""),R("per-chat"),v(!1),j.reset(),S.reset()),r(p)},[r,j,S,l]),Ae=m.useCallback(()=>{S.mutate({type:s.type,config:H(j.state.values)})},[S,s.type,j]),Fe=q.isPending||z.isPending||$.isPending,Be=B&&s.setupSteps?s.setupSteps[d]:void 0;return{step:i,isEditMode:l,adapterId:h,label:x,setLabel:y,botUsername:N,guideOpen:o,setGuideOpen:v,form:j,visibleFields:M,bindAgentId:c,setBindAgentId:P,bindStrategy:W,setBindStrategy:R,agentOptions:T,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:O,handleBack:V,handleSave:Q,handleOpenChange:Ce,handleRetryTest:Ae}}function Es({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var O;const i=Ns({manifest:a,existingInstance:r,existingAdapterIds:l,onOpenChange:t}),{step:n,isEditMode:o,adapterId:v,label:h,setLabel:x,botUsername:y,guideOpen:d,setGuideOpen:b,form:N,visibleFields:C,bindAgentId:c,setBindAgentId:P,bindStrategy:W,setBindStrategy:R,agentOptions:q,isSaving:z,hasSetupSteps:S,setupStepIndex:$,currentSetupStep:F,testConnection:w,handleContinue:E,handleBack:T,handleSave:B,handleOpenChange:j,handleRetryTest:M}=i,_={agent:"Pick who answers messages here.",configure:(F==null?void 0:F.description)??"Fill in the settings this needs.",test:"Checking the connection…",confirm:"Check it over, then save."}[n];return e.jsxs(m.Fragment,{children:[e.jsx(Ye,{open:s,onOpenChange:j,children:e.jsxs(He,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(Ze,{children:[e.jsx(Ke,{children:o?`Edit ${a.displayName}`:`Add ${a.displayName}`}),e.jsx(Xe,{children:_})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto py-2",children:[e.jsx(ds,{current:n,showAgentStep:!o}),e.jsx(Z,{mode:"wait",children:e.jsxs(K.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(xs,{agentOptions:q,agentId:c,onAgentIdChange:P,strategy:W,onStrategyChange:R}),n==="configure"&&e.jsx(us,{manifest:a,label:h,onLabelChange:x,fields:C,form:N,currentSetupStep:F,hasSetupGuide:!!a.setupGuide,onOpenGuide:()=>b(!0)}),n==="test"&&e.jsx(hs,{isPending:w.isPending,isSuccess:w.isSuccess,isError:w.isError,errorMessage:(O=w.error)==null?void 0:O.message,botUsername:y,onRetry:M}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var D;return e.jsx(ms,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((D=q.find(Q=>Q.id===c))==null?void 0:D.name)||c})}})]},n)})]}),e.jsxs(Je,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:T,disabled:z,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?$>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:T,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),n==="agent"&&e.jsxs(k,{onClick:E,disabled:!c,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="test"&&!w.isPending&&!w.isSuccess&&e.jsx(k,{variant:"ghost",onClick:E,children:"Skip"}),n==="test"&&w.isSuccess&&e.jsxs(k,{onClick:E,children:["Continue",e.jsx(Y,{className:"ml-1 size-4"})]}),n==="confirm"&&e.jsxs(k,{onClick:B,disabled:z,children:[z&&e.jsx(ke,{className:"mr-2"}),o?"Save changes":"Connect"]})]})]})]})}),a.setupGuide&&e.jsx(gs,{open:d,onOpenChange:b,title:a.displayName,content:a.setupGuide})]})}export{Es as A,zs as u};
@@ -0,0 +1 @@
1
+ import{ap as m,j as s,aq as c,ar as x,R as u,Q as d}from"./index-CdKpQ1hI.js";function h({agent:e,name:t,secondary:a,trailing:n,selected:i,className:r}){const{color:o,emoji:l}=m(e);return s.jsxs("div",{className:d("flex w-full min-w-0 items-center gap-2",r),children:[s.jsx(c,{color:o,emoji:l,size:"xs",className:"shrink-0"}),s.jsx("span",{className:"min-w-[8ch] flex-auto truncate text-sm font-medium",children:t??x(e)}),a!=null&&s.jsx("span",{"data-slot":"agent-option-row-secondary",className:"text-muted-foreground min-w-0 shrink truncate text-xs",children:a}),n??(i&&s.jsx(u,{className:"size-4 shrink-0","aria-hidden":!0}))]})}export{h as A};
@@ -0,0 +1 @@
1
+ import{r as l,ak as h,j as e,al as j,am as g,an as b,ao as v,ap as w,aq as N,ar as p,as as C,Q as y,at as k}from"./index-CdKpQ1hI.js";import{C as A,a as S,b as D,c as E,d as P,e as L}from"./command-ZTLTCj0l.js";import{A as R}from"./AgentOptionRow-BqFQvFeN.js";function u({agents:n,value:t,onSelect:a}){return e.jsxs(A,{children:[e.jsx(S,{placeholder:"Search agents…"}),e.jsxs(D,{className:"!max-h-60 !overflow-y-auto",children:[e.jsx(E,{children:"No agents found."}),e.jsx(P,{children:n.map(s=>e.jsx(L,{value:`${p(s)} ${s.name} ${s.projectPath}`,onSelect:()=>a(s.id),children:e.jsx(R,{agent:s,secondary:k(s.projectPath),selected:s.id===t})},s.id))})]})]})}function x({selectedAgent:n,open:t,onClick:a}){const s=n?w(n):null;return e.jsxs("button",{type:"button","aria-expanded":t,"aria-haspopup":"listbox",className:y("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:a,children:[n?e.jsxs("span",{className:"flex items-center gap-2 truncate",children:[e.jsx(N,{color:s.color,emoji:s.emoji,size:"xs"}),e.jsx("span",{className:"truncate",children:p(n)})]}):e.jsx("span",{className:"text-muted-foreground",children:"Select an agent…"}),e.jsx(C,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}function $({agents:n,value:t,onValueChange:a}){const[s,o]=l.useState(!1),i=h(),c=l.useRef(null);l.useEffect(()=>{if(!s||i)return;function r(f){c.current&&!c.current.contains(f.target)&&o(!1)}return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[s,i]);const d=n.find(r=>r.id===t);function m(r){a(r===t?void 0:r),o(!1)}return n.length===0?e.jsxs("div",{className:"rounded-md border px-4 py-6 text-center",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"No agents yet"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Add one from the Team page to give it tasks."})]}):i?e.jsxs(e.Fragment,{children:[e.jsx(x,{selectedAgent:d,open:s,onClick:()=>o(!0)}),e.jsx(j,{open:s,onOpenChange:o,children:e.jsxs(g,{children:[e.jsx(b,{children:e.jsx(v,{children:"Select an agent"})}),e.jsx("div",{className:"px-4 pb-4",children:e.jsx(u,{agents:n,value:t,onSelect:m})})]})})]}):e.jsxs("div",{ref:c,className:"relative w-full",children:[e.jsx(x,{selectedAgent:d,open:s,onClick:()=>o(r=>!r)}),s&&e.jsx("div",{className:"bg-popover text-popover-foreground absolute top-full left-0 z-50 mt-1 w-full rounded-md border shadow-md",children:e.jsx(u,{agents:n,value:t,onSelect:m})})]})}export{$ as A};