@lobu/runtime-server 24.5.0 → 24.6.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 (235) hide show
  1. package/dist/catalogs/connectors.json +342 -4
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/linkedin-identity.ts +43 -0
  5. package/dist/connectors/linkedin.ts +154 -3
  6. package/dist/connectors/x-like-follow.ts +329 -0
  7. package/dist/connectors/x.ts +709 -80
  8. package/dist/dependencies.bun.lock +18 -18
  9. package/dist/owletto/dist/assets/_-DT3E3BmS.js +3 -0
  10. package/dist/owletto/dist/assets/_-c1xy7bLu.js +2 -0
  11. package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +2 -0
  12. package/dist/owletto/dist/assets/_agentId-DV8utajn.js +2 -0
  13. package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +2 -0
  14. package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +2 -0
  15. package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +2 -0
  16. package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +2 -0
  17. package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +2 -0
  18. package/dist/owletto/dist/assets/_name-CM1AMywz.js +2 -0
  19. package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +3 -0
  20. package/dist/owletto/dist/assets/_shape-DGAkETDp.js +2 -0
  21. package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +2 -0
  22. package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +2 -0
  23. package/dist/owletto/dist/assets/_view-B5I7mmkl.js +2 -0
  24. package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +2 -0
  26. package/dist/owletto/dist/assets/{accept-invitation-pUl-c1KQ.js → accept-invitation-CQZQ0wwC.js} +2 -2
  27. package/dist/owletto/dist/assets/{activity-route-view-DN0ZEAzr.js → activity-route-view-CZykJXQp.js} +2 -2
  28. package/dist/owletto/dist/assets/{agent-card-controls-C5jNWgfq.js → agent-card-controls-DuQJhtqp.js} +2 -2
  29. package/dist/owletto/dist/assets/{agent-client-setup-list-DbXtJTsO.js → agent-client-setup-list-CpUTAjXf.js} +2 -2
  30. package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-Br_ycC0z.js} +2 -2
  31. package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +2 -0
  32. package/dist/owletto/dist/assets/{agent-guardrails-route-BJyfalBY.js → agent-guardrails-route-CN7vpC0X.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-list-row-rF5LH-3k.js → agent-list-row-BnP6r4pm.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-loading-shells-ClY_O6lb.js → agent-loading-shells-_18OREnx.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-permissions-matrix-bP1Qihv7.js → agent-permissions-matrix-DSjidWHL.js} +2 -2
  36. package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-1DBn7Xc_.js} +2 -2
  37. package/dist/owletto/dist/assets/{agent-skills-route-Bv5luNdw.js → agent-skills-route-d5jh3oBR.js} +2 -2
  38. package/dist/owletto/dist/assets/{agent-tab-intro-ednTs4WF.js → agent-tab-intro-DKrC3SQt.js} +2 -2
  39. package/dist/owletto/dist/assets/{agent-thread-WNk2HapT.js → agent-thread-FyEO-y44.js} +3 -3
  40. package/dist/owletto/dist/assets/agents-kXojozTU.js +2 -0
  41. package/dist/owletto/dist/assets/{agents-workbench-bPTjdVS1.js → agents-workbench-CDpJmUVN.js} +2 -2
  42. package/dist/owletto/dist/assets/{app._appId-DrL5H5lB.js → app._appId-DwNeXRJp.js} +2 -2
  43. package/dist/owletto/dist/assets/{assist-composer-ClfFEVx7.js → assist-composer-Mn9EfX4X.js} +2 -2
  44. package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +2 -0
  45. package/dist/owletto/dist/assets/{automation-row-DCHM--aD.js → automation-row-B5Q1B10y.js} +2 -2
  46. package/dist/owletto/dist/assets/automation-source-list-Dhucq1sI.js +2 -0
  47. package/dist/owletto/dist/assets/automations-kXojozTU.js +2 -0
  48. package/dist/owletto/dist/assets/{callback-DRABUOha.js → callback-9xSHyA12.js} +2 -2
  49. package/dist/owletto/dist/assets/{card-Bdi7VEwo.js → card-g4yxo4Hr.js} +2 -2
  50. package/dist/owletto/dist/assets/{change-summary-PBoM6Asb.js → change-summary-DeuXQEpb.js} +2 -2
  51. package/dist/owletto/dist/assets/{claim-CUIG1Oc-.js → claim-B98IhDra.js} +2 -2
  52. package/dist/owletto/dist/assets/{client-activity-scopes-CXOWB5co.js → client-activity-scopes-BD2HBo-_.js} +2 -2
  53. package/dist/owletto/dist/assets/{client-rows-36VnmgMK.js → client-rows-x_CxeWkP.js} +2 -2
  54. package/dist/owletto/dist/assets/{clients-BJRcMk1A.js → clients-Cmp0LmOp.js} +2 -2
  55. package/dist/owletto/dist/assets/connect-menu-CezOH3s7.js +2 -0
  56. package/dist/owletto/dist/assets/connect-zUot_0kG.js +2 -0
  57. package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +2 -0
  58. package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +2 -0
  59. package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +2 -0
  60. package/dist/owletto/dist/assets/{connected._clientId.index-jSnGvzYs.js → connected._clientId.index-DBNP2mZo.js} +2 -2
  61. package/dist/owletto/dist/assets/{connection-q1bdnxCN.js → connection-B6fM2KHN.js} +2 -2
  62. package/dist/owletto/dist/assets/{connection-feed-detail-BIlkK0Pd.js → connection-feed-detail-Ckq-qEbD.js} +2 -2
  63. package/dist/owletto/dist/assets/{connections-browser-V-3td9DB.js → connections-browser-BXsJqieG.js} +2 -2
  64. package/dist/owletto/dist/assets/{connector-boxes-lFc-WP83.js → connector-boxes-CbqSFeVm.js} +2 -2
  65. package/dist/owletto/dist/assets/{connector-page-shell-Cs1SjrYB.js → connector-page-shell-Di6XzkVo.js} +2 -2
  66. package/dist/owletto/dist/assets/{connector-provenance-aJFeeRIC.js → connector-provenance-BrnasBW4.js} +2 -2
  67. package/dist/owletto/dist/assets/{connector-scope-lists--vNdbOn0.js → connector-scope-lists-dQnZARCD.js} +2 -2
  68. package/dist/owletto/dist/assets/{connectors-BsvDMdsQ.js → connectors-DnOUxX_U.js} +2 -2
  69. package/dist/owletto/dist/assets/{consent-DJV78pnz.js → consent-Byli4yMs.js} +2 -2
  70. package/dist/owletto/dist/assets/{copy-button-DjMWgrBf.js → copy-button-Ddf7lBjZ.js} +2 -2
  71. package/dist/owletto/dist/assets/{core.esm-CQzL3ObT.js → core.esm-BsXtvNoI.js} +2 -2
  72. package/dist/owletto/dist/assets/create-B34eskZ_.js +2 -0
  73. package/dist/owletto/dist/assets/create-DLB9sXgU.js +2 -0
  74. package/dist/owletto/dist/assets/{create-jBEuveV1.js → create-YdAnh3ml.js} +2 -2
  75. package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +3 -0
  76. package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +2 -0
  77. package/dist/owletto/dist/assets/definition-comparison-B5WgZILB.js +2 -0
  78. package/dist/owletto/dist/assets/{device-Ba3RsIgb.js → device-DdCoCj-Q.js} +2 -2
  79. package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +2 -0
  80. package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +2 -0
  81. package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +2 -0
  82. package/dist/owletto/dist/assets/{entity-options-daOOQo7O.js → entity-options-BkU_En_f.js} +2 -2
  83. package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +2 -0
  84. package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +2 -0
  85. package/dist/owletto/dist/assets/entity-type-page-D0ghgRgq.js +2 -0
  86. package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +2 -0
  87. package/dist/owletto/dist/assets/{event-detail-DkY95e5b.js → event-detail-CmC-DVrK.js} +2 -2
  88. package/dist/owletto/dist/assets/{events-feed-B9CZHI_P.js → events-feed-CGzA1w3R.js} +2 -2
  89. package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +2 -0
  90. package/dist/owletto/dist/assets/{full-page-spinner-BqmckkOf.js → full-page-spinner-B5xXnKtV.js} +2 -2
  91. package/dist/owletto/dist/assets/guardrails-DkXatmea.js +2 -0
  92. package/dist/owletto/dist/assets/identity-BwJy3ixB.js +2 -0
  93. package/dist/owletto/dist/assets/{index--ZWegctR.js → index-35ehGReZ.js} +2 -2
  94. package/dist/owletto/dist/assets/index-B9hYiwBw.js +2 -0
  95. package/dist/owletto/dist/assets/{index-C186T2Rw.js → index-BDl1_w6U.js} +2 -2
  96. package/dist/owletto/dist/assets/{index-ijqrJaRB.js → index-BdNR51Ua.js} +2 -2
  97. package/dist/owletto/dist/assets/{index-DdBTTN3y.js → index-BjcZVe7n.js} +52 -52
  98. package/dist/owletto/dist/assets/{index-CsrT07TJ.js → index-BqAVebvY.js} +2 -2
  99. package/dist/owletto/dist/assets/index-BvK1fS1J.js +2 -0
  100. package/dist/owletto/dist/assets/{index-DdYWarql.css → index-CNEpTkgw.css} +1 -1
  101. package/dist/owletto/dist/assets/index-CRc73k1t.js +2 -0
  102. package/dist/owletto/dist/assets/index-CYGaSD3y.js +2 -0
  103. package/dist/owletto/dist/assets/index-CfZGe-zn.js +2 -0
  104. package/dist/owletto/dist/assets/{index-B0kw2lFL.js → index-CkiyxW4w.js} +2 -2
  105. package/dist/owletto/dist/assets/index-CzLDNB2E.js +2 -0
  106. package/dist/owletto/dist/assets/{index-BKrdVwW9.js → index-D-o5iOVd.js} +2 -2
  107. package/dist/owletto/dist/assets/index-DjYVV1Ml.js +2 -0
  108. package/dist/owletto/dist/assets/{index-ikp_mTsf.js → index-TkPy_P_u.js} +2 -2
  109. package/dist/owletto/dist/assets/index-VyAX-asP.js +2 -0
  110. package/dist/owletto/dist/assets/json-diff-DtZtra_g.js +28 -0
  111. package/dist/owletto/dist/assets/{list-skeleton-CXDLkYTg.js → list-skeleton-CIHWCi2a.js} +2 -2
  112. package/dist/owletto/dist/assets/{login-u6LCgDYG.js → login-TWR0vF4_.js} +2 -2
  113. package/dist/owletto/dist/assets/{logout-JhmuWJEH.js → logout-BA5kojS0.js} +2 -2
  114. package/dist/owletto/dist/assets/{manage-gear-D8LMhehh.js → manage-gear-C-0BAMbC.js} +2 -2
  115. package/dist/owletto/dist/assets/{member-scope-gate-4FQ0aanZ.js → member-scope-gate-BQiRAqtx.js} +2 -2
  116. package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +74 -0
  117. package/dist/owletto/dist/assets/{model-jL871x2J.js → model-C2q7WDcS.js} +2 -2
  118. package/dist/owletto/dist/assets/{model-selector-CgU8SJMF.js → model-selector-B2cjCn0V.js} +2 -2
  119. package/dist/owletto/dist/assets/models-CZkH5gtj.js +2 -0
  120. package/dist/owletto/dist/assets/{nav-pill-DrFkuyUQ.js → nav-pill-Bam6s3jj.js} +2 -2
  121. package/dist/owletto/dist/assets/new-BJst6K0b.js +2 -0
  122. package/dist/owletto/dist/assets/{new-DgE1pVV0.js → new-Dc5Bbotb.js} +2 -2
  123. package/dist/owletto/dist/assets/new-DgbivfDe.js +2 -0
  124. package/dist/owletto/dist/assets/{organization-CKM_oFX3.js → organization-B9U1L-56.js} +2 -2
  125. package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +2 -0
  126. package/dist/owletto/dist/assets/{pending-seed-sml8Uf6e.js → pending-seed-BP3xHM2d.js} +2 -2
  127. package/dist/owletto/dist/assets/{permissions-BvA9SATv.js → permissions-BVlbeY4u.js} +2 -2
  128. package/dist/owletto/dist/assets/proposal-review-shell-BED-DO9C.js +2 -0
  129. package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +2 -0
  130. package/dist/owletto/dist/assets/{record-activity-C9gVBbF0.js → record-activity-CTLwq8s1.js} +2 -2
  131. package/dist/owletto/dist/assets/{record-session-R-uHNuby.js → record-session-DOFgdd43.js} +2 -2
  132. package/dist/owletto/dist/assets/renderer-CHPS-1vD.js +96 -0
  133. package/dist/owletto/dist/assets/{reset-password-Mx3baeNc.js → reset-password-BmNM-apc.js} +2 -2
  134. package/dist/owletto/dist/assets/{run-activity-link-CaIBSRQj.js → run-activity-link-Dh1YyCfk.js} +2 -2
  135. package/dist/owletto/dist/assets/{run-initiator-BvzQJYW9.js → run-initiator-CCxNv0rK.js} +2 -2
  136. package/dist/owletto/dist/assets/{runs-fFJ1lPnw.js → runs-BntGAKQG.js} +2 -2
  137. package/dist/owletto/dist/assets/{runs-panel-DEnZHTa5.js → runs-panel-BwTVaRsE.js} +2 -2
  138. package/dist/owletto/dist/assets/{runs-table-XGnxJl7S.js → runs-table-CYS1jDdL.js} +2 -2
  139. package/dist/owletto/dist/assets/{schema-type-editor-panel-C0_9VcSs.js → schema-type-editor-panel-v3nR2Oa2.js} +2 -2
  140. package/dist/owletto/dist/assets/schema-value-BFb7jCBo.js +3 -0
  141. package/dist/owletto/dist/assets/settings-DBgT60nY.js +2 -0
  142. package/dist/owletto/dist/assets/{settings-CP4PjMQA.js → settings-DubSpJfg.js} +2 -2
  143. package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +2 -0
  144. package/dist/owletto/dist/assets/{source-record-panels-Bh0n4gGw.js → source-record-panels-m8gECt82.js} +2 -2
  145. package/dist/owletto/dist/assets/{status-dot-Cpq63I7p.js → status-dot-BnQPFrcU.js} +2 -2
  146. package/dist/owletto/dist/assets/{table-BUqshjxa.js → table-DALHuXPE.js} +2 -2
  147. package/dist/owletto/dist/assets/{use-automations-BLNjxq2K.js → use-automations-D9hKpufo.js} +2 -2
  148. package/dist/owletto/dist/assets/{use-login-redirect-CmyQW7GT.js → use-login-redirect-ciwfc-7A.js} +2 -2
  149. package/dist/owletto/dist/assets/{use-mention-search-dn3ws1WB.js → use-mention-search-CJGCatFS.js} +2 -2
  150. package/dist/owletto/dist/assets/{use-scroll-sentinel-DRyBMueA.js → use-scroll-sentinel-BWCrmNIB.js} +2 -2
  151. package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +2 -0
  152. package/dist/owletto/dist/assets/views-access-required-CZ1fvAks.js +2 -0
  153. package/dist/owletto/dist/index.html +2 -2
  154. package/dist/server-main.bundle.mjs +5596 -4000
  155. package/npm-shrinkwrap.json +99 -99
  156. package/package.json +1 -1
  157. package/vendor/connector-sdk/package.json +1 -1
  158. package/vendor/core/dist/contracts/tools/view-host.d.ts +7 -0
  159. package/vendor/core/dist/contracts/tools/view-host.js +28 -0
  160. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -4
  161. package/vendor/core/dist/contracts/tools/view-runtime.js +19 -7
  162. package/vendor/core/package.json +11 -1
  163. package/vendor/views/dist/api.d.ts +9 -4
  164. package/vendor/views/dist/api.js +33 -2
  165. package/vendor/views/dist/bridge.d.ts +8 -0
  166. package/vendor/views/dist/bridge.js +12 -2
  167. package/vendor/views/dist/components.d.ts +4 -2
  168. package/vendor/views/dist/components.js +29 -14
  169. package/vendor/views/dist/index.d.ts +1 -1
  170. package/vendor/views/dist/index.js +1 -1
  171. package/vendor/views/dist/native.d.ts +327 -0
  172. package/vendor/views/dist/native.js +57 -0
  173. package/vendor/views/package.json +1 -1
  174. package/dist/owletto/dist/assets/_-CCWuGXtQ.js +0 -2
  175. package/dist/owletto/dist/assets/_-DOJW1D-I.js +0 -3
  176. package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +0 -2
  177. package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +0 -2
  178. package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +0 -2
  179. package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +0 -2
  180. package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +0 -2
  181. package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +0 -2
  182. package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +0 -2
  183. package/dist/owletto/dist/assets/_name-D30_V03t.js +0 -2
  184. package/dist/owletto/dist/assets/_owner-Be8O41u8.js +0 -3
  185. package/dist/owletto/dist/assets/_shape-C6YbloRh.js +0 -2
  186. package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +0 -2
  187. package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +0 -2
  188. package/dist/owletto/dist/assets/_view-aoFDwEld.js +0 -2
  189. package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +0 -2
  190. package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +0 -2
  191. package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +0 -2
  192. package/dist/owletto/dist/assets/agents-DY2S2SGE.js +0 -2
  193. package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +0 -2
  194. package/dist/owletto/dist/assets/automations-DY2S2SGE.js +0 -2
  195. package/dist/owletto/dist/assets/calendar-Ck0yOLYu.js +0 -2
  196. package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +0 -16
  197. package/dist/owletto/dist/assets/connect-CMcEQWls.js +0 -2
  198. package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +0 -2
  199. package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +0 -2
  200. package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +0 -2
  201. package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +0 -2
  202. package/dist/owletto/dist/assets/create-BmKx5vq3.js +0 -2
  203. package/dist/owletto/dist/assets/create-Rt0RbiD4.js +0 -2
  204. package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +0 -3
  205. package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +0 -2
  206. package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +0 -2
  207. package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +0 -2
  208. package/dist/owletto/dist/assets/entity-avatar-TVKjZxWQ.js +0 -2
  209. package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +0 -2
  210. package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +0 -2
  211. package/dist/owletto/dist/assets/event-card-DVUB8my6.js +0 -2
  212. package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +0 -2
  213. package/dist/owletto/dist/assets/guardrails-Csusrok2.js +0 -2
  214. package/dist/owletto/dist/assets/identity-Dmg3STO8.js +0 -2
  215. package/dist/owletto/dist/assets/index-BUBcNNUY.js +0 -2
  216. package/dist/owletto/dist/assets/index-BUDr4-Yv.js +0 -2
  217. package/dist/owletto/dist/assets/index-BYPQWVwD.js +0 -2
  218. package/dist/owletto/dist/assets/index-BfpaPJPj.js +0 -2
  219. package/dist/owletto/dist/assets/index-BicNFLBW.js +0 -2
  220. package/dist/owletto/dist/assets/index-Bsdv5aks.js +0 -2
  221. package/dist/owletto/dist/assets/index-CX0pJ9j9.js +0 -2
  222. package/dist/owletto/dist/assets/index-JYEIN8nM.js +0 -2
  223. package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +0 -14
  224. package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +0 -74
  225. package/dist/owletto/dist/assets/models-jdemgIZk.js +0 -2
  226. package/dist/owletto/dist/assets/new-CcJOd5aH.js +0 -2
  227. package/dist/owletto/dist/assets/new-OWwrYckd.js +0 -2
  228. package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +0 -2
  229. package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +0 -2
  230. package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +0 -2
  231. package/dist/owletto/dist/assets/renderer-DXfJaCCa.js +0 -97
  232. package/dist/owletto/dist/assets/settings-CgaUJMHH.js +0 -2
  233. package/dist/owletto/dist/assets/skills-D-e_h3a9.js +0 -2
  234. package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +0 -2
  235. package/dist/owletto/dist/assets/views-access-required-C_b9itZ2.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a2 as v,r as a,j as e,L as h,a3 as j,Q as y,a4 as N}from"./index-DdBTTN3y.js";import{C as k,a as C,b as S,c as L}from"./card-Bdi7VEwo.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-Mx3baeNc.js.map
1
+ import{a2 as v,r as a,j as e,L as h,a3 as j,Q as y,a4 as N}from"./index-BjcZVe7n.js";import{C as k,a as C,b as S,c as L}from"./card-g4yxo4Hr.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-BmNM-apc.js.map
@@ -1,2 +1,2 @@
1
- import{u as o,j as t,B as n,L as c,cG as u,gx as h,dP as y}from"./index-DdBTTN3y.js";function f({owner:i,filters:a,name:e}){const r=o();return t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5",children:t.jsxs(c,{title:`View activity for ${e}`,to:"/$owner",params:{owner:i},search:y(a),onClick:s=>{!r||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),r.open({href:h(i,a),title:"Runs history"}))},children:[t.jsx(u,{className:"h-3.5 w-3.5"}),"View activity"]})})}export{f as R};
2
- //# sourceMappingURL=run-activity-link-CaIBSRQj.js.map
1
+ import{u as o,j as t,B as n,L as c,cG as u,gy as h,e2 as y}from"./index-BjcZVe7n.js";function f({owner:i,filters:a,name:e}){const r=o();return t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5",children:t.jsxs(c,{title:`View activity for ${e}`,to:"/$owner",params:{owner:i},search:y(a),onClick:s=>{!r||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),r.open({href:h(i,a),title:"Runs history"}))},children:[t.jsx(u,{className:"h-3.5 w-3.5"}),"View activity"]})})}export{f as R};
2
+ //# sourceMappingURL=run-activity-link-Dh1YyCfk.js.map
@@ -1,2 +1,2 @@
1
- import{v as k,eP as I,j as d,L as u,d_ as h}from"./index-DdBTTN3y.js";import{u as j}from"./use-automations-BLNjxq2K.js";import{u as b}from"./clients-BJRcMk1A.js";function C(n,e,o){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":e==="agent"?"an agent":o?`Automation ${o}`:"an Automation"}function B({ownerSlug:n,initiator:e,clientName:o,fallback:_}){const t=e?.client_id??o,{allOrgs:m,isAuthenticated:p}=k(),r=p&&m?.some(s=>s.slug===n),c=b(void 0,{ownerSlug:n,enabled:!!(t&&r)}).data?.find(s=>s.id===t)?.title,l=r?m.find(s=>s.slug===n)?.id:void 0,f=e?.kind==="automation"&&e.automation_id?String(e.automation_id):void 0,v=j(f?l:void 0,void 0,{includeDetails:!1}).data?.find(s=>s.automation_id===f)?.name,{members:x}=I(e?.kind==="user"&&e.user_id?l:void 0),$=x.find(s=>s.userId===e?.user_id)?.user.name,a=e&&e.kind!=="user"?v??C(e,void 0,e.automation_id===void 0?void 0:String(e.automation_id)):$??_,g="font-medium text-foreground",i=`${g} underline-offset-4 hover:underline`;return e?.kind==="automation"&&e.automation_id?d.jsx(u,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(e.automation_id)},search:{view:"definition",run_id:void 0},className:i,children:a}):e?.kind==="agent_session"&&e.agent_id?d.jsx(u,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:String(e.agent_id)},className:i,children:a}):t?d.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:n,clientId:t},className:`${i} inline-flex items-center gap-1 align-middle`,children:[d.jsx(h,{name:c??o??t}),c??a]}):d.jsx("span",{className:g,children:a})}export{B as R,C as p};
2
- //# sourceMappingURL=run-initiator-BvzQJYW9.js.map
1
+ import{v as k,eI as I,j as d,L as u,ed as h}from"./index-BjcZVe7n.js";import{u as j}from"./use-automations-D9hKpufo.js";import{u as b}from"./clients-Cmp0LmOp.js";function C(n,e,o){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":e==="agent"?"an agent":o?`Automation ${o}`:"an Automation"}function B({ownerSlug:n,initiator:e,clientName:o,fallback:_}){const t=e?.client_id??o,{allOrgs:m,isAuthenticated:p}=k(),r=p&&m?.some(s=>s.slug===n),c=b(void 0,{ownerSlug:n,enabled:!!(t&&r)}).data?.find(s=>s.id===t)?.title,l=r?m.find(s=>s.slug===n)?.id:void 0,f=e?.kind==="automation"&&e.automation_id?String(e.automation_id):void 0,v=j(f?l:void 0,void 0,{includeDetails:!1}).data?.find(s=>s.automation_id===f)?.name,{members:x}=I(e?.kind==="user"&&e.user_id?l:void 0),$=x.find(s=>s.userId===e?.user_id)?.user.name,a=e&&e.kind!=="user"?v??C(e,void 0,e.automation_id===void 0?void 0:String(e.automation_id)):$??_,g="font-medium text-foreground",i=`${g} underline-offset-4 hover:underline`;return e?.kind==="automation"&&e.automation_id?d.jsx(u,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(e.automation_id)},search:{view:"definition",run_id:void 0},className:i,children:a}):e?.kind==="agent_session"&&e.agent_id?d.jsx(u,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:String(e.agent_id)},className:i,children:a}):t?d.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:n,clientId:t},className:`${i} inline-flex items-center gap-1 align-middle`,children:[d.jsx(h,{name:c??o??t}),c??a]}):d.jsx("span",{className:g,children:a})}export{B as R,C as p};
2
+ //# sourceMappingURL=run-initiator-CCxNv0rK.js.map
@@ -1,2 +1,2 @@
1
- import{el as r,cO as s,cP as c,cQ as l,a3 as g,em as I}from"./index-DdBTTN3y.js";const f=30,m=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 v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?_(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return l("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}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:f},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>m.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}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 P(n,e){const{slug:i}=s(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return c({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(I(i,t),{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:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{P as a,v as u};
2
- //# sourceMappingURL=runs-fFJ1lPnw.js.map
1
+ import{el as r,cO as s,cP as c,cQ as l,a3 as g,em as I}from"./index-BjcZVe7n.js";const f=30,m=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 v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?_(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return l("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}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:f},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>m.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}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 P(n,e){const{slug:i}=s(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return c({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(I(i,t),{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:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{P as a,v as u};
2
+ //# sourceMappingURL=runs-BntGAKQG.js.map
@@ -1,2 +1,2 @@
1
- import{at as T,aH as M,cD as w,j as o,ct as k,cU as g,dM as B,i as E,dN as C,cT as _,cS as O,cz as U,c as z,w as H,dO as W,dP as D,r as x,B as R,ab as G}from"./index-DdBTTN3y.js";import{u as q}from"./use-scroll-sentinel-DRyBMueA.js";import{u as J}from"./runs-fFJ1lPnw.js";import{o as K,F as Q,S as V}from"./filter-bar-wPaR12SS.js";import{M as p,c as X,u as Y,a as Z}from"./manage-gear-D8LMhehh.js";import{R as ee,a as ne}from"./runs-table-XGnxJl7S.js";function te(t){const{org:l}=T(t?.ownerSlug),h=M(t?l?.id:null),u=w(t?l?.id:null);if(!t)return{fields:[],chips:[]};const s=(h.data??[]).map(n=>({id:n.id,label:n.display_name||`Connection #${n.id}`,connectorKey:n.connector_key}));for(const n of t.connectionIds)s.some(a=>a.id===n)||s.unshift({id:n,label:`Connection #${n}`,connectorKey:t.connectorKey});const r=(u.data??[]).map(n=>({key:n.key,label:n.name}));t.connectorKey&&!r.some(n=>n.key===t.connectorKey)&&r.unshift({key:t.connectorKey,label:t.connectorKey});const i=n=>{const a=n==="connection"?h:u,d=K({searchPlaceholder:`Search ${n}s...`,emptyText:a.isLoading?"Loading...":`No ${n}s`,multiple:n==="connection",selected:n==="connection"?t.connectionIds.map(String):[t.connectorKey],options:n==="connection"?s.map(e=>({value:String(e.id),label:e.label,action:e.connectorKey?o.jsx(p,{...X(t.ownerSlug,{id:e.id,connector_key:e.connectorKey}),label:e.label}):null})):r.map(e=>({value:e.key,label:e.label,action:o.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:t.ownerSlug,connectorKey:e.key},label:e.label})})),onSelect:e=>n==="connection"?t.onChange({connectionIds:t.connectionIds.includes(Number(e))?t.connectionIds.filter(c=>c!==Number(e)):[...t.connectionIds,Number(e)]}):t.onChange({connectorKey:e})});return{...d,items:e=>o.jsxs(o.Fragment,{children:[d.items(e,""),a.isError?o.jsxs(g,{forceMount:!0,onSelect:()=>void a.refetch(),children:["Could not load ",n,"s. Retry"]}):null]})}};return{fields:[{key:"connection",label:"Connection",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connection")},{key:"connector",label:"Connector",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connector")}],chips:[...t.connectionIds.length?[{id:"connection",field:"connection",label:"Connection",op:"is",value:t.connectionIds.map(n=>s.find(a=>a.id===n)?.label??`#${n}`).join(", "),onRemove:()=>t.onChange({connectionIds:[]})}]:[],...t.connectorKey?[{id:"connector",field:"connector",label:"Connector",op:"is",value:r.find(n=>n.key===t.connectorKey)?.label??t.connectorKey,onRemove:()=>t.onChange({connectorKey:""})}]:[]]}}function oe({bucket:t,status:l,onBucketChange:h,onStatusChange:u,automation:s,source:r}){const i=te(r),n=Y(s?.ownerSlug??"",!!s),a=(n.data??[]).map(e=>({value:e.automation_id,label:`${e.name}${e.status==="archived"?" (archived)":""}`}));for(const e of s?.ids??[])a.some(c=>c.value===String(e))||a.unshift({value:String(e),label:`Automation #${e}`});const d=e=>a.find(c=>c.value===String(e))?.label??`#${e}`;return o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[o.jsx("div",{className:"inline-flex max-w-full flex-wrap rounded-md border bg-muted/30 p-0.5 text-sm",children:B.map(e=>o.jsx("button",{type:"button",onClick:()=>h(e.value),className:E("rounded px-3 py-1 transition-colors",t===e.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))}),o.jsx(Q,{label:"Run filters",className:"w-full min-w-0",fields:[...i.fields,...s?[{key:"automation",label:"Automation",icon:o.jsx(O,{className:"h-4 w-4"}),editor:{kind:"list",searchPlaceholder:"Search Automations...",emptyText:n.isLoading?"Loading Automations...":"No Automations",items:()=>o.jsxs(o.Fragment,{children:[o.jsx(_,{children:a.map(e=>{const c=Number(e.value);return o.jsxs(g,{value:`${e.label} ${c}`,"aria-label":e.label,className:"group",onSelect:()=>s.onChange(s.ids.includes(c)?s.ids.filter(f=>f!==c):[...s.ids,c]),children:[o.jsx(V,{selected:s.ids.includes(c)}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.label}),o.jsx(p,{...Z(s.ownerSlug,e.value),label:e.label})]},e.value)})}),n.isError?o.jsx(g,{forceMount:!0,onSelect:()=>void n.refetch(),children:"Could not load Automations. Retry"}):null]})}}]:[],{key:"status",label:"Status",icon:o.jsx(U,{className:"h-4 w-4"}),editor:K({searchPlaceholder:"Search statuses...",options:C,selected:l==="all"?[]:[l],onSelect:u})}],chips:[...i.chips,...l==="all"?[]:[{id:"status",label:"Status",op:"is",value:C.find(e=>e.value===l)?.label??l,onRemove:()=>u("all")}],...s?.ids.length?[{id:"automation",field:"automation",label:"Automation",op:"is",value:s.ids.map(d).join(", "),onRemove:()=>s.onChange([])}]:[]]})]})}function ue({ownerSlug:t}){const l=z(),{search:h}=H(),u=W(h);return o.jsx(se,{scope:{workspace:!0},ownerSlug:t,filterState:u,onFilterChange:s=>{l({search:(r=>({...r,...D(s)}))})}})}function se({scope:t,ownerSlug:l,filterState:h,onFilterChange:u}){const[s,r]=x.useState({bucket:"all",status:"all",automationIds:[],connectionIds:[],connectorKey:""}),i=h??s,{bucket:n,status:a,automationIds:d,connectionIds:e,connectorKey:c}=i,f=u??r,I=x.useMemo(()=>({runTypes:n==="all"?void 0:[n],status:a==="all"?void 0:a,...d.length?{automationIds:d}:{},...e.length?{connectionIds:e}:{}}),[n,a,d,e]),{data:y,isLoading:F,isError:b,hasNextPage:v,isFetching:j,isFetchingNextPage:$,fetchNextPage:S,refetch:A}=J(c?{connectorKey:c}:t,I,l),N=x.useMemo(()=>y?.pages.flatMap(m=>m.runs)??[],[y]),L={runType:n==="all",feed:!("workspace"in t)||n==="sync",connection:"deviceId"in t||"connectorKey"in t||"workspace"in t&&n!=="automation",startedBy:!0},P=q({onIntersect:()=>void S(),enabled:!!v&&!j&&!b,rootMargin:"200px"});return o.jsxs("div",{className:"space-y-3",children:[o.jsx(oe,{bucket:n,status:a,onBucketChange:m=>f({...i,bucket:m}),onStatusChange:m=>f({...i,status:m}),automation:"workspace"in t?{ownerSlug:l,ids:d,onChange:m=>f({...i,automationIds:m})}:void 0,source:"workspace"in t?{ownerSlug:l,connectionIds:e,connectorKey:c,onChange:m=>f({...i,...m})}:void 0}),F?o.jsx(ee,{}):b?o.jsxs("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:["Failed to load runs."," ",o.jsx(R,{variant:"ghost",size:"sm",onClick:()=>void A(),children:"Retry"})]}):N.length===0?o.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&a==="all"&&!d.length&&!e.length&&!c?"No runs yet.":"No runs match these filters."}):o.jsxs(o.Fragment,{children:[o.jsx(ne,{runs:N,ownerSlug:l,columns:L}),o.jsx("div",{ref:P,className:"h-1"}),v&&o.jsx(R,{variant:"ghost",size:"sm",disabled:j,onClick:()=>void S(),children:"Load more runs"}),$&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(G,{size:"lg",className:"text-muted-foreground"})})]})]})}export{se as R,ue as W};
2
- //# sourceMappingURL=runs-panel-DEnZHTa5.js.map
1
+ import{at as P,aH as w,cD as B,j as o,ct as k,cU as g,d$ as E,i as M,e0 as C,cT as _,cS as U,cz as z,c as H,w as O,e1 as W,e2 as D,r as x,B as R,ab as G}from"./index-BjcZVe7n.js";import{u as q}from"./use-scroll-sentinel-BWCrmNIB.js";import{u as J}from"./runs-BntGAKQG.js";import{o as K,F as Q,S as V}from"./filter-bar-CQ_oE7a9.js";import{M as p,c as X,u as Y,a as Z}from"./manage-gear-C-0BAMbC.js";import{R as ee,a as ne}from"./runs-table-CYS1jDdL.js";function te(t){const{org:l}=P(t?.ownerSlug),h=w(t?l?.id:null),u=B(t?l?.id:null);if(!t)return{fields:[],chips:[]};const s=(h.data??[]).map(n=>({id:n.id,label:n.display_name||`Connection #${n.id}`,connectorKey:n.connector_key}));for(const n of t.connectionIds)s.some(a=>a.id===n)||s.unshift({id:n,label:`Connection #${n}`,connectorKey:t.connectorKey});const r=(u.data??[]).map(n=>({key:n.key,label:n.name}));t.connectorKey&&!r.some(n=>n.key===t.connectorKey)&&r.unshift({key:t.connectorKey,label:t.connectorKey});const i=n=>{const a=n==="connection"?h:u,d=K({searchPlaceholder:`Search ${n}s...`,emptyText:a.isLoading?"Loading...":`No ${n}s`,multiple:n==="connection",selected:n==="connection"?t.connectionIds.map(String):[t.connectorKey],options:n==="connection"?s.map(e=>({value:String(e.id),label:e.label,action:e.connectorKey?o.jsx(p,{...X(t.ownerSlug,{id:e.id,connector_key:e.connectorKey}),label:e.label}):null})):r.map(e=>({value:e.key,label:e.label,action:o.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:t.ownerSlug,connectorKey:e.key},label:e.label})})),onSelect:e=>n==="connection"?t.onChange({connectionIds:t.connectionIds.includes(Number(e))?t.connectionIds.filter(c=>c!==Number(e)):[...t.connectionIds,Number(e)]}):t.onChange({connectorKey:e})});return{...d,items:e=>o.jsxs(o.Fragment,{children:[d.items(e,""),a.isError?o.jsxs(g,{forceMount:!0,onSelect:()=>void a.refetch(),children:["Could not load ",n,"s. Retry"]}):null]})}};return{fields:[{key:"connection",label:"Connection",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connection")},{key:"connector",label:"Connector",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connector")}],chips:[...t.connectionIds.length?[{id:"connection",field:"connection",label:"Connection",op:"is",value:t.connectionIds.map(n=>s.find(a=>a.id===n)?.label??`#${n}`).join(", "),onRemove:()=>t.onChange({connectionIds:[]})}]:[],...t.connectorKey?[{id:"connector",field:"connector",label:"Connector",op:"is",value:r.find(n=>n.key===t.connectorKey)?.label??t.connectorKey,onRemove:()=>t.onChange({connectorKey:""})}]:[]]}}function oe({bucket:t,status:l,onBucketChange:h,onStatusChange:u,automation:s,source:r}){const i=te(r),n=Y(s?.ownerSlug??"",!!s),a=(n.data??[]).map(e=>({value:e.automation_id,label:`${e.name}${e.status==="archived"?" (archived)":""}`}));for(const e of s?.ids??[])a.some(c=>c.value===String(e))||a.unshift({value:String(e),label:`Automation #${e}`});const d=e=>a.find(c=>c.value===String(e))?.label??`#${e}`;return o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[o.jsx("div",{className:"inline-flex max-w-full flex-wrap rounded-md border bg-muted/30 p-0.5 text-sm",children:E.map(e=>o.jsx("button",{type:"button",onClick:()=>h(e.value),className:M("rounded px-3 py-1 transition-colors",t===e.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))}),o.jsx(Q,{label:"Run filters",className:"w-full min-w-0",fields:[...i.fields,...s?[{key:"automation",label:"Automation",icon:o.jsx(U,{className:"h-4 w-4"}),editor:{kind:"list",searchPlaceholder:"Search Automations...",emptyText:n.isLoading?"Loading Automations...":"No Automations",items:()=>o.jsxs(o.Fragment,{children:[o.jsx(_,{children:a.map(e=>{const c=Number(e.value);return o.jsxs(g,{value:`${e.label} ${c}`,"aria-label":e.label,className:"group",onSelect:()=>s.onChange(s.ids.includes(c)?s.ids.filter(f=>f!==c):[...s.ids,c]),children:[o.jsx(V,{selected:s.ids.includes(c)}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.label}),o.jsx(p,{...Z(s.ownerSlug,e.value),label:e.label})]},e.value)})}),n.isError?o.jsx(g,{forceMount:!0,onSelect:()=>void n.refetch(),children:"Could not load Automations. Retry"}):null]})}}]:[],{key:"status",label:"Status",icon:o.jsx(z,{className:"h-4 w-4"}),editor:K({searchPlaceholder:"Search statuses...",options:C,selected:l==="all"?[]:[l],onSelect:u})}],chips:[...i.chips,...l==="all"?[]:[{id:"status",label:"Status",op:"is",value:C.find(e=>e.value===l)?.label??l,onRemove:()=>u("all")}],...s?.ids.length?[{id:"automation",field:"automation",label:"Automation",op:"is",value:s.ids.map(d).join(", "),onRemove:()=>s.onChange([])}]:[]]})]})}function ue({ownerSlug:t}){const l=H(),{search:h}=O(),u=W(h);return o.jsx(se,{scope:{workspace:!0},ownerSlug:t,filterState:u,onFilterChange:s=>{l({search:(r=>({...r,...D(s)}))})}})}function se({scope:t,ownerSlug:l,filterState:h,onFilterChange:u}){const[s,r]=x.useState({bucket:"all",status:"all",automationIds:[],connectionIds:[],connectorKey:""}),i=h??s,{bucket:n,status:a,automationIds:d,connectionIds:e,connectorKey:c}=i,f=u??r,I=x.useMemo(()=>({runTypes:n==="all"?void 0:[n],status:a==="all"?void 0:a,...d.length?{automationIds:d}:{},...e.length?{connectionIds:e}:{}}),[n,a,d,e]),{data:y,isLoading:F,isError:b,hasNextPage:v,isFetching:j,isFetchingNextPage:$,fetchNextPage:S,refetch:A}=J(c?{connectorKey:c}:t,I,l),N=x.useMemo(()=>y?.pages.flatMap(m=>m.runs)??[],[y]),L={runType:n==="all",feed:!("workspace"in t)||n==="sync",connection:"deviceId"in t||"connectorKey"in t||"workspace"in t&&n!=="automation",startedBy:!0},T=q({onIntersect:()=>void S(),enabled:!!v&&!j&&!b,rootMargin:"200px"});return o.jsxs("div",{className:"space-y-3",children:[o.jsx(oe,{bucket:n,status:a,onBucketChange:m=>f({...i,bucket:m}),onStatusChange:m=>f({...i,status:m}),automation:"workspace"in t?{ownerSlug:l,ids:d,onChange:m=>f({...i,automationIds:m})}:void 0,source:"workspace"in t?{ownerSlug:l,connectionIds:e,connectorKey:c,onChange:m=>f({...i,...m})}:void 0}),F?o.jsx(ee,{}):b?o.jsxs("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:["Failed to load runs."," ",o.jsx(R,{variant:"ghost",size:"sm",onClick:()=>void A(),children:"Retry"})]}):N.length===0?o.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&a==="all"&&!d.length&&!e.length&&!c?"No runs yet.":"No runs match these filters."}):o.jsxs(o.Fragment,{children:[o.jsx(ne,{runs:N,ownerSlug:l,columns:L}),o.jsx("div",{ref:T,className:"h-1"}),v&&o.jsx(R,{variant:"ghost",size:"sm",disabled:j,onClick:()=>void S(),children:"Load more runs"}),$&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(G,{size:"lg",className:"text-muted-foreground"})})]})]})}export{se as R,ue as W};
2
+ //# sourceMappingURL=runs-panel-BwTVaRsE.js.map
@@ -1,2 +1,2 @@
1
- import{j as e,i as p,S as c,bG as h,B as k,L as f,da as w,a$ as v,b0 as _,b1 as C,en as S,eo as T,u as R,e5 as L,dZ as V,V as B,ep as D,dW as $,aj as A,ab as E,eq as I,r as j,dE as g,dG as y,dF as N}from"./index-DdBTTN3y.js";import{R as K}from"./run-initiator-BvzQJYW9.js";import{T as P,a as F,b as m,c as i,d as M,e as d}from"./table-BUqshjxa.js";function O({labels:t,className:r}){return e.jsx("div",{className:p("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",r),children:t.map((a,n)=>e.jsx("span",{className:n===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function q({rows:t=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(c,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:t}).map((r,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(c,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(c,{className:"h-3 w-20"}),e.jsx(c,{className:"h-3 w-16"}),e.jsx(c,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(c,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function ie({rows:t=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(O,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(q,{rows:t})]})}const G=h("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"}}),H=h("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 W({className:t,status:r,showDot:a=!0,children:n,...o}){return e.jsxs("span",{className:p(G({status:r}),t),...o,children:[a&&e.jsx("span",{className:H({status:r})}),n]})}function z(t,r){switch(r.kind){case"connection":return T(t,r.id);case"feed":return S(t,r.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(r.id)}}}}function J({ownerSlug:t,scope:r,variant:a="outline",iconOnly:n=!1,label:o,className:s,title:x}){const l=z(t,r),b=x??o??"View in memory",u=e.jsx(k,{asChild:!0,variant:a,size:n?"icon":"sm",className:p(n&&"h-7 w-7",s),children:e.jsxs(f,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:p("h-3.5 w-3.5",!n&&"mr-1.5")}),!n&&(o??"View in memory")]})});return n?e.jsxs(v,{children:[e.jsx(_,{asChild:!0,children:u}),e.jsx(C,{children:b})]}):u}const U=new Set(["error","failed","revoked"]);function X(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":U.has(t)?"error":"default"}function Z({status:t}){return t==="completed"?e.jsx($,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(A,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(E,{className:"text-blue-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-muted-foreground"})}function Q({error:t}){const[r,a]=j.useState(!1);return t.length>80?e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(N,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function Y({checkpoint:t}){const[r,a]=j.useState(!1);return e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(N,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function ee(t){if(t.initiator_kind)return{kind:t.initiator_kind,...t.initiator_ref};if(t.automation_id)return{kind:"automation",automation_id:t.automation_id};if(t.created_by_user_id)return{kind:"user",user_id:t.created_by_user_id}}function te({run:t,ownerSlug:r}){const a=ee(t);return a?a.kind==="system"?e.jsx("span",{className:"text-muted-foreground",children:"System"}):e.jsx(K,{ownerSlug:r,initiator:a,clientName:void 0,fallback:"A person"}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}function se(t){return t.feed_display_name??t.feed_key??"—"}function de({runs:t,ownerSlug:r,columns:a={}}){const n=R(),o=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(P,{children:[e.jsx(F,{children:e.jsxs(m,{children:[e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"When"}),a.runType&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Type"}),a.connection&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Connection"}),a.feed&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Feed"}),a.startedBy&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Started by"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Version"}),o&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(M,{children:t.map(s=>{const x=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(m,{children:[e.jsx(d,{className:"py-1.5 px-3",children:e.jsx(Z,{status:s.status})}),e.jsxs(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:V(s.created_at),children:[e.jsxs(f,{to:"/$owner/events",params:{owner:r},search:{run_ids:String(s.id)},className:"block text-foreground hover:underline",onClick:l=>{!n||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),n.open({href:s.run_type==="automation"&&s.automation_id!=null?`/${r}/automations/${s.automation_id}?view=activity&run_id=${s.id}`:`/${r}/events?run_ids=${s.id}`,title:`Run #${s.id}`,runId:s.id}))},children:["Run #",s.id]}),L(s.created_at)]}),a.runType&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(B,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),a.connection&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),a.feed&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:se(s)}),a.startedBy&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(te,{run:s,ownerSlug:r})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(W,{status:X(s.status),children:s.status})}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:x!=null?D(x):"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),o&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(Y,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(Q,{error:s.error_message}):""}),e.jsx(d,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:r,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{q as R,W as S,J as V,de as a,ie as b,X as g};
2
- //# sourceMappingURL=runs-table-XGnxJl7S.js.map
1
+ import{j as e,i as p,S as c,bG as h,B as k,L as f,da as w,a$ as v,b0 as _,b1 as T,en as C,eo as S,u as R,ek as V,ec as L,V as B,ep as D,e9 as $,aj as A,ab as E,eq as I,r as j,dT as g,dV as y,dU as N}from"./index-BjcZVe7n.js";import{R as K}from"./run-initiator-CCxNv0rK.js";import{T as P,a as M,b as m,c as i,d as O,e as d}from"./table-DALHuXPE.js";function q({labels:t,className:r}){return e.jsx("div",{className:p("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",r),children:t.map((a,n)=>e.jsx("span",{className:n===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function F({rows:t=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(c,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:t}).map((r,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(c,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(c,{className:"h-3 w-20"}),e.jsx(c,{className:"h-3 w-16"}),e.jsx(c,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(c,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function ie({rows:t=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(q,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(F,{rows:t})]})}const H=h("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"}}),U=h("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 z({className:t,status:r,showDot:a=!0,children:n,...o}){return e.jsxs("span",{className:p(H({status:r}),t),...o,children:[a&&e.jsx("span",{className:U({status:r})}),n]})}function G(t,r){switch(r.kind){case"connection":return S(t,r.id);case"feed":return C(t,r.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(r.id)}}}}function J({ownerSlug:t,scope:r,variant:a="outline",iconOnly:n=!1,label:o,className:s,title:x}){const l=G(t,r),b=x??o??"View in memory",u=e.jsx(k,{asChild:!0,variant:a,size:n?"icon":"sm",className:p(n&&"h-7 w-7",s),children:e.jsxs(f,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:p("h-3.5 w-3.5",!n&&"mr-1.5")}),!n&&(o??"View in memory")]})});return n?e.jsxs(v,{children:[e.jsx(_,{asChild:!0,children:u}),e.jsx(T,{children:b})]}):u}const W=new Set(["error","failed","revoked"]);function X(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":W.has(t)?"error":"default"}function Q({status:t}){return t==="completed"?e.jsx($,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(A,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(E,{className:"text-blue-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-muted-foreground"})}function Y({error:t}){const[r,a]=j.useState(!1);return t.length>80?e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(N,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function Z({checkpoint:t}){const[r,a]=j.useState(!1);return e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(N,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function ee(t){if(t.initiator_kind)return{kind:t.initiator_kind,...t.initiator_ref};if(t.automation_id)return{kind:"automation",automation_id:t.automation_id};if(t.created_by_user_id)return{kind:"user",user_id:t.created_by_user_id}}function te({run:t,ownerSlug:r}){const a=ee(t);return a?a.kind==="system"?e.jsx("span",{className:"text-muted-foreground",children:"System"}):e.jsx(K,{ownerSlug:r,initiator:a,clientName:void 0,fallback:"A person"}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}function se(t){return t.feed_display_name??t.feed_key??"—"}function de({runs:t,ownerSlug:r,columns:a={}}){const n=R(),o=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(P,{children:[e.jsx(M,{children:e.jsxs(m,{children:[e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"When"}),a.runType&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Type"}),a.connection&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Connection"}),a.feed&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Feed"}),a.startedBy&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Started by"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Version"}),o&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(O,{children:t.map(s=>{const x=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(m,{children:[e.jsx(d,{className:"py-1.5 px-3",children:e.jsx(Q,{status:s.status})}),e.jsxs(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:L(s.created_at),children:[e.jsxs(f,{to:"/$owner/events",params:{owner:r},search:{run_ids:String(s.id)},className:"block text-foreground hover:underline",onClick:l=>{!n||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),n.open({href:s.run_type==="automation"&&s.automation_id!=null?`/${r}/automations/${s.automation_id}?view=activity&run_id=${s.id}`:`/${r}/events?run_ids=${s.id}`,title:`Run #${s.id}`,runId:s.id}))},children:["Run #",s.id]}),V(s.created_at)]}),a.runType&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(B,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),a.connection&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),a.feed&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:se(s)}),a.startedBy&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(te,{run:s,ownerSlug:r})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(z,{status:X(s.status),children:s.status})}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:x!=null?D(x):"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),o&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(Z,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(Y,{error:s.error_message}):""}),e.jsx(d,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:r,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{F as R,z as S,J as V,de as a,ie as b,X as g};
2
+ //# sourceMappingURL=runs-table-CYS1jDdL.js.map
@@ -1,2 +1,2 @@
1
- import{v as u,gf as l,j as t,bO as m,b_ as f,fw as x}from"./index-DdBTTN3y.js";import{E as i}from"./entity-type-page-BLwH6qa7.js";function E({slug:r,onClose:a}){const{orgContext:e}=u(),{data:s=[],isLoading:o,isError:y}=l(e);if(r===null)return t.jsx(i,{entityType:null,orgContext:e,onClose:a,compact:!0});if(o)return t.jsx(m,{label:"entity type",variant:"panel"});if(y)return t.jsx(f,{label:"entity type"});const n=s.find(p=>p.slug===r)??null;return n?t.jsx(i,{entityType:n,orgContext:e,hideDelete:x(n),onClose:a,compact:!0}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}export{E as S};
2
- //# sourceMappingURL=schema-type-editor-panel-C0_9VcSs.js.map
1
+ import{v as u,g6 as l,j as t,bO as m,b_ as x,fo as c}from"./index-BjcZVe7n.js";import{E as i}from"./entity-type-page-D0ghgRgq.js";function E({slug:r,onClose:a}){const{orgContext:e}=u(),{data:s=[],isLoading:o,isError:y}=l(e);if(r===null)return t.jsx(i,{entityType:null,orgContext:e,onClose:a,compact:!0});if(o)return t.jsx(m,{label:"entity type",variant:"panel"});if(y)return t.jsx(x,{label:"entity type"});const n=s.find(p=>p.slug===r)??null;return n?t.jsx(i,{entityType:n,orgContext:e,hideDelete:c(n),onClose:a,compact:!0}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}export{E as S};
2
+ //# sourceMappingURL=schema-type-editor-panel-v3nR2Oa2.js.map
@@ -0,0 +1,3 @@
1
+ import{j as i,di as w,i as L,L as A,fe as D,ff as $}from"./index-BjcZVe7n.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 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-BFb7jCBo.js.map
@@ -0,0 +1,2 @@
1
+ import{j2 as t,j as e}from"./index-BjcZVe7n.js";import{a as m}from"./agents-workbench-CDpJmUVN.js";import"./agent-editor-form-BXQBFHSv.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./model-selector-B2cjCn0V.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./nav-pill-Bam6s3jj.js";function h(){const{owner:o,agentId:r}=t.useParams(),i=t.useSearch();return e.jsx(m,{owner:o,agentId:r,tab:"settings",runId:i.run_id})}export{h as component};
2
+ //# sourceMappingURL=settings-DBgT60nY.js.map
@@ -1,2 +1,2 @@
1
- import{q as l,j as e,B as i,L as t,y as c,ak as o,al as d}from"./index-DdBTTN3y.js";import{F as m}from"./full-page-spinner-BqmckkOf.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(i,{asChild:!0,children:e.jsx(t,{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(i,{variant:"outline",asChild:!0,children:e.jsx(t,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
2
- //# sourceMappingURL=settings-CP4PjMQA.js.map
1
+ import{q as l,j as e,B as i,L as t,y as c,ak as o,al as d}from"./index-BjcZVe7n.js";import{F as m}from"./full-page-spinner-B5xXnKtV.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(i,{asChild:!0,children:e.jsx(t,{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(i,{variant:"outline",asChild:!0,children:e.jsx(t,{to:"/auth/logout",children:"Sign out"})})]})]})})}export{h as component};
2
+ //# sourceMappingURL=settings-DubSpJfg.js.map
@@ -0,0 +1,2 @@
1
+ import{j1 as r,j as t,O as s}from"./index-BjcZVe7n.js";import{A as e}from"./agent-skill-context-1DBn7Xc_.js";import"./core.esm-BsXtvNoI.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
2
+ //# sourceMappingURL=skills-DDoeRGhJ.js.map
@@ -1,2 +1,2 @@
1
- import{v as y,cP as b,fk as R,j as e,B as j,fl as v,S as _,bN as C,L,dR as F,x as E}from"./index-DdBTTN3y.js";import{a as P,R as S,b as $}from"./event-card-DVUB8my6.js";import{b as k}from"./events-feed-B9CZHI_P.js";function f({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?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:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function I({record:o,orgContext:c,filters:l}){const{orgContext:d}=y(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:x,isFetchingNextPage:s}=R(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:x,onRetry:()=>void g()}),e.jsx(k,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:x,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function B({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=y(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:x}=v(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(f,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=x instanceof C&&x.status===400;h&&!s||!i&&n?g():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.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:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx($,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.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:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void g(),children:a?"Loading…":"Load more"})]}):e.jsx(f,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{I as S,B as a};
2
- //# sourceMappingURL=source-record-panels-Bh0n4gGw.js.map
1
+ import{v as y,cP as b,f1 as v,j as e,B as j,f2 as R,S as _,bN as C,L,e4 as F,x as E}from"./index-BjcZVe7n.js";import{a as P,R as S,b as $}from"./event-card-CjA_dLzq.js";import{b as A}from"./events-feed-CGzA1w3R.js";function f({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?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:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function I({record:o,orgContext:c,filters:l}){const{orgContext:d}=y(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:x,isFetchingNextPage:s}=v(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:x,onRetry:()=>void g()}),e.jsx(A,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:x,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function B({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=y(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:x}=R(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(f,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=x instanceof C&&x.status===400;h&&!s||!i&&n?g():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.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:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx($,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.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:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void g(),children:a?"Loading…":"Load more"})]}):e.jsx(f,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{I as S,B as a};
2
+ //# sourceMappingURL=source-record-panels-m8gECt82.js.map
@@ -1,2 +1,2 @@
1
- import{j as e,i as t}from"./index-DdBTTN3y.js";const s={live:"bg-green-500",amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function a({tone:r}){return e.jsx("span",{"aria-hidden":r===null,className:t("h-1.5 w-1.5 shrink-0 rounded-full",r===null?"bg-transparent":s[r])})}export{a as S};
2
- //# sourceMappingURL=status-dot-Cpq63I7p.js.map
1
+ import{j as e,i as t}from"./index-BjcZVe7n.js";const s={live:"bg-green-500",amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function a({tone:r}){return e.jsx("span",{"aria-hidden":r===null,className:t("h-1.5 w-1.5 shrink-0 rounded-full",r===null?"bg-transparent":s[r])})}export{a as S};
2
+ //# sourceMappingURL=status-dot-BnQPFrcU.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,j as l,i as o}from"./index-DdBTTN3y.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-BUqshjxa.js.map
1
+ import{r as t,j as l,i as o}from"./index-BjcZVe7n.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-DALHuXPE.js.map
@@ -1,2 +1,2 @@
1
- import{cP as o,fm as c,fn as u,a6 as r,bX as l,cQ as s}from"./index-DdBTTN3y.js";function y(){return o({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,i){return o({queryKey:["automations-list",e,a,i?.includeDetails??!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,i,t={}){const n=c(t.ownerSlug);return o({queryKey:["automation-detail",n,e,a,t.since,t.until,t.templateVersion,t.includeVersions??!1],queryFn:async()=>await s("get_automation",{automation_id:e,entity_id:a,content_since:t.since,content_until:t.until,template_version:t.templateVersion,page_size:100,include_classification:"summary",include_versions:t.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!e&&!!(t.ownerSlug||i),staleTime:3e4})}const f=u({tool:"manage_automations",body:e=>({action:"update",...e}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),q=u({tool:"manage_automations",body:e=>({action:"delete",automation_ids:[e]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),v=u({tool:"manage_automations",body:e=>({action:"create",...e}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function A(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"create_version",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}function K(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"set_reaction_script",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}export{q as a,_ as b,v as c,A as d,K as e,f,y as g,g as u};
2
- //# sourceMappingURL=use-automations-BLNjxq2K.js.map
1
+ import{cP as o,f3 as c,f4 as u,a6 as r,bX as l,cQ as s}from"./index-BjcZVe7n.js";function y(){return o({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,i){return o({queryKey:["automations-list",e,a,i?.includeDetails??!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,i,t={}){const n=c(t.ownerSlug);return o({queryKey:["automation-detail",n,e,a,t.since,t.until,t.templateVersion,t.includeVersions??!1],queryFn:async()=>await s("get_automation",{automation_id:e,entity_id:a,content_since:t.since,content_until:t.until,template_version:t.templateVersion,page_size:100,include_classification:"summary",include_versions:t.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!e&&!!(t.ownerSlug||i),staleTime:3e4})}const f=u({tool:"manage_automations",body:e=>({action:"update",...e}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),q=u({tool:"manage_automations",body:e=>({action:"delete",automation_ids:[e]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),v=u({tool:"manage_automations",body:e=>({action:"create",...e}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function A(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"create_version",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}function K(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"set_reaction_script",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}export{q as a,_ as b,v as c,A as d,K as e,f,y as g,g as u};
2
+ //# sourceMappingURL=use-automations-D9hKpufo.js.map
@@ -1,2 +1,2 @@
1
- import{r as d,j as e,V as U,i as R,W as D,B as W,Y as B,Z as I,$ as T,a0 as V,K,a1 as q}from"./index-DdBTTN3y.js";import{C as G,a as Y,b as Z,d as J,c as Q}from"./card-Bdi7VEwo.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 X({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(X,{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(G,{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(Y,{children:[e.jsx(Z,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(J,{children:t}):null]}),e.jsxs(Q,{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=K(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}=q(),[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-CmyQW7GT.js.map
1
+ import{r as d,j as e,V as U,i as R,W as D,B as W,Y as B,Z as I,$ as T,a0 as V,K,a1 as q}from"./index-BjcZVe7n.js";import{C as G,a as Y,b as Z,d as J,c as Q}from"./card-g4yxo4Hr.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 X({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(X,{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(G,{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(Y,{children:[e.jsx(Z,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(J,{children:t}):null]}),e.jsxs(Q,{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=K(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}=q(),[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-ciwfc-7A.js.map