@lobu/runtime-server 24.10.0 → 24.11.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 (172) hide show
  1. package/dist/catalogs/connectors.json +1 -1
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/linkedin-inbox-adapter.js +13 -3
  4. package/dist/connectors/whatsapp-web-adapter.js +14 -13
  5. package/dist/connectors/whatsapp-web-helpers.ts +37 -1
  6. package/dist/connectors/whatsapp_web.ts +5 -5
  7. package/dist/connectors/x-dm-adapter.js +17 -3
  8. package/dist/db/migrations/20261113170000_member_sql_rls.sql +254 -0
  9. package/dist/db/migrations/20261113180000_member_sql_rls_parallel_plans.sql +192 -0
  10. package/dist/db/migrations/20261113190000_member_sql_schema_usage.sql +24 -0
  11. package/dist/db/migrations/20261114120000_events_owner_only_visibility.sql +39 -0
  12. package/dist/dependencies.bun.lock +10 -10
  13. package/dist/embeddings-server.mjs +1 -1
  14. package/dist/guest.bundle.js +1 -1
  15. package/dist/owletto/dist/assets/_-BDMUN9XZ.js +2 -0
  16. package/dist/owletto/dist/assets/_-CF5X4ANe.js +3 -0
  17. package/dist/owletto/dist/assets/{_agentId-DN0EwMAC.js → _agentId-CGScf8z_.js} +2 -2
  18. package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +2 -0
  19. package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +2 -0
  20. package/dist/owletto/dist/assets/{_connectorKey._connectionId-CVKfL9AG.js → _connectorKey._connectionId-DcI29kGy.js} +2 -2
  21. package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +2 -0
  22. package/dist/owletto/dist/assets/{_conversationId-CPpNySjO.js → _conversationId-CnmLYlVS.js} +2 -2
  23. package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +2 -0
  24. package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +3 -0
  25. package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +2 -0
  26. package/dist/owletto/dist/assets/{_slug-DJx_8fsV.js → _slug-COPpRXLt.js} +2 -2
  27. package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +2 -0
  28. package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +2 -0
  29. package/dist/owletto/dist/assets/{accept-invitation-Dwq1GAnG.js → accept-invitation-BKeIzZXE.js} +2 -2
  30. package/dist/owletto/dist/assets/{activity-route-location-C1jcXC7v.js → activity-route-location-sLvKaSCa.js} +2 -2
  31. package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +2 -0
  32. package/dist/owletto/dist/assets/{agent-connect-pages-DoI9UR0a.js → agent-connect-pages-DVq9nAR7.js} +3 -3
  33. package/dist/owletto/dist/assets/{agent-editor-form-DlavYg2q.js → agent-editor-form-DVFyyMyd.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-loading-shells-DYqQphN7.js → agent-loading-shells-BLNHIy-r.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-permissions-matrix-C1L8IcYR.js → agent-permissions-matrix-UBKRR5vs.js} +2 -2
  36. package/dist/owletto/dist/assets/{agent-skill-context-D1nMrVod.js → agent-skill-context-fqedKd0D.js} +2 -2
  37. package/dist/owletto/dist/assets/{agent-subpage-shell-2w7vTeXw.js → agent-subpage-shell-BUCoY2Nf.js} +2 -2
  38. package/dist/owletto/dist/assets/{agent-thread-BopD-2k1.js → agent-thread-Cqf9ITrT.js} +2 -2
  39. package/dist/owletto/dist/assets/app-bridge-B-L0rGz9.js +121 -0
  40. package/dist/owletto/dist/assets/{app._appId-BXeFXW1w.js → app._appId-ByIypCL9.js} +2 -2
  41. package/dist/owletto/dist/assets/{assist-composer-CL5x8pNt.js → assist-composer-kG_heHXo.js} +2 -2
  42. package/dist/owletto/dist/assets/{automation-run-now-MtxUTfzd.js → automation-run-now-C5XTS00o.js} +2 -2
  43. package/dist/owletto/dist/assets/{callback-BgfwP1Eo.js → callback-Pz5uS-k7.js} +2 -2
  44. package/dist/owletto/dist/assets/{card-DtLIFq7D.js → card-CAPpY9P5.js} +2 -2
  45. package/dist/owletto/dist/assets/{claim-CT3hYVMF.js → claim-DgWWK0KI.js} +2 -2
  46. package/dist/owletto/dist/assets/{client-activity-scopes-BPbRX-Pe.js → client-activity-scopes-Aqdo6Pdr.js} +2 -2
  47. package/dist/owletto/dist/assets/{client-rows-vrNA6FLs.js → client-rows-Dd5YV8vn.js} +2 -2
  48. package/dist/owletto/dist/assets/{clients-xnzZeEdZ.js → clients-Bf7ZgGro.js} +2 -2
  49. package/dist/owletto/dist/assets/{code-editor-mrKkAfcE.js → code-editor-z1Sy_hiX.js} +2 -2
  50. package/dist/owletto/dist/assets/connect-BFNp1y_s.js +2 -0
  51. package/dist/owletto/dist/assets/{connect-menu-C6iVtuSo.js → connect-menu-BWrAhMqO.js} +2 -2
  52. package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +2 -0
  53. package/dist/owletto/dist/assets/{connected._clientId-ROfVgp9h.js → connected._clientId-CuOeHafK.js} +2 -2
  54. package/dist/owletto/dist/assets/{connection-BMz740Wi.js → connection-CVeHmDLs.js} +2 -2
  55. package/dist/owletto/dist/assets/{connection-feed-detail-0VAJiZTP.js → connection-feed-detail-BYo7zdVD.js} +2 -2
  56. package/dist/owletto/dist/assets/{connector-page-shell-BFv21yuv.js → connector-page-shell-an3SYLim.js} +2 -2
  57. package/dist/owletto/dist/assets/{connector-provenance-b59RfBtk.js → connector-provenance-mSZCOud-.js} +2 -2
  58. package/dist/owletto/dist/assets/{connectors-nYS31lO2.js → connectors-DBEM9QQz.js} +2 -2
  59. package/dist/owletto/dist/assets/{consent-cPRF9JQv.js → consent-1ulwyJ3k.js} +2 -2
  60. package/dist/owletto/dist/assets/{copy-button-C3wMMv63.js → copy-button-Xhh7ZnjO.js} +2 -2
  61. package/dist/owletto/dist/assets/{core.esm-C9QlSrgK.js → core.esm-Ctg_pXLe.js} +2 -2
  62. package/dist/owletto/dist/assets/{create-CGOWfMk4.js → create-CGuoqPh8.js} +2 -2
  63. package/dist/owletto/dist/assets/create-Ccb5R-S4.js +2 -0
  64. package/dist/owletto/dist/assets/{create-ASRN3Obq.js → create-DmhbacIa.js} +2 -2
  65. package/dist/owletto/dist/assets/{create-automation-form-CLicoPH5.js → create-automation-form-CD6jSlWL.js} +2 -2
  66. package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +2 -0
  67. package/dist/owletto/dist/assets/{custom-guardrail-edits-BUL7nmuO.js → custom-guardrail-edits-Ce_BwiwD.js} +2 -2
  68. package/dist/owletto/dist/assets/{definition-comparison-4UYMI6BK.js → definition-comparison-D_qP25jR.js} +2 -2
  69. package/dist/owletto/dist/assets/{detail-page-skeleton-C8v3rJXK.js → detail-page-skeleton-CPAfZLG0.js} +2 -2
  70. package/dist/owletto/dist/assets/{device-BBwsOi7q.js → device-DDl5XKvt.js} +2 -2
  71. package/dist/owletto/dist/assets/{device-pin-tombstone-Bcpe7nAA.js → device-pin-tombstone-Dkj7hrBE.js} +2 -2
  72. package/dist/owletto/dist/assets/{device._deviceId-DLT4jh0Z.js → device._deviceId-bNhTcops.js} +2 -2
  73. package/dist/owletto/dist/assets/{dynamic-schema-form-BDT8x0Vg.js → dynamic-schema-form-CRyUchXo.js} +2 -2
  74. package/dist/owletto/dist/assets/{entity-options-B9hm9V87.js → entity-options-D4t-NAcg.js} +2 -2
  75. package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +2 -0
  76. package/dist/owletto/dist/assets/{entity-pages-BWBpttz3.js → entity-pages-_nuesgnp.js} +2 -2
  77. package/dist/owletto/dist/assets/{entity-schema-graph-lMMx3HhR.js → entity-schema-graph-Cq96SJ3c.js} +2 -2
  78. package/dist/owletto/dist/assets/{entity-type-page-CkQm0yEu.js → entity-type-page-CkCSbkBx.js} +2 -2
  79. package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +2 -0
  80. package/dist/owletto/dist/assets/{events-feed-DmRzikZW.js → events-feed-DcKTkJVe.js} +2 -2
  81. package/dist/owletto/dist/assets/{filter-editors-CQoSj-20.js → filter-editors-DGVl9U4D.js} +3 -3
  82. package/dist/owletto/dist/assets/{full-page-spinner-CYyCnKve.js → full-page-spinner-CtVlF8GQ.js} +2 -2
  83. package/dist/owletto/dist/assets/index-BUlkNJzX.js +2 -0
  84. package/dist/owletto/dist/assets/{index-BS5Ty3tf.js → index-BifR-LE9.js} +2 -2
  85. package/dist/owletto/dist/assets/{index-DByaMzsG.js → index-BoqrvLHQ.js} +1383 -1383
  86. package/dist/owletto/dist/assets/index-CA9mW_ZM.js +2 -0
  87. package/dist/owletto/dist/assets/index-CH0GzG4i.js +2 -0
  88. package/dist/owletto/dist/assets/index-CK5GDX4B.js +2 -0
  89. package/dist/owletto/dist/assets/index-CtI5Eomq.js +2 -0
  90. package/dist/owletto/dist/assets/{index-CUndAH6o.js → index-DbjbHlDe.js} +2 -2
  91. package/dist/owletto/dist/assets/index-DmtQ0bds.js +2 -0
  92. package/dist/owletto/dist/assets/{index-CDyFQ32o.js → index-Du_J8hnx.js} +2 -2
  93. package/dist/owletto/dist/assets/{index-ittfA0k8.js → index-DvuJ_S_o.js} +2 -2
  94. package/dist/owletto/dist/assets/index-Pae_f9LM.css +1 -0
  95. package/dist/owletto/dist/assets/{index-C3hz9tzx.js → index-XETZnN7L.js} +2 -2
  96. package/dist/owletto/dist/assets/{json-diff-mcDgyct_.js → json-diff-OjtREegr.js} +2 -2
  97. package/dist/owletto/dist/assets/{list-skeleton-DsYGUHxi.js → list-skeleton-CH0qQBYk.js} +2 -2
  98. package/dist/owletto/dist/assets/{login-EoLq136v.js → login-DG0b9uSC.js} +2 -2
  99. package/dist/owletto/dist/assets/{logout-gLgEQOiX.js → logout-DfdgOLoM.js} +2 -2
  100. package/dist/owletto/dist/assets/{member-scope-gate-vvkgSAb2.js → member-scope-gate-Cxg2zGQT.js} +2 -2
  101. package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +74 -0
  102. package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +2 -0
  103. package/dist/owletto/dist/assets/{model-selector-D3vSMLO2.js → model-selector-D2OpDkwH.js} +2 -2
  104. package/dist/owletto/dist/assets/{needs-you-list-B5Bgd05M.js → needs-you-list-3uMsWcDv.js} +2 -2
  105. package/dist/owletto/dist/assets/{new-dLXsCHBd.js → new-AdGV6a8R.js} +2 -2
  106. package/dist/owletto/dist/assets/new-BdtIhBpo.js +2 -0
  107. package/dist/owletto/dist/assets/{new-Bk_flKQO.js → new-BjGwX6s6.js} +2 -2
  108. package/dist/owletto/dist/assets/{new-BPW3V0Y1.js → new-D-iMjV74.js} +2 -2
  109. package/dist/owletto/dist/assets/{organization-DBfgBkzq.js → organization-qaIpEiQg.js} +2 -2
  110. package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +2 -0
  111. package/dist/owletto/dist/assets/{pending-seed-CBhx2Ql-.js → pending-seed-BBACroge.js} +2 -2
  112. package/dist/owletto/dist/assets/{proposal-review-shell-B-jYcKfB.js → proposal-review-shell-C8ZfIAYn.js} +2 -2
  113. package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +2 -0
  114. package/dist/owletto/dist/assets/{record-session-CAmGHMyM.js → record-session-BrM9cdXu.js} +2 -2
  115. package/dist/owletto/dist/assets/{renderer-olRv_HMI.js → renderer-CTKNMcXP.js} +4 -4
  116. package/dist/owletto/dist/assets/{reset-password-B9_xi8Pq.js → reset-password-DKBEneyR.js} +2 -2
  117. package/dist/owletto/dist/assets/{run-initiator-DhE5v4z0.js → run-initiator-BKSgI1o0.js} +2 -2
  118. package/dist/owletto/dist/assets/{runs-C8sZQr4o.js → runs-k2NpbZm8.js} +2 -2
  119. package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +2 -0
  120. package/dist/owletto/dist/assets/{schema-value-zTJGE4eh.js → schema-value-wjqGxXhv.js} +3 -3
  121. package/dist/owletto/dist/assets/{scoped-feed-bar-BKyJSa3_.js → scoped-feed-bar-DNFL0sYX.js} +2 -2
  122. package/dist/owletto/dist/assets/{settings-z02cvVS3.js → settings-V0m5Om5j.js} +2 -2
  123. package/dist/owletto/dist/assets/{source-record-panels-CGmKIJdN.js → source-record-panels-BMut9YIA.js} +2 -2
  124. package/dist/owletto/dist/assets/{status-variants-DyRCXBzM.js → status-variants-SzXYYedJ.js} +2 -2
  125. package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +2 -0
  126. package/dist/owletto/dist/assets/{table-C637cQxG.js → table-ZuYMOjVR.js} +2 -2
  127. package/dist/owletto/dist/assets/{use-automations-CgWNoYio.js → use-automations-DfBtVzGa.js} +2 -2
  128. package/dist/owletto/dist/assets/{use-login-redirect-tDdhXTpt.js → use-login-redirect-BDiS3eyl.js} +2 -2
  129. package/dist/owletto/dist/assets/{use-mention-search-D-kIKchD.js → use-mention-search-khySpz_V.js} +2 -2
  130. package/dist/owletto/dist/assets/view-card-DiHWlypr.js +2 -0
  131. package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +2 -0
  132. package/dist/owletto/dist/assets/{views-access-required-C35Dyt91.js → views-access-required-HA-PiOwA.js} +2 -2
  133. package/dist/owletto/dist/index.html +2 -2
  134. package/dist/server-main.bundle.mjs +1052 -538
  135. package/npm-shrinkwrap.json +38 -38
  136. package/package.json +1 -1
  137. package/vendor/connector-sdk/package.json +1 -1
  138. package/vendor/core/package.json +1 -1
  139. package/vendor/views/package.json +1 -1
  140. package/dist/owletto/dist/assets/_-CYvj1y65.js +0 -3
  141. package/dist/owletto/dist/assets/_-CeLTSYYY.js +0 -2
  142. package/dist/owletto/dist/assets/_agentId-BB5E-L6T.js +0 -2
  143. package/dist/owletto/dist/assets/_automationId-DvUl9CSd.js +0 -2
  144. package/dist/owletto/dist/assets/_connectorKey.index-Cv6FzK1v.js +0 -2
  145. package/dist/owletto/dist/assets/_eventId-DZKicuq6.js +0 -2
  146. package/dist/owletto/dist/assets/_owner-Dauk3YuD.js +0 -3
  147. package/dist/owletto/dist/assets/_shape-cKrEID3T.js +0 -2
  148. package/dist/owletto/dist/assets/_viewKey-CPVzVKEf.js +0 -2
  149. package/dist/owletto/dist/assets/_viewKey-CW8gexOQ.js +0 -2
  150. package/dist/owletto/dist/assets/activity-route-view-D78Wj0RH.js +0 -2
  151. package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +0 -121
  152. package/dist/owletto/dist/assets/connect-NUCSay8X.js +0 -2
  153. package/dist/owletto/dist/assets/connect._clientId-Cp-d9Q5b.js +0 -2
  154. package/dist/owletto/dist/assets/create-CBcodaSO.js +0 -2
  155. package/dist/owletto/dist/assets/create._connectorKey-s4xkktTC.js +0 -2
  156. package/dist/owletto/dist/assets/entity-page-DZjzQ2V4.js +0 -2
  157. package/dist/owletto/dist/assets/event-detail-CkzfakTK.js +0 -2
  158. package/dist/owletto/dist/assets/index-BE7eb2kE.js +0 -2
  159. package/dist/owletto/dist/assets/index-BFR0uiKY.js +0 -2
  160. package/dist/owletto/dist/assets/index-C38OzBpB.js +0 -2
  161. package/dist/owletto/dist/assets/index-CiKysEhV.js +0 -2
  162. package/dist/owletto/dist/assets/index-DfdinB7B.js +0 -2
  163. package/dist/owletto/dist/assets/index-DgMM4Zt5.css +0 -1
  164. package/dist/owletto/dist/assets/index-Xk711gVC.js +0 -2
  165. package/dist/owletto/dist/assets/memory-browse-page-DvDtwrEI.js +0 -74
  166. package/dist/owletto/dist/assets/new-C5HtQdM_.js +0 -2
  167. package/dist/owletto/dist/assets/peek-pane-content-c2PG3TEX.js +0 -2
  168. package/dist/owletto/dist/assets/public-shell-ready-D8TijlRY.js +0 -2
  169. package/dist/owletto/dist/assets/record-activity-DnRVOrG2.js +0 -2
  170. package/dist/owletto/dist/assets/runs-list-CwtH-wmk.js +0 -2
  171. package/dist/owletto/dist/assets/subDays-D8nHthaS.js +0 -2
  172. package/dist/owletto/dist/assets/view-param-filters-CUCj9Df-.js +0 -2
@@ -1,2 +1,2 @@
1
- import{ae as v,r as a,j as e,L as h,af as j,a4 as y,ag as N}from"./index-DByaMzsG.js";import{C as k,a as C,b as S,c as L}from"./card-DtLIFq7D.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:o})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:o,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
2
- //# sourceMappingURL=reset-password-B9_xi8Pq.js.map
1
+ import{ae as v,r as a,j as e,L as h,af as j,a4 as y,ag as N}from"./index-BoqrvLHQ.js";import{C as k,a as C,b as S,c as L}from"./card-CAPpY9P5.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:o})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:o,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
2
+ //# sourceMappingURL=reset-password-DKBEneyR.js.map
@@ -1,2 +1,2 @@
1
- import{fA as R,fB as w,fC as k,fo as L,r as h,j as n,m as j,bc as A,ej as S,al as C,B as I,e7 as M,M as D,cJ as E,L as _,eI as T}from"./index-DByaMzsG.js";import{a as B}from"./list-skeleton-DsYGUHxi.js";import{s as F}from"./subDays-D8nHthaS.js";import{u as O}from"./use-automations-CgWNoYio.js";import{u as Y}from"./clients-xnzZeEdZ.js";function z(e,s){return R(k(e,e),w(e))}function V(e,s){return L(k(e,e),w(e))}function q(e,s){return L(k(e,e),F(w(e),1))}function J({onIntersect:e,onLeave:s,enabled:t,rootMargin:r="400px"}){const a=h.useRef(null),o=h.useRef(e);o.current=e;const u=h.useRef(s);return u.current=s,h.useEffect(()=>{const c=a.current;if(!c||!t)return;const f=new IntersectionObserver(l=>{l[0]?.isIntersecting?o.current():u.current?.()},{rootMargin:r});return f.observe(c),()=>f.disconnect()},[t,r]),a}function U({groupByDate:e=!0}){return n.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:n.jsxs("div",{"aria-hidden":"true",children:[e?n.jsx("div",{className:"px-3 pb-2",children:n.jsx(j,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(s=>n.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[n.jsx(j,{className:"h-8 w-8 shrink-0 rounded-none"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx(j,{className:"h-4 w-3/5 max-w-sm rounded-none"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(j,{className:"h-3 w-20 rounded-none"}),n.jsx(j,{className:"h-3 w-12 rounded-none"})]})]})]},s))]})})}function $(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:M(s,"d MMMM yyyy")}function W(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:V(s)?"Today":q(s)?"Yesterday":M(s,z(s)?"d MMM":"d MMM yyyy")}function X({items:e}){const s=[];for(const t of e){const r=W(t.occurredAt)??"Undated",a=s.at(-1);a?.day===r?a.items.push(t):s.push({day:r,items:[t]})}return n.jsx(n.Fragment,{children:s.map(({day:t,items:r},a)=>n.jsxs("section",{"aria-label":t,className:"min-w-0",children:[n.jsx("div",{className:a===0?"px-1 pb-1.5":"px-1 pt-4 pb-1.5",children:n.jsx("h2",{className:"text-sm font-semibold",children:t})}),n.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:r.map(o=>n.jsx("li",{children:o.content},o.key))})]},`${t}:${a}`))})}const G=3;function se({items:e,isLoading:s,emptyState:t,hasNextPage:r,isFetching:a,isFetchingNextPage:o,onLoadMore:u,autoLoadMore:c=!0,groupByDate:f=!0,rows:l=!1}){const[y,x]=h.useState(0),g=y>=G,b=J({onIntersect:()=>{x(i=>i+1),u()},onLeave:()=>x(0),enabled:c&&r&&!a&&!g}),N=()=>{x(0),u()};return s&&e.length===0?l?n.jsx("div",{role:"status","aria-label":"Loading activity",className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2,3].map(i=>n.jsx(B,{},i))}):n.jsx(U,{groupByDate:f}):n.jsxs("div",{children:[e.length===0?r?null:t!==void 0?t:n.jsx(A,{icon:S,title:"Nothing here yet",description:"No events match this view."}):l?n.jsx(X,{items:e}):e.map((i,m)=>{const p=$(i.occurredAt),v=m>0?$(e[m-1].occurredAt):null;return n.jsxs(h.Fragment,{children:[f&&p&&p!==v&&n.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:p}),n.jsx("div",{className:"mb-1",children:i.content})]},i.key)}),n.jsx("div",{ref:b,className:"h-1"}),o?n.jsx("div",{role:"status","aria-label":"Loading earlier activity",className:"flex justify-center py-3",children:n.jsx(C,{className:"text-muted-foreground"})}):r?c?g?n.jsx("div",{className:"flex justify-center py-3",children:n.jsx(I,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:a,onClick:N,children:"Show earlier activity"})}):null:n.jsx(I,{size:"sm",variant:"outline",className:l?"mt-3":void 0,disabled:a,onClick:N,children:"Load more"}):null]})}function H(e,s,t){return e?.kind==="agent_session"&&e.agent_id?e.client_id?`${e.agent_id} via ${e.client_id}`:e.agent_id:e?.kind==="user"?"a person":s==="agent"?"an agent":t?`Automation ${t}`:"an Automation"}function ne({ownerSlug:e,initiator:s,clientName:t,fallback:r}){const a=s?.client_id??t,{allOrgs:o,isAuthenticated:u}=D(),c=u&&o?.some(d=>d.slug===e),l=Y(void 0,{ownerSlug:e,enabled:!!(a&&c)}).data?.find(d=>d.id===a)?.title,y=c?o.find(d=>d.slug===e)?.id:void 0,x=s?.kind==="automation"&&s.automation_id?String(s.automation_id):void 0,b=O(x?y:void 0,void 0,{includeDetails:!1}).data?.find(d=>d.automation_id===x)?.name,{members:N}=E(s?.kind==="user"&&s.user_id?y:void 0),i=N.find(d=>d.userId===s?.user_id)?.user.name,m=s&&s.kind!=="user"?b??H(s,void 0,s.automation_id===void 0?void 0:String(s.automation_id)):i??r,p="font-medium text-foreground",v=`${p} underline-offset-4 hover:underline`;return s?.kind==="automation"&&s.automation_id?n.jsx(_,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:String(s.automation_id)},search:{view:"definition",run_id:void 0},className:v,children:m}):s?.kind==="agent_session"&&s.agent_id?n.jsx(_,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:String(s.agent_id)},className:v,children:m}):a?n.jsxs(_,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:a},className:`${v} inline-flex items-center gap-1 align-middle`,children:[n.jsx(T,{name:l??t??a}),l??m]}):n.jsx("span",{className:p,children:m})}export{U as E,ne as R,se as a,z as b,V as i,H as p};
2
- //# sourceMappingURL=run-initiator-DhE5v4z0.js.map
1
+ import{fQ as M,fR as w,fS as k,fE as $,r as h,j as n,m as j,bc as S,em as A,al as E,B as I,ea as L,M as C,cJ as D,L as _,eY as T}from"./index-BoqrvLHQ.js";import{a as Y}from"./list-skeleton-CH0qQBYk.js";import{s as F}from"./subDays-9s9OEl5t.js";import{u as O}from"./use-automations-DfBtVzGa.js";import{u as z}from"./clients-Bf7ZgGro.js";function B(e,s){return M(k(e,e),w(e))}function V(e,s){return $(k(e,e),w(e))}function q(e,s){return $(k(e,e),F(w(e),1))}function J({onIntersect:e,onLeave:s,enabled:t,rootMargin:r="400px"}){const a=h.useRef(null),o=h.useRef(e);o.current=e;const u=h.useRef(s);return u.current=s,h.useEffect(()=>{const c=a.current;if(!c||!t)return;const f=new IntersectionObserver(l=>{l[0]?.isIntersecting?o.current():u.current?.()},{rootMargin:r});return f.observe(c),()=>f.disconnect()},[t,r]),a}function Q({groupByDate:e=!0}){return n.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:n.jsxs("div",{"aria-hidden":"true",children:[e?n.jsx("div",{className:"px-3 pb-2",children:n.jsx(j,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(s=>n.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[n.jsx(j,{className:"h-8 w-8 shrink-0 rounded-none"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[n.jsx(j,{className:"h-4 w-3/5 max-w-sm rounded-none"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(j,{className:"h-3 w-20 rounded-none"}),n.jsx(j,{className:"h-3 w-12 rounded-none"})]})]})]},s))]})})}function R(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:L(s,"d MMMM yyyy")}function U(e){if(e==null||e==="")return null;const s=new Date(e);return Number.isNaN(s.getTime())?null:V(s)?"Today":q(s)?"Yesterday":L(s,B(s)?"d MMM":"d MMM yyyy")}function W({items:e}){const s=[];for(const t of e){const r=U(t.occurredAt)??"Undated",a=s.at(-1);a?.day===r?a.items.push(t):s.push({day:r,items:[t]})}return n.jsx(n.Fragment,{children:s.map(({day:t,items:r},a)=>n.jsxs("section",{"aria-label":t,className:"min-w-0",children:[n.jsx("div",{className:a===0?"px-1 pb-1.5":"px-1 pt-4 pb-1.5",children:n.jsx("h2",{className:"text-sm font-semibold",children:t})}),n.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:r.map(o=>n.jsx("li",{children:o.content},o.key))})]},`${t}:${a}`))})}const X=3;function se({items:e,isLoading:s,emptyState:t,hasNextPage:r,isFetching:a,isFetchingNextPage:o,onLoadMore:u,autoLoadMore:c=!0,groupByDate:f=!0,rows:l=!1}){const[y,x]=h.useState(0),g=y>=X,b=J({onIntersect:()=>{x(i=>i+1),u()},onLeave:()=>x(0),enabled:c&&r&&!a&&!g}),N=()=>{x(0),u()};return s&&e.length===0?l?n.jsx("div",{role:"status","aria-label":"Loading activity",className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2,3].map(i=>n.jsx(Y,{},i))}):n.jsx(Q,{groupByDate:f}):n.jsxs("div",{children:[e.length===0?r?null:t!==void 0?t:n.jsx(S,{icon:A,title:"Nothing here yet",description:"No events match this view."}):l?n.jsx(W,{items:e}):e.map((i,m)=>{const p=R(i.occurredAt),v=m>0?R(e[m-1].occurredAt):null;return n.jsxs(h.Fragment,{children:[f&&p&&p!==v&&n.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:p}),n.jsx("div",{className:"mb-1",children:i.content})]},i.key)}),n.jsx("div",{ref:b,className:"h-1"}),o?n.jsx("div",{role:"status","aria-label":"Loading earlier activity",className:"flex justify-center py-3",children:n.jsx(E,{className:"text-muted-foreground"})}):r?c?g?n.jsx("div",{className:"flex justify-center py-3",children:n.jsx(I,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:a,onClick:N,children:"Show earlier activity"})}):null:n.jsx(I,{size:"sm",variant:"outline",className:l?"mt-3":void 0,disabled:a,onClick:N,children:"Load more"}):null]})}function G(e,s,t){return e?.kind==="agent_session"&&e.agent_id?e.client_id?`${e.agent_id} via ${e.client_id}`:e.agent_id:e?.kind==="user"?"a person":s==="agent"?"an agent":t?`Automation ${t}`:"an Automation"}function ne({ownerSlug:e,initiator:s,clientName:t,fallback:r}){const a=s?.client_id??t,{allOrgs:o,isAuthenticated:u}=C(),c=u&&o?.some(d=>d.slug===e),l=z(void 0,{ownerSlug:e,enabled:!!(a&&c)}).data?.find(d=>d.id===a)?.title,y=c?o.find(d=>d.slug===e)?.id:void 0,x=s?.kind==="automation"&&s.automation_id?String(s.automation_id):void 0,b=O(x?y:void 0,void 0,{includeDetails:!1}).data?.find(d=>d.automation_id===x)?.name,{members:N}=D(s?.kind==="user"&&s.user_id?y:void 0),i=N.find(d=>d.userId===s?.user_id)?.user.name,m=s&&s.kind!=="user"?b??G(s,void 0,s.automation_id===void 0?void 0:String(s.automation_id)):i??r,p="font-medium text-foreground",v=`${p} underline-offset-4 hover:underline`;return s?.kind==="automation"&&s.automation_id?n.jsx(_,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:String(s.automation_id)},search:{view:"definition",run_id:void 0},className:v,children:m}):s?.kind==="agent_session"&&s.agent_id?n.jsx(_,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:String(s.agent_id)},className:v,children:m}):a?n.jsxs(_,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:a},className:`${v} inline-flex items-center gap-1 align-middle`,children:[n.jsx(T,{name:l??t??a}),l??m]}):n.jsx("span",{className:p,children:m})}export{Q as E,ne as R,se as a,B as b,V as i,G as p};
2
+ //# sourceMappingURL=run-initiator-BKSgI1o0.js.map
@@ -1,2 +1,2 @@
1
- import{f_ as l,dI as r,z as d,dJ as f,af as g,f$ as I}from"./index-DByaMzsG.js";const m=30,s=new Set(["running","pending","claimed"]);function _(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function y(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function T(n,e,t){return l({queryKey:["runs-infinite",t??null,n?_(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:a})=>{const i=a;return r("manage_operations",{action:"list_runs",...y(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...i?{before_id:i.before_id,before_created_at:i.before_created_at}:{},limit:m},t?{slug:t}:void 0)},initialPageParam:null,getNextPageParam:a=>{if(!a.has_more)return;const i=a.runs[a.runs.length-1];if(i)return{before_id:i.id,before_created_at:i.created_at}},refetchInterval:a=>(a.state.data?.pages??[]).some(u=>u.runs.some(c=>s.has(c.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function h(n){return s.has(n??"")}function b(n,e){return d({queryKey:["run-outcome",n,e],queryFn:async()=>{const t=await r("manage_operations",{action:"get_run",run_id:e},{slug:n});if(!t.run)throw new Error(t.error||"Run not found");return t.run},enabled:n!=="me",staleTime:15e3,refetchInterval:t=>h(t.state.data?.status)?5e3:!1})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function K(n,e){const{slug:t}=f(),a=e!=null?p(n,e):null,i=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return d({queryKey:["pending-proposal",t,...i,e],queryFn:async()=>{const o=await g(I(t,a),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!t&&!!a&&!!e,staleTime:0,retry:!1})}export{b as a,K as b,h as i,T as u};
2
- //# sourceMappingURL=runs-C8sZQr4o.js.map
1
+ import{ge as l,dL as r,z as d,dM as g,af as f,gf as I}from"./index-BoqrvLHQ.js";const m=30,s=new Set(["running","pending","claimed"]);function y(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function _(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function T(n,e,t){return l({queryKey:["runs-infinite",t??null,n?y(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:a})=>{const i=a;return r("manage_operations",{action:"list_runs",..._(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...i?{before_id:i.before_id,before_created_at:i.before_created_at}:{},limit:m},t?{slug:t}:void 0)},initialPageParam:null,getNextPageParam:a=>{if(!a.has_more)return;const i=a.runs[a.runs.length-1];if(i)return{before_id:i.id,before_created_at:i.created_at}},refetchInterval:a=>(a.state.data?.pages??[]).some(u=>u.runs.some(c=>s.has(c.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function h(n){return s.has(n??"")}function b(n,e){return d({queryKey:["run-outcome",n,e],queryFn:async()=>{const t=await r("manage_operations",{action:"get_run",run_id:e},{slug:n});if(!t.run)throw new Error(t.error||"Run not found");return t.run},enabled:n!=="me",staleTime:15e3,refetchInterval:t=>h(t.state.data?.status)?5e3:!1})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function K(n,e){const{slug:t}=g(),a=e!=null?p(n,e):null,i=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return d({queryKey:["pending-proposal",t,...i,e],queryFn:async()=>{const o=await f(I(t,a),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!t&&!!a&&!!e,staleTime:0,retry:!1})}export{b as a,K as b,h as i,T as u};
2
+ //# sourceMappingURL=runs-k2NpbZm8.js.map
@@ -0,0 +1,2 @@
1
+ import{j as t,B as k,L as v,d9 as B,i as h,dE as F,dF as D,dG as E,hV as M,hW as A,u as I,hX as p,hY as V,bf as y,bk as w,fa as K,r as x,aE as b,aF as N,aH as $,fe as P,as as z,al as O,hZ as U,h_ as G,h$ as _,bg as J,C as W,ea as X}from"./index-BoqrvLHQ.js";import{R as Y,a as q}from"./run-initiator-BKSgI1o0.js";function H(e,s){switch(s.kind){case"connection":return A(e,s.id);case"feed":return M(e,s.id);case"run":return{to:"/$owner/events",params:{owner:e},search:{run_ids:String(s.id)}}}}function Q({ownerSlug:e,scope:s,variant:n="outline",iconOnly:i=!1,label:o,className:c,title:a}){const l=H(e,s),r=a??o??"View in memory",u=t.jsx(k,{asChild:!0,variant:n,size:i?"icon":"sm",className:h(i&&"h-7 w-7",c),children:t.jsxs(v,{to:l.to,params:l.params,search:l.search,children:[t.jsx(B,{className:h("h-3.5 w-3.5",!i&&"mr-1.5")}),!i&&(o??"View in memory")]})});return i?t.jsxs(F,{children:[t.jsx(D,{asChild:!0,children:u}),t.jsx(E,{children:r})]}):u}function Z({status:e}){return e==="completed"?t.jsx(P,{className:"h-4 w-4 text-green-500"}):e==="failed"?t.jsx(z,{className:"h-4 w-4 text-destructive"}):e==="running"?t.jsx(O,{className:"text-blue-500"}):t.jsx(U,{className:"h-4 w-4 text-muted-foreground"})}const ee={completed:"Completed",failed:"Failed",running:"Running",pending:"Queued",claimed:"Starting",timeout:"Timed out",cancelled:"Cancelled"};function C(e){const s=e.split("_").join(" ");return s.charAt(0).toUpperCase()+s.slice(1)}function te({error:e}){const[s,n]=x.useState(!1);return e.length<=80?t.jsx("span",{className:"text-destructive",children:e}):t.jsxs(b,{open:s,onOpenChange:n,children:[t.jsx(N,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-left text-destructive hover:underline",children:e})}),t.jsx($,{className:"max-h-64 w-96 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs text-destructive",children:e})})]})}function se({checkpoint:e}){return t.jsxs(b,{children:[t.jsx(N,{asChild:!0,children:t.jsx(k,{variant:"ghost",size:"icon",title:"Checkpoint","aria-label":"Checkpoint",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(G,{className:"h-4 w-4","aria-hidden":"true"})})}),t.jsx($,{className:"max-h-64 w-80 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs",children:JSON.stringify(e,null,2)})})]})}function R(e){if(e.initiator_kind)return{kind:e.initiator_kind,...e.initiator_ref};if(e.automation_id)return{kind:"automation",automation_id:e.automation_id};if(e.created_by_user_id)return{kind:"user",user_id:e.created_by_user_id}}function ne({run:e,ownerSlug:s}){const n=R(e);return n?n.kind==="system"?t.jsx(t.Fragment,{children:"by the system"}):t.jsxs(t.Fragment,{children:["by"," ",t.jsx(Y,{ownerSlug:s,initiator:n,clientName:void 0,fallback:"a person"})]}):null}function ae({parts:e}){return t.jsx(t.Fragment,{children:e.map(([s,n],i)=>t.jsxs(x.Fragment,{children:[i>0?" · ":"",n]},s))})}function j(e,s){return[e.run_type?C(e.run_type):"Run",s.connection?e.connection_display_name:null,s.feed?e.feed_display_name??e.feed_key:null].filter(Boolean).join(" · ")}const ie=3;function g(e,s){const n=p(e.created_at);return e.status==="completed"&&n!=null?`${j(e,s)}|${X(n,"yyyy-MM-dd")}`:null}function re(e,s){const n=new Map;for(const c of e){const a=g(c,s);a&&n.set(a,[...n.get(a)??[],c])}const i=[],o=new Set;for(const c of e){const a=g(c,s),l=a?n.get(a):void 0;!a||!l||l.length<ie?i.push({kind:"run",run:c}):o.has(a)||(o.add(a),i.push({kind:"group",name:j(c,s),runs:l}))}return i}function oe({name:e,runs:s,ownerSlug:n,columns:i}){const[o,c]=x.useState(!1),a=p(s[0].created_at),l=p(s[s.length-1].created_at),r=Date.now(),u=s.reduce((m,T)=>m+(T.items_collected??0),0),d=l!=null?_(l,r):null,f=a!=null?_(a,r):null,S=d&&f&&d!==f?`${d}–${f}`:f;return t.jsxs("div",{children:[t.jsx("button",{type:"button","aria-expanded":o,onClick:()=>c(m=>!m),className:h(w,"rounded-lg transition-colors hover:bg-accent/40"),children:t.jsx(y,{mark:t.jsx(W,{"aria-hidden":"true",className:h("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-90")}),name:e,details:t.jsx(J,{parts:[`${s.length} runs`,S,"all completed",u>0?`${u} ${u===1?"item":"items"}`:null]}),at:a})}),o?t.jsx("div",{className:"ml-6 border-l pl-2",children:s.map(m=>t.jsx("div",{className:"mb-1",children:t.jsx(L,{run:m,ownerSlug:n,columns:i})},m.id))}):null]})}function L({run:e,ownerSlug:s,columns:n={}}){const i=I(),o=p(e.created_at),c=p(e.completed_at),a=o!=null&&c!=null?Math.round((c-o)/1e3):null,l=j(e,n),r=n.startedBy&&R(e)?t.jsx(ne,{run:e,ownerSlug:s}):null,u=[["status",ee[e.status]??C(e.status)],e.error_message?["error",t.jsx(te,{error:e.error_message},"error")]:null,e.items_collected!=null&&(e.run_type==="sync"||e.items_collected>0)?["items",`${e.items_collected} ${e.items_collected===1?"item":"items"}`]:null,a!=null?["duration",V(a)]:null,r?["by",r]:null,e.connector_version?["version",`v${e.connector_version}`]:null,["id",`#${e.id}`]].filter(d=>d!==null);return t.jsxs("article",{"aria-label":`Run #${e.id}`,title:K(e.created_at),className:"group relative flex items-center rounded-lg transition-colors hover:bg-accent/40",children:[t.jsx("div",{className:h(w,"min-w-0 flex-1"),children:t.jsx(y,{mark:t.jsx(Z,{status:e.status}),name:t.jsx(v,{to:"/$owner/events",params:{owner:s},search:{run_ids:String(e.id)},"aria-label":`${l} · Run #${e.id}`,className:"hover:underline",onClick:d=>{!i||d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||(d.preventDefault(),i.open({href:e.run_type==="automation"&&e.automation_id!=null?`/${s}/automations/${e.automation_id}?view=activity&run_id=${e.id}`:`/${s}/events?run_ids=${e.id}`,title:`Run #${e.id}`,runId:e.id}))},children:l}),tone:e.status==="failed"||e.status==="timeout"?"destructive":null,details:t.jsx(ae,{parts:u}),at:o,atClassName:"group-hover:invisible group-focus-within:invisible"})}),t.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:[e.checkpoint?t.jsx(se,{checkpoint:e.checkpoint}):null,t.jsx(Q,{ownerSlug:s,scope:{kind:"run",id:e.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})]})]})}function de({runs:e,ownerSlug:s,columns:n={},emptyState:i,hasNextPage:o=!1,isFetching:c=!1,isFetchingNextPage:a=!1,onLoadMore:l=()=>{}}){return t.jsx(q,{items:re(e,n).map(r=>r.kind==="run"?{key:String(r.run.id),occurredAt:r.run.created_at,content:t.jsx(L,{run:r.run,ownerSlug:s,columns:n})}:{key:`group:${r.runs[0].id}`,occurredAt:r.runs[0].created_at,content:t.jsx(oe,{name:r.name,runs:r.runs,ownerSlug:s,columns:n})}),isLoading:!1,emptyState:i,hasNextPage:o,isFetching:c,isFetchingNextPage:a,onLoadMore:l})}export{L as R,Q as V,de as a};
2
+ //# sourceMappingURL=runs-list-DUXRMkWN.js.map
@@ -1,3 +1,3 @@
1
- import{j as i,e7 as w,i as L,L as A,fX as D,fY as $}from"./index-DByaMzsG.js";const U=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,O=/^\d{4}-\d{2}-\d{2}$/;function T(t){return U.test(t)}function S(t){if(!/^https?:\/\//i.test(t))return!1;try{const r=new URL(t);return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}}function N(t){return t.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function p(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:t>=1e3?"compact":"standard",maximumFractionDigits:t>=1e9?1:0}).format(t)}function h(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function b(t){const r=new Date(O.test(t)?`${t}T00:00:00`:t);return Number.isNaN(r.getTime())?t:r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function g(t){try{const r=new URL(t),n=r.hostname.replace(/^www\./i,""),e=r.pathname&&r.pathname!=="/"?r.pathname.replace(/\/$/,""):"";return`${n}${e}`}catch{return t}}function m(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(d(t)):Array.isArray(t)?t.some(r=>typeof r=="object"&&r!==null)?t.map((r,n)=>`${n+1}. ${m(r)}`).join(`
2
- `):JSON.stringify(t):typeof t=="object"?Object.entries(t).filter(([,n])=>n!=null&&n!=="").map(([n,e])=>`${N(n)}: ${m(e)}`).join("; "):JSON.stringify(t)}function d(t,r){if(t==null)return"";if(typeof t=="boolean")return t?"Yes":"No";if(typeof t=="number")return r==="currency"?p(t):r===void 0||r==="text"?String(t):h(t);if(typeof t!="string")return m(t);switch(r){case"currency":return p(Number(t));case"date":return b(t);case"url":return g(t);case"enum":return N(t);case"number":return h(Number(t));case"auto":return S(t)?g(t):T(t)?b(t):t;default:return t}}function E(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}function P(t,r){return typeof t!="string"||!t.startsWith("@")||t.length===1?null:{action:t.slice(1),value:E(r)}}function k(t){return i.jsx("a",{...t})}const F=/^\d{4}-\d{2}-\d{2}$/;function I(t){if(F.test(t)){const[r,n,e]=t.split("-").map(Number),s=new Date(0);return s.setHours(0,0,0,0),s.setFullYear(r,n-1,e),s}return new Date(t)}function C(t,r){const n=I(t);return Number.isNaN(n.getTime())?t:r?n.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):w(n,"LLL dd, y")}function x(t){return t?t["x-currency"]||t.format==="currency"?"currency":t.format==="uri"||t.format==="url"?"url":t.enum?.length?"enum":t.type==="number"||t.type==="integer"?"number":t.type==="boolean"?"boolean":"auto":"auto"}function j(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function V(t){return Array.isArray(t)&&t.some(r=>typeof r=="object"&&r!==null)}function Y(t,r,n){const e=$(r,t);return e!==void 0?e:typeof t=="string"&&(r?.format==="date"||r?.format==="date-time")?C(t,r.format==="date-time"):d(t,n)}function y(t,r){return!r||t===null||typeof t!="object"?t:Array.isArray(t)?t.map(n=>y(n,r.items)):Object.fromEntries(Object.entries(t).filter(([n])=>!D(r.properties?.[n])).map(([n,e])=>[n,y(e,r.properties?.[n])]))}function l({value:t,prop:r,format:n,resolveLink:e,className:s}){const c=String(t),o=e?.(c);if(o)return i.jsx(A,{to:o.to,className:"text-primary hover:underline",onClick:a=>a.stopPropagation(),children:o.label});const u=typeof t=="string"&&S(t),f=n==="url"&&!u?c:Y(t,r,n);return u?i.jsx(k,{href:t,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline [overflow-wrap:anywhere]",onClick:a=>a.stopPropagation(),children:f}):i.jsx("span",{className:s,children:f})}function R({value:t,prop:r,format:n,resolveLink:e,empty:s="-",className:c}){if(j(t))return i.jsx("span",{className:"text-muted-foreground",children:s});if(V(t)){const o=t.length;return i.jsxs("span",{className:c,children:[o," ",o===1?"item":"items"]})}if(Array.isArray(t)){const o=t.filter(f=>!j(f)),u=r?.items??r;return i.jsx("span",{className:L("inline-flex flex-wrap gap-x-1",c),children:o.map((f,a)=>i.jsxs("span",{children:[i.jsx(l,{value:f,prop:u,format:n??x(u),resolveLink:e}),a<o.length-1&&","]},`${a}:${String(f)}`))})}return typeof t=="object"?i.jsx("span",{className:c,children:d(y(t,r))}):i.jsx(l,{value:t,prop:r,format:n??x(r),resolveLink:e,className:c})}export{R as S,C as a,d as f,S as i,I as p,P as t};
3
- //# sourceMappingURL=schema-value-zTJGE4eh.js.map
1
+ import{j as i,ea as w,i as L,L as A,gb as D,gc as $}from"./index-BoqrvLHQ.js";const U=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,O=/^\d{4}-\d{2}-\d{2}$/;function T(t){return U.test(t)}function S(t){if(!/^https?:\/\//i.test(t))return!1;try{const r=new URL(t);return r.protocol==="http:"||r.protocol==="https:"}catch{return!1}}function N(t){return t.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function p(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:t>=1e3?"compact":"standard",maximumFractionDigits:t>=1e9?1:0}).format(t)}function g(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function h(t){const r=new Date(O.test(t)?`${t}T00:00:00`:t);return Number.isNaN(r.getTime())?t:r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function b(t){try{const r=new URL(t),n=r.hostname.replace(/^www\./i,""),e=r.pathname&&r.pathname!=="/"?r.pathname.replace(/\/$/,""):"";return`${n}${e}`}catch{return t}}function m(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(d(t)):Array.isArray(t)?t.some(r=>typeof r=="object"&&r!==null)?t.map((r,n)=>`${n+1}. ${m(r)}`).join(`
2
+ `):JSON.stringify(t):typeof t=="object"?Object.entries(t).filter(([,n])=>n!=null&&n!=="").map(([n,e])=>`${N(n)}: ${m(e)}`).join("; "):JSON.stringify(t)}function d(t,r){if(t==null)return"";if(typeof t=="boolean")return t?"Yes":"No";if(typeof t=="number")return r==="currency"?p(t):r===void 0||r==="text"?String(t):g(t);if(typeof t!="string")return m(t);switch(r){case"currency":return p(Number(t));case"date":return h(t);case"url":return b(t);case"enum":return N(t);case"number":return g(Number(t));case"auto":return S(t)?b(t):T(t)?h(t):t;default:return t}}function E(t){return t==null?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}function R(t,r){return typeof t!="string"||!t.startsWith("@")||t.length===1?null:{action:t.slice(1),value:E(r)}}function k(t){return i.jsx("a",{...t})}const F=/^\d{4}-\d{2}-\d{2}$/;function I(t){if(F.test(t)){const[r,n,e]=t.split("-").map(Number),s=new Date(0);return s.setHours(0,0,0,0),s.setFullYear(r,n-1,e),s}return new Date(t)}function C(t,r){const n=I(t);return Number.isNaN(n.getTime())?t:r?n.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):w(n,"LLL dd, y")}function x(t){return t?t["x-currency"]||t.format==="currency"?"currency":t.format==="uri"||t.format==="url"?"url":t.enum?.length?"enum":t.type==="number"||t.type==="integer"?"number":t.type==="boolean"?"boolean":"auto":"auto"}function j(t){return t==null||t===""||Array.isArray(t)&&t.length===0}function V(t){return Array.isArray(t)&&t.some(r=>typeof r=="object"&&r!==null)}function _(t,r,n){const e=$(r,t);return e!==void 0?e:typeof t=="string"&&(r?.format==="date"||r?.format==="date-time")?C(t,r.format==="date-time"):d(t,n)}function y(t,r){return!r||t===null||typeof t!="object"?t:Array.isArray(t)?t.map(n=>y(n,r.items)):Object.fromEntries(Object.entries(t).filter(([n])=>!D(r.properties?.[n])).map(([n,e])=>[n,y(e,r.properties?.[n])]))}function l({value:t,prop:r,format:n,resolveLink:e,className:s}){const c=String(t),o=e?.(c);if(o)return i.jsx(A,{to:o.to,className:"text-primary hover:underline",onClick:a=>a.stopPropagation(),children:o.label});const u=typeof t=="string"&&S(t),f=n==="url"&&!u?c:_(t,r,n);return u?i.jsx(k,{href:t,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline [overflow-wrap:anywhere]",onClick:a=>a.stopPropagation(),children:f}):i.jsx("span",{className:s,children:f})}function Y({value:t,prop:r,format:n,resolveLink:e,empty:s="-",className:c}){if(j(t))return i.jsx("span",{className:"text-muted-foreground",children:s});if(V(t)){const o=t.length;return i.jsxs("span",{className:c,children:[o," ",o===1?"item":"items"]})}if(Array.isArray(t)){const o=t.filter(f=>!j(f)),u=r?.items??r;return i.jsx("span",{className:L("inline-flex flex-wrap gap-x-1",c),children:o.map((f,a)=>i.jsxs("span",{children:[i.jsx(l,{value:f,prop:u,format:n??x(u),resolveLink:e}),a<o.length-1&&","]},`${a}:${String(f)}`))})}return typeof t=="object"?i.jsx("span",{className:c,children:d(y(t,r))}):i.jsx(l,{value:t,prop:r,format:n??x(r),resolveLink:e,className:c})}export{Y as S,C as a,d as f,S as i,I as p,R as t};
3
+ //# sourceMappingURL=schema-value-wjqGxXhv.js.map
@@ -1,2 +1,2 @@
1
- import{j as t,L as m,A as u,n as p,cM as x,x as f,r as h,e0 as v}from"./index-DByaMzsG.js";import{e as g,f as c,c as j}from"./event-kind-options-fHAIXu24.js";import{o as b,F as N,b as y}from"./filter-editors-CQoSj-20.js";const F="h-8 rounded-md border border-input bg-muted text-sm";function E(i,{platforms:e}={}){const{isMember:o}=p(),n=o?i:null,{data:r=[]}=x(n),{data:a=[]}=f(n?{organizationId:n}:void 0);return h.useMemo(()=>j({connectors:r,entityTypes:a,selectedPlatforms:e}),[r,a,e])}function L({owner:i,organizationId:e,activitySearch:o,kinds:n,onKindsChange:r,platforms:a}){const l=n??[],s=l.length>0?{semantic_types:l.join(",")}:{};return t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[r?t.jsx(O,{organizationId:e,kinds:l,onKindsChange:r,platforms:a}):t.jsx("span",{className:"flex-1"}),t.jsxs(m,{to:"/$owner/events",params:{owner:i},search:{...o,...s},className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Open in Activity",t.jsx(u,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]})]})}function O({organizationId:i,kinds:e,onKindsChange:o,platforms:n}){const r=E(i,{platforms:n}),a={key:"kind",label:"Event kind",icon:t.jsx(v,{className:"h-4 w-4"}),editor:b({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:g(r,e).map(s=>({value:s,label:c(s)})),selected:e,multiple:!0,onSelect:s=>o(e.includes(s)?e.filter(d=>d!==s):[...e,s])})},l=e.length>0?[{id:"kind",label:"Kind",value:e.length<=2?e.map(c).join(", "):`${e.length} kinds`,title:e.map(c).join(", "),onRemove:()=>o([])}]:[];return t.jsxs(t.Fragment,{children:[t.jsx(N,{label:"Feed filters",menu:!1,fields:[a],chips:l,className:"flex-1"}),t.jsx(y,{fields:[a],triggerClassName:F})]})}export{L as S};
2
- //# sourceMappingURL=scoped-feed-bar-BKyJSa3_.js.map
1
+ import{j as t,L as m,A as u,n as p,cM as x,x as f,r as h,e3 as v}from"./index-BoqrvLHQ.js";import{e as g,f as c,c as j}from"./event-kind-options-fHAIXu24.js";import{o as b,F as N,b as y}from"./filter-editors-DGVl9U4D.js";const F="h-8 rounded-md border border-input bg-muted text-sm";function E(i,{platforms:e}={}){const{isMember:o}=p(),n=o?i:null,{data:r=[]}=x(n),{data:a=[]}=f(n?{organizationId:n}:void 0);return h.useMemo(()=>j({connectors:r,entityTypes:a,selectedPlatforms:e}),[r,a,e])}function L({owner:i,organizationId:e,activitySearch:o,kinds:n,onKindsChange:r,platforms:a}){const l=n??[],s=l.length>0?{semantic_types:l.join(",")}:{};return t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[r?t.jsx(O,{organizationId:e,kinds:l,onKindsChange:r,platforms:a}):t.jsx("span",{className:"flex-1"}),t.jsxs(m,{to:"/$owner/events",params:{owner:i},search:{...o,...s},className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Open in Activity",t.jsx(u,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]})]})}function O({organizationId:i,kinds:e,onKindsChange:o,platforms:n}){const r=E(i,{platforms:n}),a={key:"kind",label:"Event kind",icon:t.jsx(v,{className:"h-4 w-4"}),editor:b({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:g(r,e).map(s=>({value:s,label:c(s)})),selected:e,multiple:!0,onSelect:s=>o(e.includes(s)?e.filter(d=>d!==s):[...e,s])})},l=e.length>0?[{id:"kind",label:"Kind",value:e.length<=2?e.map(c).join(", "):`${e.length} kinds`,title:e.map(c).join(", "),onRemove:()=>o([])}]:[];return t.jsxs(t.Fragment,{children:[t.jsx(N,{label:"Feed filters",menu:!1,fields:[a],chips:l,className:"flex-1"}),t.jsx(y,{fields:[a],triggerClassName:F})]})}export{L as S};
2
+ //# sourceMappingURL=scoped-feed-bar-DNFL0sYX.js.map
@@ -1,2 +1,2 @@
1
- import{H as l,j as e,B as t,L as i,T as c,at as o,au as d}from"./index-DByaMzsG.js";import{F as m}from"./full-page-spinner-CYyCnKve.js";function h(){const{session:a,isReady:n}=l();if(!n)return e.jsx(m,{});if(!a?.user)return e.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Account settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to view your profile and account details."}),e.jsx(t,{asChild:!0,children:e.jsx(i,{to:"/auth/login",search:c({intent:"sign-in",callbackUrl:"/account/settings"}),children:"Sign in"})})]});const{user:s}=a,r=s.name?.trim()||"User";return e.jsx(o,{className:"py-8",children:e.jsxs(d,{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Account settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your personal profile and sign-in details."})]}),e.jsxs("section",{"aria-labelledby":"account-profile-heading",className:"space-y-5 border-b border-border pb-8",children:[e.jsx("h2",{id:"account-profile-heading",className:"text-sm font-medium",children:"Profile"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.image?e.jsx("img",{src:s.image,alt:"",referrerPolicy:"no-referrer",className:"h-12 w-12 shrink-0 rounded-full object-cover"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted text-lg font-medium",children:(s.name?.trim()||s.email||"U").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"break-words font-medium",children:r}),e.jsx("p",{className:"break-all text-sm text-muted-foreground",children:s.email})]})]}),e.jsxs("details",{className:"space-y-3",children:[e.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Account details"}),e.jsxs("dl",{className:"space-y-1 text-sm",children:[e.jsx("dt",{className:"text-muted-foreground",children:"User ID"}),e.jsx("dd",{className:"break-all font-mono text-xs",children:s.id})]})]})]}),e.jsxs("section",{"aria-labelledby":"account-session-heading",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:"account-session-heading",className:"text-sm font-medium",children:"Session"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."})]}),e.jsx(t,{variant:"outline",asChild:!0,children:e.jsx(i,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
2
- //# sourceMappingURL=settings-z02cvVS3.js.map
1
+ import{H as l,j as e,B as t,L as i,T as c,at as o,au as d}from"./index-BoqrvLHQ.js";import{F as m}from"./full-page-spinner-CtVlF8GQ.js";function h(){const{session:a,isReady:n}=l();if(!n)return e.jsx(m,{});if(!a?.user)return e.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Account settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to view your profile and account details."}),e.jsx(t,{asChild:!0,children:e.jsx(i,{to:"/auth/login",search:c({intent:"sign-in",callbackUrl:"/account/settings"}),children:"Sign in"})})]});const{user:s}=a,r=s.name?.trim()||"User";return e.jsx(o,{className:"py-8",children:e.jsxs(d,{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Account settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your personal profile and sign-in details."})]}),e.jsxs("section",{"aria-labelledby":"account-profile-heading",className:"space-y-5 border-b border-border pb-8",children:[e.jsx("h2",{id:"account-profile-heading",className:"text-sm font-medium",children:"Profile"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.image?e.jsx("img",{src:s.image,alt:"",referrerPolicy:"no-referrer",className:"h-12 w-12 shrink-0 rounded-full object-cover"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted text-lg font-medium",children:(s.name?.trim()||s.email||"U").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"break-words font-medium",children:r}),e.jsx("p",{className:"break-all text-sm text-muted-foreground",children:s.email})]})]}),e.jsxs("details",{className:"space-y-3",children:[e.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Account details"}),e.jsxs("dl",{className:"space-y-1 text-sm",children:[e.jsx("dt",{className:"text-muted-foreground",children:"User ID"}),e.jsx("dd",{className:"break-all font-mono text-xs",children:s.id})]})]})]}),e.jsxs("section",{"aria-labelledby":"account-session-heading",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:"account-session-heading",className:"text-sm font-medium",children:"Session"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."})]}),e.jsx(t,{variant:"outline",asChild:!0,children:e.jsx(i,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
2
+ //# sourceMappingURL=settings-V0m5Om5j.js.map
@@ -1,2 +1,2 @@
1
- import{M as j,z as _,fN as C,j as e,B as N,fO as F,m as L,K as E,L as w,fe as S,Q as $}from"./index-DByaMzsG.js";import{a as P,R as A,b as M}from"./events-feed-DmRzikZW.js";import{a as k}from"./run-initiator-DhE5v4z0.js";function b(r){return{failed:r.filter(i=>i.code!=="withheld"),withheld:[...new Set(r.filter(i=>i.code==="withheld").map(i=>i.error))]}}function v({reasons:r}){return r.length===0?null:e.jsx("div",{className:"space-y-1",children:r.map(i=>e.jsx("p",{className:"text-xs text-muted-foreground",children:i},i))})}function y({failures:r,onRetry:i,isError:c=!1,isFetching:d=!1}){return r.length===0&&!c?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[r.length<=1?"A source":`${r.length} sources`," could not be read, so some items may be missing."]}),e.jsx(N,{size:"sm",variant:"outline",className:"h-7",onClick:i,disabled:d,children:"Retry"})]})}function O({record:r,orgContext:i,filters:c}){const{orgContext:d}=j(),s=i??d,{data:m}=_({queryKey:["connector-definitions","source-record",s.organizationId,s.slug],queryFn:()=>$(s),enabled:!!(s.organizationId||s.slug),staleTime:6e4}),{data:n,isLoading:h,isError:a,refetch:g,fetchNextPage:l,hasNextPage:p,isFetching:x,isFetchingNextPage:u}=C(r,s,c),f=n?.pages.flatMap(o=>o.events)??[],{failed:t,withheld:R}=b(n?.pages.flatMap(o=>o.failures)??[]);return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(y,{failures:t,isError:a,isFetching:x,onRetry:()=>void g()}),e.jsx(v,{reasons:R}),e.jsx(k,{isLoading:h,hasNextPage:!!p&&!a,autoLoadMore:t.length===0,isFetching:x,isFetchingNextPage:u,onLoadMore:()=>void l(),emptyState:a||t.length>0||p?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:f.map(o=>({key:`${o.feed_id}:${o.origin_id}`,occurredAt:o.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:s.slug,connectorDefinitions:m,content:{...o,title:o.title||o.origin_type||o.origin_id,text_content:o.payload_text??""}})})}))})]})}function q({record:r,ownerSlug:i,orgContext:c}){const{orgContext:d}=j(),{data:s,isLoading:m,isError:n,refetch:h,hasNextPage:a,fetchNextPage:g,isFetching:l,isFetchNextPageError:p,error:x}=F(r,c??d);if(m)return e.jsx(L,{className:"h-12 w-full rounded-lg"});if(!s)return e.jsx(y,{failures:[],isError:!0,isFetching:l,onRetry:()=>void h()});const{failed:u,withheld:f}=b(s.failures);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(A,{count:s.relationshipFailures?.length??0,onRetry:()=>void h()}),e.jsx(y,{failures:u,isError:n,isFetching:l,onRetry:()=>{if(l)return;const t=x instanceof E&&x.status===400;p&&!t||!n&&a?g():h()}}),e.jsx(v,{reasons:f}),s.links.length===0&&(s.relationships?.length??0)===0&&u.length===0&&(s.relationshipFailures?.length??0)===0&&!a&&!n&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),s.links.length===0&&(s.relationships?.length??0)===0&&a&&!n&&u.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(s.relationships??[]).map(t=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx(M,{row:t,entityId:r.key,entityType:r.type,ownerSlug:i,orgContext:c??d})},`authored:${t.id}`)),s.links.map(t=>e.jsx("li",{children:e.jsx(w,{to:S(i,[{entity_type:t.entity_type,slug:t.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.relationship_type.replaceAll("_"," "),t.direction==="incoming"?" (from)":""," ·"," ",t.entity_type," ·"," "]}),t.name]})})},`${t.relationship_type}:${t.direction}:${t.entity_type}:${t.key}`))]}),a&&!n&&u.length===0&&e.jsx(N,{variant:"outline",size:"sm",disabled:l,onClick:()=>void g(),children:l?"Loading…":"Load more"})]})}export{O as S,q as a};
2
- //# sourceMappingURL=source-record-panels-CGmKIJdN.js.map
1
+ import{M as j,z as _,f$ as C,j as e,B as N,g0 as F,m as L,K as E,L as $,fu as w,Q as S}from"./index-BoqrvLHQ.js";import{a as P,R as A,b as M}from"./events-feed-DcKTkJVe.js";import{a as k}from"./run-initiator-BKSgI1o0.js";function b(r){return{failed:r.filter(i=>i.code!=="withheld"),withheld:[...new Set(r.filter(i=>i.code==="withheld").map(i=>i.error))]}}function v({reasons:r}){return r.length===0?null:e.jsx("div",{className:"space-y-1",children:r.map(i=>e.jsx("p",{className:"text-xs text-muted-foreground",children:i},i))})}function y({failures:r,onRetry:i,isError:c=!1,isFetching:d=!1}){return r.length===0&&!c?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[r.length<=1?"A source":`${r.length} sources`," could not be read, so some items may be missing."]}),e.jsx(N,{size:"sm",variant:"outline",className:"h-7",onClick:i,disabled:d,children:"Retry"})]})}function q({record:r,orgContext:i,filters:c}){const{orgContext:d}=j(),s=i??d,{data:m}=_({queryKey:["connector-definitions","source-record",s.organizationId,s.slug],queryFn:()=>S(s),enabled:!!(s.organizationId||s.slug),staleTime:6e4}),{data:n,isLoading:h,isError:a,refetch:g,fetchNextPage:l,hasNextPage:p,isFetching:x,isFetchingNextPage:u}=C(r,s,c),f=n?.pages.flatMap(o=>o.events)??[],{failed:t,withheld:R}=b(n?.pages.flatMap(o=>o.failures)??[]);return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(y,{failures:t,isError:a,isFetching:x,onRetry:()=>void g()}),e.jsx(v,{reasons:R}),e.jsx(k,{isLoading:h,hasNextPage:!!p&&!a,autoLoadMore:t.length===0,isFetching:x,isFetchingNextPage:u,onLoadMore:()=>void l(),emptyState:a||t.length>0||p?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:f.map(o=>({key:`${o.feed_id}:${o.origin_id}`,occurredAt:o.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:s.slug,connectorDefinitions:m,content:{...o,title:o.title||o.origin_type||o.origin_id,text_content:o.payload_text??""}})})}))})]})}function K({record:r,ownerSlug:i,orgContext:c}){const{orgContext:d}=j(),{data:s,isLoading:m,isError:n,refetch:h,hasNextPage:a,fetchNextPage:g,isFetching:l,isFetchNextPageError:p,error:x}=F(r,c??d);if(m)return e.jsx(L,{className:"h-12 w-full rounded-lg"});if(!s)return e.jsx(y,{failures:[],isError:!0,isFetching:l,onRetry:()=>void h()});const{failed:u,withheld:f}=b(s.failures);return e.jsxs("div",{className:"space-y-2",children:[e.jsx(A,{count:s.relationshipFailures?.length??0,onRetry:()=>void h()}),e.jsx(y,{failures:u,isError:n,isFetching:l,onRetry:()=>{if(l)return;const t=x instanceof E&&x.status===400;p&&!t||!n&&a?g():h()}}),e.jsx(v,{reasons:f}),s.links.length===0&&(s.relationships?.length??0)===0&&u.length===0&&(s.relationshipFailures?.length??0)===0&&!a&&!n&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),s.links.length===0&&(s.relationships?.length??0)===0&&a&&!n&&u.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(s.relationships??[]).map(t=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx(M,{row:t,entityId:r.key,entityType:r.type,ownerSlug:i,orgContext:c??d})},`authored:${t.id}`)),s.links.map(t=>e.jsx("li",{children:e.jsx($,{to:w(i,[{entity_type:t.entity_type,slug:t.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.relationship_type.replaceAll("_"," "),t.direction==="incoming"?" (from)":""," ·"," ",t.entity_type," ·"," "]}),t.name]})})},`${t.relationship_type}:${t.direction}:${t.entity_type}:${t.key}`))]}),a&&!n&&u.length===0&&e.jsx(N,{variant:"outline",size:"sm",disabled:l,onClick:()=>void g(),children:l?"Loading…":"Load more"})]})}export{q as S,K as a};
2
+ //# sourceMappingURL=source-record-panels-BMut9YIA.js.map
@@ -1,2 +1,2 @@
1
- import{j as t,i as s,bL as a}from"./index-DByaMzsG.js";const u=a("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),i=a("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function b({className:e,status:r,showDot:n=!0,children:d,...g}){return t.jsxs("span",{className:s(u({status:r}),e),...g,children:[n&&t.jsx("span",{className:i({status:r})}),d]})}const l=new Set(["error","failed","revoked"]);function x(e){return e==="active"?"active":e==="paused"?"paused":e==="pending"||e==="pending_auth"?"pending":l.has(e)?"error":"default"}export{b as S,x as g};
2
- //# sourceMappingURL=status-variants-DyRCXBzM.js.map
1
+ import{j as t,i as s,bL as a}from"./index-BoqrvLHQ.js";const u=a("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),i=a("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function b({className:e,status:r,showDot:n=!0,children:d,...g}){return t.jsxs("span",{className:s(u({status:r}),e),...g,children:[n&&t.jsx("span",{className:i({status:r})}),d]})}const l=new Set(["error","failed","revoked"]);function x(e){return e==="active"?"active":e==="paused"?"paused":e==="pending"||e==="pending_auth"?"pending":l.has(e)?"error":"default"}export{b as S,x as g};
2
+ //# sourceMappingURL=status-variants-SzXYYedJ.js.map
@@ -0,0 +1,2 @@
1
+ import{fT as o}from"./index-BoqrvLHQ.js";function f(s,a,r){return o(s,-a,r)}export{f as s};
2
+ //# sourceMappingURL=subDays-9s9OEl5t.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,j as l,i as o}from"./index-DByaMzsG.js";const r=t.forwardRef(({className:e,...a},s)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:s,className:o("w-full caption-bottom text-sm",e),...a})}));r.displayName="Table";const d=t.forwardRef(({className:e,...a},s)=>l.jsx("thead",{ref:s,className:o("[&_tr]:border-b",e),...a}));d.displayName="TableHeader";const c=t.forwardRef(({className:e,...a},s)=>l.jsx("tbody",{ref:s,className:o("[&_tr:last-child]:border-0",e),...a}));c.displayName="TableBody";const b=t.forwardRef(({className:e,...a},s)=>l.jsx("tr",{ref:s,className:o("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));b.displayName="TableRow";const m=t.forwardRef(({className:e,...a},s)=>l.jsx("th",{ref:s,className:o("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));m.displayName="TableHead";const i=t.forwardRef(({className:e,...a},s)=>l.jsx("td",{ref:s,className:o("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));i.displayName="TableCell";export{r as T,d as a,b,m as c,c as d,i as e};
2
- //# sourceMappingURL=table-C637cQxG.js.map
1
+ import{r as t,j as l,i as o}from"./index-BoqrvLHQ.js";const r=t.forwardRef(({className:e,...a},s)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:s,className:o("w-full caption-bottom text-sm",e),...a})}));r.displayName="Table";const d=t.forwardRef(({className:e,...a},s)=>l.jsx("thead",{ref:s,className:o("[&_tr]:border-b",e),...a}));d.displayName="TableHeader";const c=t.forwardRef(({className:e,...a},s)=>l.jsx("tbody",{ref:s,className:o("[&_tr:last-child]:border-0",e),...a}));c.displayName="TableBody";const b=t.forwardRef(({className:e,...a},s)=>l.jsx("tr",{ref:s,className:o("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...a}));b.displayName="TableRow";const m=t.forwardRef(({className:e,...a},s)=>l.jsx("th",{ref:s,className:o("h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));m.displayName="TableHead";const i=t.forwardRef(({className:e,...a},s)=>l.jsx("td",{ref:s,className:o("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a}));i.displayName="TableCell";export{r as T,d as a,b,m as c,c as d,i as e};
2
+ //# sourceMappingURL=table-ZuYMOjVR.js.map
@@ -1,2 +1,2 @@
1
- import{z as u,dG as c,dH as s,y as r,E as l,dI as o}from"./index-DByaMzsG.js";function y(){return u({queryKey:["automation-catalog"],queryFn:async()=>(await o("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(t,e,i){return u({queryKey:["automations-list",t,e,i?.includeDetails??!0],queryFn:async()=>(await o("manage_automations",{action:"list",entity_id:e,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!t,staleTime:3e4})}function _(t,e,i,a={}){const n=c(a.ownerSlug);return u({queryKey:["automation-detail",n,t,e,a.includeVersions??!1],queryFn:async()=>await o("get_automation",{automation_id:t,entity_id:e,page_size:1,include_versions:a.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!t&&!!(a.ownerSlug||i),staleTime:3e4})}const A=s({tool:"manage_automations",body:t=>({action:"update",...t}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),q=s({tool:"manage_automations",body:t=>({action:"trigger",automation_id:t}),invalidateKeys:["automations-list","automation-detail","automations","runs-infinite"],errorMessage:"Failed to run Automation"}),v=s({tool:"manage_automations",body:t=>({action:"delete",automation_ids:[t]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),K=s({tool:"manage_automations",body:t=>({action:"create",...t}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function f(){const t=r();return l({mutationFn:async e=>o("manage_automations",{action:"create_version",...e}),onSuccess:()=>{t.invalidateQueries({queryKey:["automations-list"]}),t.invalidateQueries({queryKey:["automation-detail"]}),t.invalidateQueries({queryKey:["automations"]})}})}function M(){const t=r();return l({mutationFn:async e=>o("manage_automations",{action:"set_reaction_script",...e}),onSuccess:()=>{t.invalidateQueries({queryKey:["automations-list"]}),t.invalidateQueries({queryKey:["automation-detail"]}),t.invalidateQueries({queryKey:["automations"]})}})}export{_ as a,v as b,K as c,f as d,M as e,A as f,y as g,q as h,g as u};
2
- //# sourceMappingURL=use-automations-CgWNoYio.js.map
1
+ import{z as u,dJ as c,dK as s,y as r,E as l,dL as o}from"./index-BoqrvLHQ.js";function y(){return u({queryKey:["automation-catalog"],queryFn:async()=>(await o("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(t,e,i){return u({queryKey:["automations-list",t,e,i?.includeDetails??!0],queryFn:async()=>(await o("manage_automations",{action:"list",entity_id:e,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!t,staleTime:3e4})}function _(t,e,i,a={}){const n=c(a.ownerSlug);return u({queryKey:["automation-detail",n,t,e,a.includeVersions??!1],queryFn:async()=>await o("get_automation",{automation_id:t,entity_id:e,page_size:1,include_versions:a.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!t&&!!(a.ownerSlug||i),staleTime:3e4})}const A=s({tool:"manage_automations",body:t=>({action:"update",...t}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),q=s({tool:"manage_automations",body:t=>({action:"trigger",automation_id:t}),invalidateKeys:["automations-list","automation-detail","automations","runs-infinite"],errorMessage:"Failed to run Automation"}),v=s({tool:"manage_automations",body:t=>({action:"delete",automation_ids:[t]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),K=s({tool:"manage_automations",body:t=>({action:"create",...t}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function f(){const t=r();return l({mutationFn:async e=>o("manage_automations",{action:"create_version",...e}),onSuccess:()=>{t.invalidateQueries({queryKey:["automations-list"]}),t.invalidateQueries({queryKey:["automation-detail"]}),t.invalidateQueries({queryKey:["automations"]})}})}function M(){const t=r();return l({mutationFn:async e=>o("manage_automations",{action:"set_reaction_script",...e}),onSuccess:()=>{t.invalidateQueries({queryKey:["automations-list"]}),t.invalidateQueries({queryKey:["automation-detail"]}),t.invalidateQueries({queryKey:["automations"]})}})}export{_ as a,v as b,K as c,f as d,M as e,A as f,y as g,q as h,g as u};
2
+ //# sourceMappingURL=use-automations-DfBtVzGa.js.map
@@ -1,2 +1,2 @@
1
- import{r as d,j as e,a7 as U,i as R,a8 as D,B as W,a9 as B,aa as I,ab as T,ac as V,a1 as q,ad as G}from"./index-DByaMzsG.js";import{C as K,a as J,b as Q,d as X,c as Y}from"./card-DtLIFq7D.js";function z(s){if(!s)return null;try{const t=new URL(s);return t.protocol==="https:"&&t.hostname?t.toString():null}catch{return null}}function _(s){const t=z(s);if(!t)return null;const a=new URL(t).hostname.toLowerCase();return a.length>0&&a.length<=253&&/^[a-z0-9.-]+$/.test(a)?a:null}function Z({clientName:s,logoUri:t=null,clientUri:a=null}){const[r,i]=d.useState(!1),[o,p]=d.useState(!1),g=r?null:z(t),j=o?null:_(a)??_(t);return g?e.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",onError:()=>i(!0),className:"h-10 w-10 shrink-0 rounded-md object-contain"}):j?e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(j)}&sz=64`,alt:"",referrerPolicy:"no-referrer",onError:()=>p(!0),className:"h-10 w-10 shrink-0 rounded-md bg-secondary object-contain"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-secondary text-base font-bold text-secondary-foreground",children:(s??"?").charAt(0).toUpperCase()||"?"})}const H=["mcp:read","mcp:write","mcp:admin"],ee=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],L={read:0,write:1,admin:2};function F(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function se(s,t){const a=s.filter(i=>!H.includes(i));if(!t)return a;const r=F(s);return!r||L[t]>L[r]?a:["mcp:read",...t==="write"||t==="admin"?["mcp:write"]:[],...t==="admin"?["mcp:admin"]:[],...a]}function ie({idPrefix:s,clientName:t,clientNote:a,requestedScopes:r,accessLevel:i,onAccessLevelChange:o,allowNoAccess:p=!1,disabled:g=!1,resource:j=null,logoUri:w=null,clientUri:h=null}){const y=F(r),x=r.includes("profile:read"),m=r.filter(c=>!H.includes(c)&&c!=="profile:read"&&c!=="device_worker:run"&&c!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsx("section",{"aria-label":"Application",className:"space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Z,{clientName:t,logoUri:w,clientUri:h}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t||"Unnamed application"}),a?e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a}):null,j&&e.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5",children:[e.jsx("p",{children:"Requesting access to"}),r.length>0&&e.jsx("p",{className:"flex flex-wrap gap-1.5",children:r.map(c=>e.jsx("span",{className:"px-1 py-0.5 font-mono text-[11px] text-foreground",children:c},c))})]}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:e.jsxs("p",{children:["on"," ",e.jsx("code",{className:"break-all rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:j})]})})]})]})]})}),x&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(U,{variant:"secondary",children:"Always included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to. This is separate from the workspace data access below."})]})]}),y&&e.jsxs("fieldset",{className:"space-y-2",disabled:g,children:[e.jsx("legend",{className:"text-sm font-medium",children:"What should this client have access to?"}),e.jsxs("div",{className:"space-y-2",children:[p?e.jsxs("label",{htmlFor:`${s}-access-none`,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",i===null&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:`${s}-access-none`,type:"radio",name:`${s}-access-level`,value:"none",checked:i===null,onChange:()=>o(null),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:"No workspace data access"}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:"Pair the device only. It won't read or write workspace data."})]})]}):null,ee.filter(c=>L[c.value]<=L[y]).map(c=>{const f=`${s}-access-${c.value}`,b=i===c.value;return e.jsxs("label",{htmlFor:f,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:f,type:"radio",name:`${s}-access-level`,value:c.value,checked:b,onChange:()=>o(c.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.title,c.risk==="high"&&e.jsx(D,{"aria-label":"High risk",className:"h-3.5 w-3.5 shrink-0 text-destructive",children:e.jsx("title",{children:"High risk"})})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:c.description})]})]},c.value)})]})]}),m.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:m.map(c=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:c},c))})]})]})}function oe({summary:s,children:t,className:a}){return e.jsxs("div",{className:R("flex flex-wrap items-center gap-3 border-t pt-4",s?"justify-between":"justify-end",a),children:[s?e.jsx("p",{className:"text-sm text-muted-foreground",children:s}):null,e.jsx("div",{className:"ml-auto flex items-center gap-3",children:t})]})}function de({busy:s,approveLabel:t="Approve",approveDisabled:a=!1,denyDisabled:r=!1,onApprove:i,onDeny:o}){return e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"outline",onClick:o,disabled:r,children:s==="deny"?"Denying...":"Deny"}),e.jsx(W,{type:"button",onClick:i,disabled:a,children:s==="approve"?"Approving...":t})]})}function me({title:s,description:t,busy:a=!1,error:r=null,review:i,aside:o,below:p,notice:g,footer:j,live:w=!1}){return e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(K,{className:R("w-full",o?"max-w-4xl":"max-w-lg"),role:w?"status":void 0,"aria-live":w?"polite":void 0,children:[e.jsxs(J,{children:[e.jsx(Q,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(X,{children:t}):null]}),e.jsxs(Y,{className:"space-y-5","aria-busy":a,children:[o?e.jsxs("div",{className:"grid gap-6 md:grid-cols-[minmax(0,1fr)_300px]",children:[e.jsx("div",{className:"min-w-0",children:i}),e.jsx("div",{className:"min-w-0",children:o})]}):i,p,g,r?e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:r}):null,j]})]})})}function ue({resourceOrg:s,accessLevel:t}){return e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",s]}),e.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"If this workspace is public, the app can read public data immediately after approval."}),t==="write"?e.jsx("li",{children:"If you are not already a member, this connection will stay read-only. Ask an organization admin to grant write access, then reconnect the MCP client."}):null,t==="admin"?e.jsx("li",{children:"If you are not already an admin or owner, elevated actions will stay blocked. Ask an organization owner to grant the required role, then reconnect the MCP client."}):null,t==="read"?e.jsx("li",{children:"Public read access does not require membership."}):null]})]})}function te(s){const t=q(s);return t.kind==="cross-host"?t.href:t.to}function pe({idPrefix:s,heading:t,orgList:a,selectedOrgIds:r,onWorkspaceAccessChange:i,onSelectedOrgChange:o,orgsLoading:p,orgsError:g,onRetry:j,disabled:w=!1,includedOrgId:h=null,allowMultiple:y}){const x=`${s}-workspace-access-legend`,m=`${s}-workspace-search`,[c,f]=d.useState(""),b=t??"Workspace access",N=h?a.find(n=>n.id===h)??null:null,k=a.filter(n=>n.id!==h),$=r.filter(n=>n!==h).length,A=h?$:r.length,E=k.length>0&&k.every(n=>r.includes(n.id));if(p)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]});if(g)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:j,children:"Retry"})]})]});if(a.length===0)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]});const M=()=>{if(E)for(const n of k)o(n.id,!1);else i("all_current")},S=c.trim().toLowerCase(),l=S?k.filter(n=>n.name.toLowerCase().includes(S)||n.slug.toLowerCase().includes(S)):k;return e.jsxs("fieldset",{className:"min-w-0 space-y-3",disabled:w,children:[e.jsx("legend",{id:x,className:"sr-only",children:b}),e.jsxs("p",{className:"text-sm font-medium",children:[b," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",A," selected"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-md border bg-card",children:[e.jsxs("div",{className:"border-b bg-card p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),y&&k.length>0&&e.jsx("button",{type:"button",onClick:M,className:"shrink-0 cursor-pointer bg-none p-0 text-xs font-semibold text-foreground underline underline-offset-4",children:E?"Clear all":`Select all ${k.length}`})]}),!h&&e.jsx("p",{className:"mt-0.5 whitespace-nowrap text-sm text-muted-foreground",children:y?"Choose workspaces for this app.":"Choose one workspace this application can access."}),e.jsx("input",{id:m,type:"search",value:c,onChange:n=>f(n.target.value),placeholder:"Filter workspaces…","aria-label":"Filter workspaces",className:"mt-2 flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.jsxs("div",{className:"max-h-80 space-y-1.5 overflow-auto p-2",children:[N?e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md bg-muted px-2.5 py-2",children:[e.jsx(B,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:N.name}),N.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})}),e.jsx(U,{variant:"secondary",className:"shrink-0",children:"Device home"})]})}),e.jsx("span",{className:"sr-only",children:"Included"})]}):null,l.map(n=>{const u=`${s}-workspace-${n.id}`,v=r.includes(n.id);return e.jsxs("div",{className:R("flex items-center gap-2.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted/60",v&&"bg-primary/5 hover:bg-primary/5"),children:[e.jsx(T,{id:u,checked:v,disabled:w,onCheckedChange:C=>o(n.id,C===!0)}),e.jsx("label",{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:n.name}),n.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})})]})}),e.jsx("a",{href:te(n.slug),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),"aria-label":`Open ${n.name} workspace`,title:`Open ${n.name} workspace`,className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(V,{className:"h-3.5 w-3.5"})})]},n.id)}),l.length===0&&!N&&e.jsx("p",{className:"px-2 py-3 text-[13px] text-muted-foreground",children:"No workspaces match."})]}),e.jsx("div",{className:"border-t bg-card px-3 py-2 text-xs text-muted-foreground",children:e.jsx("p",{"aria-live":"polite",children:h?`${$} additional workspace${$===1?"":"s"} selected.`:`${r.length} of ${a.length} workspaces selected.`})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function ne(s,t){return s.length===t.length&&s.every((a,r)=>a===t[r])}function re(s={}){const{requireDeviceHome:t=!1,deviceHomeOrgId:a=null,allowMultiple:r=!0}=s,{data:i,error:o,isPending:p,refetch:g}=G(),[j,w]=d.useState("selected"),[h,y]=d.useState([]),x=d.useRef(!1),m=d.useMemo(()=>i?i.filter(l=>l.is_member).map(l=>({id:l.id,name:l.name,slug:l.slug,isPersonal:l.is_personal===!0})):[],[i]),c=m.find(l=>l.isPersonal)?.id??null,f=t?a&&m.some(l=>l.id===a)?a:c:null,b=d.useRef(m);b.current=m;const N=o instanceof Error?o.message:o?"Unable to load workspaces":null;d.useEffect(()=>{if(p||N)return;const l=m.map(u=>u.id),n=new Set(l);y(u=>{const v=x.current?u.filter(C=>n.has(C)):[c??l[0]].filter(C=>!!C);return x.current=!0,ne(u,v)?u:v})},[m,N,p,c]);const k=d.useCallback(l=>{if(l==="all_current"){if(!r)return;y(b.current.map(n=>n.id))}w(l)},[r]),$=d.useCallback((l,n)=>{b.current.some(u=>u.id===l)&&(t&&(l===f||!r)||(w("selected"),y(u=>n?r?u.includes(l)?u:[...u,l]:[l]:u.filter(v=>v!==l))))},[r,f,t]),A=d.useMemo(()=>{if(t&&f&&!r)return[f];const l=new Set(h);return t&&f&&l.add(f),m.filter(n=>l.has(n.id)).map(n=>n.id)},[r,h,f,m,t]),E=d.useCallback(()=>{const l=b.current,n=l.find(u=>u.isPersonal)?.id??l[0]?.id;x.current=l.length>0,w("selected"),y(n?[n]:[])},[]),M=!p&&!N&&m.length>0&&A.length>0&&(r||A.length===1)&&(!t||f!==null&&A.includes(f)),S=d.useCallback(()=>{g()},[g]);return{orgList:m,workspaceAccess:j,setWorkspaceAccess:k,selectedOrgIds:A,toggleSelectedOrgId:$,resetWorkspaceSelection:E,personalOrgId:c,deviceHomeOrgId:f,orgsLoading:p,orgsError:N,retryOrgs:S,workspaceSelectionReady:M}}function ae(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}function he({requestedScopes:s,resource:t=null,allowMultiple:a,requireDeviceHome:r=!1,deviceHomeOrgId:i=null}){const o=F(s),[p,g]=d.useState(o);d.useEffect(()=>{g(F(s))},[s]);const j=d.useMemo(()=>se(s,p),[s,p]),w=d.useMemo(()=>ae(t),[t]),h=j.some(m=>m.startsWith("mcp:")),y=h&&!w,x=re({allowMultiple:a,requireDeviceHome:r,deviceHomeOrgId:i});return{accessLevel:p,setAccessLevel:g,selectedScopes:j,resourceOrg:w,hasMcpScopes:h,requiresWorkspaceAccess:y,...x}}function P(s){return typeof s=="string"&&s.length>0?s:null}function xe(s,t){return P(s?.error_description)??P(s?.message)??P(s?.error)??t}function O(s=window.location.href){const t=new URL("/auth/login",window.location.origin);return t.searchParams.set("callbackUrl",s),t.toString()}function fe(){window.location.href=O()}function ge(s,t){d.useEffect(()=>{t||s||(window.location.href=O())},[s,t])}export{ie as A,me as C,ue as R,pe as W,ge as a,oe as b,de as c,F as g,xe as o,fe as r,he as u};
2
- //# sourceMappingURL=use-login-redirect-tDdhXTpt.js.map
1
+ import{r as d,j as e,a7 as U,i as R,a8 as D,B as W,a9 as B,aa as I,ab as T,ac as V,a1 as q,ad as G}from"./index-BoqrvLHQ.js";import{C as K,a as J,b as Q,d as X,c as Y}from"./card-CAPpY9P5.js";function z(s){if(!s)return null;try{const t=new URL(s);return t.protocol==="https:"&&t.hostname?t.toString():null}catch{return null}}function _(s){const t=z(s);if(!t)return null;const a=new URL(t).hostname.toLowerCase();return a.length>0&&a.length<=253&&/^[a-z0-9.-]+$/.test(a)?a:null}function Z({clientName:s,logoUri:t=null,clientUri:a=null}){const[r,i]=d.useState(!1),[o,p]=d.useState(!1),g=r?null:z(t),j=o?null:_(a)??_(t);return g?e.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",onError:()=>i(!0),className:"h-10 w-10 shrink-0 rounded-md object-contain"}):j?e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(j)}&sz=64`,alt:"",referrerPolicy:"no-referrer",onError:()=>p(!0),className:"h-10 w-10 shrink-0 rounded-md bg-secondary object-contain"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-secondary text-base font-bold text-secondary-foreground",children:(s??"?").charAt(0).toUpperCase()||"?"})}const H=["mcp:read","mcp:write","mcp:admin"],ee=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],L={read:0,write:1,admin:2};function F(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function se(s,t){const a=s.filter(i=>!H.includes(i));if(!t)return a;const r=F(s);return!r||L[t]>L[r]?a:["mcp:read",...t==="write"||t==="admin"?["mcp:write"]:[],...t==="admin"?["mcp:admin"]:[],...a]}function ie({idPrefix:s,clientName:t,clientNote:a,requestedScopes:r,accessLevel:i,onAccessLevelChange:o,allowNoAccess:p=!1,disabled:g=!1,resource:j=null,logoUri:w=null,clientUri:h=null}){const y=F(r),x=r.includes("profile:read"),m=r.filter(c=>!H.includes(c)&&c!=="profile:read"&&c!=="device_worker:run"&&c!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsx("section",{"aria-label":"Application",className:"space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Z,{clientName:t,logoUri:w,clientUri:h}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t||"Unnamed application"}),a?e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a}):null,j&&e.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5",children:[e.jsx("p",{children:"Requesting access to"}),r.length>0&&e.jsx("p",{className:"flex flex-wrap gap-1.5",children:r.map(c=>e.jsx("span",{className:"px-1 py-0.5 font-mono text-[11px] text-foreground",children:c},c))})]}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:e.jsxs("p",{children:["on"," ",e.jsx("code",{className:"break-all rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:j})]})})]})]})]})}),x&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(U,{variant:"secondary",children:"Always included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to. This is separate from the workspace data access below."})]})]}),y&&e.jsxs("fieldset",{className:"space-y-2",disabled:g,children:[e.jsx("legend",{className:"text-sm font-medium",children:"What should this client have access to?"}),e.jsxs("div",{className:"space-y-2",children:[p?e.jsxs("label",{htmlFor:`${s}-access-none`,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",i===null&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:`${s}-access-none`,type:"radio",name:`${s}-access-level`,value:"none",checked:i===null,onChange:()=>o(null),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:"No workspace data access"}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:"Pair the device only. It won't read or write workspace data."})]})]}):null,ee.filter(c=>L[c.value]<=L[y]).map(c=>{const f=`${s}-access-${c.value}`,b=i===c.value;return e.jsxs("label",{htmlFor:f,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:f,type:"radio",name:`${s}-access-level`,value:c.value,checked:b,onChange:()=>o(c.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.title,c.risk==="high"&&e.jsx(D,{"aria-label":"High risk",className:"h-3.5 w-3.5 shrink-0 text-destructive",children:e.jsx("title",{children:"High risk"})})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:c.description})]})]},c.value)})]})]}),m.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:m.map(c=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:c},c))})]})]})}function oe({summary:s,children:t,className:a}){return e.jsxs("div",{className:R("flex flex-wrap items-center gap-3 border-t pt-4",s?"justify-between":"justify-end",a),children:[s?e.jsx("p",{className:"text-sm text-muted-foreground",children:s}):null,e.jsx("div",{className:"ml-auto flex items-center gap-3",children:t})]})}function de({busy:s,approveLabel:t="Approve",approveDisabled:a=!1,denyDisabled:r=!1,onApprove:i,onDeny:o}){return e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"outline",onClick:o,disabled:r,children:s==="deny"?"Denying...":"Deny"}),e.jsx(W,{type:"button",onClick:i,disabled:a,children:s==="approve"?"Approving...":t})]})}function me({title:s,description:t,busy:a=!1,error:r=null,review:i,aside:o,below:p,notice:g,footer:j,live:w=!1}){return e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(K,{className:R("w-full",o?"max-w-4xl":"max-w-lg"),role:w?"status":void 0,"aria-live":w?"polite":void 0,children:[e.jsxs(J,{children:[e.jsx(Q,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(X,{children:t}):null]}),e.jsxs(Y,{className:"space-y-5","aria-busy":a,children:[o?e.jsxs("div",{className:"grid gap-6 md:grid-cols-[minmax(0,1fr)_300px]",children:[e.jsx("div",{className:"min-w-0",children:i}),e.jsx("div",{className:"min-w-0",children:o})]}):i,p,g,r?e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:r}):null,j]})]})})}function ue({resourceOrg:s,accessLevel:t}){return e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",s]}),e.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"If this workspace is public, the app can read public data immediately after approval."}),t==="write"?e.jsx("li",{children:"If you are not already a member, this connection will stay read-only. Ask an organization admin to grant write access, then reconnect the MCP client."}):null,t==="admin"?e.jsx("li",{children:"If you are not already an admin or owner, elevated actions will stay blocked. Ask an organization owner to grant the required role, then reconnect the MCP client."}):null,t==="read"?e.jsx("li",{children:"Public read access does not require membership."}):null]})]})}function te(s){const t=q(s);return t.kind==="cross-host"?t.href:t.to}function pe({idPrefix:s,heading:t,orgList:a,selectedOrgIds:r,onWorkspaceAccessChange:i,onSelectedOrgChange:o,orgsLoading:p,orgsError:g,onRetry:j,disabled:w=!1,includedOrgId:h=null,allowMultiple:y}){const x=`${s}-workspace-access-legend`,m=`${s}-workspace-search`,[c,f]=d.useState(""),b=t??"Workspace access",N=h?a.find(n=>n.id===h)??null:null,k=a.filter(n=>n.id!==h),$=r.filter(n=>n!==h).length,A=h?$:r.length,E=k.length>0&&k.every(n=>r.includes(n.id));if(p)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]});if(g)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:j,children:"Retry"})]})]});if(a.length===0)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]});const M=()=>{if(E)for(const n of k)o(n.id,!1);else i("all_current")},S=c.trim().toLowerCase(),l=S?k.filter(n=>n.name.toLowerCase().includes(S)||n.slug.toLowerCase().includes(S)):k;return e.jsxs("fieldset",{className:"min-w-0 space-y-3",disabled:w,children:[e.jsx("legend",{id:x,className:"sr-only",children:b}),e.jsxs("p",{className:"text-sm font-medium",children:[b," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",A," selected"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-md border bg-card",children:[e.jsxs("div",{className:"border-b bg-card p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),y&&k.length>0&&e.jsx("button",{type:"button",onClick:M,className:"shrink-0 cursor-pointer bg-none p-0 text-xs font-semibold text-foreground underline underline-offset-4",children:E?"Clear all":`Select all ${k.length}`})]}),!h&&e.jsx("p",{className:"mt-0.5 whitespace-nowrap text-sm text-muted-foreground",children:y?"Choose workspaces for this app.":"Choose one workspace this application can access."}),e.jsx("input",{id:m,type:"search",value:c,onChange:n=>f(n.target.value),placeholder:"Filter workspaces…","aria-label":"Filter workspaces",className:"mt-2 flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.jsxs("div",{className:"max-h-80 space-y-1.5 overflow-auto p-2",children:[N?e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md bg-muted px-2.5 py-2",children:[e.jsx(B,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:N.name}),N.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})}),e.jsx(U,{variant:"secondary",className:"shrink-0",children:"Device home"})]})}),e.jsx("span",{className:"sr-only",children:"Included"})]}):null,l.map(n=>{const u=`${s}-workspace-${n.id}`,v=r.includes(n.id);return e.jsxs("div",{className:R("flex items-center gap-2.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted/60",v&&"bg-primary/5 hover:bg-primary/5"),children:[e.jsx(T,{id:u,checked:v,disabled:w,onCheckedChange:C=>o(n.id,C===!0)}),e.jsx("label",{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:n.name}),n.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})})]})}),e.jsx("a",{href:te(n.slug),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),"aria-label":`Open ${n.name} workspace`,title:`Open ${n.name} workspace`,className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(V,{className:"h-3.5 w-3.5"})})]},n.id)}),l.length===0&&!N&&e.jsx("p",{className:"px-2 py-3 text-[13px] text-muted-foreground",children:"No workspaces match."})]}),e.jsx("div",{className:"border-t bg-card px-3 py-2 text-xs text-muted-foreground",children:e.jsx("p",{"aria-live":"polite",children:h?`${$} additional workspace${$===1?"":"s"} selected.`:`${r.length} of ${a.length} workspaces selected.`})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function ne(s,t){return s.length===t.length&&s.every((a,r)=>a===t[r])}function re(s={}){const{requireDeviceHome:t=!1,deviceHomeOrgId:a=null,allowMultiple:r=!0}=s,{data:i,error:o,isPending:p,refetch:g}=G(),[j,w]=d.useState("selected"),[h,y]=d.useState([]),x=d.useRef(!1),m=d.useMemo(()=>i?i.filter(l=>l.is_member).map(l=>({id:l.id,name:l.name,slug:l.slug,isPersonal:l.is_personal===!0})):[],[i]),c=m.find(l=>l.isPersonal)?.id??null,f=t?a&&m.some(l=>l.id===a)?a:c:null,b=d.useRef(m);b.current=m;const N=o instanceof Error?o.message:o?"Unable to load workspaces":null;d.useEffect(()=>{if(p||N)return;const l=m.map(u=>u.id),n=new Set(l);y(u=>{const v=x.current?u.filter(C=>n.has(C)):[c??l[0]].filter(C=>!!C);return x.current=!0,ne(u,v)?u:v})},[m,N,p,c]);const k=d.useCallback(l=>{if(l==="all_current"){if(!r)return;y(b.current.map(n=>n.id))}w(l)},[r]),$=d.useCallback((l,n)=>{b.current.some(u=>u.id===l)&&(t&&(l===f||!r)||(w("selected"),y(u=>n?r?u.includes(l)?u:[...u,l]:[l]:u.filter(v=>v!==l))))},[r,f,t]),A=d.useMemo(()=>{if(t&&f&&!r)return[f];const l=new Set(h);return t&&f&&l.add(f),m.filter(n=>l.has(n.id)).map(n=>n.id)},[r,h,f,m,t]),E=d.useCallback(()=>{const l=b.current,n=l.find(u=>u.isPersonal)?.id??l[0]?.id;x.current=l.length>0,w("selected"),y(n?[n]:[])},[]),M=!p&&!N&&m.length>0&&A.length>0&&(r||A.length===1)&&(!t||f!==null&&A.includes(f)),S=d.useCallback(()=>{g()},[g]);return{orgList:m,workspaceAccess:j,setWorkspaceAccess:k,selectedOrgIds:A,toggleSelectedOrgId:$,resetWorkspaceSelection:E,personalOrgId:c,deviceHomeOrgId:f,orgsLoading:p,orgsError:N,retryOrgs:S,workspaceSelectionReady:M}}function ae(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}function he({requestedScopes:s,resource:t=null,allowMultiple:a,requireDeviceHome:r=!1,deviceHomeOrgId:i=null}){const o=F(s),[p,g]=d.useState(o);d.useEffect(()=>{g(F(s))},[s]);const j=d.useMemo(()=>se(s,p),[s,p]),w=d.useMemo(()=>ae(t),[t]),h=j.some(m=>m.startsWith("mcp:")),y=h&&!w,x=re({allowMultiple:a,requireDeviceHome:r,deviceHomeOrgId:i});return{accessLevel:p,setAccessLevel:g,selectedScopes:j,resourceOrg:w,hasMcpScopes:h,requiresWorkspaceAccess:y,...x}}function P(s){return typeof s=="string"&&s.length>0?s:null}function xe(s,t){return P(s?.error_description)??P(s?.message)??P(s?.error)??t}function O(s=window.location.href){const t=new URL("/auth/login",window.location.origin);return t.searchParams.set("callbackUrl",s),t.toString()}function fe(){window.location.href=O()}function ge(s,t){d.useEffect(()=>{t||s||(window.location.href=O())},[s,t])}export{ie as A,me as C,ue as R,pe as W,ge as a,oe as b,de as c,F as g,xe as o,fe as r,he as u};
2
+ //# sourceMappingURL=use-login-redirect-BDiS3eyl.js.map