@lobu/runtime-server 24.11.1 → 24.12.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 (272) hide show
  1. package/dist/catalogs/connectors.json +1113 -107
  2. package/dist/catalogs/skills.json +2 -2
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +2 -2
  5. package/dist/connectors/chat-transport-actions.ts +50 -0
  6. package/dist/connectors/discord.ts +2 -0
  7. package/dist/connectors/gchat.ts +2 -0
  8. package/dist/connectors/github.ts +4 -4
  9. package/dist/connectors/google_drive.ts +20 -0
  10. package/dist/connectors/google_gmail.ts +49 -8
  11. package/dist/connectors/herdr.ts +1 -1
  12. package/dist/connectors/imessage.ts +1 -0
  13. package/dist/connectors/linkedin-browser-script.ts +11 -0
  14. package/dist/connectors/linkedin-draft-page.js +24 -8
  15. package/dist/connectors/linkedin-inbox-adapter.js +209 -19
  16. package/dist/connectors/linkedin-inbox.ts +152 -4
  17. package/dist/connectors/linkedin-network.ts +788 -0
  18. package/dist/connectors/linkedin-search.ts +1284 -0
  19. package/dist/connectors/linkedin.ts +892 -27
  20. package/dist/connectors/microsoft_outlook.ts +57 -19
  21. package/dist/connectors/rss.ts +179 -33
  22. package/dist/connectors/slack.ts +2 -0
  23. package/dist/connectors/source-file-attachment.ts +46 -0
  24. package/dist/connectors/teams.ts +2 -0
  25. package/dist/connectors/telegram.ts +2 -0
  26. package/dist/connectors/tiktok_web.ts +1 -1
  27. package/dist/connectors/whatsapp.ts +2 -0
  28. package/dist/connectors/whatsapp_web.ts +3 -3
  29. package/dist/connectors/x-dm-adapter.js +8 -10
  30. package/dist/connectors/x.ts +8 -9
  31. package/dist/db/migrations/20261115040000_account_two_factor.sql +20 -0
  32. package/dist/db/migrations/20261115130000_entities_retired_type_idx.sql +34 -0
  33. package/dist/db/migrations/20261115140000_entity_identities_personal_owner_idx.sql +34 -0
  34. package/dist/db/migrations/20261117090000_write_policy_kind_note.sql +65 -0
  35. package/dist/db/migrations/20261117120000_app_policy_principal.sql +48 -0
  36. package/dist/db/migrations/20261117170000_personal_org_connector_auto_policy_backfill.sql +57 -0
  37. package/dist/db/migrations/20261117190000_org_slug_reserved_paths.sql +29 -0
  38. package/dist/db/migrations/20261118120000_workspace_view_top_level_paths.sql +69 -0
  39. package/dist/db/migrations/preconditions/20261117190000_org_slug_reserved_paths.sql +14 -0
  40. package/dist/db/migrations/preconditions/20261118120000_workspace_view_top_level_paths.sql +21 -0
  41. package/dist/dependencies.bun.lock +51 -46
  42. package/dist/guest.bundle.js +11 -2
  43. package/dist/owletto/dist/assets/_-BC9j6MkU.js +2 -0
  44. package/dist/owletto/dist/assets/_-Z1u1cIe6.js +3 -0
  45. package/dist/owletto/dist/assets/_agentId-B-TFq9TP.js +2 -0
  46. package/dist/owletto/dist/assets/{_agentId-CGScf8z_.js → _agentId-BGatZWsd.js} +2 -2
  47. package/dist/owletto/dist/assets/_automationId-CMUrWPvr.js +2 -0
  48. package/dist/owletto/dist/assets/_connectorKey._connectionId-CUoAoP0_.js +2 -0
  49. package/dist/owletto/dist/assets/_connectorKey.index-Bs49QGGH.js +2 -0
  50. package/dist/owletto/dist/assets/_conversationId-CszP1den.js +2 -0
  51. package/dist/owletto/dist/assets/_eventId-C0AZUBnD.js +2 -0
  52. package/dist/owletto/dist/assets/_owner-B4ydA75k.js +3 -0
  53. package/dist/owletto/dist/assets/_shape-C4-ikE70.js +2 -0
  54. package/dist/owletto/dist/assets/_slug-DE5J3KVu.js +2 -0
  55. package/dist/owletto/dist/assets/_viewKey-Dkcd8JQC.js +2 -0
  56. package/dist/owletto/dist/assets/{accept-invitation-BKeIzZXE.js → accept-invitation-DmrQQu_W.js} +2 -2
  57. package/dist/owletto/dist/assets/{activity-route-location-sLvKaSCa.js → activity-route-location-Bec6fW-t.js} +2 -2
  58. package/dist/owletto/dist/assets/activity-route-view-DCSNBKZU.js +2 -0
  59. package/dist/owletto/dist/assets/agent-client-connections-xvabPpi6.js +4 -0
  60. package/dist/owletto/dist/assets/agent-connect-pages-DDPtkcmq.js +6 -0
  61. package/dist/owletto/dist/assets/{agent-editor-form-DVFyyMyd.js → agent-editor-form-BrhQbHZg.js} +2 -2
  62. package/dist/owletto/dist/assets/{agent-loading-shells-BLNHIy-r.js → agent-loading-shells-D3y98xuO.js} +2 -2
  63. package/dist/owletto/dist/assets/{agent-permissions-matrix-UBKRR5vs.js → agent-permissions-matrix-jQJjSa9i.js} +2 -2
  64. package/dist/owletto/dist/assets/{agent-skill-context-fqedKd0D.js → agent-skill-context-CCcknBYE.js} +2 -2
  65. package/dist/owletto/dist/assets/{agent-subpage-shell-BUCoY2Nf.js → agent-subpage-shell-6f_53cSf.js} +2 -2
  66. package/dist/owletto/dist/assets/agent-thread-v_lSSnJi.js +6 -0
  67. package/dist/owletto/dist/assets/{app._appId-ByIypCL9.js → app._appId-CKWzZ2ic.js} +2 -2
  68. package/dist/owletto/dist/assets/assist-composer-Q9ZJjAta.js +2 -0
  69. package/dist/owletto/dist/assets/automation-run-now-Dl0MKx3N.js +2 -0
  70. package/dist/owletto/dist/assets/{callback-Pz5uS-k7.js → callback-Bentv78L.js} +2 -2
  71. package/dist/owletto/dist/assets/{card-CAPpY9P5.js → card-C4oPCVh6.js} +2 -2
  72. package/dist/owletto/dist/assets/{claim-DgWWK0KI.js → claim-B3C4qIi2.js} +2 -2
  73. package/dist/owletto/dist/assets/client-activity-scopes-DqaFEyir.js +2 -0
  74. package/dist/owletto/dist/assets/{client-rows-Dd5YV8vn.js → client-rows-rse9thnk.js} +2 -2
  75. package/dist/owletto/dist/assets/{clients-Bf7ZgGro.js → clients-BhPMbxHi.js} +2 -2
  76. package/dist/owletto/dist/assets/{code-editor-z1Sy_hiX.js → code-editor-CTdKUDPY.js} +2 -2
  77. package/dist/owletto/dist/assets/connect-D8o7HBlo.js +2 -0
  78. package/dist/owletto/dist/assets/connect-menu-D5EZvSHb.js +2 -0
  79. package/dist/owletto/dist/assets/connect._clientId-Dbagcg9L.js +2 -0
  80. package/dist/owletto/dist/assets/connected._clientId-DALW9S2K.js +2 -0
  81. package/dist/owletto/dist/assets/connection-DyxzSqVE.js +2 -0
  82. package/dist/owletto/dist/assets/connection-feed-detail-LqpxUCdy.js +2 -0
  83. package/dist/owletto/dist/assets/{connector-page-shell-an3SYLim.js → connector-page-shell-DZjKv9zQ.js} +2 -2
  84. package/dist/owletto/dist/assets/{connector-provenance-mSZCOud-.js → connector-provenance-DtTJn1Nk.js} +2 -2
  85. package/dist/owletto/dist/assets/connectors-BVl-AR33.js +2 -0
  86. package/dist/owletto/dist/assets/{consent-1ulwyJ3k.js → consent-XCqsHLxS.js} +2 -2
  87. package/dist/owletto/dist/assets/{core.esm-Ctg_pXLe.js → core.esm-B1du4Zwy.js} +3 -3
  88. package/dist/owletto/dist/assets/create-BYKCtGL4.js +2 -0
  89. package/dist/owletto/dist/assets/create-D6Mmuxcq.js +2 -0
  90. package/dist/owletto/dist/assets/{create-CGuoqPh8.js → create-GHTb6wKX.js} +2 -2
  91. package/dist/owletto/dist/assets/{create-automation-form-CD6jSlWL.js → create-automation-form-CTiy_S9G.js} +3 -3
  92. package/dist/owletto/dist/assets/create._connectorKey-DMH97KkK.js +2 -0
  93. package/dist/owletto/dist/assets/custom-guardrail-edits-DZy66ucV.js +2 -0
  94. package/dist/owletto/dist/assets/definition-comparison-C2mPfIMD.js +2 -0
  95. package/dist/owletto/dist/assets/detail-page-skeleton-DNBL7nyk.js +2 -0
  96. package/dist/owletto/dist/assets/device-CwP1PY8q.js +2 -0
  97. package/dist/owletto/dist/assets/{device-pin-tombstone-Dkj7hrBE.js → device-pin-tombstone-DYTt7kU5.js} +2 -2
  98. package/dist/owletto/dist/assets/device._deviceId-DZ2kqI4Y.js +2 -0
  99. package/dist/owletto/dist/assets/{entity-options-D4t-NAcg.js → entity-options-D9K_5Lcs.js} +2 -2
  100. package/dist/owletto/dist/assets/entity-page-DggKXrcE.js +2 -0
  101. package/dist/owletto/dist/assets/entity-pages-C6M6yKFf.js +2 -0
  102. package/dist/owletto/dist/assets/{entity-schema-graph-Cq96SJ3c.js → entity-schema-graph-B255NKjF.js} +2 -2
  103. package/dist/owletto/dist/assets/entity-type-page-CGBAP2wt.js +2 -0
  104. package/dist/owletto/dist/assets/event-attachments-D8Z8uwv9.js +2 -0
  105. package/dist/owletto/dist/assets/event-detail-CgG3pDLA.js +2 -0
  106. package/dist/owletto/dist/assets/events-feed-ClhEywwV.js +2 -0
  107. package/dist/owletto/dist/assets/{filter-editors-DGVl9U4D.js → filter-editors-D_Sfn0dv.js} +3 -3
  108. package/dist/owletto/dist/assets/{full-page-spinner-CtVlF8GQ.js → full-page-spinner-C1clibUY.js} +2 -2
  109. package/dist/owletto/dist/assets/{index-CK5GDX4B.js → index-04B26s6E.js} +2 -2
  110. package/dist/owletto/dist/assets/index-2HrEO-nl.js +2 -0
  111. package/dist/owletto/dist/assets/index-BU3k9wpw.js +2 -0
  112. package/dist/owletto/dist/assets/{index-DvuJ_S_o.js → index-BXHqp23o.js} +2 -2
  113. package/dist/owletto/dist/assets/index-BdLRUDIR.js +2 -0
  114. package/dist/owletto/dist/assets/index-C2FrGwYN.js +2 -0
  115. package/dist/owletto/dist/assets/index-CB9wGfUm.js +2 -0
  116. package/dist/owletto/dist/assets/index-Caihaftb.js +2 -0
  117. package/dist/owletto/dist/assets/index-CwH59DJV.js +2 -0
  118. package/dist/owletto/dist/assets/index-DB2lVKuV.js +7908 -0
  119. package/dist/owletto/dist/assets/{index-DbjbHlDe.js → index-DTvJRjrM.js} +2 -2
  120. package/dist/owletto/dist/assets/index-SF2ni1Rs.css +1 -0
  121. package/dist/owletto/dist/assets/{index-BifR-LE9.js → index-mSrdbx3C.js} +9 -9
  122. package/dist/owletto/dist/assets/index-uFn-Ilrx.js +2 -0
  123. package/dist/owletto/dist/assets/{json-diff-OjtREegr.js → json-diff-Ce6YAXzY.js} +2 -2
  124. package/dist/owletto/dist/assets/{list-skeleton-CH0qQBYk.js → list-skeleton-DLPBTnbR.js} +2 -2
  125. package/dist/owletto/dist/assets/login-DeWlvogD.js +2 -0
  126. package/dist/owletto/dist/assets/{logout-DfdgOLoM.js → logout-CJY0ceN9.js} +2 -2
  127. package/dist/owletto/dist/assets/{member-scope-gate-Cxg2zGQT.js → member-scope-gate-CBPMprXu.js} +2 -2
  128. package/dist/owletto/dist/assets/memory-browse-page-D5kj1RaR.js +74 -0
  129. package/dist/owletto/dist/assets/{model-selector-D2OpDkwH.js → model-selector-CjkBPpjN.js} +2 -2
  130. package/dist/owletto/dist/assets/new-BKrNkOQD.js +2 -0
  131. package/dist/owletto/dist/assets/new-BetiMuDq.js +2 -0
  132. package/dist/owletto/dist/assets/new-dk_-eXqU.js +2 -0
  133. package/dist/owletto/dist/assets/new-efN--4Wx.js +2 -0
  134. package/dist/owletto/dist/assets/organization-C3rpwx_d.js +2 -0
  135. package/dist/owletto/dist/assets/pdf-document--AN-oCKj.css +1 -0
  136. package/dist/owletto/dist/assets/pdf-document-2W1q0sRA.js +56 -0
  137. package/dist/owletto/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
  138. package/dist/owletto/dist/assets/peek-pane-content-ChsBWO0P.js +3 -0
  139. package/dist/owletto/dist/assets/{pending-seed-BBACroge.js → pending-seed-CTKYdA4X.js} +2 -2
  140. package/dist/owletto/dist/assets/proposal-review-shell-EyGWEYwQ.js +2 -0
  141. package/dist/owletto/dist/assets/public-shell-ready-_KWdfzEM.js +2 -0
  142. package/dist/owletto/dist/assets/record-session-D27VNxP_.js +2 -0
  143. package/dist/owletto/dist/assets/{renderer-CTKNMcXP.js → renderer-B8yZ5lql.js} +34 -33
  144. package/dist/owletto/dist/assets/{reset-password-DKBEneyR.js → reset-password-BGVJIh2I.js} +2 -2
  145. package/dist/owletto/dist/assets/run-initiator-C0sur8lU.js +2 -0
  146. package/dist/owletto/dist/assets/runs-list-CJOFMgpk.js +2 -0
  147. package/dist/owletto/dist/assets/schema-value-DDNHANGs.js +3 -0
  148. package/dist/owletto/dist/assets/{scoped-feed-bar-DNFL0sYX.js → scoped-feed-bar-BTv9mPcR.js} +2 -2
  149. package/dist/owletto/dist/assets/settings-Ponr5XbS.js +3 -0
  150. package/dist/owletto/dist/assets/{status-variants-SzXYYedJ.js → status-variants-mLqVhg5O.js} +2 -2
  151. package/dist/owletto/dist/assets/subDays-BGA_fkig.js +2 -0
  152. package/dist/owletto/dist/assets/two-factor-pqoxGSgL.js +2 -0
  153. package/dist/owletto/dist/assets/{use-automations-DfBtVzGa.js → use-automations-DcdlmVuX.js} +2 -2
  154. package/dist/owletto/dist/assets/{use-login-redirect-BDiS3eyl.js → use-login-redirect-D7HW5Ed6.js} +2 -2
  155. package/dist/owletto/dist/assets/{use-mention-search-khySpz_V.js → use-mention-search-BniE-K2d.js} +3 -3
  156. package/dist/owletto/dist/assets/view-card-Cg6PeEiV.js +2 -0
  157. package/dist/owletto/dist/assets/view-param-filters-CvrKw0mZ.js +2 -0
  158. package/dist/owletto/dist/index.html +2 -2
  159. package/dist/server-main.bundle.mjs +5718 -2991
  160. package/npm-shrinkwrap.json +195 -172
  161. package/package.json +2 -1
  162. package/vendor/connector-sdk/dist/connector-types.d.ts +20 -0
  163. package/vendor/connector-sdk/dist/define-connector.js +2 -0
  164. package/vendor/connector-sdk/dist/extension-dom-scrape.d.ts +2 -0
  165. package/vendor/connector-sdk/dist/extension-dom-scrape.js +5 -0
  166. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +20 -0
  167. package/vendor/connector-sdk/package.json +1 -1
  168. package/vendor/core/dist/contracts/entity-reference.d.ts +2 -0
  169. package/vendor/core/dist/contracts/entity-reference.js +4 -3
  170. package/vendor/core/dist/contracts/tools/entity-list-sort.d.ts +18 -0
  171. package/vendor/core/dist/contracts/tools/entity-list-sort.js +64 -0
  172. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +1 -1
  173. package/vendor/core/dist/contracts/tools/manage-agents.js +3 -3
  174. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +4 -0
  175. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +4 -0
  176. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
  177. package/vendor/core/dist/contracts/tools/manage-entity.js +11 -1
  178. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +29 -3
  179. package/vendor/core/dist/contracts/tools/manage-operations.js +24 -2
  180. package/vendor/core/dist/contracts/tools/manage-views.d.ts +36 -0
  181. package/vendor/core/dist/contracts/tools/manage-views.js +15 -2
  182. package/vendor/core/dist/contracts/tools/view-definition.js +7 -2
  183. package/vendor/core/dist/contracts/tools/view-host.js +5 -0
  184. package/vendor/core/dist/contracts/tools/view-path.d.ts +8 -1
  185. package/vendor/core/dist/contracts/tools/view-path.js +11 -1
  186. package/vendor/core/dist/reserved.d.ts +7 -1
  187. package/vendor/core/dist/reserved.js +17 -0
  188. package/vendor/core/package.json +6 -1
  189. package/vendor/views/dist/api.d.ts +19 -3
  190. package/vendor/views/dist/api.js +53 -5
  191. package/vendor/views/dist/components.d.ts +7 -0
  192. package/vendor/views/dist/components.js +223 -2
  193. package/vendor/views/dist/embed.js +13 -2
  194. package/vendor/views/dist/live-gate.d.ts +34 -0
  195. package/vendor/views/dist/live-gate.js +100 -0
  196. package/vendor/views/dist/native.d.ts +43 -1
  197. package/vendor/views/dist/native.js +1 -0
  198. package/vendor/views/package.json +1 -1
  199. package/dist/owletto/dist/assets/_-BDMUN9XZ.js +0 -2
  200. package/dist/owletto/dist/assets/_-CF5X4ANe.js +0 -3
  201. package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +0 -2
  202. package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +0 -2
  203. package/dist/owletto/dist/assets/_connectorKey._connectionId-DcI29kGy.js +0 -2
  204. package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +0 -2
  205. package/dist/owletto/dist/assets/_conversationId-CnmLYlVS.js +0 -2
  206. package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +0 -2
  207. package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +0 -3
  208. package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +0 -2
  209. package/dist/owletto/dist/assets/_slug-COPpRXLt.js +0 -2
  210. package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +0 -2
  211. package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +0 -2
  212. package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +0 -2
  213. package/dist/owletto/dist/assets/agent-connect-pages-DVq9nAR7.js +0 -4
  214. package/dist/owletto/dist/assets/agent-thread-Cqf9ITrT.js +0 -6
  215. package/dist/owletto/dist/assets/assist-composer-kG_heHXo.js +0 -2
  216. package/dist/owletto/dist/assets/automation-run-now-C5XTS00o.js +0 -2
  217. package/dist/owletto/dist/assets/client-activity-scopes-Aqdo6Pdr.js +0 -2
  218. package/dist/owletto/dist/assets/connect-BFNp1y_s.js +0 -2
  219. package/dist/owletto/dist/assets/connect-menu-BWrAhMqO.js +0 -2
  220. package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +0 -2
  221. package/dist/owletto/dist/assets/connected._clientId-CuOeHafK.js +0 -2
  222. package/dist/owletto/dist/assets/connection-CVeHmDLs.js +0 -2
  223. package/dist/owletto/dist/assets/connection-feed-detail-BYo7zdVD.js +0 -2
  224. package/dist/owletto/dist/assets/connectors-DBEM9QQz.js +0 -2
  225. package/dist/owletto/dist/assets/copy-button-Xhh7ZnjO.js +0 -2
  226. package/dist/owletto/dist/assets/create-Ccb5R-S4.js +0 -2
  227. package/dist/owletto/dist/assets/create-DmhbacIa.js +0 -2
  228. package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +0 -2
  229. package/dist/owletto/dist/assets/custom-guardrail-edits-Ce_BwiwD.js +0 -2
  230. package/dist/owletto/dist/assets/definition-comparison-D_qP25jR.js +0 -2
  231. package/dist/owletto/dist/assets/detail-page-skeleton-CPAfZLG0.js +0 -2
  232. package/dist/owletto/dist/assets/device-DDl5XKvt.js +0 -2
  233. package/dist/owletto/dist/assets/device._deviceId-bNhTcops.js +0 -2
  234. package/dist/owletto/dist/assets/dynamic-schema-form-CRyUchXo.js +0 -2
  235. package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +0 -2
  236. package/dist/owletto/dist/assets/entity-pages-_nuesgnp.js +0 -2
  237. package/dist/owletto/dist/assets/entity-type-page-CkCSbkBx.js +0 -2
  238. package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +0 -2
  239. package/dist/owletto/dist/assets/events-feed-DcKTkJVe.js +0 -2
  240. package/dist/owletto/dist/assets/index-BUlkNJzX.js +0 -2
  241. package/dist/owletto/dist/assets/index-BoqrvLHQ.js +0 -7906
  242. package/dist/owletto/dist/assets/index-CA9mW_ZM.js +0 -2
  243. package/dist/owletto/dist/assets/index-CH0GzG4i.js +0 -2
  244. package/dist/owletto/dist/assets/index-CtI5Eomq.js +0 -2
  245. package/dist/owletto/dist/assets/index-DmtQ0bds.js +0 -2
  246. package/dist/owletto/dist/assets/index-Du_J8hnx.js +0 -2
  247. package/dist/owletto/dist/assets/index-Pae_f9LM.css +0 -1
  248. package/dist/owletto/dist/assets/index-XETZnN7L.js +0 -2
  249. package/dist/owletto/dist/assets/login-DG0b9uSC.js +0 -2
  250. package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +0 -74
  251. package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +0 -2
  252. package/dist/owletto/dist/assets/needs-you-list-3uMsWcDv.js +0 -2
  253. package/dist/owletto/dist/assets/new-AdGV6a8R.js +0 -2
  254. package/dist/owletto/dist/assets/new-BdtIhBpo.js +0 -2
  255. package/dist/owletto/dist/assets/new-BjGwX6s6.js +0 -2
  256. package/dist/owletto/dist/assets/new-D-iMjV74.js +0 -2
  257. package/dist/owletto/dist/assets/organization-qaIpEiQg.js +0 -2
  258. package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +0 -2
  259. package/dist/owletto/dist/assets/proposal-review-shell-C8ZfIAYn.js +0 -2
  260. package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +0 -2
  261. package/dist/owletto/dist/assets/record-session-BrM9cdXu.js +0 -2
  262. package/dist/owletto/dist/assets/run-initiator-BKSgI1o0.js +0 -2
  263. package/dist/owletto/dist/assets/runs-k2NpbZm8.js +0 -2
  264. package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +0 -2
  265. package/dist/owletto/dist/assets/schema-value-wjqGxXhv.js +0 -3
  266. package/dist/owletto/dist/assets/settings-V0m5Om5j.js +0 -2
  267. package/dist/owletto/dist/assets/source-record-panels-BMut9YIA.js +0 -2
  268. package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +0 -2
  269. package/dist/owletto/dist/assets/table-ZuYMOjVR.js +0 -2
  270. package/dist/owletto/dist/assets/view-card-DiHWlypr.js +0 -2
  271. package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +0 -2
  272. package/dist/owletto/dist/assets/views-access-required-HA-PiOwA.js +0 -2
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Bounded live refresh for view reads.
3
+ *
4
+ * A host forwards every workspace content invalidation to an open view. A
5
+ * view can issue several reads (the net-worth view issues five), so an
6
+ * unbounded forward turns workspace write volume into view read volume. The
7
+ * app's own content queries already bound this with `liveRefreshIntervalMs`
8
+ * (`packages/owletto/src/lib/live-refresh.ts`); the view runtime only had
9
+ * in-flight coalescing. This gate adds the missing time floor:
10
+ *
11
+ * - the first change after an idle window reads immediately (leading edge);
12
+ * - changes inside the window collapse into one trailing read;
13
+ * - a hidden frame defers, then reads once when it becomes visible;
14
+ * - a committed action forces an immediate read (`force`) so a view never
15
+ * shows stale data after its own write waiting for the window.
16
+ *
17
+ * "Hidden" is the top-level document's visibility: an iframe inherits it, so
18
+ * a dashboard left in a background tab costs nothing until it is looked at.
19
+ */
20
+ export declare const LIVE_REFRESH_MIN_INTERVAL_MS = 15000;
21
+ /** True when the top-level document is hidden; an iframe inherits it. */
22
+ export declare function documentHidden(): boolean;
23
+ export interface DataChangeGate {
24
+ /** Subscribe to `visibilitychange`; idempotent. */
25
+ start(): void;
26
+ /** Drop the listener and any pending trailing read; idempotent. */
27
+ stop(): void;
28
+ /** A host data change arrived: read now, or once at the end of the window. */
29
+ notify(): void;
30
+ /** Read now regardless of the window (a committed action). */
31
+ force(): void;
32
+ }
33
+ export declare function createDataChangeGate(onChange: () => void, intervalMs?: number): DataChangeGate;
34
+ //# sourceMappingURL=live-gate.d.ts.map
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Bounded live refresh for view reads.
3
+ *
4
+ * A host forwards every workspace content invalidation to an open view. A
5
+ * view can issue several reads (the net-worth view issues five), so an
6
+ * unbounded forward turns workspace write volume into view read volume. The
7
+ * app's own content queries already bound this with `liveRefreshIntervalMs`
8
+ * (`packages/owletto/src/lib/live-refresh.ts`); the view runtime only had
9
+ * in-flight coalescing. This gate adds the missing time floor:
10
+ *
11
+ * - the first change after an idle window reads immediately (leading edge);
12
+ * - changes inside the window collapse into one trailing read;
13
+ * - a hidden frame defers, then reads once when it becomes visible;
14
+ * - a committed action forces an immediate read (`force`) so a view never
15
+ * shows stale data after its own write waiting for the window.
16
+ *
17
+ * "Hidden" is the top-level document's visibility: an iframe inherits it, so
18
+ * a dashboard left in a background tab costs nothing until it is looked at.
19
+ */
20
+ export const LIVE_REFRESH_MIN_INTERVAL_MS = 15_000;
21
+ /** True when the top-level document is hidden; an iframe inherits it. */
22
+ export function documentHidden() {
23
+ return (typeof document !== "undefined" && document.visibilityState === "hidden");
24
+ }
25
+ export function createDataChangeGate(onChange, intervalMs = LIVE_REFRESH_MIN_INTERVAL_MS) {
26
+ let lastFiredAt = 0;
27
+ let timer = null;
28
+ let pending = false;
29
+ let listening = false;
30
+ const clearTimer = () => {
31
+ if (timer === null)
32
+ return;
33
+ clearTimeout(timer);
34
+ timer = null;
35
+ };
36
+ const fire = () => {
37
+ timer = null;
38
+ pending = false;
39
+ lastFiredAt = Date.now();
40
+ onChange();
41
+ };
42
+ const notify = () => {
43
+ if (documentHidden()) {
44
+ // Do not spend a read on a frame nobody is looking at. Keep one
45
+ // "something changed" bit for the next visibility change.
46
+ pending = true;
47
+ clearTimer();
48
+ return;
49
+ }
50
+ const wait = lastFiredAt + intervalMs - Date.now();
51
+ if (wait <= 0) {
52
+ clearTimer();
53
+ fire();
54
+ return;
55
+ }
56
+ if (timer !== null)
57
+ return;
58
+ timer = setTimeout(fire, wait);
59
+ };
60
+ const force = () => {
61
+ clearTimer();
62
+ fire();
63
+ };
64
+ const onVisibilityChange = () => {
65
+ if (documentHidden()) {
66
+ // A trailing read scheduled while visible must not run in a frame
67
+ // nobody is looking at. Keep it as the one pending bit for the next
68
+ // visible transition instead of dropping the change.
69
+ if (timer !== null) {
70
+ pending = true;
71
+ clearTimer();
72
+ }
73
+ return;
74
+ }
75
+ if (!pending)
76
+ return;
77
+ pending = false;
78
+ clearTimer();
79
+ fire();
80
+ };
81
+ return {
82
+ start() {
83
+ if (listening || typeof document === "undefined")
84
+ return;
85
+ document.addEventListener("visibilitychange", onVisibilityChange);
86
+ listening = true;
87
+ },
88
+ stop() {
89
+ if (listening) {
90
+ document.removeEventListener("visibilitychange", onVisibilityChange);
91
+ listening = false;
92
+ }
93
+ clearTimer();
94
+ pending = false;
95
+ },
96
+ notify,
97
+ force,
98
+ };
99
+ }
100
+ //# sourceMappingURL=live-gate.js.map
@@ -1,6 +1,7 @@
1
1
  /** Public prop contracts for the native components built by Owletto.
2
2
  * Implementations are supplied by the host artifact, using the shell's React. */
3
3
  import { type ComponentType, type ReactNode, type ComponentProps } from "react";
4
+ import type { CollectionSelection } from "@lobu/core/contracts/tools/collection-selection";
4
5
  import type { ValueFormat } from "@lobu/core/json-template";
5
6
  export interface ViewEntity {
6
7
  id: number | string | null;
@@ -53,6 +54,7 @@ export interface SchemaProperty {
53
54
  "x-dimension"?: unknown;
54
55
  }
55
56
  interface MetadataTableProperty {
57
+ type?: string;
56
58
  title?: string;
57
59
  description?: string;
58
60
  enum?: string[];
@@ -154,6 +156,45 @@ export interface EntityListPageProps {
154
156
  onRetry?: () => void;
155
157
  empty?: ReactNode;
156
158
  }
159
+ export type CollectionLayout = "table" | "board";
160
+ /**
161
+ * One entity type's native collection, as on its `/<type>` page: saved
162
+ * filters (`x-lobu-collection` presets), search, filter chips, the segment
163
+ * chip and the table/board switch, read through the view broker with the
164
+ * visiting user's access. Read-only: no create, board moves or preset saving.
165
+ * An invalid selection, an unknown preset or a viewer preset (no identity
166
+ * crosses into a view) renders an error, never unfiltered rows. Hosts without
167
+ * native components render a plain table over the same read.
168
+ */
169
+ export interface EntityCollectionProps {
170
+ entityType: string;
171
+ /** A saved filter's key; `selection` beside it edits that preset. */
172
+ preset?: string;
173
+ /** Controlled `{ search, filters, segment }`. */
174
+ selection?: CollectionSelection;
175
+ defaultSelection?: CollectionSelection;
176
+ onSelectionChange?(next: CollectionSelection): void;
177
+ /** Else the type's default layout, then the workflow auto-pick. */
178
+ layout?: CollectionLayout;
179
+ defaultLayout?: CollectionLayout;
180
+ /** One entry hides the switcher; board needs a workflow-state field. */
181
+ allowedLayouts?: readonly CollectionLayout[];
182
+ onLayoutChange?(layout: CollectionLayout): void;
183
+ /** `false` hides every control; an object hides the ones set to false. */
184
+ controls?: boolean | {
185
+ search?: boolean;
186
+ filters?: boolean;
187
+ segments?: boolean;
188
+ presets?: boolean;
189
+ };
190
+ /** Table rows per page: default 50, at most 500. */
191
+ pageSize?: number;
192
+ /** Default: the native record peek. */
193
+ onOpenRecord?(entity: ViewEntity): void;
194
+ title?: ReactNode;
195
+ actions?: ReactNode;
196
+ empty?: ReactNode;
197
+ }
157
198
  /** Shared record body; callers provide activity, views and authorized actions. */
158
199
  export interface EntityRecordPageProps {
159
200
  entity: ViewEntity;
@@ -232,6 +273,7 @@ export interface NativeComponentProps {
232
273
  ConnectorReference: ConnectorReferenceProps;
233
274
  JsonDiff: JsonDiffProps;
234
275
  EntityListPage: EntityListPageProps;
276
+ EntityCollection: EntityCollectionProps;
235
277
  EntityRecordPage: EntityRecordPageProps;
236
278
  EntityTableView: EntityTableViewProps;
237
279
  RecordSpecSheet: {
@@ -288,7 +330,7 @@ export interface NativeComponentProps {
288
330
  export type NativeComponents = {
289
331
  [K in keyof NativeComponentProps]: ComponentType<NativeComponentProps[K]>;
290
332
  };
291
- export declare const NATIVE_COMPONENT_NAMES: readonly ["SchemaGraph", "AutomationDefinition", "AgentDefinition", "ConnectorDefinition", "AutomationReference", "AgentReference", "ConnectorReference", "JsonDiff", "EntityListPage", "EntityRecordPage", "EntityTableView", "RecordSpecSheet", "SchemaValue", "EntityAvatar", "Button", "Badge", "Tabs", "TabsList", "TabsTrigger", "TabsContent"];
333
+ export declare const NATIVE_COMPONENT_NAMES: readonly ["SchemaGraph", "AutomationDefinition", "AgentDefinition", "ConnectorDefinition", "AutomationReference", "AgentReference", "ConnectorReference", "JsonDiff", "EntityListPage", "EntityCollection", "EntityRecordPage", "EntityTableView", "RecordSpecSheet", "SchemaValue", "EntityAvatar", "Button", "Badge", "Tabs", "TabsList", "TabsTrigger", "TabsContent"];
292
334
  export declare const NATIVE_COMPONENT_GLOBAL = "__lobuViewNative";
293
335
  export declare const EntityListPage: ComponentType<EntityListPageProps>;
294
336
  /** Read-only workspace schema, snapshot, or semantic schema comparison. */
@@ -11,6 +11,7 @@ export const NATIVE_COMPONENT_NAMES = [
11
11
  "ConnectorReference",
12
12
  "JsonDiff",
13
13
  "EntityListPage",
14
+ "EntityCollection",
14
15
  "EntityRecordPage",
15
16
  "EntityTableView",
16
17
  "RecordSpecSheet",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "24.11.1",
3
+ "version": "24.12.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,2 +0,0 @@
1
- import{cl as t,j as r}from"./index-BoqrvLHQ.js";import{A as e}from"./activity-route-view-msesKUwn.js";import{A as s}from"./activity-route-location-sLvKaSCa.js";import"./view-card-DiHWlypr.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./runs-k2NpbZm8.js";import"./event-kind-options-fHAIXu24.js";import"./source-record-panels-BMut9YIA.js";import"./events-feed-DcKTkJVe.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./use-automations-DfBtVzGa.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";import"./client-activity-scopes-Aqdo6Pdr.js";import"./client-rows-Dd5YV8vn.js";import"./agent-loading-shells-BLNHIy-r.js";import"./member-scope-gate-Cxg2zGQT.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./needs-you-list-3uMsWcDv.js";import"./entity-schema-graph-Cq96SJ3c.js";import"./feed-event-kinds-BYuZCoU4.js";import"./public-shell-ready-K2R8iXSI.js";function M(){const{owner:i}=t.useParams(),{entityScope:m,pathname:p}=t.useLoaderData(),o=t.useSearch();return r.jsx(s,{pathname:p,search:o,children:r.jsx(e,{owner:i,search:o,entityScope:m})})}export{M as component};
2
- //# sourceMappingURL=_-BDMUN9XZ.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-BOOL_vy3.js","assets/index-BoqrvLHQ.js","assets/index-Pae_f9LM.css","assets/entity-pages-_nuesgnp.js","assets/renderer-CTKNMcXP.js","assets/schema-value-wjqGxXhv.js","assets/card-CAPpY9P5.js","assets/table-ZuYMOjVR.js","assets/view-card-DiHWlypr.js","assets/filter-editors-DGVl9U4D.js","assets/subDays-9s9OEl5t.js","assets/runs-k2NpbZm8.js","assets/activity-route-location-sLvKaSCa.js","assets/event-kind-options-fHAIXu24.js","assets/source-record-panels-BMut9YIA.js","assets/events-feed-DcKTkJVe.js","assets/definition-comparison-D_qP25jR.js","assets/json-diff-OjtREegr.js","assets/code-editor-z1Sy_hiX.js","assets/index-Vcq4gwWv.js","assets/run-initiator-BKSgI1o0.js","assets/list-skeleton-CH0qQBYk.js","assets/use-automations-DfBtVzGa.js","assets/clients-Bf7ZgGro.js","assets/copy-button-Xhh7ZnjO.js","assets/device-automation-Dp3faMvp.js","assets/client-activity-scopes-Aqdo6Pdr.js","assets/client-rows-Dd5YV8vn.js","assets/agent-loading-shells-BLNHIy-r.js","assets/member-scope-gate-Cxg2zGQT.js","assets/missing-view-xT0B-f5z.js","assets/app-bridge-B-L0rGz9.js","assets/dynamic-schema-form-CRyUchXo.js","assets/views-access-required-HA-PiOwA.js","assets/record-session-BrM9cdXu.js","assets/view-param-filters-DGKxSr7r.js"])))=>i.map(i=>d[i]);
2
- import{av as a,aw as m,H as p,I as y,J as j,j as e,r as g,ax as f,l as R,_ as v}from"./index-BoqrvLHQ.js";import{A as P}from"./activity-route-location-sLvKaSCa.js";import{P as i}from"./public-shell-ready-K2R8iXSI.js";const S=R(async()=>({default:(await v(async()=>{const{EntityPage:s}=await import("./entity-page-BOOL_vy3.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,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(f,{})})}function A(){const{owner:s}=a.useParams(),{path:l,viewKey:d,pathname:u}=a.useLoaderData(),x=a.useSearch(),{data:t,isLoading:n,error:o}=m(l,{slug:s}),{session:h,isReady:r}=p();return y({active:j({settled:!n,authReady:r,session:h,resolved:!!t,error:o}),owner:s}),n||!r&&!t?e.jsx(c,{}):o||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(i,{}),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(i,{}),e.jsx(g.Suspense,{fallback:e.jsx(c,{}),children:e.jsx(P,{pathname:u,search:x,children:e.jsx(S,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})})]})}export{A as component};
3
- //# sourceMappingURL=_-CF5X4ANe.js.map
@@ -1,2 +0,0 @@
1
- import{c as L,dy as P,r as d,dz as w,j as n,i as D,H as E,n as M,s as N,bc as R,dj as O,z,dA as B,dB as H,bp as $,V as Q}from"./index-BoqrvLHQ.js";import{L as _,A as F}from"./agent-thread-Cqf9ITrT.js";import{n as b,c as S}from"./agent-thread-storage-Bx2-WBHQ.js";import{A as U,C as V}from"./agent-loading-shells-BLNHIy-r.js";import"./app-bridge-B-L0rGz9.js";import"./pending-seed-BBACroge.js";import"./use-mention-search-khySpz_V.js";import"./index-Vcq4gwWv.js";import"./use-automations-DfBtVzGa.js";import"./events-feed-DcKTkJVe.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./subDays-9s9OEl5t.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";function W({owner:e,agent:s,threadId:t,afterMessagesContent:u,className:r,initialDraft:g,newChatRequested:f=!1,preventAutoNavigate:p}){const o=L(),i=s.agentId,{data:a=[]}=P(i,{orgSlug:e}),[l,x]=d.useState(()=>b()),[h,A]=d.useState(null);d.useEffect(()=>{!f||t||(x(b()),A(null),o({...w,search:(m=>{const{new:C,...y}=m;return y}),replace:!0}))},[f,t,o]);const v=d.useMemo(()=>!h||a.some(m=>m.id===h.id)?a:[h,...a],[a,h]),c=t??l,T=!t||!v.some(m=>m.id===t),j=d.useCallback(()=>{if(v.some(C=>C.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const m=S(e,i,c);o({...m,replace:!0})},[v,c,o,e,i]),k=d.useCallback(()=>{T&&!p&&j()},[T,j,p]);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(_,{agentId:i,workspaceSlug:e,thread:c,loadHistory:!!t,onFirstUserMessage:k,initialDraft:g,children:n.jsx(F,{afterMessagesContent:u})},`${i}:${c}`)})})}function q({owner:e,agentId:s,threadId:t,initialDraft:u,newChatRequested:r,afterMessagesContent:g,preventAutoNavigate:f}){const{isAuthenticated:p}=E(),{isMember:o,isLoading:i}=M(),a=p&&o,{data:l=[],isLoading:x}=N({enabled:a}),h=s??null,A=l.find(c=>c.agentId===h)??null;return a&&x||i?n.jsx(U,{}):A?n.jsx(W,{owner:e,agent:A,threadId:t,initialDraft:u,newChatRequested:r,afterMessagesContent:g,preventAutoNavigate:f,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(R,{icon:O,title:"Agent not found",description:"This agent may have been removed."})}function G(e){return[...e].sort((s,t)=>t.updatedAt-s.updatedAt)[0]}function J({owner:e,agentId:s,threadId:t,initialDraft:u,forceComposer:r=!1,newChatRequested:g=!1,afterMessagesContent:f,preventAutoNavigate:p}){const o=L(),{data:i=[],isLoading:a}=z(B(e,s,{strict:!1})),l=d.useMemo(()=>G(i),[i]);return d.useEffect(()=>{if(t||r||a||!l)return;const x=S(e,s,l.id);o({...x,replace:!0})},[s,a,l,o,e,t,r]),!t&&!r&&(a||l)?n.jsx(V,{}):n.jsx(q,{owner:e,agentId:s,threadId:t,initialDraft:u,newChatRequested:g,afterMessagesContent:f,preventAutoNavigate:p})}function At(){const{owner:e,agentId:s}=H.useParams(),{threadId:t}=$({strict:!1}),{new:u,prompt:r}=Q({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:e,agentId:s,threadId:t,initialDraft:r,forceComposer:!t,newChatRequested:!!u})})})}export{At as component};
2
- //# sourceMappingURL=_agentId-EQU2aUP0.js.map
@@ -1,2 +0,0 @@
1
- import{u as b,d as P,j as t,dD as $,dE as L,dF as S,B as r,L as u,d5 as _,dG as z,c as B,M as T,aw as E,H as O,n as H,r as K,at as W,au as F,du as G,dv as N,dj as M,m as U,c9 as V,dH as q,dI as w,aS as J}from"./index-BoqrvLHQ.js";import{u as Q,R as X,a as Y,A as Z}from"./automation-run-now-C5XTS00o.js";import{a as I,b as tt}from"./use-automations-DfBtVzGa.js";import"./event-detail-DUvlqn9b.js";import"./events-feed-DcKTkJVe.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./subDays-9s9OEl5t.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./view-param-filters-DGKxSr7r.js";import"./filter-editors-DGVl9U4D.js";import"./needs-you-list-3uMsWcDv.js";import"./scoped-feed-bar-DNFL0sYX.js";import"./event-kind-options-fHAIXu24.js";import"./create-automation-form-CD6jSlWL.js";import"./entity-options-D4t-NAcg.js";import"./model-selector-D2OpDkwH.js";import"./skill-editor-D_W3QlRz.js";import"./use-mention-search-khySpz_V.js";import"./proposal-review-shell-C8ZfIAYn.js";import"./runs-k2NpbZm8.js";import"./runs-list-DUXRMkWN.js";function et({owner:e,automationId:s,name:i}){const a=b(),n=`/${e}/automations/${encodeURIComponent(String(s))}?view=activity`,{pathname:p,search:h}=P(n);return t.jsx($,{delayDuration:200,children:t.jsxs(L,{children:[t.jsx(S,{asChild:!0,children:t.jsx(r,{asChild:!0,variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsxs(u,{to:p,search:h??{},onClick:o=>{!a||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||(o.preventDefault(),a.open({href:n,title:i,owner:e}))},children:[t.jsx(_,{className:"h-4 w-4","aria-hidden":"true"}),t.jsx("span",{className:"sr-only",children:"View activity"})]})})}),t.jsxs(z,{children:["View activity for ",i]})]})})}function st({owner:e,automationId:s,view:i,runId:a}){const n=B(),{orgContext:p,hasOrgContext:h}=T(),{data:o,isLoading:g}=E(`/${e}`,p),{isAuthenticated:C}=O(),{isLoading:j}=H(),y=o?.workspace?.id??"",k=C?!h||g||j:g||j,c=I(s,void 0,y).data?.automation,x=c?.automation_name??"Automation",f=()=>void n({to:"/$owner",params:{owner:e},search:{section:"automation"}}),d=tt(),R=()=>void n({to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"activity",run_id:void 0}}),A=()=>void n({to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"definition",run_id:void 0},replace:!0}),m=!a&&i==="definition",[D,v]=K.useState(!1),l=Q(e,s,c,!a&&!m);return t.jsx(W,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(F,{className:"flex min-w-0 flex-col gap-4",children:[t.jsx(G,{crumbs:[m||a?t.jsx(u,{to:"/$owner",params:{owner:e},search:{section:"automation"},className:N,children:"Automations"},"automations"):t.jsx(u,{to:"/$owner",params:{owner:e},className:N,children:"Home"},"home")],current:a?"Review change":x}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"flex min-w-0 items-center gap-2",children:t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx(M,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),k&&!c?t.jsx(U,{className:"h-5 w-40"}):a?"Review change":x]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[m?t.jsx(et,{owner:e,automationId:s,name:x}):null,m&&c?D?t.jsxs(t.Fragment,{children:[t.jsx(r,{type:"button",variant:"destructive",size:"sm",className:"h-8",disabled:d.isPending,onClick:()=>d.mutate(s,{onSuccess:f}),children:d.isPending?"Deleting...":"Delete"}),t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"h-8",disabled:d.isPending,onClick:()=>v(!1),children:"Cancel"})]}):t.jsxs(r,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:()=>v(!0),children:[t.jsx(V,{className:"h-3.5 w-3.5"}),"Delete"]}):null,l.canRun&&!l.paused?t.jsx(X,{pending:l.pending,onRun:l.run}):null,a?null:m?t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:R,children:"Done"}):t.jsx(r,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs(u,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"definition",run_id:void 0},children:[t.jsx(q,{className:"h-3.5 w-3.5"}),"Edit"]})})]})]}),t.jsx(Y,{runNow:l}),t.jsx(Z,{owner:e,agentId:c?.managed_agent_id??null,automationId:s,view:i,runId:a,onDone:a?f:A})]})})}function Ot(){const{owner:e,automationId:s}=w.useParams(),i=w.useSearch();return t.jsx(J,{owner:e,children:()=>t.jsx(st,{owner:e,automationId:s,view:i.view,runId:i.run_id})})}export{Ot as component};
2
- //# sourceMappingURL=_automationId-PXZ33jsF.js.map
@@ -1,2 +0,0 @@
1
- import{jq as P,j as e,aS as Q,c as X,aZ as Y,cK as K,cM as ee,d_ as ne,B as M,L as c,cx as te,a_ as se,j9 as oe,ja as ae,ba as ie,dv as u,j4 as re,aP as ce,iF as de,dt as R,du as y,aD as me,W as le,S as pe}from"./index-BoqrvLHQ.js";import{f as ue,C as he,a as xe,F as je,b as fe,c as ve,A as Ce,d as De}from"./connection-feed-detail-BYo7zdVD.js";import{c as $e,C as Ne}from"./device-pin-tombstone-Dkj7hrBE.js";import{C as b}from"./connector-page-shell-an3SYLim.js";import{a as ge}from"./connector-provenance-mSZCOud-.js";import{D as be}from"./detail-page-skeleton-CPAfZLG0.js";import{S as T,g as W}from"./status-variants-SzXYYedJ.js";import"./scoped-feed-bar-DNFL0sYX.js";import"./event-kind-options-fHAIXu24.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./events-feed-DcKTkJVe.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./use-automations-DfBtVzGa.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";import"./entity-options-D4t-NAcg.js";import"./runs-list-DUXRMkWN.js";import"./feed-event-kinds-BYuZCoU4.js";import"./runs-k2NpbZm8.js";function tn(){const{owner:p,connectorKey:n,connectionId:f}=P.useParams(),{addFeed:o,feedId:i,settings:x,auth_result:a}=P.useSearch();return e.jsx(Q,{owner:p,children:d=>e.jsx(_e,{organizationId:d.organizationId,ownerSlug:d.ownerSlug,isWorkspaceLoading:d.isWorkspaceLoading,connectorKey:n,connectionId:Number(f),showAddFeed:o===!0,feedId:i,settingsView:x===!0,authResult:a})})}function _e({organizationId:p,ownerSlug:n,isWorkspaceLoading:f,connectorKey:o,connectionId:i,showAddFeed:x,feedId:a,settingsView:d,authResult:_}){const S=X(),{data:H=[]}=Y(),{data:O=[],isLoading:V,isError:v,refetch:q}=K(p??"",{connectorKey:o,connectionIds:[i]}),{data:F=[]}=ee(p??""),{data:z=[],isLoading:G,isError:U,refetch:Z}=ne(a?i:null,{eventCounts:!0}),t=O.find(r=>r.id===i),s=F.find(r=>r.key===o),m=a?z.find(r=>r.id===a):null;if(f||V||a&&G||!p)return e.jsx(be,{label:a?"Loading feed":"Loading connection"});if(v||a&&U)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",v?"connection":"feed","."]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>void(v?q():Z()),children:"Retry"})]});if(!t)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",s?.name??o]})]});const C=te({...t,connector_name:t.connector_name??s?.name??null}),D=!a&&!x,J=()=>void S({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},replace:!0});let h,j=C,w,k,$;a?m?(j=ue(m,s),m.store==="channel_messages"?(h=e.jsx(xe,{feed:m,hideHeader:!0}),$="chat channel"):(w=e.jsx(je,{feed:m,ownerSlug:n}),k=e.jsx(fe,{feed:m}),h=e.jsx(ve,{feed:m,connectorDef:s,ownerSlug:n}))):(h=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),j="Feed"):x&&(h=e.jsx(Ce,{onClose:J,organizationId:p,connections:[t],connectorDefinitions:F}),j="Add feed",$=De);const l=H.find(r=>r.id===t.device_worker_id&&se(r,n)),L=l?oe(l):void 0,N=L?ae(n,L,ie()):void 0,I=[e.jsx(c,{to:"/$owner/connectors",params:{owner:n},className:u,children:"Connectors"},"connectors"),...l&&N?[e.jsx(c,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:N.id},className:u,children:N.name},"app"),e.jsx(c,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:l.id},className:u,children:re(l)},"device")]:[e.jsx(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:u,children:s?.name??o},"connector")]];D||I.push(e.jsx(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},className:u,children:C},"connection"));const g=D?$e(t):null,A=$??g??void 0,E=s?e.jsx(ce,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??de(s.auth_schema)}):null,B=e.jsx(R,{breadcrumb:e.jsx(y,{crumbs:I}),icon:E,title:j,status:w??e.jsx(T,{status:W(t.status),showDot:!0,children:t.status}),meta:k,caption:A,captionTone:g?"error":"muted"});return D?l&&s&&me(s)?e.jsx(le,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:l.id},search:{connection:t.id,settings:d||void 0},hash:`connection-${t.id}`,replace:!0}):!d&&!_?e.jsx(b,{header:e.jsx(R,{breadcrumb:e.jsx(y,{crumbs:[e.jsx(c,{to:"/$owner",params:{owner:n},className:u,children:"Home"},"home")]}),icon:E,title:C,status:e.jsx(T,{status:W(t.status),showDot:!0,children:t.status}),meta:e.jsx(M,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:e.jsxs(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{settings:!0},children:[e.jsx(pe,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Settings"]})}),caption:A,captionTone:g?"error":"muted"}),children:e.jsx(he,{connection:t,ownerSlug:n})}):e.jsxs(b,{header:B,children:[e.jsx(ge,{connectorDef:s,connectorKey:o,ownerSlug:n,deviceWorkerId:t.device_worker_id,deviceLabel:t.device_label}),e.jsx(Ne,{embedded:!0,connection:t,connectorDef:s,ownerSlug:n,openSettings:d,authResult:_},t.id)]}):e.jsx(b,{header:B,children:e.jsx("div",{className:"mt-0",children:h})})}export{tn as component};
2
- //# sourceMappingURL=_connectorKey._connectionId-DcI29kGy.js.map
@@ -1,2 +0,0 @@
1
- import{aW as Pe,aX as Se,aY as $e,b3 as re,b0 as J,i9 as Ge,ia as Qe,j as e,ib as Ze,B as g,L as _,b2 as le,bl as Ee,dt as ee,du as se,dv as M,ic as Je,y as es,id as Z,r as u,ie as ye,ig as De,dM as ss,ih as Ne,by as I,ii as Ce,Z as k,bq as ts,br as ns,bs as as,bt as is,bu as rs,ij as os,$ as S,bR as V,al as z,A as ke,ik as ls,il as cs,ez as ds,im as us,c9 as ce,io as ms,ip as xs,iq as _e,ir as Fe,is as Le,e9 as Be,a7 as D,a8 as te,it as hs,gA as ps,iu as gs,cJ as Re,iv as Ke,i5 as R,c as X,iw as js,aE as fs,aF as vs,aH as bs,ix as W,iy as ys,aS as Ns,u as Oe,iz as Ie,iA as Cs,b5 as ks,iB as ws,iC as As,iD as Ps,aV as we,aU as Ss,cK as $s,aN as Es,au as U,f2 as Me,dz as Ds,iE as Ue,aP as de,be as _s,i as Fs,iF as Ls}from"./index-BoqrvLHQ.js";import{C as Bs,A as Rs}from"./connect-menu-BWrAhMqO.js";import{C as ne}from"./connector-page-shell-an3SYLim.js";import{C as Ks}from"./connector-provenance-mSZCOud-.js";import{R as Os,D as ue}from"./detail-page-skeleton-CPAfZLG0.js";import{L as oe}from"./list-skeleton-CH0qQBYk.js";import"./runs-k2NpbZm8.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./runs-list-DUXRMkWN.js";import"./run-initiator-BKSgI1o0.js";import"./use-automations-DfBtVzGa.js";import"./clients-Bf7ZgGro.js";function Is({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",o=Pe({enabled:n}),d=Se({enabled:n}),x=$e({enabled:!n}),c=n?o:x,l=n?d.data?.find(i=>i.slug===a)?.displayName??a:re(a),p=(n?(o.data??[]).filter(i=>i.kind===a).map(i=>({key:`${J}${i.slug}`,name:i.displayName||i.slug,status:[i.isDefault?"Default":null,i.status].filter(Boolean).join(" · ")})):(x.data?.sandboxes??[]).filter(i=>i.providerKind===a).map(i=>({key:`${Ge}${i.id}`,name:i.name,status:i.connected?"Connected":"Needs credentials"}))).map(i=>({id:i.key,name:i.name,description:i.status,tone:null,link:Qe({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:i.key},search:{}})})),m=`${n?J:le}${a}`;return e.jsx(ne,{header:e.jsx(ee,{title:l,breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors")]})}),children:e.jsx(Ze,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:n?e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(Ee,{ownerSlug:s,connectorKey:m})})})}function Ms({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:o,onDone:d}){const x=Je(),c=es(),l=s.find(r=>r.slug===t)??s[0],p=n&&l&&Z(l)?"oauth":"api-key",[m,i]=u.useState(l?.slug??""),[f,N]=u.useState(a??l?.slug??""),[h,b]=u.useState(l?.displayName??""),[v,w]=u.useState(l?.baseUrl??""),[E,A]=u.useState(o??l?.defaultModel??""),[$,T]=u.useState(""),[Y,B]=u.useState(l?.apiKeyPlaceholder??""),[q,K]=u.useState(p),[F,H]=u.useState(""),[C,ae]=u.useState(null),[O,L]=u.useState(!1),[me,xe]=u.useState(!1),j=s.find(r=>r.slug===m),G=ye(j?.modalities??[]),he=n&&!!j&&Z(j),pe=j?De(j):!1,ge=he&&q==="oauth",je=pe&&!ge,P=ss().slug,Q=u.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),ze=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),Te=u.useCallback(async()=>{if(!(!P||!j)){L(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(r.authorizeUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{L(!1)}}},[P,j]),qe=u.useCallback(async()=>{if(!(!P||!j||!F.trim())){L(!0);try{const r=await Ce(P,j.slug,{code:F.trim()});if(r.status!=="success")throw new Error(r.error||"Sign-in not complete");Q(),I.success(`Signed in with ${j.displayName}`)}catch(r){I.error(r instanceof Error?r.message:"Failed to complete sign-in")}finally{L(!1)}}},[P,j,F,Q]),Ve=u.useCallback(async()=>{if(!(!P||!j)){L(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="device")throw new Error("Unexpected sign-in mode");ae({userCode:r.userCode,deviceAuthId:r.deviceAuthId,verificationUrl:r.verificationUrl}),window.open(r.verificationUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{L(!1)}}},[P,j]),We=u.useCallback(async()=>{if(!(!P||!j||!C)){L(!0);try{const r=await Ce(P,j.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(r.status==="success"){Q(),I.success(`Signed in with ${j.displayName}`);return}ae(y=>y&&{...y,message:r.error||"Waiting for approval..."})}catch(r){I.error(r instanceof Error?r.message:"Failed to check status")}finally{L(!1)}}},[P,j,C,Q]),Xe=j?.supportedAuthTypes.includes("device-code")??!1,Ye=r=>{i(r);const y=s.find(ie=>ie.slug===r);y&&(N(y.slug),b(y.displayName),w(y.baseUrl),A(y.slug===t&&o?o:y.defaultModel??""),B(y.apiKeyPlaceholder),K(n&&Z(y)?"oauth":"api-key"),H(""),ae(null),xe(!1))},fe=/^[a-z0-9][a-z0-9-]*$/.test(f),ve=fe&&je&&$.trim().length>0&&!x.isPending,He=r=>{if(r.preventDefault(),!ve)return;const y={};v.trim()&&(y.base_url=v.trim()),E.trim()&&(y.model=E.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;x.mutate({slug:f.trim(),kind:m,displayName:h.trim()||void 0,apiKey:$.trim(),capabilities:ie},{onSuccess:()=>d()})},be=!!(t&&s.some(r=>r.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:be&&j?`Connect ${j.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:He,className:"grid max-w-md gap-3",children:[be&&j?e.jsx("p",{className:"text-xs text-muted-foreground",children:G.length>0?`Serves text, plus ${G.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ts,{value:m,onValueChange:Ye,children:[e.jsx(ns,{id:"ip-provider",className:"w-full",children:e.jsx(as,{})}),e.jsx(is,{children:s.map(r=>{const y=ye(r.modalities);return e.jsx(rs,{value:r.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.iconUrl?e.jsx("img",{src:r.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(os,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},r.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:G.length>0?`Serves text, plus ${G.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx(S,{id:"ip-display",placeholder:"Friendly name",value:h,onChange:r=>b(r.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:r=>N(r.target.value),autoComplete:"off",required:!0}),f&&!fe?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."})]}),he&&pe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{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:q==="oauth"?"secondary":"ghost",onClick:()=>K("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:q==="api-key"?"secondary":"ghost",onClick:()=>K("api-key"),children:"API key"})]})]}):null,je?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(S,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:r=>w(r.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(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx(S,{id:"ip-model",placeholder:"gpt-4o-mini",value:E,onChange:r=>A(r.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-key",type:"password",placeholder:Y||void 0,value:$,onChange:r=>T(r.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(V,{onCancel:d,children:e.jsx(g,{type:"submit",disabled:!ve,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ge?e.jsxs("div",{className:"grid gap-3",children:[me?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",j?.displayName??"provider",". This covers your agents in this org."]}):Xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Ve(),disabled:O||!P,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(S,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",j?.displayName??"provider"," to approve",e.jsx(ke,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.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 We(),disabled:O,children:O?"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 Te(),disabled:O||!P,children:["Sign in with ",j?.displayName??"provider",e.jsx(ke,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(S,{id:"ip-oauth-code",placeholder:"code#state",value:F,onChange:r=>H(r.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void qe(),disabled:O||!F.trim(),children:O?"Finishing...":"Finish sign-in"})]}),e.jsx(V,{onCancel:d,children:e.jsx(g,{type:"button",onClick:ze,disabled:!me,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(V,{onCancel:d})]})]})]})}const Us={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function zs({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[o,d]=u.useState(a?"edit":null),x=cs(s.kind,t);u.useEffect(()=>{a&&d("edit")},[a]);const l=(t.find(i=>i.slug===s.kind)?.modalities??["text"]).filter(i=>i!=="text"),p=x&&l.length>0,m=i=>d(f=>f===i?null:i);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 ${ds(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"}),p?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),o==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(qs,{provider:s,supportsUpstreamConfig:x,onDone:()=>d(null)})}):null,o==="capabilities"&&p?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(i=>e.jsx(Vs,{providerSlug:s.slug,modality:i,block:s.capabilities[i]??{}},i))]})}):null]})}function Ts({provider:s,onDeleted:t}){const a=us(),[n,o]=u.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:()=>o(!1)}),children:[a.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>o(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>o(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function qs({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=ms(),o=xs(),d=_e(),[x,c]=u.useState(s.displayName??""),[l,p]=u.useState(""),m=s.capabilities.text??{},[i,f]=u.useState(m.base_url??""),[N,h]=u.useState(m.model??""),[b,v]=u.useState(null),w=x.trim().length>0&&x.trim()!==(s.displayName??""),E=t&&l.trim().length>0,A=i.trim()!==(m.base_url??""),$=N.trim()!==(m.model??""),T=t&&(A||$),Y={base_url:i.trim()||void 0,model:N.trim()||void 0,models_endpoint:m.models_endpoint},B=Fe(Y),q=t&&T&&Le(B),K=n.isPending||o.isPending||d.isPending,F=(w||E||T)&&!q&&!K,H=async C=>{if(C.preventDefault(),!!F){v(null);try{await Promise.all([w?n.mutateAsync({providerSlug:s.slug,displayName:x.trim()}):Promise.resolve(),T?d.mutateAsync({providerSlug:s.slug,modality:"text",block:Y}):Promise.resolve(),E?o.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:H,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(S,{id:`edit-name-${s.slug}`,value:x,onChange:C=>c(C.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(k,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(S,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:i,onChange:C=>f(C.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(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(S,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:C=>h(C.target.value),autoComplete:"off"}),B.model?e.jsx("p",{className:"text-xs text-destructive",children:B.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(S,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:C=>p(C.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,b?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:b}):null,e.jsx(V,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!F,children:K?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function Vs({providerSlug:s,modality:t,block:a}){const n=_e(),[o,d]=u.useState(!1),[x,c]=u.useState(a.base_url??""),[l,p]=u.useState(a.model??""),[m,i]=u.useState(a.models_endpoint??""),[f,N]=u.useState(!!a.models_endpoint),h=!!(a.base_url||a.model||a.models_endpoint),b={base_url:x.trim()||void 0,model:l.trim()||void 0,models_endpoint:m.trim()||void 0},v=Fe(b),w=Le(v),E=()=>{w||n.mutate({providerSlug:s,modality:t,block:b})};return e.jsxs("div",{className:Be,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(A=>!A),children:[e.jsx("span",{className:"text-sm font-medium",children:Us[t]}),h?e.jsx(D,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),o?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(S,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:x,onChange:A=>c(A.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(S,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:A=>p(A.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(S,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:A=>i(A.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.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(V,{onCancel:()=>d(!1),children:e.jsx(g,{size:"sm",disabled:w||n.isPending,onClick:E,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function Ws({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(Ys,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(D,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(D,{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(D,{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(te,{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 Xs({sandbox:s,onDeleted:t}){const a=hs(),[n,o]=u.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(ce,{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(z,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),children:"Delete sandbox"})]})})}function Ys({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(ps,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(gs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Hs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Gs={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Ct(){const{owner:s,connectorKey:t}=W.useParams(),{instances:a}=W.useSearch(),{kind:n,id:o}=ys(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:x,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Is,{ownerSlug:d,familyKind:n,familyId:o});switch(n){case"inference":return e.jsx(Js,{ownerSlug:d,providerSlug:o});case"sandbox":return e.jsx(Zs,{ownerSlug:d,sandboxId:o});case"sandbox-provider":return e.jsx(Qs,{ownerSlug:d,providerKind:o});default:return e.jsx(nt,{ownerSlug:d,organizationId:x,isWorkspaceLoading:c,connectorKey:t})}}})}function Qs({ownerSlug:s,providerKind:t}){const a=X();return u.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${le}${t}`},replace:!0})},[a,s,t]),null}function Zs({ownerSlug:s,sandboxId:t}){const a=X(),{data:n,isLoading:o,isError:d,refetch:x}=$e(),c=n?.sandboxes.find(p=>p.id===t)??null;if(o)return e.jsx(ue,{label:"Loading sandbox",sections:1});if(d)return e.jsx(U,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(g,{variant:"outline",onClick:()=>void x(),children:"Retry"})]})});if(!c)return e.jsxs(U,{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=c.name||re(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${le}${c.providerKind}`},search:{instances:!0},className:M,children:re(c.providerKind)},"family")]}),icon:e.jsx(de,{name:l,faviconDomain:_s(c.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(D,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(D,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Ue,{facets:Gs})}),children:[e.jsx(Ws,{sandbox:c}),e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Xs,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Js({ownerSlug:s,providerSlug:t}){const a=X(),{model:n,reason:o,agentId:d,addAccount:x}=W.useSearch(),{data:c=[],isLoading:l,isError:p,refetch:m}=Pe(),i=Se(),{data:f=[],isLoading:N}=i,h=x?null:c.find($=>$.slug===t)??null,b=f.find($=>$.slug===(h?.kind??t))??null;if(l||N)return e.jsx(ue,{label:"Loading account"});if(p)return e.jsx(U,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(g,{variant:"outline",onClick:()=>void m(),children:"Retry"})]})});if(!h&&!b&&!i.isError)return e.jsxs(U,{className:"space-y-3",children:[e.jsx(Me,{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 v=h?h.displayName||h.slug:b?.displayName||t,w=h!==null,E=o?e.jsx(tt,{agentId:d,model:n,providerName:v}):n?e.jsx(st,{providerName:v,model:n,isConnected:w}):null,A=e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),...h?[e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${h.kind}`},search:{instances:!0},className:M,children:b?.displayName??h.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:b?.iconUrl,name:v}),title:v,badge:h?e.jsxs(e.Fragment,{children:[h.isDefault?e.jsx(D,{variant:"secondary",children:"Default"}):null,h.status?e.jsx(D,{variant:"outline",children:h.status}):null,h.hasCustomUpstream?e.jsx(D,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Ue,{facets:Hs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:A,children:[E,e.jsx("div",{className:"space-y-6",children:h?e.jsx(zs,{provider:h,catalog:f,autoOpenEdit:!!n}):e.jsx(et,{ownerSlug:s,providerSlug:t,existingSlugs:c.map($=>$.slug),catalog:f,catalogError:i.isError?i.error:null,model:n})}),h?e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ts,{provider:h,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function et({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:o,model:d}){const x=X(),c=n.find(m=>m.slug===t),l=a.includes(t)&&!!c&&Z(c);let p=t;for(let m=2;a.includes(p);m++)p=`${t}-${m}`;return o?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(te,{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:o instanceof Error?o.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(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${t}`},search:{},children:"Open existing connection"})})]}),(!l||c&&De(c))&&e.jsx(Ms,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!l,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void x({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function st({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(te,{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 tt({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(te,{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 nt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:o=[],isLoading:d,isError:x,refetch:c}=Ss(t??""),{data:l=[],isLoading:p,isError:m,refetch:i}=$s(t??"",{connectorKey:n}),{setup:f}=W.useSearch(),N=W.useNavigate(),h=u.useMemo(()=>o.find(w=>w.key===n),[o,n]),b=u.useMemo(()=>Es(n,o,{name:l[0]?.connector_name??n}),[n,o,l]);if(a||d)return e.jsx(ue,{label:"Loading connector",sections:3});if(x||m)return e.jsx(U,{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:()=>{c(),i()},children:"Retry"})]})});const v=h?e.jsx(it,{connector:h,ownerSlug:s,organizationId:t??void 0,connectionCount:l.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Me,{connector:b,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:h&&t?e.jsx(at,{hero:v,connector:h,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void N({...Ds,search:w=>({...w,setup:void 0}),replace:!0})}):e.jsxs(U,{className:"space-y-6",children:[v,l.length>0&&!p?e.jsx(Ke,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):p?e.jsx(oe,{label:"Loading connections",rows:2}):e.jsx("div",{children:e.jsx(Ee,{ownerSlug:s,connectorKey:n})})]})})}function at({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:o,connections:d,isLoading:x,openNewApp:c,onNewAppHandled:l}){const{isAdmin:p,isLoading:m}=Re(a),i=(t.operations_summary?.total??0)>0,f=e.jsx(Bs,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:l});return e.jsxs(ne,{header:s,children:[x?e.jsx(oe,{label:"Loading connections",rows:2}):d.length>0?e.jsx(Ke,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:o,action:f}):f,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(ct,{connector:t,organizationId:a,ownerSlug:n}),i&&m?e.jsx(oe,{label:"Loading actions",rows:2}):i&&p?e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}):i&&!p?e.jsx(R,{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]}),d.length>0?e.jsx(R,{title:"Runs",children:e.jsx(Os,{scope:{connectorKey:o},ownerSlug:n})}):null,e.jsx(rt,{connector:t,organizationId:a,ownerSlug:n})]})}function it({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:t},className:M,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Ls(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Ks,{connectorDef:s,ownerSlug:t}),a?e.jsx(ot,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function rt({connector:s,organizationId:t,ownerSlug:a}){const n=Cs(s.auth_schema),o=ks(s.auth_schema),d=ws(s.auth_schema),x=As(s.auth_schema),c=n.some(b=>b.type==="env_keys"),l=n.some(b=>b.type==="browser"),p=o.some(b=>b.type==="interactive"),m=!!(d||x||c||l),i=Ps(s),{data:f=[]}=we(t,{connectorKey:s.key,profileKind:"env"}),{data:N=[]}=we(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||l&&N.length>0||!m&&(i||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(Ae,{profiles:f,type:"env"}):null,l&&N.length>0?e.jsx(Ae,{profiles:N,type:"browser_session"}):null,m?null:i?e.jsx(R,{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(_,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):p?e.jsx(R,{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."]})}):null]}):null}function ot({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const o=X(),{isAdmin:d}=Re(t),x=js(),[c,l]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=n>0,i=x.isPending,f=()=>{l(null),x.mutate({connector_key:s.key},{onSuccess:()=>{o({to:"/$owner/connectors",params:{owner:a}})},onError:N=>{l(N instanceof Error?N.message:"Failed to remove connector")}})};return e.jsxs(fs,{onOpenChange:()=>l(null),children:[e.jsx(vs,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(bs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),m?e.jsxs("p",{className:"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,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(g,{variant:"destructive",size:"sm",disabled:i||m,onClick:f,children:[i?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=Oe();return e.jsx(Ie,{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 Ae({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(R,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:Fs(Be,"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(Rs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function ct({connector:s,organizationId:t,ownerSlug:a}){const n=Oe(),o=Object.keys(s.feeds_schema??{}).length;return o?e.jsx(Ie,{title:"Feeds",summary:`${o} ${o===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{at as ConnectorDetailShell,ot as ConnectorRemoveButton,Ct as component};
2
- //# sourceMappingURL=_connectorKey.index-Cr2NDJWX.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,da as w,i as c,jF as h,jG as p,jH as d,jI as u,jJ as A,r as M,n as C,cK as z,jK as N}from"./index-BoqrvLHQ.js";import{A as y}from"./agent-loading-shells-BLNHIy-r.js";import{s as b,R as k,A as I}from"./agent-thread-Cqf9ITrT.js";import{d as O}from"./events-feed-DcKTkJVe.js";import"./app-bridge-B-L0rGz9.js";import"./pending-seed-BBACroge.js";import"./use-mention-search-khySpz_V.js";import"./index-Vcq4gwWv.js";import"./use-automations-DfBtVzGa.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./subDays-9s9OEl5t.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";const P={discord:{hex:`#${u.hex}`,path:u.path},gchat:{hex:`#${d.hex}`,path:d.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:`#${p.hex}`,path:p.path},whatsapp:{hex:`#${h.hex}`,path:h.path}};function R({platform:s,className:a}){const t=s?P[s]:null;return t?"imgSrc"in t?e.jsx("img",{src:t.imgSrc,alt:"","aria-hidden":"true",className:c("rounded-sm",a),loading:"lazy"}):e.jsx("svg",{viewBox:t.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:a,style:{color:t.hex},children:e.jsx("path",{d:t.path})}):e.jsx(w,{className:c("text-muted-foreground",a),"aria-hidden":"true"})}function S(s,a,t){return s==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function T({owner:s,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=A(a,t,{orgSlug:s}),i=M.useMemo(()=>n.map(r=>b(r,{showToolCalls:!0})).filter(r=>r!==null),[n]),[o,g]=t.split(":"),m=O(o)??"the source app",{org:f}=C(),{data:j=[]}=z(f?.id??"",{connectorKey:o}),v=j[0]?.config?.chatMetadata,l=S(o,g,v);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:x?e.jsx(y,{readOnly:!0}):i.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(k,{messages:i,children:e.jsx(I,{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(R,{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 ",m,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",m," →"]})]}):null]})})}function s2(){const{owner:s,agentId:a,conversationId:t}=N.useParams();return e.jsx(T,{owner:s,agentId:a,conversationId:t})}export{s2 as component};
2
- //# sourceMappingURL=_conversationId-CnmLYlVS.js.map
@@ -1,2 +0,0 @@
1
- import{V as v,c as d,j as r,at as h,aS as f,cg as x,ch as w,ci as j,cj as P,bp as g,ck as E}from"./index-BoqrvLHQ.js";import{E as $}from"./event-detail-DUvlqn9b.js";import"./events-feed-DcKTkJVe.js";import"./definition-comparison-D_qP25jR.js";import"./json-diff-OjtREegr.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";import"./schema-value-wjqGxXhv.js";import"./run-initiator-BKSgI1o0.js";import"./list-skeleton-CH0qQBYk.js";import"./subDays-9s9OEl5t.js";import"./use-automations-DfBtVzGa.js";import"./clients-Bf7ZgGro.js";import"./renderer-CTKNMcXP.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./copy-button-Xhh7ZnjO.js";import"./device-automation-Dp3faMvp.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./view-param-filters-DGKxSr7r.js";import"./filter-editors-DGVl9U4D.js";function b({owner:e,eventId:t,viewKey:s}){const o=v({strict:!1}),p=d(),m=(i,a)=>r.jsx($,{owner:a,organizationId:i,eventId:t,viewKey:s,params:s?j(o):{},onParamsChange:(n,c,l)=>void p({to:w(a,t,n),search:u=>x(u,c),replace:l?.replace??!0}),fullBleed:!0},`${a}/${t}`);return r.jsx(h,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):r.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):r.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function M(){const{owner:e,eventId:t}=P.useParams(),s=g({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=E(t);return o===null?null:r.jsx(b,{owner:e,eventId:o,viewKey:s?.viewKey})}export{M as component};
2
- //# sourceMappingURL=_eventId-w5sDz5oa.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-CEsDVScl.js","assets/index-BoqrvLHQ.js","assets/index-Pae_f9LM.css","assets/automation-run-now-C5XTS00o.js","assets/event-detail-DUvlqn9b.js","assets/events-feed-DcKTkJVe.js","assets/definition-comparison-D_qP25jR.js","assets/json-diff-OjtREegr.js","assets/code-editor-z1Sy_hiX.js","assets/index-Vcq4gwWv.js","assets/schema-value-wjqGxXhv.js","assets/run-initiator-BKSgI1o0.js","assets/list-skeleton-CH0qQBYk.js","assets/subDays-9s9OEl5t.js","assets/use-automations-DfBtVzGa.js","assets/clients-Bf7ZgGro.js","assets/renderer-CTKNMcXP.js","assets/card-CAPpY9P5.js","assets/table-ZuYMOjVR.js","assets/copy-button-Xhh7ZnjO.js","assets/device-automation-Dp3faMvp.js","assets/missing-view-xT0B-f5z.js","assets/app-bridge-B-L0rGz9.js","assets/view-param-filters-DGKxSr7r.js","assets/filter-editors-DGVl9U4D.js","assets/needs-you-list-3uMsWcDv.js","assets/scoped-feed-bar-DNFL0sYX.js","assets/event-kind-options-fHAIXu24.js","assets/create-automation-form-CD6jSlWL.js","assets/entity-options-D4t-NAcg.js","assets/model-selector-D2OpDkwH.js","assets/skill-editor-D_W3QlRz.js","assets/use-mention-search-khySpz_V.js","assets/proposal-review-shell-C8ZfIAYn.js","assets/runs-k2NpbZm8.js","assets/runs-list-DUXRMkWN.js","assets/agent-loading-shells-BLNHIy-r.js","assets/agent-thread-Cqf9ITrT.js","assets/pending-seed-BBACroge.js","assets/connection-feed-detail-BYo7zdVD.js","assets/status-variants-SzXYYedJ.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-BWrAhMqO.js","assets/source-record-panels-BMut9YIA.js","assets/entity-type-page-CkCSbkBx.js","assets/views-access-required-HA-PiOwA.js","assets/dynamic-schema-form-CRyUchXo.js","assets/record-session-BrM9cdXu.js"])))=>i.map(i=>d[i]);
2
- import{p as m,j as t,r as p,C as R,L as v,u as N,a as P,b as A,c as E,d as D,D as _,e as $,f as z,g as K,h as L,i as j,B as h,k as T,S as O,A as q,X as W,l as B,_ as U,m as g,n as C,o as F,q as H,s as Q,t as G,v as J,w as M,x as V,y as Y,z as X,E as Z,F as w,G as S,R as ee,H as te,I as ne,J as ae,K as se,N as re,O as b}from"./index-BoqrvLHQ.js";import{R as ie}from"./record-session-BrM9cdXu.js";import{u as oe}from"./use-automations-DfBtVzGa.js";import{u as le}from"./clients-Bf7ZgGro.js";function I({item:e}){const n=e.href?m(e.href):null;if(!n||n.kind==="event"||n.kind==="automation"&&!("runId"in n&&n.runId!=null))return null;const a=n.owner,o=n.kind==="automation"?n.automationId:e.sourceAttribution?.automation_id??null,s=e.sourceAttribution,r=[{label:a,to:"/$owner",params:{owner:a}}];return s?.agent_id&&s.agent_name&&r.push({label:s.agent_name,to:"/$owner/agents/$agentId",params:{owner:a,agentId:s.agent_id}}),o!=null&&r.push({label:s?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:a,automationId:String(o)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?r.push({label:"Run details"}):n.kind==="memory"&&"contentIds"in n&&r.push({label:"Details"}),r.length<2?null:t.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:r.map((i,l)=>{const c=l===r.length-1,f=t.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:i.label});return t.jsxs(p.Fragment,{children:[l>0?t.jsx(R,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,i.to&&!c?t.jsx(v,{to:i.to,params:i.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:i.label}):f]},i.to??i.label)})})}const ce=B(async()=>({default:(await U(async()=>{const{PeekPaneContent:e}=await import("./peek-pane-content-CEsDVScl.js");return{PeekPaneContent:e}},__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,35,36,37,38,39,40,41,42,43,44,45,46,47]))).PeekPaneContent}));function ue(){return t.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[t.jsx(g,{className:"h-5 w-2/3"}),t.jsx(g,{className:"h-4 w-full"}),t.jsx(g,{className:"h-24 w-full rounded-lg"})]})}const de=460,fe=480;function he({children:e}){const n=p.useRef(null),a=N(),o=P(),s=A(n,de+fe),r=!o&&s&&a?.item!=null;return t.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[t.jsx("div",{inert:r,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e}),t.jsx(me,{covers:r})]})}function me({covers:e=!1}){const n=N(),a=P();return n?.item?t.jsx(ve,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:a,covers:e}):null}function y({item:e,children:n}){const a=e.href?m(e.href):null;return a?.kind==="automation"&&a.runId==null&&!e.runId?t.jsx(ge,{owner:a.owner,automationId:a.automationId,fallback:e.title,children:n}):a?.kind==="agent"?t.jsx(we,{agentId:a.agentId,clientIds:a.clientIds,fallback:e.title,children:n}):a?.kind==="event"?t.jsx(xe,{owner:a.owner,eventId:a.eventId,fallback:e.title,children:n}):t.jsx(pe,{item:e,children:n})}function xe({owner:e,eventId:n,fallback:a,children:o}){const{org:s}=C(e),{data:r}=G(s?.id??null,void 0,{contentIds:[n]},e),i=r?.pages[0]?.content.find(l=>Number(l.id)===n);return o({title:i?J(i):a,status:null})}function pe({item:e,children:n}){const a=e.href?m(e.href):null,o=a?.kind==="record-view"?a.viewKey:null,s=a?.kind==="entity-type"?a:null,r=s?.typeSlug??null,i=M({slug:o?a?.owner:void 0}),{data:l}=V(r?a?.owner??null:null),c=r?l?.find(f=>f.slug===r)?.name:void 0;return n({title:o&&i.data?.find(f=>f.key===o)?.name||c&&(s?.view==="activity"?`${c} activity`:c)||e.title,status:null})}function ge({owner:e,automationId:n,fallback:a,children:o}){const{org:s}=C(e),{data:r}=oe(s?.id,void 0,{includeDetails:!1}),i=r?.find(l=>l.automation_id===n);return o({title:i?.name?.trim()||a,status:i?F(H(i),Date.now()):null})}function we({agentId:e,clientIds:n,fallback:a,children:o}){const s=Q({enabled:!!e}),r=le(null,{enabled:!e&&!!n?.length}),i=e?s.data?.find(l=>l.agentId===e)?.name:r.data?.find(l=>n?.includes(l.id))?.title;return o({title:i?.trim()||a,status:null})}function ye(e){const n=e.connectorPanel;if(n?.connectionId!=null)return{label:"Settings",pathname:`/${n.ownerSlug}/connectors/${encodeURIComponent(n.connectorKey)}/${n.connectionId}`,search:{settings:!0}};const a=e.href?m(e.href):null;if(a?.kind==="automation"&&a.runId==null&&!e.runId)return{label:"Edit",pathname:`/${a.owner}/automations/${encodeURIComponent(a.automationId)}`,search:{view:"definition"}};if(a?.kind==="agent"&&a.owner!=="me"){if(a.agentId)return{label:"Agent settings",pathname:`/${a.owner}/agents/${encodeURIComponent(a.agentId)}`};const o=a.clientIds?.[0];if(o)return{label:"Agent settings",pathname:`/${a.owner}/agents/connected/${encodeURIComponent(o)}`}}return null}function ve({item:e,onClose:n,onBack:a,isNarrow:o,covers:s}){const r=E(),i=e.href?m(e.href):null,l=e.runId&&i?.kind==="automation"&&i.view==="activity"?{pathname:`/${i.owner}/events`,search:{run_ids:String(e.runId)}}:e.href?D(e.href):null,c=ye(e);p.useEffect(()=>{if(o)return;const d=u=>{u.defaultPrevented||u.key!=="Escape"||(u.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,o]);const f=d=>t.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-1 border-b border-border px-3 py-1.5",children:[a||d?t.jsx(h,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:a??n,children:t.jsx(T,{className:"h-4 w-4"})}):null,t.jsx(y,{item:e,children:({title:u,status:x})=>t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:u}),x?t.jsx("p",{title:x.text,className:j("truncate text-xs",x.problem?"text-destructive":"text-muted-foreground"),children:x.text}):null]})}),c?t.jsx(h,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",children:t.jsxs(v,{to:c.pathname,search:c.search??{},onClick:u=>{u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||(u.preventDefault(),(async()=>(await n(),await r({to:c.pathname,search:c.search??{}})))())},children:[t.jsx(O,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),c.label]})}):null,l?t.jsx(h,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:t.jsx(v,{to:l.pathname,search:l.search??{},onClick:u=>{u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||(u.preventDefault(),(async()=>(await n(),await r({to:l.pathname,search:l.search??{}})))())},children:t.jsx(q,{className:"h-4 w-4"})})}):null,t.jsx(h,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:t.jsx(W,{className:"h-4 w-4"})})]}),k=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(p.Suspense,{fallback:t.jsx(ue,{}),children:t.jsx(y,{item:e,children:({title:d})=>t.jsx(ce,{item:d===e.title?e:{...e,title:d}})})})});return o?t.jsx(_,{open:!0,onOpenChange:d=>{d||n()},children:t.jsxs($,{children:[t.jsx(z,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),t.jsxs(K,{"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:[t.jsx(L,{className:"sr-only",children:t.jsx(y,{item:e,children:({title:d})=>d})}),f(!0),t.jsx(I,{item:e}),k]})]})}):t.jsxs("aside",{className:j("flex flex-col border-l border-border bg-background",s?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),t.jsx(I,{item:e}),k]})}function ke({owner:e,userId:n,children:a}){const o=Y(),s=X({queryKey:["workspace-invitation",n,e],retry:!1,queryFn:async()=>{const i=await w.organization.listUserInvitations();if(i.error)throw new Error(i.error.message||"Could not check invitations.");for(const l of i.data??[]){if(l.status!=="pending"||new Date(l.expiresAt).getTime()<=Date.now())continue;const c=await w.organization.getInvitation({query:{id:l.id}});if(c.error){if([400,403,404].includes(c.error.status))continue;throw new Error(c.error.message||"Could not check invitations.")}if(c.data.organizationSlug===e)return c.data}return null}}),r=Z({mutationFn:async()=>{if(!s.data)return;const i=await w.organization.acceptInvitation({invitationId:s.data.id});if(i.error)throw new Error(i.error.message||"Could not accept the invitation.");await Promise.all([o.invalidateQueries({queryKey:["organizations"]}),o.invalidateQueries({queryKey:S.queryOptions(e,{slug:e}).queryKey})])}});return s.isPending?t.jsx("p",{role:"status",className:"py-12 text-center text-sm text-muted-foreground",children:"Checking your invitation…"}):s.isError?t.jsxs("div",{className:"flex flex-col items-center gap-3 px-4 py-12 text-center",children:[t.jsx("p",{role:"alert",className:"text-sm text-muted-foreground",children:"Your invitations could not be checked."}),t.jsx(h,{variant:"outline",onClick:()=>void s.refetch(),children:"Try again"})]}):s.data?t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-4 py-12 text-center",children:[t.jsxs("div",{className:"max-w-md space-y-2",children:[t.jsxs("h1",{className:"text-xl font-semibold text-balance",children:["You're invited to join ",s.data.organizationName]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept your invitation to open this workspace."})]}),r.isError&&t.jsx("p",{role:"alert",className:"max-w-md text-sm text-destructive",children:r.error.message}),t.jsx(h,{disabled:r.isPending,onClick:()=>r.mutate(),children:r.isPending?"Joining…":"Accept invitation"})]}):a}function Pe(){const{owner:e}=ee.useParams(),{data:n,isLoading:a,error:o}=S(e==="me"?null:e,{slug:e}),{session:s,isReady:r}=te();if(ne({active:ae({settled:!a,authReady:r,session:s,resolved:!!n?.workspace,error:o}),owner:e}))return null;const l=e!=="me"&&s&&r&&!a&&!n?.workspace&&o instanceof se&&[401,403,404].includes(o.status);return t.jsx(re,{children:t.jsx(ie,{children:t.jsx(he,{children:l&&s?t.jsx(ke,{owner:e,userId:s.user.id,children:t.jsx(b,{})},`${s.user.id}:${e}`):t.jsx(b,{})})})})}export{Pe as component};
3
- //# sourceMappingURL=_owner-CkOZR4n0.js.map
@@ -1,2 +0,0 @@
1
- import{jB as p,j as e,bo as m}from"./index-BoqrvLHQ.js";import{M as i}from"./memory-browse-page-qEDQ9Z18.js";import"./public-shell-ready-K2R8iXSI.js";import"./dynamic-schema-form-CRyUchXo.js";import"./renderer-CTKNMcXP.js";import"./schema-value-wjqGxXhv.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./entity-pages-_nuesgnp.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./entity-schema-graph-Cq96SJ3c.js";import"./core.esm-Ctg_pXLe.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./view-param-filters-DGKxSr7r.js";import"./member-scope-gate-Cxg2zGQT.js";function l(){const{owner:o,entityType:t,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:o,typeScope:m(t),create:!1,shape:r})}export{l as component};
2
- //# sourceMappingURL=_shape-C_FmSf9G.js.map
@@ -1,2 +0,0 @@
1
- import{dr as m,M as y,c as d,ds as u,cY as c,j as t,at as g,au as x,bQ as E}from"./index-BoqrvLHQ.js";import{E as f}from"./entity-type-page-CkCSbkBx.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-z1Sy_hiX.js";import"./index-Vcq4gwWv.js";function b(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=y(),o=d(),{data:i=[],isLoading:r}=u(s),e=i.find(l=>l.slug===n)??null,p=e?c(e):!1;return t.jsx(g,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(x,{children:r?t.jsx(E,{label:"entity type",variant:"panel"}):e?t.jsx(f,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner",params:{owner:a},search:{layout:"graph"}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
2
- //# sourceMappingURL=_slug-COPpRXLt.js.map
@@ -1,2 +0,0 @@
1
- import{jC as t,j as m}from"./index-BoqrvLHQ.js";import{M as i}from"./memory-browse-page-qEDQ9Z18.js";import"./public-shell-ready-K2R8iXSI.js";import"./dynamic-schema-form-CRyUchXo.js";import"./renderer-CTKNMcXP.js";import"./schema-value-wjqGxXhv.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./entity-pages-_nuesgnp.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./entity-schema-graph-Cq96SJ3c.js";import"./core.esm-Ctg_pXLe.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./view-param-filters-DGKxSr7r.js";import"./member-scope-gate-Cxg2zGQT.js";function v(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{v as component};
2
- //# sourceMappingURL=_viewKey-BVdJiilV.js.map
@@ -1,2 +0,0 @@
1
- import{jL as e,j as p,bo as i}from"./index-BoqrvLHQ.js";import{M as m}from"./memory-browse-page-qEDQ9Z18.js";import"./public-shell-ready-K2R8iXSI.js";import"./dynamic-schema-form-CRyUchXo.js";import"./renderer-CTKNMcXP.js";import"./schema-value-wjqGxXhv.js";import"./card-CAPpY9P5.js";import"./table-ZuYMOjVR.js";import"./entity-pages-_nuesgnp.js";import"./filter-editors-DGVl9U4D.js";import"./subDays-9s9OEl5t.js";import"./entity-schema-graph-Cq96SJ3c.js";import"./core.esm-Ctg_pXLe.js";import"./missing-view-xT0B-f5z.js";import"./app-bridge-B-L0rGz9.js";import"./view-param-filters-DGKxSr7r.js";import"./member-scope-gate-Cxg2zGQT.js";function R(){const{owner:o,entityType:t,viewKey:r}=e.useParams();return p.jsx(m,{ownerSlug:o,typeScope:i(t),create:!1,viewKey:r})}export{R as component};
2
- //# sourceMappingURL=_viewKey-mxxpqjtC.js.map