@lobu/runtime-server 24.5.0 → 24.7.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 (253) hide show
  1. package/dist/catalogs/connectors.json +342 -4
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/linkedin-identity.ts +43 -0
  5. package/dist/connectors/linkedin.ts +154 -3
  6. package/dist/connectors/x-like-follow.ts +329 -0
  7. package/dist/connectors/x.ts +709 -80
  8. package/dist/dependencies.bun.lock +18 -18
  9. package/dist/owletto/dist/assets/_-CZgmjLR9.js +2 -0
  10. package/dist/owletto/dist/assets/_-Cm5OgtYD.js +3 -0
  11. package/dist/owletto/dist/assets/_agentId-Cci6NFc1.js +2 -0
  12. package/dist/owletto/dist/assets/_agentId-GhWTlPO2.js +2 -0
  13. package/dist/owletto/dist/assets/_automationId-KUlxSTK2.js +2 -0
  14. package/dist/owletto/dist/assets/_connectorKey._connectionId-Zpy7Hvml.js +2 -0
  15. package/dist/owletto/dist/assets/_connectorKey.index-CYDRp9UX.js +2 -0
  16. package/dist/owletto/dist/assets/_conversationId-NNqDdije.js +2 -0
  17. package/dist/owletto/dist/assets/_eventId-0BSX6VHj.js +2 -0
  18. package/dist/owletto/dist/assets/_owner-C-CD22NB.js +3 -0
  19. package/dist/owletto/dist/assets/_shape-CvXp4omb.js +2 -0
  20. package/dist/owletto/dist/assets/_slug-DgK7zpKA.js +2 -0
  21. package/dist/owletto/dist/assets/_viewKey-cH54P0zY.js +2 -0
  22. package/dist/owletto/dist/assets/_viewKey-m0B5j7L9.js +2 -0
  23. package/dist/owletto/dist/assets/{accept-invitation-pUl-c1KQ.js → accept-invitation-CX7Egv-p.js} +2 -2
  24. package/dist/owletto/dist/assets/activity-link-rXNpmppV.js +2 -0
  25. package/dist/owletto/dist/assets/activity-route-view-B0m7_g9q.js +2 -0
  26. package/dist/owletto/dist/assets/{agent-client-setup-list-DbXtJTsO.js → agent-client-setup-list-BmD3-_Ox.js} +2 -2
  27. package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-BtOTCsTU.js} +2 -2
  28. package/dist/owletto/dist/assets/agent-editor-form-CirqCpcM.js +2 -0
  29. package/dist/owletto/dist/assets/agent-list-row-SyACVYX7.js +2 -0
  30. package/dist/owletto/dist/assets/{agent-loading-shells-ClY_O6lb.js → agent-loading-shells-DHvKiEUB.js} +2 -2
  31. package/dist/owletto/dist/assets/agent-permissions-matrix-Dsc26dyW.js +2 -0
  32. package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-DF5q0Dfr.js} +2 -2
  33. package/dist/owletto/dist/assets/agent-subpage-shell-Pi5cECga.js +2 -0
  34. package/dist/owletto/dist/assets/{agent-thread-WNk2HapT.js → agent-thread-B1ZepGZc.js} +4 -4
  35. package/dist/owletto/dist/assets/agents-D1FHZ0jR.js +2 -0
  36. package/dist/owletto/dist/assets/app._appId-01I0CJal.js +2 -0
  37. package/dist/owletto/dist/assets/{assist-composer-ClfFEVx7.js → assist-composer-BD9msDk3.js} +2 -2
  38. package/dist/owletto/dist/assets/automation-detail-content-BFv1TglZ.js +2 -0
  39. package/dist/owletto/dist/assets/automation-row-CmTpAD4r.js +2 -0
  40. package/dist/owletto/dist/assets/automation-source-list-D8ZSavQU.js +2 -0
  41. package/dist/owletto/dist/assets/automations-D1FHZ0jR.js +2 -0
  42. package/dist/owletto/dist/assets/{callback-DRABUOha.js → callback-Ckrxv0eo.js} +2 -2
  43. package/dist/owletto/dist/assets/{card-Bdi7VEwo.js → card-DT9mSjSp.js} +2 -2
  44. package/dist/owletto/dist/assets/{change-summary-PBoM6Asb.js → change-summary-CGrKEJ04.js} +2 -2
  45. package/dist/owletto/dist/assets/{claim-CUIG1Oc-.js → claim-Bzby28tT.js} +2 -2
  46. package/dist/owletto/dist/assets/{client-activity-scopes-CXOWB5co.js → client-activity-scopes-DoIErdUy.js} +2 -2
  47. package/dist/owletto/dist/assets/{client-rows-36VnmgMK.js → client-rows-BbVQy5Ti.js} +2 -2
  48. package/dist/owletto/dist/assets/{clients-BJRcMk1A.js → clients-6aJvabvS.js} +2 -2
  49. package/dist/owletto/dist/assets/connect-BmDziBzI.js +2 -0
  50. package/dist/owletto/dist/assets/connect-menu-Bs8mxsga.js +2 -0
  51. package/dist/owletto/dist/assets/connect._clientId-t5aKu3aa.js +2 -0
  52. package/dist/owletto/dist/assets/connected._clientId-DswMAw8l.js +2 -0
  53. package/dist/owletto/dist/assets/{connection-q1bdnxCN.js → connection-BOaMa324.js} +2 -2
  54. package/dist/owletto/dist/assets/connection-feed-detail-BLCjhP-H.js +2 -0
  55. package/dist/owletto/dist/assets/connector-boxes-BAP_f77M.js +2 -0
  56. package/dist/owletto/dist/assets/{connector-page-shell-Cs1SjrYB.js → connector-page-shell-ClOmVPJr.js} +2 -2
  57. package/dist/owletto/dist/assets/{connector-provenance-aJFeeRIC.js → connector-provenance-wmYu5jwO.js} +2 -2
  58. package/dist/owletto/dist/assets/{connectors-BsvDMdsQ.js → connectors-D5F5rHxX.js} +2 -2
  59. package/dist/owletto/dist/assets/{consent-DJV78pnz.js → consent-RqHNkmm8.js} +2 -2
  60. package/dist/owletto/dist/assets/{copy-button-DjMWgrBf.js → copy-button-D6zpsZLi.js} +2 -2
  61. package/dist/owletto/dist/assets/{core.esm-CQzL3ObT.js → core.esm-BIE97rfo.js} +3 -3
  62. package/dist/owletto/dist/assets/create-BPxsKwk7.js +2 -0
  63. package/dist/owletto/dist/assets/{create-jBEuveV1.js → create-GT8_yF0R.js} +2 -2
  64. package/dist/owletto/dist/assets/create-Yx2qBMBy.js +2 -0
  65. package/dist/owletto/dist/assets/create-automation-form-B12yTrmj.js +3 -0
  66. package/dist/owletto/dist/assets/create._connectorKey-CzXqSkuI.js +2 -0
  67. package/dist/owletto/dist/assets/custom-guardrail-edits-B9plaLBN.js +2 -0
  68. package/dist/owletto/dist/assets/definition-comparison-C3k6Wa9B.js +2 -0
  69. package/dist/owletto/dist/assets/detail-page-skeleton-I5_7FkKx.js +2 -0
  70. package/dist/owletto/dist/assets/{device-Ba3RsIgb.js → device-CadaiNF4.js} +2 -2
  71. package/dist/owletto/dist/assets/device-automation-Dp3faMvp.js +2 -0
  72. package/dist/owletto/dist/assets/device-pin-tombstone-U7Bx05P6.js +2 -0
  73. package/dist/owletto/dist/assets/device._deviceId-DTZqj1HS.js +2 -0
  74. package/dist/owletto/dist/assets/dynamic-schema-form-DyT_9iVE.js +2 -0
  75. package/dist/owletto/dist/assets/entity-options-CGTjLlcS.js +2 -0
  76. package/dist/owletto/dist/assets/entity-page-DHHMmA8V.js +2 -0
  77. package/dist/owletto/dist/assets/entity-pages-eYbG2FDT.js +2 -0
  78. package/dist/owletto/dist/assets/entity-type-page-CjFqxSdL.js +2 -0
  79. package/dist/owletto/dist/assets/event-card-BtTUuf2q.js +2 -0
  80. package/dist/owletto/dist/assets/{event-detail-DkY95e5b.js → event-detail-8xHiplt_.js} +2 -2
  81. package/dist/owletto/dist/assets/events-feed-zFnTSE27.js +2 -0
  82. package/dist/owletto/dist/assets/filter-editors-Dd5R2Etd.js +2 -0
  83. package/dist/owletto/dist/assets/{full-page-spinner-BqmckkOf.js → full-page-spinner-CCU4PkRv.js} +2 -2
  84. package/dist/owletto/dist/assets/home-stream-IVsNEkwp.js +2 -0
  85. package/dist/owletto/dist/assets/index-2oaMOFKe.js +2 -0
  86. package/dist/owletto/dist/assets/index-B-Ab8srM.js +7899 -0
  87. package/dist/owletto/dist/assets/index-B4RZgvvI.js +2 -0
  88. package/dist/owletto/dist/assets/{index-C186T2Rw.js → index-B72KYdN1.js} +2 -2
  89. package/dist/owletto/dist/assets/index-BBZM53p8.js +2 -0
  90. package/dist/owletto/dist/assets/index-BOb0a5f9.js +2 -0
  91. package/dist/owletto/dist/assets/{index-ijqrJaRB.js → index-BYFDMIQC.js} +2 -2
  92. package/dist/owletto/dist/assets/index-BwnFQcMe.js +2 -0
  93. package/dist/owletto/dist/assets/index-CvYsWYlF.js +2 -0
  94. package/dist/owletto/dist/assets/{index-B0kw2lFL.js → index-DIXIvtnM.js} +2 -2
  95. package/dist/owletto/dist/assets/index-DLwokXHW.js +2 -0
  96. package/dist/owletto/dist/assets/index-_nlPHus1.js +2 -0
  97. package/dist/owletto/dist/assets/index-cwOgj4-i.js +2 -0
  98. package/dist/owletto/dist/assets/{index-ikp_mTsf.js → index-pmr1WUoG.js} +2 -2
  99. package/dist/owletto/dist/assets/index-pp4qmhkA.js +2 -0
  100. package/dist/owletto/dist/assets/index-tTbno-PX.css +1 -0
  101. package/dist/owletto/dist/assets/json-diff-B-1Swv_y.js +28 -0
  102. package/dist/owletto/dist/assets/list-skeleton-BAqT0vxo.js +2 -0
  103. package/dist/owletto/dist/assets/{login-u6LCgDYG.js → login-D5bIjMtf.js} +2 -2
  104. package/dist/owletto/dist/assets/{logout-JhmuWJEH.js → logout-JYZvxz8v.js} +2 -2
  105. package/dist/owletto/dist/assets/{member-scope-gate-4FQ0aanZ.js → member-scope-gate-Lj9m4RL2.js} +2 -2
  106. package/dist/owletto/dist/assets/memory-browse-page-rAKfVdQ_.js +74 -0
  107. package/dist/owletto/dist/assets/{model-selector-CgU8SJMF.js → model-selector-onvGA9Ww.js} +2 -2
  108. package/dist/owletto/dist/assets/{new-DgE1pVV0.js → new-B-Jd-vBl.js} +2 -2
  109. package/dist/owletto/dist/assets/new-BmehH1uR.js +2 -0
  110. package/dist/owletto/dist/assets/new-KDi15LWZ.js +2 -0
  111. package/dist/owletto/dist/assets/{organization-CKM_oFX3.js → organization-B9bh20Xo.js} +2 -2
  112. package/dist/owletto/dist/assets/peek-pane-content-Bqus80Mq.js +2 -0
  113. package/dist/owletto/dist/assets/{pending-seed-sml8Uf6e.js → pending-seed-CoFPQ835.js} +2 -2
  114. package/dist/owletto/dist/assets/proposal-review-shell-CnACXCUg.js +2 -0
  115. package/dist/owletto/dist/assets/public-shell-ready-Dlh-eWz0.js +2 -0
  116. package/dist/owletto/dist/assets/record-activity-6CfR95Ul.js +2 -0
  117. package/dist/owletto/dist/assets/{record-session-R-uHNuby.js → record-session-Bpx4_LGk.js} +2 -2
  118. package/dist/owletto/dist/assets/renderer-CgaQKMoG.js +96 -0
  119. package/dist/owletto/dist/assets/{reset-password-Mx3baeNc.js → reset-password-C-4Jnuqk.js} +2 -2
  120. package/dist/owletto/dist/assets/run-initiator-BvruBM5H.js +2 -0
  121. package/dist/owletto/dist/assets/{runs-fFJ1lPnw.js → runs-BMzp7j7j.js} +2 -2
  122. package/dist/owletto/dist/assets/runs-list-DVhrTr3v.js +2 -0
  123. package/dist/owletto/dist/assets/{schema-type-editor-panel-C0_9VcSs.js → schema-type-editor-panel-Bdeumkux.js} +2 -2
  124. package/dist/owletto/dist/assets/schema-value-BUgC0Ro8.js +3 -0
  125. package/dist/owletto/dist/assets/{settings-CP4PjMQA.js → settings-DYYvrrZ4.js} +2 -2
  126. package/dist/owletto/dist/assets/skill-route-key-sF006xiz.js +2 -0
  127. package/dist/owletto/dist/assets/source-record-panels-CBV9tsR3.js +2 -0
  128. package/dist/owletto/dist/assets/status-variants-DT61YfsU.js +2 -0
  129. package/dist/owletto/dist/assets/{table-BUqshjxa.js → table-B6yimlsZ.js} +2 -2
  130. package/dist/owletto/dist/assets/{use-automations-BLNjxq2K.js → use-automations-II_YJWtN.js} +2 -2
  131. package/dist/owletto/dist/assets/{use-login-redirect-CmyQW7GT.js → use-login-redirect-BqtEilid.js} +2 -2
  132. package/dist/owletto/dist/assets/{use-mention-search-dn3ws1WB.js → use-mention-search-Bxlpd6Dp.js} +3 -3
  133. package/dist/owletto/dist/assets/view-param-filters-DYlqBocg.js +2 -0
  134. package/dist/owletto/dist/assets/views-access-required-BVtMfgLh.js +2 -0
  135. package/dist/owletto/dist/index.html +2 -2
  136. package/dist/server-main.bundle.mjs +5680 -4005
  137. package/npm-shrinkwrap.json +99 -99
  138. package/package.json +1 -1
  139. package/vendor/connector-sdk/package.json +1 -1
  140. package/vendor/core/dist/contracts/tools/view-host.d.ts +7 -0
  141. package/vendor/core/dist/contracts/tools/view-host.js +28 -0
  142. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -4
  143. package/vendor/core/dist/contracts/tools/view-runtime.js +19 -7
  144. package/vendor/core/package.json +11 -1
  145. package/vendor/views/dist/api.d.ts +9 -4
  146. package/vendor/views/dist/api.js +33 -2
  147. package/vendor/views/dist/bridge.d.ts +8 -0
  148. package/vendor/views/dist/bridge.js +12 -2
  149. package/vendor/views/dist/components.d.ts +4 -2
  150. package/vendor/views/dist/components.js +29 -14
  151. package/vendor/views/dist/index.d.ts +1 -1
  152. package/vendor/views/dist/index.js +1 -1
  153. package/vendor/views/dist/native.d.ts +327 -0
  154. package/vendor/views/dist/native.js +57 -0
  155. package/vendor/views/package.json +1 -1
  156. package/dist/owletto/dist/assets/_-CCWuGXtQ.js +0 -2
  157. package/dist/owletto/dist/assets/_-DOJW1D-I.js +0 -3
  158. package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +0 -2
  159. package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +0 -2
  160. package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +0 -2
  161. package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +0 -2
  162. package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +0 -2
  163. package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +0 -2
  164. package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +0 -2
  165. package/dist/owletto/dist/assets/_name-D30_V03t.js +0 -2
  166. package/dist/owletto/dist/assets/_owner-Be8O41u8.js +0 -3
  167. package/dist/owletto/dist/assets/_shape-C6YbloRh.js +0 -2
  168. package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +0 -2
  169. package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +0 -2
  170. package/dist/owletto/dist/assets/_view-aoFDwEld.js +0 -2
  171. package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +0 -2
  172. package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +0 -2
  173. package/dist/owletto/dist/assets/activity-route-view-DN0ZEAzr.js +0 -2
  174. package/dist/owletto/dist/assets/agent-card-controls-C5jNWgfq.js +0 -2
  175. package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +0 -2
  176. package/dist/owletto/dist/assets/agent-guardrails-route-BJyfalBY.js +0 -2
  177. package/dist/owletto/dist/assets/agent-list-row-rF5LH-3k.js +0 -2
  178. package/dist/owletto/dist/assets/agent-permissions-matrix-bP1Qihv7.js +0 -2
  179. package/dist/owletto/dist/assets/agent-skills-route-Bv5luNdw.js +0 -2
  180. package/dist/owletto/dist/assets/agent-tab-intro-ednTs4WF.js +0 -2
  181. package/dist/owletto/dist/assets/agents-DY2S2SGE.js +0 -2
  182. package/dist/owletto/dist/assets/agents-workbench-bPTjdVS1.js +0 -2
  183. package/dist/owletto/dist/assets/app._appId-DrL5H5lB.js +0 -2
  184. package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +0 -2
  185. package/dist/owletto/dist/assets/automation-row-DCHM--aD.js +0 -2
  186. package/dist/owletto/dist/assets/automations-DY2S2SGE.js +0 -2
  187. package/dist/owletto/dist/assets/calendar-Ck0yOLYu.js +0 -2
  188. package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +0 -16
  189. package/dist/owletto/dist/assets/connect-CMcEQWls.js +0 -2
  190. package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +0 -2
  191. package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +0 -2
  192. package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +0 -2
  193. package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +0 -2
  194. package/dist/owletto/dist/assets/connected._clientId.index-jSnGvzYs.js +0 -2
  195. package/dist/owletto/dist/assets/connection-feed-detail-BIlkK0Pd.js +0 -2
  196. package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +0 -2
  197. package/dist/owletto/dist/assets/connections-browser-V-3td9DB.js +0 -2
  198. package/dist/owletto/dist/assets/connector-boxes-lFc-WP83.js +0 -2
  199. package/dist/owletto/dist/assets/connector-scope-lists--vNdbOn0.js +0 -2
  200. package/dist/owletto/dist/assets/create-BmKx5vq3.js +0 -2
  201. package/dist/owletto/dist/assets/create-Rt0RbiD4.js +0 -2
  202. package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +0 -3
  203. package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +0 -2
  204. package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +0 -2
  205. package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +0 -2
  206. package/dist/owletto/dist/assets/entity-avatar-TVKjZxWQ.js +0 -2
  207. package/dist/owletto/dist/assets/entity-options-daOOQo7O.js +0 -2
  208. package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +0 -2
  209. package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +0 -2
  210. package/dist/owletto/dist/assets/event-card-DVUB8my6.js +0 -2
  211. package/dist/owletto/dist/assets/events-feed-B9CZHI_P.js +0 -2
  212. package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +0 -2
  213. package/dist/owletto/dist/assets/guardrails-Csusrok2.js +0 -2
  214. package/dist/owletto/dist/assets/identity-Dmg3STO8.js +0 -2
  215. package/dist/owletto/dist/assets/index--ZWegctR.js +0 -2
  216. package/dist/owletto/dist/assets/index-BKrdVwW9.js +0 -2
  217. package/dist/owletto/dist/assets/index-BUBcNNUY.js +0 -2
  218. package/dist/owletto/dist/assets/index-BUDr4-Yv.js +0 -2
  219. package/dist/owletto/dist/assets/index-BYPQWVwD.js +0 -2
  220. package/dist/owletto/dist/assets/index-BfpaPJPj.js +0 -2
  221. package/dist/owletto/dist/assets/index-BicNFLBW.js +0 -2
  222. package/dist/owletto/dist/assets/index-Bsdv5aks.js +0 -2
  223. package/dist/owletto/dist/assets/index-CX0pJ9j9.js +0 -2
  224. package/dist/owletto/dist/assets/index-CsrT07TJ.js +0 -2
  225. package/dist/owletto/dist/assets/index-DdBTTN3y.js +0 -7899
  226. package/dist/owletto/dist/assets/index-DdYWarql.css +0 -1
  227. package/dist/owletto/dist/assets/index-JYEIN8nM.js +0 -2
  228. package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +0 -14
  229. package/dist/owletto/dist/assets/list-skeleton-CXDLkYTg.js +0 -2
  230. package/dist/owletto/dist/assets/manage-gear-D8LMhehh.js +0 -2
  231. package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +0 -74
  232. package/dist/owletto/dist/assets/model-jL871x2J.js +0 -2
  233. package/dist/owletto/dist/assets/models-jdemgIZk.js +0 -2
  234. package/dist/owletto/dist/assets/nav-pill-DrFkuyUQ.js +0 -2
  235. package/dist/owletto/dist/assets/new-CcJOd5aH.js +0 -2
  236. package/dist/owletto/dist/assets/new-OWwrYckd.js +0 -2
  237. package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +0 -2
  238. package/dist/owletto/dist/assets/permissions-BvA9SATv.js +0 -2
  239. package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +0 -2
  240. package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +0 -2
  241. package/dist/owletto/dist/assets/record-activity-C9gVBbF0.js +0 -2
  242. package/dist/owletto/dist/assets/renderer-DXfJaCCa.js +0 -97
  243. package/dist/owletto/dist/assets/run-activity-link-CaIBSRQj.js +0 -2
  244. package/dist/owletto/dist/assets/run-initiator-BvzQJYW9.js +0 -2
  245. package/dist/owletto/dist/assets/runs-panel-DEnZHTa5.js +0 -2
  246. package/dist/owletto/dist/assets/runs-table-XGnxJl7S.js +0 -2
  247. package/dist/owletto/dist/assets/settings-CgaUJMHH.js +0 -2
  248. package/dist/owletto/dist/assets/skills-D-e_h3a9.js +0 -2
  249. package/dist/owletto/dist/assets/source-record-panels-Bh0n4gGw.js +0 -2
  250. package/dist/owletto/dist/assets/status-dot-Cpq63I7p.js +0 -2
  251. package/dist/owletto/dist/assets/use-scroll-sentinel-DRyBMueA.js +0 -2
  252. package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +0 -2
  253. package/dist/owletto/dist/assets/views-access-required-C_b9itZ2.js +0 -2
@@ -0,0 +1,57 @@
1
+ /** Public prop contracts for the native components built by Owletto.
2
+ * Implementations are supplied by the host artifact, using the shell's React. */
3
+ import { createElement, } from "react";
4
+ export const NATIVE_COMPONENT_NAMES = [
5
+ "AutomationDefinition",
6
+ "AgentDefinition",
7
+ "ConnectorDefinition",
8
+ "AutomationReference",
9
+ "AgentReference",
10
+ "ConnectorReference",
11
+ "JsonDiff",
12
+ "EntityListPage",
13
+ "EntityRecordPage",
14
+ "EntityTableView",
15
+ "RecordSpecSheet",
16
+ "SchemaValue",
17
+ "EntityAvatar",
18
+ "Button",
19
+ "Badge",
20
+ "Tabs",
21
+ "TabsList",
22
+ "TabsTrigger",
23
+ "TabsContent",
24
+ ];
25
+ export const NATIVE_COMPONENT_GLOBAL = "__lobuViewNative";
26
+ function native(name) {
27
+ return function NativeComponent(props) {
28
+ const registry = globalThis.__lobuViewNative;
29
+ const component = registry?.[name];
30
+ if (!component)
31
+ throw new Error(`Native component ${name} is unavailable in this host runtime.`);
32
+ return createElement(component, props);
33
+ };
34
+ }
35
+ export const EntityListPage = native("EntityListPage");
36
+ export const EntityRecordPage = native("EntityRecordPage");
37
+ export const EntityTableView = native("EntityTableView");
38
+ export const RecordSpecSheet = native("RecordSpecSheet");
39
+ export const SchemaValue = native("SchemaValue");
40
+ export const EntityAvatar = native("EntityAvatar");
41
+ export const Button = native("Button");
42
+ export const Badge = native("Badge");
43
+ export const Tabs = native("Tabs");
44
+ export const TabsList = native("TabsList");
45
+ export const TabsTrigger = native("TabsTrigger");
46
+ export const TabsContent = native("TabsContent");
47
+ export const AutomationReference = native("AutomationReference");
48
+ export const AgentReference = native("AgentReference");
49
+ export const ConnectorReference = native("ConnectorReference");
50
+ export const JsonDiff = native("JsonDiff");
51
+ /** Instructions, sources, triggers, outputs and code from an Automation snapshot. */
52
+ export const AutomationDefinition = native("AutomationDefinition");
53
+ /** Identity and settings from an Agent snapshot, using the native editor fields. */
54
+ export const AgentDefinition = native("AgentDefinition");
55
+ /** Connector capabilities, schemas and source from a definition snapshot. */
56
+ export const ConnectorDefinition = native("ConnectorDefinition");
57
+ //# sourceMappingURL=native.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "24.5.0",
3
+ "version": "24.7.0",
4
4
  "description": "Authoring runtime for Lobu views — React modules rendered in the sandboxed MCP Apps frame",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import{gO as t,w as p,j as a,gP as e,ao as s}from"./index-DdBTTN3y.js";import{A as n}from"./activity-route-view-DN0ZEAzr.js";import"./record-activity-C9gVBbF0.js";import"./filter-bar-wPaR12SS.js";import"./calendar-Ck0yOLYu.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-D8LMhehh.js";import"./runs-fFJ1lPnw.js";import"./source-record-panels-Bh0n4gGw.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./events-feed-B9CZHI_P.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./agent-loading-shells-ClY_O6lb.js";import"./member-scope-gate-4FQ0aanZ.js";import"./runs-panel-DEnZHTa5.js";import"./runs-table-XGnxJl7S.js";import"./nav-pill-DrFkuyUQ.js";import"./public-shell-ready-BIVCHQHe.js";function K(){const{owner:o}=t.useParams(),r=p({select:m=>m.pathname}),i=t.useSearch();return a.jsx(n,{owner:o,search:i,entityScope:e(s(r,1)).path})}export{K as component};
2
- //# sourceMappingURL=_-CCWuGXtQ.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-BfJXvbxn.js","assets/index-DdBTTN3y.js","assets/index-DdYWarql.css","assets/record-activity-C9gVBbF0.js","assets/filter-bar-wPaR12SS.js","assets/calendar-Ck0yOLYu.js","assets/connection-label-BobuYiAG.js","assets/manage-gear-D8LMhehh.js","assets/runs-fFJ1lPnw.js","assets/source-record-panels-Bh0n4gGw.js","assets/event-card-DVUB8my6.js","assets/run-initiator-BvzQJYW9.js","assets/use-automations-BLNjxq2K.js","assets/clients-BJRcMk1A.js","assets/renderer-DXfJaCCa.js","assets/table-BUqshjxa.js","assets/card-Bdi7VEwo.js","assets/change-summary-PBoM6Asb.js","assets/json-diff-BaLL4Fsu.js","assets/index-Vcq4gwWv.js","assets/copy-button-DjMWgrBf.js","assets/agent-list-row-rF5LH-3k.js","assets/client-rows-36VnmgMK.js","assets/automation-row-DCHM--aD.js","assets/model-jL871x2J.js","assets/events-feed-B9CZHI_P.js","assets/client-activity-scopes-CXOWB5co.js","assets/use-scroll-sentinel-DRyBMueA.js","assets/agent-loading-shells-ClY_O6lb.js","assets/member-scope-gate-4FQ0aanZ.js","assets/views-access-required-C_b9itZ2.js","assets/record-session-R-uHNuby.js","assets/entity-avatar-TVKjZxWQ.js","assets/view-param-filters-CER47Tlz.js","assets/app-bridge-C4nPtae3.js"])))=>i.map(i=>d[i]);
2
- import{am as x,w as p,an as y,ao as j,ap as P,aq as g,q as R,s as f,t as v,j as e,r as w,ar as E,n as S,_}from"./index-DdBTTN3y.js";import{P as r}from"./public-shell-ready-BIVCHQHe.js";const b=S(async()=>({default:(await _(async()=>{const{EntityPage:a}=await import("./entity-page-BfJXvbxn.js");return{EntityPage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(E,{})})}function L(){const{owner:a}=x.useParams(),l=p({select:m=>m.pathname}),s=y(j(l)),d=s?.viewKey,{path:u}=P(a,s?.entityPath),{data:t,isLoading:n,error:o}=g(u,{slug:a}),{session:h,isReady:i}=R();return f({active:v({settled:!n,authReady:i,session:h,resolved:!!t,error:o}),owner:a}),n||!i&&!t?e.jsx(c,{}):o||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't resolve this path."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsx(w.Suspense,{fallback:e.jsx(c,{}),children:e.jsx(b,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})]})}export{L as component};
3
- //# sourceMappingURL=_-DOJW1D-I.js.map
@@ -1,2 +0,0 @@
1
- import{hH as r,j as e}from"./index-DdBTTN3y.js";import{A as m}from"./agents-workbench-bPTjdVS1.js";import"./agent-editor-form-CdA5vLr8.js";import"./model-selector-CgU8SJMF.js";import"./proposal-review-shell-D6KABxah.js";import"./runs-fFJ1lPnw.js";import"./nav-pill-DrFkuyUQ.js";function x(){const{owner:o,agentId:t}=r.useParams();return e.jsx(m,{owner:o,agentId:t})}export{x as component};
2
- //# sourceMappingURL=_agentId-CJhQbi6k.js.map
@@ -1,2 +0,0 @@
1
- import{c as L,gV as P,r as u,j as n,i as w,cx as k,q as D,at as E,bb as M,b2 as N,d1 as R,cP as O,gW as $,gX as B,bk as Q,E as W}from"./index-DdBTTN3y.js";import{L as q,A as z}from"./agent-thread-WNk2HapT.js";import{n as C}from"./agent-thread-storage-U6htL3ad.js";import{A as F,C as H}from"./agent-loading-shells-ClY_O6lb.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-sml8Uf6e.js";import"./use-mention-search-dn3ws1WB.js";import"./index-Vcq4gwWv.js";import"./use-automations-BLNjxq2K.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./connection-label-BobuYiAG.js";import"./events-feed-B9CZHI_P.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";function U({owner:e,agent:s,threadId:t,afterMessagesContent:d,className:r,initialDraft:h,newChatRequested:p=!1,preventAutoNavigate:f}){const o=L(),i=s.agentId,{data:a=[]}=P(i,{orgSlug:e}),[l,x]=u.useState(()=>C()),[g,A]=u.useState(null);u.useEffect(()=>{!p||t||(x(C()),A(null),o({to:".",search:(m=>{const{new:b,...y}=m;return y}),replace:!0}))},[p,t,o]);const v=u.useMemo(()=>!g||a.some(m=>m.id===g.id)?a:[g,...a],[a,g]),c=t??l,T=!t||!v.some(m=>m.id===t),j=u.useCallback(()=>{if(v.some(b=>b.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const m=k(e,i,c);o({...m,replace:!0})},[v,c,o,e,i]),S=u.useCallback(()=>{T&&!f&&j()},[T,j,f]);return n.jsx("div",{className:w("flex min-h-0 flex-1 flex-col",r),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(q,{agentId:i,workspaceSlug:e,thread:c,loadHistory:!!t,onFirstUserMessage:S,initialDraft:h,children:n.jsx(z,{afterMessagesContent:d})},`${i}:${c}`)})})}function V({owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:p}){const{isAuthenticated:f}=D(),{isMember:o,isLoading:i}=E(),a=f&&o,{data:l=[],isLoading:x}=M({enabled:a}),g=s??null,A=l.find(c=>c.agentId===g)??null;return a&&x||i?n.jsx(F,{}):A?n.jsx(U,{owner:e,agent:A,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:p,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(N,{icon:R,title:"Agent not found",description:"This agent may have been removed."})}function X(e){return[...e].sort((s,t)=>t.updatedAt-s.updatedAt)[0]}function _({owner:e,agentId:s,threadId:t,initialDraft:d,forceComposer:r=!1,newChatRequested:h=!1,afterMessagesContent:p,preventAutoNavigate:f}){const o=L(),{data:i=[],isLoading:a}=O($(e,s,{strict:!1})),l=u.useMemo(()=>X(i),[i]);return u.useEffect(()=>{if(t||r||a||!l)return;const x=k(e,s,l.id);o({...x,replace:!0})},[s,a,l,o,e,t,r]),!t&&!r&&(a||l)?n.jsx(H,{}):n.jsx(V,{owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:h,afterMessagesContent:p,preventAutoNavigate:f})}function jt(){const{owner:e,agentId:s}=B.useParams(),{threadId:t}=Q({strict:!1}),{new:d,prompt:r}=W({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 pt-2.5 pb-4 lg:px-6 lg:pb-6",children:n.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:n.jsx(_,{owner:e,agentId:s,threadId:t,initialDraft:r,forceComposer:!t,newChatRequested:!!d})})})}export{jt as component};
2
- //# sourceMappingURL=_agentId-DD4K1i6V.js.map
@@ -1,2 +0,0 @@
1
- import{c as k,v as A,aq as L,q as R,at as b,j as t,ak as C,al as _,gS as S,L as d,gT as D,d1 as P,S as $,B as u,e_ as y,hy as g,az as B}from"./index-DdBTTN3y.js";import{A as O}from"./automation-detail-content-dFy1Huas.js";import{R as z}from"./run-activity-link-CaIBSRQj.js";import{b as E}from"./use-automations-BLNjxq2K.js";import"./create-automation-form-PEmSLMD6.js";import"./model-jL871x2J.js";import"./entity-options-daOOQo7O.js";import"./connection-label-BobuYiAG.js";import"./model-selector-CgU8SJMF.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-DNuRKde1.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-dn3ws1WB.js";import"./proposal-review-shell-D6KABxah.js";import"./runs-fFJ1lPnw.js";import"./events-feed-B9CZHI_P.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";function W({owner:a,automationId:e,view:s,runId:o}){const r=k(),{orgContext:x,hasOrgContext:h}=A(),{data:f,isLoading:m}=L(`/${a}`,x),{isAuthenticated:v}=R(),{isLoading:c}=b(),j=f?.workspace?.id??"",N=v?!h||m||c:m||c,i=E(e,void 0,j).data?.automation,n=i?.automation_name??"Automation",l=()=>void r({to:"/$owner/automations",params:{owner:a}}),w=()=>void r({to:"/$owner/automations/$automationId",params:{owner:a,automationId:e},search:{view:"definition",run_id:void 0},replace:!0}),p=!o&&s==="definition";return t.jsx(C,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(_,{className:"flex min-w-0 flex-col gap-4",children:[t.jsx(S,{crumbs:[t.jsx(d,{to:"/$owner/automations",params:{owner:a},className:D,children:"Automations"},"automations")],current:o?"Review change":n}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"flex min-w-0 items-center gap-2",children:t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx(P,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),N&&!i?t.jsx($,{className:"h-5 w-40"}):o?"Review change":n]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[p?t.jsx(z,{owner:a,filters:{automationIds:[Number(e)],bucket:"automation"},name:n}):null,o?null:p?t.jsx(u,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:l,children:"Done"}):t.jsx(u,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs(d,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:e},search:{view:"definition",run_id:void 0},children:[t.jsx(y,{className:"h-3.5 w-3.5"}),"Edit"]})})]})]}),t.jsx(O,{owner:a,agentId:i?.managed_agent_id??null,automationId:e,view:s,runId:o,onDone:o?l:w})]})})}function ft(){const{owner:a,automationId:e}=g.useParams(),s=g.useSearch();return t.jsx(B,{owner:a,children:()=>t.jsx(W,{owner:a,automationId:e,view:s.view,runId:s.run_id})})}export{ft as component};
2
- //# sourceMappingURL=_automationId-Cbd7B0mP.js.map
@@ -1,2 +0,0 @@
1
- import{iS as I,j as e,az as z,c as J,aG as Q,aH as U,cD as q,d3 as X,S as R,B as Y,L as p,aJ as Z,iD as K,iE as ee,aW as ne,gT as x,gr as se,gR as oe,b8 as ae,i3 as te,gS as ie,aQ as re,F as ce}from"./index-DdBTTN3y.js";import{R as de,c as me,C as le}from"./device-pin-tombstone-C79KIAIK.js";import{C as E}from"./connector-page-shell-Cs1SjrYB.js";import{a as pe}from"./connector-provenance-aJFeeRIC.js";import{f as ue,C as xe,F as he,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-BIlkK0Pd.js";import{S as De,g as Ne}from"./runs-table-XGnxJl7S.js";import{c as ge}from"./connection-label-BobuYiAG.js";import"./run-activity-link-CaIBSRQj.js";import"./connector-scope-lists--vNdbOn0.js";import"./status-dot-Cpq63I7p.js";import"./entity-options-daOOQo7O.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";function Ze(){const{owner:m,connectorKey:n,connectionId:v}=I.useParams(),{addFeed:a,feedId:r,settings:h,auth_result:t}=I.useSearch();return e.jsx(z,{owner:m,children:l=>e.jsx($e,{organizationId:l.organizationId,ownerSlug:l.ownerSlug,isWorkspaceLoading:l.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:a===!0,feedId:r,openSettings:h===!0,authResult:t})})}function $e({organizationId:m,ownerSlug:n,isWorkspaceLoading:v,connectorKey:a,connectionId:r,showAddFeed:h,feedId:t,openSettings:l,authResult:A}){const y=J(),{data:B=[]}=Q(),{data:M=[],isLoading:P,isError:j,refetch:S}=U(m??"",{connectorKey:a,connectionIds:[r]}),{data:g=[]}=q(m??""),{data:T=[],isLoading:W,isError:H,refetch:O}=X(t?r:null),s=M.find(i=>i.id===r),o=g.find(i=>i.key===a),c=t?T.find(i=>i.id===t):null;if(v||P||t&&W||!m)return e.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[e.jsx(R,{className:"h-7 w-56"}),e.jsx(R,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||t&&H)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Y,{variant:"outline",size:"sm",onClick:()=>void(j?S():O()),children:"Retry"})]});if(!s)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:a},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",o?.name??a]})]});const $=ge({...s,connector_name:s.connector_name??o?.name??null}),C=!t&&!h,G=()=>void y({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:a,connectionId:String(r)},search:{},replace:!0});let u,f=$,F,k,D;t?c?(f=ue(c,o),c.store==="channel_messages"?(u=e.jsx(xe,{feed:c,hideHeader:!0}),D="chat channel"):(F=e.jsx(he,{feed:c,ownerSlug:n}),k=e.jsx(fe,{feed:c}),u=e.jsx(ve,{feed:c,connectorDef:o,ownerSlug:n}))):(u=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),f="Feed"):h&&(u=e.jsx(je,{onClose:G,organizationId:m,connections:[s],connectorDefinitions:g}),f="Add feed",D=Ce);const d=B.find(i=>i.id===s.device_worker_id&&Z(i,n)),w=d?K(d):void 0,N=w?ee(n,w,ne()):void 0,_=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:x,children:"Connectors"},"connectors"),...d&&N?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:N.id},className:x,children:N.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:x,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:a},search:{},className:x,children:o?.name??a},"connector")]];C||_.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:a,connectionId:String(r)},search:{},className:x,children:$},"connection"));const b=C?me(s):null,V=D??b??void 0,L=e.jsx(oe,{breadcrumb:e.jsx(ie,{crumbs:_}),icon:o?e.jsx(ae,{icon:o.icon,name:o.name,faviconDomain:o.favicon_domain??te(o.auth_schema)}):null,title:f,status:F??e.jsx(De,{status:Ne(s.status),showDot:!0,children:s.status}),meta:k,caption:V,captionTone:b?"error":"muted"});return C?d&&o&&re(o)?e.jsx(ce,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},search:{connection:s.id,settings:l||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(E,{header:L,children:[e.jsx(pe,{connectorDef:o,connectorKey:a,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(le,{embedded:!0,connection:s,connectorDef:o,ownerSlug:n,openSettings:l,authResult:A},s.id)]}):e.jsx(E,{header:L,children:e.jsx("div",{className:"mt-0",children:u})})}export{Ze as component};
2
- //# sourceMappingURL=_connectorKey._connectionId-DFpPep9B.js.map
@@ -1,2 +0,0 @@
1
- import{aD as Ae,aE as Pe,aF as Se,aO as le,aL as ee,hO as qe,gt as Ge,j as e,B as j,L as B,aN as oe,gR as se,gS as te,gT as M,hP as Qe,a6 as Ze,hQ as J,r as u,hR as Ne,hS as $e,cO as Je,hT as ye,bt as U,hU as be,H as k,bl as es,bm as ss,bn as ts,bo as as,bp as ns,hK as rs,I as $,bP as H,ab as z,A as Ce,hV as is,hW as ls,e5 as os,hX as cs,bc as ce,hY as ds,hZ as us,h_ as Ee,h$ as De,i0 as _e,dh as Fe,V as _,W as ae,i1 as ms,g9 as hs,i2 as xs,eP as Be,S as w,gu as T,b8 as de,i3 as ps,c as Y,i4 as js,dE as gs,dG as fs,dF as vs,i5 as X,i6 as Ns,az as ys,u as Le,gw as Re,i7 as bs,aR as Cs,i8 as ks,i9 as ws,gs as As,aC as ke,aB as Ps,aH as Ss,b4 as $s,al as F,eH as Ke,b9 as Oe,b5 as Es,i as Ds}from"./index-DdBTTN3y.js";import{C as _s,A as Fs}from"./connect-menu-C-B-1xGR.js";import{C as Bs,A as Ie,a as Ue}from"./connections-browser-V-3td9DB.js";import{C as ne}from"./connector-page-shell-Cs1SjrYB.js";import{C as Ls}from"./connector-provenance-aJFeeRIC.js";import{R as Rs}from"./run-activity-link-CaIBSRQj.js";import"./connection-label-BobuYiAG.js";import"./status-dot-Cpq63I7p.js";function Ks({ownerSlug:s,familyKind:t,familyId:n}){const a=t==="inference",l=Ae({enabled:a}),d=Pe({enabled:a}),h=Se({enabled:!a}),c=a?l:h,o=a?d.data?.find(r=>r.slug===n)?.displayName??n:le(n),p=(a?(l.data??[]).filter(r=>r.kind===n).map(r=>({key:`${ee}${r.slug}`,name:r.displayName||r.slug,status:[r.isDefault?"Default":null,r.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(r=>r.providerKind===n).map(r=>({key:`${qe}${r.id}`,name:r.name,status:r.connected?"Connected":"Needs credentials"}))).map(r=>({id:r.key,name:r.name,description:r.status,tone:null,link:Ge({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:r.key},search:{}})})),m=`${a?ee:oe}${n}`;return e.jsx(ne,{header:e.jsx(se,{title:o,breadcrumb:e.jsx(te,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors")]})}),children:e.jsx(Bs,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:a?e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(Ie,{ownerSlug:s,connectorKey:m})})})}function Os({catalog:s,initialProvider:t,initialSlug:n,allowOAuth:a=!0,initialModel:l,onDone:d}){const h=Qe(),c=Ze(),o=s.find(i=>i.slug===t)??s[0],p=a&&o&&J(o)?"oauth":"api-key",[m,r]=u.useState(o?.slug??""),[f,b]=u.useState(n??o?.slug??""),[x,N]=u.useState(o?.displayName??""),[v,A]=u.useState(o?.baseUrl??""),[D,P]=u.useState(l??o?.defaultModel??""),[E,V]=u.useState(""),[q,K]=u.useState(o?.apiKeyPlaceholder??""),[W,O]=u.useState(p),[L,G]=u.useState(""),[C,re]=u.useState(null),[I,R]=u.useState(!1),[ue,me]=u.useState(!1),g=s.find(i=>i.slug===m),Q=Ne(g?.modalities??[]),he=a&&!!g&&J(g),xe=g?$e(g):!1,pe=he&&W==="oauth",je=xe&&!pe,S=Je().slug,Z=u.useCallback(()=>{me(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Me=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),Te=u.useCallback(async()=>{if(!(!S||!g)){R(!0);try{const i=await ye(S,g.slug);if(i.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(i.authorizeUrl,"_blank","noreferrer")}catch(i){U.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[S,g]),ze=u.useCallback(async()=>{if(!(!S||!g||!L.trim())){R(!0);try{const i=await be(S,g.slug,{code:L.trim()});if(i.status!=="success")throw new Error(i.error||"Sign-in not complete");Z(),U.success(`Signed in with ${g.displayName}`)}catch(i){U.error(i instanceof Error?i.message:"Failed to complete sign-in")}finally{R(!1)}}},[S,g,L,Z]),Ve=u.useCallback(async()=>{if(!(!S||!g)){R(!0);try{const i=await ye(S,g.slug);if(i.mode!=="device")throw new Error("Unexpected sign-in mode");re({userCode:i.userCode,deviceAuthId:i.deviceAuthId,verificationUrl:i.verificationUrl}),window.open(i.verificationUrl,"_blank","noreferrer")}catch(i){U.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[S,g]),We=u.useCallback(async()=>{if(!(!S||!g||!C)){R(!0);try{const i=await be(S,g.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(i.status==="success"){Z(),U.success(`Signed in with ${g.displayName}`);return}re(y=>y&&{...y,message:i.error||"Waiting for approval..."})}catch(i){U.error(i instanceof Error?i.message:"Failed to check status")}finally{R(!1)}}},[S,g,C,Z]),He=g?.supportedAuthTypes.includes("device-code")??!1,Xe=i=>{r(i);const y=s.find(ie=>ie.slug===i);y&&(b(y.slug),N(y.displayName),A(y.baseUrl),P(y.slug===t&&l?l:y.defaultModel??""),K(y.apiKeyPlaceholder),O(a&&J(y)?"oauth":"api-key"),G(""),re(null),me(!1))},ge=/^[a-z0-9][a-z0-9-]*$/.test(f),fe=ge&&je&&E.trim().length>0&&!h.isPending,Ye=i=>{if(i.preventDefault(),!fe)return;const y={};v.trim()&&(y.base_url=v.trim()),D.trim()&&(y.model=D.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;h.mutate({slug:f.trim(),kind:m,displayName:x.trim()||void 0,apiKey:E.trim(),capabilities:ie},{onSuccess:()=>d()})},ve=!!(t&&s.some(i=>i.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ve&&g?`Connect ${g.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Ye,className:"grid max-w-md gap-3",children:[ve&&g?e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(es,{value:m,onValueChange:Xe,children:[e.jsx(ss,{id:"ip-provider",className:"w-full",children:e.jsx(ts,{})}),e.jsx(as,{children:s.map(i=>{const y=Ne(i.modalities);return e.jsx(ns,{value:i.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[i.iconUrl?e.jsx("img",{src:i.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(rs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},i.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx($,{id:"ip-display",placeholder:"Friendly name",value:x,onChange:i=>N(i.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx($,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:i=>b(i.target.value),autoComplete:"off",required:!0}),f&&!ge?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(j,{type:"button",size:"sm",variant:W==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(j,{type:"button",size:"sm",variant:W==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,je?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx($,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:i=>A(i.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx($,{id:"ip-model",placeholder:"gpt-4o-mini",value:D,onChange:i=>P(i.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx($,{id:"ip-key",type:"password",placeholder:q||void 0,value:E,onChange:i=>V(i.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(H,{onCancel:d,children:e.jsx(j,{type:"submit",disabled:!fe,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):pe?e.jsxs("div",{className:"grid gap-3",children:[ue?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",g?.displayName??"provider",". This covers your agents in this org."]}):He?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Ve(),disabled:I||!S,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx($,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(j,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",g?.displayName??"provider"," to approve",e.jsx(Ce,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:I,children:I?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Te(),disabled:I||!S,children:["Sign in with ",g?.displayName??"provider",e.jsx(Ce,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx($,{id:"ip-oauth-code",placeholder:"code#state",value:L,onChange:i=>G(i.target.value),autoComplete:"off"})]}),e.jsx(j,{type:"button",className:"justify-self-start",onClick:()=>void ze(),disabled:I||!L.trim(),children:I?"Finishing...":"Finish sign-in"})]}),e.jsx(H,{onCancel:d,children:e.jsx(j,{type:"button",onClick:Me,disabled:!ue,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(H,{onCancel:d})]})]})]})}const Is={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Us({provider:s,catalog:t,autoOpenEdit:n}){const a=is(),[l,d]=u.useState(n?"edit":null),h=ls(s.kind,t);u.useEffect(()=>{n&&d("edit")},[n]);const o=(t.find(r=>r.slug===s.kind)?.modalities??["text"]).filter(r=>r!=="text"),p=h&&o.length>0,m=r=>d(f=>f===r?null:r);return e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:"Credential"}),e.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[s.slug,s.createdAt?` · created ${os(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug}),children:"Set as default"}),p?e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),l==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(Ts,{provider:s,supportsUpstreamConfig:h,onDone:()=>d(null)})}):null,l==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),o.map(r=>e.jsx(zs,{providerSlug:s.slug,modality:r,block:s.capabilities[r]??{}},r))]})}):null]})}function Ms({provider:s,onDeleted:t}){const n=cs(),[a,l]=u.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:a?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>l(!1)}),children:[n.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:n.isPending,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:n.isPending,onClick:()=>l(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function Ts({provider:s,supportsUpstreamConfig:t,onDone:n}){const a=ds(),l=us(),d=Ee(),[h,c]=u.useState(s.displayName??""),[o,p]=u.useState(""),m=s.capabilities.text??{},[r,f]=u.useState(m.base_url??""),[b,x]=u.useState(m.model??""),[N,v]=u.useState(null),A=h.trim().length>0&&h.trim()!==(s.displayName??""),D=t&&o.trim().length>0,P=r.trim()!==(m.base_url??""),E=b.trim()!==(m.model??""),V=t&&(P||E),q={base_url:r.trim()||void 0,model:b.trim()||void 0,models_endpoint:m.models_endpoint},K=De(q),W=t&&V&&_e(K),O=a.isPending||l.isPending||d.isPending,L=(A||D||V)&&!W&&!O,G=async C=>{if(C.preventDefault(),!!L){v(null);try{await Promise.all([A?a.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),V?d.mutateAsync({providerSlug:s.slug,modality:"text",block:q}):Promise.resolve(),D?l.mutateAsync({providerSlug:s.slug,value:o.trim()}):Promise.resolve()]),n()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:G,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx($,{id:`edit-name-${s.slug}`,value:h,onChange:C=>c(C.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx($,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:r,onChange:C=>f(C.target.value),autoComplete:"off"}),K.base_url?e.jsx("p",{className:"text-xs text-destructive",children:K.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx($,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:b,onChange:C=>x(C.target.value),autoComplete:"off"}),K.model?e.jsx("p",{className:"text-xs text-destructive",children:K.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx($,{id:`edit-key-${s.slug}`,type:"password",value:o,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,N?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:N}):null,e.jsx(H,{onCancel:n,children:e.jsx(j,{type:"submit",disabled:!L,children:O?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function zs({providerSlug:s,modality:t,block:n}){const a=Ee(),[l,d]=u.useState(!1),[h,c]=u.useState(n.base_url??""),[o,p]=u.useState(n.model??""),[m,r]=u.useState(n.models_endpoint??""),[f,b]=u.useState(!!n.models_endpoint),x=!!(n.base_url||n.model||n.models_endpoint),N={base_url:h.trim()||void 0,model:o.trim()||void 0,models_endpoint:m.trim()||void 0},v=De(N),A=_e(v),D=()=>{A||a.mutate({providerSlug:s,modality:t,block:N})};return e.jsxs("div",{className:Fe,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(P=>!P),children:[e.jsx("span",{className:"text-sm font-medium",children:Is[t]}),x?e.jsx(_,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),l?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx($,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:h,onChange:P=>c(P.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx($,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:o,onChange:P=>p(P.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx($,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:P=>r(P.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:"Advanced"}),e.jsx(H,{onCancel:()=>d(!1),children:e.jsx(j,{size:"sm",disabled:A||a.isPending,onClick:D,children:a.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function Vs({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Hs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(_,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(_,{className:"h-4 border-transparent bg-emerald-500/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",className:"h-4 border-transparent bg-destructive/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-destructive",children:"No credential"})]}),t.length>0?e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:t.map(([n,a])=>`${n}: ${a}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function Ws({sandbox:s,onDeleted:t}){const n=ms(),[a,l]=u.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"destructive",size:"sm",disabled:n.isPending,onClick:()=>n.mutate({id:s.id},{onSuccess:t}),children:n.isPending?e.jsx(z,{}):"Delete permanently"}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"})]}):e.jsx(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>l(!0),children:"Delete sandbox"})]})})}function Hs({kind:s}){return s==="vercel"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 shrink-0 fill-foreground","aria-hidden":!0,children:[e.jsx("title",{children:"Vercel"}),e.jsx("path",{d:"M12 3 22 20H2L12 3Z"})]}):s==="builtin"?e.jsx(hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(xs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Xs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Ys={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function jt(){const{owner:s,connectorKey:t}=X.useParams(),{instances:n}=X.useSearch(),{kind:a,id:l}=Ns(t);return e.jsx(ys,{owner:s,children:({ownerSlug:d,organizationId:h,isWorkspaceLoading:c})=>{if(n&&(a==="inference"||a==="sandbox-provider"))return e.jsx(Ks,{ownerSlug:d,familyKind:a,familyId:l});switch(a){case"inference":return e.jsx(Qs,{ownerSlug:d,providerSlug:l});case"sandbox":return e.jsx(Gs,{ownerSlug:d,sandboxId:l});case"sandbox-provider":return e.jsx(qs,{ownerSlug:d,providerKind:l});default:return e.jsx(st,{ownerSlug:d,organizationId:h,isWorkspaceLoading:c,connectorKey:t})}}})}function qs({ownerSlug:s,providerKind:t}){const n=Y();return u.useEffect(()=>{n({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${oe}${t}`},replace:!0})},[n,s,t]),null}function Gs({ownerSlug:s,sandboxId:t}){const n=Y(),{data:a,isLoading:l,isError:d,refetch:h}=Se(),c=a?.sandboxes.find(p=>p.id===t)??null;if(l)return e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-24 w-full rounded-lg"})]});if(d)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(j,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!c)return e.jsxs(F,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(j,{variant:"outline",size:"sm",onClick:()=>void n({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const o=c.name||le(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${oe}${c.providerKind}`},search:{instances:!0},className:M,children:le(c.providerKind)},"family")]}),icon:e.jsx(de,{name:o,faviconDomain:Es(c.providerKind)}),title:o,badge:e.jsxs(e.Fragment,{children:[e.jsx(_,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(_,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Oe,{facets:Ys})}),children:[e.jsx(Vs,{sandbox:c}),e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void n({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Qs({ownerSlug:s,providerSlug:t}){const n=Y(),{model:a,reason:l,agentId:d,addAccount:h}=X.useSearch(),{data:c=[],isLoading:o,isError:p,refetch:m}=Ae(),r=Pe(),{data:f=[],isLoading:b}=r,x=h?null:c.find(E=>E.slug===t)??null,N=f.find(E=>E.slug===(x?.kind??t))??null;if(o||b)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-16 w-full rounded-lg"}),e.jsx(w,{className:"h-24 w-full rounded-lg"}),e.jsx(w,{className:"h-32 w-full rounded-lg"})]})});if(p)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(j,{variant:"outline",onClick:()=>void m(),children:"Retry"})]})});if(!x&&!N&&!r.isError)return e.jsxs(F,{className:"space-y-3",children:[e.jsx(Ke,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=x?x.displayName||x.slug:N?.displayName||t,A=x!==null,D=l?e.jsx(et,{agentId:d,model:a,providerName:v}):a?e.jsx(Js,{providerName:v,model:a,isConnected:A}):null,P=e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),...x?[e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${x.kind}`},search:{instances:!0},className:M,children:N?.displayName??x.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:N?.iconUrl,name:v}),title:v,badge:x?e.jsxs(e.Fragment,{children:[x.isDefault?e.jsx(_,{variant:"secondary",children:"Default"}):null,x.status?e.jsx(_,{variant:"outline",children:x.status}):null,x.hasCustomUpstream?e.jsx(_,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Oe,{facets:Xs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:P,children:[D,e.jsx("div",{className:"space-y-6",children:x?e.jsx(Us,{provider:x,catalog:f,autoOpenEdit:!!a}):e.jsx(Zs,{ownerSlug:s,providerSlug:t,existingSlugs:c.map(E=>E.slug),catalog:f,catalogError:r.isError?r.error:null,model:a})}),x?e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ms,{provider:x,onDeleted:()=>void n({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Zs({ownerSlug:s,providerSlug:t,existingSlugs:n,catalog:a,catalogError:l,model:d}){const h=Y(),c=a.find(m=>m.slug===t),o=n.includes(t)&&!!c&&J(c);let p=t;for(let m=2;n.includes(p);m++)p=`${t}-${m}`;return l?e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Failed to load provider catalog."}),e.jsx("p",{className:"mt-1 text-xs",children:l instanceof Error?l.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[o&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${t}`},search:{},children:"Open existing connection"})})]}),(!o||c&&$e(c))&&e.jsx(Os,{catalog:a,initialProvider:t,initialSlug:p,allowOAuth:!o,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${a.length}:${t}`)]})}function Js({providerName:s,model:t,isConnected:n}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review ",e.jsx("strong",{children:s})," for model"," ",e.jsx("strong",{children:t}),"."," ",n?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function et({agentId:s,model:t,providerName:n}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"This agent needs a model provider before it can reply."}),e.jsxs("p",{children:[s?e.jsxs("span",{children:["Agent ",e.jsx("strong",{children:s})," is"," "]}):null,"configured to use ",t?e.jsx("strong",{children:t}):"a model"," ","from ",e.jsx("strong",{children:n}),", but that provider is not ready in this workspace."]}),e.jsx("p",{children:"Connect the provider below, then retry the message."})]})]})})}function st({ownerSlug:s,organizationId:t,isWorkspaceLoading:n,connectorKey:a}){const{data:l=[],isLoading:d,isError:h,refetch:c}=Ps(t??""),{data:o=[],isLoading:p,isError:m,refetch:r}=Ss(t??"",{connectorKey:a}),{setup:f}=X.useSearch(),b=X.useNavigate(),x=u.useMemo(()=>l.find(A=>A.key===a),[l,a]),N=u.useMemo(()=>$s(a,l,{name:o[0]?.connector_name??a}),[a,l,o]);if(n||d)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-16 w-full rounded-lg"}),e.jsx(w,{className:"h-24 w-full rounded-lg"}),e.jsx(w,{className:"h-32 w-full rounded-lg"})]})});if(h||m)return e.jsx(F,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(j,{variant:"outline",onClick:()=>{c(),r()},children:"Retry"})]})});const v=x?e.jsx(at,{connector:x,ownerSlug:s,organizationId:t??void 0,connectionCount:o.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ke,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",o.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:x&&t?e.jsx(tt,{hero:v,connector:x,organizationId:t,ownerSlug:s,connectorKey:a,connections:o,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void b({search:A=>({...A,setup:void 0}),replace:!0})}):e.jsxs(F,{className:"space-y-6",children:[v,o.length>0&&!p?e.jsx(Ue,{section:!0,connections:o,ownerSlug:s,connectorKey:a}):p?e.jsx(w,{className:"h-8 w-40"}):e.jsx("div",{children:e.jsx(Ie,{ownerSlug:s,connectorKey:a})})]})})}function tt({hero:s,connector:t,organizationId:n,ownerSlug:a,connectorKey:l,connections:d,isLoading:h,openNewApp:c,onNewAppHandled:o}){const{isAdmin:p,isLoading:m}=Be(n),r=(t.operations_summary?.total??0)>0,f=e.jsx(_s,{connector:t,organizationId:n,ownerSlug:a,connections:d,openNewApp:c,onNewAppHandled:o});return e.jsxs(ne,{header:s,children:[h?e.jsx(w,{className:"h-8 w-40"}):d.length>0?e.jsx(Ue,{section:!0,connections:d,connector:t,ownerSlug:a,connectorKey:l,action:f}):f,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(lt,{connector:t,organizationId:n,ownerSlug:a}),r&&m?e.jsx(w,{className:"h-20 w-full rounded-lg"}):r&&p?e.jsx(it,{connector:t,organizationId:n,ownerSlug:a}):r&&!p?e.jsx(T,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(nt,{connector:t,organizationId:n,ownerSlug:a})]})}function at({connector:s,ownerSlug:t,organizationId:n,connectionCount:a}){return e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:t},className:M,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??ps(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Ls,{connectorDef:s,ownerSlug:t}),n?e.jsx(rt,{connector:s,organizationId:n,ownerSlug:t,connectionCount:a}):null]}),caption:s.description,meta:e.jsx(Rs,{owner:t,filters:{connectorKey:s.key},name:s.name})})}function nt({connector:s,organizationId:t,ownerSlug:n}){const a=bs(s.auth_schema),l=Cs(s.auth_schema),d=ks(s.auth_schema),h=ws(s.auth_schema),c=a.some(N=>N.type==="env_keys"),o=a.some(N=>N.type==="browser"),p=l.some(N=>N.type==="interactive"),m=!!(d||h||c||o),r=As(s),{data:f=[]}=ke(t,{connectorKey:s.key,profileKind:"env"}),{data:b=[]}=ke(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||o&&b.length>0||!m&&(r||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(we,{profiles:f,type:"env"}):null,o&&b.length>0?e.jsx(we,{profiles:b,type:"browser_session"}):null,m?null:r?e.jsx(T,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors",params:{owner:n},search:{},children:"View devices"})})]})}):p?e.jsx(T,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:n,connectionCount:a}){const l=Y(),{isAdmin:d}=Be(t),h=js(),[c,o]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=a>0,r=h.isPending,f=()=>{o(null),h.mutate({connector_key:s.key},{onSuccess:()=>{l({to:"/$owner/connectors",params:{owner:n}})},onError:b=>{o(b instanceof Error?b.message:"Failed to remove connector")}})};return e.jsxs(gs,{onOpenChange:()=>o(null),children:[e.jsx(fs,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(vs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),m?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[a," connection",a===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(j,{variant:"destructive",size:"sm",disabled:r||m,onClick:f,children:[r?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function it({connector:s,organizationId:t,ownerSlug:n}){const a=Le();return e.jsx(Re,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>a?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:n}})})}function we({profiles:s,type:t}){const n=t==="env"?"Credentials":"Browser sessions";return e.jsx(T,{title:n,children:e.jsx("div",{className:"space-y-2",children:s.map(a=>e.jsxs("div",{className:Ds(Fe,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:a.display_name}),e.jsx(Fs,{status:a.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]},a.slug))})})}function lt({connector:s,organizationId:t,ownerSlug:n}){const a=Le(),l=Object.keys(s.feeds_schema??{}).length;return l?e.jsx(Re,{title:"Feeds",summary:`${l} ${l===1?"feed type":"feed types"}`,onOpen:()=>a?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:n}})}):null}export{tt as ConnectorDetailShell,at as ConnectorHero,rt as ConnectorRemoveButton,jt as component};
2
- //# sourceMappingURL=_connectorKey.index-n3iSDT74.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,cA as A,i as c,ji as p,jj as h,jk as d,jl as u,jm as w,r as M,at as k,aH as C,jn as z}from"./index-DdBTTN3y.js";import{A as N}from"./agent-loading-shells-ClY_O6lb.js";import{s as b,R as y,A as O}from"./agent-thread-WNk2HapT.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-sml8Uf6e.js";import"./use-mention-search-dn3ws1WB.js";import"./index-Vcq4gwWv.js";import"./use-automations-BLNjxq2K.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./connection-label-BobuYiAG.js";import"./events-feed-B9CZHI_P.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";const T={discord:{hex:`#${u.hex}`,path:u.path},gchat:{hex:`#${d.hex}`,path:d.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${h.hex}`,path:h.path},whatsapp:{hex:`#${p.hex}`,path:p.path}};function I({platform:r,className:a}){const t=r?T[r]:null;return t?"imgSrc"in t?e.jsx("img",{src:t.imgSrc,alt:"","aria-hidden":"true",className:c("rounded-sm",a),loading:"lazy"}):e.jsx("svg",{viewBox:t.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:a,style:{color:t.hex},children:e.jsx("path",{d:t.path})}):e.jsx(A,{className:c("text-muted-foreground",a),"aria-hidden":"true"})}const L={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(r,a,t){return r==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function S({owner:r,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=w(a,t,{orgSlug:r}),i=M.useMemo(()=>n.map(o=>b(o,{showToolCalls:!0})).filter(o=>o!==null),[n]),[s,g]=t.split(":"),m=L[s]??"the source app",{org:f}=k(),{data:j=[]}=C(f?.id??"",{connectorKey:s}),v=j[0]?.config?.chatMetadata,l=R(s,g,v);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:x?e.jsx(N,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(y,{messages:i,children:e.jsx(O,{readOnly:!0})}),l?e.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm transition-colors hover:bg-muted",children:[e.jsx(I,{platform:s,className:"size-5 shrink-0"}),e.jsxs("span",{className:"text-muted-foreground",children:["This is a read-only copy. Continue the conversation with this agent in ",m,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",m," →"]})]}):null]})})}function i2(){const{owner:r,agentId:a,conversationId:t}=z.useParams();return e.jsx(S,{owner:r,agentId:a,conversationId:t})}export{i2 as component};
2
- //# sourceMappingURL=_conversationId-B1yGIGA9.js.map
@@ -1,2 +0,0 @@
1
- import{E as u,c as v,j as a,ak as d,az as f,cg as h,ch as x,ci as j,bk as w,cj as P}from"./index-DdBTTN3y.js";import{E as g}from"./event-detail-DkY95e5b.js";import"./events-feed-B9CZHI_P.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./connection-label-BobuYiAG.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./filter-bar-wPaR12SS.js";function E({owner:e,eventId:t,viewKey:s}){const o=u({strict:!1}),p=v(),m=(i,r)=>a.jsx(g,{owner:r,organizationId:i,eventId:t,viewKey:s,params:s?x(o):{},onParamsChange:(n,c,l)=>void p({to:h(r,t,n),search:c,replace:l?.replace??!0}),fullBleed:!0},`${r}/${t}`);return a.jsx(d,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):a.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:r})=>i?m(i,r):a.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function S(){const{owner:e,eventId:t}=j.useParams(),s=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=P(t);return o===null?null:a.jsx(E,{owner:e,eventId:o,viewKey:s?.viewKey})}export{S as component};
2
- //# sourceMappingURL=_eventId-B1H0-vD7.js.map
@@ -1,2 +0,0 @@
1
- import{jh as a,j as e}from"./index-DdBTTN3y.js";import{b as i}from"./agent-guardrails-route-BJyfalBY.js";import"./model-selector-CgU8SJMF.js";import"./agent-tab-intro-ednTs4WF.js";import"./table-BUqshjxa.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function l(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{l as component};
2
- //# sourceMappingURL=_name-D30_V03t.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-D68BjguQ.js","assets/index-DdBTTN3y.js","assets/index-DdYWarql.css","assets/automation-detail-content-dFy1Huas.js","assets/create-automation-form-PEmSLMD6.js","assets/model-jL871x2J.js","assets/entity-options-daOOQo7O.js","assets/connection-label-BobuYiAG.js","assets/use-automations-BLNjxq2K.js","assets/model-selector-CgU8SJMF.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-DNuRKde1.js","assets/json-diff-BaLL4Fsu.js","assets/index-Vcq4gwWv.js","assets/use-mention-search-dn3ws1WB.js","assets/proposal-review-shell-D6KABxah.js","assets/runs-fFJ1lPnw.js","assets/events-feed-B9CZHI_P.js","assets/event-card-DVUB8my6.js","assets/run-initiator-BvzQJYW9.js","assets/clients-BJRcMk1A.js","assets/renderer-DXfJaCCa.js","assets/calendar-Ck0yOLYu.js","assets/table-BUqshjxa.js","assets/card-Bdi7VEwo.js","assets/change-summary-PBoM6Asb.js","assets/copy-button-DjMWgrBf.js","assets/agent-list-row-rF5LH-3k.js","assets/client-rows-36VnmgMK.js","assets/automation-row-DCHM--aD.js","assets/client-activity-scopes-CXOWB5co.js","assets/use-scroll-sentinel-DRyBMueA.js","assets/agent-loading-shells-ClY_O6lb.js","assets/agent-thread-WNk2HapT.js","assets/app-bridge-C4nPtae3.js","assets/pending-seed-sml8Uf6e.js","assets/connection-feed-detail-BIlkK0Pd.js","assets/runs-table-XGnxJl7S.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-C-B-1xGR.js","assets/connections-browser-V-3td9DB.js","assets/status-dot-Cpq63I7p.js","assets/connector-scope-lists--vNdbOn0.js","assets/source-record-panels-Bh0n4gGw.js","assets/schema-type-editor-panel-C0_9VcSs.js","assets/entity-type-page-BLwH6qa7.js","assets/event-detail-DkY95e5b.js","assets/view-param-filters-CER47Tlz.js","assets/filter-bar-wPaR12SS.js","assets/views-access-required-C_b9itZ2.js","assets/record-session-R-uHNuby.js","assets/runs-panel-DEnZHTa5.js","assets/manage-gear-D8LMhehh.js"])))=>i.map(i=>d[i]);
2
- import{p as m,j as e,r as h,C as j,L as y,u as v,a as b,b as N,c as P,d as R,D as I,e as _,f as D,g as A,h as E,i as w,k as S,l as C,B as p,m as L,A as O,X as T,n as z,_ as K,S as x,R as $,o as B,q as W,s as H,t as V,N as q,O as F}from"./index-DdBTTN3y.js";import{R as G}from"./record-session-R-uHNuby.js";function k({item:t}){const n=t.href?m(t.href):null;if(!n)return null;const s=n.owner,i=n.kind==="automation"?n.automationId:t.sourceAttribution?.automation_id??null,o=t.sourceAttribution,r=[{label:s,to:"/$owner",params:{owner:s}}];return o?.agent_id&&o.agent_name&&r.push({label:o.agent_name,to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:o.agent_id}}),i!=null&&r.push({label:o?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:s,automationId:String(i)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?r.push({label:"Run details"}):n.kind==="event"?r.push({label:"Event details"}):n.kind==="memory"&&"contentIds"in n&&r.push({label:"Details"}),r.length<2?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:r.map((a,l)=>{const c=l===r.length-1,f=e.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:a.label});return e.jsxs(h.Fragment,{children:[l>0?e.jsx(j,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,a.to&&!c?e.jsx(y,{to:a.to,params:a.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:a.label}):f]},a.to??a.label)})})}const M=z(async()=>({default:(await K(async()=>{const{PeekPaneContent:t}=await import("./peek-pane-content-D68BjguQ.js");return{PeekPaneContent:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]))).PeekPaneContent}));function Q(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(x,{className:"h-5 w-2/3"}),e.jsx(x,{className:"h-4 w-full"}),e.jsx(x,{className:"h-24 w-full rounded-lg"})]})}const U=460,X=480;function J({children:t}){const n=h.useRef(null),s=v(),i=b(),o=N(n,U+X),r=!i&&o&&s?.item!=null;return e.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{inert:r,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:t}),e.jsx(Y,{covers:r})]})}function Y({covers:t=!1}){const n=v(),s=b();return n?.item?e.jsx(ee,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:s,covers:t}):null}function Z(t){const n=t.href?m(t.href):null,s=n?.kind==="record-view"?n.viewKey:null,i=n?.kind==="entity-type"?n:null,o=i?.typeSlug??null,r=S({slug:s?n?.owner:void 0}),{data:a}=C(o?n?.owner??null:null),l=o?a?.find(c=>c.slug===o)?.name:void 0;return s&&r.data?.find(c=>c.key===s)?.name||l&&(i?.view==="activity"?`${l} activity`:l)||t.title}function ee({item:t,onClose:n,onBack:s,isNarrow:i,covers:o}){const r=P(),a=t.href?m(t.href):null,l=t.runId&&a?.kind==="automation"&&a.view==="activity"?{pathname:`/${a.owner}/events`,search:{run_ids:String(t.runId)}}:t.href?R(t.href):null,c=Z(t);h.useEffect(()=>{if(i)return;const d=u=>{u.defaultPrevented||u.key!=="Escape"||(u.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,i]);const f=d=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[s||d?e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:s??n,children:e.jsx(L,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:c}),l?e.jsx(p,{type:"button",variant:"ghost",size:a?.kind==="runs"?"sm":"icon",className:w("h-7 shrink-0 text-muted-foreground hover:text-foreground",a?.kind==="runs"?"gap-1 px-2 text-xs":"w-7"),"aria-label":a?.kind==="runs"?"Open in Activity":"Open full page",asChild:!0,children:e.jsxs(y,{to:l.pathname,search:l.search??{},onClick:u=>{u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||(u.preventDefault(),(async()=>(await n(),await r({to:l.pathname,search:l.search??{}})))())},children:[a?.kind==="runs"?"Open in Activity":null,e.jsx(O,{className:"h-4 w-4"})]})}):null,e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:e.jsx(T,{className:"h-4 w-4"})})]}),g=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(h.Suspense,{fallback:e.jsx(Q,{}),children:e.jsx(M,{item:t})})});return i?e.jsx(I,{open:!0,onOpenChange:d=>{d||n()},children:e.jsxs(_,{children:[e.jsx(D,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(A,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(E,{className:"sr-only",children:c}),f(!0),e.jsx(k,{item:t}),g]})]})}):e.jsxs("aside",{className:w("flex flex-col border-l border-border bg-background",o?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),e.jsx(k,{item:t}),g]})}function ae(){const{owner:t}=$.useParams(),{data:n,isLoading:s,error:i}=B(t==="me"?null:t,{slug:t}),{session:o,isReady:r}=W();return H({active:V({settled:!s,authReady:r,session:o,resolved:!!n?.workspace,error:i}),owner:t})?null:e.jsx(q,{children:e.jsx(G,{children:e.jsx(J,{children:e.jsx(F,{})})})})}export{ae as component};
3
- //# sourceMappingURL=_owner-Be8O41u8.js.map
@@ -1,2 +0,0 @@
1
- import{j5 as p,j as m,bj as i}from"./index-DdBTTN3y.js";import{M as e}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function D(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{D as component};
2
- //# sourceMappingURL=_shape-C6YbloRh.js.map
@@ -1,2 +0,0 @@
1
- import{jf as e,j as i}from"./index-DdBTTN3y.js";import{b as m}from"./agent-skills-route-Bv5luNdw.js";import"./agent-skill-context-BAaGpvfS.js";import"./core.esm-CQzL3ObT.js";import"./skill-editor-D_W3QlRz.js";import"./agent-tab-intro-ednTs4WF.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function j(){const{owner:t,agentId:o,skillKey:r}=e.useParams();return i.jsx(m,{owner:t,agentId:o,skillKey:r})}export{j as component};
2
- //# sourceMappingURL=_skillKey-BMPvvoOI.js.map
@@ -1,2 +0,0 @@
1
- import{gQ as l,v as y,c as d,gf as g,fw as u,j as t,ak as c,al as x,bO as f}from"./index-DdBTTN3y.js";import{E}from"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";function C(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=y(),o=d(),{data:i=[],isLoading:r}=g(s),e=i.find(m=>m.slug===n)??null,p=e?u(e):!1;return t.jsx(c,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(x,{children:r?t.jsx(f,{label:"entity type",variant:"panel"}):e?t.jsx(E,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{C as component};
2
- //# sourceMappingURL=_slug-Bc4YIEA2.js.map
@@ -1,2 +0,0 @@
1
- import{bH as t,bI as p,j as e}from"./index-DdBTTN3y.js";import{A as s,h as a}from"./activity-route-view-DN0ZEAzr.js";import"./record-activity-C9gVBbF0.js";import"./filter-bar-wPaR12SS.js";import"./calendar-Ck0yOLYu.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-D8LMhehh.js";import"./runs-fFJ1lPnw.js";import"./source-record-panels-Bh0n4gGw.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./events-feed-B9CZHI_P.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./agent-loading-shells-ClY_O6lb.js";import"./member-scope-gate-4FQ0aanZ.js";import"./runs-panel-DEnZHTa5.js";import"./runs-table-XGnxJl7S.js";import"./nav-pill-DrFkuyUQ.js";import"./public-shell-ready-BIVCHQHe.js";function M(){const{owner:r,view:i}=t.useParams(),m=t.useSearch(),o=a(i);if(!o)throw p();return e.jsx(s,{owner:r,search:m,homeView:o})}export{M as component};
2
- //# sourceMappingURL=_view-aoFDwEld.js.map
@@ -1,2 +0,0 @@
1
- import{jo as p,j as i,bj as m}from"./index-DdBTTN3y.js";import{M as e}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function A(){const{owner:o,entityType:t,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:o,typeScope:m(t),create:!1,viewKey:r})}export{A as component};
2
- //# sourceMappingURL=_viewKey-DuNHc3cc.js.map
@@ -1,2 +0,0 @@
1
- import{jc as t,j as m}from"./index-DdBTTN3y.js";import{M as i}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function q(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{q as component};
2
- //# sourceMappingURL=_viewKey-rJ7A1zNx.js.map
@@ -1,2 +0,0 @@
1
- import{v as rt,at as Z,ck as K,bj as O,cl as Q,r as v,c as B,aq as ut,cm as dt,j as o,bO as X,b2 as M,cn as mt,co as V,cp as pt,cq as tt,B as T,L as j,cr as nt,cs as ft,ct as gt,cu as xt,cv as F,bb as ht,cw as vt,cx as bt,cy as et,cz as jt,cA as at,cB as ot,cC as st,cD as yt,aH as kt,cE as _t,cF as Nt,cG as At,cH as it,cI as It,i as $t,u as Rt,cJ as St,cK as Et,d as ct,cL as Ct,cM as Lt,cN as Tt,w as Mt,ak as Ft,az as Ot,al as Pt}from"./index-DdBTTN3y.js";import{R as Ht,E as Kt,S as Bt,N as U,M as Wt}from"./record-activity-C9gVBbF0.js";import{M as wt}from"./member-scope-gate-4FQ0aanZ.js";import{o as P,F as Dt}from"./filter-bar-wPaR12SS.js";import{W as Ut}from"./runs-panel-DEnZHTa5.js";import{u as zt}from"./client-activity-scopes-CXOWB5co.js";import{n as Gt}from"./nav-pill-DrFkuyUQ.js";import{c as qt}from"./client-rows-36VnmgMK.js";import{P as Yt}from"./public-shell-ready-BIVCHQHe.js";function Jt({organizationId:n,ownerSlug:t,typeScope:e,entityScope:a,attentionOnly:i=!1}){const{orgContext:r}=rt(),{isMember:c,isLoading:d}=Z(),p=c&&!!n,{attentionItems:s,isError:u}=K(t),g=e?O(e):void 0,m=!a&&!g,{feeds:l,rows:h,pageRows:f}=Q(n,s),y=v.useMemo(()=>new Set(f.flatMap(({item:D})=>D.approvalRunId!=null?[D.approvalRunId]:[])),[f]),b=B(),_=()=>void b({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:k,isLoading:N,error:C}=ut(a?`/${t}/${dt(a)}`:`/${t}`,r),A=a?k?.entity:void 0,L=(a?A?.entity_type??O(a.split("/").at(-2)??""):g)==="$member",$=a!=null&&!N&&(C!=null||k?.entity==null),x=a?void 0:k?.counts,R=x?x.connections>0||x.agents>0:!1,w=p&&!d&&!N&&x!=null&&!R,S=a&&N?o.jsx(X,{label:"Loading record…"}):$?o.jsx(M,{icon:mt,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):i&&m?o.jsx(Zt,{owner:t,items:h,isError:u}):A?o.jsx(Ht,{ownerSlug:t,entity:A,organizationId:n}):o.jsx(Kt,{organizationId:n,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:g?[g]:void 0,pinned:m&&(f.length>0||l.length>0)?{rows:o.jsx(V,{owner:t,organizationId:n,feeds:l,rows:f}),hiddenApprovalRunIds:y}:void 0,onShowNotifications:m?_:void 0,emptyState:w?o.jsx(Xt,{ownerSlug:t}):void 0});return o.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:L?o.jsx(wt,{children:S}):S})}function Zt({owner:n,items:t,isError:e}){const a=B();return o.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[o.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),o.jsx(Qt,{owner:n}),o.jsx(Bt,{value:U.value,withNotifications:!0,onChange:i=>{if(i===U.value)return;const[r,c]=i.split("-");a({to:"/$owner",params:{owner:n},search:pt({sortBy:r,sortOrder:c})})}})]}),e?o.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?o.jsx(M,{icon:tt,title:"All caught up",description:"Nothing needs you right now.",children:o.jsx(T,{asChild:!0,variant:"outline",className:"mt-4",children:o.jsx(j,{to:"/$owner",params:{owner:n},children:"See all activity"})})}):o.jsx(nt,{owner:n,rows:t})]})}function Qt({owner:n}){const{visibleUnreadIds:t,markVisibleRead:e,bulkPending:a}=K(n);return t.length===0?null:o.jsxs(T,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:a,onClick:()=>void e(),children:[o.jsx(tt,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function Xt({ownerSlug:n}){return o.jsx("div",{className:"px-6",children:o.jsx(M,{icon:ft,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:o.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[o.jsx(T,{asChild:!0,children:o.jsxs(j,{to:"/$owner/connectors/create",params:{owner:n},children:[o.jsx(gt,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),o.jsx(T,{asChild:!0,variant:"outline",children:o.jsxs(j,{to:"/$owner/agents",params:{owner:n},children:[o.jsx(xt,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const H={agent:null,connection:null,automation:null,status:null,attentionKind:null};function E(n,t){const e=n[t];return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"&&Number.isFinite(e)?String(e):null}function Vt(n){const t=E(n,"home_status"),e=E(n,"home_kind");return{agent:E(n,"home_agent"),connection:E(n,"home_connection"),automation:E(n,"home_automation"),status:t==="failed"||t==="running"||t==="completed"?t:null,attentionKind:e==="approval"||e==="notification"||e==="draft"?e:null}}function tn(n){return{home_agent:n.agent??void 0,home_connection:n.connection??void 0,home_automation:n.automation??void 0,home_status:n.status??void 0,home_kind:n.attentionKind??void 0}}function nn(n){return Object.values(n).some(t=>t!=null)}function en(n,t){const e=n.card?.status;return e?t==="failed"?F(e):t==="running"?e==="pending"||e==="claimed"||e==="running":e==="completed":!1}function an(n,t){return!(t.agent&&n.source?.agent_id!==t.agent||t.connection&&String(n.source?.connection_id??"")!==t.connection||t.automation&&String(n.source?.automation_id??"")!==t.automation||t.status&&!en(n,t.status))}function on(n,t){const e=n.notification;return t.agent&&e?.agent_id!==t.agent||t.connection&&String(e?.connection_id??"")!==t.connection||t.automation&&String(e?.automation_id??"")!==t.automation?!1:t.attentionKind==="draft"?n.browserUrl!=null:t.attentionKind==="approval"?n.approvalRunId!=null||n.interactionType==="approval"||n.interactionType==="authorization":t.attentionKind==="notification"?n.notification!=null&&n.approvalRunId==null:!0}function sn(n){const t=new Map;for(const e of n){const a=e.source?.agent_id;a&&t.set(a,e.source?.agent_name??a)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function cn(n){const t=new Map;for(const e of n){const a=e.source?.automation_id;a!=null&&t.set(String(a),e.source?.automation_name||e.subjectLabel||`Automation ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function ln(n){return n.map(t=>({value:String(t.id),label:t.display_name||t.connector_key})).sort((t,e)=>t.label.localeCompare(e.label))}function rn(n){const t=new Map;for(const e of n){const a=e.notification?.agent_id;a&&t.set(a,e.notification?.agent_name??a)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function un(n){const t=new Map;for(const e of n){const a=e.notification?.automation_id;a!=null&&t.set(String(a),e.notification?.automation_name??`Automation ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function dn(n){const t=new Map;for(const e of n){const a=e.notification?.connection_id;a!=null&&t.set(String(a),e.notification?.connection_name??`Connection ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}const z=[{value:"failed",label:"Failed"},{value:"running",label:"Running"},{value:"completed",label:"Completed"}],G=[{value:"approval",label:"Approvals"},{value:"notification",label:"Notifications"},{value:"draft",label:"Browser drafts"}];function I(n,t,e,a){return P({searchPlaceholder:`Search ${n.toLowerCase()}...`,emptyText:`No ${n.toLowerCase()} in this view`,options:t,selected:e?[e]:[],onSelect:a})}function mn({view:n,entries:t,attentionItems:e=[],connections:a,filters:i,onChange:r}){const c=n==="attention",d=[],p=c?rn(e):sn(t),s=c?un(e):cn(t),u=c?dn(e):ln(a);c?((()=>{d.push({key:"agent",label:"Agent",editor:I("agents",p,i.agent,l=>r({agent:l}))}),d.push({key:"connection",label:"Connection",editor:I("connections",u,i.connection,l=>r({connection:l}))}),d.push({key:"automation",label:"Automation",editor:I("automations",s,i.automation,l=>r({automation:l}))})})(),d.push({key:"attentionKind",label:"Type",editor:P({searchPlaceholder:"Search types...",options:G,selected:i.attentionKind?[i.attentionKind]:[],onSelect:l=>r({attentionKind:l})})})):((n==="all"||n==="sessions")&&d.push({key:"agent",label:"Agent",editor:I("agents",p,i.agent,l=>r({agent:l}))}),(n==="all"||n==="feeds")&&d.push({key:"connection",label:"Connection",editor:I("connections",u,i.connection,l=>r({connection:l}))}),(n==="all"||n==="automations")&&d.push({key:"automation",label:"Automation",editor:I("automations",s,i.automation,l=>r({automation:l}))}),n!=="sessions"&&d.push({key:"status",label:"Status",editor:P({searchPlaceholder:"Search statuses...",options:z,selected:i.status?[i.status]:[],onSelect:l=>r({status:l})})}));const m=[];if(i.agent&&m.push({id:"agent",label:"Agent",op:"is",value:p.find(l=>l.value===i.agent)?.label??i.agent,onRemove:()=>r({agent:null})}),i.connection){const l=u.find(h=>h.value===i.connection)?.label??i.connection;m.push({id:"connection",label:"Connection",op:"is",value:l,onRemove:()=>r({connection:null})})}return i.automation&&m.push({id:"automation",label:"Automation",op:"is",value:s.find(l=>l.value===i.automation)?.label??i.automation,onRemove:()=>r({automation:null})}),i.status&&!c&&m.push({id:"status",label:"Status",op:"is",value:z.find(l=>l.value===i.status)?.label??i.status,onRemove:()=>r({status:null})}),i.attentionKind&&c&&m.push({id:"attentionKind",label:"Type",op:"is",value:G.find(l=>l.value===i.attentionKind)?.label??i.attentionKind,onRemove:()=>r({attentionKind:null})}),o.jsx(Dt,{label:"Home filters",fields:d,chips:m,onClearAll:()=>r(H)})}const q=12,pn=5e3;function fn(n,t){const e=!!n&&!!t.organizationId&&(t.enabled??!0),a=ht({enabled:e}),{data:i}=a,r=i??[],c=v.useMemo(()=>r.map(l=>l.agentId),[r]),{threads:d,isLoading:p,isError:s}=vt(n,c,{enabled:e&&c.length>0,limit:q}),u=zt({enabled:e,limit:q,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:l=>l?pn:!1}),g=t.organizationId?u.data:void 0;return{items:v.useMemo(()=>[...d.map(l=>({kind:"conversation",at:l.updatedAt,thread:l})),...(g??[]).map(l=>({kind:"mcp",at:l.lastCallAt,conversation:l}))].sort((l,h)=>h.at-l.at),[g,d]),agents:r,isLoading:e&&(a.isLoading||p||u.isLoading),isError:a.isError||s||u.isError}}function gn(n){return n==="all"?"activity":n}function Tn(n){switch(n){case"attention":return"attention";case"activity":return"all";case"sessions":return"sessions";case"feeds":return"feeds";case"runs":return"runs";case"automations":return"automations";default:return null}}function xn(n,t){return t==="attention"?{to:"/$owner",params:{owner:n}}:{to:"/$owner/views/$view",params:{owner:n,view:gn(t)}}}function hn(n,t,e,a=[]){const i=new Map(a.map(s=>[s.id,s])),r=new Map;for(const s of[...t.filter(u=>u.kind==="notification"),...e])r.set(s.notification_id!=null?`n:${s.notification_id}`:s.id,s);const c=new Set([...r.values()].flatMap(s=>s.run_id!=null?[s.run_id]:[])),d=new Map,p=new Set(t.flatMap(s=>s.kind==="automation_due"&&s.run_id!=null?[s.run_id]:[]));for(const s of[...t.filter(u=>u.kind!=="notification"&&(u.kind==="automation_due"||u.run_id==null||!p.has(u.run_id))&&(u.run_id==null||!c.has(u.run_id))),...r.values()])d.set(s.id,s);return[...d.values()].map(s=>{const u=s.connection_id!=null?i.get(s.connection_id):void 0,g={...s,platform:s.platform||u?.connector_key,connection_name:s.connection_name||u?.display_name},m=s.kind==="notification"?"notification":s.kind==="sync"?"feed":s.kind==="automation_run"||s.kind==="automation_due"?"automation":"run",l=m==="automation"&&s.automation_id!=null?`automation:${s.automation_id}`:(m==="feed"||m==="run")&&s.connection_id!=null?`connection:${s.connection_id}`:null;return{id:s.id,at:new Date(s.at).getTime(),title:s.title,detail:s.kind==="run"&&s.status&&!F(s.status)?s.status:s.body||s.status,kind:m,subject:l,subjectLabel:s.automation_name||g.connection_name||s.title,href:m!=="notification"&&s.run_id!=null?m==="automation"&&s.automation_id!=null?`/${n}/automations/${s.automation_id}?view=activity&run_id=${s.run_id}`:`/${n}/events?run_ids=${s.run_id}`:s.href,card:s,source:g}})}function vn(n,t,e){return t.map(a=>{if(a.kind==="mcp"){const s=a.conversation,u=n==="me"||s.organizationId==null?"/me/events":`/${n}/agents/connected/${encodeURIComponent(s.clientId)}/activity`,g=new URLSearchParams({mcp_activity_id:s.activityId});return(n==="me"||s.organizationId==null)&&g.set("client_ids",s.clientId),{id:`client:${s.clientId}:${s.activityId}`,at:a.at,title:qt(s),detail:`${s.clientName||"Connected app"} · ${s.callCount} ${s.callCount===1?"call":"calls"}${s.isLive?" · Active":""}`,href:`${u}?${g}`,kind:"session",subject:`client:${s.clientId}`,subjectLabel:s.clientName||"Connected app",source:{client_id:s.clientId,client_name:s.clientName}}}const i=a.thread,r=e.get(i.agentId)||"Agent",c=i.platform||"web",d=bt(n,i.agentId,i.id),p=c==="web"?Object.entries(d.params).reduce((s,[u,g])=>s.replace(`$${u}`,encodeURIComponent(g)),d.to):`/${n}/agents/${encodeURIComponent(i.agentId)}/conversations/${encodeURIComponent(i.conversationId??i.id)}`;return{id:`thread:${i.agentId}:${i.id}`,at:a.at,title:i.title||"Conversation",detail:`${r} · ${c==="web"?"Chat":c}${i.isRunning?" · Active":""}`,href:p,kind:"session",subject:`agent:${i.agentId}`,subjectLabel:r,source:{agent_id:i.agentId,agent_name:r,platform:c==="web"?null:c}}})}function bn(n){const t=new Map;for(const e of[...n].sort((a,i)=>i.at-a.at||a.id.localeCompare(i.id))){const a=new Date(e.at),i=`${a.getFullYear()}-${a.getMonth()}-${a.getDate()}`,r=e.subject?`${e.kind}:${e.subject}:${i}`:e.id,c=t.get(r)??{key:r,entries:[]};c.entries.push(e),t.set(r,c)}return[...t.values()]}const Y=[{view:"attention",label:"Needs attention",icon:et},{view:"all",label:"Activity",icon:jt},{view:"sessions",label:"Sessions",icon:at},{view:"feeds",label:"Feeds",icon:ot},{view:"runs",label:"Runs",icon:st}];function jn({owner:n,view:t,organizationId:e,filters:a,onFiltersChange:i}){const{isMember:r,isPublic:c,isLoading:d}=Z(n),p=c&&!r&&!d,s=p&&(t==="attention"||t==="sessions")?"all":t,u=p?Y.filter(m=>m.view!=="attention"&&m.view!=="sessions"):Y,g=K(p?null:n);return o.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[o.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap items-center gap-1.5",children:u.map(({view:m,label:l,icon:h})=>{const f=xn(n,m);return o.jsxs(j,{to:f.to,params:f.params,activeOptions:{exact:!0},"aria-current":s===m?"page":void 0,className:Gt(s===m,"h-7 gap-1.5 px-2 text-xs"),children:[o.jsx(h,{"aria-hidden":"true",className:"size-3.5"}),l,m==="attention"&&g.attentionItems.length>0?o.jsx("span",{className:"text-xs tabular-nums",children:g.attentionItems.length}):null]},m)})}),s==="runs"?o.jsx(Ut,{ownerSlug:n}):o.jsx(yn,{owner:n,view:s,visitor:p,organizationId:e,attention:g,filters:a,onFiltersChange:i})]})}function yn({owner:n,view:t,visitor:e,organizationId:a,attention:i,filters:r,onFiltersChange:c}){const[d,p]=v.useState(H),s=c!=null,u=r??d,g=x=>{if(c){c(x);return}p(R=>({...R,...x}))};v.useEffect(()=>{s||p(H)},[t,s]);const{data:m=[]}=yt(a),{data:l=[]}=kt(t==="all"||t==="feeds"||t==="automations"?a:null),h=Q(e?null:a,i.attentionItems),f=nn(u),y=t==="all"&&!f&&(h.feeds.length>0||h.pageRows.length>0),b=fn(n,{organizationId:a,enabled:!e&&(t==="all"||t==="sessions")}),_=_t(t==="attention"||t==="sessions"?null:n,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),k=v.useMemo(()=>{const x=new Map(b.agents.map(S=>[S.agentId,S.name])),R=t==="all"||t==="sessions"?vn(n,b.items,x):[];return[...t==="attention"?[]:hn(n,[..._.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],l),...R]},[n,t,b.agents,b.items,_.data,l,i.attentionCards,i.notificationCards]),N=v.useMemo(()=>new Set(t==="all"?h.pageRows.map(({item:x})=>x.id):[]),[t,h.pageRows]),C=v.useMemo(()=>bn(k.filter(x=>!N.has(x.id)&&an(x,u))),[k,N,u]),A=v.useMemo(()=>h.rows.filter(({item:x})=>on(x,u)),[h.rows,u]),W=a==null||(t==="attention"?i.isLoading:t!=="sessions"&&_.isLoading||(t==="all"||t==="sessions")&&b.isLoading||t==="all"&&i.isLoading),L=t==="attention"?i.isError:t!=="sessions"&&_.isError||(t==="all"||t==="sessions")&&b.isError||t==="all"&&i.isError,$=t==="attention"?A.length===0:C.length===0&&!y;return o.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[o.jsx(mn,{view:t,entries:k,attentionItems:i.attentionItems,connections:l,filters:u,onChange:g}),t==="attention"&&!f?o.jsx(Nt,{owner:n}):null,L?o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,W&&$?o.jsx(X,{label:"activity"}):$?L?null:o.jsx(M,{icon:At,title:t==="attention"?f?"No notifications match":"All caught up":e?"No public activity":"No recent activity",description:t==="attention"?f?"No notifications match these filters. Try another filter.":"Nothing needs you right now.":f?"No activity matches these filters. Try another filter.":e?"Runs on this workspace's public connections show up here.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?o.jsx(nt,{owner:n,rows:A}):o.jsxs(o.Fragment,{children:[y?o.jsx("div",{className:"space-y-1",children:o.jsx(V,{owner:n,organizationId:a,feeds:h.feeds,rows:h.pageRows})}):null,o.jsx("ul",{className:"divide-y divide-border/60",children:C.map(x=>o.jsx("li",{children:o.jsx(kn,{owner:n,group:x,connectorDefinitions:m})},x.key))})]}),!$&&t!=="attention"?o.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[e&&t==="all"?o.jsx(j,{to:"/$owner/data",params:{owner:n},children:"Browse memory"}):null,t==="all"||t==="feeds"?o.jsx(j,{to:"/$owner/connectors",params:{owner:n},children:"Browse feeds"}):null,t==="all"||t==="automations"?o.jsx(j,{to:"/$owner",params:{owner:n},search:{tab:"runs",run_type:"automation"},children:"Automation history"}):null,t==="sessions"?o.jsx(j,{to:"/$owner/agents",params:{owner:n},children:"Browse agents and apps"}):null]}):null]})}function kn({owner:n,group:t,connectorDefinitions:e}){const[a,i]=v.useState(!1),r=v.useId(),c=t.entries[0];if(t.entries.length===1)return o.jsx(J,{owner:n,entry:c,connectorDefinitions:e});const d=t.entries.filter(s=>F(s.card?.status??"")).length,p=c.kind==="session"?"sessions":c.kind==="feed"?"syncs":c.kind==="run"?"operations":"runs";return o.jsxs("div",{children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":r,onClick:()=>i(!a),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[o.jsx(lt,{entry:c,connectorDefinitions:e}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:c.subjectLabel}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",p,d>0?o.jsxs("span",{className:"text-destructive",children:[" · ",d," failed"]}):null,c.kind==="session"?null:` · ${c.detail??""}`]})]}),o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:it(c.at)}),o.jsx(It,{"aria-hidden":!0,className:$t("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",a&&"rotate-180")})]}),o.jsxs("ul",{id:r,hidden:!a,className:"ml-4 border-l pl-3",children:[a?t.entries.map(s=>o.jsx("li",{children:o.jsx(J,{owner:n,entry:s,connectorDefinitions:e})},s.id)):null,a&&c.card?.href?o.jsx("li",{children:o.jsx(_n,{entry:c})}):null]})]})}function _n({entry:n}){const t=ct(n.card?.href??"");return o.jsx(j,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:n.kind==="automation"?"View Automation history":"View connection history"})}function lt({entry:n,connectorDefinitions:t}){const e=n.kind==="session"?at:n.kind==="feed"?ot:n.kind==="automation"?Ct:st;return o.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:o.jsx(Lt,{source:n.source,connectorDefinitions:t,label:n.subjectLabel,fallback:o.jsx(e,{className:"h-4 w-4 text-muted-foreground"})})})}function J({owner:n,entry:t,connectorDefinitions:e}){const a=Rt();if(t.kind==="notification"&&t.card)return o.jsx(St,{owner:n,item:Et({...t.card,...t.source})});const i=o.jsxs(o.Fragment,{children:[o.jsx(lt,{entry:t,connectorDefinitions:e}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[F(t.card?.status??"")?o.jsx(et,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,o.jsx("span",{className:"truncate",children:t.detail})]})]}),o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:it(t.at)})]}),r="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return o.jsx("div",{className:r,children:i});const c=ct(t.href);return o.jsx(j,{to:c.pathname,search:c.search,className:r,onClick:d=>{!a||!t.card||t.kind==="session"||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||d.button!==0||(d.preventDefault(),a.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:n,sourceAttribution:t.source??t.card}))},children:i})}function Mn({owner:n,search:t,entityScope:e,home:a=!1,homeView:i}){const r=typeof t.type=="string"&&t.type.trim()?O(t.type.trim()):void 0,c=typeof t.tab=="string"?t.tab:void 0,p=i??(a?c==="sessions"||c==="feeds"||c==="runs"?c:c==="automations"?"runs":"attention":null),s=String(t.attention)==="1",u=Object.entries(t).some(([f,y])=>(Tt.includes(f)||f.startsWith("clf_"))&&y!=null&&y!==""),g=B(),{pathname:m}=Mt(),l=Vt(t),h=f=>{const y={...l,...f};g({to:m,search:(b=>({...b,...tn(y)})),replace:!0})};return o.jsxs(Ft,{className:"gap-6 pt-2.5 pb-8",children:[o.jsx(Yt,{}),o.jsx(Ot,{owner:n,children:f=>o.jsx(Wt,{organizationId:f.organizationId,isWorkspaceLoading:f.isWorkspaceLoading,children:o.jsx(Pt,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:p!=null&&(!u||p==="runs")&&!r&&!e?o.jsx(jn,{owner:f.ownerSlug,organizationId:f.organizationId,view:p,filters:l,onFiltersChange:h}):o.jsx(Jt,{organizationId:f.organizationId,ownerSlug:f.ownerSlug,typeScope:r,entityScope:e,attentionOnly:s})})})})]})}export{Mn as A,Tn as h};
2
- //# sourceMappingURL=activity-route-view-DN0ZEAzr.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,fC as i,C as l,i as c}from"./index-DdBTTN3y.js";function x({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{x as A};
2
- //# sourceMappingURL=agent-card-controls-C5jNWgfq.js.map
@@ -1,2 +0,0 @@
1
- import{aD as ye,aE as Ne,j as e,B as j,db as Ce,fi as Se,bc as Me,i as Ae,fa as ke,cU as Y,Y as K,d6 as Ie,hC as Pe,hD as Fe,hE as Te,hF as De,gZ as Ee,hG as Re,c2 as _e,c3 as $e,aF as Le,r as Z,bt as $,fL as J,c7 as Be,H as b,eS as L,I as z,$ as Ue,bl as Oe,bm as ze,bn as Ge,bo as Ve,bp as Q}from"./index-DdBTTN3y.js";import{b as qe,s as He}from"./model-selector-CgU8SJMF.js";function We(a){const t=a.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(t?/^[a-z]/.test(t)&&t.length>=3?t:`agent-${t}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function Xe(a,t){const r=new Set(t),x=We(a);let v=x,u=2;for(;r.has(v);){const g=`-${u}`;v=`${x.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return v}const Ye="__unresolved__";function ee(a){return a.endsWith(`/${Ye}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Ke(a,t){const{slug:r,model:x}=se(a);return{provider:t.find(g=>g.value===a)?.provider??t.find(g=>se(g.value).slug===r)?.provider??r,model:x}}function Ze({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=qe(x,v),g=(s,c)=>{const l=s+c;if(l<0||l>=a.length)return;const m=[...a];[m[s],m[l]]=[m[l],m[s]],t(m)},k=s=>{t(a.filter((c,l)=>l!==s))},I=s=>{a.includes(s)||t([...a,s])},o=u.filter(s=>!a.includes(s.value)&&!ee(s.value));return e.jsxs("div",{className:"grid gap-2",children:[a.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:a.map((s,c)=>{const l=ee(s),{provider:m,model:i}=Ke(s,u);return e.jsxs("li",{className:Ae("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",l&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:m}),c===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:l?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:r||c===0,onClick:()=>g(c,-1),children:e.jsx(Ce,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:r||c===a.length-1,onClick:()=>g(c,1),children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:r,onClick:()=>k(c),children:e.jsx(Me,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ke,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(j,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:r,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(Ie,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,c)=>{const l=c.trim(),m=He(l,u)&&!a.includes(l);return e.jsxs(e.Fragment,{children:[o.map(i=>e.jsxs(Y,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),m?e.jsxs(Y,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:l})]})]}):null]})}})]})}const Je=3,Qe=72,es=2e3;function te(a){return Array.from({length:Je},(t,r)=>a?.[r]??{title:"",message:""})}function ae(a){return a.map(({title:t,message:r})=>({title:t.trim(),message:r.trim()})).filter(({title:t,message:r})=>t&&r)}function ns({mode:a,section:t="identity",existingAgentIds:r=[],onCreated:x,onCancel:v,onDone:u,reviewMode:g="none",reviewProposal:k=null,reviewControlsDisabled:I=!1}){const o=a.kind==="create",s=a.kind==="edit"?a.agent:null,c=!o&&t!=="platforms"&&t!=="skills"&&!!s,l=Pe(),m=Fe(s?.agentId??""),i=Te(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:G}=Ee(s?.agentId,{enabled:c}),V=!o&&g==="active"?k:null,B=V?Re(V.proposal):void 0,N=p,q=s?.agentId??"create",d=_e(q,{name:B?.name??s?.name??"",description:B?.description??s?.description??"",identityMd:B?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:N?.models??N?.settings?.models??[],showToolCalls:N?.showToolCalls??N?.settings?.showToolCalls??!1,sandboxId:N?.sandboxId??N?.settings?.sandboxId??"builtin",starters:te(p?.starters)}),[w,ne]=d.field("name"),[C,le]=d.field("description"),[F,re]=d.field("identityMd"),[T,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[E,oe]=d.field("models"),[R,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,H]=d.field("starters"),[ue,_]=$e(q,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=Z.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:Xe(w,r),name:w.trim(),description:C.trim()||void 0});x?await x(h.agentId):u?.();return}if(s){if(!p){$.error("Still loading agent settings — try again in a moment");return}if(y.some(({title:h,message:M})=>!!h.trim()!=!!M.trim())){$.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([m.mutateAsync({name:w.trim()||s.name,description:C.trim()||void 0}),P.mutateAsync({identityMd:F.trim(),soulMd:T.trim(),userMd:D.trim(),models:E,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:R,sandboxId:S==="builtin"?void 0:S,starters:ae(y)})]),d.accept(d.values,{name:w.trim()||s.name,description:C.trim()||s.description||"",identityMd:F.trim(),soulMd:T.trim(),userMd:D.trim(),models:E,showToolCalls:R,sandboxId:S,starters:te(ae(y))}),$.success("Agent saved"),u?.()}catch(h){$.error(h instanceof Error?h.message:"Failed to save agent")}}}},[p,l,C,d.accept,d.values,d.canSubmit,S,r,F,o,E,w,x,u,s,R,T,y,m,P,D]),xe=Z.useCallback(async()=>{s&&(await i.mutateAsync(),_(!1),u?.())},[i,u,s,_]),U=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&G)return e.jsx(J,{rows:6});const f=U||I,fe=g==="none"||g==="gone",ve=w.trim().length>0&&pe,be=o||t==="settings",je=!o&&(t==="identity"||t==="settings"),we=!o&&t==="settings",W=!o&&t==="settings",X=!o&&t==="models";return e.jsxs("form",{onSubmit:he,className:"flex min-h-0 flex-col",children:[e.jsx(Be,{visible:d.hasConflict,onReload:d.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[je?G?e.jsx(J,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx(L,{id:"identity-md",rows:6,value:F,onChange:n=>re(n.target.value),disabled:f,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx(L,{id:"soul-md",rows:6,value:T,onChange:n=>ie(n.target.value),disabled:f,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx(L,{id:"user-md",rows:6,value:D,onChange:n=>de(n.target.value),disabled:f,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,be?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(z,{id:"agent-name",placeholder:"Support Bot",value:w,onChange:n=>ne(n.target.value),disabled:f,required:!0}),o?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),o?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx(L,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:C,onChange:n=>le(n.target.value),disabled:f,rows:3})]})]}):null,W?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(Ue,{id:"show-tool-calls",checked:R,onCheckedChange:n=>ce(n===!0),disabled:f,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Conversation starters"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to three prompts offered on a new chat, on the web and in Slack. The message is sent as the user when tapped."}),y.map((n,h)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[12rem_1fr]",children:[e.jsx(z,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Qe,value:n.title,onChange:M=>H(y.map((A,O)=>O===h?{...A,title:M.target.value}:A)),disabled:f}),e.jsx(z,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:M=>H(y.map((A,O)=>O===h?{...A,message:M.target.value}:A)),disabled:f})]},h))]}):null,X?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Ze,{value:E,onChange:oe,disabled:f}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,X?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Oe,{value:S,onValueChange:me,disabled:f,children:[e.jsx(ze,{id:"agent-sandbox",className:"w-full",children:e.jsx(Ge,{placeholder:"Built-in"})}),e.jsxs(Ve,{children:[e.jsx(Q,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Q,{value:n.id,children:[n.name," (",n.providerKind,")",n.connected?"":" — no credential"]},n.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),fe?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[we?ue?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(j,{type:"button",variant:"destructive",onClick:()=>void xe(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>_(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v?e.jsx(j,{type:"button",variant:"outline",onClick:v,disabled:U,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||U,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
2
- //# sourceMappingURL=agent-editor-form-CdA5vLr8.js.map
@@ -1,2 +0,0 @@
1
- import{r as y,j as e,H as w,I as k,bl as K,bm as X,bn as Y,bo as ee,bp as ae,eS as te,B as S,c as P,gZ as G,ja as L,jb as U,hF as B,fL as se,bt as j,h2 as I,bO as ne,b_ as re,b2 as D,h4 as ie,V as oe,iH as le,bQ as q,d6 as de,i as E,j8 as ue}from"./index-DdBTTN3y.js";import{M as ce}from"./model-selector-CgU8SJMF.js";import{b as me,a as ge,A as J}from"./agent-tab-intro-ednTs4WF.js";import{T as he,a as pe,b as O,c as R,d as xe,e as $}from"./table-BUqshjxa.js";import{f as be}from"./agent-loading-shells-ClY_O6lb.js";import{A as je}from"./agent-card-controls-C5jNWgfq.js";const fe=[{value:"input",label:"Input",hint:"the user message, before the agent runs"},{value:"output",label:"Output",hint:"the agent's reply, before the user sees it"},{value:"pre-tool",label:"Pre-tool",hint:"a tool call, before it executes"},{value:"egress",label:"Egress",hint:"an outbound request to a judged domain"}];function H({initial:a,judgeModelDefault:t,submitLabel:n,submitting:s,onSubmit:o,onCancel:r}){const[i,d]=y.useState(a?.name??""),[h,f]=y.useState(a?.stage??"input"),[p,N]=y.useState(a?.policy??""),[x,C]=y.useState(a?.model??""),[b,u]=y.useState((a?.tools??[]).join(", ")),[l,m]=y.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",Q=c=>{c.preventDefault();const _=b.split(",").map(T=>T.trim()).filter(Boolean);o({name:i,stage:h,...g?{kind:g}:{},policy:p,model:x.trim()||void 0,tools:(v||h==="pre-tool")&&_.length>0?_:void 0,domains:h==="egress"&&l.trim()?l.split(",").map(T=>T.trim()).filter(Boolean):void 0,enabled:a?.enabled??!0})};return e.jsxs("form",{onSubmit:Q,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-name",value:i,onChange:c=>d(c.target.value),placeholder:"no-competitor-mentions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Shown in the list and on every trip. Must be unique."})]}),v?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-stage",children:"Stage"}),e.jsxs(K,{value:h,onValueChange:c=>f(c),disabled:s,children:[e.jsx(X,{id:"guardrail-stage",children:e.jsx(Y,{})}),e.jsx(ee,{children:fe.map(c=>e.jsxs(ae,{value:c.value,children:[c.label," — ",c.hint]},c.value))})]})]}),v?e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-required-tools",children:["Required tools ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-required-tools",value:b,onChange:c=>u(c.target.value),placeholder:"suggest_actions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated. The turn trips if the agent finishes without calling every one of these. No judge model runs — this is a lookup against the tools the turn actually used."})]}):null,v?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-policy",children:["Policy ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(te,{id:"guardrail-policy",rows:5,value:p,onChange:c=>N(c.target.value),placeholder:"Deny any response that names a competitor (Acme, Globex) or quotes their pricing.",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"A judge model reads this and the text at the chosen stage, then allows or denies. Write it as an instruction to a reviewer."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-model",children:["Judge model",t?null:e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(ce,{value:x,onChange:C,placeholder:t?`Default (${t})`:"Select a model",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?"Optional. Leave blank to use the gateway's default judge model.":"Required: the gateway has no default judge model (EGRESS_JUDGE_MODEL is unset)."})]})]}),!v&&h==="pre-tool"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-tools",children:"Tool scope"}),e.jsx(k,{id:"guardrail-tools",value:b,onChange:c=>u(c.target.value),placeholder:"github.delete_repo, fs.delete",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Optional, comma-separated. Leave blank to judge every tool call."})]}):null,h==="egress"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-domains",children:"Domains"}),e.jsx(k,{id:"guardrail-domains",value:l,onChange:c=>m(c.target.value),placeholder:"api.github.com, .slack.com",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated hostnames this judge gates — exact (api.github.com) or wildcard (.slack.com). Leave blank to route nothing."})]}):null,e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[r?e.jsx(S,{type:"button",variant:"outline",onClick:r,disabled:s,children:"Cancel"}):null,e.jsx(S,{type:"submit",disabled:s,children:s?"Saving…":n})]})]})}function z(a){return a.kind==="require-tool"}function V(a,t,n,s,o){const r=a.name.trim();return r?/^[a-zA-Z0-9][a-zA-Z0-9 _-]*$/.test(r)?n.includes(r)?`"${r}" is a built-in guardrail name — pick another.`:t.some(d=>d.name===r&&d.name!==o)?`A custom guardrail named "${r}" already exists.`:z(a)?a.stage!=="output"?"A required-tool guardrail only runs at the output stage.":a.tools?.some(d=>d.trim())?null:"List at least one tool that must be used.":a.policy.trim()?!s&&!a.model?.trim()?"Judge model is required — the gateway has no default (EGRESS_JUDGE_MODEL is unset).":null:"Policy is required.":"Name may use letters, numbers, spaces, hyphens, and underscores.":"Name is required."}function W(a){const t=z(a),s=(t||a.stage==="pre-tool")&&a.tools&&a.tools.length>0?a.tools.map(d=>d.trim()).filter(Boolean):void 0,o=a.stage==="egress"&&a.domains&&a.domains.length>0?a.domains.map(d=>d.trim()).filter(Boolean):void 0,r=a.model?.trim()||void 0,i=a.policy.trim();return{name:a.name.trim(),enabled:a.enabled,stage:a.stage,...t?{kind:"require-tool"}:{},...t?i?{policy:i}:{}:{policy:i},...r?{model:r}:{},...s&&s.length>0?{tools:s}:{},...o&&o.length>0?{domains:o}:{}}}function ve(a,t){return[...a,W(t)]}function ye(a,t,n){return a.map(s=>s.name===t?W(n):s)}function Ne(a,t){return a.filter(n=>n.name!==t)}function Ce(a,t,n){return a.map(s=>s.name===t?{...s,enabled:n}:s)}function we({owner:a,agentId:t}){const n=P(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=L(t),{data:d=null,isLoading:h}=U(t),f=o||i||h,p=B(t),N=s?.guardrailsInline??[],x=(r??[]).map(u=>u.name),C=async u=>{if(!s){j.error("Still loading agent settings — try again in a moment");return}const l=V(u,N,x,d);if(l){j.error(l);return}try{await p.mutateAsync({guardrailsInline:ve(N,u)}),j.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){j.error(m instanceof Error?m.message:"Failed to create guardrail")}},b=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),f?e.jsx(se,{rows:4}):e.jsx(H,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:p.isPending,onSubmit:C,onCancel:b})]})}function F(a,t){const n=new Set(a?.guardrails??[]),s=new Set(t.map(i=>i.name)),o=t.map(i=>({name:i.name,stages:i.stages,description:i.description,enabled:n.has(i.name),unknown:!1})),r=(a?.guardrails??[]).filter(i=>!s.has(i)).map(i=>({name:i,stages:[],enabled:!0,unknown:!0}));return[...o,...r]}function Se(a){return a.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function ke(a,t,n){return Se(a.map(s=>s.name===t&&!s.unknown?{...s,enabled:n}:s))}const A={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function Ae(a){const t=new Date(a);return Number.isNaN(t.getTime())?a:le(t,{addSuffix:!0})}function Ge({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=L(t),r=y.useMemo(()=>F(s,o??[]).find(d=>d.name===n)??null,[s,o,n]),i=(s?.guardrailsInline??[]).find(d=>d.name===n);return i?e.jsx(Te,{owner:a,agentId:t,guardrail:i}):r?e.jsx(Le,{agentId:t,name:n,row:r}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Le({agentId:a,name:t,row:n}){return e.jsxs("div",{className:"space-y-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:n.description??(n.stages.length>0?`Built-in. Short-circuits this agent's ${n.stages.map(s=>A[s].toLowerCase()).join(", ")} stage${n.stages.length>1?"s":""} when it matches.`:"Configured out of band — toggling is managed via lobu apply.")}),e.jsx(Z,{agentId:a,guardrail:t})]})}function Te({owner:a,agentId:t,guardrail:n}){const s=P(),{data:o}=G(t),{data:r}=L(t),{data:i=null}=U(t),d=B(t),[h,f]=y.useState(!1),p=o?.guardrailsInline??[],N=(r??[]).map(u=>u.name),x=async(u,l)=>{if(!o)return j.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),j.success(l),!0}catch(m){return j.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=V(u,p,N,i,n.name);if(l){j.error(l);return}await x(ye(p,n.name,u),"Guardrail saved")&&u.name.trim()!==n.name&&s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(u.name.trim())}})},b=async()=>{await x(Ne(p,n.name),"Guardrail deleted")&&s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})};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:n.kind==="require-tool"?"Required tools":"Policy"}),e.jsx(H,{initial:n,judgeModelDefault:i,submitLabel:"Save changes",submitting:d.isPending,onSubmit:C})]}),e.jsx("div",{className:"flex justify-end",children:h?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{type:"button",variant:"destructive",onClick:()=>void b(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>f(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(S,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>f(!0),children:["Delete ",n.name]})}),e.jsx(Z,{agentId:t,guardrail:n.name})]})}function Z({agentId:a,guardrail:t}){const{data:n=[],isLoading:s,isError:o}=I(a,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),s?e.jsx(ne,{label:"catches",variant:"table",rows:4}):o?e.jsx(re,{label:"catches"}):n.length===0?e.jsx(D,{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(he,{children:[e.jsx(pe,{children:e.jsxs(O,{children:[e.jsx(R,{className:"w-[180px]",children:"When"}),e.jsx(R,{className:"w-[120px]",children:"Stage"}),e.jsx(R,{children:"Reason"})]})}),e.jsx(xe,{children:n.map(r=>e.jsxs(O,{children:[e.jsx($,{className:"text-xs text-muted-foreground",title:r.occurredAt,children:Ae(r.occurredAt)}),e.jsx($,{children:e.jsx(oe,{variant:"outline",className:"text-[10px]",children:A[r.stage]})}),e.jsx($,{className:"text-sm text-muted-foreground",children:r.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},r.id))})]})})]})}function M(a,t){return a.get(t)??0}function Ee(a,t,n){const s=a.map(r=>{const i=r.stages.map(d=>A[d]);return r.unknown&&i.push("Unknown"),{id:r.name,name:r.name,kind:"builtin",description:r.description,stages:r.stages,enabled:r.enabled,unknown:r.unknown,badges:i,tripCount:M(n,r.name)}}),o=t.map(r=>{const i=[A[r.stage],"Custom"];return{id:r.name,name:r.name,kind:"custom",description:r.policy,stages:[r.stage],enabled:r.enabled,unknown:!1,badges:i,tripCount:M(n,r.name)}});return[...s,...o]}function Re({owner:a,agentId:t,expandedName:n}){const s=P(),{data:o,isLoading:r}=G(t),{data:i,isLoading:d}=L(t),{data:h=[]}=I(t),f=B(t),p=async(l,m)=>{if(!o){j.error("Still loading agent settings — try again in a moment");return}try{if(l.kind==="custom")await f.mutateAsync({guardrailsInline:Ce(o.guardrailsInline??[],l.name,m)});else{const g=F(o,i??[]);await f.mutateAsync({guardrails:ke(g,l.name,m)})}j.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){j.error(g instanceof Error?g.message:"Failed to save guardrail")}},N=i===null,x=y.useMemo(()=>{const l=F(o,i??[]),m=o?.guardrailsInline??[],g=new Map;for(const v of h)g.set(v.guardrailName,(g.get(v.guardrailName)??0)+1);return Ee(l,m,g)},[o,i,h]),C=l=>{if(l===n){s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return}s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(l)}})},b=()=>{s({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:a,agentId:t}})},u=r||d;return!u&&x.length===0?e.jsx("div",{className:"space-y-6",children:N?e.jsx(D,{icon:q,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:b}):e.jsx(D,{icon:q,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:b})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(ge,{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(S,{type:"button",onClick:b,children:[e.jsx(de,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(be,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((l,m)=>{const g=l.name===n;return e.jsx($e,{card:l,expanded:g,isLast:m===x.length-1,onToggle:()=>C(l.name),onToggleEnabled:v=>void p(l,v),toggleDisabled:l.unknown||f.isPending,children:g?e.jsx(Ge,{owner:a,agentId:t,name:l.name}):null},l.id)})})]})}function $e({card:a,expanded:t,isLast:n,onToggle:s,onToggleEnabled:o,toggleDisabled:r,children:i}){return e.jsxs("div",{className:E("bg-background",!n||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:s,"aria-expanded":t,className:E("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",!a.enabled&&!a.unknown&&!t&&"opacity-70"),children:[e.jsx(q,{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:E("truncate text-sm text-foreground",a.unknown&&"font-mono text-xs"),children:a.name}),a.kind==="custom"&&a.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:a.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a.tripCount>0?`${a.tripCount} recent ${a.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(ue,{badges:a.badges})]})]}),e.jsx(je,{enabled:a.enabled,name:a.name,expanded:t,onToggleEnabled:o,toggleDisabled:r,onToggle:s})]}),t&&i?e.jsx("div",{className:"border-t border-border px-4 py-4",children:i}):null]})}function De({owner:a,agentId:t,expandedName:n}){return e.jsx(J,{children:e.jsx(Re,{owner:a,agentId:t,expandedName:n})})}function Me({owner:a,agentId:t}){return e.jsx(J,{children:e.jsx(we,{owner:a,agentId:t})})}function Ue({owner:a,agentId:t,name:n}){return e.jsx(De,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{De as A,Me as a,Ue as b};
2
- //# sourceMappingURL=agent-guardrails-route-BJyfalBY.js.map
@@ -1,2 +0,0 @@
1
- import{j as n,L as i,cu as l,d_ as d}from"./index-DdBTTN3y.js";import{a as u}from"./client-rows-36VnmgMK.js";function g({owner:s,item:t,last:c,appearance:r="row"}){const a=r==="inline"?"inline-flex items-center gap-1.5 rounded-md bg-accent px-1.5 py-0.5 text-sm font-medium":`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${c?"":"border-b"}`;if(t.kind==="managed"){const e=t.agent,o=[e.status===void 0?null:e.status==="active"?"Working":"Idle",e.connectionCount===void 0?null:`${e.connectionCount} ${e.connectionCount===1?"connection":"connections"}`,e.userCount===void 0?null:`${e.userCount} ${e.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return n.jsxs(i,{to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:e.agentId},search:{run_id:void 0},className:a,children:[n.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:n.jsx(l,{className:"h-4 w-4"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:e.name}),r==="row"&&(o||e.description)?n.jsx("p",{className:"truncate text-xs",children:o||e.description}):null]}),e.status==="active"?n.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(t.kind==="connected"){const e=t.group;return n.jsxs(i,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:e.clientId},className:a,children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:n.jsx(d,{name:e.title})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:e.title}),n.jsxs("p",{className:"truncate text-xs",children:["Connected · ",u(e)]})]}),n.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}export{g as A};
2
- //# sourceMappingURL=agent-list-row-rF5LH-3k.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,bR as B,i as S,a$ as D,b0 as K,b1 as R,gy as X,a6 as G,bK as Y,bJ as Z,bW as V,gz as ee,bX as P,bt as F,bY as se,bS as ne,bZ as te,bT as re,r as A,gA as ae,gB as ie,bO as le,b_ as oe,L as w,gC as de,gD as ce,d5 as W,gE as ue,gF as me,gG as ge,gH as k,cU as L,X as fe,gI as q,gJ as z,fa as xe,d6 as he,gK as be,gL as ye,c1 as pe,gM as je}from"./index-DdBTTN3y.js";const ve={auto:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",approval:"bg-amber-500/15 text-amber-600 dark:text-amber-400",deny:"bg-red-500/15 text-red-600 dark:text-red-400"};function Ne({options:n,value:t,floor:o,onChange:a,disabled:i,ariaLabel:m,compact:u}){return e.jsx("div",{role:"radiogroup","aria-label":m,className:S("inline-flex shrink-0 items-stretch gap-0.5 rounded-lg border border-border bg-muted/40 p-0.5"),children:n.map(l=>{const b=X({option:l,floor:o}),h=l===t,g=b.disabled&&!h,y=B[l],f=e.jsx("button",{type:"button",role:"radio","aria-checked":h,disabled:i||g,onClick:()=>{!h&&!g&&!i&&a(l)},className:S("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",u?"min-w-[3rem] rounded-md px-2.5 py-1.5 text-xs leading-none":"min-w-[3.25rem] rounded-md px-3 py-1.5 text-sm leading-none",h?S(ve[l],""):"text-muted-foreground hover:bg-background/60 hover:text-foreground",g&&"cursor-not-allowed opacity-40",i&&!g&&"cursor-not-allowed opacity-60"),children:y},l);return g&&b.reason?e.jsxs(D,{children:[e.jsx(K,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:f})}),e.jsx(R,{children:b.reason})]},l):f})})}function M({children:n,controls:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 px-3 py-2",children:[e.jsx("div",{className:"min-w-40 flex-1 text-sm",children:n}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t})]})}const _e=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every entity type."},{resourceClass:"agent_config",title:"Agents",sub:"Defaults for reading and managing agents."}];function Ae(n,t,o,a,i=null){const m=q(n.floor,t,o,a,i),u=z(n.floor,t,o,a,i)?m:"auto";return(a!==null||i!==null)&&be(n.agent,t,o)?ye(u,k(n,t,o,null)):u}function Se({label:n,response:t,resourceClass:o,action:a,entityTypeSlug:i,targetAgentId:m=null,dimmed:u,pending:l,onSave:b}){const h=q(t.floor,o,a,i,m),g=z(t.floor,o,a,i,m),y=k(t,o,a,i,m),f=Ae(t,o,a,i,m),j=pe(o,a),p=e.jsx("div",{className:S("inline-flex shrink-0",u&&"opacity-45"),children:e.jsx(Ne,{options:j,value:y,floor:f,disabled:l,compact:!0,ariaLabel:n,onChange:b})});return g?e.jsxs(D,{children:[e.jsx(K,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:p})}),e.jsxs(R,{children:["Org floor ",B[h]," — can only go stricter"]})]}):p}function ke(n,t){const o=i=>i.resource_class===t.resource_class&&(i.entity_type_slug??null)===(t.entity_type_slug??null)&&(i.operation_key??null)===(t.operation_key??null)&&(i.target_agent_id??null)===(t.target_agent_id??null),a=n.map(i=>o(i)?t:i);return a.some(o)?a:[...a,t]}function Ce(n,t,o,a,i,m){const u=je(n,t,o,a);return u[i]=m,u}const $="font-medium text-foreground hover:text-primary hover:underline";function Ee({type:n}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(W,{icon:n.icon,className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:n.slug})]})}function Q({label:n,disabled:t,hint:o,searchPlaceholder:a,emptyText:i,children:m}){return t?e.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[n,o?` ${o}`:""]}):e.jsx(xe,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:a,emptyText:i,trigger:u=>e.jsxs("button",{type:"button","aria-expanded":u,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[e.jsx(he,{className:"h-3 w-3"}),n]}),children:u=>m(u)})}function Te({pending:n,onClick:t,label:o}){return e.jsx("button",{type:"button",disabled:n,onClick:t,"aria-label":o,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:e.jsx(fe,{className:"h-3 w-3"})})}function $e({owner:n,agentId:t,variant:o="agent"}){const a=o==="org-floor",i=G(),m=Y(n,t??"",{enabled:!a&&!!t}),u=Z(n,{enabled:a}),{data:l,isLoading:b,isError:h,error:g}=a?u:m,y=a?V(n):ee(n,t??""),f=P({mutationFn:r=>a?se(n,r):ne(n,t??"",r),onSuccess:r=>{i.setQueryData(y,c=>c&&{...c,agent:ke(c.agent,r)}),i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to save permission")}}),j=P({mutationFn:r=>a?te(n,r):re(n,t??"",r),onSuccess:()=>{i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to remove override")}}),p=f.isPending||j.isPending,C=A.useMemo(()=>l?ae(l):[],[l]),E=A.useMemo(()=>{if(!l)return[];const r=new Set(C.map(c=>c.slug));return l.entity_types.filter(c=>!r.has(c.slug))},[l,C]),v=A.useMemo(()=>l?ie(l):[],[l]),N=A.useMemo(()=>{if(!l)return[];const r=new Set(v.map(c=>c.id));return l.agents.filter(c=>(a||c.id!==t)&&!r.has(c.id))},[l,v,t,a]);if(b)return e.jsx(le,{label:"permissions",variant:"cards",cards:2});if(h||!l)return e.jsx(oe,{label:g instanceof Error?g.message:"permissions"});const x=l,H=(r,c,T,_,s=null)=>{const d=Ce(x,r,c,s,T,_);f.mutate({resource_class:r,effects:d,entity_type_slug:c,target_agent_id:s})},I=x.entity_types.length===0?"— none yet":E.length===0?"— all covered":null,J=N.length===0&&v.length===0?"— no other agents":N.length===0?"— all covered":null;return e.jsxs("div",{className:"space-y-4",children:[a?null:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage connector rules and agent restrictions in"," ",e.jsx(w,{to:"/$owner/settings/organization",params:{owner:n},search:{agent:t},hash:"policies",className:$,children:"Organization policies"}),"."]}),_e.map(r=>{const c=r.resourceClass==="entity",T=r.resourceClass==="agent_config",_=[{key:"default",label:"Default",name:"Default",entityTypeSlug:null,targetAgentId:null,owned:!1,diffs:0},...c?C.map(s=>({key:`entity:${s.slug}`,name:s.name,label:e.jsx(w,{to:"/$owner/entity-types/$slug",params:{owner:n,slug:s.slug},className:$,title:`Open ${s.name}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(W,{icon:s.icon,className:"h-3.5 w-3.5 shrink-0"}),s.name]})}),entityTypeSlug:s.slug,targetAgentId:null,owned:ce(x,s.slug),diffs:de(x,s.slug)})):v.map(s=>({key:`agent:${s.id}`,name:s.name,label:e.jsx(w,{to:"/$owner/agents/$agentId/settings",params:{owner:n,agentId:s.id},search:{run_id:void 0},className:$,title:`Open ${s.name}`,children:s.name}),entityTypeSlug:null,targetAgentId:s.id,owned:me(x,s.id),diffs:ue(x,s.id)}))];return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-medium",children:r.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]}),e.jsxs("div",{className:"divide-y overflow-hidden rounded-lg border",children:[_.map(s=>e.jsxs("div",{className:"divide-y",children:[_.length>1&&e.jsx("div",{className:"bg-muted/30",children:e.jsx(M,{controls:s.owned?e.jsx(Te,{pending:p,label:`Remove ${s.name} exception`,onClick:()=>j.mutate({resource_class:r.resourceClass,entity_type_slug:s.entityTypeSlug,target_agent_id:s.targetAgentId})}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s.label,s.key!=="default"&&!s.owned?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Organization minimum"}):s.diffs>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.diffs," ",s.diffs===1?"change":"changes"]}):null]})})}),e.jsx("div",{className:"divide-y",children:ge[r.resourceClass].filter(d=>!s.targetAgentId||d!=="create").map(d=>{const O=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c?"entities":"agents"}`;return e.jsx(M,{controls:e.jsx(Se,{label:`${s.name}: ${O}`,response:x,resourceClass:r.resourceClass,action:d,entityTypeSlug:s.entityTypeSlug,targetAgentId:s.targetAgentId,dimmed:s.key!=="default"&&k(x,r.resourceClass,d,s.entityTypeSlug,s.targetAgentId)===k(x,r.resourceClass,d,null),pending:p,onSave:U=>H(r.resourceClass,s.entityTypeSlug,d,U,s.targetAgentId)}),children:O},d)})})]},s.key)),e.jsxs("div",{className:"border-t",children:[c?e.jsx(Q,{label:"Add type",disabled:p||E.length===0,hint:I,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:s=>E.map(d=>e.jsx(L,{value:`${d.name} ${d.slug}`,onSelect:()=>{f.mutate({resource_class:"entity",effects:{},entity_type_slug:d.slug}),s()},className:"cursor-pointer",children:e.jsx(Ee,{type:d})},d.slug))}):null,T?e.jsx(Q,{label:"Add agent",disabled:p||N.length===0,hint:J,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:s=>N.map(d=>e.jsxs(L,{value:`${d.name} ${d.id}`,onSelect:()=>{f.mutate({resource_class:"agent_config",effects:{},target_agent_id:d.id}),s()},className:"cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:d.name}),e.jsx("span",{className:"ml-1.5 font-mono text-[10px] text-muted-foreground",children:d.id})]},d.id))}):null]})]})]},r.resourceClass)})]})}export{$e as A,Ne as P,M as a};
2
- //# sourceMappingURL=agent-permissions-matrix-bP1Qihv7.js.map
@@ -1,2 +0,0 @@
1
- import{c as D,r as g,j as e,d6 as L,H as N,I as K,eS as P,bP as O,B as C,i as R,dh as _,hw as H,hx as z,b2 as G,hI as Q,f_ as Y,j8 as V}from"./index-DdBTTN3y.js";import{u as w,b as X,f as q,s as J,a as U,S as W,v as Z,c as ee}from"./agent-skill-context-BAaGpvfS.js";import{b as se,a as te,A as E}from"./agent-tab-intro-ednTs4WF.js";import{u as ae,a as F,m as ne,P as le,D as ie,n as oe,C as re}from"./core.esm-CQzL3ObT.js";import{f as ce}from"./agent-loading-shells-ClY_O6lb.js";import{A as de}from"./agent-card-controls-C5jNWgfq.js";const T=":";function A(s){const t=s.indexOf("/");return t<0?s:`${s.slice(0,t)}${T}${s.slice(t+1)}`}function B(s){const t=s.indexOf(T);return t<0?s:`${s.slice(0,t)}/${s.slice(t+1)}`}function me({owner:s,agentId:t}){const a=D(),[n,i]=g.useState(""),[o,d]=g.useState(!1),[x,k]=g.useState(""),[r,b]=g.useState(""),{skillRows:m,catalog:p,isLoading:u,addSkillFromCatalog:h,addCustomSkill:S}=w(),v=g.useMemo(()=>new Set(m.map(c=>c.repo)),[m]),f=g.useMemo(()=>X(p?.catalog??[],v),[p?.catalog,v]),l=g.useMemo(()=>q(f,n),[f,n]),y=c=>{h(c),a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(c)}})},j=()=>{const c=S({name:x,instructions:r});c&&a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(c)}})},$=e.jsx(se,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."});return e.jsxs("div",{className:"space-y-6",children:[$,e.jsx("div",{className:R(_,"w-full"),children:o?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(K,{id:"custom-skill-name",value:x,onChange:c=>k(c.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:r,onChange:c=>b(c.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(O,{onCancel:()=>d(!1),children:e.jsx(C,{type:"button",size:"sm",onClick:j,disabled:!x.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>d(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),u?e.jsx(H,{}):e.jsx(z,{items:l,searchQuery:n,onSearchChange:i,onSelect:c=>y(c.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:n.trim()?`No skills match "${n}"`:f.length===0?"All catalog skills are already configured":"No skills available"})]})}function ue({row:s}){const{isSaving:t,updateSkillRow:a}=w(),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(N,{htmlFor:"skill-name",children:"Name"}),e.jsx(K,{id:"skill-name",value:s.name,onChange:i=>a(s.repo,{name:i.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(P,{id:"skill-instructions",value:s.instructions??"",onChange:i=>{const o=i.target.value;a(s.repo,{instructions:o,content:o.trim()||s.name})},rows:4,disabled:t})]})]})})}function ge({owner:s,agentId:t,skillKey:a}){const n=D(),[i,o]=g.useState(!1),d=B(a),{skillRows:x,catalog:k,isSaving:r,saveSkills:b,removeSkillAndSave:m,addSkillFromCatalog:p}=w(),u=x.find(f=>f.repo===d)??null,h=k?.catalog.find(f=>f.repo===d);g.useEffect(()=>{!u&&h&&p(d)},[p,h,d,u]);const S=async()=>{await m(d)&&(o(!1),n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}}))};if(!u)return h?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const v=!u.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(ue,{row:u}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[v?i?e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"button",variant:"destructive",onClick:()=>void S(),disabled:r,children:r?"Removing...":"Remove skill"}),e.jsx(C,{type:"button",variant:"outline",onClick:()=>o(!1),disabled:r,children:"Cancel"})]}):e.jsxs(C,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),disabled:r,children:["Remove ",u.name]}):null,e.jsx(C,{type:"button",onClick:()=>void b(),disabled:r||i,children:r?"Saving...":"Save changes"})]})]})}function xe(s){return s.map(t=>{const a=J(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const I="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 M({owner:s,agentId:t,expandedRepo:a}){const n=D(),{skillRows:i,catalog:o,isLoading:d,isSaving:x,reorderSkills:k,setSkillEnabledAndSave:r,addSkillFromCatalog:b}=w();g.useEffect(()=>{a&&(i.some(l=>l.repo===a)||o?.catalog.some(l=>l.repo===a)&&b(a))},[a,i,o,b]);const m=g.useMemo(()=>xe(i),[i]),p=g.useMemo(()=>m.map(l=>l.repo),[m]),u=ae(F(le,{activationConstraint:{distance:8}}),F(ne,{coordinateGetter:U})),h=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},S=e.jsxs(C,{type:"button",onClick:h,children:[e.jsx(L,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),v=l=>{if(l===a){n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}});return}n({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(l)}})},f=l=>{const{active:y,over:j}=l;!j||y.id===j.id||k(String(y.id),String(j.id))};return d?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(ce,{rows:2})]}):m.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(G,{icon:Q,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:h})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(te,{description:I,action:S}),e.jsx(ie,{sensors:u,collisionDetection:oe,onDragEnd:f,children:e.jsx(W,{items:p,strategy:Z,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:m.map((l,y)=>{const j=l.repo===a;return e.jsx(he,{card:l,rank:y+1,disabled:x,expanded:j,isLast:y===m.length-1,onToggle:()=>v(l.repo),onToggleEnabled:$=>void r(l.repo,$),toggleDisabled:x,children:j?e.jsx(ge,{owner:s,agentId:t,skillKey:A(l.repo)}):null},l.id)})})})})]})}function he({card:s,rank:t,disabled:a,expanded:n,isLast:i,onToggle:o,onToggleEnabled:d,toggleDisabled:x,children:k}){const r=a||n,{attributes:b,listeners:m,setNodeRef:p,transform:u,transition:h,isDragging:S}=ee({id:s.repo,disabled:r}),v={transform:re.Transform.toString(u),transition:h};return e.jsxs("div",{ref:p,style:v,className:R("bg-background",!i||n?"border-b":"",S&&"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:r,...b,...m,children:e.jsx(Y,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:R("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:o,"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(de,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:d,toggleDisabled:x,onToggle:o})]}),n&&k?e.jsx("div",{className:"border-t border-border px-4 py-4",children:k}):null]})}function Se({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t})})}function ye({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(me,{owner:s,agentId:t})})}function Ce({owner:s,agentId:t,skillKey:a}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t,expandedRepo:B(a)})})}export{Se as A,ye as a,Ce as b};
2
- //# sourceMappingURL=agent-skills-route-Bv5luNdw.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,al as n,i as a}from"./index-DdBTTN3y.js";function l({children:t,className:s}){return e.jsx(n,{className:a("pb-8",s),children:t})}function x({title:t,description:s}){return e.jsxs("div",{className:"mb-2 space-y-1",children:[e.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:s})]})}function c({description:t,action:s}){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:t}),s?e.jsx("div",{className:"shrink-0",children:s}):null]})}export{l as A,c as a,x as b};
2
- //# sourceMappingURL=agent-tab-intro-ednTs4WF.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as o}from"./index-DdBTTN3y.js";const n=()=>t.jsx(o,{});export{n as component};
2
- //# sourceMappingURL=agents-DY2S2SGE.js.map