dorkos 0.110.0 → 0.111.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 (173) hide show
  1. package/dist/bin/cli.js +57 -17
  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-C4kqKgU6.js → AboutPage-BKzqcz_A.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-DiSxgHLa.js → ActivityErrorState-BXOZg9ve.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BQneQ83b.js → ActivityPage-CFN2MEAV.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-BEKcGUIZ.js → ActivityRow-CujXx04u.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-CyEZ9jER.js → AdapterIcon-BdM7K69W.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-DpnW23lt.js → AdapterSetupWizard-3Bt9HEWF.js} +1 -1
  10. package/dist/client/assets/{AgentRequestCard-DosR0AYu.js → AgentRequestCard-CAaBGC0L.js} +1 -1
  11. package/dist/client/assets/{AppearancePage-DIeNtC-G.js → AppearancePage-BEe-Gssu.js} +1 -1
  12. package/dist/client/assets/{AttentionSignalRow-B0nSHLwZ.js → AttentionSignalRow-Cp0AJs73.js} +1 -1
  13. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXMeIZyY.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CN1iW2cB.js} +1 -1
  14. package/dist/client/assets/{BlintzCanvas-D-7b_-SG.js → BlintzCanvas-B7qs2dxW.js} +1 -1
  15. package/dist/client/assets/{CanvasCsvContent-iBvH55TS.js → CanvasCsvContent-DiB5zXOC.js} +1 -1
  16. package/dist/client/assets/{CanvasFileContent-C4LA1NRl.js → CanvasFileContent-CDNfnWMW.js} +2 -2
  17. package/dist/client/assets/{CanvasModel3dContent-BqLPKItZ.js → CanvasModel3dContent-C7EINmuq.js} +2 -2
  18. package/dist/client/assets/{CodeMirrorDiff-BfF4jWmG.js → CodeMirrorDiff-BJhflpbC.js} +1 -1
  19. package/dist/client/assets/{CodeMirrorEditor-gShkyo4u.js → CodeMirrorEditor-SkdXRKSN.js} +1 -1
  20. package/dist/client/assets/{CommitmentList-Bz1qfyAm.js → CommitmentList-DsEn6iK1.js} +1 -1
  21. package/dist/client/assets/{CommitmentsPage-BFnrzM5F.js → CommitmentsPage-W5h0GjRr.js} +1 -1
  22. package/dist/client/assets/{ConnectionAccessLists-C5dmaUUD.js → ConnectionAccessLists-DVFqelmV.js} +1 -1
  23. package/dist/client/assets/{ConnectionsPage-BX_hUzvu.js → ConnectionsPage-CZhSh2mO.js} +1 -1
  24. package/dist/client/assets/{ConventionPage-DHtiOJYZ.js → ConventionPage-DcDBP-vR.js} +1 -1
  25. package/dist/client/assets/{ExtensionPageRoute-DluAWT6h.js → ExtensionPageRoute-mKN8Jqyx.js} +1 -1
  26. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-IBBeJf7u.js → FloatingTanStackRouterDevtools-CqogiFob-CGXG-x9g.js} +1 -1
  27. package/dist/client/assets/HandlePage-Bun58ePo.js +1 -0
  28. package/dist/client/assets/{HeartbeatPage-DcispKV9.js → HeartbeatPage-DFf7Udem.js} +1 -1
  29. package/dist/client/assets/{LexicalField-CvW19ipK.js → LexicalField-vJ284m2H.js} +1 -1
  30. package/dist/client/assets/{ManagesPage-Dru8_kTd.js → ManagesPage-mDuaA2JT.js} +1 -1
  31. package/dist/client/assets/{Marketplace-UEST-d72.js → Marketplace-BoiupH2Z.js} +1 -1
  32. package/dist/client/assets/{MarketplaceSourcesView-2XwWS0fF.js → MarketplaceSourcesView-krw9hUyu.js} +1 -1
  33. package/dist/client/assets/{McpAppFrame-DcPNmy1o.js → McpAppFrame-DmHduNgp.js} +1 -1
  34. package/dist/client/assets/{McpSigninBody-YXQtYFSW.js → McpSigninBody-DoY09n4J.js} +1 -1
  35. package/dist/client/assets/{Model3dViewer-D9HznL8w.js → Model3dViewer-BZEdR7-9.js} +1 -1
  36. package/dist/client/assets/NamePage-CXyClUPJ.js +1 -0
  37. package/dist/client/assets/{NewDirectMessageMenu-DNd6s2qQ.js → NewDirectMessageMenu-BjqYwnXW.js} +1 -1
  38. package/dist/client/assets/{NotificationsPage-Dg7_d0Fo.js → NotificationsPage-CybW1eIb.js} +1 -1
  39. package/dist/client/assets/{OpenMeshSwitch-Dw8ylRP7.js → OpenMeshSwitch-DrmjsCDY.js} +1 -1
  40. package/dist/client/assets/{OperatorIdentityForm-DtA4qIAR.js → OperatorIdentityForm-byU2FeSU.js} +1 -1
  41. package/dist/client/assets/{PermissionsPage-ZEO9Crz4.js → PermissionsPage-CP3kbqyJ.js} +1 -1
  42. package/dist/client/assets/{PersonalityPopover-Cv26YoDX.js → PersonalityPopover-BLsjgaum.js} +1 -1
  43. package/dist/client/assets/PhotoPage-hn5b42qN.js +1 -0
  44. package/dist/client/assets/{PreviewRefusedNotice-CLOum_3D.js → PreviewRefusedNotice-fTN8MJ1h.js} +1 -1
  45. package/dist/client/assets/{PromptSuggestionChips-BMFNtxGR.js → PromptSuggestionChips-BZOaY5Tx.js} +1 -1
  46. package/dist/client/assets/{ReportsToPopover-CR7Exvh7.js → ReportsToPopover-B6JvfRt3.js} +1 -1
  47. package/dist/client/assets/{RoomSurface-Bq7667r4.js → RoomSurface-BM0QO_av.js} +3 -3
  48. package/dist/client/assets/{RoomsPage-DGOvUZFv.js → RoomsPage-B-NOCLXC.js} +1 -1
  49. package/dist/client/assets/{RunsOnPopover-CpS43xkI.js → RunsOnPopover-D1jQQatj.js} +1 -1
  50. package/dist/client/assets/{RuntimeSetupDialog-Bh0jopL-.js → RuntimeSetupDialog-ufwCvCJB.js} +1 -1
  51. package/dist/client/assets/{SessionsPage-Zfpi_q-8.js → SessionsPage-CBE1KHYg.js} +1 -1
  52. package/dist/client/assets/{SkillsPage-cjkbMED1.js → SkillsPage-CPTFjEUe.js} +1 -1
  53. package/dist/client/assets/{TasksPage-HQqmMSc-.js → TasksPage-BRUqs3v5.js} +1 -1
  54. package/dist/client/assets/{ToolsPage-Bo2_xjXO.js → ToolsPage-C25kL822.js} +1 -1
  55. package/dist/client/assets/{TopologyGraph-Is22VGxs.js → TopologyGraph-of6Cp5Kj.js} +1 -1
  56. package/dist/client/assets/{TourHost-DxBh58jt.js → TourHost-zwSilkjm.js} +1 -1
  57. package/dist/client/assets/{UnlinkDialog-B70UThXm.js → UnlinkDialog-BgwHAqdW.js} +1 -1
  58. package/dist/client/assets/{WidgetErrorCard-l8cP9oJc.js → WidgetErrorCard-BQwrR6PJ.js} +6 -6
  59. package/dist/client/assets/{_shell-pedi36wq.js → _shell-bcx2y7VT.js} +1 -1
  60. package/dist/client/assets/{_shell._home-9g2nykRD.js → _shell._home-BkP0NafS.js} +1 -1
  61. package/dist/client/assets/{_shell._home.activity-M0V2vwFy.js → _shell._home.activity-BO_2ciGK.js} +1 -1
  62. package/dist/client/assets/{_shell._home.index-8qVMuOhT.js → _shell._home.index-B-OFwU9u.js} +1 -1
  63. package/dist/client/assets/{_shell._home.tasks-fGzbxCP4.js → _shell._home.tasks-jAQczH7j.js} +1 -1
  64. package/dist/client/assets/{_shell._home.workspaces-BSeaYQDz.js → _shell._home.workspaces-B34Uk1SP.js} +1 -1
  65. package/dist/client/assets/{_shell.channels-DwyPOJGL.js → _shell.channels-CGzsxvXD.js} +1 -1
  66. package/dist/client/assets/_shell.connections-BNbeBrxQ.js +1 -0
  67. package/dist/client/assets/{_shell.feedback-requests-BPwtAQNY.js → _shell.feedback-requests-B71l48KB.js} +1 -1
  68. package/dist/client/assets/_shell.marketplace-3YAsNaRk.js +1 -0
  69. package/dist/client/assets/_shell.marketplace_.sources-cI3nNBXr.js +1 -0
  70. package/dist/client/assets/_shell.session-ybAc0bwn.js +66 -0
  71. package/dist/client/assets/{_shell.team-DKZ4y6kn.js → _shell.team-BE_60YS4.js} +3 -3
  72. package/dist/client/assets/_shell.x._extensionId-jiyP599c.js +1 -0
  73. package/dist/client/assets/_shell.x._extensionId_._-jiyP599c.js +1 -0
  74. package/dist/client/assets/{agent-browser-CSBlgMiw.js → agent-browser-Cs8abkZs.js} +1 -1
  75. package/dist/client/assets/{banner-D26eekSD.js → banner-CU2Nh3Kv.js} +1 -1
  76. package/dist/client/assets/{card-CTGm0Blo.js → card-BTgwskmX.js} +1 -1
  77. package/dist/client/assets/{file-B6neiwXF.js → file-DlQX-hKl.js} +1 -1
  78. package/dist/client/assets/{file-exclamation-point-B-iziRzy.js → file-exclamation-point-Dg2iCyPM.js} +1 -1
  79. package/dist/client/assets/{find-latest-widget-fence-Dw4BJ_cR.js → find-latest-widget-fence-BGiexm6r.js} +1 -1
  80. package/dist/client/assets/{git-branch-D9jctpSd.js → git-branch-Dq_w3Iyx.js} +1 -1
  81. package/dist/client/assets/{heart-cgLUdSV5.js → heart-Bp14wOx6.js} +1 -1
  82. package/dist/client/assets/{highlighted-body-KPVGNVTW-CEOricmN.js → highlighted-body-KPVGNVTW-kD1HK_wk.js} +1 -1
  83. package/dist/client/assets/{index-DcqBUr0N.js → index--3UwFg2s.js} +1 -1
  84. package/dist/client/assets/{index-CVzwL_3n.js → index-5OyUurJr.js} +1 -1
  85. package/dist/client/assets/{index-CUu6WsiU.js → index-B0OZehWe.js} +1 -1
  86. package/dist/client/assets/{index-BWnfydnq.js → index-B2JJZXsq.js} +1 -1
  87. package/dist/client/assets/{index-ZNJbhnlq.js → index-B6_ikFYj.js} +1 -1
  88. package/dist/client/assets/{index-1flHw44u.js → index-B8R78Nnj.js} +2 -2
  89. package/dist/client/assets/{index-bHlg-Jp8.js → index-BA-nPsLw.js} +1 -1
  90. package/dist/client/assets/{index-jD4A_p4E.js → index-BAjUSKoJ.js} +1 -1
  91. package/dist/client/assets/{index-CiIZQZuK.js → index-BHsZlKfx.js} +1 -1
  92. package/dist/client/assets/{index-BO2LMWbR.js → index-BeBmUxo_.js} +1 -1
  93. package/dist/client/assets/index-BpDY3eoD.js +1 -0
  94. package/dist/client/assets/{index-CqHifKay.js → index-BxUoa3yn.js} +1 -1
  95. package/dist/client/assets/{index-CLuxURdA.js → index-BxrZwUJp.js} +1 -1
  96. package/dist/client/assets/{index-vkTtWH-G.js → index-C-DN0Vg_.js} +1 -1
  97. package/dist/client/assets/{index-ClIP6HHR.js → index-C99173Ze.js} +1 -1
  98. package/dist/client/assets/{index-DKjP63zN.js → index-CAhJGlSW.js} +1 -1
  99. package/dist/client/assets/{index-CeCuaX5y.js → index-CDWsIVX7.js} +1 -1
  100. package/dist/client/assets/{index-tf4Y0hYZ.js → index-CKCMjqcu.js} +1 -1
  101. package/dist/client/assets/{index-K2hqr6x6.js → index-C_uYJzKi.js} +3 -3
  102. package/dist/client/assets/{index-CupP-VJi.js → index-Cc280M3V.js} +1 -1
  103. package/dist/client/assets/{index-D4em25Xt.js → index-CcV9S7cO.js} +1 -1
  104. package/dist/client/assets/{index-Bkfi8Myj.js → index-DHUToGjI.js} +1 -1
  105. package/dist/client/assets/{index-LP8S5WuT.js → index-DKQDBIWq.js} +1 -1
  106. package/dist/client/assets/{index-BfgOj4sK.js → index-DKlxz3u7.js} +1 -1
  107. package/dist/client/assets/{index-CBQqdBKL.js → index-DNglWRBB.js} +1 -1
  108. package/dist/client/assets/{index-CbDB1su1.js → index-DO6a5Hey.js} +1 -1
  109. package/dist/client/assets/{index-DQDCxGNh.js → index-DS-thlE8.js} +1 -1
  110. package/dist/client/assets/{index-CsjcT6BA.js → index-DSPs6GF4.js} +1 -1
  111. package/dist/client/assets/{index-DMmU6ZLq.js → index-DW6zqLoM.js} +1 -1
  112. package/dist/client/assets/{index-_nhqr_iZ.js → index-Dm53S0up.js} +1 -1
  113. package/dist/client/assets/{index-DckajKF2.js → index-DnmtTIUB.js} +1 -1
  114. package/dist/client/assets/{index-BZKMWkth.js → index-Dr-0P6rd.js} +239 -234
  115. package/dist/client/assets/{index-CGLE5zMG.js → index-F7Lcwnfm.js} +1 -1
  116. package/dist/client/assets/{index-B38pxhxw.js → index-LszRbEbX.js} +1 -1
  117. package/dist/client/assets/{index-lKqCjbqn.js → index-PxSRtDpP.js} +1 -1
  118. package/dist/client/assets/{index-BkYvXnXR.js → index-aDNEGBTK.js} +1 -1
  119. package/dist/client/assets/{index-C3tcDwG6.js → index-gu2JYnOq.js} +1 -1
  120. package/dist/client/assets/{index-BfDqp5Sv.js → index-kHXlTLUx.js} +7 -7
  121. package/dist/client/assets/{index-CSQHKTvU.js → index-knGXyHhh.js} +1 -1
  122. package/dist/client/assets/{kickoff-D-oHin9P.js → kickoff-Btbza7bw.js} +1 -1
  123. package/dist/client/assets/{layers-BpMm7sp6.js → layers-B0oCOfxz.js} +1 -1
  124. package/dist/client/assets/{lightbulb-CxP8HLlU.js → lightbulb-D80IzMqz.js} +1 -1
  125. package/dist/client/assets/{markdown-content-plNIomQc.js → markdown-content-aNzh-54y.js} +1 -1
  126. package/dist/client/assets/{mention-pill-B9c_KFvY.js → mention-pill-BxMK0xuY.js} +1 -1
  127. package/dist/client/assets/{message-square-off-8wAP6cRG.js → message-square-off-D-CJXmTq.js} +1 -1
  128. package/dist/client/assets/{owner-notice-CopwUeso.js → owner-notice-BkrTEMDm.js} +1 -1
  129. package/dist/client/assets/{package-B7amjGSw.js → package-CoTlAnXZ.js} +1 -1
  130. package/dist/client/assets/{page-container-DMx2f-Ca.js → page-container-CPxW5T9E.js} +1 -1
  131. package/dist/client/assets/{paperclip-CA9pcNn6.js → paperclip-Cj1P85mz.js} +1 -1
  132. package/dist/client/assets/{radio-B4GY45ie.js → radio-DICkTr_p.js} +1 -1
  133. package/dist/client/assets/{room-files-source-91oNy8mM.js → room-files-source-BywWQPBN.js} +1 -1
  134. package/dist/client/assets/{rotate-ccw-clock-C-ftj_rU.js → rotate-ccw-clock-cx5RyP4l.js} +1 -1
  135. package/dist/client/assets/{rotate-cw-TrlUqVdq.js → rotate-cw-DrGRGSwy.js} +1 -1
  136. package/dist/client/assets/{scroll-area-DKse0rZa.js → scroll-area-XlDz8u4m.js} +1 -1
  137. package/dist/client/assets/{search-x-DvMuhABO.js → search-x-LIKnWE64.js} +1 -1
  138. package/dist/client/assets/{shield-x-ZcQ8NB0Z.js → shield-x-DioB6qH_.js} +1 -1
  139. package/dist/client/assets/{soul-file-B_MwZHvh.js → soul-file-C7YgkNET.js} +1 -1
  140. package/dist/client/assets/{table-BJDpTBxJ.js → table-P4N5xQn2.js} +1 -1
  141. package/dist/client/assets/{use-connector-management-BZ-sfu8O.js → use-connector-management-pgVHbXoO.js} +1 -1
  142. package/dist/client/assets/{use-delete-binding-XWrr4lIB.js → use-delete-binding-DxEiOjjh.js} +1 -1
  143. package/dist/client/assets/{use-dev-links-daERqZ4e.js → use-dev-links-BImQrE6g.js} +1 -1
  144. package/dist/client/assets/{use-external-adapter-catalog-DE5zmChu.js → use-external-adapter-catalog-D8KHMSZU.js} +1 -1
  145. package/dist/client/assets/{use-full-activity-feed-DkDB2i0G.js → use-full-activity-feed-2o7GNAMe.js} +1 -1
  146. package/dist/client/assets/use-is-below-desktop-DBet5zg_.js +1 -0
  147. package/dist/client/assets/{use-jump-back-in-Dm-2B4la.js → use-jump-back-in-D9tBJ4v5.js} +1 -1
  148. package/dist/client/assets/{use-mesh-topology-DXFAk9hJ.js → use-mesh-topology-DBeqzUoy.js} +1 -1
  149. package/dist/client/assets/use-pending-read-DmrlNHS0.js +1 -0
  150. package/dist/client/assets/{use-personality-commit-CgQm9Y7m.js → use-personality-commit-Gfoi__sT.js} +1 -1
  151. package/dist/client/assets/{use-promo-activation-CZMwcIvl.js → use-promo-activation-Bv1gnqKq.js} +1 -1
  152. package/dist/client/assets/{use-pulse-freshness-CKzRoyfz.js → use-pulse-freshness-SFRdnugS.js} +1 -1
  153. package/dist/client/assets/{use-room-follow-claim-TvE0bgPq.js → use-room-follow-claim-Cf20JiJ_.js} +1 -1
  154. package/dist/client/assets/{use-roving-tab-list-DlrB639e.js → use-roving-tab-list-3Pb7ps4E.js} +1 -1
  155. package/dist/client/assets/{use-session-canvas-8hTR83y8.js → use-session-canvas-BaXuEhw8.js} +4 -4
  156. package/dist/client/assets/{use-session-diagnostics-DAd4CfKM.js → use-session-diagnostics-7xxJ6zQQ.js} +1 -1
  157. package/dist/client/assets/{use-unclaimed-chats-DKLFamqB.js → use-unclaimed-chats-D4k-EK_f.js} +1 -1
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/index.js +865 -216
  160. package/dist/server/index.js.map +2 -2
  161. package/package.json +3 -3
  162. package/dist/client/assets/HandlePage-CjinTYw3.js +0 -1
  163. package/dist/client/assets/NamePage-D5q8YN0G.js +0 -1
  164. package/dist/client/assets/PhotoPage-BYtfMHJD.js +0 -1
  165. package/dist/client/assets/_shell.connections-DQ8AztAx.js +0 -6
  166. package/dist/client/assets/_shell.marketplace-CiM3PSqV.js +0 -1
  167. package/dist/client/assets/_shell.marketplace_.sources-C5u-WJmL.js +0 -1
  168. package/dist/client/assets/_shell.session-DYCz4inz.js +0 -66
  169. package/dist/client/assets/_shell.x._extensionId-C1fzIfH4.js +0 -1
  170. package/dist/client/assets/_shell.x._extensionId_._-C1fzIfH4.js +0 -1
  171. package/dist/client/assets/index-AYHwV9IU.js +0 -1
  172. package/dist/client/assets/use-is-below-desktop-B-Dt4c9S.js +0 -1
  173. package/dist/client/assets/use-pending-read-CH_0XPYp.js +0 -1
@@ -1 +1 @@
1
- import{j as e,t as o,p as r,g as l,C as d}from"./index-BZKMWkth.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
1
+ import{j as e,t as o,p as r,g as l,C as d}from"./index-Dr-0P6rd.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
@@ -1,4 +1,4 @@
1
- import{a4 as te,ae as B,aj as de,ak as P,af as ae,ag as ue,lF as ln,r as p,u as ke,lG as Ce,j as s,dY as on,dZ as cn,d_ as dn,d$ as un,e0 as mn,fo as hn,e3 as ee,iY as pn,I as fn,lH as We,lI as be,lJ as Ge,lK as us,lL as ms,e as W,A as xn,lp as gn,at as me,lM as kn,B as C,dc as jn,lN as Ke,lO as vn,lP as bn,a3 as Qe,P as yn,Z as oe,cQ as S,cU as K,ee as Nn,lw as wn,lQ as Cn,cT as Pn,cP as Sn,gB as $n,lR as In,lS as Ye,lT as J,lU as Rn,lV as ve,$ as hs,g$ as Ve,lW as Tn,b2 as Dn,ec as qe,gY as ps,aa as se,ei as En,C as Pe,dK as fs,gL as Ln,gM as An,gN as Un,gO as On,lX as xs,gP as Fn,bv as Mn,e6 as zn,e7 as _n,j4 as Kn,ii as gs,aJ as ks,ed as js,dd as He,eX as vs,g4 as Vn,aN as bs,lY as qn,a as Ae,bz as ys,cV as Se,cW as $e,cX as Ie,cY as Re,cZ as Te,hS as Ns,hT as ye,lZ as ws,da as De,c_ as Ee,F as Fe,b7 as Cs,gH as Hn,l_ as Bn,hG as Me,ix as Wn,l$ as Gn,h4 as Qn,m0 as Yn,m1 as Jn,ir as Xn,m2 as Zn,dv as et,m3 as st}from"./index-BZKMWkth.js";import{r as nt,d as tt,u as Ps,P as Ss,T as at,a as rt,b as Je}from"./PreviewRefusedNotice-CLOum_3D.js";import{C as lt}from"./card-CTGm0Blo.js";import{M as it}from"./markdown-content-plNIomQc.js";import{U as ot}from"./use-unclaimed-chats-DKLFamqB.js";import{d as ct,f as dt,a as ut,b as mt,c as ht,U as $s,u as pt,e as ft}from"./UnlinkDialog-B70UThXm.js";import{a as Is}from"./use-dev-links-daERqZ4e.js";import{F as Rs}from"./file-B6neiwXF.js";import{F as xt}from"./file-exclamation-point-B-iziRzy.js";import{R as Ts}from"./rotate-ccw-clock-C-ftj_rU.js";/**
1
+ import{a4 as te,ae as B,aj as de,ak as P,af as ae,ag as ue,lG as ln,r as p,u as ke,lH as Ce,j as s,dY as on,dZ as cn,d_ as dn,d$ as un,e0 as mn,fo as hn,e3 as ee,iY as pn,I as fn,lI as We,lJ as be,lK as Ge,lL as us,lM as ms,e as W,A as xn,lq as gn,at as me,lN as kn,B as C,dc as jn,lO as Ke,lP as vn,lQ as bn,a3 as Qe,P as yn,Z as oe,cQ as S,cU as K,ee as Nn,lx as wn,lR as Cn,cT as Pn,cP as Sn,gB as $n,lS as In,lT as Ye,lU as J,lV as Rn,lW as ve,$ as hs,g$ as Ve,lX as Tn,b2 as Dn,ec as qe,gY as ps,aa as se,ei as En,C as Pe,dK as fs,gL as Ln,gM as An,gN as Un,gO as On,lY as xs,gP as Fn,bv as Mn,e6 as zn,e7 as _n,j4 as Kn,ii as gs,aJ as ks,ed as js,dd as He,eX as vs,g4 as Vn,aN as bs,lZ as qn,a as Ae,bz as ys,cV as Se,cW as $e,cX as Ie,cY as Re,cZ as Te,hS as Ns,hT as ye,l_ as ws,da as De,c_ as Ee,F as Fe,b7 as Cs,gH as Hn,l$ as Bn,hG as Me,ix as Wn,m0 as Gn,h4 as Qn,m1 as Yn,m2 as Jn,ir as Xn,m3 as Zn,dv as et,m4 as st}from"./index-Dr-0P6rd.js";import{r as nt,d as tt,u as Ps,P as Ss,T as at,a as rt,b as Je}from"./PreviewRefusedNotice-fTN8MJ1h.js";import{C as lt}from"./card-BTgwskmX.js";import{M as it}from"./markdown-content-aNzh-54y.js";import{U as ot}from"./use-unclaimed-chats-D4k-EK_f.js";import{d as ct,f as dt,a as ut,b as mt,c as ht,U as $s,u as pt,e as ft}from"./UnlinkDialog-BgwHAqdW.js";import{a as Is}from"./use-dev-links-BImQrE6g.js";import{F as Rs}from"./file-DlQX-hKl.js";import{F as xt}from"./file-exclamation-point-Dg2iCyPM.js";import{R as Ts}from"./rotate-ccw-clock-cx5RyP4l.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{ae as N,aj as T,ak as g,af as S,ag as $,r as b,j as e,dv as L,B as x,f as R,e as P,eW as I,dd as W,eX as B,cQ as v,eY as H,eZ as V,e_ as G,e$ as X,f0 as Y,e3 as D,I as F,f1 as Z}from"./index-BZKMWkth.js";import{u as _}from"./use-pending-read-CH_0XPYp.js";function J(){const s=N();return T({queryKey:g.sources(),queryFn:()=>s.listMarketplaceSources(),staleTime:6e4})}function U(){const s=N(),t=S();return $({mutationFn:n=>s.addMarketplaceSource(n),onSuccess:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function ee(){const s=N(),t=S();return $({mutationFn:n=>s.removeMarketplaceSource(n),onSuccess:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function se(){const s=N(),t=S();return $({mutationFn:n=>s.refreshMarketplaceSource(n),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function M(s){return s===1?"1 package is ready to install.":`${s} packages are ready to install.`}function k(s){return`${s.replace(/\.+$/,"")}.`}function C(s){return new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function q(s){return s.startsWith("file://")}function z(s){return q(s)?"Couldn’t read that folder":"Couldn’t reach it"}function ae(s){const t=s.lastFetch;return(t==null?void 0:t.state)==="failed"?{kind:"failed",message:`Its packages didn’t load: ${k(t.reason)}`}:(t==null?void 0:t.state)==="stale"?{kind:"stale",message:`${z(s.source)}: ${k(t.reason)} Still showing the last copy, from ${C(t.copyFetchedAt)}.`}:null}function te(s,t,n){return s?(t==null?void 0:t.kind)==="failed"?"Enabled, but its packages didn’t load":(t==null?void 0:t.kind)==="stale"?"Enabled, showing an older copy":n?"Enabled":"Enabled, not fetched yet":"Disabled"}function ne({name:s,source:t,enabled:n,addedAt:d,listing:u,fetched:i,onRefresh:h,isRefreshing:r,onRemove:p,isRemoving:f}){const c=C(d),j=n?u?"fill-current text-status-warning-dot":i?"fill-current text-status-success":"fill-none text-muted-foreground":"fill-current text-muted-foreground";return e.jsxs("div",{"data-slot":"source-card",className:"bg-card flex items-start justify-between gap-4 rounded-xl border p-5",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx(I,{className:`mt-0.5 size-3 shrink-0 ${j}`,"aria-label":te(n,u,i)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold",children:s}),e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:t}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Added ",c]}),u&&e.jsxs("p",{className:"text-status-warning-fg mt-2 text-xs",children:[u.message," ",e.jsx(x,{variant:"link",size:"sm",onClick:h,"aria-busy":r,"aria-label":`Try again for ${s}`,className:"text-status-warning-fg h-auto p-0 text-xs underline",children:"Try again"})]})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs(x,{variant:"ghost",size:"sm",onClick:h,"aria-busy":r,"aria-label":`Refresh ${s}`,children:[e.jsx(W,{className:`size-3.5 ${r?"animate-spin":""}`}),e.jsx("span",{className:"ml-1.5 hidden sm:inline",children:"Refresh"})]}),e.jsxs(x,{variant:"ghost",size:"sm",onClick:p,disabled:f,className:"text-destructive hover:text-destructive","aria-label":`Remove ${s}`,children:[e.jsx(B,{className:"size-3.5"}),e.jsx("span",{className:"ml-1.5 hidden sm:inline",children:"Remove"})]})]})]})}function re({open:s,onOpenChange:t,isPending:n,error:d,onSubmit:u}){const[i,h]=b.useState(""),[r,p]=b.useState(""),f=()=>{u(i.trim(),r.trim())},c=m=>{m||(h(""),p("")),t(m)},j=r.trim().length>0&&i.trim().length>0;return e.jsx(H,{open:s,onOpenChange:c,children:e.jsxs(V,{className:"sm:max-w-md",children:[e.jsxs(G,{children:[e.jsx(X,{children:"Add a marketplace source"}),e.jsx(Y,{children:"Paste a git repository link and give it a name."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{htmlFor:"source-url",children:"Repository link"}),e.jsx(F,{id:"source-url",value:r,onChange:m=>p(m.target.value),placeholder:"https://github.com/org/marketplace",autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{htmlFor:"source-name",children:"Name"}),e.jsx(F,{id:"source-name",value:i,onChange:m=>h(m.target.value),placeholder:"e.g. my-registry",autoComplete:"off"})]}),d&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:d})]}),e.jsxs(Z,{children:[e.jsx(x,{variant:"ghost",onClick:()=>c(!1),disabled:n,children:"Cancel"}),e.jsx(x,{onClick:f,disabled:!j||n,children:n?"Adding…":"Add source"})]})]})})}function oe(){var w;const{data:s,isLoading:t}=J(),n=_(t),d=U(),u=ee(),i=se(),[h,r]=b.useState(!1),[p,f]=b.useState({id:0,text:""}),c=a=>f(o=>({id:o.id+1,text:a})),j=(a,o)=>{d.mutate({name:a,source:o,enabled:!0},{onSuccess:l=>{if(r(!1),l.listing.fetched){const y=M(l.listing.packageCount);c(`${l.name}: ${y}`),v.success(`Added ${l.name}. ${y}`)}else c(`${l.name}: Added, but its packages didn’t load: ${k(l.listing.reason)}`),v.warning(`Added ${l.name}, but its packages didn’t load.`)}})},m=a=>i.isPending&&i.variables===a,E=a=>{m(a)||i.mutate(a,{onSuccess:o=>{var y;if(o.stale){const A=((y=s==null?void 0:s.find(O=>O.name===a))==null?void 0:y.source)??"";c(`${a}: ${z(A)}: ${k(o.reason??"no reason given")} Still showing the last copy, from ${C(o.fetchedAt)}.`),v.warning(`${q(A)?"Couldn’t read":"Couldn’t reach"} ${a}. Still showing the last copy.`);return}const l=M(o.marketplace.plugins.length);c(`${a}: ${l}`),v.success(`Refreshed ${a}. ${l}`)},onError:o=>{c(`${a}: Its packages didn’t load: ${k(o.message)}`),v.warning(`Couldn’t refresh ${a}.`)}})},Q=a=>{a||d.reset(),r(a)},K=!n&&(!s||s.length===0);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[e.jsxs("div",{children:[e.jsx(L,{children:"Marketplace sources"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Git registries that publish marketplace packages."})]}),e.jsxs(x,{onClick:()=>r(!0),size:"sm",children:[e.jsx(R,{className:"mr-1.5 size-4"}),"Add marketplace source"]})]}),n&&e.jsx("div",{className:"space-y-3",children:[1,2].map(a=>e.jsx(P,{className:"h-20 rounded-xl border"},a))}),K&&e.jsxs("div",{className:"rounded-xl border border-dashed p-10 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No marketplaces added yet"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Add a source to browse its packages."}),e.jsxs(x,{className:"mt-4",size:"sm",onClick:()=>r(!0),children:[e.jsx(R,{className:"mr-1.5 size-4"}),"Add marketplace source"]})]}),s&&s.length>0&&e.jsx("div",{className:"space-y-3",children:s.map(a=>e.jsx(ne,{name:a.name,source:a.source,enabled:a.enabled,addedAt:a.addedAt,listing:ae(a),fetched:a.lastFetch===void 0||a.lastFetch.state!=="never",onRefresh:()=>E(a.name),isRefreshing:m(a.name),onRemove:()=>u.mutate(a.name),isRemoving:u.isPending},a.name))}),e.jsx("div",{"data-slot":"listing-announcer",role:"status","aria-live":"polite",className:"sr-only",children:e.jsx("span",{children:p.text},p.id)}),e.jsx(re,{open:h,onOpenChange:Q,isPending:d.isPending,error:((w=d.error)==null?void 0:w.message)??null,onSubmit:j})]})}export{oe as M};
1
+ import{ae as N,aj as T,ak as g,af as S,ag as $,r as b,j as e,dv as L,B as x,f as R,e as P,eW as I,dd as W,eX as B,cQ as v,eY as H,eZ as V,e_ as G,e$ as X,f0 as Y,e3 as D,I as F,f1 as Z}from"./index-Dr-0P6rd.js";import{u as _}from"./use-pending-read-DmrlNHS0.js";function J(){const s=N();return T({queryKey:g.sources(),queryFn:()=>s.listMarketplaceSources(),staleTime:6e4})}function U(){const s=N(),t=S();return $({mutationFn:n=>s.addMarketplaceSource(n),onSuccess:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function ee(){const s=N(),t=S();return $({mutationFn:n=>s.removeMarketplaceSource(n),onSuccess:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function se(){const s=N(),t=S();return $({mutationFn:n=>s.refreshMarketplaceSource(n),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:g.sources()}),t.invalidateQueries({queryKey:g.packages()})}})}function M(s){return s===1?"1 package is ready to install.":`${s} packages are ready to install.`}function k(s){return`${s.replace(/\.+$/,"")}.`}function C(s){return new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function q(s){return s.startsWith("file://")}function z(s){return q(s)?"Couldn’t read that folder":"Couldn’t reach it"}function ae(s){const t=s.lastFetch;return(t==null?void 0:t.state)==="failed"?{kind:"failed",message:`Its packages didn’t load: ${k(t.reason)}`}:(t==null?void 0:t.state)==="stale"?{kind:"stale",message:`${z(s.source)}: ${k(t.reason)} Still showing the last copy, from ${C(t.copyFetchedAt)}.`}:null}function te(s,t,n){return s?(t==null?void 0:t.kind)==="failed"?"Enabled, but its packages didn’t load":(t==null?void 0:t.kind)==="stale"?"Enabled, showing an older copy":n?"Enabled":"Enabled, not fetched yet":"Disabled"}function ne({name:s,source:t,enabled:n,addedAt:d,listing:u,fetched:i,onRefresh:h,isRefreshing:r,onRemove:p,isRemoving:f}){const c=C(d),j=n?u?"fill-current text-status-warning-dot":i?"fill-current text-status-success":"fill-none text-muted-foreground":"fill-current text-muted-foreground";return e.jsxs("div",{"data-slot":"source-card",className:"bg-card flex items-start justify-between gap-4 rounded-xl border p-5",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx(I,{className:`mt-0.5 size-3 shrink-0 ${j}`,"aria-label":te(n,u,i)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold",children:s}),e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:t}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Added ",c]}),u&&e.jsxs("p",{className:"text-status-warning-fg mt-2 text-xs",children:[u.message," ",e.jsx(x,{variant:"link",size:"sm",onClick:h,"aria-busy":r,"aria-label":`Try again for ${s}`,className:"text-status-warning-fg h-auto p-0 text-xs underline",children:"Try again"})]})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs(x,{variant:"ghost",size:"sm",onClick:h,"aria-busy":r,"aria-label":`Refresh ${s}`,children:[e.jsx(W,{className:`size-3.5 ${r?"animate-spin":""}`}),e.jsx("span",{className:"ml-1.5 hidden sm:inline",children:"Refresh"})]}),e.jsxs(x,{variant:"ghost",size:"sm",onClick:p,disabled:f,className:"text-destructive hover:text-destructive","aria-label":`Remove ${s}`,children:[e.jsx(B,{className:"size-3.5"}),e.jsx("span",{className:"ml-1.5 hidden sm:inline",children:"Remove"})]})]})]})}function re({open:s,onOpenChange:t,isPending:n,error:d,onSubmit:u}){const[i,h]=b.useState(""),[r,p]=b.useState(""),f=()=>{u(i.trim(),r.trim())},c=m=>{m||(h(""),p("")),t(m)},j=r.trim().length>0&&i.trim().length>0;return e.jsx(H,{open:s,onOpenChange:c,children:e.jsxs(V,{className:"sm:max-w-md",children:[e.jsxs(G,{children:[e.jsx(X,{children:"Add a marketplace source"}),e.jsx(Y,{children:"Paste a git repository link and give it a name."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{htmlFor:"source-url",children:"Repository link"}),e.jsx(F,{id:"source-url",value:r,onChange:m=>p(m.target.value),placeholder:"https://github.com/org/marketplace",autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(D,{htmlFor:"source-name",children:"Name"}),e.jsx(F,{id:"source-name",value:i,onChange:m=>h(m.target.value),placeholder:"e.g. my-registry",autoComplete:"off"})]}),d&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:d})]}),e.jsxs(Z,{children:[e.jsx(x,{variant:"ghost",onClick:()=>c(!1),disabled:n,children:"Cancel"}),e.jsx(x,{onClick:f,disabled:!j||n,children:n?"Adding…":"Add source"})]})]})})}function oe(){var w;const{data:s,isLoading:t}=J(),n=_(t),d=U(),u=ee(),i=se(),[h,r]=b.useState(!1),[p,f]=b.useState({id:0,text:""}),c=a=>f(o=>({id:o.id+1,text:a})),j=(a,o)=>{d.mutate({name:a,source:o,enabled:!0},{onSuccess:l=>{if(r(!1),l.listing.fetched){const y=M(l.listing.packageCount);c(`${l.name}: ${y}`),v.success(`Added ${l.name}. ${y}`)}else c(`${l.name}: Added, but its packages didn’t load: ${k(l.listing.reason)}`),v.warning(`Added ${l.name}, but its packages didn’t load.`)}})},m=a=>i.isPending&&i.variables===a,E=a=>{m(a)||i.mutate(a,{onSuccess:o=>{var y;if(o.stale){const A=((y=s==null?void 0:s.find(O=>O.name===a))==null?void 0:y.source)??"";c(`${a}: ${z(A)}: ${k(o.reason??"no reason given")} Still showing the last copy, from ${C(o.fetchedAt)}.`),v.warning(`${q(A)?"Couldn’t read":"Couldn’t reach"} ${a}. Still showing the last copy.`);return}const l=M(o.marketplace.plugins.length);c(`${a}: ${l}`),v.success(`Refreshed ${a}. ${l}`)},onError:o=>{c(`${a}: Its packages didn’t load: ${k(o.message)}`),v.warning(`Couldn’t refresh ${a}.`)}})},Q=a=>{a||d.reset(),r(a)},K=!n&&(!s||s.length===0);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[e.jsxs("div",{children:[e.jsx(L,{children:"Marketplace sources"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Git registries that publish marketplace packages."})]}),e.jsxs(x,{onClick:()=>r(!0),size:"sm",children:[e.jsx(R,{className:"mr-1.5 size-4"}),"Add marketplace source"]})]}),n&&e.jsx("div",{className:"space-y-3",children:[1,2].map(a=>e.jsx(P,{className:"h-20 rounded-xl border"},a))}),K&&e.jsxs("div",{className:"rounded-xl border border-dashed p-10 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No marketplaces added yet"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Add a source to browse its packages."}),e.jsxs(x,{className:"mt-4",size:"sm",onClick:()=>r(!0),children:[e.jsx(R,{className:"mr-1.5 size-4"}),"Add marketplace source"]})]}),s&&s.length>0&&e.jsx("div",{className:"space-y-3",children:s.map(a=>e.jsx(ne,{name:a.name,source:a.source,enabled:a.enabled,addedAt:a.addedAt,listing:ae(a),fetched:a.lastFetch===void 0||a.lastFetch.state!=="never",onRefresh:()=>E(a.name),isRefreshing:m(a.name),onRemove:()=>u.mutate(a.name),isRemoving:u.isPending},a.name))}),e.jsx("div",{"data-slot":"listing-announcer",role:"status","aria-live":"polite",className:"sr-only",children:e.jsx("span",{children:p.text},p.id)}),e.jsx(re,{open:h,onOpenChange:Q,isPending:d.isPending,error:((w=d.error)==null?void 0:w.message)??null,onSubmit:j})]})}export{oe as M};
@@ -1,4 +1,4 @@
1
- import{a4 as S,ae as j,aj as T,r as h,j as u,Z as w,cP as P,fm as C,fn as $}from"./index-BZKMWkth.js";/**
1
+ import{a4 as S,ae as j,aj as T,r as h,j as u,Z as w,cP as P,fm as C,fn as $}from"./index-Dr-0P6rd.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{ae as q,af as B,r as l,e2 as K,ag as T,aj as Q,j as s,e3 as U,I as W,e4 as Y,B as b,F as z,Z as S,e5 as H,e6 as V,e7 as X,b7 as Z}from"./index-BZKMWkth.js";const P={SIGNIN_NO_APP_REGISTRATION:"This server doesn’t let DorkOS register itself. Add your own app credentials to try again.",SIGNIN_NO_SIGNIN_SUPPORT:"This server doesn’t offer sign-in the way DorkOS expects.",SIGNIN_UNREACHABLE:"Couldn’t reach the server to start the sign-in."};function J(e){return e!==void 0&&e in P}function k(e){const{message:t,code:i,detail:c}=e;return J(i)?{message:P[i],detail:c??t??null,canUseOwnCredentials:i==="SIGNIN_NO_APP_REGISTRATION"}:{message:t??"Sign-in didn’t finish. Try again.",detail:c??null,canUseOwnCredentials:!1}}function ee(e){if(typeof e!="object"||e===null)return{};const{code:t,body:i}=e,c=typeof i=="object"&&i!==null?i.detail:void 0;return{...typeof t=="string"?{code:t}:{},...typeof c=="string"?{detail:c}:{}}}const _=2e3,F=5,se="Couldn’t check the sign-in. Retrying.",te="Couldn’t check if the sign-in finished. Try again in a moment.",j={phase:"idle",disclosure:null,authorizeUrl:null,startFailure:null,credentialsError:null,flowId:null,watching:!1};function ne(e){const t=e==null?void 0:e.toolCount;return typeof t!="number"||!Number.isFinite(t)||t<0?null:t}function re(e,t){return(e==null?void 0:e.status)==="failed"?e.error??"Sign-in didn’t finish. Try again.":t>=F?te:null}function ie(e){return{...j,phase:"failed",startFailure:k({message:e.message,...ee(e)})}}function le(e){return e===null?null:k({message:e})}function O(e){return e.flowId===null?!1:e.phase==="waiting"||e.phase==="disclosure"&&e.watching}function ae(e,t,i){return O(e)?(t==null?void 0:t.status)==="connected"?"connected":(t==null?void 0:t.status)==="failed"?"failed":e.phase!=="waiting"?e.phase:i>=F?"failed":"waiting":e.phase}function he(e,t){const i=q(),c=B(),[o,r]=l.useState(j),h=l.useRef(0),[x,C]=l.useState(0),g=l.useRef(null),d=l.useCallback(n=>{g.current=n,h.current=0,C(0)},[]),p=l.useCallback((n,u)=>{u===g.current&&(h.current=n==="ok"?0:h.current+1,C(h.current))},[]),f=l.useCallback(()=>{c.invalidateQueries({queryKey:K.mcpServers(e)}),c.invalidateQueries({queryKey:["mcp-config"]})},[c,e]),a=T({mutationFn:()=>i.startMcpSignin(e,t),meta:{suppressErrorToast:!0}}),v=l.useCallback(()=>{d(null),r({...j,phase:"starting"}),a.mutate(void 0,{onSuccess:n=>{if(!n.alreadyConnected&&!n.authorizeUrl){r({...j,phase:"failed",startFailure:k({message:"Couldn’t make a sign-in link for this server."})});return}d(n.flowId),r({phase:n.alreadyConnected?"connected":"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl??null,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!1})},onError:n=>r(ie(n))})},[a,d]),I=T({mutationFn:n=>i.setMcpClientCredentials(e,t,n),meta:{suppressErrorToast:!0}}),A=l.useCallback(n=>{r(u=>u.credentialsError===null?u:{...u,credentialsError:null}),I.mutate(n,{onSuccess:()=>{f(),v()},onError:u=>r(N=>({...N,credentialsError:u.message}))})},[I,f,v]),M=l.useCallback(n=>{g.current!==n.flowId&&(f(),d(n.flowId),r({phase:"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!0}))},[d]),D=l.useCallback(()=>{r(n=>n.phase==="disclosure"?{...n,phase:"waiting"}:n)},[]),G=l.useCallback(()=>{d(null),r(j)},[d]),E=Q({queryKey:["mcp-signin",e,t,o.flowId??""],queryFn:async()=>{const n=o.flowId??"";try{const u=await i.pollMcpSignin(n);return p("ok",n),u}catch(u){throw p("failed",n),u}},enabled:O(o),refetchInterval:n=>{var R;const u=(R=n.state.data)==null?void 0:R.status;if(u==="connected"||u==="failed")return!1;const N=h.current;return N===0?_:N>=F?!1:_*(N+1)},retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,gcTime:0,staleTime:0,meta:{suppressErrorToast:!0}}),w=x,y=ae(o,E.data,w);l.useEffect(()=>{y==="connected"&&f()},[y,f]);const m=O(o)?le(re(E.data,w)):o.startFailure,$=y==="waiting"&&w>0?se:null;return{state:{step:y,disclosure:o.disclosure,authorizeUrl:o.authorizeUrl,error:(m==null?void 0:m.message)??null,errorDetail:(m==null?void 0:m.detail)??null,canUseOwnCredentials:(m==null?void 0:m.canUseOwnCredentials)??!1,savingCredentials:I.isPending,credentialsError:o.credentialsError,retryNotice:$,toolCount:y==="connected"?ne(E.data):null},start:v,adopt:M,authOpened:D,useOwnCredentials:A,reset:G}}function ce({onSave:e,onCancel:t,saving:i=!1,error:c=null,className:o}){const r=l.useId(),h=l.useRef(null),[x,C]=l.useState(""),[g,d]=l.useState(""),p=x.trim(),f=g.trim();return l.useEffect(()=>{var a;(a=h.current)==null||a.focus()},[]),s.jsxs("form",{className:S("space-y-2",o),onSubmit:a=>{a.preventDefault(),!(!p||i)&&e({clientId:p,...f?{clientSecret:f}:{}})},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(U,{htmlFor:`${r}-client-id`,className:"text-xs",children:"Client ID"}),s.jsx(W,{id:`${r}-client-id`,ref:h,value:x,onChange:a=>C(a.target.value),autoComplete:"off",spellCheck:!1,disabled:i,className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(U,{htmlFor:`${r}-client-secret`,className:"text-xs",children:["Client secret ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(if you got one)"})]}),s.jsx(Y,{id:`${r}-client-secret`,value:g,onChange:a=>d(a.target.value),autoComplete:"off",disabled:i,className:"h-8 text-xs"})]}),s.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"From the service’s developer settings. Kept encrypted here; agents never see it."}),c&&s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:c}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(b,{type:"submit",size:"sm",disabled:!p||i,className:"gap-1.5 focus-visible:ring-2",children:[i&&s.jsx(z,{size:"xs"}),"Save and sign in"]}),s.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:i,className:"focus-visible:ring-2",children:"Cancel"})]})]})}function L({children:e}){return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[s.jsx(z,{size:"xs"}),e]})}function oe(e){return e===null?"Signed in. Its tools are available on the next turn.":`Connected · ${e} tool${e===1?"":"s"}.`}function ue(e){return`DorkOS keeps the key from ${e} here, never your agent. Removing the server deletes it.`}function de(e){const{state:t}=e;return t.step==="starting"?s.jsx(L,{children:"Starting sign-in…"}):t.step==="waiting"?s.jsxs("div",{className:"space-y-1",children:[s.jsx(L,{children:"Waiting for you to sign in… Close the tab when done."}),t.retryNotice&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t.retryNotice})]}):t.step==="connected"?s.jsxs("p",{className:"text-status-success-fg flex items-center gap-2 text-xs",children:[s.jsx(Z,{className:"size-3.5","aria-hidden":!0}),oe(t.toolCount)]}):null}function pe({flow:e,serverName:t,className:i,failedActions:c,connectedActions:o}){const{state:r}=e,h=l.useRef(null),x=r.step==="disclosure",C=l.useRef(null),[g,d]=l.useState(!1),p=g&&r.canUseOwnCredentials;l.useEffect(()=>{var a;x&&((a=h.current)==null||a.focus())},[x]);const f=l.useRef(!1);return l.useEffect(()=>{var a;!f.current||p||(f.current=!1,(a=C.current)==null||a.focus())},[p]),s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"status",className:S("[&:not(:empty)]:mt-1",i),children:de(e)}),x&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsxs("div",{ref:h,tabIndex:-1,className:"border-status-success-border bg-status-success-bg text-status-success-fg flex items-start gap-2 rounded-md border px-3 py-2 focus-visible:ring-2",children:[s.jsx(H,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Your sign-in stays on this computer."}),s.jsx("p",{className:"text-xs leading-relaxed",children:r.disclosure??ue(t)})]})]}),r.authorizeUrl&&s.jsx(b,{asChild:!0,size:"sm",className:"gap-1.5 focus-visible:ring-2",children:s.jsxs(V,{href:r.authorizeUrl,onOpened:()=>e.authOpened(),"aria-label":`Open the sign-in page for ${t}`,children:["Open the sign-in page",s.jsx(X,{className:"size-3.5","aria-hidden":!0})]})})]}),r.step==="failed"&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:r.error??"Sign-in didn’t finish. Try again."}),r.errorDetail&&s.jsxs("details",{className:"text-muted-foreground text-xs",children:[s.jsx("summary",{className:"cursor-pointer focus-visible:ring-2",children:"Details"}),s.jsx("code",{className:"text-2xs mt-1 block font-mono break-all",children:r.errorDetail})]}),p?s.jsx(ce,{onSave:a=>e.useOwnCredentials(a),onCancel:()=>{d(!1),f.current=!0},saving:r.savingCredentials,error:r.credentialsError}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[c,r.canUseOwnCredentials&&s.jsx(b,{ref:C,variant:"secondary",size:"sm",onClick:()=>d(!0),className:"focus-visible:ring-2",children:"Use your own app credentials"})]})]}),r.step==="connected"&&o&&s.jsx("div",{className:S("mt-1",i),children:o})]})}export{pe as M,he as u};
1
+ import{ae as q,af as B,r as l,e2 as K,ag as T,aj as Q,j as s,e3 as U,I as W,e4 as Y,B as b,F as z,Z as S,e5 as H,e6 as V,e7 as X,b7 as Z}from"./index-Dr-0P6rd.js";const P={SIGNIN_NO_APP_REGISTRATION:"This server doesn’t let DorkOS register itself. Add your own app credentials to try again.",SIGNIN_NO_SIGNIN_SUPPORT:"This server doesn’t offer sign-in the way DorkOS expects.",SIGNIN_UNREACHABLE:"Couldn’t reach the server to start the sign-in."};function J(e){return e!==void 0&&e in P}function k(e){const{message:t,code:i,detail:c}=e;return J(i)?{message:P[i],detail:c??t??null,canUseOwnCredentials:i==="SIGNIN_NO_APP_REGISTRATION"}:{message:t??"Sign-in didn’t finish. Try again.",detail:c??null,canUseOwnCredentials:!1}}function ee(e){if(typeof e!="object"||e===null)return{};const{code:t,body:i}=e,c=typeof i=="object"&&i!==null?i.detail:void 0;return{...typeof t=="string"?{code:t}:{},...typeof c=="string"?{detail:c}:{}}}const _=2e3,F=5,se="Couldn’t check the sign-in. Retrying.",te="Couldn’t check if the sign-in finished. Try again in a moment.",j={phase:"idle",disclosure:null,authorizeUrl:null,startFailure:null,credentialsError:null,flowId:null,watching:!1};function ne(e){const t=e==null?void 0:e.toolCount;return typeof t!="number"||!Number.isFinite(t)||t<0?null:t}function re(e,t){return(e==null?void 0:e.status)==="failed"?e.error??"Sign-in didn’t finish. Try again.":t>=F?te:null}function ie(e){return{...j,phase:"failed",startFailure:k({message:e.message,...ee(e)})}}function le(e){return e===null?null:k({message:e})}function O(e){return e.flowId===null?!1:e.phase==="waiting"||e.phase==="disclosure"&&e.watching}function ae(e,t,i){return O(e)?(t==null?void 0:t.status)==="connected"?"connected":(t==null?void 0:t.status)==="failed"?"failed":e.phase!=="waiting"?e.phase:i>=F?"failed":"waiting":e.phase}function he(e,t){const i=q(),c=B(),[o,r]=l.useState(j),h=l.useRef(0),[x,C]=l.useState(0),g=l.useRef(null),d=l.useCallback(n=>{g.current=n,h.current=0,C(0)},[]),p=l.useCallback((n,u)=>{u===g.current&&(h.current=n==="ok"?0:h.current+1,C(h.current))},[]),f=l.useCallback(()=>{c.invalidateQueries({queryKey:K.mcpServers(e)}),c.invalidateQueries({queryKey:["mcp-config"]})},[c,e]),a=T({mutationFn:()=>i.startMcpSignin(e,t),meta:{suppressErrorToast:!0}}),v=l.useCallback(()=>{d(null),r({...j,phase:"starting"}),a.mutate(void 0,{onSuccess:n=>{if(!n.alreadyConnected&&!n.authorizeUrl){r({...j,phase:"failed",startFailure:k({message:"Couldn’t make a sign-in link for this server."})});return}d(n.flowId),r({phase:n.alreadyConnected?"connected":"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl??null,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!1})},onError:n=>r(ie(n))})},[a,d]),I=T({mutationFn:n=>i.setMcpClientCredentials(e,t,n),meta:{suppressErrorToast:!0}}),A=l.useCallback(n=>{r(u=>u.credentialsError===null?u:{...u,credentialsError:null}),I.mutate(n,{onSuccess:()=>{f(),v()},onError:u=>r(N=>({...N,credentialsError:u.message}))})},[I,f,v]),M=l.useCallback(n=>{g.current!==n.flowId&&(f(),d(n.flowId),r({phase:"disclosure",disclosure:n.disclosure,authorizeUrl:n.authorizeUrl,startFailure:null,credentialsError:null,flowId:n.flowId,watching:!0}))},[d]),D=l.useCallback(()=>{r(n=>n.phase==="disclosure"?{...n,phase:"waiting"}:n)},[]),G=l.useCallback(()=>{d(null),r(j)},[d]),E=Q({queryKey:["mcp-signin",e,t,o.flowId??""],queryFn:async()=>{const n=o.flowId??"";try{const u=await i.pollMcpSignin(n);return p("ok",n),u}catch(u){throw p("failed",n),u}},enabled:O(o),refetchInterval:n=>{var R;const u=(R=n.state.data)==null?void 0:R.status;if(u==="connected"||u==="failed")return!1;const N=h.current;return N===0?_:N>=F?!1:_*(N+1)},retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,gcTime:0,staleTime:0,meta:{suppressErrorToast:!0}}),w=x,y=ae(o,E.data,w);l.useEffect(()=>{y==="connected"&&f()},[y,f]);const m=O(o)?le(re(E.data,w)):o.startFailure,$=y==="waiting"&&w>0?se:null;return{state:{step:y,disclosure:o.disclosure,authorizeUrl:o.authorizeUrl,error:(m==null?void 0:m.message)??null,errorDetail:(m==null?void 0:m.detail)??null,canUseOwnCredentials:(m==null?void 0:m.canUseOwnCredentials)??!1,savingCredentials:I.isPending,credentialsError:o.credentialsError,retryNotice:$,toolCount:y==="connected"?ne(E.data):null},start:v,adopt:M,authOpened:D,useOwnCredentials:A,reset:G}}function ce({onSave:e,onCancel:t,saving:i=!1,error:c=null,className:o}){const r=l.useId(),h=l.useRef(null),[x,C]=l.useState(""),[g,d]=l.useState(""),p=x.trim(),f=g.trim();return l.useEffect(()=>{var a;(a=h.current)==null||a.focus()},[]),s.jsxs("form",{className:S("space-y-2",o),onSubmit:a=>{a.preventDefault(),!(!p||i)&&e({clientId:p,...f?{clientSecret:f}:{}})},children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(U,{htmlFor:`${r}-client-id`,className:"text-xs",children:"Client ID"}),s.jsx(W,{id:`${r}-client-id`,ref:h,value:x,onChange:a=>C(a.target.value),autoComplete:"off",spellCheck:!1,disabled:i,className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(U,{htmlFor:`${r}-client-secret`,className:"text-xs",children:["Client secret ",s.jsx("span",{className:"text-muted-foreground font-normal",children:"(if you got one)"})]}),s.jsx(Y,{id:`${r}-client-secret`,value:g,onChange:a=>d(a.target.value),autoComplete:"off",disabled:i,className:"h-8 text-xs"})]}),s.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"From the service’s developer settings. Kept encrypted here; agents never see it."}),c&&s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:c}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(b,{type:"submit",size:"sm",disabled:!p||i,className:"gap-1.5 focus-visible:ring-2",children:[i&&s.jsx(z,{size:"xs"}),"Save and sign in"]}),s.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:i,className:"focus-visible:ring-2",children:"Cancel"})]})]})}function L({children:e}){return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[s.jsx(z,{size:"xs"}),e]})}function oe(e){return e===null?"Signed in. Its tools are available on the next turn.":`Connected · ${e} tool${e===1?"":"s"}.`}function ue(e){return`DorkOS keeps the key from ${e} here, never your agent. Removing the server deletes it.`}function de(e){const{state:t}=e;return t.step==="starting"?s.jsx(L,{children:"Starting sign-in…"}):t.step==="waiting"?s.jsxs("div",{className:"space-y-1",children:[s.jsx(L,{children:"Waiting for you to sign in… Close the tab when done."}),t.retryNotice&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t.retryNotice})]}):t.step==="connected"?s.jsxs("p",{className:"text-status-success-fg flex items-center gap-2 text-xs",children:[s.jsx(Z,{className:"size-3.5","aria-hidden":!0}),oe(t.toolCount)]}):null}function pe({flow:e,serverName:t,className:i,failedActions:c,connectedActions:o}){const{state:r}=e,h=l.useRef(null),x=r.step==="disclosure",C=l.useRef(null),[g,d]=l.useState(!1),p=g&&r.canUseOwnCredentials;l.useEffect(()=>{var a;x&&((a=h.current)==null||a.focus())},[x]);const f=l.useRef(!1);return l.useEffect(()=>{var a;!f.current||p||(f.current=!1,(a=C.current)==null||a.focus())},[p]),s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"status",className:S("[&:not(:empty)]:mt-1",i),children:de(e)}),x&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsxs("div",{ref:h,tabIndex:-1,className:"border-status-success-border bg-status-success-bg text-status-success-fg flex items-start gap-2 rounded-md border px-3 py-2 focus-visible:ring-2",children:[s.jsx(H,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Your sign-in stays on this computer."}),s.jsx("p",{className:"text-xs leading-relaxed",children:r.disclosure??ue(t)})]})]}),r.authorizeUrl&&s.jsx(b,{asChild:!0,size:"sm",className:"gap-1.5 focus-visible:ring-2",children:s.jsxs(V,{href:r.authorizeUrl,onOpened:()=>e.authOpened(),"aria-label":`Open the sign-in page for ${t}`,children:["Open the sign-in page",s.jsx(X,{className:"size-3.5","aria-hidden":!0})]})})]}),r.step==="failed"&&s.jsxs("div",{className:S("mt-1 space-y-2",i),children:[s.jsx("p",{role:"alert",className:"text-destructive text-xs leading-relaxed",children:r.error??"Sign-in didn’t finish. Try again."}),r.errorDetail&&s.jsxs("details",{className:"text-muted-foreground text-xs",children:[s.jsx("summary",{className:"cursor-pointer focus-visible:ring-2",children:"Details"}),s.jsx("code",{className:"text-2xs mt-1 block font-mono break-all",children:r.errorDetail})]}),p?s.jsx(ce,{onSave:a=>e.useOwnCredentials(a),onCancel:()=>{d(!1),f.current=!0},saving:r.savingCredentials,error:r.credentialsError}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[c,r.canUseOwnCredentials&&s.jsx(b,{ref:C,variant:"secondary",size:"sm",onClick:()=>d(!0),className:"focus-visible:ring-2",children:"Use your own app credentials"})]})]}),r.step==="connected"&&o&&s.jsx("div",{className:S("mt-1",i),children:o})]})}export{pe as M,he as u};
@@ -1,4 +1,4 @@
1
- var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-BZKMWkth.js";/**
1
+ var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-Dr-0P6rd.js";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -0,0 +1 @@
1
+ import{j as o,o as r}from"./index-Dr-0P6rd.js";function a({member:e}){return o.jsx(r,{member:e})}export{a as NamePage};
@@ -1 +1 @@
1
- import{ae as R,af as b,ag as j,eJ as x,cQ as P,eK as C,r as d,j as e,cV as E,cW as M,cX as k,cY as T,cZ as K,da as L,e3 as F,I,az as N,B as D,dE as O,dF as Q,eL as B,f as H,dG as Y,dH as _,eM as q}from"./index-BZKMWkth.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function S(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function z({isInlineErrorVisible:t}){const n=R(),r=b();return j({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{S(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function $(){const t=R(),n=b();return j({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function J({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=z({isInlineErrorVisible:()=>u.current}),g=S(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},A=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(I,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:A,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const G="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function W(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function U({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),q.getState().open()};return e.jsxs(O,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(Q,{asChild:!0,children:e.jsx(B,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(H,{})})}),e.jsxs(Y,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(_,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:W,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:G})]})]})}export{J as C,U as N,G as O,V as a,W as o,$ as u};
1
+ import{ae as R,af as b,ag as j,eJ as x,cQ as P,eK as C,r as d,j as e,cV as E,cW as M,cX as k,cY as T,cZ as K,da as L,e3 as F,I,az as N,B as D,dE as O,dF as Q,eL as B,f as H,dG as Y,dH as _,eM as q}from"./index-Dr-0P6rd.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function S(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function z({isInlineErrorVisible:t}){const n=R(),r=b();return j({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{S(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function $(){const t=R(),n=b();return j({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function J({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=z({isInlineErrorVisible:()=>u.current}),g=S(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},A=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(T,{children:"New channel"}),e.jsx(K,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(I,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:A,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const G="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function W(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function U({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),q.getState().open()};return e.jsxs(O,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(Q,{asChild:!0,children:e.jsx(B,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(H,{})})}),e.jsxs(Y,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(_,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:W,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:G})]})]})}export{J as C,U as N,G as O,V as a,W as o,$ as u};
@@ -1 +1 @@
1
- import{j as t,z as s}from"./index-BZKMWkth.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
1
+ import{j as t,z as s}from"./index-Dr-0P6rd.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
@@ -1,4 +1,4 @@
1
- import{eN as A,r as f,eO as K,eP as R,ae as p,aj as T,af as m,ag as v,eQ as M,j as d,eR as w,dw as _,Z as j}from"./index-BZKMWkth.js";import{u as S}from"./use-mesh-topology-DXFAk9hJ.js";const O={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=O.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>O.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=R((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function B(e,t=[],s=q){const n=e.join(`
1
+ import{eN as A,r as f,eO as K,eP as R,ae as p,aj as T,af as m,ag as v,eQ as M,j as d,eR as w,dw as _,Z as j}from"./index-Dr-0P6rd.js";import{u as S}from"./use-mesh-topology-DBeqzUoy.js";const O={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=O.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>O.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=R((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function B(e,t=[],s=q){const n=e.join(`
2
2
  `),a=t.join(`
3
3
  `),i=A(f.useCallback(u=>u.statusCwds,[])),o=A(f.useCallback(u=>u.statuses,[])),{data:r}=K(),c=r==null?void 0:r.agentActivity;return f.useMemo(()=>{const u=n.length===0?[]:n.split(`
4
4
  `),N=new Set(a.length===0?[]:a.split(`
@@ -1 +1 @@
1
- import{fa as j,fb as H,fc as F,aN as x,r as p,bN as P,fd as w,fe as B,ae as D,aj as G,bC as K,bx as M,ff as Y,V as q,U as z,fg as W,fh as U,fi as N,fj as V,fk as Q,bS as J,j as i,e3 as A,I as R,fl as L,B as I}from"./index-BZKMWkth.js";function X(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function se(e){const r=X(e);return r.name||r.handle}function Z(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...H,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return F(a,o)??""}function re(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);p.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const $="agent-hub",ee={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function te(e){return(typeof e=="string"?ee[e]:null)??void 0}const k=new Set(["identity","personality","channels","tools"]);function oe(){var n;const e=w(),r=D(),a=G({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=K(g=>g.openProfileDockedFromLink),t=x(g=>g.requestRightPanel),s=x(g=>g.setExplicitAgentPath),d=M(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=Y(e.profilePage)??void 0,h=p.useRef(null);p.useEffect(()=>{!l&&c&&h.current!==c&&(h.current=c,s(c))},[l,c,s]);const f=p.useRef(new Map);p.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const g=c??d;if(g){const m=f.current.get(g);if(m!==void 0&&(u===void 0||m.has(u)))return;f.current.set(g,(m??new Set).add(u??"")),o(g,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function le(){const e=w(),r=B(),a=D(),o=e.panel===$,t=e.dialog==="agent"||!!e.agent&&k.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;p.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const h=te(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&k.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,h?n.profilePage=h:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function ae(){var S,b;const r=((S=q().data)==null?void 0:S.members)??[],a=r.find(y=>y.isSelf),o=z(),t=W({isShownInline:()=>o.current}),s=U({isShownInline:()=>o.current}),[d,l]=p.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[h,f]=N(c),[n,g]=N(a?u||Z(a,r):""),m=h.trim(),v=n.trim(),E=a?V(a):null,C=m.length>0&&(m!==c||E!==null),T=t.isError&&t.variables===m?Q(t.error):null,O=s.isError&&((b=s.variables)==null?void 0:b.handle)===v?J(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return C&&(y=await t.mutateAsync(m).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:h,setName:f,handle:n,setHandle:g,canSave:a!==void 0&&!d&&(m.length>0||v.length>0),saving:d,nameError:T,nameSuggestion:E!==null&&m===c?E:null,handleError:O,save:_}}function ie({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=ae(),s=p.useId(),d=p.useId(),l=p.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let h=r;return t.saving?h="Saving…":u&&(h="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(A,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(R,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(L,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(A,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(R,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(L,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(I,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:h}),a&&i.jsx(I,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{ie as O,oe as a,re as b,se as i,le as u};
1
+ import{fa as j,fb as H,fc as F,aN as x,r as p,bN as P,fd as w,fe as B,ae as D,aj as G,bC as K,bx as M,ff as Y,V as q,U as z,fg as W,fh as U,fi as N,fj as V,fk as Q,bS as J,j as i,e3 as A,I as R,fl as L,B as I}from"./index-Dr-0P6rd.js";function X(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function se(e){const r=X(e);return r.name||r.handle}function Z(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...H,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return F(a,o)??""}function re(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);p.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const $="agent-hub",ee={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function te(e){return(typeof e=="string"?ee[e]:null)??void 0}const k=new Set(["identity","personality","channels","tools"]);function oe(){var n;const e=w(),r=D(),a=G({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=K(g=>g.openProfileDockedFromLink),t=x(g=>g.requestRightPanel),s=x(g=>g.setExplicitAgentPath),d=M(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=Y(e.profilePage)??void 0,h=p.useRef(null);p.useEffect(()=>{!l&&c&&h.current!==c&&(h.current=c,s(c))},[l,c,s]);const f=p.useRef(new Map);p.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const g=c??d;if(g){const m=f.current.get(g);if(m!==void 0&&(u===void 0||m.has(u)))return;f.current.set(g,(m??new Set).add(u??"")),o(g,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function le(){const e=w(),r=B(),a=D(),o=e.panel===$,t=e.dialog==="agent"||!!e.agent&&k.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;p.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const h=te(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&k.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,h?n.profilePage=h:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function ae(){var S,b;const r=((S=q().data)==null?void 0:S.members)??[],a=r.find(y=>y.isSelf),o=z(),t=W({isShownInline:()=>o.current}),s=U({isShownInline:()=>o.current}),[d,l]=p.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[h,f]=N(c),[n,g]=N(a?u||Z(a,r):""),m=h.trim(),v=n.trim(),E=a?V(a):null,C=m.length>0&&(m!==c||E!==null),T=t.isError&&t.variables===m?Q(t.error):null,O=s.isError&&((b=s.variables)==null?void 0:b.handle)===v?J(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return C&&(y=await t.mutateAsync(m).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:h,setName:f,handle:n,setHandle:g,canSave:a!==void 0&&!d&&(m.length>0||v.length>0),saving:d,nameError:T,nameSuggestion:E!==null&&m===c?E:null,handleError:O,save:_}}function ie({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=ae(),s=p.useId(),d=p.useId(),l=p.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let h=r;return t.saving?h="Saving…":u&&(h="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(A,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(R,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(L,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(A,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(R,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(L,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(I,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:h}),a&&i.jsx(I,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{ie as O,oe as a,re as b,se as i,le as u};
@@ -1 +1 @@
1
- import{G as i,j as s,J as a,K as r}from"./index-BZKMWkth.js";function d({member:t}){var o;const e=i((o=t.agent)==null?void 0:o.runtime),n=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[n?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(a,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(r,{agentId:t.id})]})]})}export{d as PermissionsPage};
1
+ import{G as i,j as s,J as a,K as r}from"./index-Dr-0P6rd.js";function d({member:t}){var o;const e=i((o=t.agent)==null?void 0:o.runtime),n=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[n?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(a,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(r,{agentId:t.id})]})]})}export{d as PermissionsPage};
@@ -1 +1 @@
1
- import{b as n,j as t,e as i}from"./index-BZKMWkth.js";import{u as m,P as p}from"./use-personality-commit-CgQm9Y7m.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-B_MwZHvh.js";function P({member:r}){const{agent:e,isPending:o,update:a}=n(r),s=m(e,a);return o?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(p,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{P as PersonalityPopover};
1
+ import{b as n,j as t,e as i}from"./index-Dr-0P6rd.js";import{u as m,P as p}from"./use-personality-commit-Gfoi__sT.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-C7YgkNET.js";function P({member:r}){const{agent:e,isPending:o,update:a}=n(r),s=m(e,a);return o?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(p,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{P as PersonalityPopover};
@@ -0,0 +1 @@
1
+ import{j as t,s as r}from"./index-Dr-0P6rd.js";function s({member:o}){return t.jsx(r,{member:o})}export{s as PhotoPage};
@@ -1 +1 @@
1
- import{r as b,j as n,b9 as _,bc as p,bd as S,f2 as k,bh as E,d0 as I,f3 as N,f4 as R,f5 as A,ba as T,bi as h,f6 as M,f7 as $,f8 as D,f9 as O,ae as F,aj as V,ak as G}from"./index-BZKMWkth.js";import{S as L}from"./shield-x-ZcQ8NB0Z.js";var K=Object.defineProperty,g=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[U,oe]=S(x,[k]),C=k(),[q,y]=U(x),H=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:v="automatic",...m}=t,u=E(l),[c,f]=I({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(q,{scope:r,baseId:N(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:v,children:n.jsx(p.div,{dir:u,"data-orientation":i,...m,ref:a})})},"Tabs")),z="TabsList",B=b.forwardRef(g(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(z,r),i=C(r);return n.jsx(R,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(p.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=C(r),v=w(i.baseId,s),m=j(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:v,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),v=w(l.baseId,s),m=j(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:m,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}g(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}g(j,"makeContentId");var Y=H,Z=B,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.jsx(Z,{"data-slot":"tabs-list",className:h("bg-dui-muted text-dui-muted-foreground inline-flex items-center justify-center rounded-lg p-1",t?M:"h-9",e),...a})}function ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow,opacity] motion-reduce:transition-none! md:py-1","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-dui-background data-[state=active]:text-dui-foreground data-[state=active]:shadow",e),...t})}function de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t})}const ae={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function le(e){return ae[e]??!1}function se(e){try{return O.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=$(e.startsEnabled);return`${t}, ${a}. This job ${D(e.permissionMode)}.`}function be(e,t){const a=F(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return V({queryKey:G.permissionPreview(e??"",o?s:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?s:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function P(e){const t=e==null?void 0:e.body,a=Array.isArray(t==null?void 0:t.errors)?t.errors.filter(r=>typeof r=="string"):[];return a.length>0?{reasons:a,checked:!0}:{reasons:e instanceof Error&&e.message?[e.message]:[],checked:!1}}function ge(e){return P(e).checked}function ve({error:e}){const{reasons:t,checked:a}=P(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ve as P,ie as T,ce as a,ue as b,de as c,fe as d,ge as i,le as r,be as u};
1
+ import{r as b,j as n,b9 as _,bc as p,bd as S,f2 as k,bh as E,d0 as I,f3 as N,f4 as R,f5 as A,ba as T,bi as h,f6 as M,f7 as $,f8 as D,f9 as O,ae as F,aj as V,ak as G}from"./index-Dr-0P6rd.js";import{S as L}from"./shield-x-DioB6qH_.js";var K=Object.defineProperty,g=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[U,oe]=S(x,[k]),C=k(),[q,y]=U(x),H=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:v="automatic",...m}=t,u=E(l),[c,f]=I({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(q,{scope:r,baseId:N(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:v,children:n.jsx(p.div,{dir:u,"data-orientation":i,...m,ref:a})})},"Tabs")),z="TabsList",B=b.forwardRef(g(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(z,r),i=C(r);return n.jsx(R,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(p.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=C(r),v=w(i.baseId,s),m=j(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:v,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),v=w(l.baseId,s),m=j(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:m,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}g(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}g(j,"makeContentId");var Y=H,Z=B,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.jsx(Z,{"data-slot":"tabs-list",className:h("bg-dui-muted text-dui-muted-foreground inline-flex items-center justify-center rounded-lg p-1",t?M:"h-9",e),...a})}function ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow,opacity] motion-reduce:transition-none! md:py-1","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-dui-background data-[state=active]:text-dui-foreground data-[state=active]:shadow",e),...t})}function de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t})}const ae={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function le(e){return ae[e]??!1}function se(e){try{return O.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=$(e.startsEnabled);return`${t}, ${a}. This job ${D(e.permissionMode)}.`}function be(e,t){const a=F(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return V({queryKey:G.permissionPreview(e??"",o?s:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?s:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function P(e){const t=e==null?void 0:e.body,a=Array.isArray(t==null?void 0:t.errors)?t.errors.filter(r=>typeof r=="string"):[];return a.length>0?{reasons:a,checked:!0}:{reasons:e instanceof Error&&e.message?[e.message]:[],checked:!1}}function ge(e){return P(e).checked}function ve({error:e}){const{reasons:t,checked:a}=P(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ve as P,ie as T,ce as a,ue as b,de as c,fe as d,ge as i,le as r,be as u};
@@ -1 +1 @@
1
- import{j as e,a3 as c,aL as l,Z as i}from"./index-BZKMWkth.js";const p=4,m={compact:"max-w-[200px] gap-1.5 px-2.5 py-1 text-xs",comfortable:"min-h-9 max-w-[280px] gap-2 px-3 py-1.5 text-sm"};function u({suggestions:o,onChipClick:s,ariaLabel:r="Suggested follow-ups",size:a="compact"}){const n=o.slice(0,p);return e.jsx(c.div,{"data-slot":"prompt-suggestion-chips",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":r,className:"mt-1.5 flex flex-wrap items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button","aria-label":t,title:t,onClick:()=>s(t),className:i("bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring inline-flex items-center truncate rounded-md transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",m[a]),children:[e.jsx(l,{className:i("shrink-0",a==="compact"?"size-3":"size-3.5")}),e.jsx("span",{className:"truncate",children:t})]},t))})}export{u as P};
1
+ import{j as e,a3 as c,aL as l,Z as i}from"./index-Dr-0P6rd.js";const p=4,m={compact:"max-w-[200px] gap-1.5 px-2.5 py-1 text-xs",comfortable:"min-h-9 max-w-[280px] gap-2 px-3 py-1.5 text-sm"};function u({suggestions:o,onChipClick:s,ariaLabel:r="Suggested follow-ups",size:a="compact"}){const n=o.slice(0,p);return e.jsx(c.div,{"data-slot":"prompt-suggestion-chips",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":r,className:"mt-1.5 flex flex-wrap items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button","aria-label":t,title:t,onClick:()=>s(t),className:i("bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring inline-flex items-center truncate rounded-md transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",m[a]),children:[e.jsx(l,{className:i("shrink-0",a==="compact"?"size-3":"size-3.5")}),e.jsx("span",{className:"truncate",children:t})]},t))})}export{u as P};
@@ -1 +1 @@
1
- import{U as P,r as g,b as D,V as O,j as e,e as U,W as _,Y,Z as C,t as z,g as F,$ as M,a0 as W}from"./index-BZKMWkth.js";const A="REPORTS_TO_CYCLE",q="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function B({option:a,selected:d,focusable:i,isDefault:f,disabled:p,onPick:c}){const o=z(a.member);return e.jsxs("button",{type:"button",role:"radio","aria-checked":d,tabIndex:i?0:-1,disabled:p,onClick:c,className:C(W,"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm","hover:bg-accent disabled:opacity-60"),children:[e.jsx(F,{size:"xs",kind:o.kind,color:o.color,emoji:o.emoji,imageUrl:o.imageUrl,fallback:o.fallback,origin:o.origin,badge:null}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[a.label,f&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"text-muted-foreground",children:"(default)"})]})]}),d&&e.jsx(M,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function K({member:a}){var y,R;const d=P(),i=g.useRef(null),f=g.useId(),p=g.useId(),{agent:c,isPending:o,isSaving:h,error:u,update:b}=D(a,{errorLabel:"Couldn’t change who this agent reports to",isShownInline:t=>d.current===!0&&t.code===A}),j=O();if(o||j.isPending)return e.jsx(U,{className:"h-24 w-full"});if(!c)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const I=((y=j.data)==null?void 0:y.members)??[],l=_(c,I,a),m=Y(c.id,I,a),E=m.some(t=>t.accountId===l.accountId)?l.accountId:((R=m[0])==null?void 0:R.accountId)??null,L=t=>{var v;const s=Array.from(((v=i.current)==null?void 0:v.querySelectorAll('[role="radio"]'))??[]),r=s.indexOf(document.activeElement),n={ArrowDown:r+1,ArrowRight:r+1,ArrowUp:r-1,ArrowLeft:r-1,Home:0,End:s.length-1}[t.key];if(n===void 0||s.length===0)return;t.preventDefault();const x=s[(n+s.length)%s.length];s.forEach(N=>N.tabIndex=N===x?0:-1),x==null||x.focus()},S=m.filter(t=>t.kind==="person"),T=m.filter(t=>t.kind==="agent"),k=(u==null?void 0:u.code)===A?u.message:null,w=(t,s,r)=>r.length>0&&e.jsxs("div",{role:"group","aria-labelledby":s,className:"space-y-0.5",children:[e.jsx("div",{id:s,className:C(q,"px-1.5"),children:t}),r.map(n=>e.jsx(B,{option:n,selected:l.accountId===n.accountId,focusable:E===n.accountId,isDefault:l.isDefault&&l.accountId===n.accountId,disabled:h,onPick:()=>{n.accountId!==c.reportsTo&&b({reportsTo:n.accountId})}},n.accountId))]});return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-reports-to",children:[e.jsxs("div",{ref:i,role:"radiogroup","aria-label":"Reports to",onKeyDown:L,className:"max-h-72 space-y-2 overflow-y-auto",children:[w("People",f,S),w("Agents",p,T)]}),k&&e.jsx("p",{role:"alert",className:"text-status-error px-1.5 text-xs",children:k}),!l.isDefault&&e.jsx("button",{type:"button",disabled:h,onClick:()=>b({reportsTo:null}),className:"text-muted-foreground hover:text-foreground px-1.5 text-xs underline-offset-2 hover:underline",children:"Use the default"})]})}export{K as ReportsToPopover};
1
+ import{U as P,r as g,b as D,V as O,j as e,e as U,W as _,Y,Z as C,t as z,g as F,$ as M,a0 as W}from"./index-Dr-0P6rd.js";const A="REPORTS_TO_CYCLE",q="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function B({option:a,selected:d,focusable:i,isDefault:f,disabled:p,onPick:c}){const o=z(a.member);return e.jsxs("button",{type:"button",role:"radio","aria-checked":d,tabIndex:i?0:-1,disabled:p,onClick:c,className:C(W,"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm","hover:bg-accent disabled:opacity-60"),children:[e.jsx(F,{size:"xs",kind:o.kind,color:o.color,emoji:o.emoji,imageUrl:o.imageUrl,fallback:o.fallback,origin:o.origin,badge:null}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[a.label,f&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"text-muted-foreground",children:"(default)"})]})]}),d&&e.jsx(M,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function K({member:a}){var y,R;const d=P(),i=g.useRef(null),f=g.useId(),p=g.useId(),{agent:c,isPending:o,isSaving:h,error:u,update:b}=D(a,{errorLabel:"Couldn’t change who this agent reports to",isShownInline:t=>d.current===!0&&t.code===A}),j=O();if(o||j.isPending)return e.jsx(U,{className:"h-24 w-full"});if(!c)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const I=((y=j.data)==null?void 0:y.members)??[],l=_(c,I,a),m=Y(c.id,I,a),E=m.some(t=>t.accountId===l.accountId)?l.accountId:((R=m[0])==null?void 0:R.accountId)??null,L=t=>{var v;const s=Array.from(((v=i.current)==null?void 0:v.querySelectorAll('[role="radio"]'))??[]),r=s.indexOf(document.activeElement),n={ArrowDown:r+1,ArrowRight:r+1,ArrowUp:r-1,ArrowLeft:r-1,Home:0,End:s.length-1}[t.key];if(n===void 0||s.length===0)return;t.preventDefault();const x=s[(n+s.length)%s.length];s.forEach(N=>N.tabIndex=N===x?0:-1),x==null||x.focus()},S=m.filter(t=>t.kind==="person"),T=m.filter(t=>t.kind==="agent"),k=(u==null?void 0:u.code)===A?u.message:null,w=(t,s,r)=>r.length>0&&e.jsxs("div",{role:"group","aria-labelledby":s,className:"space-y-0.5",children:[e.jsx("div",{id:s,className:C(q,"px-1.5"),children:t}),r.map(n=>e.jsx(B,{option:n,selected:l.accountId===n.accountId,focusable:E===n.accountId,isDefault:l.isDefault&&l.accountId===n.accountId,disabled:h,onPick:()=>{n.accountId!==c.reportsTo&&b({reportsTo:n.accountId})}},n.accountId))]});return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-reports-to",children:[e.jsxs("div",{ref:i,role:"radiogroup","aria-label":"Reports to",onKeyDown:L,className:"max-h-72 space-y-2 overflow-y-auto",children:[w("People",f,S),w("Agents",p,T)]}),k&&e.jsx("p",{role:"alert",className:"text-status-error px-1.5 text-xs",children:k}),!l.isDefault&&e.jsx("button",{type:"button",disabled:h,onClick:()=>b({reportsTo:null}),className:"text-muted-foreground hover:text-foreground px-1.5 text-xs underline-offset-2 hover:underline",children:"Use the default"})]})}export{K as ReportsToPopover};