@lobu/runtime-server 24.11.0 → 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 (275) 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/20261115120000_events_unbound_tool_audit_without_bridge.sql +40 -0
  33. package/dist/db/migrations/20261115120001_events_unbound_tool_audit_validate.sql +19 -0
  34. package/dist/db/migrations/20261115120002_drop_events_linked_org_ids.sql +119 -0
  35. package/dist/db/migrations/20261115130000_entities_retired_type_idx.sql +34 -0
  36. package/dist/db/migrations/20261115140000_entity_identities_personal_owner_idx.sql +34 -0
  37. package/dist/db/migrations/20261117090000_write_policy_kind_note.sql +65 -0
  38. package/dist/db/migrations/20261117120000_app_policy_principal.sql +48 -0
  39. package/dist/db/migrations/20261117170000_personal_org_connector_auto_policy_backfill.sql +57 -0
  40. package/dist/db/migrations/20261117190000_org_slug_reserved_paths.sql +29 -0
  41. package/dist/db/migrations/20261118120000_workspace_view_top_level_paths.sql +69 -0
  42. package/dist/db/migrations/preconditions/20261117190000_org_slug_reserved_paths.sql +14 -0
  43. package/dist/db/migrations/preconditions/20261118120000_workspace_view_top_level_paths.sql +21 -0
  44. package/dist/dependencies.bun.lock +51 -46
  45. package/dist/guest.bundle.js +11 -2
  46. package/dist/owletto/dist/assets/_-BC9j6MkU.js +2 -0
  47. package/dist/owletto/dist/assets/_-Z1u1cIe6.js +3 -0
  48. package/dist/owletto/dist/assets/_agentId-B-TFq9TP.js +2 -0
  49. package/dist/owletto/dist/assets/{_agentId-CGScf8z_.js → _agentId-BGatZWsd.js} +2 -2
  50. package/dist/owletto/dist/assets/_automationId-CMUrWPvr.js +2 -0
  51. package/dist/owletto/dist/assets/_connectorKey._connectionId-CUoAoP0_.js +2 -0
  52. package/dist/owletto/dist/assets/_connectorKey.index-Bs49QGGH.js +2 -0
  53. package/dist/owletto/dist/assets/_conversationId-CszP1den.js +2 -0
  54. package/dist/owletto/dist/assets/_eventId-C0AZUBnD.js +2 -0
  55. package/dist/owletto/dist/assets/_owner-B4ydA75k.js +3 -0
  56. package/dist/owletto/dist/assets/_shape-C4-ikE70.js +2 -0
  57. package/dist/owletto/dist/assets/_slug-DE5J3KVu.js +2 -0
  58. package/dist/owletto/dist/assets/_viewKey-Dkcd8JQC.js +2 -0
  59. package/dist/owletto/dist/assets/{accept-invitation-BKeIzZXE.js → accept-invitation-DmrQQu_W.js} +2 -2
  60. package/dist/owletto/dist/assets/{activity-route-location-sLvKaSCa.js → activity-route-location-Bec6fW-t.js} +2 -2
  61. package/dist/owletto/dist/assets/activity-route-view-DCSNBKZU.js +2 -0
  62. package/dist/owletto/dist/assets/agent-client-connections-xvabPpi6.js +4 -0
  63. package/dist/owletto/dist/assets/agent-connect-pages-DDPtkcmq.js +6 -0
  64. package/dist/owletto/dist/assets/{agent-editor-form-DVFyyMyd.js → agent-editor-form-BrhQbHZg.js} +2 -2
  65. package/dist/owletto/dist/assets/{agent-loading-shells-BLNHIy-r.js → agent-loading-shells-D3y98xuO.js} +2 -2
  66. package/dist/owletto/dist/assets/{agent-permissions-matrix-UBKRR5vs.js → agent-permissions-matrix-jQJjSa9i.js} +2 -2
  67. package/dist/owletto/dist/assets/{agent-skill-context-fqedKd0D.js → agent-skill-context-CCcknBYE.js} +2 -2
  68. package/dist/owletto/dist/assets/{agent-subpage-shell-BUCoY2Nf.js → agent-subpage-shell-6f_53cSf.js} +2 -2
  69. package/dist/owletto/dist/assets/agent-thread-v_lSSnJi.js +6 -0
  70. package/dist/owletto/dist/assets/{app._appId-ByIypCL9.js → app._appId-CKWzZ2ic.js} +2 -2
  71. package/dist/owletto/dist/assets/assist-composer-Q9ZJjAta.js +2 -0
  72. package/dist/owletto/dist/assets/automation-run-now-Dl0MKx3N.js +2 -0
  73. package/dist/owletto/dist/assets/{callback-Pz5uS-k7.js → callback-Bentv78L.js} +2 -2
  74. package/dist/owletto/dist/assets/{card-CAPpY9P5.js → card-C4oPCVh6.js} +2 -2
  75. package/dist/owletto/dist/assets/{claim-DgWWK0KI.js → claim-B3C4qIi2.js} +2 -2
  76. package/dist/owletto/dist/assets/client-activity-scopes-DqaFEyir.js +2 -0
  77. package/dist/owletto/dist/assets/{client-rows-Dd5YV8vn.js → client-rows-rse9thnk.js} +2 -2
  78. package/dist/owletto/dist/assets/{clients-Bf7ZgGro.js → clients-BhPMbxHi.js} +2 -2
  79. package/dist/owletto/dist/assets/{code-editor-z1Sy_hiX.js → code-editor-CTdKUDPY.js} +2 -2
  80. package/dist/owletto/dist/assets/connect-D8o7HBlo.js +2 -0
  81. package/dist/owletto/dist/assets/connect-menu-D5EZvSHb.js +2 -0
  82. package/dist/owletto/dist/assets/connect._clientId-Dbagcg9L.js +2 -0
  83. package/dist/owletto/dist/assets/connected._clientId-DALW9S2K.js +2 -0
  84. package/dist/owletto/dist/assets/connection-DyxzSqVE.js +2 -0
  85. package/dist/owletto/dist/assets/connection-feed-detail-LqpxUCdy.js +2 -0
  86. package/dist/owletto/dist/assets/{connector-page-shell-an3SYLim.js → connector-page-shell-DZjKv9zQ.js} +2 -2
  87. package/dist/owletto/dist/assets/{connector-provenance-mSZCOud-.js → connector-provenance-DtTJn1Nk.js} +2 -2
  88. package/dist/owletto/dist/assets/connectors-BVl-AR33.js +2 -0
  89. package/dist/owletto/dist/assets/{consent-1ulwyJ3k.js → consent-XCqsHLxS.js} +2 -2
  90. package/dist/owletto/dist/assets/{core.esm-Ctg_pXLe.js → core.esm-B1du4Zwy.js} +3 -3
  91. package/dist/owletto/dist/assets/create-BYKCtGL4.js +2 -0
  92. package/dist/owletto/dist/assets/create-D6Mmuxcq.js +2 -0
  93. package/dist/owletto/dist/assets/{create-CGuoqPh8.js → create-GHTb6wKX.js} +2 -2
  94. package/dist/owletto/dist/assets/{create-automation-form-CD6jSlWL.js → create-automation-form-CTiy_S9G.js} +3 -3
  95. package/dist/owletto/dist/assets/create._connectorKey-DMH97KkK.js +2 -0
  96. package/dist/owletto/dist/assets/custom-guardrail-edits-DZy66ucV.js +2 -0
  97. package/dist/owletto/dist/assets/definition-comparison-C2mPfIMD.js +2 -0
  98. package/dist/owletto/dist/assets/detail-page-skeleton-DNBL7nyk.js +2 -0
  99. package/dist/owletto/dist/assets/device-CwP1PY8q.js +2 -0
  100. package/dist/owletto/dist/assets/{device-pin-tombstone-Dkj7hrBE.js → device-pin-tombstone-DYTt7kU5.js} +2 -2
  101. package/dist/owletto/dist/assets/device._deviceId-DZ2kqI4Y.js +2 -0
  102. package/dist/owletto/dist/assets/{entity-options-D4t-NAcg.js → entity-options-D9K_5Lcs.js} +2 -2
  103. package/dist/owletto/dist/assets/entity-page-DggKXrcE.js +2 -0
  104. package/dist/owletto/dist/assets/entity-pages-C6M6yKFf.js +2 -0
  105. package/dist/owletto/dist/assets/{entity-schema-graph-Cq96SJ3c.js → entity-schema-graph-B255NKjF.js} +2 -2
  106. package/dist/owletto/dist/assets/entity-type-page-CGBAP2wt.js +2 -0
  107. package/dist/owletto/dist/assets/event-attachments-D8Z8uwv9.js +2 -0
  108. package/dist/owletto/dist/assets/event-detail-CgG3pDLA.js +2 -0
  109. package/dist/owletto/dist/assets/events-feed-ClhEywwV.js +2 -0
  110. package/dist/owletto/dist/assets/{filter-editors-DGVl9U4D.js → filter-editors-D_Sfn0dv.js} +3 -3
  111. package/dist/owletto/dist/assets/{full-page-spinner-CtVlF8GQ.js → full-page-spinner-C1clibUY.js} +2 -2
  112. package/dist/owletto/dist/assets/{index-CK5GDX4B.js → index-04B26s6E.js} +2 -2
  113. package/dist/owletto/dist/assets/index-2HrEO-nl.js +2 -0
  114. package/dist/owletto/dist/assets/index-BU3k9wpw.js +2 -0
  115. package/dist/owletto/dist/assets/{index-DvuJ_S_o.js → index-BXHqp23o.js} +2 -2
  116. package/dist/owletto/dist/assets/index-BdLRUDIR.js +2 -0
  117. package/dist/owletto/dist/assets/index-C2FrGwYN.js +2 -0
  118. package/dist/owletto/dist/assets/index-CB9wGfUm.js +2 -0
  119. package/dist/owletto/dist/assets/index-Caihaftb.js +2 -0
  120. package/dist/owletto/dist/assets/index-CwH59DJV.js +2 -0
  121. package/dist/owletto/dist/assets/index-DB2lVKuV.js +7908 -0
  122. package/dist/owletto/dist/assets/{index-DbjbHlDe.js → index-DTvJRjrM.js} +2 -2
  123. package/dist/owletto/dist/assets/index-SF2ni1Rs.css +1 -0
  124. package/dist/owletto/dist/assets/{index-BifR-LE9.js → index-mSrdbx3C.js} +9 -9
  125. package/dist/owletto/dist/assets/index-uFn-Ilrx.js +2 -0
  126. package/dist/owletto/dist/assets/{json-diff-OjtREegr.js → json-diff-Ce6YAXzY.js} +2 -2
  127. package/dist/owletto/dist/assets/{list-skeleton-CH0qQBYk.js → list-skeleton-DLPBTnbR.js} +2 -2
  128. package/dist/owletto/dist/assets/login-DeWlvogD.js +2 -0
  129. package/dist/owletto/dist/assets/{logout-DfdgOLoM.js → logout-CJY0ceN9.js} +2 -2
  130. package/dist/owletto/dist/assets/{member-scope-gate-Cxg2zGQT.js → member-scope-gate-CBPMprXu.js} +2 -2
  131. package/dist/owletto/dist/assets/memory-browse-page-D5kj1RaR.js +74 -0
  132. package/dist/owletto/dist/assets/{model-selector-D2OpDkwH.js → model-selector-CjkBPpjN.js} +2 -2
  133. package/dist/owletto/dist/assets/new-BKrNkOQD.js +2 -0
  134. package/dist/owletto/dist/assets/new-BetiMuDq.js +2 -0
  135. package/dist/owletto/dist/assets/new-dk_-eXqU.js +2 -0
  136. package/dist/owletto/dist/assets/new-efN--4Wx.js +2 -0
  137. package/dist/owletto/dist/assets/organization-C3rpwx_d.js +2 -0
  138. package/dist/owletto/dist/assets/pdf-document--AN-oCKj.css +1 -0
  139. package/dist/owletto/dist/assets/pdf-document-2W1q0sRA.js +56 -0
  140. package/dist/owletto/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
  141. package/dist/owletto/dist/assets/peek-pane-content-ChsBWO0P.js +3 -0
  142. package/dist/owletto/dist/assets/{pending-seed-BBACroge.js → pending-seed-CTKYdA4X.js} +2 -2
  143. package/dist/owletto/dist/assets/proposal-review-shell-EyGWEYwQ.js +2 -0
  144. package/dist/owletto/dist/assets/public-shell-ready-_KWdfzEM.js +2 -0
  145. package/dist/owletto/dist/assets/record-session-D27VNxP_.js +2 -0
  146. package/dist/owletto/dist/assets/{renderer-CTKNMcXP.js → renderer-B8yZ5lql.js} +34 -33
  147. package/dist/owletto/dist/assets/{reset-password-DKBEneyR.js → reset-password-BGVJIh2I.js} +2 -2
  148. package/dist/owletto/dist/assets/run-initiator-C0sur8lU.js +2 -0
  149. package/dist/owletto/dist/assets/runs-list-CJOFMgpk.js +2 -0
  150. package/dist/owletto/dist/assets/schema-value-DDNHANGs.js +3 -0
  151. package/dist/owletto/dist/assets/{scoped-feed-bar-DNFL0sYX.js → scoped-feed-bar-BTv9mPcR.js} +2 -2
  152. package/dist/owletto/dist/assets/settings-Ponr5XbS.js +3 -0
  153. package/dist/owletto/dist/assets/{status-variants-SzXYYedJ.js → status-variants-mLqVhg5O.js} +2 -2
  154. package/dist/owletto/dist/assets/subDays-BGA_fkig.js +2 -0
  155. package/dist/owletto/dist/assets/two-factor-pqoxGSgL.js +2 -0
  156. package/dist/owletto/dist/assets/{use-automations-DfBtVzGa.js → use-automations-DcdlmVuX.js} +2 -2
  157. package/dist/owletto/dist/assets/{use-login-redirect-BDiS3eyl.js → use-login-redirect-D7HW5Ed6.js} +2 -2
  158. package/dist/owletto/dist/assets/{use-mention-search-khySpz_V.js → use-mention-search-BniE-K2d.js} +3 -3
  159. package/dist/owletto/dist/assets/view-card-Cg6PeEiV.js +2 -0
  160. package/dist/owletto/dist/assets/view-param-filters-CvrKw0mZ.js +2 -0
  161. package/dist/owletto/dist/index.html +2 -2
  162. package/dist/server-main.bundle.mjs +5766 -2999
  163. package/npm-shrinkwrap.json +195 -172
  164. package/package.json +2 -1
  165. package/vendor/connector-sdk/dist/connector-types.d.ts +20 -0
  166. package/vendor/connector-sdk/dist/define-connector.js +2 -0
  167. package/vendor/connector-sdk/dist/extension-dom-scrape.d.ts +2 -0
  168. package/vendor/connector-sdk/dist/extension-dom-scrape.js +5 -0
  169. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +20 -0
  170. package/vendor/connector-sdk/package.json +1 -1
  171. package/vendor/core/dist/contracts/entity-reference.d.ts +2 -0
  172. package/vendor/core/dist/contracts/entity-reference.js +4 -3
  173. package/vendor/core/dist/contracts/tools/entity-list-sort.d.ts +18 -0
  174. package/vendor/core/dist/contracts/tools/entity-list-sort.js +64 -0
  175. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +1 -1
  176. package/vendor/core/dist/contracts/tools/manage-agents.js +3 -3
  177. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +4 -0
  178. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +4 -0
  179. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
  180. package/vendor/core/dist/contracts/tools/manage-entity.js +11 -1
  181. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +29 -3
  182. package/vendor/core/dist/contracts/tools/manage-operations.js +24 -2
  183. package/vendor/core/dist/contracts/tools/manage-views.d.ts +36 -0
  184. package/vendor/core/dist/contracts/tools/manage-views.js +15 -2
  185. package/vendor/core/dist/contracts/tools/view-definition.js +7 -2
  186. package/vendor/core/dist/contracts/tools/view-host.js +5 -0
  187. package/vendor/core/dist/contracts/tools/view-path.d.ts +8 -1
  188. package/vendor/core/dist/contracts/tools/view-path.js +11 -1
  189. package/vendor/core/dist/reserved.d.ts +7 -1
  190. package/vendor/core/dist/reserved.js +17 -0
  191. package/vendor/core/package.json +6 -1
  192. package/vendor/views/dist/api.d.ts +19 -3
  193. package/vendor/views/dist/api.js +53 -5
  194. package/vendor/views/dist/components.d.ts +7 -0
  195. package/vendor/views/dist/components.js +223 -2
  196. package/vendor/views/dist/embed.js +13 -2
  197. package/vendor/views/dist/live-gate.d.ts +34 -0
  198. package/vendor/views/dist/live-gate.js +100 -0
  199. package/vendor/views/dist/native.d.ts +43 -1
  200. package/vendor/views/dist/native.js +1 -0
  201. package/vendor/views/package.json +1 -1
  202. package/dist/owletto/dist/assets/_-BDMUN9XZ.js +0 -2
  203. package/dist/owletto/dist/assets/_-CF5X4ANe.js +0 -3
  204. package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +0 -2
  205. package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +0 -2
  206. package/dist/owletto/dist/assets/_connectorKey._connectionId-DcI29kGy.js +0 -2
  207. package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +0 -2
  208. package/dist/owletto/dist/assets/_conversationId-CnmLYlVS.js +0 -2
  209. package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +0 -2
  210. package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +0 -3
  211. package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +0 -2
  212. package/dist/owletto/dist/assets/_slug-COPpRXLt.js +0 -2
  213. package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +0 -2
  214. package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +0 -2
  215. package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +0 -2
  216. package/dist/owletto/dist/assets/agent-connect-pages-DVq9nAR7.js +0 -4
  217. package/dist/owletto/dist/assets/agent-thread-Cqf9ITrT.js +0 -6
  218. package/dist/owletto/dist/assets/assist-composer-kG_heHXo.js +0 -2
  219. package/dist/owletto/dist/assets/automation-run-now-C5XTS00o.js +0 -2
  220. package/dist/owletto/dist/assets/client-activity-scopes-Aqdo6Pdr.js +0 -2
  221. package/dist/owletto/dist/assets/connect-BFNp1y_s.js +0 -2
  222. package/dist/owletto/dist/assets/connect-menu-BWrAhMqO.js +0 -2
  223. package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +0 -2
  224. package/dist/owletto/dist/assets/connected._clientId-CuOeHafK.js +0 -2
  225. package/dist/owletto/dist/assets/connection-CVeHmDLs.js +0 -2
  226. package/dist/owletto/dist/assets/connection-feed-detail-BYo7zdVD.js +0 -2
  227. package/dist/owletto/dist/assets/connectors-DBEM9QQz.js +0 -2
  228. package/dist/owletto/dist/assets/copy-button-Xhh7ZnjO.js +0 -2
  229. package/dist/owletto/dist/assets/create-Ccb5R-S4.js +0 -2
  230. package/dist/owletto/dist/assets/create-DmhbacIa.js +0 -2
  231. package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +0 -2
  232. package/dist/owletto/dist/assets/custom-guardrail-edits-Ce_BwiwD.js +0 -2
  233. package/dist/owletto/dist/assets/definition-comparison-D_qP25jR.js +0 -2
  234. package/dist/owletto/dist/assets/detail-page-skeleton-CPAfZLG0.js +0 -2
  235. package/dist/owletto/dist/assets/device-DDl5XKvt.js +0 -2
  236. package/dist/owletto/dist/assets/device._deviceId-bNhTcops.js +0 -2
  237. package/dist/owletto/dist/assets/dynamic-schema-form-CRyUchXo.js +0 -2
  238. package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +0 -2
  239. package/dist/owletto/dist/assets/entity-pages-_nuesgnp.js +0 -2
  240. package/dist/owletto/dist/assets/entity-type-page-CkCSbkBx.js +0 -2
  241. package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +0 -2
  242. package/dist/owletto/dist/assets/events-feed-DcKTkJVe.js +0 -2
  243. package/dist/owletto/dist/assets/index-BUlkNJzX.js +0 -2
  244. package/dist/owletto/dist/assets/index-BoqrvLHQ.js +0 -7906
  245. package/dist/owletto/dist/assets/index-CA9mW_ZM.js +0 -2
  246. package/dist/owletto/dist/assets/index-CH0GzG4i.js +0 -2
  247. package/dist/owletto/dist/assets/index-CtI5Eomq.js +0 -2
  248. package/dist/owletto/dist/assets/index-DmtQ0bds.js +0 -2
  249. package/dist/owletto/dist/assets/index-Du_J8hnx.js +0 -2
  250. package/dist/owletto/dist/assets/index-Pae_f9LM.css +0 -1
  251. package/dist/owletto/dist/assets/index-XETZnN7L.js +0 -2
  252. package/dist/owletto/dist/assets/login-DG0b9uSC.js +0 -2
  253. package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +0 -74
  254. package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +0 -2
  255. package/dist/owletto/dist/assets/needs-you-list-3uMsWcDv.js +0 -2
  256. package/dist/owletto/dist/assets/new-AdGV6a8R.js +0 -2
  257. package/dist/owletto/dist/assets/new-BdtIhBpo.js +0 -2
  258. package/dist/owletto/dist/assets/new-BjGwX6s6.js +0 -2
  259. package/dist/owletto/dist/assets/new-D-iMjV74.js +0 -2
  260. package/dist/owletto/dist/assets/organization-qaIpEiQg.js +0 -2
  261. package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +0 -2
  262. package/dist/owletto/dist/assets/proposal-review-shell-C8ZfIAYn.js +0 -2
  263. package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +0 -2
  264. package/dist/owletto/dist/assets/record-session-BrM9cdXu.js +0 -2
  265. package/dist/owletto/dist/assets/run-initiator-BKSgI1o0.js +0 -2
  266. package/dist/owletto/dist/assets/runs-k2NpbZm8.js +0 -2
  267. package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +0 -2
  268. package/dist/owletto/dist/assets/schema-value-wjqGxXhv.js +0 -3
  269. package/dist/owletto/dist/assets/settings-V0m5Om5j.js +0 -2
  270. package/dist/owletto/dist/assets/source-record-panels-BMut9YIA.js +0 -2
  271. package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +0 -2
  272. package/dist/owletto/dist/assets/table-ZuYMOjVR.js +0 -2
  273. package/dist/owletto/dist/assets/view-card-DiHWlypr.js +0 -2
  274. package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +0 -2
  275. package/dist/owletto/dist/assets/views-access-required-HA-PiOwA.js +0 -2
@@ -1,3 +1,3 @@
1
- import{j as e,i as g,r as x,B as j,aE as D,aF as L,eM as E,dh as Z,aH as O,k as B,aI as W,aJ as _,aK as Q,aL as A,aM as H,aO as V,a9 as U,X as q,ab as ee,ea as N,eN as se,eO as k,eP as w,$ as R,eQ as te}from"./index-BoqrvLHQ.js";import{s as P}from"./subDays-9s9OEl5t.js";function G(s){return s&&s.kind!=="toggle"?s:void 0}const M="w-72";function ne(s){return s<=0?Number.POSITIVE_INFINITY:s<=359?0:s<=479?2:3}function re(){const s=x.useRef(null),[t,n]=x.useState(0);return x.useLayoutEffect(()=>{const l=s.current;if(!l||(n(l.clientWidth),typeof ResizeObserver>"u"))return;const i=new ResizeObserver(()=>n(l.clientWidth));return i.observe(l),()=>i.disconnect()},[]),[s,t]}function $(s){return s.value?s.op?[s.label,s.op,s.value].join(" "):`${s.label}: ${s.value}`:s.label}function T({editor:s,close:t,header:n,footer:l}){const[i,a]=x.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(W,{shouldFilter:!s.onQueryChange,children:[e.jsx(_,{autoFocus:!0,placeholder:s.searchPlaceholder,value:i,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(Q,{children:[e.jsx(A,{children:s.emptyText}),e.jsx(H,{children:s.items(t,i)})]})]}):s.render(t),l]})}function ae({chip:s,editor:t}){const[n,l]=x.useState(!1),i=s.onRemove!=null,a=$(s),u=s.value?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:s.op?s.label:`${s.label}:`}),s.op?e.jsx("span",{className:"text-muted-foreground",children:s.op}):null,e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.value})]}):e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.label}),r=t?e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Edit filter: ${a}`,className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1 focus-visible:outline-none",children:u})}):e.jsx("span",{className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1",children:u});return e.jsxs(D,{open:n,onOpenChange:l,children:[e.jsxs("div",{"data-filter-chip":s.id,title:s.title,className:g("inline-flex h-8 min-w-0 max-w-full items-stretch rounded-md border text-sm",s.tone==="warning"?"border-amber-500/60 bg-amber-500/10":i?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!i&&"pr-1.5"),children:[r,i?e.jsx("button",{type:"button","aria-label":`Remove filter: ${a}`,onClick:s.onRemove,className:"flex w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(O,{align:"start",className:g("p-0",M,t.className),children:e.jsx(T,{editor:t,close:()=>l(!1),footer:i?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{l(!1),s.onRemove?.()},children:"Remove filter"})}):null})}):null]})}function I({chips:s,editorFor:t,collapsed:n=!1}){const[l,i]=x.useState(!1),[a,u]=x.useState(),r=s.find(o=>o.id===a),m=r?t(r):void 0,b=s.some(o=>o.tone==="warning"),h=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:o=>{i(o),o||u(void 0)},children:[e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":n?`Show ${s.length} applied filters`:`Show ${s.length} more filters`,title:s.map($).join(`
2
- `),className:g("inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-sm tabular-nums",b?"border-amber-500/60 bg-amber-500/10":"bg-muted text-muted-foreground",l&&"ring-1 ring-ring"),children:n?e.jsxs(e.Fragment,{children:[e.jsx(E,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),e.jsx("span",{children:"Filters"}),e.jsxs("span",{className:"text-foreground",children:["· ",s.length]})]}):e.jsxs("span",{className:"text-foreground",children:["+",s.length]})})}),e.jsx(O,{align:"start",className:g("max-h-80 overflow-y-auto p-0",M,m?.className),children:r&&m?e.jsx(T,{editor:m,close:h,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(B,{className:"h-4 w-4"})}),r.label]}),footer:r.onRemove?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{h(),r.onRemove?.()},children:"Remove filter"})}):null},r.id):e.jsx("div",{className:"py-1",children:s.map(o=>{const c=$(o),d=t(o)!=null;return e.jsxs("div",{className:"flex items-center gap-1 px-1",children:[e.jsxs("button",{type:"button",disabled:!d,"aria-label":d?`Edit filter: ${c}`:void 0,onClick:d?()=>u(o.id):void 0,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-left text-sm hover:bg-accent/50 disabled:hover:bg-transparent",children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op||!o.value?o.label:`${o.label}:`}),o.op?e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op}):null,o.value?e.jsx("span",{className:"min-w-0 truncate font-medium",children:o.value}):null]}),o.onRemove?e.jsx("button",{type:"button","aria-label":`Remove filter: ${c}`,onClick:o.onRemove,className:"flex w-7 shrink-0 self-stretch items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]},o.id)})})})]})}function le({fields:s,triggerClassName:t}){const n=s.filter(c=>c.inMenu!==!1),[l,i]=x.useState(!1),[a,u]=x.useState(),r=n.find(c=>c.key===a),m=G(r?.editor),b=n.filter(c=>c.editor.kind==="toggle"&&c.editor.checked).length,h=[...new Set(n.map(c=>c.group??""))],o=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:c=>{i(c),c||u(void 0)},children:[e.jsx(L,{asChild:!0,children:t?e.jsxs("button",{type:"button",className:g("flex shrink-0 items-center gap-1.5 px-2.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t),children:[e.jsx(E,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Filter",b>0?e.jsx("span",{className:"tabular-nums text-foreground",children:b}):null,e.jsx(Z,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",children:[e.jsx(E,{className:"h-3.5 w-3.5"}),"Filter"]})}),e.jsx(O,{align:t?"end":"start",className:g("p-0",M,m?.className),children:r&&m?e.jsx(T,{editor:m,close:o,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(B,{className:"h-4 w-4"})}),r.label]})},r.key):e.jsxs(W,{children:[e.jsx(_,{autoFocus:!0,placeholder:"Filter by…"}),e.jsxs(Q,{children:[e.jsx(A,{children:"No matching filter"}),h.map(c=>e.jsx(H,{heading:c||void 0,children:n.filter(d=>(d.group??"")===c).map(d=>e.jsxs(V,{value:`${d.label} ${d.key}`,onSelect:()=>d.editor.kind==="toggle"?d.editor.onToggle():u(d.key),"aria-checked":d.editor.kind==="toggle"?d.editor.checked:void 0,className:"gap-2",children:[d.icon?e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",children:d.icon}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.label}),d.editor.kind==="toggle"?e.jsxs(e.Fragment,{children:[d.editor.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:d.editor.count.toLocaleString()}):null,e.jsx(U,{"aria-hidden":"true",className:g("h-4 w-4 shrink-0",!d.editor.checked&&"invisible")})]}):null]},d.key))},c))]})]})})]})}function he({fields:s,chips:t,meta:n,actions:l,trailing:i,onClearAll:a,hasClearableState:u=!1,className:r,label:m="Filters",menu:b=!0,clearAllMin:h=1,maxVisible:o}){const c=s.filter(f=>f.inMenu!==!1),d=t.filter(f=>f.onRemove).length,[v,J]=re(),C=Math.min(o??ne(J),t.length),K=t.slice(0,C),z=t.slice(C),S=f=>G(f.editor??s.find(Y=>Y.key===(f.field??f.id))?.editor),y=a!=null&&d+(u?1:0)>=h?e.jsx(j,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,F=t.length>0,p=f=>f!=null&&f!==!1,X=b&&c.length>0||p(l)||p(n)||p(i)||!F&&y!=null;return e.jsxs("div",{ref:v,role:"search","aria-label":m,className:g("flex min-w-0 flex-col items-stretch gap-2",r),children:[X?e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[b&&c.length>0?e.jsx(le,{fields:c}):null,p(l)?l:null,e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[p(n)?e.jsx("span",{className:"text-sm text-muted-foreground",children:n}):null,F?null:y,p(i)?i:null]})]}):null,F?e.jsxs("div",{"data-filter-chips":!0,className:"flex min-w-0 flex-nowrap items-center gap-2",children:[C===0?e.jsx(I,{chips:t,editorFor:S,collapsed:!0}):e.jsxs(e.Fragment,{children:[K.map(f=>e.jsx(ae,{chip:f,editor:S(f)},f.id)),z.length>0?e.jsx(I,{chips:z,editorFor:S}):null]}),y?e.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:y}):null]}):null]})}function oe({selected:s}){return e.jsx(U,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function be({searchPlaceholder:s,emptyText:t="No options",options:n,selected:l,multiple:i=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(r=>{const m=l.includes(r.value);return e.jsxs(V,{value:`${r.label} ${r.keywords??r.value}`,onSelect:()=>{a(r.value),i||u()},"aria-label":r.label,className:"group gap-2",children:[i?e.jsx(ee,{checked:m,className:"mr-1"}):e.jsx(oe,{selected:m}),r.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.count.toLocaleString()}):null,r.action]},r.value)})}}function ge([s,t],n,l){return s<=n?`≤ ${t}`:t>=l?`≥ ${s}`:`${s}–${t}`}function ie({value:s,min:t,max:n,onApply:l,close:i}){const[a,u]=x.useState(String(s?.[0]??t)),[r,m]=x.useState(String(s?.[1]??n)),[b,h]=x.useState(),o=c=>{c.preventDefault();const d=Number(a),v=Number(r);if(!Number.isFinite(d)||!Number.isFinite(v)){h("Enter a number.");return}if(d<t||v>n){h(`Use values between ${t} and ${n}.`);return}if(d>v){h("The lower bound must not exceed the upper bound.");return}l([d,v]),i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:o,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[e.jsx(R,{"aria-label":"From",type:"number",min:t,max:n,value:a,onChange:c=>u(c.target.value)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"to"}),e.jsx(R,{"aria-label":"To",type:"number",min:t,max:n,value:r,onChange:c=>m(c.target.value)})]}),b?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:b}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function je(s){return{kind:"custom",render:t=>e.jsx(ie,{...s,close:t})}}const ce=[{label:"Today",range:()=>[k(new Date),w(new Date)]},{label:"Last 7 days",range:()=>[k(P(new Date,6)),w(new Date)]},{label:"Last 30 days",range:()=>[k(P(new Date,29)),w(new Date)]},{label:"This month",range:()=>[te(new Date),w(new Date)]}];function ve([s,t]){return N(s,"yyyy-MM-dd")===N(t,"yyyy-MM-dd")?N(s,"LLL d, y"):`${N(s,"LLL d")} – ${N(t,"LLL d, y")}`}function de({value:s,onApply:t,close:n}){const[l,i]=x.useState(s?{from:s[0],to:s[1]}:void 0);return e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"flex flex-col gap-0.5 border-b p-2 sm:w-36 sm:border-b-0 sm:border-r",children:ce.map(a=>e.jsx(j,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>{t(a.range()),n()},children:a.label},a.label))}),e.jsx(se,{mode:"range",defaultMonth:l?.from,selected:l,onSelect:a=>{i(a),a?.from&&a.to&&a.from!==a.to&&(t([k(a.from),w(a.to)]),n())},numberOfMonths:1})]})}function pe(s){return{kind:"custom",className:"w-auto",render:t=>e.jsx(de,{...s,close:t})}}function ue({type:s,label:t,value:n,onApply:l,close:i}){const[a,u]=x.useState(n==null?"":String(n)),[r,m]=x.useState(),b=h=>{if(h.preventDefault(),s==="number"){const o=Number(a);if(a.trim()===""||!Number.isFinite(o)){m("Enter a number.");return}l(o)}else l(a);i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:b,children:[e.jsx(R,{autoFocus:!0,"aria-label":t,type:s,step:s==="number"?"any":void 0,value:a,onChange:h=>u(h.target.value),placeholder:"Enter a value…"}),r?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:r}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function Ne(s){return{kind:"custom",render:t=>e.jsx(ue,{...s,close:t})}}export{he as F,oe as S,ge as a,le as b,pe as d,ve as f,be as o,je as r,Ne as v};
3
- //# sourceMappingURL=filter-editors-DGVl9U4D.js.map
1
+ import{j as e,i as g,r as x,B as j,aM as D,aN as L,f7 as R,c_ as Z,aP as T,k as W,aQ as B,aR as _,aS as Q,aT as A,aU as U,aW as V,aa as H,X as q,ac as ee,ek as N,f8 as se,f9 as k,fa as w,a0 as E,fb as te}from"./index-DB2lVKuV.js";import{s as P}from"./subDays-BGA_fkig.js";function G(s){return s&&s.kind!=="toggle"?s:void 0}const O="w-72";function ne(s){return s<=0?Number.POSITIVE_INFINITY:s<=359?0:s<=479?2:3}function re(){const s=x.useRef(null),[t,n]=x.useState(0);return x.useLayoutEffect(()=>{const l=s.current;if(!l||(n(l.clientWidth),typeof ResizeObserver>"u"))return;const i=new ResizeObserver(()=>n(l.clientWidth));return i.observe(l),()=>i.disconnect()},[]),[s,t]}function $(s){return s.value?s.op?[s.label,s.op,s.value].join(" "):`${s.label}: ${s.value}`:s.label}function M({editor:s,close:t,header:n,footer:l}){const[i,a]=x.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(B,{shouldFilter:!s.onQueryChange,children:[e.jsx(_,{autoFocus:!0,placeholder:s.searchPlaceholder,value:i,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(Q,{children:[e.jsx(A,{children:s.emptyText}),e.jsx(U,{children:s.items(t,i)})]})]}):s.render(t),l]})}function ae({chip:s,editor:t}){const[n,l]=x.useState(!1),i=s.onRemove!=null,a=$(s),u=s.value?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:s.op?s.label:`${s.label}:`}),s.op?e.jsx("span",{className:"text-muted-foreground",children:s.op}):null,e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.value})]}):e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.label}),r=t?e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Edit filter: ${a}`,className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1 focus-visible:outline-none",children:u})}):e.jsx("span",{className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1",children:u});return e.jsxs(D,{open:n,onOpenChange:l,children:[e.jsxs("div",{"data-filter-chip":s.id,title:s.title,className:g("inline-flex h-8 min-w-0 max-w-full items-stretch rounded-md border text-sm",s.tone==="warning"?"border-amber-500/60 bg-amber-500/10":i?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!i&&"pr-1.5"),children:[r,i?e.jsx("button",{type:"button","aria-label":`Remove filter: ${a}`,onClick:s.onRemove,className:"flex w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(T,{align:"start",className:g("p-0",O,t.className),children:e.jsx(M,{editor:t,close:()=>l(!1),footer:i?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{l(!1),s.onRemove?.()},children:"Remove filter"})}):null})}):null]})}function I({chips:s,editorFor:t,collapsed:n=!1}){const[l,i]=x.useState(!1),[a,u]=x.useState(),r=s.find(o=>o.id===a),m=r?t(r):void 0,b=s.some(o=>o.tone==="warning"),h=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:o=>{i(o),o||u(void 0)},children:[e.jsx(L,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":n?`Show ${s.length} applied filters`:`Show ${s.length} more filters`,title:s.map($).join(`
2
+ `),className:g("inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-sm tabular-nums",b?"border-amber-500/60 bg-amber-500/10":"bg-muted text-muted-foreground",l&&"ring-1 ring-ring"),children:n?e.jsxs(e.Fragment,{children:[e.jsx(R,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),e.jsx("span",{children:"Filters"}),e.jsxs("span",{className:"text-foreground",children:["· ",s.length]})]}):e.jsxs("span",{className:"text-foreground",children:["+",s.length]})})}),e.jsx(T,{align:"start",className:g("max-h-80 overflow-y-auto p-0",O,m?.className),children:r&&m?e.jsx(M,{editor:m,close:h,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(W,{className:"h-4 w-4"})}),r.label]}),footer:r.onRemove?e.jsx("div",{className:"border-t p-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{h(),r.onRemove?.()},children:"Remove filter"})}):null},r.id):e.jsx("div",{className:"py-1",children:s.map(o=>{const c=$(o),d=t(o)!=null;return e.jsxs("div",{className:"flex items-center gap-1 px-1",children:[e.jsxs("button",{type:"button",disabled:!d,"aria-label":d?`Edit filter: ${c}`:void 0,onClick:d?()=>u(o.id):void 0,className:"flex min-w-0 flex-1 items-center gap-1.5 rounded-sm px-1.5 py-1.5 text-left text-sm hover:bg-accent/50 disabled:hover:bg-transparent",children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op||!o.value?o.label:`${o.label}:`}),o.op?e.jsx("span",{className:"shrink-0 text-muted-foreground",children:o.op}):null,o.value?e.jsx("span",{className:"min-w-0 truncate font-medium",children:o.value}):null]}),o.onRemove?e.jsx("button",{type:"button","aria-label":`Remove filter: ${c}`,onClick:o.onRemove,className:"flex w-7 shrink-0 self-stretch items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(q,{className:"h-3.5 w-3.5"})}):null]},o.id)})})})]})}function le({fields:s,triggerClassName:t}){const n=s.filter(c=>c.inMenu!==!1),[l,i]=x.useState(!1),[a,u]=x.useState(),r=n.find(c=>c.key===a),m=G(r?.editor),b=n.filter(c=>c.editor.kind==="toggle"&&c.editor.checked).length,h=[...new Set(n.map(c=>c.group??""))],o=()=>{i(!1),u(void 0)};return e.jsxs(D,{open:l,onOpenChange:c=>{i(c),c||u(void 0)},children:[e.jsx(L,{asChild:!0,children:t?e.jsxs("button",{type:"button",className:g("flex shrink-0 items-center gap-1.5 px-2.5 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t),children:[e.jsx(R,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Filter",b>0?e.jsx("span",{className:"tabular-nums text-foreground",children:b}):null,e.jsx(Z,{"aria-hidden":"true",className:"h-3.5 w-3.5"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Filter"]})}),e.jsx(T,{align:t?"end":"start",className:g("p-0",O,m?.className),children:r&&m?e.jsx(M,{editor:m,close:o,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>u(void 0),children:e.jsx(W,{className:"h-4 w-4"})}),r.label]})},r.key):e.jsxs(B,{children:[e.jsx(_,{autoFocus:!0,placeholder:"Filter by…"}),e.jsxs(Q,{children:[e.jsx(A,{children:"No matching filter"}),h.map(c=>e.jsx(U,{heading:c||void 0,children:n.filter(d=>(d.group??"")===c).map(d=>e.jsxs(V,{value:`${d.label} ${d.key}`,onSelect:()=>d.editor.kind==="toggle"?d.editor.onToggle():u(d.key),"aria-checked":d.editor.kind==="toggle"?d.editor.checked:void 0,className:"gap-2",children:[d.icon?e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",children:d.icon}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.label}),d.editor.kind==="toggle"?e.jsxs(e.Fragment,{children:[d.editor.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:d.editor.count.toLocaleString()}):null,e.jsx(H,{"aria-hidden":"true",className:g("h-4 w-4 shrink-0",!d.editor.checked&&"invisible")})]}):null]},d.key))},c))]})]})})]})}function he({fields:s,chips:t,meta:n,actions:l,trailing:i,onClearAll:a,hasClearableState:u=!1,className:r,label:m="Filters",menu:b=!0,clearAllMin:h=1,maxVisible:o}){const c=s.filter(f=>f.inMenu!==!1),d=t.filter(f=>f.onRemove).length,[v,X]=re(),C=Math.min(o??ne(X),t.length),Y=t.slice(0,C),z=t.slice(C),S=f=>G(f.editor??s.find(K=>K.key===(f.field??f.id))?.editor),y=a!=null&&d+(u?1:0)>=h?e.jsx(j,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,F=t.length>0,p=f=>f!=null&&f!==!1,J=b&&c.length>0||p(l)||p(n)||p(i)||!F&&y!=null;return e.jsxs("div",{ref:v,role:"search","aria-label":m,className:g("flex min-w-0 flex-col items-stretch gap-2",r),children:[J?e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[b&&c.length>0?e.jsx(le,{fields:c}):null,p(l)?l:null,e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[p(n)?e.jsx("span",{className:"text-sm text-muted-foreground",children:n}):null,F?null:y,p(i)?i:null]})]}):null,F?e.jsxs("div",{"data-filter-chips":!0,className:"flex min-w-0 flex-nowrap items-center gap-2",children:[C===0?e.jsx(I,{chips:t,editorFor:S,collapsed:!0}):e.jsxs(e.Fragment,{children:[Y.map(f=>e.jsx(ae,{chip:f,editor:S(f)},f.id)),z.length>0?e.jsx(I,{chips:z,editorFor:S}):null]}),y?e.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:y}):null]}):null]})}function oe({selected:s}){return e.jsx(H,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function be({searchPlaceholder:s,emptyText:t="No options",options:n,selected:l,multiple:i=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(r=>{const m=l.includes(r.value);return e.jsxs(V,{value:`${r.label} ${r.keywords??r.value}`,onSelect:()=>{a(r.value),i||u()},"aria-label":r.label,className:"group gap-2",children:[i?e.jsx(ee,{checked:m,className:"mr-1"}):e.jsx(oe,{selected:m}),r.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.count.toLocaleString()}):null,r.action]},r.value)})}}function ge([s,t],n,l){return s<=n?`≤ ${t}`:t>=l?`≥ ${s}`:`${s}–${t}`}function ie({value:s,min:t,max:n,onApply:l,close:i}){const[a,u]=x.useState(String(s?.[0]??t)),[r,m]=x.useState(String(s?.[1]??n)),[b,h]=x.useState(),o=c=>{c.preventDefault();const d=Number(a),v=Number(r);if(!Number.isFinite(d)||!Number.isFinite(v)){h("Enter a number.");return}if(d<t||v>n){h(`Use values between ${t} and ${n}.`);return}if(d>v){h("The lower bound must not exceed the upper bound.");return}l([d,v]),i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:o,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[e.jsx(E,{"aria-label":"From",type:"number",min:t,max:n,value:a,onChange:c=>u(c.target.value)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"to"}),e.jsx(E,{"aria-label":"To",type:"number",min:t,max:n,value:r,onChange:c=>m(c.target.value)})]}),b?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:b}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function je(s){return{kind:"custom",render:t=>e.jsx(ie,{...s,close:t})}}const ce=[{label:"Today",range:()=>[k(new Date),w(new Date)]},{label:"Last 7 days",range:()=>[k(P(new Date,6)),w(new Date)]},{label:"Last 30 days",range:()=>[k(P(new Date,29)),w(new Date)]},{label:"This month",range:()=>[te(new Date),w(new Date)]}];function ve([s,t]){return N(s,"yyyy-MM-dd")===N(t,"yyyy-MM-dd")?N(s,"LLL d, y"):`${N(s,"LLL d")} – ${N(t,"LLL d, y")}`}function de({value:s,onApply:t,close:n}){const[l,i]=x.useState(s?{from:s[0],to:s[1]}:void 0);return e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"flex flex-col gap-0.5 border-b p-2 sm:w-36 sm:border-b-0 sm:border-r",children:ce.map(a=>e.jsx(j,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>{t(a.range()),n()},children:a.label},a.label))}),e.jsx(se,{mode:"range",defaultMonth:l?.from,selected:l,onSelect:a=>{i(a),a?.from&&a.to&&a.from!==a.to&&(t([k(a.from),w(a.to)]),n())},numberOfMonths:1})]})}function pe(s){return{kind:"custom",className:"w-auto",render:t=>e.jsx(de,{...s,close:t})}}function ue({type:s,label:t,value:n,onApply:l,close:i}){const[a,u]=x.useState(n==null?"":String(n)),[r,m]=x.useState(),b=h=>{if(h.preventDefault(),s==="number"){const o=Number(a);if(a.trim()===""||!Number.isFinite(o)){m("Enter a number.");return}l(o)}else l(a);i()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:b,children:[e.jsx(E,{autoFocus:!0,"aria-label":t,type:s,step:s==="number"?"any":void 0,value:a,onChange:h=>u(h.target.value),placeholder:"Enter a value…"}),r?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:r}):null,e.jsx(j,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function Ne(s){return{kind:"custom",render:t=>e.jsx(ue,{...s,close:t})}}export{he as F,oe as S,ge as a,le as b,pe as d,ve as f,be as o,je as r,Ne as v};
3
+ //# sourceMappingURL=filter-editors-D_Sfn0dv.js.map
@@ -1,2 +1,2 @@
1
- import{r,j as t,i as u}from"./index-BoqrvLHQ.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
2
- //# sourceMappingURL=full-page-spinner-CtVlF8GQ.js.map
1
+ import{r,j as t,i as u}from"./index-DB2lVKuV.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
2
+ //# sourceMappingURL=full-page-spinner-C1clibUY.js.map
@@ -1,2 +1,2 @@
1
- import{i7 as n,j as s,i8 as r}from"./index-BoqrvLHQ.js";function i(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{i as component};
2
- //# sourceMappingURL=index-CK5GDX4B.js.map
1
+ import{iu as n,j as s,iv as r}from"./index-DB2lVKuV.js";function i(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{i as component};
2
+ //# sourceMappingURL=index-04B26s6E.js.map
@@ -0,0 +1,2 @@
1
+ import{V as t,j as i}from"./index-DB2lVKuV.js";import{A as m}from"./activity-route-view-DCSNBKZU.js";import"./view-card-Cg6PeEiV.js";import"./events-feed-ClhEywwV.js";import"./event-attachments-D8Z8uwv9.js";import"./definition-comparison-C2mPfIMD.js";import"./json-diff-Ce6YAXzY.js";import"./code-editor-CTdKUDPY.js";import"./index-Vcq4gwWv.js";import"./schema-value-DDNHANGs.js";import"./run-initiator-C0sur8lU.js";import"./list-skeleton-DLPBTnbR.js";import"./subDays-BGA_fkig.js";import"./use-automations-DcdlmVuX.js";import"./clients-BhPMbxHi.js";import"./renderer-B8yZ5lql.js";import"./card-C4oPCVh6.js";import"./device-automation-Dp3faMvp.js";import"./filter-editors-D_Sfn0dv.js";import"./activity-route-location-Bec6fW-t.js";import"./event-kind-options-fHAIXu24.js";import"./client-activity-scopes-DqaFEyir.js";import"./client-rows-rse9thnk.js";import"./agent-loading-shells-D3y98xuO.js";import"./member-scope-gate-CBPMprXu.js";import"./view-param-filters-CvrKw0mZ.js";import"./app-bridge-B-L0rGz9.js";import"./automation-run-now-Dl0MKx3N.js";import"./event-detail-CgG3pDLA.js";import"./scoped-feed-bar-BTv9mPcR.js";import"./create-automation-form-CTiy_S9G.js";import"./entity-options-D9K_5Lcs.js";import"./model-selector-CjkBPpjN.js";import"./skill-editor-D_W3QlRz.js";import"./use-mention-search-BniE-K2d.js";import"./proposal-review-shell-EyGWEYwQ.js";import"./runs-list-CJOFMgpk.js";import"./entity-schema-graph-B255NKjF.js";import"./feed-event-kinds-BYuZCoU4.js";import"./public-shell-ready-_KWdfzEM.js";function Q(){const{owner:o}=t.useParams(),r=t.useSearch();return i.jsx(m,{owner:o,search:r,home:!0})}export{Q as component};
2
+ //# sourceMappingURL=index-2HrEO-nl.js.map
@@ -0,0 +1,2 @@
1
+ import{aI as m,aJ as e,j as t,aC as s,aD as a}from"./index-DB2lVKuV.js";import{A as n}from"./activity-route-view-DCSNBKZU.js";import{E as c}from"./events-feed-ClhEywwV.js";import"./view-card-Cg6PeEiV.js";import"./run-initiator-C0sur8lU.js";import"./list-skeleton-DLPBTnbR.js";import"./subDays-BGA_fkig.js";import"./use-automations-DcdlmVuX.js";import"./clients-BhPMbxHi.js";import"./filter-editors-D_Sfn0dv.js";import"./activity-route-location-Bec6fW-t.js";import"./event-kind-options-fHAIXu24.js";import"./event-attachments-D8Z8uwv9.js";import"./client-activity-scopes-DqaFEyir.js";import"./client-rows-rse9thnk.js";import"./renderer-B8yZ5lql.js";import"./schema-value-DDNHANGs.js";import"./card-C4oPCVh6.js";import"./agent-loading-shells-D3y98xuO.js";import"./member-scope-gate-CBPMprXu.js";import"./view-param-filters-CvrKw0mZ.js";import"./app-bridge-B-L0rGz9.js";import"./automation-run-now-Dl0MKx3N.js";import"./event-detail-CgG3pDLA.js";import"./scoped-feed-bar-BTv9mPcR.js";import"./create-automation-form-CTiy_S9G.js";import"./entity-options-D9K_5Lcs.js";import"./device-automation-Dp3faMvp.js";import"./model-selector-CjkBPpjN.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-CTdKUDPY.js";import"./index-Vcq4gwWv.js";import"./json-diff-Ce6YAXzY.js";import"./use-mention-search-BniE-K2d.js";import"./proposal-review-shell-EyGWEYwQ.js";import"./definition-comparison-C2mPfIMD.js";import"./runs-list-CJOFMgpk.js";import"./entity-schema-graph-B255NKjF.js";import"./feed-event-kinds-BYuZCoU4.js";import"./public-shell-ready-_KWdfzEM.js";function Z(){const{owner:r}=m.useParams(),i=m.useSearch();if(r==="me"){const o=e(i),p={sortBy:"date",sortOrder:"desc",...o.contentIds?.length?{contentIds:o.contentIds}:{clientIds:o.clientIds,mcpActivityId:o.mcpActivityId}};return t.jsx(s,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(a,{className:"flex flex-col gap-6",children:[t.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),t.jsx(c,{organizationId:null,ownerSlug:"me",filters:p})]})})}return t.jsx(n,{owner:r,search:i})}export{Z as component};
2
+ //# sourceMappingURL=index-BU3k9wpw.js.map
@@ -1,2 +1,2 @@
1
- import{j as n,i as Z,aC as ee,c as Y,r as y,aD as H,aE as ne,aF as se,B as T,aG as oe,aH as ae,aI as te,aJ as re,aK as ie,aL as ce,aM as B,aN as V,aO as F,aP as q,aQ as de,aR as W,aS as le,aT as me,aU as ue,aV as pe,aW as he,aX as fe,aY as xe,aZ as ve,a_ as ge,au as U,a$ as be,b0 as ye,b1 as je,b2 as _e,b3 as Ce,b4 as Ne,b5 as ke,b6 as Ie,b7 as Le,b8 as G,b9 as Ee,ba as $e,bb as we,L as M,bc as z,bd as X,be as Oe,bf as Re,bg as Se,bh as De,bi as Pe,bj as Me,bk as Ae,bl as Ke}from"./index-BoqrvLHQ.js";import{L as Te}from"./list-skeleton-CH0qQBYk.js";const Be="overflow-hidden rounded-lg border divide-y";function Fe({header:o,action:r}){return n.jsxs("div",{className:Z("flex items-center",ee),children:[n.jsx("div",{className:"min-w-0 flex-1",children:o}),r?n.jsx("div",{className:"shrink-0 pr-3",children:r}):null]})}function We({ownerSlug:o,catalog:r,trigger:i}){const u=Y(),[p,c]=y.useState(!1),N=y.useMemo(()=>new Map(r.map(t=>[t.key,t])),[r]),j=y.useMemo(()=>r.filter(t=>!H(t)).sort((t,f)=>t.name.localeCompare(f.name)),[r]),h=t=>{c(!1),u(t?{to:"/$owner/connectors/create/$connectorKey",params:{owner:o,connectorKey:t}}:{to:"/$owner/connectors/create",params:{owner:o}})};return n.jsxs(ne,{open:p,onOpenChange:c,children:[n.jsx(se,{asChild:!0,children:i??n.jsxs(T,{size:"sm",className:"h-8 shrink-0 justify-start text-xs",children:[n.jsx(oe,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})}),n.jsx(ae,{align:"end",className:"w-72 p-0",children:n.jsxs(te,{children:[n.jsx(re,{placeholder:"Search connectors…"}),n.jsxs(ie,{children:[n.jsx(ce,{children:"No connector matches."}),n.jsx(B,{children:j.map(t=>{const f=V(t.key,N,{name:t.name});return n.jsxs(F,{value:`${t.name} ${t.key}`,onSelect:()=>h(t.key),className:"gap-2",children:[n.jsx(q,{icon:f.icon,iconUrl:f.iconUrl,name:f.name,faviconDomain:f.faviconDomain,className:"h-5 w-5 shrink-0 rounded text-[9px]"}),n.jsx("span",{className:"truncate",children:t.name}),t.installed?n.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"Added"}):null]},t.key)})}),n.jsx(de,{}),n.jsx(B,{children:n.jsx(F,{value:"browse all connectors",onSelect:()=>h(),children:"Browse all connectors…"})})]})]})})]})}function qe(){const{owner:o}=W.useParams(),{filter:r}=W.useSearch();return n.jsx(le,{owner:o,children:i=>n.jsx(Ue,{ownerSlug:i.ownerSlug,organizationId:i.organizationId,isWorkspaceLoading:i.isWorkspaceLoading,requestedFilter:r})})}function Ue({ownerSlug:o,organizationId:r,isWorkspaceLoading:i,requestedFilter:u}){const{data:p=[],isLoading:c,isError:N,refetch:j}=me(r??""),{data:h=[],isLoading:t,isError:f,refetch:A}=ue(r??""),{data:R=[]}=pe(r,{}),{data:I=[],isLoading:L,isError:_,refetch:w}=he(),{data:E=[]}=fe(),{data:S,isLoading:D,isError:s,refetch:l}=xe(),{data:C=[],isLoading:x,isError:$,refetch:v}=ve(),e=i||c||t||L||D||x,a=S?.sandboxes??[],d=y.useMemo(()=>C.filter(m=>ge(m,o)),[C,o]);return N||f||_||s||$?n.jsx(U,{children:n.jsxs("div",{role:"alert",className:"space-y-2",children:[n.jsx("p",{children:"Could not load the connector inventory."}),n.jsx(T,{variant:"outline",size:"sm",onClick:()=>{Promise.all([j(),A(),w(),l(),v()])},children:"Retry"})]})}):n.jsx(U,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ge,{ownerSlug:o,isContentLoading:e,groups:p,installedDefs:h,authProfiles:R,inferenceProviders:I,inferenceCatalog:E,sandboxes:a,devices:d,requestedFilter:u})})}function Ge({ownerSlug:o,isContentLoading:r,groups:i,installedDefs:u,authProfiles:p,inferenceProviders:c,inferenceCatalog:N,sandboxes:j,devices:h,requestedFilter:t}){const f=Y(),A=y.useMemo(()=>new Map(u.map(s=>[s.key,s])),[u]),R=t??"all",I=y.useMemo(()=>{const s=new Map(i.map(e=>[e.connector_key,e])),l=new Map;for(const e of u)l.set(e.key,e);for(const e of i)l.has(e.connector_key)||l.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const C=be(c).filter((e,a,d)=>d.findIndex(m=>m.provider.kind===e.provider.kind)===a).map(e=>({connector:{...e.connector,key:`${ye}${e.provider.kind}`,name:N.find(a=>a.slug===e.provider.kind)?.displayName??e.provider.kind},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0,deviceFamily:void 0})),x=je(j).filter((e,a,d)=>d.findIndex(m=>m.sandbox.providerKind===e.sandbox.providerKind)===a).map(e=>({connector:{...e.connector,key:`${_e}${e.sandbox.providerKind}`,name:Ce(e.sandbox.providerKind)},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:j.some(a=>a.providerKind===e.sandbox.providerKind&&!a.connected),provider:void 0,sandbox:e.sandbox,device:void 0,deviceFamily:void 0})),$=Ne(h,i,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device,deviceFamily:e}));return[...Array.from(l.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!H(e)).map(e=>{const a=s.get(e.key),d=ke(e.auth_schema),m=p.reduce((g,b)=>(b.connector_key!==e.key||(g[b.profile_kind]+=1),g),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),O=Ie(e,a),P=h.some(g=>g.connectors.some(b=>b.organization_slug===o&&b.connector_key===e.key)),K=Ye(e,a,d,m);return{connector:e,group:a,profileCounts:m,facets:O,needsSetup:K,isDevice:P,provider:void 0,sandbox:void 0,device:void 0,deviceFamily:void 0}}),...C,...x,...$].sort((e,a)=>e.needsSetup&&!a.needsSetup?-1:!e.needsSetup&&a.needsSetup?1:e.connector.name.localeCompare(a.connector.name))},[o,p,h,i,u,c,N,j]),L=y.useMemo(()=>{const s=Le.filter(l=>l!=="all"&&I.some(C=>G(C,l)));return s.length>1?["all",...s]:[]},[I]),_=L.includes(R)?R:"all",w=y.useMemo(()=>I.filter(s=>G(s,_)),[I,_]),E=y.useMemo(()=>_==="all"?Ee(o,h,$e()):[],[_,o,h]),S=n.jsx(We,{ownerSlug:o,catalog:u});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:S}),n.jsx(Te,{label:"Loading connectors",rows:6})]});const D=s=>{f({to:"/$owner/connectors",params:{owner:o},search:l=>({...l,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[L.map(s=>n.jsx(T,{type:"button",variant:_===s?"secondary":"ghost","aria-pressed":_===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(s),children:we[s]},s)),L.length===0&&w.length===0&&E.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:S})]}),E.length>0?n.jsx("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-dashed bg-border sm:grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]",children:E.map(s=>n.jsxs(M,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},title:s.tagline,className:"flex min-w-0 items-center gap-2 bg-background px-3 py-2.5 text-muted-foreground transition-colors last:odd:col-span-2 hover:bg-accent/50 hover:text-foreground sm:last:odd:col-span-1",children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:s.icon}),n.jsx("span",{className:"truncate text-sm font-medium",children:s.name})]},s.id))}):null,w.length===0?L.length>0?n.jsx(z,{icon:X.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>D("all")}):E.length>0?null:n.jsx(z,{icon:X.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:Be,children:w.map(({connector:s,group:l,facets:C,profileCounts:x,needsSetup:$,provider:v,sandbox:e,device:a,deviceFamily:d})=>{const m=V(s.key,A,{name:s.name,iconUrl:v?N.find(k=>k.slug===v.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??l?.favicon_domain??(e?Oe(e.providerKind):void 0)}),O=x.oauth_account+x.browser_session,P=l?.connection_count??0,K=a?`${d?.devices.length??1} ${a.platform==="chrome-extension"?d?.devices.length===1?"profile":"profiles":d?.devices.length===1?"device":"devices"} · ${d?.devices.filter(k=>k.online).length??0} online`:v?ze(c.filter(k=>k.kind===v.kind).length,"configured account","configured accounts"):e?`${j.filter(k=>k.providerKind===e.providerKind).length} instances`:[`${P} ${P===1?"connection":"connections"}`,O>0?`${O} ${O===1?"saved authorization":"saved authorizations"}`:null,x.oauth_app>0?`${x.oauth_app} OAuth app${x.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),g=Xe,b=n.jsx(Re,{mark:a?n.jsx(Pe,{platform:Me(a)}):n.jsx(q,{icon:m.icon,iconUrl:m.iconUrl,name:m.name,faviconDomain:m.faviconDomain,className:"h-7 w-7 text-[10px]"}),name:m.name,tone:$?"amber":null,details:n.jsx(Se,{parts:[$?"Needs setup":null,De(C).join(", "),K]})}),J=d?.appId?n.jsx(M,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:d.appId},className:g,children:b},s.key):a?n.jsx(M,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:a.id},className:g,children:b},s.key):n.jsx(M,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},search:v||e?{instances:!0}:{},className:g,children:b},s.key),Q=!v&&!e&&!a&&!d;return n.jsx(Fe,{header:J,action:Q?n.jsx(Ke,{ownerSlug:o,connectorKey:s.key,iconOnly:!0}):void 0},s.key)})})]})}function ze(o,r,i){return`${o} ${o===1?r:i}`}const Xe=Ae;function Ye(o,r,i,u){if((r?.connection_count??0)>0)return!1;const p=i.some(c=>c.type==="none");return!!(!p&&i.some(c=>c.type==="oauth")&&u.oauth_app===0||!p&&i.some(c=>c.type==="env_keys")&&u.env===0||!p&&i.some(c=>c.type==="app_installation")&&!r||o.required_capability&&!r)}export{qe as component};
2
- //# sourceMappingURL=index-DvuJ_S_o.js.map
1
+ import{j as n,i as J,aK as ee,c as Y,r as y,aL as q,aM as ne,aN as se,B as T,aO as oe,aP as ae,aQ as te,aR as re,aS as ie,aT as ce,aU as B,aV as V,aW as W,aX as H,aY as de,aZ as F,a_ as le,a$ as me,b0 as pe,b1 as ue,b2 as he,b3 as fe,b4 as xe,b5 as ve,b6 as be,aD as U,b7 as ge,b8 as ye,b9 as je,ba as _e,bb as Ce,bc as Ne,bd as ke,be as Le,bf as Ie,bg as z,bh as Ee,bi as $e,bj as we,L as M,bk as G,bl as X,bm as Oe,bn as Re,bo as Se,bp as De,bq as Pe,br as Me,bs as Ae,bt as Ke}from"./index-DB2lVKuV.js";import{L as Te}from"./list-skeleton-DLPBTnbR.js";const Be="overflow-hidden rounded-lg border divide-y";function We({header:o,action:r}){return n.jsxs("div",{className:J("flex items-center",ee),children:[n.jsx("div",{className:"min-w-0 flex-1",children:o}),r?n.jsx("div",{className:"shrink-0 pr-3",children:r}):null]})}function Fe({ownerSlug:o,catalog:r,trigger:i}){const p=Y(),[u,c]=y.useState(!1),N=y.useMemo(()=>new Map(r.map(t=>[t.key,t])),[r]),j=y.useMemo(()=>r.filter(t=>!q(t)).sort((t,f)=>t.name.localeCompare(f.name)),[r]),h=t=>{c(!1),p(t?{to:"/$owner/connectors/create/$connectorKey",params:{owner:o,connectorKey:t}}:{to:"/$owner/connectors/create",params:{owner:o}})};return n.jsxs(ne,{open:u,onOpenChange:c,children:[n.jsx(se,{asChild:!0,children:i??n.jsxs(T,{size:"sm",className:"h-8 shrink-0 justify-start text-xs",children:[n.jsx(oe,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})}),n.jsx(ae,{align:"end",className:"w-72 p-0",children:n.jsxs(te,{children:[n.jsx(re,{placeholder:"Search connectors…"}),n.jsxs(ie,{children:[n.jsx(ce,{children:"No connector matches."}),n.jsx(B,{children:j.map(t=>{const f=V(t.key,N,{name:t.name});return n.jsxs(W,{value:`${t.name} ${t.key}`,onSelect:()=>h(t.key),className:"gap-2",children:[n.jsx(H,{icon:f.icon,iconUrl:f.iconUrl,name:f.name,faviconDomain:f.faviconDomain,className:"h-5 w-5 shrink-0 rounded text-[9px]"}),n.jsx("span",{className:"truncate",children:t.name}),t.installed?n.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"Added"}):null]},t.key)})}),n.jsx(de,{}),n.jsx(B,{children:n.jsx(W,{value:"browse all connectors",onSelect:()=>h(),children:"Browse all connectors…"})})]})]})})]})}function He(){const{owner:o}=F.useParams(),{filter:r}=F.useSearch();return n.jsx(le,{owner:o,children:i=>n.jsx(Ue,{ownerSlug:i.ownerSlug,organizationId:i.organizationId,isWorkspaceLoading:i.isWorkspaceLoading,requestedFilter:r})})}function Ue({ownerSlug:o,organizationId:r,isWorkspaceLoading:i,requestedFilter:p}){const{data:u=[],isLoading:c,isError:N,refetch:j}=me(r??""),{data:h=[],isLoading:t,isError:f,refetch:A}=pe(r??""),{data:R=[]}=ue(r,{}),{data:L=[],isLoading:I,isError:_,refetch:w}=he(),{data:E=[]}=fe(),{data:S,isLoading:D,isError:s,refetch:l}=xe(),{data:C=[],isLoading:x,isError:$,refetch:v}=ve(),e=i||c||t||I||D||x,a=S?.sandboxes??[],d=y.useMemo(()=>C.filter(m=>be(m,o)),[C,o]);return N||f||_||s||$?n.jsx(U,{children:n.jsxs("div",{role:"alert",className:"space-y-2",children:[n.jsx("p",{children:"Could not load the connector inventory."}),n.jsx(T,{variant:"outline",size:"sm",onClick:()=>{Promise.all([j(),A(),w(),l(),v()])},children:"Retry"})]})}):n.jsx(U,{className:"flex flex-1 flex-col gap-6",children:n.jsx(ze,{ownerSlug:o,isContentLoading:e,groups:u,installedDefs:h,authProfiles:R,inferenceProviders:L,inferenceCatalog:E,sandboxes:a,devices:d,requestedFilter:p})})}function ze({ownerSlug:o,isContentLoading:r,groups:i,installedDefs:p,authProfiles:u,inferenceProviders:c,inferenceCatalog:N,sandboxes:j,devices:h,requestedFilter:t}){const f=Y(),A=y.useMemo(()=>new Map(p.map(s=>[s.key,s])),[p]),R=t??"all",L=y.useMemo(()=>{const s=new Map(i.map(e=>[e.connector_key,e])),l=new Map;for(const e of p)l.set(e.key,e);for(const e of i)l.has(e.connector_key)||l.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const C=ge(c).filter((e,a,d)=>d.findIndex(m=>m.provider.kind===e.provider.kind)===a).map(e=>({connector:{...e.connector,key:`${ye}${e.provider.kind}`,name:N.find(a=>a.slug===e.provider.kind)?.displayName??e.provider.kind},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0,deviceFamily:void 0})),x=je(j).filter((e,a,d)=>d.findIndex(m=>m.sandbox.providerKind===e.sandbox.providerKind)===a).map(e=>({connector:{...e.connector,key:`${_e}${e.sandbox.providerKind}`,name:Ce(e.sandbox.providerKind)},group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:j.some(a=>a.providerKind===e.sandbox.providerKind&&!a.connected),provider:void 0,sandbox:e.sandbox,device:void 0,deviceFamily:void 0})),$=Ne(h,i,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device,deviceFamily:e}));return[...Array.from(l.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!q(e)).map(e=>{const a=s.get(e.key),d=ke(e.auth_schema),m=u.reduce((b,g)=>(g.connector_key!==e.key||(b[g.profile_kind]+=1),b),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),O=Le(e,a),P=h.some(b=>b.connectors.some(g=>g.organization_slug===o&&g.connector_key===e.key)),K=Ye(e,a,d,m);return{connector:e,group:a,profileCounts:m,facets:O,needsSetup:K,isDevice:P,provider:void 0,sandbox:void 0,device:void 0,deviceFamily:void 0}}),...C,...x,...$].sort((e,a)=>e.needsSetup&&!a.needsSetup?-1:!e.needsSetup&&a.needsSetup?1:e.connector.name.localeCompare(a.connector.name))},[o,u,h,i,p,c,N,j]),I=y.useMemo(()=>{const s=Ie.filter(l=>l!=="all"&&L.some(C=>z(C,l)));return s.length>1?["all",...s]:[]},[L]),_=I.includes(R)?R:"all",w=y.useMemo(()=>L.filter(s=>z(s,_)),[L,_]),E=y.useMemo(()=>_==="all"?Ee(o,h,$e()):[],[_,o,h]),S=n.jsx(Fe,{ownerSlug:o,catalog:p});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:S}),n.jsx(Te,{label:"Loading connectors",rows:6})]});const D=s=>{f({to:"/$owner/connectors",params:{owner:o},search:l=>({...l,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[I.map(s=>n.jsx(T,{type:"button",variant:_===s?"secondary":"ghost","aria-pressed":_===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>D(s),children:we[s]},s)),I.length===0&&w.length===0&&E.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:S})]}),E.length>0?n.jsx("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-dashed bg-border sm:grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]",children:E.map(s=>n.jsxs(M,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},title:s.tagline,className:"flex min-w-0 items-center gap-2 bg-background px-3 py-2.5 text-muted-foreground transition-colors last:odd:col-span-2 hover:bg-accent/50 hover:text-foreground sm:last:odd:col-span-1",children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:s.icon}),n.jsx("span",{className:"truncate text-sm font-medium",children:s.name})]},s.id))}):null,w.length===0?I.length>0?n.jsx(G,{icon:X.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>D("all")}):E.length>0?null:n.jsx(G,{icon:X.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:Be,children:w.map(({connector:s,group:l,facets:C,profileCounts:x,needsSetup:$,provider:v,sandbox:e,device:a,deviceFamily:d})=>{const m=V(s.key,A,{name:s.name,iconUrl:v?N.find(k=>k.slug===v.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??l?.favicon_domain??(e?Oe(e.providerKind):void 0)}),O=x.oauth_account+x.browser_session,P=l?.connection_count??0,K=a?`${d?.devices.length??1} ${a.platform==="chrome-extension"?d?.devices.length===1?"profile":"profiles":d?.devices.length===1?"device":"devices"} · ${d?.devices.filter(k=>k.online).length??0} online`:v?Ge(c.filter(k=>k.kind===v.kind).length,"configured account","configured accounts"):e?`${j.filter(k=>k.providerKind===e.providerKind).length} instances`:[`${P} ${P===1?"connection":"connections"}`,O>0?`${O} ${O===1?"saved authorization":"saved authorizations"}`:null,x.oauth_app>0?`${x.oauth_app} OAuth app${x.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),b=Xe,g=n.jsx(Re,{mark:a?n.jsx(Pe,{platform:Me(a)}):n.jsx(H,{icon:m.icon,iconUrl:m.iconUrl,name:m.name,faviconDomain:m.faviconDomain,className:"h-7 w-7 text-[10px]"}),name:m.name,tone:$?"amber":null,details:n.jsx(Se,{parts:[$?"Needs setup":null,De(C).join(", "),K]})}),Q=d?.appId?n.jsx(M,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:d.appId},className:b,children:g},s.key):a?n.jsx(M,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:a.id},className:b,children:g},s.key):n.jsx(M,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},search:v||e?{instances:!0}:{},className:b,children:g},s.key),Z=!v&&!e&&!a&&!d;return n.jsx(We,{header:Q,action:Z?n.jsx(Ke,{ownerSlug:o,connectorKey:s.key,iconOnly:!0}):void 0},s.key)})})]})}function Ge(o,r,i){return`${o} ${o===1?r:i}`}const Xe=Ae;function Ye(o,r,i,p){if((r?.connection_count??0)>0)return!1;const u=i.some(c=>c.type==="none");return!!(!u&&i.some(c=>c.type==="oauth")&&p.oauth_app===0||!u&&i.some(c=>c.type==="env_keys")&&p.env===0||!u&&i.some(c=>c.type==="app_installation")&&!r||o.required_capability&&!r)}export{He as component};
2
+ //# sourceMappingURL=index-BXHqp23o.js.map
@@ -0,0 +1,2 @@
1
+ import{je as r,j as o,a_ as n}from"./index-DB2lVKuV.js";import{A as a}from"./agent-connect-pages-DDPtkcmq.js";import"./agent-client-connections-xvabPpi6.js";import"./clients-BhPMbxHi.js";import"./client-rows-rse9thnk.js";import"./connector-page-shell-DZjKv9zQ.js";function j(){const{owner:t}=r.useParams();return o.jsx(n,{owner:t,children:({ownerSlug:e})=>o.jsx(a,{owner:e})})}export{j as component};
2
+ //# sourceMappingURL=index-BdLRUDIR.js.map
@@ -0,0 +1,2 @@
1
+ import{h1 as F,jh as B,r as N,j as e,c as R,ji as te,iq as z,B as k,bH as y,ig as W,bZ as ae,c9 as ne,bk as L,ih as ie,gt as re,gu as oe,gv as O,gw as E,gz as le,gA as G,a8 as ce,jj as de,cO as ue,C as me,i as w,b$ as T,ds as J,jk as V,$ as K,a0 as ge,fO as xe,jl as he,hv as pe,P as Y,aF as fe,H as be,o as je,t as ve,dH as ke,n as Ne,dI as ye,L as Ce,dJ as Se,cT as we,is as C,dL as A,cF as Ae,jm as Le,jn as H}from"./index-DB2lVKuV.js";import{A as De}from"./agent-editor-form-BrhQbHZg.js";import{A as Re,v as Ee,u as Ge,r as Pe,s as Te}from"./custom-guardrail-edits-DZy66ucV.js";import{f as Z}from"./agent-loading-shells-D3y98xuO.js";import{A as $e}from"./agent-permissions-matrix-jQJjSa9i.js";import{u as Fe,a as _,m as Be,P as Me,D as Ie,n as Oe,C as Ke}from"./core.esm-B1du4Zwy.js";import{u as M,s as He,a as _e,S as Ue,v as qe,b as ze}from"./agent-skill-context-CCcknBYE.js";import{s as Q,a as U}from"./skill-route-key-sF006xiz.js";import{P as We}from"./proposal-review-shell-EyGWEYwQ.js";import{C as Je}from"./connector-page-shell-DZjKv9zQ.js";import"./definition-comparison-C2mPfIMD.js";import"./json-diff-Ce6YAXzY.js";import"./code-editor-CTdKUDPY.js";import"./index-Vcq4gwWv.js";import"./schema-value-DDNHANGs.js";import"./model-selector-CjkBPpjN.js";import"./skill-editor-D_W3QlRz.js";function $(s,t){const a=new Set(s?.guardrails??[]),n=new Set(t.map(r=>r.name)),o=t.map(r=>({name:r.name,stages:r.stages,description:r.description,enabled:a.has(r.name),unknown:!1})),i=(s?.guardrails??[]).filter(r=>!n.has(r)).map(r=>({name:r,stages:[],enabled:!0,unknown:!0}));return[...o,...i]}function Ve(s){return s.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function Ye(s,t,a){return Ve(s.map(n=>n.name===t&&!n.unknown?{...n,enabled:a}:n))}const D={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function Ze(s){const t=new Date(s);return Number.isNaN(t.getTime())?s:de(t,{addSuffix:!0})}function Qe({owner:s,agentId:t,name:a}){const{data:n}=F(t),{data:o}=B(t),i=N.useMemo(()=>$(n,o??[]).find(d=>d.name===a)??null,[n,o,a]),r=(n?.guardrailsInline??[]).find(d=>d.name===a);return r?e.jsx(es,{owner:s,agentId:t,guardrail:r}):i?e.jsx(Xe,{agentId:t,name:a,row:i}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Xe({agentId:s,name:t,row:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description??(a.stages.length>0?`Built-in. Short-circuits this agent's ${a.stages.map(n=>D[n].toLowerCase()).join(", ")} stage${a.stages.length>1?"s":""} when it matches.`:"Configured out of band — toggling is managed via lobu apply.")}),e.jsx(X,{agentId:s,guardrail:t})]})}function es({owner:s,agentId:t,guardrail:a}){const n=R(),{data:o}=F(t),{data:i}=B(t),{data:r=null}=te(t),d=z(t),[f,m]=N.useState(!1),x=o?.guardrailsInline??[],h=(i??[]).map(u=>u.name),b=async(u,c)=>{if(!o)return y.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),y.success(c),!0}catch(g){return y.error(g instanceof Error?g.message:"Failed to save guardrail"),!1}},p=async u=>{const c=Ee(u,x,h,r,a.name);if(c){y.error(c);return}await b(Ge(x,a.name,u),"Guardrail saved")&&u.name.trim()!==a.name&&n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:l=>({...l,guardrail:u.name.trim()}),resetScroll:!1})},j=async()=>{await b(Pe(x,a.name),"Guardrail deleted")&&n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:c=>({...c,guardrail:void 0}),resetScroll:!1})};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:a.kind==="require-tool"?"Required tools":"Policy"}),e.jsx(Re,{initial:a,judgeModelDefault:r,submitLabel:"Save changes",submitting:d.isPending,onSubmit:p})]}),e.jsx("div",{className:"flex justify-end",children:f?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>void j(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>m(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(k,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>m(!0),children:["Delete ",a.name]})}),e.jsx(X,{agentId:t,guardrail:a.name})]})}function X({agentId:s,guardrail:t}){const{data:a=[],isLoading:n,isError:o}=W(s,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),n?e.jsx(ae,{label:"catches",variant:"table",rows:4}):o?e.jsx(ne,{label:"catches"}):a.length===0?e.jsx(L,{icon:ie,title:"No catches yet",description:"This guardrail hasn't short-circuited anything on this agent."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsxs(re,{children:[e.jsx(oe,{children:e.jsxs(O,{children:[e.jsx(E,{className:"w-[180px]",children:"When"}),e.jsx(E,{className:"w-[120px]",children:"Stage"}),e.jsx(E,{children:"Reason"})]})}),e.jsx(le,{children:a.map(i=>e.jsxs(O,{children:[e.jsx(G,{className:"text-xs text-muted-foreground",title:i.occurredAt,children:Ze(i.occurredAt)}),e.jsx(G,{children:e.jsx(ce,{variant:"outline",className:"text-[10px]",children:D[i.stage]})}),e.jsx(G,{className:"text-sm text-muted-foreground",children:i.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},i.id))})]})})]})}function I({description:s,action:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:s}),t?e.jsx("div",{className:"shrink-0",children:t}):null]})}function q(s,t){return s.get(t)??0}function ss(s,t,a){const n=s.map(i=>{const r=i.stages.map(d=>D[d]);return i.unknown&&r.push("Unknown"),{id:i.name,name:i.name,kind:"builtin",description:i.description,stages:i.stages,enabled:i.enabled,unknown:i.unknown,badges:r,tripCount:q(a,i.name)}}),o=t.map(i=>{const r=[D[i.stage],"Custom"];return{id:i.name,name:i.name,kind:"custom",description:i.policy,stages:[i.stage],enabled:i.enabled,unknown:!1,badges:r,tripCount:q(a,i.name)}});return[...n,...o]}function ee({enabled:s,name:t,expanded:a,onToggleEnabled:n,toggleDisabled:o,onToggle:i}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(ue,{checked:s,onCheckedChange:n,disabled:o,"aria-label":s?`Disable ${t}`:`Enable ${t}`}),e.jsx("button",{type:"button",onClick:i,"aria-label":a?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(me,{className:w("h-4 w-4 transition-transform",a&&"rotate-90")})})]})}function ts({owner:s,agentId:t,expandedName:a}){const n=R(),{data:o,isLoading:i}=F(t),{data:r,isLoading:d}=B(t),{data:f=[]}=W(t),m=z(t),x=async(c,g)=>{if(!o){y.error("Still loading agent settings — try again in a moment");return}try{if(c.kind==="custom")await m.mutateAsync({guardrailsInline:Te(o.guardrailsInline??[],c.name,g)});else{const l=$(o,r??[]);await m.mutateAsync({guardrails:Ye(l,c.name,g)})}y.success(g?"Guardrail enabled":"Guardrail disabled")}catch(l){y.error(l instanceof Error?l.message:"Failed to save guardrail")}},h=r===null,b=N.useMemo(()=>{const c=$(o,r??[]),g=o?.guardrailsInline??[],l=new Map;for(const v of f)l.set(v.guardrailName,(l.get(v.guardrailName)??0)+1);return ss(c,g,l)},[o,r,f]),p=c=>{n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:g=>({...g,guardrail:c===a?void 0:c}),resetScroll:!1})},j=()=>{n({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:s,agentId:t}})},u=i||d;return!u&&b.length===0?e.jsx("div",{className:"space-y-6",children:h?e.jsx(L,{icon:T,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:j}):e.jsx(L,{icon:T,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:j})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(I,{description:"Each guardrail short-circuits this agent's input, output, or tool-call stages. Built-ins are toggle-only; add a custom guardrail to judge messages against a policy you write.",action:u?void 0:e.jsxs(k,{type:"button",onClick:j,children:[e.jsx(J,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(Z,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map((c,g)=>{const l=c.name===a;return e.jsx(as,{card:c,expanded:l,isLast:g===b.length-1,onToggle:()=>p(c.name),onToggleEnabled:v=>void x(c,v),toggleDisabled:c.unknown||m.isPending,children:l?e.jsx(Qe,{owner:s,agentId:t,name:c.name}):null},c.id)})})]})}function as({card:s,expanded:t,isLast:a,onToggle:n,onToggleEnabled:o,toggleDisabled:i,children:r}){return e.jsxs("div",{className:w("bg-background",!a||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:n,"aria-expanded":t,className:w("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!s.unknown&&!t&&"opacity-70"),children:[e.jsx(T,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:w("truncate text-sm text-foreground",s.unknown&&"font-mono text-xs"),children:s.name}),s.kind==="custom"&&s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:s.tripCount>0?`${s.tripCount} recent ${s.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(V,{badges:s.badges})]})]}),e.jsx(ee,{enabled:s.enabled,name:s.name,expanded:t,onToggleEnabled:o,toggleDisabled:i,onToggle:n})]}),t&&r?e.jsx("div",{className:"border-t border-border px-4 py-4",children:r}):null]})}function ns({row:s}){const{isSaving:t,updateSkillRow:a}=M(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"skill-name",children:"Name"}),e.jsx(ge,{id:"skill-name",value:s.name,onChange:o=>a(s.repo,{name:o.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(xe,{id:"skill-instructions",value:s.instructions??"",onChange:o=>{const i=o.target.value;a(s.repo,{instructions:i,content:i.trim()||s.name})},rows:4,disabled:t})]})]})})}function is({owner:s,agentId:t,skillKey:a}){const n=R(),[o,i]=N.useState(!1),r=Q(a),{skillRows:d,catalog:f,isSaving:m,saveSkills:x,removeSkillAndSave:h,addSkillFromCatalog:b}=M(),p=d.find(g=>g.repo===r)??null,j=f?.catalog.find(g=>g.repo===r);N.useEffect(()=>{!p&&j&&b(r)},[b,j,r,p]);const u=async()=>{await h(r)&&(i(!1),n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:l=>({...l,skill:void 0}),resetScroll:!1}))};if(!p)return j?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const c=!p.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(ns,{row:p}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[c?o?e.jsxs(e.Fragment,{children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>void u(),disabled:m,children:m?"Removing...":"Remove skill"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>i(!1),disabled:m,children:"Cancel"})]}):e.jsxs(k,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>i(!0),disabled:m,children:["Remove ",p.name]}):null,e.jsx(k,{type:"button",onClick:()=>void x(),disabled:m||o,children:m?"Saving...":"Save changes"})]})]})}function rs(s){return s.map(t=>{const a=He(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const P="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function os({owner:s,agentId:t,expandedRepo:a}){const n=R(),{skillRows:o,catalog:i,isLoading:r,isSaving:d,reorderSkills:f,setSkillEnabledAndSave:m,addSkillFromCatalog:x}=M();N.useEffect(()=>{a&&(o.some(l=>l.repo===a)||i?.catalog.some(l=>l.repo===a)&&x(a))},[a,o,i,x]);const h=N.useMemo(()=>rs(o),[o]),b=N.useMemo(()=>h.map(l=>l.repo),[h]),p=Fe(_(Me,{activationConstraint:{distance:8}}),_(Be,{coordinateGetter:_e})),j=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},u=e.jsxs(k,{type:"button",onClick:j,children:[e.jsx(J,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),c=l=>{n({to:"/$owner/agents/$agentId",params:{owner:s,agentId:t},search:v=>({...v,skill:l===a?void 0:U(l)}),resetScroll:!1})},g=l=>{const{active:v,over:S}=l;!S||v.id===S.id||f(String(v.id),String(S.id))};return r?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e.jsx(Z,{rows:2})]}):h.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e.jsx(L,{icon:he,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:j})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{description:P,action:u}),e.jsx(Ie,{sensors:p,collisionDetection:Oe,onDragEnd:g,children:e.jsx(Ue,{items:b,strategy:qe,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:h.map((l,v)=>{const S=l.repo===a;return e.jsx(ls,{card:l,rank:v+1,disabled:d,expanded:S,isLast:v===h.length-1,onToggle:()=>c(l.repo),onToggleEnabled:se=>void m(l.repo,se),toggleDisabled:d,children:S?e.jsx(is,{owner:s,agentId:t,skillKey:U(l.repo)}):null},l.id)})})})})]})}function ls({card:s,rank:t,disabled:a,expanded:n,isLast:o,onToggle:i,onToggleEnabled:r,toggleDisabled:d,children:f}){const m=a||n,{attributes:x,listeners:h,setNodeRef:b,transform:p,transition:j,isDragging:u}=ze({id:s.repo,disabled:m}),c={transform:Ke.Transform.toString(p),transition:j};return e.jsxs("div",{ref:b,style:c,className:w("bg-background",!o||n?"border-b":"",u&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:m,...x,...h,children:e.jsx(pe,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:w("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:i,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(V,{badges:s.badges})]})]}),e.jsx(ee,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:r,toggleDisabled:d,onToggle:i})]}),n&&f?e.jsx("div",{className:"border-t border-border px-4 py-4",children:f}):null]})}function cs(){return e.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(Ae,{className:"h-4 w-4"})})}function ds({agentId:s}){const[t,a]=N.useState(!1),n=Le(s);return e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-destructive/30 p-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Deleting removes this agent and its configuration from the workspace."}),t?e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx(k,{type:"button",variant:"destructive",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?"Deleting...":"Delete agent"}),e.jsx(k,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:n.isPending,children:"Cancel"})]}):e.jsx(k,{type:"button",variant:"outline",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>a(!0),children:"Delete agent"})]})}function us({owner:s,agent:t,runId:a,expandedSkill:n,expandedGuardrail:o}){const{orgContext:i}=Y(),{isAdmin:r}=we(i.organizationId),{agentId:d}=t;return e.jsxs(e.Fragment,{children:[e.jsx(We,{resource:{kind:"agent",agentId:d},runId:a,children:({reviewMode:f,proposal:m,controlsDisabled:x})=>e.jsx(De,{mode:{kind:"edit",agent:t},reviewMode:f,reviewProposal:m,reviewControlsDisabled:x},d)}),e.jsx(C,{id:"skills",title:"Skills",children:e.jsx(os,{owner:s,agentId:d,expandedRepo:n?Q(n):void 0})}),e.jsx(C,{id:"guardrails",title:"Guardrails",children:e.jsx(ts,{owner:s,agentId:d,expandedName:o})}),r?e.jsx(C,{id:"permissions",title:"Permissions",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx($e,{owner:s,agentId:d})})]})}):null,a?null:e.jsx(ds,{agentId:d})]})}function ms(){return e.jsxs(e.Fragment,{children:[e.jsx(C,{title:"Settings",children:e.jsx(A,{rows:6})}),e.jsx(C,{title:"Models",children:e.jsx(A,{rows:2})}),e.jsx(C,{title:"Skills",children:e.jsx(A,{rows:2})}),e.jsx(C,{title:"Guardrails",children:e.jsx(A,{rows:2})})]})}function gs({owner:s,agentId:t,runId:a,expandedSkill:n,expandedGuardrail:o}){const{orgContext:i,hasOrgContext:r}=Y(),{isLoading:d}=fe(`/${s}`,i),{isAuthenticated:f}=be(),{isMember:m,isLoading:x}=je(),h=f&&m,{data:b=[],isLoading:p}=ve({enabled:h}),u=(h?!r||d||p||x:d||x)?null:b.find(c=>c.agentId===t)??null;return e.jsx(Je,{header:e.jsx(ke,{breadcrumb:e.jsx(ye,{crumbs:[e.jsx(Ce,{to:"/$owner",params:{owner:s},search:{section:"agent"},className:Se,children:"Agents"},"agents")]}),icon:e.jsx(cs,{}),title:u?u.name:e.jsx(Ne,{className:"h-6 w-40"}),caption:u?.description||void 0}),children:u?e.jsx(us,{owner:s,agent:u,runId:a,expandedSkill:n,expandedGuardrail:o}):e.jsx(ms,{})})}function Es(){const{owner:s,agentId:t}=H.useParams(),{run_id:a,skill:n,guardrail:o}=H.useSearch();return e.jsx(gs,{owner:s,agentId:t,runId:a,expandedSkill:n,expandedGuardrail:o})}export{Es as component};
2
+ //# sourceMappingURL=index-C2FrGwYN.js.map
@@ -0,0 +1,2 @@
1
+ import{bv as i,w as m,bw as n,j as s,bx as c}from"./index-DB2lVKuV.js";import{M as p}from"./memory-browse-page-D5kj1RaR.js";import"./public-shell-ready-_KWdfzEM.js";import"./entity-pages-C6M6yKFf.js";import"./renderer-B8yZ5lql.js";import"./schema-value-DDNHANGs.js";import"./card-C4oPCVh6.js";import"./filter-editors-D_Sfn0dv.js";import"./subDays-BGA_fkig.js";import"./core.esm-B1du4Zwy.js";import"./entity-schema-graph-B255NKjF.js";import"./view-param-filters-CvrKw0mZ.js";import"./app-bridge-B-L0rGz9.js";import"./member-scope-gate-CBPMprXu.js";function T(){const{owner:e,entityType:o}=i.useParams(),{create:a}=i.useSearch(),r=m({slug:e});if(r.data===void 0&&!r.isError)return null;const t=n(r.data??[],o);return t?s.jsx(p,{ownerSlug:e,create:!1,viewKey:t.key}):s.jsx(p,{ownerSlug:e,typeScope:c(o),create:a??!1})}export{T as component};
2
+ //# sourceMappingURL=index-CB9wGfUm.js.map
@@ -0,0 +1,2 @@
1
+ import{el as Be,r as N,gl as K,j as e,gM as ye,u as I,gm as Ae,ks as ke,kt as $e,gt as Te,gu as Ie,gv as ne,gw as re,gz as Oe,gA as ie,B as k,C as Ve,ds as Me,fU as we,cj as ze,H as Ue,L as He,U as Ke,ku as We,cd as qe,kv as F,hE as Ge,fj as oe,gn as Y,kl as Qe,n as le,eZ as Ne,W as Xe,c as Ye,b as Je,ce as A,o as Ze,w as es,fl as ss,cT as ts,e_ as as,kw as ns,fV as rs,dN as ce,cq as de,cs as ue,hx as is,dL as os,aw as ls,ax as cs,ay as ds,az as us,aA as ms,kx as hs,ci as xs,$ as X,a0 as me,fO as fs,a9 as ps,ky as he}from"./index-DB2lVKuV.js";import{n as gs,N as vs,m as js,o as bs,p as ys,S as ks}from"./entity-pages-C6M6yKFf.js";import{a as ws,V as Ns,R as Ss}from"./view-card-Cg6PeEiV.js";import{R as J,c as Z,h as xe,j as _s,d as Rs}from"./renderer-B8yZ5lql.js";import{u as Fs,a as Cs}from"./record-session-D27VNxP_.js";import{S as fe}from"./schema-value-DDNHANGs.js";import{V as pe,M as Es,b as Ls,a as Ds}from"./view-param-filters-CvrKw0mZ.js";import{r as Ps,R as ge,b as Bs}from"./events-feed-ClhEywwV.js";function As(t,s){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const n=!!(t.condition??!0),r=t.blockerFn;return{shouldBlockFn:async()=>n&&r!==void 0?await r():n,enableBeforeUnload:n,withResolver:r===void 0}}function $s(t,s){const{shouldBlockFn:n,enableBeforeUnload:r=!0,disabled:a=!1,withResolver:u=!1}=As(t),o=Be(),{history:i}=o,[l,g]=N.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return N.useEffect(()=>{const p=async x=>{function c(v){const b=o.parseLocation(v),S=o.getMatchedRoutes(b.pathname);return S.foundRoute===void 0?{routeId:"__notFound__",fullPath:b.pathname,pathname:b.pathname,params:S.routeParams,search:o.options.parseSearch(v.search)}:{routeId:S.foundRoute.id,fullPath:S.foundRoute.fullPath,pathname:b.pathname,params:S.routeParams,search:o.options.parseSearch(v.search)}}const d=c(x.currentLocation),m=c(x.nextLocation);if(d.routeId==="__notFound__"&&m.routeId!=="__notFound__")return!1;const h=await n({action:x.action,current:d,next:m});if(!u)return h;if(!h)return!1;const f=await new Promise(v=>{g({status:"blocked",current:d,next:m,action:x.action,proceed:()=>v(!1),reset:()=>v(!0)})});return g({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),f};return a?void 0:i.block({blockerFn:p,enableBeforeUnload:r})},[n,r,a,u,i,o]),l}const Ts=3;function Se(t,s,n,r){const a=_e(t.schema,s),u=K(s,a??{});return{href:"",key:`record-field:${t.entity.id}:${s}${n===void 0?"":`:${n}`}`,title:n===void 0?u:r?`${u} ${n+1} of ${r}`:`${u} ${n+1}`,recordField:{entityId:t.entity.id,field:s,row:n}}}function _e(t,s){return t?.properties?.[s]}function ut({target:t}){const s=Fs(t.entityId),n=_e(s?.schema,t.field);return s?!n||ye(n)?e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This field is no longer available in this view."}):e.jsx("div",{className:"space-y-3 px-5 py-4",children:t.row===void 0?e.jsx(Is,{session:s,field:t.field,prop:n}):e.jsx(Os,{session:s,field:t.field,prop:n,row:t.row})}):e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This record is no longer open. Open it again to see this field."})}function Is({session:t,field:s,prop:n}){const r=I(),{record:a,editing:u}=t,o=a.values.metadata[s],i=Array.isArray(o)?o:[],l=Ae(n.items?.properties),g=(o==null||Array.isArray(o))&&Object.keys(n.items?.properties??{}).length>0&&i.every(ke),p=K(s,n),x=n.maxItems===void 0||i.length<n.maxItems,c=e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Field of ",t.entity.name," · ",i.length," ",i.length===1?"item":"items",g&&i.length>0?" · open an item for every field":""]});if(!g)return e.jsxs(e.Fragment,{children:[c,u?e.jsx($e,{fieldPath:`peek.${s}`,fieldKey:s,prop:n,value:o,onChange:h=>a.setMetadataField(s,h),isRequired:!1,options:{valueModel:"metadata",orgContext:t.orgContext},ariaLabel:p}):e.jsx("div",{className:"text-sm",children:e.jsx(fe,{value:o,prop:n})})]});const d=l.slice(0,Ts),m=(h,f=i.length)=>r?.open(Se(t,s,h,f));return e.jsxs(e.Fragment,{children:[c,i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No items yet."}):e.jsx("div",{className:"rounded-md border",children:e.jsxs(Te,{children:[e.jsx(Ie,{children:e.jsxs(ne,{children:[d.map(([h,f])=>e.jsx(re,{children:K(h,f)},h)),e.jsx(re,{className:"w-10",children:e.jsx("span",{className:"sr-only",children:"Open"})})]})}),e.jsx(Oe,{children:i.map((h,f)=>e.jsxs(ne,{className:"cursor-pointer",onClick:()=>m(f),children:[d.map(([v,b])=>e.jsx(ie,{className:"max-w-[10rem] truncate",children:e.jsx(fe,{value:h[v],prop:b})},v)),e.jsx(ie,{children:e.jsx(k,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":`Open ${p} ${f+1}`,onClick:v=>{v.stopPropagation(),m(f)},children:e.jsx(Ve,{className:"h-4 w-4"})})})]},f))})]})}),u?e.jsxs(k,{type:"button",variant:"outline",size:"sm",disabled:!x,onClick:()=>{a.setMetadataField(s,[...i,{}]),m(i.length,i.length+1)},children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Add item"]}):null]})}function Os({session:t,field:s,prop:n,row:r}){const a=I(),{record:u,editing:o}=t,i=u.values.metadata[s],l=Array.isArray(i)?i:[],g=l[r],p=n.minItems===void 0||l.length>n.minItems;return ke(g)?o?e.jsxs(e.Fragment,{children:[e.jsx(we,{valueModel:"metadata",schema:n.items,values:g,onValuesChange:x=>u.setMetadataField(s,l.map((c,d)=>d===r?x:c)),orgContext:t.orgContext}),e.jsxs(k,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",disabled:!p,onClick:()=>{u.setMetadataField(s,l.filter((x,c)=>c!==r)),a?.back?.()},children:[e.jsx(ze,{className:"mr-1.5 h-4 w-4"}),"Remove item"]})]}):e.jsx(J,{fields:Z(n.items),values:g,context:{ownerSlug:t.ownerSlug,orgContext:t.orgContext}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"This item is no longer in the list."})}function Vs(){const{isAuthenticated:t,isReady:s}=Ue();return s?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center","data-testid":"views-access-required",children:[e.jsx("h2",{className:"text-lg font-semibold",children:t?"Join this workspace to open this view":"Sign in to open this view"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:t?"Attached views are available to workspace members. Use the workspace banner to join.":"Attached views are available to workspace members. Public record details remain available."}),t?null:e.jsx(He,{to:"/auth/login",search:Ke({callbackUrl:We(),intent:"sign-in"}),className:"mt-4 text-sm font-medium underline underline-offset-4",children:"Sign in"})]}):null}function W(t,s){return oe(Y(t))===oe(Y(s))}function Ms(t,s){const n={};for(const r of new Set([...Object.keys(t),...Object.keys(s)]))W(t[r],s[r])||(n[r]=Y(t[r])??null);return Object.keys(n).length>0?n:void 0}function zs(t,s){return[...new Set([...Object.keys(t),...Object.keys(s)])].filter(n=>{try{return!W(t[n],s[n])}catch{return!0}})}function ve(t,s){return{name:t.name,slug:t.slug,metadata:gs(t.metadata??{},s)}}function Us(t,s,n){const r=new Set(n),a={},u={},o=new Set([...Object.keys(t.values.metadata),...Object.keys(t.baseline.metadata),...Object.keys(s.metadata)]);for(const i of o){const l=r.has(i),g=l?t.values.metadata[i]:t.baseline.metadata[i],p=W(g,s.metadata[i])?g:s.metadata[i];p!==void 0&&(a[i]=p);let x=!1;if(!l)try{x=!W(t.values.metadata[i],t.baseline.metadata[i])}catch{x=!0}const c=x?t.values.metadata[i]:p;c!==void 0&&(u[i]=c)}return{baseline:{name:s.name,slug:s.slug,metadata:a},values:{name:s.name,slug:s.slug,metadata:u}}}function Hs({entity:t,schema:s,orgContext:n}){const r=N.useMemo(()=>ve(t,s),[t,s]),a=qe(F(t),r,s),u=Ge(n),{values:o,baseline:i,commit:l}=a,g=N.useMemo(()=>zs(o.metadata,i.metadata),[o.metadata,i.metadata]),p=o.name!==i.name||o.slug!==i.slug,x=N.useCallback((d,m)=>a.setValues(h=>({...h,metadata:{...h.metadata,[d]:m}})),[a.setValues]),c=async({note:d}={})=>{if(typeof t.id!="number")throw new Error("Source records are read-only");if(!a.canSubmit)return null;const m=Ms(o.metadata,i.metadata),h=o.name.trim()!==i.name.trim();if(!m&&!p)return null;const f=await u.mutateAsync({entityId:t.id,name:h?o.name.trim():void 0,slug:o.slug,metadata:m,field_note:m&&d?.trim()||void 0}),v=ve(f.entity,s);return l(b=>Us(b,v,Object.keys(m??{})),v),{held:f.blocked_fields??[],approvalUrl:f.approval_url}};return{values:o,baseline:i,revision:a.revision,setValues:a.setValues,setMetadataField:x,reset:a.reset,save:c,saving:u.isPending,dirtyKeys:g,identityDirty:p,isDirty:p||g.length>0,canSubmit:a.canSubmit,hasConflict:a.hasConflict,hasInvalidInput:a.hasInvalidInput}}const Ks=3,Ws=50;function Re(t){const s=N.useRef(null);return N.useEffect(()=>{t&&(s.current?.scrollIntoView?.({block:"start"}),s.current?.focus())},[t]),s}function T({headingRef:t,children:s}){return e.jsx("h3",{ref:t,tabIndex:-1,className:"text-xs font-medium uppercase tracking-wide text-muted-foreground outline-none",children:s})}function qs({entityId:t,entityName:s,ownerSlug:n,orgContext:r,focus:a,collapsed:u=!1}){const o=I(),i=Re(a),{data:l,isLoading:g,isError:p,refetch:x}=Qe(t,r,{limit:Ws});if(t===void 0)return null;if(g)return e.jsxs("section",{className:"space-y-2","aria-busy":"true",children:[e.jsx(T,{headingRef:i,children:"Linked"}),e.jsx(le,{className:"h-4 w-24"}),e.jsx(le,{className:"h-6 w-full rounded-md"})]});if(p||!l)return e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:i,children:"Linked"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Could not load this record's links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void x(),children:"Retry"})]})]});if(l.countsByType.length===0&&!l.hasMore&&!l.failures?.length)return a?e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:i,children:"Linked"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No links to other records yet."})]}):null;if(u){const c=l.countsByType.flatMap(d=>{const m=d.count===1?l.rows.find(h=>h.relationship_type_slug===d.relationship_type_slug):void 0;return m?[Ps(m,d.relationship_type_name)]:[d.relationship_type_name,String(d.count)]});return e.jsxs("section",{className:"space-y-1","aria-label":"Linked records",children:[e.jsx(T,{headingRef:i,children:"Linked"}),e.jsx(ge,{count:l.failures?.length??0,onRetry:()=>void x()}),e.jsx("p",{"data-testid":"linked-summary",className:"truncate text-sm text-muted-foreground",children:c.join(" · ")})]})}return e.jsxs("section",{className:"space-y-3","aria-label":"Linked records",children:[e.jsx(T,{headingRef:i,children:"Linked"}),e.jsx(ge,{count:l.failures?.length??0,onRetry:()=>void x()}),l.hasMore&&o?e.jsx(k,{type:"button",variant:"ghost",size:"sm",onClick:()=>o.open({href:"",key:`record-links:${t}`,title:"Linked records",recordLinks:{entityId:t,entityName:s,ownerSlug:n,orgContext:r,label:"Linked records"}}),children:"Browse linked records"}):null,l.countsByType.map(c=>{const d=l.rows.filter(h=>h.relationship_type_slug===c.relationship_type_slug).slice(0,Ks),m=c.count>d.length;return e.jsxs("div",{className:"space-y-1 text-sm",children:[m||d.length===0?e.jsxs("p",{className:"text-muted-foreground",children:[c.relationship_type_name,m?e.jsxs("span",{className:"tabular-nums text-muted-foreground/70",children:[" ","· ",c.count,l.countsScope==="page"?" shown":""]}):null]}):null,e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[d.map(h=>e.jsx(Bs,{row:h,label:c.relationship_type_name,entityId:t,ownerSlug:n},h.id)),m&&o?e.jsxs(k,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-primary hover:text-primary",onClick:()=>o.open({href:"",key:`record-links:${t}:${c.relationship_type_slug}`,title:`${c.relationship_type_name} · ${c.count}`,recordLinks:{entityId:t,entityName:s,ownerSlug:n,orgContext:r,relationshipType:c.relationship_type_slug,label:c.relationship_type_name}}),children:["Show all ",c.count]}):null]})]},c.relationship_type_slug)})]})}function Gs({record:t,ownerSlug:s,orgContext:n,focus:r}){const[a,u]=N.useState(r),o=Re(r);return e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:o,children:"Linked"}),a?e.jsx(ws,{record:t,ownerSlug:s,orgContext:n}):e.jsx(k,{type:"button",variant:"outline",size:"sm",className:"h-7",onClick:()=>u(!0),children:"Find linked records"})]})}const Qs="$name";function Fe({outcome:t,schema:s}){if(!t||t.held.length===0)return null;const n=s?.properties??{},r=t.held.map(a=>a===Qs?"Name":K(a,n[a]??{}));return e.jsxs("div",{role:"status",className:"rounded-md bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300",children:[r.join(", ")," ",r.length===1?"needs":"need"," approval before ",r.length===1?"it changes":"they change",".",t.approvalUrl?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:t.approvalUrl,className:"underline",children:"Review"})]}):null]})}function Xs({view:t,orgSlug:s,recordUrl:n,scope:r}){const a=I(),u=`${n}${Ne(t.key)}`;return e.jsx(Ns,{view:t,orgSlug:s,scope:r,open:a?()=>a.open({href:u,title:t.name}):void 0})}function Ys({recordUrl:t,dirty:s,onDiscard:n,pane:r=!1}){const a=N.useRef(!1);s&&a.current&&(a.current=!1);const u=I()?.registerLeaveGuard,[o,i]=N.useState(null),l=N.useRef(o);l.current=o,N.useEffect(()=>{if(!(!r||!s||!u))return u(()=>{if(l.current)return l.current.answer;let d=()=>{};const m=new Promise(f=>{d=f}),h={answer:m,resolve:d};return l.current=h,i(h),m})},[r,s,u]);const g=$s({disabled:!s,enableBeforeUnload:s,withResolver:!0,shouldBlockFn:({current:d,next:m})=>r?!a.current&&(m.pathname!==d.pathname||he(d.search)&&!he(m.search)):m.pathname!==t&&!m.pathname.startsWith(`${t}${Ne("")}`)}),p=g.status==="blocked",x=p||o!==null,c=d=>{d&&(a.current=!0,n()),o&&(l.current=null,i(null),o.resolve(d)),p&&(d?g.proceed():g.reset())};return e.jsx(ls,{open:x,onOpenChange:d=>{!d&&x&&c(!1)},children:e.jsxs(cs,{className:"max-w-sm",children:[e.jsxs(ds,{children:[e.jsx(us,{children:"Discard unsaved changes?"}),e.jsx(ms,{children:"This record has edits that are not saved. Leaving discards them."})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(k,{type:"button",variant:"ghost",onClick:()=>x&&c(!1),children:"Keep editing"}),e.jsx(k,{type:"button",variant:"destructive",onClick:()=>x&&c(!0),children:"Discard"})]})]})})}const je=6;function Js({entity:t,ownerSlug:s,orgContext:n,recordUrl:r,schema:a,entityTypeName:u,isTypeLoading:o,record:i,canEdit:l,editing:g,onEditingChange:p,outcome:x,onSaved:c,formId:d,fieldLimit:m,onDeleted:h,pane:f}){const v=g&&l,b=I(),S={entity:{id:F(t),name:t.name,entity_type:t.entity_type},ownerSlug:s,orgContext:n,schema:a,record:i,editing:v};Cs(S,!f);const C=f?null:b,_=C?.item?.recordField,P={ownerSlug:s,orgContext:n,controls:t.field_controls,dirtyKeys:i.dirtyKeys,openField:C?L=>C.open(Se(S,L.key)):void 0,openFieldKey:_?.entityId===F(t)?_.field:void 0},$=e.jsx(Ys,{recordUrl:r,pane:f,dirty:v&&i.isDirty,onDiscard:()=>{i.reset(),p(!1)}});if(o)return e.jsx(os,{rows:6});if(v)return e.jsxs(e.Fragment,{children:[$,e.jsx(Zs,{formId:d,entity:t,entityTypeName:u,schema:a,record:i,orgContext:n,renderControl:(L,B,D)=>_s(B)?e.jsx(Rs,{field:{key:L,prop:B},value:D,context:P}):void 0,onSaved:c,onDeleted:h,onDone:()=>p(!1)})]});const E=Z(i.revision);return e.jsxs("div",{className:"space-y-3",children:[e.jsx(Fe,{outcome:x,schema:a}),e.jsx(J,{fields:E,fieldLimit:m,values:i.values.metadata,context:P})]})}function Zs({formId:t,entity:s,entityTypeName:n,schema:r,record:a,orgContext:u,renderControl:o,onSaved:i,onDeleted:l,onDone:g}){const p=hs(),x=s.field_controls,{name:c,slug:d,metadata:m}=a.values,h=j=>a.setValues(w=>({...w,name:j})),f=j=>a.setValues(w=>({...w,slug:j})),v=j=>a.setValues(w=>({...w,metadata:j})),[b,S]=A(F(s),""),[C,_]=A(F(s),null),[P,$]=A(F(s),null),[E,L]=A(F(s),!1),[B,D]=A(F(s),null),R=a.dirtyKeys.length>0,q=async j=>{if(j.preventDefault(),!!a.canSubmit){if(_(null),!c.trim()){_("Name is required");return}try{const w=await a.save({note:b});$(w),i(w),S(""),w?.held.length||g()}catch(w){_(w instanceof Error?w.message:"Failed to update entity")}}},O=async()=>{D(null);try{if(typeof s.id!="number")throw new Error("Source records are read-only");await p.mutateAsync({entityId:s.id}),L(!1),l?.()}catch(j){D(j instanceof Error?j.message:"Failed to delete entity")}},V=[s.total_content>0&&`${s.total_content} content item${s.total_content===1?"":"s"}`,s.automations_count>0&&`${s.automations_count} Automation${s.automations_count===1?"":"s"}`,s.active_connections>0&&`${s.active_connections} connector${s.active_connections===1?"":"s"}`].filter(Boolean).join(", ");return e.jsxs("form",{id:t,onSubmit:q,className:"space-y-4",children:[e.jsx(xs,{visible:a.hasConflict,onReload:a.reset}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(X,{htmlFor:"sidebar-name",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(me,{id:"sidebar-name",value:c,onChange:j=>h(j.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(X,{htmlFor:"sidebar-slug",children:"URL Slug"}),e.jsx(me,{id:"sidebar-slug",value:d,onChange:j=>f(j.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))})]}),a.revision&&Object.keys(a.revision).length>0&&e.jsxs(e.Fragment,{children:[e.jsx(ks,{}),e.jsx(we,{valueModel:"metadata",schema:a.revision,values:m,onValuesChange:v,fieldControls:x,orgContext:u,renderControl:o})]}),R&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(X,{htmlFor:"sidebar-correction-note",children:"Correction note (optional)"}),e.jsx(fs,{id:"sidebar-correction-note",value:b,onChange:j=>S(j.target.value),placeholder:"Why are you changing these fields? Helps Automations respect the correction.",rows:2})]}),C&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}),e.jsx(Fe,{outcome:P,schema:r}),E?e.jsxs("div",{className:"space-y-3 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5 text-sm",children:[e.jsx(ps,{className:"h-4 w-4 shrink-0 text-destructive mt-0.5"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-medium text-foreground",children:['Delete "',s.name,'"?']}),V&&e.jsxs("p",{className:"text-muted-foreground",children:["Removes ",V,". This cannot be easily undone."]})]})]}),B&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-2.5 py-1.5 text-sm text-destructive",children:B}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(k,{type:"button",variant:"ghost",size:"sm",onClick:()=>{L(!1),D(null)},children:"Cancel"}),e.jsx(k,{type:"button",variant:"destructive",size:"sm",onClick:O,disabled:p.isPending,children:p.isPending?"Deleting...":`Delete ${n||"entity"}`})]})]}):e.jsx("div",{className:"pt-2",children:e.jsx(k,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>L(!0),children:"Delete"})})]})}function Ce(t,s){const n=new Set(t.measure_columns??[]),r=s?.properties??{};return Object.keys(t.metadata??{}).filter(a=>a!=="id"&&a!=="slug"&&a!=="name"&&!ye(r[a])&&r[a]?.const===void 0).map(a=>({key:a,prop:r[a]??{},label:r[a]?.["x-table-label"]??(n.has(a)?a:is(a.replace(/_/g," "))),numeric:n.has(a)}))}function et({entity:t,schema:s,ownerSlug:n,orgContext:r,fieldLimit:a}){const u=Ce(t,s);return e.jsxs("div",{children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Managed by the source"}),e.jsx(J,{fields:u,fieldLimit:a,values:t.metadata??{},context:{ownerSlug:n,orgContext:r}})]})}const be="owletto:record-details-expanded",st={};function tt(){const[t,s]=N.useState(()=>{try{return window.localStorage.getItem(be)==="1"}catch{return!1}});return[t,r=>{s(r);try{window.localStorage.setItem(be,r?"1":"0")}catch{}}]}function mt({namespace:t,entity:s,recordUrl:n,viewKey:r,title:a,onDeleted:u,pane:o=!1}){const i=Xe({strict:!1}),l=o?st:i,g=Ye(),p=N.useRef(null),x=Je(p,vs),[c,d]=tt(),[m,h]=A(F(s),!1),f={slug:t.slug,organizationId:t.id},{isMember:v,isPublic:b,isLoading:S}=Ze(t.slug),C=v||b,_=es({...f,organizationId:v?t.id:null}),{data:P,isLoading:$}=ss(s.entity_type,f),E=P?.metadata_schema,{isAdmin:L,isLoading:B}=ts(v?f.organizationId:void 0),D=v&&L&&!B&&!s.is_derived,R=Hs({entity:s,schema:E,orgContext:f}),[q,O]=A(F(s),null),V=`record-form-${s.id}`,j=m&&D,w=C?_.data??[]:[],ee=as(w,{type:s.entity_type,id:F(s)}),U=ns(ee,r),H=!r&&l.tab==="relationships",Ee=y=>void g({...ce,search:Q=>de(Q,y),replace:!0}),se={type:s.entity_type,entity:s.is_derived?s.slug:s.id??s.slug},M=x&&!c&&!m&&!H,te=s.is_derived?xe(Ce(s,E),s.metadata??{}).length:xe(Z(R.revision),R.values.metadata).length,ae=M?je:void 0,Le=e.jsxs("div",{className:"space-y-6",children:[s.is_derived?e.jsxs(e.Fragment,{children:[e.jsx(et,{entity:s,schema:E,ownerSlug:t.slug,orgContext:f,fieldLimit:ae}),e.jsx(Gs,{record:{type:s.entity_type,key:s.slug},ownerSlug:t.slug,orgContext:f,focus:H})]}):e.jsxs(e.Fragment,{children:[e.jsx(Js,{entity:s,ownerSlug:t.slug,orgContext:f,recordUrl:n,schema:E,entityTypeName:P?.name,isTypeLoading:$,record:R,canEdit:D,editing:m,onEditingChange:h,outcome:q,onSaved:O,formId:V,fieldLimit:ae,onDeleted:u,pane:o}),e.jsx(qs,{entityId:typeof s.id=="number"?s.id:void 0,entityName:s.name,ownerSlug:t.slug,orgContext:f,focus:H,collapsed:M})]}),x&&!m&&!H?e.jsx(k,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-primary hover:text-primary","aria-expanded":!M,onClick:()=>d(M),children:M?te>je?`Show all ${te} fields`:"Show all details":"Show fewer"}):null]}),De=y=>e.jsx(bs,{rootRef:p,narrow:x,details:Le,summary:e.jsx(ys,{entity:s,schema:E,context:{ownerSlug:t.slug,orgContext:f}}),children:y}),G=j?e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(k,{type:"button",variant:"ghost",size:"sm",onClick:()=>{R.reset(),O(null),h(!1)},children:"Cancel"}),e.jsx(k,{type:"submit",form:V,size:"sm",disabled:!R.canSubmit||!R.isDirty||R.saving||!R.values.name.trim(),children:R.saving?"Saving...":"Save"})]}):D&&!$?e.jsxs(k,{type:"button",variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5 px-2 text-muted-foreground hover:text-foreground",onClick:()=>{O(null),h(!0)},children:[e.jsx(rs,{className:"h-3.5 w-3.5"}),"Edit"]}):null,z=y=>o?e.jsxs(e.Fragment,{children:[G?e.jsx("div",{className:"sticky top-0 z-10 -mx-4 -mt-4 mb-3 flex justify-end border-b border-border bg-background px-4 py-1.5",children:G}):null,y]}):e.jsx(js,{entity:s,owner:t.slug,schema:E,title:a??null,actions:G,layout:"content",children:y});if(r&&!C)return z(S?null:e.jsx(Vs,{}));if(r&&_.data===void 0)return z(_.isError?e.jsx(pe,{onRetry:()=>void _.refetch()}):null);if(U.kind==="missing")return z(e.jsx(Es,{viewKey:U.key,backTo:n,backLabel:`Back to ${s.name}`}));if(U.kind==="view"){const{view:y}=U;return z(e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsx(Ls,{decls:y.params,params:ue(l),onParamsChange:Q=>void g({...ce,search:Pe=>de(Pe,Q)})}),e.jsx(Ds,{orgSlug:t.slug,viewKey:y.key,scope:se,params:ue(l),onParamsChange:Ee,paramDecls:y.params,contentHash:y.content_hash,title:y.name,minHeight:320})]}))}return z(De(e.jsxs("div",{className:"min-w-0 space-y-4",children:[C&&_.isError&&e.jsx(pe,{onRetry:()=>void _.refetch()}),ee.map(y=>e.jsx(Xs,{view:y,orgSlug:t.slug,recordUrl:n,scope:se},y.key)),e.jsxs("section",{"aria-labelledby":"record-activity-heading",className:"min-w-0",children:[e.jsx("h2",{id:"record-activity-heading",className:"mb-2 text-sm font-medium text-muted-foreground",children:"Activity"}),e.jsx(Ss,{entity:s,organizationId:t.id,ownerSlug:t.slug,pane:o})]})]})))}export{mt as E,ut as R,Vs as V};
2
+ //# sourceMappingURL=index-Caihaftb.js.map
@@ -0,0 +1,2 @@
1
+ import{bu as o,c as u,t as i,r as c,j as g}from"./index-DB2lVKuV.js";import{C as f}from"./agent-loading-shells-D3y98xuO.js";function d(t,n,e){const r=t.find(a=>a.system)??t[0];return r?{to:"/$owner/chat/$agentId",params:{owner:n,agentId:r.agentId},search:e,replace:!0}:null}function p(){const{owner:t}=o.useParams(),n=o.useSearch(),e=u(),{data:r=[],isLoading:a}=i(),s=d(r,t,n);return c.useEffect(()=>{s&&e(s)},[e,s]),c.useEffect(()=>{a||r.length>0||e({to:"/$owner",params:{owner:t},search:{section:"agent"},replace:!0})},[r.length,a,e,t]),g.jsx(f,{})}export{d as chatEntryTarget,p as component};
2
+ //# sourceMappingURL=index-CwH59DJV.js.map