@lobu/runtime-server 24.1.1 → 24.2.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 (284) hide show
  1. package/dist/catalogs/connectors.json +151 -37
  2. package/dist/catalogs/skills.json +2 -2
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/google_gmail.ts +70 -41
  5. package/dist/connectors/google_gmail_references.ts +406 -0
  6. package/dist/connectors/linkedin-inbox-adapter.js +107 -36
  7. package/dist/connectors/linkedin-inbox.ts +13 -0
  8. package/dist/connectors/linkedin.ts +1 -1
  9. package/dist/connectors/postgres.ts +5 -3
  10. package/dist/connectors/reddit.ts +171 -5
  11. package/dist/connectors/whatsapp-web-adapter.js +147 -61
  12. package/dist/connectors/whatsapp-web-helpers.ts +6 -2
  13. package/dist/connectors/whatsapp_web.ts +48 -17
  14. package/dist/connectors/x-dm-adapter.js +252 -35
  15. package/dist/connectors/x.ts +189 -13
  16. package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +3 -1
  17. package/dist/db/migrations/20261024050000_events_source_reference_arrival.sql +27 -0
  18. package/dist/db/migrations/20261026000000_turn_write_receipts.sql +36 -0
  19. package/dist/db/migrations/20261026190000_federated_relationship_endpoints.sql +143 -0
  20. package/dist/dependencies.bun.lock +81 -83
  21. package/dist/embeddings-server.mjs +81 -11
  22. package/dist/guest.bundle.js +62 -25
  23. package/dist/owletto/dist/assets/_-Cjvw31gU.js +2 -0
  24. package/dist/owletto/dist/assets/_-iToIRRFt.js +3 -0
  25. package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +2 -0
  26. package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +2 -0
  27. package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +2 -0
  28. package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +2 -0
  29. package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +2 -0
  30. package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +2 -0
  31. package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +2 -0
  32. package/dist/owletto/dist/assets/_name-BsOZmvlH.js +2 -0
  33. package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +3 -0
  34. package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +2 -0
  35. package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +2 -0
  36. package/dist/owletto/dist/assets/_slug-MHQU8ftJ.js +2 -0
  37. package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +2 -0
  38. package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +2 -0
  39. package/dist/owletto/dist/assets/accept-invitation-D2T_a2dj.js +2 -0
  40. package/dist/owletto/dist/assets/activity-route-view-_G_lDz5K.js +2 -0
  41. package/dist/owletto/dist/assets/agent-card-controls-ColL5rdd.js +2 -0
  42. package/dist/owletto/dist/assets/{agent-client-setup-list-BlXB4SE5.js → agent-client-setup-list-BgyLhJCo.js} +2 -2
  43. package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +2 -0
  44. package/dist/owletto/dist/assets/{agent-editor-form-DsSoeQeF.js → agent-editor-form-C24p9LLg.js} +2 -2
  45. package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +2 -0
  46. package/dist/owletto/dist/assets/{agent-loading-shells-B7v6Cffw.js → agent-loading-shells-jkf9DjdO.js} +2 -2
  47. package/dist/owletto/dist/assets/agent-permissions-matrix-C8j8kRB1.js +2 -0
  48. package/dist/owletto/dist/assets/{agent-skill-context-DFucg4c4.js → agent-skill-context-B9giw2u2.js} +2 -2
  49. package/dist/owletto/dist/assets/agent-skills-route-BMZ3r1bP.js +2 -0
  50. package/dist/owletto/dist/assets/agent-subpage-shell-D49f-bzP.js +2 -0
  51. package/dist/owletto/dist/assets/{agent-thread-D38STyeu.js → agent-thread-BGHYHWDO.js} +4 -4
  52. package/dist/owletto/dist/assets/agents-C05k-Xw6.js +2 -0
  53. package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +2 -0
  54. package/dist/owletto/dist/assets/app._appId-A51tx2jU.js +2 -0
  55. package/dist/owletto/dist/assets/automation-detail-content-DCAZBKle.js +2 -0
  56. package/dist/owletto/dist/assets/automations-C05k-Xw6.js +2 -0
  57. package/dist/owletto/dist/assets/callback-WmyCei3R.js +2 -0
  58. package/dist/owletto/dist/assets/{card-jzhQrMDP.js → card-Cspo-4M6.js} +2 -2
  59. package/dist/owletto/dist/assets/{claim-B-wq745Q.js → claim-CCKdBtFt.js} +2 -2
  60. package/dist/owletto/dist/assets/client-activity-scopes-CmK3DkSP.js +2 -0
  61. package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +2 -0
  62. package/dist/owletto/dist/assets/{code-editor-CEqoCky-.js → code-editor-C8FJbT2P.js} +3 -3
  63. package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +2 -0
  64. package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +2 -0
  65. package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +2 -0
  66. package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +2 -0
  67. package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +2 -0
  68. package/dist/owletto/dist/assets/{connection-CNm2ukrI.js → connection-DJd9bnEc.js} +2 -2
  69. package/dist/owletto/dist/assets/{connection-feed-detail-WcGCA6qY.js → connection-feed-detail-IO6G5QjL.js} +2 -2
  70. package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +2 -0
  71. package/dist/owletto/dist/assets/{connector-provenance-D-ECOlMJ.js → connector-provenance-bmBJJ9B4.js} +2 -2
  72. package/dist/owletto/dist/assets/connector-scope-lists-B44Q9W-j.js +2 -0
  73. package/dist/owletto/dist/assets/{connectors-CH4KBZyT.js → connectors-CTWPDH8f.js} +2 -2
  74. package/dist/owletto/dist/assets/{consent-C9ZpHb7V.js → consent-C_WBfmQ8.js} +2 -2
  75. package/dist/owletto/dist/assets/copy-button-kcjg8Giw.js +2 -0
  76. package/dist/owletto/dist/assets/{core.esm-BupT3V0i.js → core.esm-CoJ5Splc.js} +2 -2
  77. package/dist/owletto/dist/assets/create-CQE5rD0i.js +2 -0
  78. package/dist/owletto/dist/assets/create-DQNlRTUX.js +2 -0
  79. package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +3 -0
  80. package/dist/owletto/dist/assets/create-lOFSQV_5.js +2 -0
  81. package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +2 -0
  82. package/dist/owletto/dist/assets/{cronstrue-CWImw-kf.js → cronstrue-CeUS_78Q.js} +2 -2
  83. package/dist/owletto/dist/assets/{device-D-7WBe9E.js → device-Br9JHadR.js} +2 -2
  84. package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +2 -0
  85. package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +2 -0
  86. package/dist/owletto/dist/assets/elk-worker.min-BENGc9gn.js +23 -0
  87. package/dist/owletto/dist/assets/{entity-avatar-mdh7Kq5D.js → entity-avatar-BZIa-7i5.js} +2 -2
  88. package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +2 -0
  89. package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +2 -0
  90. package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +2 -0
  91. package/dist/owletto/dist/assets/{event-detail-DV_zfWnC.js → event-detail-C25TvOb_.js} +2 -2
  92. package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +2 -0
  93. package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +2 -0
  94. package/dist/owletto/dist/assets/{full-page-spinner-BVbcpW3R.js → full-page-spinner-DtmqQmgl.js} +2 -2
  95. package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +2 -0
  96. package/dist/owletto/dist/assets/identity-BkK8ggdp.js +2 -0
  97. package/dist/owletto/dist/assets/index-BhBYXtEN.js +2 -0
  98. package/dist/owletto/dist/assets/{index-BTlx9K_t.js → index-Bhop_otG.js} +2 -2
  99. package/dist/owletto/dist/assets/index-Bw5iV_J7.js +2 -0
  100. package/dist/owletto/dist/assets/index-C3dpyynY.js +2 -0
  101. package/dist/owletto/dist/assets/index-C3zAbslo.js +2 -0
  102. package/dist/owletto/dist/assets/index-CGKN_WN_.js +2 -0
  103. package/dist/owletto/dist/assets/{index-DB1iWI_a.js → index-CgRaCOzW.js} +2 -2
  104. package/dist/owletto/dist/assets/{index-D7gHOpfg.js → index-DRbaESbJ.js} +2 -2
  105. package/dist/owletto/dist/assets/index-DfIoxD5Q.js +2 -0
  106. package/dist/owletto/dist/assets/index-DijuudSs.js +2 -0
  107. package/dist/owletto/dist/assets/index-Dr7bouPX.css +1 -0
  108. package/dist/owletto/dist/assets/index-JmEl29py.js +7950 -0
  109. package/dist/owletto/dist/assets/index-NK2VKPoL.js +2 -0
  110. package/dist/owletto/dist/assets/index-_5qsmBkt.js +2 -0
  111. package/dist/owletto/dist/assets/{index-B64PGxQm.js → index-qkOKpRYs.js} +2 -2
  112. package/dist/owletto/dist/assets/index-wHFQv1aT.js +12 -0
  113. package/dist/owletto/dist/assets/index-wzYkECAe.js +2 -0
  114. package/dist/owletto/dist/assets/json-diff-4sMmayDd.js +4 -0
  115. package/dist/owletto/dist/assets/linked-record-peek-B0_B4PnF.js +97 -0
  116. package/dist/owletto/dist/assets/{list-skeleton-CepswBka.js → list-skeleton-BafzvpOM.js} +2 -2
  117. package/dist/owletto/dist/assets/login-XL5XxN6y.js +2 -0
  118. package/dist/owletto/dist/assets/{logout-Bkzc7J44.js → logout-CMxdhLbM.js} +2 -2
  119. package/dist/owletto/dist/assets/{member-scope-gate-DD4YBFn-.js → member-scope-gate-Dit3MXBQ.js} +2 -2
  120. package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +74 -0
  121. package/dist/owletto/dist/assets/{model-selector-CDrAjH31.js → model-selector-BeFuFH7p.js} +2 -2
  122. package/dist/owletto/dist/assets/models-BAVaDnKN.js +2 -0
  123. package/dist/owletto/dist/assets/new-1QLuS1o-.js +2 -0
  124. package/dist/owletto/dist/assets/{new-ktz9Cs_P.js → new-ChwqLmVY.js} +2 -2
  125. package/dist/owletto/dist/assets/new-D21LGMl6.js +2 -0
  126. package/dist/owletto/dist/assets/{oauth-workspace-access-lZNZ9gul.js → oauth-workspace-access-D15LYKSe.js} +2 -2
  127. package/dist/owletto/dist/assets/organization-CoUJYXx7.js +2 -0
  128. package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +2 -0
  129. package/dist/owletto/dist/assets/permissions-C6UFdvz2.js +2 -0
  130. package/dist/owletto/dist/assets/proposal-review-shell-CmLy1MZf.js +2 -0
  131. package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +2 -0
  132. package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +2 -0
  133. package/dist/owletto/dist/assets/{record-session-Pbr5czGw.js → record-session-CJzFoVKc.js} +2 -2
  134. package/dist/owletto/dist/assets/{reset-password-CzZw6RcC.js → reset-password-Y-WO77iR.js} +2 -2
  135. package/dist/owletto/dist/assets/runs-B0zVYb-w.js +2 -0
  136. package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +2 -0
  137. package/dist/owletto/dist/assets/{runs-table-B1APZv7d.js → runs-table-9OVdfPXZ.js} +2 -2
  138. package/dist/owletto/dist/assets/schema-type-editor-panel-DcJqbCrU.js +2 -0
  139. package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +2 -0
  140. package/dist/owletto/dist/assets/settings-Dg0D_l_w.js +2 -0
  141. package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +2 -0
  142. package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +2 -0
  143. package/dist/owletto/dist/assets/status-dot-_LQZmEIX.js +2 -0
  144. package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +2 -0
  145. package/dist/owletto/dist/assets/{use-mention-search-Dcunv4L0.js → use-mention-search-CAFbh-Dk.js} +4 -4
  146. package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +2 -0
  147. package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +2 -0
  148. package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +2 -0
  149. package/dist/owletto/dist/index.html +2 -2
  150. package/dist/server-main.bundle.mjs +44298 -40801
  151. package/npm-shrinkwrap.json +389 -402
  152. package/package.json +1 -1
  153. package/vendor/connector-sdk/dist/browser-requirement.js +1 -1
  154. package/vendor/connector-sdk/dist/connector-types.d.ts +5 -1
  155. package/vendor/connector-sdk/package.json +1 -1
  156. package/vendor/core/dist/agent-tooling.d.ts +8 -0
  157. package/vendor/core/dist/agent-tooling.js +9 -1
  158. package/vendor/core/dist/capabilities.d.ts +1 -1
  159. package/vendor/core/dist/capabilities.js +5 -0
  160. package/vendor/core/dist/contracts/entity-reference.d.ts +3 -0
  161. package/vendor/core/dist/contracts/entity-reference.js +31 -0
  162. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
  163. package/vendor/core/dist/contracts/tools/manage-automations.js +3 -0
  164. package/vendor/core/dist/contracts/tools/manage-connections.js +1 -1
  165. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
  166. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +113 -34
  167. package/vendor/core/dist/contracts/tools/manage-entity.js +41 -14
  168. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
  169. package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
  170. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
  171. package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
  172. package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
  173. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
  174. package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
  175. package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
  176. package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
  177. package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
  178. package/vendor/core/dist/contracts/worker/protocol.js +20 -0
  179. package/vendor/core/dist/reserved.d.ts +6 -3
  180. package/vendor/core/dist/reserved.js +6 -3
  181. package/vendor/core/dist/worker/auth.d.ts +3 -2
  182. package/vendor/core/package.json +6 -1
  183. package/vendor/postgres/cf/src/query.js +3 -1
  184. package/vendor/postgres/cjs/src/query.js +3 -1
  185. package/vendor/postgres/src/query.js +3 -1
  186. package/vendor/views/dist/api.js +31 -7
  187. package/vendor/views/dist/bridge.d.ts +2 -1
  188. package/vendor/views/dist/bridge.js +10 -1
  189. package/vendor/views/package.json +1 -1
  190. package/dist/owletto/dist/assets/_-BorucF19.js +0 -3
  191. package/dist/owletto/dist/assets/_-CkGyNi0G.js +0 -2
  192. package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +0 -2
  193. package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +0 -2
  194. package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +0 -2
  195. package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +0 -2
  196. package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +0 -2
  197. package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +0 -2
  198. package/dist/owletto/dist/assets/_deploymentId-B1UWPY0i.js +0 -2
  199. package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +0 -2
  200. package/dist/owletto/dist/assets/_name-BUfFO_A0.js +0 -2
  201. package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +0 -3
  202. package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +0 -2
  203. package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +0 -2
  204. package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +0 -2
  205. package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +0 -2
  206. package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +0 -2
  207. package/dist/owletto/dist/assets/accept-invitation-UXU5Fx2G.js +0 -2
  208. package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +0 -2
  209. package/dist/owletto/dist/assets/agent-card-controls-CplnPhbv.js +0 -2
  210. package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +0 -2
  211. package/dist/owletto/dist/assets/agent-guardrails-route-TdvvIc_J.js +0 -2
  212. package/dist/owletto/dist/assets/agent-permissions-matrix-BkZu1LYE.js +0 -2
  213. package/dist/owletto/dist/assets/agent-skills-route-B3vvvZZe.js +0 -2
  214. package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +0 -2
  215. package/dist/owletto/dist/assets/agents-DAOln24A.js +0 -2
  216. package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +0 -2
  217. package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +0 -2
  218. package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +0 -2
  219. package/dist/owletto/dist/assets/automations-DAOln24A.js +0 -2
  220. package/dist/owletto/dist/assets/callback-CBexCo3F.js +0 -2
  221. package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +0 -2
  222. package/dist/owletto/dist/assets/clients-BhNl1tVq.js +0 -2
  223. package/dist/owletto/dist/assets/connect-wx-qqLir.js +0 -2
  224. package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +0 -2
  225. package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +0 -2
  226. package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +0 -2
  227. package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +0 -2
  228. package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +0 -2
  229. package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +0 -2
  230. package/dist/owletto/dist/assets/conversations-table-D_HOe1jN.js +0 -2
  231. package/dist/owletto/dist/assets/create-C4lptGWj.js +0 -2
  232. package/dist/owletto/dist/assets/create-CCjZxIkK.js +0 -2
  233. package/dist/owletto/dist/assets/create-DkgUQAbB.js +0 -2
  234. package/dist/owletto/dist/assets/create-automation-form-Bpy92SM5.js +0 -3
  235. package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +0 -2
  236. package/dist/owletto/dist/assets/deployments-C5hvipQh.js +0 -2
  237. package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +0 -2
  238. package/dist/owletto/dist/assets/deployments-body-DGII20dQ.js +0 -2
  239. package/dist/owletto/dist/assets/device-pin-tombstone-2U0UMu3_.js +0 -2
  240. package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +0 -2
  241. package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +0 -2
  242. package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +0 -2
  243. package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +0 -2
  244. package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +0 -2
  245. package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +0 -2
  246. package/dist/owletto/dist/assets/guardrails-BiJollCA.js +0 -2
  247. package/dist/owletto/dist/assets/identity-HCFWtdaI.js +0 -2
  248. package/dist/owletto/dist/assets/index-8wxsyxqt.js +0 -2
  249. package/dist/owletto/dist/assets/index-9YuSRymd.js +0 -7950
  250. package/dist/owletto/dist/assets/index-B3c-0eZG.js +0 -2
  251. package/dist/owletto/dist/assets/index-BSH07yVD.css +0 -1
  252. package/dist/owletto/dist/assets/index-BX0EA_oB.js +0 -2
  253. package/dist/owletto/dist/assets/index-CDz3-ieP.js +0 -12
  254. package/dist/owletto/dist/assets/index-CdJJaQDX.js +0 -2
  255. package/dist/owletto/dist/assets/index-CfT_W8Vo.js +0 -2
  256. package/dist/owletto/dist/assets/index-CxF2XXzl.js +0 -2
  257. package/dist/owletto/dist/assets/index-D3WHeGql.js +0 -2
  258. package/dist/owletto/dist/assets/index-DMNzF8Lf.js +0 -2
  259. package/dist/owletto/dist/assets/index-DyB3IzOA.js +0 -2
  260. package/dist/owletto/dist/assets/index-Vcq4gwWv.js +0 -2
  261. package/dist/owletto/dist/assets/index-fgAJydgX.js +0 -2
  262. package/dist/owletto/dist/assets/json-diff-DIN5Jhfx.js +0 -4
  263. package/dist/owletto/dist/assets/login-DxGYyE4n.js +0 -2
  264. package/dist/owletto/dist/assets/memory-browse-page-BnuhLJ6X.css +0 -1
  265. package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +0 -103
  266. package/dist/owletto/dist/assets/models-BAVeysNq.js +0 -2
  267. package/dist/owletto/dist/assets/new-C2av0diq.js +0 -2
  268. package/dist/owletto/dist/assets/new-snm1ctHn.js +0 -2
  269. package/dist/owletto/dist/assets/organization-Cb0W823y.js +0 -2
  270. package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +0 -2
  271. package/dist/owletto/dist/assets/permissions-Dv39zWKt.js +0 -2
  272. package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +0 -2
  273. package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +0 -2
  274. package/dist/owletto/dist/assets/recent-QhnLDU1_.js +0 -2
  275. package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +0 -2
  276. package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +0 -2
  277. package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +0 -2
  278. package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +0 -97
  279. package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +0 -2
  280. package/dist/owletto/dist/assets/settings-VDNiffKU.js +0 -2
  281. package/dist/owletto/dist/assets/skills-DgDGscm5.js +0 -2
  282. package/dist/owletto/dist/assets/source-record-panels-BdfOVPWn.js +0 -2
  283. package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +0 -2
  284. /package/vendor/postgres/{.bun-tag-2f292c6554a8475e → .bun-tag-22d644c2873790db} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "24.1.1",
3
+ "version": "24.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -240,6 +240,11 @@
240
240
  "types": "./dist/contracts/tools/source-files.d.ts",
241
241
  "import": "./dist/contracts/tools/source-files.js",
242
242
  "require": "./dist/contracts/tools/source-files.js"
243
+ },
244
+ "./contracts/entity-reference": {
245
+ "types": "./dist/contracts/entity-reference.d.ts",
246
+ "import": "./dist/contracts/entity-reference.js",
247
+ "require": "./dist/contracts/entity-reference.js"
243
248
  }
244
249
  },
245
250
  "dependencies": {
@@ -50,7 +50,9 @@ export class Query extends Promise {
50
50
  }
51
51
 
52
52
  cancel() {
53
- return this.canceller && (this.canceller(this), this.canceller = null)
53
+ // Cancellation uses a separate connection and is best effort. Its failure
54
+ // must not escape as an unhandled rejection; the statement settles itself.
55
+ return this.canceller && (this.canceller(this).catch(() => {}), this.canceller = null)
54
56
  }
55
57
 
56
58
  simple() {
@@ -50,7 +50,9 @@ const Query = module.exports.Query = class Query extends Promise {
50
50
  }
51
51
 
52
52
  cancel() {
53
- return this.canceller && (this.canceller(this), this.canceller = null)
53
+ // Cancellation uses a separate connection and is best effort. Its failure
54
+ // must not escape as an unhandled rejection; the statement settles itself.
55
+ return this.canceller && (this.canceller(this).catch(() => {}), this.canceller = null)
54
56
  }
55
57
 
56
58
  simple() {
@@ -50,7 +50,9 @@ export class Query extends Promise {
50
50
  }
51
51
 
52
52
  cancel() {
53
- return this.canceller && (this.canceller(this), this.canceller = null)
53
+ // Cancellation uses a separate connection and is best effort. Its failure
54
+ // must not escape as an unhandled rejection; the statement settles itself.
55
+ return this.canceller && (this.canceller(this).catch(() => {}), this.canceller = null)
54
56
  }
55
57
 
56
58
  simple() {
@@ -207,6 +207,12 @@ export function useQuery(query, options = {}) {
207
207
  // answer already on screen, drops a result.
208
208
  const readSeq = useRef(0);
209
209
  const shownSeq = useRef(0);
210
+ // A data change while a read is still answering waits for it and then reads
211
+ // once more, so a burst of writes costs one follow-up read instead of one
212
+ // concurrent read per write.
213
+ const reading = useRef(0);
214
+ const owed = useRef(false);
215
+ const [followUp, setFollowUp] = useState(0);
210
216
  const key = query === null
211
217
  ? null
212
218
  : typeof query === "string"
@@ -214,11 +220,12 @@ export function useQuery(query, options = {}) {
214
220
  : query.kind === "tool"
215
221
  ? `tool:${query.name}:${JSON.stringify(query.args)}`
216
222
  : `sql:${query.text}`;
217
- // biome-ignore lint/correctness/useExhaustiveDependencies: key is the stable identity of query (listing query itself refetches every render); rt.callTool is stable; tick and rt.dataVersion are the intentional refetch triggers.
223
+ // biome-ignore lint/correctness/useExhaustiveDependencies: key is the stable identity of query (listing query itself refetches every render); rt.callTool is stable; tick, rt.dataVersion and followUp are the intentional refetch triggers.
218
224
  useEffect(() => {
219
225
  // A skipped query is idle, even when the previous request is in flight.
220
226
  if (key === null) {
221
227
  lastRead.current = null;
228
+ owed.current = false;
222
229
  setState((s) => (s.loading ? { ...s, loading: false } : s));
223
230
  return;
224
231
  }
@@ -231,17 +238,33 @@ export function useQuery(query, options = {}) {
231
238
  lastRead.current.tick === tick) {
232
239
  return;
233
240
  }
241
+ const last = lastRead.current;
242
+ const background = last?.key === key &&
243
+ last.tick === tick &&
244
+ (last.dataVersion !== rt.dataVersion || last.followUp !== followUp);
245
+ lastRead.current = { key, dataVersion: rt.dataVersion, tick, followUp };
246
+ if (background && reading.current !== 0) {
247
+ owed.current = true;
248
+ return;
249
+ }
234
250
  const seq = ++readSeq.current;
251
+ reading.current = seq;
252
+ owed.current = false;
235
253
  const show = (next) => {
236
254
  if (lastRead.current?.key !== key || seq < shownSeq.current)
237
255
  return;
238
256
  shownSeq.current = seq;
239
257
  setState(next);
240
258
  };
241
- const background = lastRead.current?.key === key &&
242
- lastRead.current.tick === tick &&
243
- lastRead.current.dataVersion !== rt.dataVersion;
244
- lastRead.current = { key, dataVersion: rt.dataVersion, tick };
259
+ const settle = () => {
260
+ if (reading.current !== seq)
261
+ return;
262
+ reading.current = 0;
263
+ if (owed.current && lastRead.current?.key === key) {
264
+ owed.current = false;
265
+ setFollowUp((n) => n + 1);
266
+ }
267
+ };
245
268
  if (!background)
246
269
  setState((s) => ({ ...s, loading: true }));
247
270
  const q = query;
@@ -264,8 +287,9 @@ export function useQuery(query, options = {}) {
264
287
  truncatedColumns: [],
265
288
  loading: false,
266
289
  });
267
- });
268
- }, [key, rt.ready, tick, rt.dataVersion, live]);
290
+ })
291
+ .finally(settle);
292
+ }, [key, rt.ready, tick, rt.dataVersion, followUp, live]);
269
293
  const refetch = useCallback(() => setTick((t) => t + 1), []);
270
294
  return { ...state, refetch };
271
295
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hand-written MCP Apps guest transport for Lobu views.
3
3
  *
4
- * Zero dependencies on purpose: the spike measured zod + MCP SDK + ext-apps at
4
+ * No protocol SDK dependencies: the spike measured zod + MCP SDK + ext-apps at
5
5
  * 378 KB of a 577 KB view bundle, so the guest speaks the wire protocol
6
6
  * directly instead of importing `@modelcontextprotocol/ext-apps`. The method
7
7
  * names below mirror that SDK (protocol version `2026-01-26`): the host side
@@ -73,6 +73,7 @@ export declare class ViewBridge {
73
73
  * before it (the host seeds scope + params there; anything read earlier
74
74
  * runs against defaults and double-fetches). */
75
75
  private toolInputReceived;
76
+ private workspace;
76
77
  private hostContext;
77
78
  private didConnect;
78
79
  private handoff;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hand-written MCP Apps guest transport for Lobu views.
3
3
  *
4
- * Zero dependencies on purpose: the spike measured zod + MCP SDK + ext-apps at
4
+ * No protocol SDK dependencies: the spike measured zod + MCP SDK + ext-apps at
5
5
  * 378 KB of a 577 KB view bundle, so the guest speaks the wire protocol
6
6
  * directly instead of importing `@modelcontextprotocol/ext-apps`. The method
7
7
  * names below mirror that SDK (protocol version `2026-01-26`): the host side
@@ -13,6 +13,7 @@
13
13
  * "2.0", method, params }`. Anything else in the inbox is ignored, exactly
14
14
  * like the SDK's transport.
15
15
  */
16
+ import { VIEW_WORKSPACE_META_KEY } from "@lobu/core/contracts/tools/view-runtime";
16
17
  /** Event notifications worth replaying to the mounted guest (context merges
17
18
  * into adopted state instead; anything else is ignored). */
18
19
  const HANDOFF_NOTIFICATIONS = new Set([
@@ -50,6 +51,7 @@ export class ViewBridge {
50
51
  * before it (the host seeds scope + params there; anything read earlier
51
52
  * runs against defaults and double-fetches). */
52
53
  toolInputReceived = false;
54
+ workspace = null;
53
55
  hostContext = {};
54
56
  didConnect = false;
55
57
  handoff = null;
@@ -159,6 +161,8 @@ export class ViewBridge {
159
161
  if (isRecord(h.toolInput)) {
160
162
  this.toolInputReceived = true;
161
163
  const args = h.toolInput;
164
+ this.workspace =
165
+ typeof args.organization === "string" ? args.organization : null;
162
166
  for (const listener of [...this.toolInputListeners])
163
167
  listener(args);
164
168
  }
@@ -183,6 +187,9 @@ export class ViewBridge {
183
187
  return this.request("tools/call", {
184
188
  name,
185
189
  arguments: args,
190
+ ...(this.workspace
191
+ ? { _meta: { [VIEW_WORKSPACE_META_KEY]: this.workspace } }
192
+ : {}),
186
193
  });
187
194
  }
188
195
  /** Read one `resources/read` URI and return the first text payload. The
@@ -307,6 +314,8 @@ export class ViewBridge {
307
314
  case "ui/notifications/tool-input": {
308
315
  this.toolInputReceived = true;
309
316
  const args = isRecord(params.arguments) ? params.arguments : {};
317
+ this.workspace =
318
+ typeof args.organization === "string" ? args.organization : null;
310
319
  for (const listener of [...this.toolInputListeners])
311
320
  listener(args);
312
321
  break;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "24.1.1",
3
+ "version": "24.2.0",
4
4
  "description": "Authoring runtime for Lobu views — React modules rendered in the sandboxed MCP Apps frame",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-D3e4iPle.js","assets/index-9YuSRymd.js","assets/index-BSH07yVD.css","assets/record-activity-ZJntBfN_.js","assets/filter-editors-Bwhqj7lY.js","assets/connection-label-BobuYiAG.js","assets/source-record-panels-BdfOVPWn.js","assets/events-feed-DO3IiJO2.js","assets/conversations-table-D_HOe1jN.js","assets/clients-BhNl1tVq.js","assets/schema-value-normalization-CKdPjdPC.js","assets/card-jzhQrMDP.js","assets/client-rows-BYbsXGy9.js","assets/agent-loading-shells-B7v6Cffw.js","assets/member-scope-gate-DD4YBFn-.js","assets/record-field-peek-Brh1IQGy.js","assets/record-session-Pbr5czGw.js","assets/entity-avatar-mdh7Kq5D.js","assets/view-param-filters-B0quibBi.js","assets/app-bridge-BCm4muqj.js"])))=>i.map(i=>d[i]);
2
- import{al as x,am as m,an as p,ao as y,i as j,m as P,j as e,r as g,ap as R,l as f,_ as v}from"./index-9YuSRymd.js";import{P as r}from"./public-shell-ready-DqX8AXfw.js";const E=f(async()=>({default:(await v(async()=>{const{EntityPage:s}=await import("./entity-page-D3e4iPle.js");return{EntityPage:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))).EntityPage}));function l(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(R,{})})}function S(){const{owner:s,_splat:c}=x.useParams(),a=m(c||""),d=a?.viewKey,{path:u}=p(s,a?.entityPath),{data:t,isLoading:n,error:i}=y(u,{slug:s},{includeBootstrap:!0}),{session:h,isReady:o}=j();return P({active:!n&&o&&!h&&(!!i||!t),owner:s}),n||!o&&!t?e.jsx(l,{}):i||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't resolve this path."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsx(g.Suspense,{fallback:e.jsx(l,{}),children:e.jsx(E,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})]})}export{S as component};
3
- //# sourceMappingURL=_-BorucF19.js.map
@@ -1,2 +0,0 @@
1
- import{c3 as t,j as p,c4 as m}from"./index-9YuSRymd.js";import{A as e}from"./activity-route-view-D7ORHntE.js";import"./record-activity-ZJntBfN_.js";import"./filter-editors-Bwhqj7lY.js";import"./connection-label-BobuYiAG.js";import"./source-record-panels-BdfOVPWn.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./client-rows-BYbsXGy9.js";import"./agent-loading-shells-B7v6Cffw.js";import"./member-scope-gate-DD4YBFn-.js";import"./public-shell-ready-DqX8AXfw.js";function w(){const{owner:o,_splat:r}=t.useParams(),i=t.useSearch();return p.jsx(e,{owner:o,search:i,entityScope:m(r||"").path})}export{w as component};
2
- //# sourceMappingURL=_-CkGyNi0G.js.map
@@ -1,2 +0,0 @@
1
- import{hd as r,j as e}from"./index-9YuSRymd.js";import{A as n}from"./agents-workbench-DJ67GZ93.js";import"./agent-editor-form-DsSoeQeF.js";import"./model-selector-CDrAjH31.js";import"./proposal-review-shell-CFhOqCLf.js";function i(){const{owner:o,agentId:t}=r.useParams();return e.jsx(n,{owner:o,agentId:t})}export{i as component};
2
- //# sourceMappingURL=_agentId-BrhcaxUk.js.map
@@ -1,2 +0,0 @@
1
- import{o as L,gd as y,r as u,ge as C,j as n,Q as D,gf as S,i as P,bh as R,a_ as E,aR as M,bb as N,ch as O,gg as Q,gh as $,bo as B,w as _}from"./index-9YuSRymd.js";import{L as z,A as F}from"./agent-thread-D38STyeu.js";import{A as H,C as U}from"./agent-loading-shells-B7v6Cffw.js";import"./app-bridge-BCm4muqj.js";import"./use-mention-search-Dcunv4L0.js";import"./index-Vcq4gwWv.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";function W({owner:t,agent:s,threadId:e,afterMessagesContent:d,className:r,initialDraft:p,newChatRequested:m=!1,preventAutoNavigate:g}){const o=L(),i=s.agentId,{data:a=[]}=y(i,{orgSlug:t}),[l,x]=u.useState(()=>C()),[h,A]=u.useState(null);u.useEffect(()=>{!m||e||(x(C()),A(null),o({to:".",search:(f=>{const{new:b,...w}=f;return w}),replace:!0}))},[m,e,o]);const v=u.useMemo(()=>!h||a.some(f=>f.id===h.id)?a:[h,...a],[a,h]),c=e??l,T=!e||!v.some(f=>f.id===e),j=u.useCallback(()=>{if(v.some(b=>b.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const f=S(t,i,c);o({...f,replace:!0})},[v,c,o,t,i]),k=u.useCallback(()=>{T&&!g&&j()},[T,j,g]);return n.jsx("div",{className:D("flex min-h-0 flex-1 flex-col",r),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(z,{agentId:i,workspaceSlug:t,thread:c,loadHistory:!!e,onFirstUserMessage:k,initialDraft:p,children:n.jsx(F,{afterMessagesContent:d})},`${i}:${c}`)})})}function q({owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:r,afterMessagesContent:p,preventAutoNavigate:m}){const{isAuthenticated:g}=P(),{isMember:o,isLoading:i}=R(),a=g&&o,{data:l=[],isLoading:x}=E({enabled:a}),h=s??null,A=l.find(c=>c.agentId===h)??null;return a&&x||i?n.jsx(H,{}):A?n.jsx(W,{owner:t,agent:A,threadId:e,initialDraft:d,newChatRequested:r,afterMessagesContent:p,preventAutoNavigate:m,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(M,{icon:N,title:"Agent not found",description:"This agent may have been removed."})}function G(t){return[...t].sort((s,e)=>e.updatedAt-s.updatedAt)[0]}function J({owner:t,agentId:s,threadId:e,initialDraft:d,forceComposer:r=!1,newChatRequested:p=!1,afterMessagesContent:m,preventAutoNavigate:g}){const o=L(),{data:i=[],isLoading:a}=O(Q(t,s,{strict:!1})),l=u.useMemo(()=>G(i),[i]);return u.useEffect(()=>{if(e||r||a||!l)return;const x=S(t,s,l.id);o({...x,replace:!0})},[s,a,l,o,t,e,r]),!e&&!r&&(a||l)?n.jsx(U,{}):n.jsx(q,{owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:p,afterMessagesContent:m,preventAutoNavigate:g})}function ie(){const{owner:t,agentId:s}=$.useParams(),{threadId:e}=B({strict:!1}),{new:d,prompt:r}=_({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 pt-2.5 pb-4 lg:px-6 lg:pb-6",children:n.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:n.jsx(J,{owner:t,agentId:s,threadId:e,initialDraft:r,forceComposer:!e,newChatRequested:!!d})})})}export{ie as component};
2
- //# sourceMappingURL=_agentId-DgRrCE2B.js.map
@@ -1,2 +0,0 @@
1
- import{o as N,n as A,ao as b,i as k,bh as L,e7 as C,j as t,B as n,gK as y,bb as R,S as _,L as $,b9 as D,h2 as u,ai as O}from"./index-9YuSRymd.js";import{A as z}from"./automation-detail-content-DSwbRpbx.js";import"./create-automation-form-Bpy92SM5.js";import"./cronstrue-CWImw-kf.js";import"./entity-options-Clz_WXK-.js";import"./connection-label-BobuYiAG.js";import"./model-selector-CDrAjH31.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-CEqoCky-.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-Dcunv4L0.js";import"./proposal-review-shell-CFhOqCLf.js";import"./json-diff-DIN5Jhfx.js";import"./deployments-C5hvipQh.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";function P({owner:e,automationId:o,view:a,runId:s}){const r=N(),{orgContext:p,hasOrgContext:x}=A(),{data:h,isLoading:m}=b(`/${e}`,p),{isAuthenticated:g}=k(),{isLoading:c}=L(),f=h?.workspace?.id??"",v=g?!x||m||c:m||c,i=C(o,void 0,f).data?.automation,j=i?.automation_name??"Automation",l=()=>void r({to:"/$owner/automations",params:{owner:e}}),d=()=>void r({to:"/$owner/automations/$automationId",params:{owner:e,automationId:o},search:{view:"activity",run_id:void 0}}),w=!s&&a==="definition";return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsxs("div",{className:"mx-auto flex w-full min-w-0 max-w-3xl flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsxs(n,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:l,children:[t.jsx(y,{className:"h-3.5 w-3.5"}),"Automations"]}),t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx(R,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),v&&!i?t.jsx(_,{className:"h-5 w-40"}):s?"Review change":j]})]}),s?null:w?t.jsx(n,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:d,children:"Done"}):t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs($,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:o},search:{view:"definition",run_id:void 0},children:[t.jsx(D,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),t.jsx(z,{owner:e,agentId:i?.managed_agent_id??null,automationId:o,view:a,runId:s,onDone:s?l:d})]})})}function ot(){const{owner:e,automationId:o}=u.useParams(),a=u.useSearch();return t.jsx(O,{owner:e,children:()=>t.jsx(P,{owner:e,automationId:o,view:a.view,runId:a.run_id})})}export{ot as component};
2
- //# sourceMappingURL=_automationId-DSrZIYcs.js.map
@@ -1,2 +0,0 @@
1
- import{iD as I,j as e,ai as J,o as U,aA as q,d7 as z,cg as Q,cP as X,S as A,B as Y,L as p,aB as Z,im as K,io as ee,aP as ne,gb as h,ih as se,g9 as ae,aW as oe,i4 as te,ga as ie,ht as E,aJ as ce,x as re}from"./index-9YuSRymd.js";import{R as de,c as le,C as me}from"./device-pin-tombstone-2U0UMu3_.js";import{a as pe}from"./connector-provenance-D-ECOlMJ.js";import{f as ue,C as he,F as xe,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-WcGCA6qY.js";import{S as De,g as Ne}from"./runs-table-B1APZv7d.js";import{c as ge}from"./connection-label-BobuYiAG.js";import"./runs-panel-C0_DNTcq.js";import"./filter-editors-Bwhqj7lY.js";import"./connector-scope-lists-CRFEpSvk.js";import"./entity-options-Clz_WXK-.js";function ye(){const{owner:l,connectorKey:n,connectionId:v}=I.useParams(),{addFeed:o,feedId:c,settings:x,auth_result:t}=I.useSearch();return e.jsx(J,{owner:l,children:m=>e.jsx($e,{organizationId:m.organizationId,ownerSlug:m.ownerSlug,isWorkspaceLoading:m.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:o===!0,feedId:c,openSettings:x===!0,authResult:t})})}function $e({organizationId:l,ownerSlug:n,isWorkspaceLoading:v,connectorKey:o,connectionId:c,showAddFeed:x,feedId:t,openSettings:m,authResult:R}){const y=U(),{data:B=[]}=q(),{data:P=[],isLoading:M,isError:j,refetch:T}=z(l??"",{connectorKey:o,connectionIds:[c]}),{data:g=[]}=Q(l??""),{data:W=[],isLoading:O,isError:S,refetch:H}=X(t?c:null),s=P.find(i=>i.id===c),a=g.find(i=>i.key===o),r=t?W.find(i=>i.id===t):null;if(v||M||t&&O||!l)return e.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[e.jsx(A,{className:"h-7 w-56"}),e.jsx(A,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||t&&S)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Y,{variant:"outline",size:"sm",onClick:()=>void(j?T():H()),children:"Retry"})]});if(!s)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",a?.name??o]})]});const $=ge({...s,connector_name:s.connector_name??a?.name??null}),C=!t&&!x,V=()=>void y({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},replace:!0});let u,f=$,_,k,D;t?r?(f=ue(r,a),r.store==="channel_messages"?(u=e.jsx(he,{feed:r,hideHeader:!0}),D="chat channel"):(_=e.jsx(xe,{feed:r,ownerSlug:n}),k=e.jsx(fe,{feed:r}),u=e.jsx(ve,{feed:r,connectorDef:a,ownerSlug:n}))):(u=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),f="Feed"):x&&(u=e.jsx(je,{onClose:V,organizationId:l,connections:[s],connectorDefinitions:g}),f="Add feed",D=Ce);const d=B.find(i=>i.id===s.device_worker_id&&Z(i,n)),w=d?K(d):void 0,N=w?ee(n,w,ne()):void 0,F=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:h,children:"Connectors"},"connectors"),...d&&N?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:N.id},className:h,children:N.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:h,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:h,children:a?.name??o},"connector")]];C||F.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},className:h,children:$},"connection"));const b=C?le(s):null,G=D??b??void 0,L=e.jsx(ae,{breadcrumb:e.jsx(ie,{crumbs:F}),icon:a?e.jsx(oe,{icon:a.icon,name:a.name,faviconDomain:a.favicon_domain??te(a.auth_schema)}):null,title:f,status:_??e.jsx(De,{status:Ne(s.status),showDot:!0,children:s.status}),meta:k,caption:G,captionTone:b?"error":"muted"});return C?d&&a&&ce(a)?e.jsx(re,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},search:{connection:s.id,settings:m||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(E,{header:L,children:[e.jsx(pe,{connectorDef:a,connectorKey:o,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(me,{embedded:!0,connection:s,connectorDef:a,ownerSlug:n,openSettings:m,authResult:R},s.id)]}):e.jsx(E,{header:L,children:e.jsx("div",{className:"mt-0",children:u})})}export{ye as component};
2
- //# sourceMappingURL=_connectorKey._connectionId-DWxv1uoi.js.map
@@ -1,2 +0,0 @@
1
- import{ax as Pe,ay as De,az as Ee,aH as me,aE as ae,hr as ls,hs as os,j as e,ht as le,B as g,L as K,aG as he,g9 as oe,ga as ce,gb as X,hu as cs,$ as ds,hv as te,r as p,hw as we,hx as Fe,cx as us,hy as Ae,bJ as Y,hz as _e,z as $,bp as Le,bq as Re,br as Oe,bs as Be,bt as Ke,hk as ms,I as F,bA as G,a2 as q,A as Se,hA as hs,hB as xs,bd as ps,hC as fs,a$ as xe,hD as gs,hE as js,hF as Ue,hG as Ie,hH as ze,af as ne,P as U,b8 as de,hI as vs,ft as ys,hJ as Ns,e_ as J,hK as bs,S as D,hL as B,i as Cs,hM as ks,hN as ws,hO as As,hP as _s,hQ as Ss,hR as $s,hS as Ps,hT as Ds,bR as se,hU as Es,hV as Fs,bQ as Ls,ec as Rs,g$ as Os,Q as re,ed as Bs,bU as Ks,cT as Me,hW as H,hX as Us,ai as Is,hY as Te,aw as ie,u as Ve,hZ as qe,aK as zs,h_ as We,h$ as Ms,i0 as Ye,i1 as Ts,ee as Vs,av as qs,d7 as Ws,aS as Ys,aC as M,i2 as Xe,o as Q,aX as Qe,aW as pe,aT as Xs,i3 as Qs,i4 as Gs}from"./index-9YuSRymd.js";import{C as Hs,a as Ge}from"./connections-browser-CrtnAs0Q.js";import{C as Js}from"./connector-provenance-D-ECOlMJ.js";import{R as Zs}from"./runs-panel-C0_DNTcq.js";import"./connection-label-BobuYiAG.js";import"./filter-editors-Bwhqj7lY.js";import"./runs-table-B1APZv7d.js";function et({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",r=Pe({enabled:n}),i=De({enabled:n}),h=Ee({enabled:!n}),o=n?r:h,l=n?i.data?.find(c=>c.slug===a)?.displayName??a:me(a),x=(n?(r.data??[]).filter(c=>c.kind===a).map(c=>({key:`${ae}${c.slug}`,name:c.displayName||c.slug,status:[c.isDefault?"Default":null,c.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(c=>c.providerKind===a).map(c=>({key:`${ls}${c.id}`,name:c.name,status:c.connected?"Connected":"Needs credentials"}))).map(c=>({id:c.key,name:c.name,description:c.status,tone:null,link:os({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:c.key},search:{}})})),u=`${n?ae:he}${a}`;return e.jsx(le,{header:e.jsx(oe,{title:l,breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors")]})}),children:e.jsx(Hs,{entries:x,isLoading:o.isLoading,isError:o.isError,onRetry:()=>void o.refetch(),action:e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:n?e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:u},search:{addAccount:!0},children:"Add connection"}):e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:u},children:"Add connection"})})})})}function st({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:r,onDone:i}){const h=cs(),o=ds(),l=s.find(d=>d.slug===t)??s[0],x=n&&l&&te(l)?"oauth":"api-key",[u,c]=p.useState(l?.slug??""),[j,N]=p.useState(a??l?.slug??""),[m,y]=p.useState(l?.displayName??""),[b,P]=p.useState(l?.baseUrl??""),[w,k]=p.useState(r??l?.defaultModel??""),[E,_]=p.useState(""),[z,R]=p.useState(l?.apiKeyPlaceholder??""),[I,O]=p.useState(x),[v,f]=p.useState(""),[A,W]=p.useState(null),[T,V]=p.useState(!1),[fe,ge]=p.useState(!1),C=s.find(d=>d.slug===u),Z=we(C?.modalities??[]),je=n&&!!C&&te(C),ve=C?Fe(C):!1,ye=je&&I==="oauth",Ne=ve&&!ye,L=us().slug,ee=p.useCallback(()=>{ge(!0),o.invalidateQueries({queryKey:["inference-providers"]})},[o]),Ze=p.useCallback(()=>{o.invalidateQueries({queryKey:["inference-providers"]}),i()},[o,i]),es=p.useCallback(async()=>{if(!(!L||!C)){V(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(d.authorizeUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{V(!1)}}},[L,C]),ss=p.useCallback(async()=>{if(!(!L||!C||!v.trim())){V(!0);try{const d=await _e(L,C.slug,{code:v.trim()});if(d.status!=="success")throw new Error(d.error||"Sign-in not complete");ee(),Y.success(`Signed in with ${C.displayName}`)}catch(d){Y.error(d instanceof Error?d.message:"Failed to complete sign-in")}finally{V(!1)}}},[L,C,v,ee]),ts=p.useCallback(async()=>{if(!(!L||!C)){V(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="device")throw new Error("Unexpected sign-in mode");W({userCode:d.userCode,deviceAuthId:d.deviceAuthId,verificationUrl:d.verificationUrl}),window.open(d.verificationUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{V(!1)}}},[L,C]),as=p.useCallback(async()=>{if(!(!L||!C||!A)){V(!0);try{const d=await _e(L,C.slug,{deviceAuthId:A.deviceAuthId,userCode:A.userCode});if(d.status==="success"){ee(),Y.success(`Signed in with ${C.displayName}`);return}W(S=>S&&{...S,message:d.error||"Waiting for approval..."})}catch(d){Y.error(d instanceof Error?d.message:"Failed to check status")}finally{V(!1)}}},[L,C,A,ee]),ns=C?.supportedAuthTypes.includes("device-code")??!1,rs=d=>{c(d);const S=s.find(ue=>ue.slug===d);S&&(N(S.slug),y(S.displayName),P(S.baseUrl),k(S.slug===t&&r?r:S.defaultModel??""),R(S.apiKeyPlaceholder),O(n&&te(S)?"oauth":"api-key"),f(""),W(null),ge(!1))},be=/^[a-z0-9][a-z0-9-]*$/.test(j),Ce=be&&Ne&&E.trim().length>0&&!h.isPending,is=d=>{if(d.preventDefault(),!Ce)return;const S={};b.trim()&&(S.base_url=b.trim()),w.trim()&&(S.model=w.trim());const ue=Object.keys(S).length>0?{text:S}:void 0;h.mutate({slug:j.trim(),kind:u,displayName:m.trim()||void 0,apiKey:E.trim(),capabilities:ue},{onSuccess:()=>i()})},ke=!!(t&&s.some(d=>d.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ke&&C?`Connect ${C.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:is,className:"grid max-w-md gap-3",children:[ke&&C?e.jsx("p",{className:"text-xs text-muted-foreground",children:Z.length>0?`Serves text, plus ${Z.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(Le,{value:u,onValueChange:rs,children:[e.jsx(Re,{id:"ip-provider",className:"w-full",children:e.jsx(Oe,{})}),e.jsx(Be,{children:s.map(d=>{const S=we(d.modalities);return e.jsx(Ke,{value:d.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[d.iconUrl?e.jsx("img",{src:d.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(ms,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.displayName,S.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",S.join(", ")]}):null]})},d.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Z.length>0?`Serves text, plus ${Z.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-display",children:"Name"}),e.jsx(F,{id:"ip-display",placeholder:"Friendly name",value:m,onChange:d=>y(d.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs($,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-slug",placeholder:"my-provider",value:j,onChange:d=>N(d.target.value),autoComplete:"off",required:!0}),j&&!be?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),je&&ve?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:I==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:I==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,Ne?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(F,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:b,onChange:d=>P(d.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-model",children:"Default model"}),e.jsx(F,{id:"ip-model",placeholder:"gpt-4o-mini",value:w,onChange:d=>k(d.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs($,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-key",type:"password",placeholder:z||void 0,value:E,onChange:d=>_(d.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(G,{onCancel:i,children:e.jsx(g,{type:"submit",disabled:!Ce,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(q,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ye?e.jsxs("div",{className:"grid gap-3",children:[fe?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",C?.displayName??"provider",". This covers your agents in this org."]}):ns?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ts(),disabled:T||!L,children:A?"Get a new code":"Get device code"}),A?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(F,{id:"ip-device-code",readOnly:!0,value:A.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:A.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",C?.displayName??"provider"," to approve",e.jsx(Se,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void as(),disabled:T,children:T?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void es(),disabled:T||!L,children:["Sign in with ",C?.displayName??"provider",e.jsx(Se,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(F,{id:"ip-oauth-code",placeholder:"code#state",value:v,onChange:d=>f(d.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void ss(),disabled:T||!v.trim(),children:T?"Finishing...":"Finish sign-in"})]}),e.jsx(G,{onCancel:i,children:e.jsx(g,{type:"button",onClick:Ze,disabled:!fe,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(G,{onCancel:i})]})]})]})}const tt={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function at({provider:s,catalog:t,autoOpenEdit:a}){const n=hs(),[r,i]=p.useState(a?"edit":null),h=xs(s.kind,t);p.useEffect(()=>{a&&i("edit")},[a]);const l=(t.find(c=>c.slug===s.kind)?.modalities??["text"]).filter(c=>c!=="text"),x=h&&l.length>0,u=c=>i(j=>j===c?null:c);return e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:"Credential"}),e.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[s.slug,s.createdAt?` · created ${ps(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),x?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("edit"),children:"Edit"})]})]}),r==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(rt,{provider:s,supportsUpstreamConfig:h,onDone:()=>i(null)})}):null,r==="capabilities"&&x?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),l.map(c=>e.jsx(it,{providerSlug:s.slug,modality:c,block:s.capabilities[c]??{}},c))]})}):null]})}function nt({provider:s,onDeleted:t}){const a=fs(),[n,r]=p.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>r(!1)}),children:[a.isPending?e.jsx(q,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>r(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>r(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function rt({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=gs(),r=js(),i=Ue(),[h,o]=p.useState(s.displayName??""),[l,x]=p.useState(""),u=s.capabilities.text??{},[c,j]=p.useState(u.base_url??""),[N,m]=p.useState(u.model??""),[y,b]=p.useState(null),P=h.trim().length>0&&h.trim()!==(s.displayName??""),w=t&&l.trim().length>0,k=c.trim()!==(u.base_url??""),E=N.trim()!==(u.model??""),_=t&&(k||E),z={base_url:c.trim()||void 0,model:N.trim()||void 0,models_endpoint:u.models_endpoint},R=Ie(z),I=t&&_&&ze(R),O=n.isPending||r.isPending||i.isPending,v=(P||w||_)&&!I&&!O,f=async A=>{if(A.preventDefault(),!!v){b(null);try{await Promise.all([P?n.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),_?i.mutateAsync({providerSlug:s.slug,modality:"text",block:z}):Promise.resolve(),w?r.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{b("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:f,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(F,{id:`edit-name-${s.slug}`,value:h,onChange:A=>o(A.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(F,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:c,onChange:A=>j(A.target.value),autoComplete:"off"}),R.base_url?e.jsx("p",{className:"text-xs text-destructive",children:R.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(F,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:A=>m(A.target.value),autoComplete:"off"}),R.model?e.jsx("p",{className:"text-xs text-destructive",children:R.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(F,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:A=>x(A.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,y?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:y}):null,e.jsx(G,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!v,children:O?e.jsxs(e.Fragment,{children:[e.jsx(q,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function it({providerSlug:s,modality:t,block:a}){const n=Ue(),[r,i]=p.useState(!1),[h,o]=p.useState(a.base_url??""),[l,x]=p.useState(a.model??""),[u,c]=p.useState(a.models_endpoint??""),[j,N]=p.useState(!!a.models_endpoint),m=!!(a.base_url||a.model||a.models_endpoint),y={base_url:h.trim()||void 0,model:l.trim()||void 0,models_endpoint:u.trim()||void 0},b=Ie(y),P=ze(b),w=()=>{P||n.mutate({providerSlug:s,modality:t,block:y})};return e.jsxs("div",{className:ne,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>i(k=>!k),children:[e.jsx("span",{className:"text-sm font-medium",children:tt[t]}),m?e.jsx(U,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),r?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(F,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:h,onChange:k=>o(k.target.value),autoComplete:"off"}),b.base_url?e.jsx("p",{className:"text-xs text-destructive",children:b.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(F,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:k=>x(k.target.value),autoComplete:"off"}),b.model?e.jsx("p",{className:"text-xs text-destructive",children:b.model}):null]}),j?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(F,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:u,onChange:k=>c(k.target.value),autoComplete:"off"}),b.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:b.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!0),children:"Advanced"}),e.jsx(G,{onCancel:()=>i(!1),children:e.jsx(g,{size:"sm",disabled:P||n.isPending,onClick:w,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(q,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function lt({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(ct,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(U,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(U,{className:"h-4 border-transparent bg-emerald-500/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-emerald-500",children:"Connected"}):e.jsx(U,{variant:"destructive",className:"h-4 border-transparent bg-destructive/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-destructive",children:"No credential"})]}),t.length>0?e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:t.map(([a,n])=>`${a}: ${n}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function ot({sandbox:s,onDeleted:t}){const a=vs(),[n,r]=p.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(xe,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(q,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>r(!0),children:"Delete sandbox"})]})})}function ct({kind:s}){return s==="vercel"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 shrink-0 fill-foreground","aria-hidden":!0,children:[e.jsx("title",{children:"Vercel"}),e.jsx("path",{d:"M12 3 22 20H2L12 3Z"})]}):s==="builtin"?e.jsx(ys,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ns,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const dt={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},ut={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Kt(){const{owner:s,connectorKey:t}=H.useParams(),{instances:a}=H.useSearch(),{kind:n,id:r}=Us(t);return e.jsx(Is,{owner:s,children:({ownerSlug:i,organizationId:h,isWorkspaceLoading:o})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(et,{ownerSlug:i,familyKind:n,familyId:r});switch(n){case"inference":return e.jsx(xt,{ownerSlug:i,providerSlug:r});case"sandbox":return e.jsx(ht,{ownerSlug:i,sandboxId:r});case"sandbox-provider":return e.jsx(mt,{ownerSlug:i,providerKind:r});default:return e.jsx(jt,{ownerSlug:i,organizationId:h,isWorkspaceLoading:o,connectorKey:t})}}})}function mt({ownerSlug:s,providerKind:t}){const a=Q();return p.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${he}${t}`},replace:!0})},[a,s,t]),null}function ht({ownerSlug:s,sandboxId:t}){const a=Q(),{data:n,isLoading:r,isError:i,refetch:h}=Ee(),o=n?.sandboxes.find(x=>x.id===t)??null;if(r)return e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-24 w-full rounded-lg"})]});if(i)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(g,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!o)return e.jsxs(M,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const l=o.name||me(o.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors"),e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${he}${o.providerKind}`},search:{instances:!0},className:X,children:me(o.providerKind)},"family")]}),icon:e.jsx(pe,{name:l,faviconDomain:Xs(o.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"secondary",children:o.providerKind}),o.connected?e.jsx(U,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(U,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Qe,{facets:ut})}),children:[e.jsx(lt,{sandbox:o}),e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(ot,{sandbox:o,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function xt({ownerSlug:s,providerSlug:t}){const a=Q(),{model:n,reason:r,agentId:i,addAccount:h}=H.useSearch(),{data:o=[],isLoading:l,isError:x,refetch:u}=Pe(),c=De(),{data:j=[],isLoading:N}=c,m=h?null:o.find(E=>E.slug===t)??null,y=j.find(E=>E.slug===(m?.kind??t))??null;if(l||N)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(x)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(g,{variant:"outline",onClick:()=>void u(),children:"Retry"})]})});if(!m&&!y&&!c.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Xe,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const b=m?m.displayName||m.slug:y?.displayName||t,P=m!==null,w=r?e.jsx(gt,{agentId:i,model:n,providerName:b}):n?e.jsx(ft,{providerName:b,model:n,isConnected:P}):null,k=e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors"),...m?[e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${m.kind}`},search:{instances:!0},className:X,children:y?.displayName??m.kind},"family")]:[]]}),icon:e.jsx(pe,{iconUrl:y?.iconUrl,name:b}),title:b,badge:m?e.jsxs(e.Fragment,{children:[m.isDefault?e.jsx(U,{variant:"secondary",children:"Default"}):null,m.status?e.jsx(U,{variant:"outline",children:m.status}):null,m.hasCustomUpstream?e.jsx(U,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Qe,{facets:dt})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:k,children:[w,e.jsx("div",{className:"space-y-6",children:m?e.jsx(at,{provider:m,catalog:j,autoOpenEdit:!!n}):e.jsx(pt,{ownerSlug:s,providerSlug:t,existingSlugs:o.map(E=>E.slug),catalog:j,catalogError:c.isError?c.error:null,model:n})}),m?e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(nt,{provider:m,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function pt({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:r,model:i}){const h=Q(),o=n.find(u=>u.slug===t),l=a.includes(t)&&!!o&&te(o);let x=t;for(let u=2;a.includes(x);u++)x=`${t}-${u}`;return r?e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Failed to load provider catalog."}),e.jsx("p",{className:"mt-1 text-xs",children:r instanceof Error?r.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${t}`},search:{},children:"Open existing connection"})})]}),(!l||o&&Fe(o))&&e.jsx(st,{catalog:n,initialProvider:t,initialSlug:x,allowOAuth:!l,initialModel:i?.includes("/")?i.split("/").slice(1).join("/"):i,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function ft({providerName:s,model:t,isConnected:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review ",e.jsx("strong",{children:s})," for model"," ",e.jsx("strong",{children:t}),"."," ",a?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function gt({agentId:s,model:t,providerName:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"This agent needs a model provider before it can reply."}),e.jsxs("p",{children:[s?e.jsxs("span",{children:["Agent ",e.jsx("strong",{children:s})," is"," "]}):null,"configured to use ",t?e.jsx("strong",{children:t}):"a model"," ","from ",e.jsx("strong",{children:a}),", but that provider is not ready in this workspace."]}),e.jsx("p",{children:"Connect the provider below, then retry the message."})]})]})})}function jt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:r=[],isLoading:i,isError:h,refetch:o}=qs(t??""),{data:l=[],isLoading:x,isError:u,refetch:c}=Ws(t??"",{connectorKey:n}),j=p.useMemo(()=>r.find(y=>y.key===n),[r,n]),N=p.useMemo(()=>Ys(n,r,{name:l[0]?.connector_name??n}),[n,r,l]);if(a||i)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(h||u)return e.jsx(M,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(g,{variant:"outline",onClick:()=>{o(),c()},children:"Retry"})]})});const m=j?e.jsx(yt,{connector:j,ownerSlug:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Xe,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",l.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:j&&t?e.jsx(vt,{hero:m,connector:j,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:x,refetchConnections:c}):e.jsxs(M,{className:"space-y-6",children:[m,l.length>0&&!x?e.jsx(Ge,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):e.jsx(He,{organizationId:t??"",ownerSlug:s,connectorKey:n,connections:l,isLoading:x})]})})}function vt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}){const{isAdmin:l,isLoading:x}=J(a),u=(t.operations_summary?.total??0)>0;return e.jsxs(le,{header:s,children:[e.jsx(bs,{organizationId:a,connectorKey:r}),e.jsx(At,{connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}),i.length>0?e.jsx(Ge,{section:!0,connections:i,connector:t,ownerSlug:n,connectorKey:r}):null,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(St,{connector:t,organizationId:a,ownerSlug:n}),u&&x?e.jsx(D,{className:"h-20 w-full rounded-lg"}):u&&l?e.jsx(Ct,{connector:t,organizationId:a,ownerSlug:n}):u&&!l?e.jsx(B,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(Nt,{connector:t,organizationId:a,ownerSlug:n,connectionCount:i.length}),!h&&i.length>0?e.jsx(B,{title:"Recent activity",children:e.jsx(Zs,{scope:{connectorKey:r},ownerSlug:n})}):null]})}function yt({connector:s,ownerSlug:t}){return e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:t},className:X,children:"Connectors"},"connectors")]}),icon:e.jsx(pe,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Gs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsx(Js,{connectorDef:s,ownerSlug:t}),caption:s.description})}function Nt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Te(s.auth_schema),i=zs(s.auth_schema),h=r.find(w=>w.type==="oauth"),o=We(s.auth_schema),l=r.some(w=>w.type==="env_keys"),x=r.some(w=>w.type==="browser"),u=i.some(w=>w.type==="interactive"),c=!!(h||o||l||x),j=Ms(s),{isAdmin:N}=J(t),{data:m=[]}=ie(t,{connectorKey:s.key,profileKind:"env"}),{data:y=[]}=ie(t,{profileKind:"browser_session",connectorKey:s.key}),b=N&&s.installed!==!1;return!!(h||o)||l&&m.length>0||x&&y.length>0||!c||b?e.jsxs("div",{className:"space-y-6",children:[h?e.jsx(kt,{connector:s,organizationId:t,oauthMethod:h}):null,o?e.jsx(B,{title:"App installation",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install the ",s.name," app to create or repair the workspace connection."]}),e.jsx(Ye,{organizationId:t,connectorKey:s.key,provider:o.provider,providerLabel:s.name,installShape:o.installShape,variant:"outline"})]})}):null,l&&m.length>0?e.jsx($e,{profiles:m,type:"env"}):null,x&&y.length>0?e.jsx($e,{profiles:y,type:"browser_session"}):null,c?null:j?e.jsx(B,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):u?e.jsx(B,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):e.jsx(B,{title:"Authentication",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector doesn't need workspace credentials. Create a connection above to get started."})}),e.jsx(bt,{connector:s,organizationId:t,ownerSlug:a,connectionCount:n})]}):null}function bt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Q(),{isAdmin:i}=J(t),h=Qs(),[o,l]=p.useState(!1),[x,u]=p.useState(null),c=s.installed!==!1;if(!i||!c)return null;const j=n>0,N=h.isPending,m=()=>{u(null),h.mutate({connector_key:s.key},{onSuccess:()=>{r({to:"/$owner/connectors",params:{owner:a}})},onError:y=>{u(y instanceof Error?y.message:"Failed to remove connector"),l(!1)}})};return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove connector"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Archives ",s.name," in this workspace. Existing synced data stays in memory."]}),j?e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,x?e.jsx("p",{className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}):null,e.jsx("div",{className:"mt-3",children:o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:N,onClick:m,children:[N?e.jsx(q,{size:"md",className:"mr-1.5"}):null,"Confirm remove"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:N,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:N||j,onClick:()=>l(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove connector"]})})]})}function Ct({connector:s,organizationId:t,ownerSlug:a}){const n=Ve();return e.jsx(qe,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function kt({connector:s,organizationId:t,oauthMethod:a}){const{isAdmin:n,isLoading:r}=J(t),{setup:i}=H.useSearch(),h=H.useNavigate(),{data:o=[],refetch:l,isLoading:x,isError:u}=ie(t,{connectorKey:s.key,provider:a.provider}),c=o.filter(j=>j.profile_kind==="oauth_app");return r||x?e.jsx(D,{className:"h-28 w-full"}):u?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load OAuth apps. Reload the page to try again."}):e.jsx(wt,{connector:s,oauthMethod:a,appProfiles:c,isAdmin:n,initialOpen:i==="oauth_app",onClose:()=>{i==="oauth_app"&&h({search:j=>({...j,setup:void 0}),hash:"",replace:!0})},refetchProfiles:l})}function wt({initialOpen:s=!1,onClose:t,connector:a,oauthMethod:n,appProfiles:r,isAdmin:i,refetchProfiles:h}){const o=Ps(),l=Ds(),[x,u]=se(a.key,s&&i),[c,j]=p.useState(!1);p.useEffect(()=>{s&&i&&u(!0)},[s,i,u]);const N=`${Es()}/connect/oauth/callback`,[m,y]=se(a.key,`${a.name} OAuth App`),[b,P]=se(a.key,""),[w,k]=se(a.key,null),E=Fs(n),_=Ls(`${a.key}:${x}`,Rs(E),E),{values:z,setValues:R}=_,I=r.find(v=>v.is_default_for_connector&&v.connector_key===a.key),O=()=>{_.canSubmit&&(k(null),o.mutate({connector_key:a.key,profile_kind:"oauth_app",display_name:m.trim()||`${a.name} OAuth App`,slug:b.trim()||void 0,credentials:Pt(Vs(z))},{onSuccess:v=>{const f=v.auth_profile?.slug;f&&!I&&l.mutate({connector_key:a.key,auth_profile_slug:f}),u(!1),t?.(),y(`${a.name} OAuth App`),P(""),h()},onError:v=>{k(v instanceof Error?v.message:"Failed to add OAuth app")}}))};return e.jsxs(B,{id:"connector-oauth-apps",title:`${$t(n.provider)} app configuration`,action:i&&!x?e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[e.jsx(Me,{className:"size-3.5"}),"Add OAuth app"]}):null,children:[i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx($,{children:"OAuth callback URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs",children:N}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(N).then(()=>j(!0)).catch(()=>k("Could not copy the callback URL. Select and copy it above."))},children:[e.jsx(Os,{className:"mr-1.5 h-3.5 w-3.5"}),c?"Copied":"Copy callback URL"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Register this exact URL in your provider’s app settings before saving the client configuration."})]}),r.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No app configured on this server. Choose a managed option if available, or add your own app here."}):e.jsx("div",{className:"space-y-2",children:r.map(v=>e.jsxs("div",{className:re(ne,"flex flex-wrap items-center gap-3 p-3"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:v.display_name}),v.is_default_for_connector&&v.connector_key===a.key?e.jsx(U,{variant:"secondary",className:"text-[10px]",children:"Default"}):null,e.jsx(Je,{status:v.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:v.slug})]}),i&&!v.is_default_for_connector&&v.connector_key===a.key&&v.status==="active"?e.jsx(g,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate({connector_key:a.key,auth_profile_slug:v.slug}),children:"Set default"}):null]},v.slug))}),i&&x?e.jsxs("div",{className:re(ne,"space-y-3 p-3"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{htmlFor:"oauth-app-name",children:"Display name"}),e.jsx(F,{id:"oauth-app-name",value:m,onChange:v=>y(v.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{htmlFor:"oauth-app-slug",children:"Slug"}),e.jsx(F,{id:"oauth-app-slug",placeholder:"optional",value:b,onChange:v=>P(v.target.value)})]}),e.jsx(Bs,{schema:_.revision??void 0,values:z,onValuesChange:R,fieldIdPrefix:"oauth-app-"}),e.jsx(Ks,{visible:_.hasConflict,onReload:_.reset}),w?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>{u(!1),t?.()},children:"Cancel"}),e.jsxs(g,{size:"sm",disabled:o.isPending||!_.canSubmit,onClick:O,children:[o.isPending?e.jsx(q,{size:"md",className:"mr-1.5"}):null,"Save OAuth app"]})]})]}):null]})}function At({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i,refetchConnections:h}){const l=Te(s.auth_schema).find(N=>N.type==="oauth"),{data:x=[],refetch:u,isLoading:c,isError:j}=ie(t,{connectorKey:s.key,provider:l?.provider});if(l){if(j)return e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load accounts. Reload the page to try again."});const N=x.filter(y=>y.profile_kind==="oauth_app"),m=x.filter(y=>y.profile_kind==="oauth_account");return e.jsx(_t,{connector:s,organizationId:t,oauthMethod:l,appProfiles:N,accounts:m,connections:r,isLoading:i||c,refetchProfiles:u,refetchConnections:h})}return e.jsx(He,{connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i})}function _t({connector:s,organizationId:t,oauthMethod:a,appProfiles:n,accounts:r,connections:i,isLoading:h,refetchProfiles:o,refetchConnections:l}){const{session:x}=Cs(),{isAdmin:u,isLoading:c}=J(t),j=ks(),N=ws(),m=As(),[y,b]=p.useState(""),[P,w]=p.useState([]),k=n.filter(f=>f.status==="active"),E=k.find(f=>f.is_default_for_connector&&f.connector_key===s.key),_=(u?k.find(f=>f.slug===y):void 0)??E??(u&&k.length===1?k[0]:void 0),z=new Set(i.map(f=>f.auth_profile_slug)),R=r.filter(f=>f.created_by===x?.user?.id),I=R.filter(f=>!z.has(f.slug)),O=!i.some(f=>f.created_by===x?.user?.id)&&R.length===0;if(h||c||!x?.user?.id||!O&&I.length===0&&!m.error&&!m.continueUrl)return null;const v=f=>m.begin(async()=>{const A=await j.mutateAsync({connector_key:s.key,app_auth_profile_slug:f,requested_scopes:Ts(a,P)});return o(),l(),A});return e.jsxs(B,{title:O?"Connect your account":"Your accounts",children:[O&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your own account to grant access. Your connection is private to you."}),u&&k.length>1?e.jsxs("div",{className:"space-y-1",children:[e.jsx($,{children:"App used for this account"}),e.jsxs(Le,{value:_?.slug??"",onValueChange:b,children:[e.jsx(Re,{"aria-label":"App used for this account",children:e.jsx(Oe,{placeholder:"Choose an OAuth app"})}),e.jsx(Be,{children:k.map(f=>e.jsxs(Ke,{value:f.slug,children:[f.display_name,f.is_default_for_connector&&f.connector_key===s.key?" (workspace default)":""]},f.slug))})]})]}):_?e.jsxs("p",{className:"text-sm",children:["App: ",_.display_name,_.is_default_for_connector&&_.connector_key===s.key?" (workspace default)":""]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Configure an OAuth app below, then connect your account.":"Ask an administrator to configure and set the workspace-default OAuth app."}),_&&e.jsx(_s,{requiredScopes:$s(a),optionalScopes:Ss(a),selectedOptionalScopes:P,onToggleOptionalScope:(f,A)=>w(W=>A?[...new Set([...W,f])]:W.filter(T=>T!==f))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{size:"sm",disabled:!_||m.pending,onClick:()=>{_&&v(_.slug)},children:"Connect account"}),u&&e.jsx(g,{asChild:!0,size:"sm",variant:"outline",children:e.jsx("a",{href:"#connector-oauth-apps",children:"Manage app"})})]})]}),I.map(f=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2",children:[e.jsx("span",{className:"text-sm",children:f.display_name}),e.jsx(g,{variant:"outline",size:"sm",disabled:m.pending,onClick:()=>void m.begin(()=>f.status==="active"?j.mutateAsync({connector_key:s.key,auth_profile_slug:f.slug}):N.mutateAsync({auth_profile_slug:f.slug})),children:f.status==="active"?"Use this account":"Reconnect"})]},f.slug)),m.error&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m.error}),m.continueUrl&&e.jsx("a",{href:m.continueUrl,target:"_blank",rel:"noreferrer",className:"text-sm underline",children:"Continue authorization in your browser"})]})}function $e({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(B,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:re(ne,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:n.display_name}),e.jsx(Je,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function St({connector:s,organizationId:t,ownerSlug:a}){const n=Ve(),r=Object.keys(s.feeds_schema??{}).length;return r?e.jsx(qe,{title:"Feeds",summary:`${r} ${r===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}function He({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i}){const h=Q(),o=We(s?.auth_schema);if(i)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-4 w-24"}),e.jsx(D,{className:"h-16 w-full rounded-lg"})]});if(r.length===0){const l=s&&o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ye,{organizationId:t,connectorKey:n,provider:o.provider,providerLabel:s.name,installShape:o.installShape,size:"default",label:`Install ${s.name}`}),e.jsx(g,{asChild:!0,variant:"outline",children:e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n},children:"Use your own app"})})]}):e.jsxs(g,{size:"default",onClick:()=>h({to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n}}),children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Create connection"]});return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:l})}return null}function Je({status:s}){const t=s==="active"?"text-green-500":s==="error"||s==="revoked"?"text-destructive":"text-amber-500";return e.jsxs("span",{className:re("text-xs",t),children:["· ",s]})}function $t(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Pt(s){const t={};for(const[a,n]of Object.entries(s))typeof n=="string"&&n.trim()?t[a]=n.trim():(typeof n=="number"||typeof n=="boolean")&&(t[a]=String(n));return t}export{vt as ConnectorDetailShell,_t as OAuthAccountsSection,wt as OAuthAppProfilesSection,Kt as component};
2
- //# sourceMappingURL=_connectorKey.index-BTP5ijdT.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,eo as M,Q as h,j0 as j,r as w,bh as z,d7 as C,j1 as b}from"./index-9YuSRymd.js";import{A as k}from"./agent-loading-shells-B7v6Cffw.js";import{s as N,R as y,A as L}from"./agent-thread-D38STyeu.js";import"./app-bridge-BCm4muqj.js";import"./use-mention-search-Dcunv4L0.js";import"./index-Vcq4gwWv.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";const m={path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z",hex:"5865F2"},p={path:"M1.637 0C.733 0 0 .733 0 1.637v16.5c0 .904.733 1.636 1.637 1.636h3.955v3.323c0 .804.97 1.207 1.539.638l3.963-3.96h11.27c.903 0 1.636-.733 1.636-1.637V5.592L18.408 0Zm3.955 5.592h12.816v8.59H8.455l-2.863 2.863Z",hex:"34A853"},d={path:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z",hex:"26A5E4"},x={path:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z",hex:"25D366"},O={discord:{hex:`#${m.hex}`,path:m.path},gchat:{hex:`#${p.hex}`,path:p.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${d.hex}`,path:d.path},whatsapp:{hex:`#${x.hex}`,path:x.path}};function T({platform:s,className:t}){const a=s?O[s]:null;return a?"imgSrc"in a?e.jsx("img",{src:a.imgSrc,alt:"","aria-hidden":"true",className:h("rounded-sm",t),loading:"lazy"}):e.jsx("svg",{viewBox:a.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:t,style:{color:a.hex},children:e.jsx("path",{d:a.path})}):e.jsx(M,{className:h("text-muted-foreground",t),"aria-hidden":"true"})}const I={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(s,t,a){return s==="slack"&&a?.teamId&&t?`https://app.slack.com/client/${a.teamId}/${t}`:null}function S({owner:s,agentId:t,conversationId:a}){const{data:n=[],isLoading:u}=j(t,a,{orgSlug:s}),c=w.useMemo(()=>n.map(r=>N(r,{showToolCalls:!0})).filter(r=>r!==null),[n]),[o,g]=a.split(":"),i=I[o]??"the source app",{org:f}=z(),{data:v=[]}=C(f?.id??"",{connectorKey:o}),A=v[0]?.config?.chatMetadata,l=R(o,g,A);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:u?e.jsx(k,{readOnly:!0}):c.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(y,{messages:c,children:e.jsx(L,{readOnly:!0})}),l?e.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm transition-colors hover:bg-muted",children:[e.jsx(T,{platform:o,className:"size-5 shrink-0"}),e.jsxs("span",{className:"text-muted-foreground",children:["This is a read-only copy. Continue the conversation with this agent in ",i,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",i," →"]})]}):null]})})}function q(){const{owner:s,agentId:t,conversationId:a}=b.useParams();return e.jsx(S,{owner:s,agentId:t,conversationId:a})}export{q as component};
2
- //# sourceMappingURL=_conversationId-98Y3RuRO.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,L as h,gK as f,bz as g,bM as j,aR as d,ho as y,hn as N,dY as m,bd as o,P as b,Q as v,af as D,g$ as w,bJ as S,iz as C}from"./index-9YuSRymd.js";import{c as x,d as A}from"./deployments-body-DGII20dQ.js";import{J as I}from"./json-diff-DIN5Jhfx.js";import{b as B,a as L}from"./deployments-C5hvipQh.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";const c="change-";function k({owner:t,deploymentId:s}){const a=s.startsWith(c),r=B(a?null:s),l=L(a?s.slice(c.length):null),i=a?l:r;return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs(h,{to:"/$owner/connectors/deployments",params:{owner:t},className:"inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(f,{className:"h-3 w-3"}),"All deployments"]}),i.isLoading?e.jsx(g,{label:"deployment",variant:"panel"}):i.isError?e.jsx(j,{label:"deployment"}):a?l.data?e.jsx(R,{change:l.data}):e.jsx(d,{icon:y,title:"Change not found",description:"This config change is not in the audit trail, or the server predates the deployments API."}):r.data?e.jsx($,{detail:r.data}):e.jsx(d,{icon:N,title:"Deployment not found",description:"This apply run is not in the audit trail, or the server predates the deployments API."})]})}function $({detail:t}){const{deployment:s,changes:a}=t;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("h2",{className:"text-lg font-semibold",children:["Deployment ",s.applyId?.slice(4,12)??s.id]}),A(s.status),s.gitDirty?e.jsx(b,{variant:"outline",children:"Dirty working tree"}):null]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[m(s.createdAt)," (",o(s.createdAt),")",s.createdBy?` · by ${s.createdBy}`:""]}),e.jsxs("dl",{className:"grid gap-1.5 text-xs",children:[s.applyId?e.jsx(n,{label:"Apply id",value:s.applyId,copyable:!0}):null,s.manifestHash?e.jsx(n,{label:"Manifest hash",value:s.manifestHash,copyable:!0}):null,s.gitSha?e.jsx(n,{label:"Git SHA",value:s.gitDirty?`${s.gitSha} (dirty)`:s.gitSha,copyValue:s.gitSha,copyable:!0}):null,s.cliVersion?e.jsx(n,{label:"CLI version",value:s.cliVersion,copyable:!0}):null]}),s.status==="partial_failure"&&s.error?e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s.error}):null]}),s.gitSha?e.jsxs("section",{className:v(D,"space-y-2 p-4"),children:[e.jsx("p",{className:"text-sm font-medium",children:"Rollback"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Rollback is git-first: revert the commit that produced this deployment, then re-apply."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"font-mono text-xs",children:["git revert ",s.gitSha," && lobu apply"]}),e.jsx(p,{value:`git revert ${s.gitSha} && lobu apply`,label:"rollback command"})]})]}):null,e.jsxs("section",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-medium",children:["Changes",e.jsx("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:a.length})]}),a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No config changes in this apply run."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:a.map((r,l)=>e.jsx(u,{change:r,isLast:l===a.length-1},r.id))})]})]})}function R({change:t}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("h2",{className:"text-lg font-semibold",children:[t.resourceKind??"config",t.resourceId?e.jsxs("span",{className:"text-muted-foreground",children:[" ",t.resourceId]}):null]}),x(t.op)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[m(t.createdAt)," (",o(t.createdAt),")",t.actorSource?` · via ${t.actorSource}`:"",t.createdBy?` · by ${t.createdBy}`:""]})]}),e.jsx("section",{className:"overflow-hidden rounded-lg border",children:e.jsx(u,{change:t,isLast:!0})})]})}function u({change:t,isLast:s}){return e.jsxs("div",{className:`px-3 py-2.5 ${s?"":"border-b"}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[t.resourceKind??"config",t.resourceId?e.jsxs("span",{className:"text-muted-foreground",children:[" ",t.resourceId]}):null]}),x(t.op),e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:o(t.createdAt)})]}),t.changedFields&&t.changedFields.length>0?e.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Changed: ",t.changedFields.join(", ")]}):null,e.jsx(I,{before:t.before,after:t.after})]})}function n({label:t,value:s,copyValue:a,copyable:r}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("dt",{className:"w-24 shrink-0 text-muted-foreground",children:t}),e.jsxs("dd",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("span",{className:"truncate font-mono",children:s}),r?e.jsx(p,{value:a??s,label:t}):null]})]})}function p({value:t,label:s}){return e.jsx("button",{type:"button","aria-label":`Copy ${s}`,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>{navigator.clipboard.writeText(t),S.success("Copied to clipboard")},children:e.jsx(w,{className:"h-3 w-3"})})}function J(){const{owner:t,deploymentId:s}=C.useParams();return e.jsx(k,{owner:t,deploymentId:s})}export{J as component};
2
- //# sourceMappingURL=_deploymentId-B1UWPY0i.js.map
@@ -1,2 +0,0 @@
1
- import{w as u,o as v,j as t,ai as x,b$ as d,c0 as f,c1 as h,bo as w,c2 as j}from"./index-9YuSRymd.js";import{E as P}from"./event-detail-DV_zfWnC.js";import"./events-feed-DO3IiJO2.js";import"./conversations-table-D_HOe1jN.js";import"./clients-BhNl1tVq.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./filter-editors-Bwhqj7lY.js";function g({owner:e,eventId:a,viewKey:r}){const o=u({strict:!1}),l=v(),i=(n,s)=>t.jsx(P,{owner:s,organizationId:n,eventId:a,viewKey:r,params:r?f(o):{},onParamsChange:(m,c,p)=>void l({to:d(s,a,m),search:c,replace:p?.replace??!0}),fullBleed:!0},`${s}/${a}`);return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:e==="me"?i(null,e):t.jsx(x,{owner:e,children:({organizationId:n,ownerSlug:s})=>n?i(n,s):t.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function D(){const{owner:e,eventId:a}=h.useParams(),r=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(a);return o===null?null:t.jsx(g,{owner:e,eventId:o,viewKey:r?.viewKey})}export{D as component};
2
- //# sourceMappingURL=_eventId-BAnr8g8z.js.map
@@ -1,2 +0,0 @@
1
- import{i$ as a,j as e}from"./index-9YuSRymd.js";import{b as i}from"./agent-guardrails-route-TdvvIc_J.js";import"./model-selector-CDrAjH31.js";import"./agent-subpage-shell-CZJvnjNC.js";import"./agent-loading-shells-B7v6Cffw.js";import"./agent-card-controls-CplnPhbv.js";function l(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{l as component};
2
- //# sourceMappingURL=_name-BUfFO_A0.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-BNR9ImQY.js","assets/index-9YuSRymd.js","assets/index-BSH07yVD.css","assets/automation-detail-content-DSwbRpbx.js","assets/create-automation-form-Bpy92SM5.js","assets/cronstrue-CWImw-kf.js","assets/entity-options-Clz_WXK-.js","assets/connection-label-BobuYiAG.js","assets/model-selector-CDrAjH31.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-CEqoCky-.js","assets/index-CDz3-ieP.js","assets/index-Vcq4gwWv.js","assets/use-mention-search-Dcunv4L0.js","assets/proposal-review-shell-CFhOqCLf.js","assets/json-diff-DIN5Jhfx.js","assets/deployments-C5hvipQh.js","assets/events-feed-DO3IiJO2.js","assets/conversations-table-D_HOe1jN.js","assets/clients-BhNl1tVq.js","assets/schema-value-normalization-CKdPjdPC.js","assets/card-jzhQrMDP.js","assets/agent-loading-shells-B7v6Cffw.js","assets/agent-thread-D38STyeu.js","assets/app-bridge-BCm4muqj.js","assets/connection-feed-detail-WcGCA6qY.js","assets/runs-table-B1APZv7d.js","assets/connector-scope-lists-CRFEpSvk.js","assets/connections-browser-CrtnAs0Q.js","assets/source-record-panels-BdfOVPWn.js","assets/event-detail-DV_zfWnC.js","assets/view-param-filters-B0quibBi.js","assets/filter-editors-Bwhqj7lY.js","assets/record-field-peek-Brh1IQGy.js","assets/record-session-Pbr5czGw.js"])))=>i.map(i=>d[i]);
2
- import{u as h,a as p,j as e,p as m,r as x,D as k,b as g,c as w,d as v,e as j,f as b,g as y,B as d,C as N,L as P,A as R,X as E,l as S,_ as z,S as u,R as L,h as C,i as D,k as O,m as _,N as A,O as I}from"./index-9YuSRymd.js";import{R as T}from"./record-session-Pbr5czGw.js";const B=S(async()=>({default:(await z(async()=>{const{PeekPaneContent:s}=await import("./peek-pane-content-BNR9ImQY.js");return{PeekPaneContent:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))).PeekPaneContent}));function W(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(u,{className:"h-5 w-2/3"}),e.jsx(u,{className:"h-4 w-full"}),e.jsx(u,{className:"h-24 w-full rounded-lg"})]})}function H(){const s=h(),a=p();return s?.item?e.jsx(U,{item:s.item,onClose:s.close,onBack:s.back,isNarrow:a}):null}function K(s){const a=s.href?b(s.href):null,n=a?.kind==="record-view"?a.viewKey:null,r=y({slug:n?a?.owner:void 0});return n&&r.data?.find(t=>t.key===n)?.name||s.title}function U({item:s,onClose:a,onBack:n,isNarrow:r}){const t=s.href?m(s.href):null,i=K(s);x.useEffect(()=>{if(r)return;const o=f=>{f.key==="Escape"&&(f.preventDefault(),a())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,r]);const l=o=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[n||o?e.jsx(d,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:n??a,children:e.jsx(N,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:i}),t?e.jsx(d,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:e.jsx(P,{to:t.pathname,search:t.search??{},onClick:a,children:e.jsx(R,{className:"h-4 w-4"})})}):null,e.jsx(d,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:a,children:e.jsx(E,{className:"h-4 w-4"})})]}),c=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(x.Suspense,{fallback:e.jsx(W,{}),children:e.jsx(B,{item:s})})});return r?e.jsx(k,{open:!0,onOpenChange:o=>{o||a()},children:e.jsxs(g,{children:[e.jsx(w,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(v,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(j,{className:"sr-only",children:i}),l(!0),c]})]})}):e.jsxs("aside",{className:"flex w-[460px] max-w-[45vw] shrink-0 flex-col border-l border-border bg-background",children:[l(!1),c]})}function q(){const{owner:s}=L.useParams(),{data:a,isLoading:n,error:r}=C(s==="me"?null:s,{slug:s}),{session:t,isReady:i}=D(),l=O(r)&&!a?.workspace;return _({active:!n&&!l&&i&&!t&&!a?.workspace,owner:s})?null:e.jsx(A,{children:e.jsx(T,{children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e.jsx(I,{})}),e.jsx(H,{})]})})})}export{q as component};
3
- //# sourceMappingURL=_owner-C79BwQ0I.js.map
@@ -1,2 +0,0 @@
1
- import{iP as p,j as e,bn as m}from"./index-9YuSRymd.js";import{M as i}from"./memory-browse-page-D_UlBa27.js";import"./public-shell-ready-DqX8AXfw.js";import"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./entity-avatar-mdh7Kq5D.js";import"./filter-editors-Bwhqj7lY.js";import"./core.esm-BupT3V0i.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-DD4YBFn-.js";function h(){const{owner:t,entityType:o,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:t,typeScope:m(o),create:!1,shape:r})}export{h as component};
2
- //# sourceMappingURL=_shape-Ep6JpyFX.js.map
@@ -1,2 +0,0 @@
1
- import{iZ as r,j as e}from"./index-9YuSRymd.js";import{b as m}from"./agent-skills-route-B3vvvZZe.js";import"./agent-subpage-shell-CZJvnjNC.js";import"./agent-skill-context-DFucg4c4.js";import"./core.esm-BupT3V0i.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-B7v6Cffw.js";import"./agent-card-controls-CplnPhbv.js";function c(){const{owner:t,agentId:o,skillKey:i}=r.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:i})}export{c as component};
2
- //# sourceMappingURL=_skillKey-B24alBfT.js.map
@@ -1,2 +0,0 @@
1
- import{g8 as m,n as d,o as x,eW as y,cC as c,j as t,bz as g}from"./index-9YuSRymd.js";import{E as u}from"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";function h(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=d(),o=x(),{data:i=[],isLoading:p}=y(s),e=i.find(l=>l.slug===n)??null,r=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:p?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:r,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{h as component};
2
- //# sourceMappingURL=_slug-DbPdDc-5.js.map
@@ -1,2 +0,0 @@
1
- import{iW as t,j as m}from"./index-9YuSRymd.js";import{M as i}from"./memory-browse-page-D_UlBa27.js";import"./public-shell-ready-DqX8AXfw.js";import"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./entity-avatar-mdh7Kq5D.js";import"./filter-editors-Bwhqj7lY.js";import"./core.esm-BupT3V0i.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-DD4YBFn-.js";function R(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{R as component};
2
- //# sourceMappingURL=_viewKey-DDUxjjFD.js.map
@@ -1,2 +0,0 @@
1
- import{j2 as e,j as p,bn as i}from"./index-9YuSRymd.js";import{M as m}from"./memory-browse-page-D_UlBa27.js";import"./public-shell-ready-DqX8AXfw.js";import"./entity-type-page-DebN1vCM.js";import"./json-diff-DIN5Jhfx.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-CEqoCky-.js";import"./schema-value-normalization-CKdPjdPC.js";import"./card-jzhQrMDP.js";import"./entity-avatar-mdh7Kq5D.js";import"./filter-editors-Bwhqj7lY.js";import"./core.esm-BupT3V0i.js";import"./view-param-filters-B0quibBi.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-DD4YBFn-.js";function M(){const{owner:t,entityType:o,viewKey:r}=e.useParams();return p.jsx(m,{ownerSlug:t,typeScope:i(o),create:!1,viewKey:r})}export{M as component};
2
- //# sourceMappingURL=_viewKey-hdpq3RoX.js.map
@@ -1,2 +0,0 @@
1
- import{i as l,aa as u,r as c,J as m,j as e,ab as d,ac as h,ad as f,$ as v,ae as x,a8 as g}from"./index-9YuSRymd.js";import{F as p}from"./full-page-spinner-BVbcpW3R.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function b(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
2
- //# sourceMappingURL=accept-invitation-UXU5Fx2G.js.map
@@ -1,2 +0,0 @@
1
- import{c5 as Z,c6 as ee,c7 as se,c8 as O,c9 as te,ca as P,cb as S,cc as D,cd as ne,ce as $,cf as ae,cg as F,r as y,ch as ie,ci as oe,cj as re,j as e,ck as ce,cl as le,cm as de,bf as W,cn as ue,B as j,a2 as me,co as xe,cp as he,n as fe,bh as pe,a as ge,cq as B,bn as I,cr as ye,ao as je,cs as ve,bz as Ne,aR as C,ct as be,L as b,Q as z,ak as we,cu as U,cv as Y,cw as ke,bj as Me,ai as _e}from"./index-9YuSRymd.js";import{R as Te,E as Ae,M as Ie}from"./record-activity-ZJntBfN_.js";import{M as Ce}from"./member-scope-gate-DD4YBFn-.js";import{P as Re}from"./public-shell-ready-DqX8AXfw.js";function Ee(s,t,o){const a=ne(),n=o?.locale??a.locale??te,r=Z(s,t);if(isNaN(r))throw new RangeError("Invalid time value");const i=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:r}),[c,f]=ee(o?.in,...r>0?[t,s]:[s,t]),x=se(o?.roundingMethod??"round"),v=f.getTime()-c.getTime(),p=v/$,w=O(f)-O(c),m=(v-w)/$,g=o?.unit;let d;if(g?d=g:p<1?d="second":p<60?d="minute":p<P?d="hour":m<S?d="day":m<D?d="month":d="year",d==="second"){const l=x(v/1e3);return n.formatDistance("xSeconds",l,i)}else if(d==="minute"){const l=x(p);return n.formatDistance("xMinutes",l,i)}else if(d==="hour"){const l=x(p/60);return n.formatDistance("xHours",l,i)}else if(d==="day"){const l=x(m/P);return n.formatDistance("xDays",l,i)}else if(d==="month"){const l=x(m/S);return l===12&&g!=="month"?n.formatDistance("xYears",1,i):n.formatDistance("xMonths",l,i)}else{const l=x(m/D);return n.formatDistance("xYears",l,i)}}function Le(s,t){return Ee(s,ae(s),t)}const Oe=4e3;function Pe(s){if(s?.kind!=="browser"||!s.url)return null;try{return new URL(s.url).origin}catch{return null}}function Se(s,t){const o=Pe(t),{data:a=[]}=F(o?s:null),n=y.useMemo(()=>new Set(a.filter(c=>o&&c.browser?.origins.includes(o)).map(c=>c.key)),[a,o]),r=!!s&&n.size>0,{data:i=[]}=ie({...oe.queryOptions(s,{status:"active",enabled:r}),enabled:r,refetchInterval:c=>c.state.data?.some(f=>n.has(f.connector_key)&&f.active_runs>0)?Oe:!1});return y.useMemo(()=>i.filter(c=>n.has(c.connector_key)&&c.operations.includes("sync")),[i,n])}function De(s){return s.active_runs>0?{text:"Syncing…",failed:!1}:s.last_sync_status==="failed"&&s.last_error?{text:s.last_error,failed:!0}:s.last_sync_at?{text:`Last synced ${Le(new Date(s.last_sync_at),{addSuffix:!0})}.`,failed:!1}:{text:"Not synced yet. Sync while you're signed in.",failed:!1}}function $e({organizationId:s,feeds:t}){const{data:o=[]}=F(s),a=re();return t.length===0?null:e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx("ul",{className:"space-y-1",children:t.map(n=>{const r=De(n),i=n.active_runs>0||a.isPending&&a.variables===n.id,c=[n.connection_name??n.connector_name??n.connector_key,n.display_name??n.feed_key].join(" · ");return e.jsx("li",{className:"rounded-lg bg-primary/5 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ce,{className:le,children:e.jsx(de,{platform:n.connector_key,connectorDefinitions:o,label:c,fallback:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"line-clamp-2 min-w-0 text-sm font-medium",children:c}),e.jsx("p",{className:r.failed?"mt-1 line-clamp-3 text-sm text-destructive":"mt-1 text-sm text-muted-foreground",children:r.text}),e.jsx(ue,{tag:"This page",children:n.device_label?`Connection · ${n.device_label}`:"Connection"}),e.jsx("div",{className:"mt-2",children:e.jsxs(j,{type:"button",size:"sm",variant:r.failed?"default":"outline",className:"h-7 text-xs",disabled:i,onClick:()=>a.mutate(n.id),children:[i?e.jsx(me,{size:"sm",className:"mr-1"}):e.jsx(xe,{className:"mr-1 h-3 w-3"}),i?"Syncing":r.failed?"Try again":"Sync now"]})})]})]})},n.id)})})})}const ze=3;function Fe({organizationId:s,ownerSlug:t,typeScope:o,entityScope:a,activityTab:n="events",attentionOnly:r=!1}){const i=he(),c=Se(s,i),{orgContext:f}=fe(),{isMember:x,isLoading:v}=pe(),p=x&&!!s,w=ge(),m=n==="sessions"&&w,{attentionItems:g,isError:d}=B(t),l=o?I(o):void 0,R=!a&&!l,h=y.useMemo(()=>g.map(u=>({item:u,onPage:i?ye(u,i):!1})).sort((u,N)=>Number(N.onPage)-Number(u.onPage)||N.item.at-u.item.at),[g,i]),[E,q]=y.useState(!1),M=y.useMemo(()=>E?h:h.slice(0,ze),[h,E]),K=y.useMemo(()=>new Set(M.flatMap(({item:u})=>u.approvalRunId!=null?[u.approvalRunId]:[])),[M]),{data:_,isLoading:T,error:Q}=je(a?`/${t}/${ve(a)}`:`/${t}`,f),A=a?_?.entity:void 0,V=(a?A?.entity_type??I(a.split("/").at(-2)??""):l)==="$member",H=a!=null&&!T&&(Q!=null||_?.entity==null),k=a?void 0:_?.counts,J=k?k.connections>0||k.agents>0:!1,X=p&&!v&&!T&&k!=null&&!J,L=a&&T?e.jsx(Ne,{label:"Loading record…"}):H?e.jsx(C,{icon:be,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):r&&R?e.jsx(Be,{owner:t,items:h,isError:d}):A?e.jsx(Te,{ownerSlug:t,entity:A,organizationId:s}):e.jsx(Ae,{organizationId:s,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:l?[l]:void 0,notificationsFirst:R?{pinned:d||h.length>0||c.length>0?e.jsxs(e.Fragment,{children:[e.jsx($e,{organizationId:s,feeds:c}),d?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):null,h.length>0?e.jsx(We,{owner:t,shown:M,total:h.length,onShowAll:()=>q(!0)}):null]}):null,hiddenApprovalRunIds:K,filterActions:h.length>0?e.jsx(G,{owner:t}):void 0}:void 0,emptyState:X?e.jsx(Ue,{ownerSlug:t}):void 0});return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[w?e.jsx("div",{className:"sticky top-0 z-20 flex min-w-0 flex-wrap items-center justify-center gap-x-4 gap-y-2 bg-background pt-1",children:e.jsxs("div",{className:"flex items-center rounded-lg bg-muted/60 p-0.5 text-xs",children:[e.jsx(b,{to:"/$owner/events",params:{owner:t},search:u=>{const N={...u??{}};return delete N.tab,N},"aria-current":m?void 0:"page",className:z("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",m?"text-muted-foreground hover:text-foreground":"bg-background text-foreground "),children:"Events"}),e.jsx(b,{to:"/$owner/events",params:{owner:t},search:u=>({...u??{},tab:"sessions"}),"aria-current":m?"page":void 0,className:z("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",m?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:"Sessions"})]})}):null,m?e.jsx(we,{owner:t,tone:"page",empty:"message"}):V?e.jsx(Ce,{children:L}):L]})}function We({owner:s,shown:t,total:o,onShowAll:a}){const n=o-t.length;return e.jsxs("section",{"aria-label":"Needs attention",className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:t.map(({item:r,onPage:i})=>e.jsx("li",{children:e.jsx(Y,{owner:s,item:r,tone:i?"relevant":"default",tag:i?"This page":void 0})},r.id))}),n>0?e.jsxs(j,{type:"button",variant:"ghost",size:"sm",className:"ml-1 h-7 text-xs text-muted-foreground",onClick:a,children:["Show ",n," more"]}):null]})}function Be({owner:s,items:t,isError:o}){return e.jsxs("section",{"aria-label":"Needs attention",className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("h2",{className:"text-sm font-medium",children:["Needs attention",t.length>0?e.jsx("span",{className:"ml-2 text-muted-foreground tabular-nums",children:t.length}):null]}),e.jsx(G,{owner:s})]}),o?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?e.jsx(C,{icon:U,title:"All caught up",description:"Nothing needs you right now.",children:e.jsx(j,{asChild:!0,variant:"outline",className:"mt-4",children:e.jsx(b,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):e.jsx("ul",{className:"space-y-1",children:t.map(({item:a,onPage:n})=>e.jsx("li",{children:e.jsx(Y,{owner:s,item:a,tone:n?"relevant":"default",tag:n?"This page":void 0})},a.id))})]})}function G({owner:s}){const{visibleUnreadIds:t,markVisibleRead:o,bulkPending:a}=B(s);return t.length===0?null:e.jsxs(j,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:a,onClick:()=>void o(),children:[e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function Ue({ownerSlug:s}){return e.jsx("div",{className:"px-6",children:e.jsx(C,{icon:ke,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(j,{asChild:!0,children:e.jsxs(b,{to:"/$owner/connectors/create",params:{owner:s},children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(j,{asChild:!0,variant:"outline",children:e.jsxs(b,{to:"/$owner/agents",params:{owner:s},children:[e.jsx(Me,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}function Ve({owner:s,search:t,entityScope:o}){const a=typeof t.type=="string"&&t.type.trim()?I(t.type.trim()):void 0,n=t.tab==="sessions"?"sessions":"events",r=String(t.attention)==="1";return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Re,{}),e.jsx(_e,{owner:s,children:i=>e.jsx(Ie,{organizationId:i.organizationId,isWorkspaceLoading:i.isWorkspaceLoading,children:e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:e.jsx(Fe,{organizationId:i.organizationId,ownerSlug:i.ownerSlug,typeScope:a,entityScope:o,activityTab:n,attentionOnly:r})})})})]})}export{Ve as A};
2
- //# sourceMappingURL=activity-route-view-D7ORHntE.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,eS as i,dF as l,Q as c}from"./index-9YuSRymd.js";function d({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{d as A};
2
- //# sourceMappingURL=agent-card-controls-CplnPhbv.js.map
@@ -1,2 +0,0 @@
1
- import{J as m,j as e,aC as b,g9 as N,ag as A,ga as L,L as p,gb as w,h as k,r as C,ht as S,hL as x,B as y,A as I,bk as f,dy as P,g$ as R}from"./index-9YuSRymd.js";import{A as $,f as M,b as T}from"./agent-client-setup-list-BlXB4SE5.js";import{u as _}from"./clients-BhNl1tVq.js";import{g as B,c as U}from"./client-rows-BYbsXGy9.js";function E(t){const n=t?`/mcp/${t}`:"/mcp";if(!m)return`http://localhost:8787${n}`;try{const s=new URL(m);return s.pathname=n,s.toString()}catch{return`${m}${n}`}}const u="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function D(t,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${t===n-1?"":"border-b"}`}function v({owner:t}){return e.jsx(L,{crumbs:[e.jsx(p,{to:"/$owner/agents",params:{owner:t},className:w,children:"Agents"},"agents")]})}function q({owner:t}){return e.jsx("div",{className:u,children:e.jsxs(b,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(N,{breadcrumb:e.jsx(v,{owner:t}),icon:e.jsx(A.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx($,{owner:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Local Automation delivery is separate and is not enabled by connecting an agent."})]})})}function j({text:t,label:n}){const[s,l]=C.useState(!1);return e.jsxs(y,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},children:[s?e.jsx(P,{className:"mr-1.5 h-3.5 w-3.5"}):e.jsx(R,{className:"mr-1.5 h-3.5 w-3.5"}),s?"Copied":n]})}function F({owner:t,clientId:n}){const s=M(n),{data:l}=k(t,{slug:t}),{data:h=[]}=_(null,{refetchInterval:2500}),r=C.useMemo(()=>B(h).filter(a=>a.connected),[h]);if(!s)return e.jsx("div",{className:u,children:e.jsxs(b,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(p,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const o=E(t),c=T({workspaceName:l?.workspace?.name??t,owner:t,mcpUrl:o,clientLabel:s.id==="other"?void 0:s.label,terminalLogin:s.terminalLogin}),i=s.setupMode==="agent-prompt",g=i?c:s.installText?.(o)??c;return e.jsx("div",{className:u,children:e.jsxs(S,{header:e.jsx(N,{breadcrumb:e.jsx(v,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:s.label})}),title:s.label,caption:s.description}),children:[e.jsx(x,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:g}),e.jsx(j,{text:g,label:i?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:s.steps(o).map((a,d)=>e.jsxs("li",{children:[d+1,". ",a]},a))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[i?null:e.jsx(j,{text:c,label:"Copy setup prompt"}),s.guideLinks.map(a=>e.jsx(y,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:a.href,target:"_blank",rel:"noreferrer",children:[a.label,e.jsx(I,{className:"ml-1.5 h-3.5 w-3.5"})]})},a.href))]})]})}),e.jsx(x,{title:"Connected agents",count:r.length>0?String(r.length):void 0,children:r.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:r.map((a,d)=>e.jsxs(p,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:a.clientId},className:D(d,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:a.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:a.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:U(a)})]})]},a.key))})}),e.jsx(x,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:o})]})})]})})}export{q as A,F as a};
2
- //# sourceMappingURL=agent-connect-pages-BmknviTI.js.map