@lobu/runtime-server 24.2.0 → 24.3.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 (252) hide show
  1. package/dist/catalogs/connectors.json +24 -2
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/gchat.ts +31 -1
  5. package/dist/connectors/postgres.ts +9 -5
  6. package/dist/dependencies.bun.lock +104 -167
  7. package/dist/owletto/dist/assets/_-XKF0m81R.js +3 -0
  8. package/dist/owletto/dist/assets/_-e8MbEBtw.js +2 -0
  9. package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +2 -0
  10. package/dist/owletto/dist/assets/_agentId-emObu67X.js +2 -0
  11. package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +2 -0
  12. package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +2 -0
  13. package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +2 -0
  14. package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +2 -0
  15. package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +2 -0
  16. package/dist/owletto/dist/assets/_name-DjtJMop4.js +2 -0
  17. package/dist/owletto/dist/assets/_owner-oBX68rb9.js +3 -0
  18. package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +2 -0
  19. package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +2 -0
  20. package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-B2g5qzn3.js} +2 -2
  21. package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +2 -0
  22. package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +2 -0
  23. package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-38lHBvjO.js} +2 -2
  24. package/dist/owletto/dist/assets/{activity-route-view-_G_lDz5K.js → activity-route-view-voRYSM3a.js} +2 -2
  25. package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-DiU7Un5w.js} +2 -2
  26. package/dist/owletto/dist/assets/{agent-client-setup-list-BgyLhJCo.js → agent-client-setup-list-Bkyw22GW.js} +4 -4
  27. package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +2 -0
  28. package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-QrIDroFL.js} +2 -2
  29. package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +2 -0
  30. package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-CamDtzHY.js} +2 -2
  31. package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CgsQ8BK_.js} +2 -2
  32. package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-lWbXKEm1.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-D-w3tY_2.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-CLqpn5Tb.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-CsRexwTv.js} +4 -4
  36. package/dist/owletto/dist/assets/agents-DzH_FFKU.js +2 -0
  37. package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.js +2 -0
  38. package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
  39. package/dist/owletto/dist/assets/{app._appId-A51tx2jU.js → app._appId-BO7G38fL.js} +2 -2
  40. package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-DMYxs6F6.js} +2 -2
  41. package/dist/owletto/dist/assets/automations-DzH_FFKU.js +2 -0
  42. package/dist/owletto/dist/assets/calendar-DDCCSPW6.js +2 -0
  43. package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-DFciMR8u.js} +2 -2
  44. package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-BCsbrdGs.js} +2 -2
  45. package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-BRua2b_7.js} +2 -2
  46. package/dist/owletto/dist/assets/{client-activity-scopes-CmK3DkSP.js → client-activity-scopes-BLIy1Zc3.js} +2 -2
  47. package/dist/owletto/dist/assets/client-rows-DiJQ5D1z.js +2 -0
  48. package/dist/owletto/dist/assets/clients-8-EpRjsm.js +2 -0
  49. package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-BFZa4EIt.js} +2 -2
  50. package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +2 -0
  51. package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +2 -0
  52. package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +2 -0
  53. package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +2 -0
  54. package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +2 -0
  55. package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +2 -0
  56. package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +2 -0
  57. package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +2 -0
  58. package/dist/owletto/dist/assets/connections-browser-BMV8bf54.js +2 -0
  59. package/dist/owletto/dist/assets/connector-boxes-DqZA-FdG.js +2 -0
  60. package/dist/owletto/dist/assets/{connector-provenance-bmBJJ9B4.js → connector-provenance-BIg8P8WY.js} +2 -2
  61. package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-CJYz53YF.js} +2 -2
  62. package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BroKpwhB.js} +2 -2
  63. package/dist/owletto/dist/assets/{consent-C_WBfmQ8.js → consent-fzLN-Qy7.js} +2 -2
  64. package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +2 -0
  65. package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-A1UnFbGs.js} +2 -2
  66. package/dist/owletto/dist/assets/create-BjwsYarn.js +2 -0
  67. package/dist/owletto/dist/assets/create-Dzr4mlr0.js +2 -0
  68. package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +3 -0
  69. package/dist/owletto/dist/assets/create-c94SPL21.js +2 -0
  70. package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +2 -0
  71. package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-xxpD1P2-.js} +2 -2
  72. package/dist/owletto/dist/assets/{device-Br9JHadR.js → device-C3AEoL5c.js} +2 -2
  73. package/dist/owletto/dist/assets/device-pin-tombstone-B_te59GE.js +2 -0
  74. package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
  75. package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-CEV4ttUQ.js} +2 -2
  76. package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +2 -0
  77. package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +2 -0
  78. package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +2 -0
  79. package/dist/owletto/dist/assets/event-card-CBlsG32u.js +2 -0
  80. package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +2 -0
  81. package/dist/owletto/dist/assets/events-feed-VfU4csn2.js +2 -0
  82. package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
  83. package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +2 -0
  84. package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-C1Q_jEzD.js} +2 -2
  85. package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +2 -0
  86. package/dist/owletto/dist/assets/identity-BaFLmbSo.js +2 -0
  87. package/dist/owletto/dist/assets/index-008wj-Pz.js +7950 -0
  88. package/dist/owletto/dist/assets/index-BaetvYLa.js +2 -0
  89. package/dist/owletto/dist/assets/index-BiEf5xOE.css +1 -0
  90. package/dist/owletto/dist/assets/index-BrDP4PCs.js +2 -0
  91. package/dist/owletto/dist/assets/index-BuXIeK7D.js +2 -0
  92. package/dist/owletto/dist/assets/index-CAVcR9za.js +2 -0
  93. package/dist/owletto/dist/assets/index-CMLfWGPU.js +2 -0
  94. package/dist/owletto/dist/assets/index-D0YEYP7N.js +2 -0
  95. package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-DFyBbp7b.js} +2 -2
  96. package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-DNtYqkiA.js} +2 -2
  97. package/dist/owletto/dist/assets/index-DQxzeM37.js +2 -0
  98. package/dist/owletto/dist/assets/index-DkO0nPex.js +2 -0
  99. package/dist/owletto/dist/assets/index-KlRId0g6.js +2 -0
  100. package/dist/owletto/dist/assets/index-Ywnqi4A6.js +2 -0
  101. package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
  102. package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-yIub2xUM.js} +2 -2
  103. package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-LE_vNZrM.js} +4 -4
  104. package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Kzxi2OXB.js} +2 -2
  105. package/dist/owletto/dist/assets/login-DWOT6jtS.js +2 -0
  106. package/dist/owletto/dist/assets/logout-Dt_VDilG.js +2 -0
  107. package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-De75CR7W.js} +2 -2
  108. package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +74 -0
  109. package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-3l9lY50C.js} +2 -2
  110. package/dist/owletto/dist/assets/model-udnQ_S43.js +2 -0
  111. package/dist/owletto/dist/assets/models-CQj7GIOp.js +2 -0
  112. package/dist/owletto/dist/assets/new-BOwIHkre.js +2 -0
  113. package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-BbdwuJPm.js} +2 -2
  114. package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
  115. package/dist/owletto/dist/assets/{oauth-workspace-access-D15LYKSe.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
  116. package/dist/owletto/dist/assets/{organization-CoUJYXx7.js → organization-BDzjnqPf.js} +2 -2
  117. package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
  118. package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-CfoY4WFY.js} +2 -2
  119. package/dist/owletto/dist/assets/{proposal-review-shell-CmLy1MZf.js → proposal-review-shell-CVkLnnKo.js} +2 -2
  120. package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +2 -0
  121. package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +2 -0
  122. package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-D07szzqN.js} +2 -2
  123. package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-AJxSmE3-.js} +30 -30
  124. package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
  125. package/dist/owletto/dist/assets/{runs-B0zVYb-w.js → runs-lG2ChtOt.js} +2 -2
  126. package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
  127. package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-C_Es0qDf.js} +2 -2
  128. package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
  129. package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-gGYXbFfd.js} +2 -2
  130. package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +2 -0
  131. package/dist/owletto/dist/assets/source-record-panels-CjFPgKKJ.js +2 -0
  132. package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-CSBtKT4g.js} +2 -2
  133. package/dist/owletto/dist/assets/table-DHM-vCxP.js +2 -0
  134. package/dist/owletto/dist/assets/use-automations-C4TSie1i.js +2 -0
  135. package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-PfZrNbu_.js} +2 -2
  136. package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +2 -0
  137. package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +2 -0
  138. package/dist/owletto/dist/assets/views-access-required-2ubIf_3N.js +2 -0
  139. package/dist/owletto/dist/index.html +2 -2
  140. package/dist/server-main.bundle.mjs +99167 -97912
  141. package/npm-shrinkwrap.json +537 -896
  142. package/package.json +7 -10
  143. package/vendor/@better-auth-kysely-adapter/.bun-tag-abf95749a412716 +0 -0
  144. package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
  145. package/vendor/@better-auth-kysely-adapter/README.md +17 -0
  146. package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
  147. package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
  148. package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
  149. package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
  150. package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
  151. package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
  152. package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
  153. package/vendor/@better-auth-kysely-adapter/package.json +52 -0
  154. package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
  155. package/vendor/connector-sdk/dist/index.d.ts +3 -1
  156. package/vendor/connector-sdk/dist/index.js +4 -0
  157. package/vendor/connector-sdk/dist/redact.d.ts +10 -0
  158. package/vendor/connector-sdk/dist/redact.js +130 -0
  159. package/vendor/connector-sdk/dist/types.d.ts +2 -1
  160. package/vendor/connector-sdk/package.json +6 -1
  161. package/vendor/core/dist/connector-query-errors.d.ts +6 -0
  162. package/vendor/core/dist/connector-query-errors.js +4 -0
  163. package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
  164. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
  165. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
  166. package/vendor/core/dist/contracts/tools/manage-entity.js +6 -0
  167. package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
  168. package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
  169. package/vendor/core/dist/errors.d.ts +0 -20
  170. package/vendor/core/dist/errors.js +1 -25
  171. package/vendor/core/dist/otel.js +38 -10
  172. package/vendor/core/dist/utils/ajv.js +3 -1
  173. package/vendor/core/package.json +26 -5
  174. package/vendor/views/package.json +1 -1
  175. package/dist/owletto/dist/assets/_-Cjvw31gU.js +0 -2
  176. package/dist/owletto/dist/assets/_-iToIRRFt.js +0 -3
  177. package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +0 -2
  178. package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +0 -2
  179. package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +0 -2
  180. package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +0 -2
  181. package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +0 -2
  182. package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +0 -2
  183. package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +0 -2
  184. package/dist/owletto/dist/assets/_name-BsOZmvlH.js +0 -2
  185. package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +0 -3
  186. package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +0 -2
  187. package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +0 -2
  188. package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +0 -2
  189. package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +0 -2
  190. package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +0 -2
  191. package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +0 -2
  192. package/dist/owletto/dist/assets/agents-C05k-Xw6.js +0 -2
  193. package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +0 -2
  194. package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
  195. package/dist/owletto/dist/assets/automations-C05k-Xw6.js +0 -2
  196. package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +0 -2
  197. package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +0 -2
  198. package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +0 -2
  199. package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +0 -2
  200. package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +0 -2
  201. package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +0 -2
  202. package/dist/owletto/dist/assets/connection-DJd9bnEc.js +0 -2
  203. package/dist/owletto/dist/assets/connection-feed-detail-IO6G5QjL.js +0 -2
  204. package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +0 -2
  205. package/dist/owletto/dist/assets/copy-button-kcjg8Giw.js +0 -2
  206. package/dist/owletto/dist/assets/create-CQE5rD0i.js +0 -2
  207. package/dist/owletto/dist/assets/create-DQNlRTUX.js +0 -2
  208. package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +0 -3
  209. package/dist/owletto/dist/assets/create-lOFSQV_5.js +0 -2
  210. package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +0 -2
  211. package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +0 -2
  212. package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +0 -2
  213. package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +0 -2
  214. package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +0 -2
  215. package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +0 -2
  216. package/dist/owletto/dist/assets/event-detail-C25TvOb_.js +0 -2
  217. package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +0 -2
  218. package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +0 -2
  219. package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +0 -2
  220. package/dist/owletto/dist/assets/identity-BkK8ggdp.js +0 -2
  221. package/dist/owletto/dist/assets/index-Bw5iV_J7.js +0 -2
  222. package/dist/owletto/dist/assets/index-C3dpyynY.js +0 -2
  223. package/dist/owletto/dist/assets/index-C3zAbslo.js +0 -2
  224. package/dist/owletto/dist/assets/index-CGKN_WN_.js +0 -2
  225. package/dist/owletto/dist/assets/index-CgRaCOzW.js +0 -2
  226. package/dist/owletto/dist/assets/index-DfIoxD5Q.js +0 -2
  227. package/dist/owletto/dist/assets/index-DijuudSs.js +0 -2
  228. package/dist/owletto/dist/assets/index-Dr7bouPX.css +0 -1
  229. package/dist/owletto/dist/assets/index-JmEl29py.js +0 -7950
  230. package/dist/owletto/dist/assets/index-NK2VKPoL.js +0 -2
  231. package/dist/owletto/dist/assets/index-_5qsmBkt.js +0 -2
  232. package/dist/owletto/dist/assets/index-qkOKpRYs.js +0 -2
  233. package/dist/owletto/dist/assets/index-wzYkECAe.js +0 -2
  234. package/dist/owletto/dist/assets/login-XL5XxN6y.js +0 -2
  235. package/dist/owletto/dist/assets/logout-CMxdhLbM.js +0 -2
  236. package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +0 -74
  237. package/dist/owletto/dist/assets/models-BAVaDnKN.js +0 -2
  238. package/dist/owletto/dist/assets/new-1QLuS1o-.js +0 -2
  239. package/dist/owletto/dist/assets/new-D21LGMl6.js +0 -2
  240. package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +0 -2
  241. package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +0 -2
  242. package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +0 -2
  243. package/dist/owletto/dist/assets/reset-password-Y-WO77iR.js +0 -2
  244. package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +0 -2
  245. package/dist/owletto/dist/assets/runs-table-9OVdfPXZ.js +0 -2
  246. package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +0 -2
  247. package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +0 -2
  248. package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +0 -2
  249. package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +0 -2
  250. package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +0 -2
  251. package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +0 -2
  252. package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +0 -2
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-BUghWZ1s.js","assets/index-008wj-Pz.js","assets/index-BiEf5xOE.css","assets/record-activity-BXhvJbd9.js","assets/filter-bar-COU0sBFQ.js","assets/calendar-DDCCSPW6.js","assets/connection-label-BobuYiAG.js","assets/runs-lG2ChtOt.js","assets/source-record-panels-CjFPgKKJ.js","assets/event-card-CBlsG32u.js","assets/use-scroll-sentinel-D-fJx_Md.js","assets/use-automations-C4TSie1i.js","assets/clients-8-EpRjsm.js","assets/renderer-AJxSmE3-.js","assets/table-DHM-vCxP.js","assets/card-BCsbrdGs.js","assets/json-diff-LE_vNZrM.js","assets/index-wHFQv1aT.js","assets/copy-button-Df7QXE0w.js","assets/events-feed-VfU4csn2.js","assets/client-activity-scopes-BLIy1Zc3.js","assets/client-rows-DiJQ5D1z.js","assets/agent-loading-shells-CamDtzHY.js","assets/member-scope-gate-De75CR7W.js","assets/views-access-required-2ubIf_3N.js","assets/record-session-D07szzqN.js","assets/entity-avatar-CEV4ttUQ.js","assets/view-param-filters-DkX4YdDT.js","assets/app-bridge-C4nPtae3.js"])))=>i.map(i=>d[i]);
2
+ import{ai as x,w as p,aj as y,ak as j,al as P,am as g,o as R,s as f,j as e,r as v,an as w,m as E,_ as S}from"./index-008wj-Pz.js";import{P as r}from"./public-shell-ready-DXUTTGGp.js";const _=E(async()=>({default:(await S(async()=>{const{EntityPage:a}=await import("./entity-page-BUghWZ1s.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]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(w,{})})}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:i}=g(u,{slug:a},{includeBootstrap:!0}),{session:h,isReady:o}=R();return f({active:!n&&o&&!h&&(!!i||!t),owner:a}),n||!o&&!t?e.jsx(c,{}):i||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't resolve this path."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsx(v.Suspense,{fallback:e.jsx(c,{}),children:e.jsx(_,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})]})}export{L as component};
3
+ //# sourceMappingURL=_-XKF0m81R.js.map
@@ -0,0 +1,2 @@
1
+ import{ca as t,w as p,j as a,cb as e,ak as s}from"./index-008wj-Pz.js";import{A as n}from"./activity-route-view-voRYSM3a.js";import"./record-activity-BXhvJbd9.js";import"./filter-bar-COU0sBFQ.js";import"./calendar-DDCCSPW6.js";import"./connection-label-BobuYiAG.js";import"./runs-lG2ChtOt.js";import"./source-record-panels-CjFPgKKJ.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./use-automations-C4TSie1i.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./copy-button-Df7QXE0w.js";import"./events-feed-VfU4csn2.js";import"./client-activity-scopes-BLIy1Zc3.js";import"./client-rows-DiJQ5D1z.js";import"./agent-loading-shells-CamDtzHY.js";import"./member-scope-gate-De75CR7W.js";import"./public-shell-ready-DXUTTGGp.js";function z(){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{z as component};
2
+ //# sourceMappingURL=_-e8MbEBtw.js.map
@@ -0,0 +1,2 @@
1
+ import{v as L,gv as w,r as u,gw as C,j as n,h as D,cF as S,o as E,ap as P,b8 as M,a$ as N,bi as R,co as O,gx as $,gy as B,bu as F,E as Q}from"./index-008wj-Pz.js";import{L as z,A as H}from"./agent-thread-CsRexwTv.js";import{A as U,C as W}from"./agent-loading-shells-CamDtzHY.js";import"./app-bridge-C4nPtae3.js";import"./use-mention-search-PfZrNbu_.js";import"./index-wHFQv1aT.js";import"./use-automations-C4TSie1i.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./copy-button-Df7QXE0w.js";import"./events-feed-VfU4csn2.js";import"./client-activity-scopes-BLIy1Zc3.js";import"./client-rows-DiJQ5D1z.js";function _({owner:e,agent:s,threadId:t,afterMessagesContent:d,className:r,initialDraft:h,newChatRequested:f=!1,preventAutoNavigate:p}){const o=L(),i=s.agentId,{data:a=[]}=w(i,{orgSlug:e}),[l,x]=u.useState(()=>C()),[g,v]=u.useState(null);u.useEffect(()=>{!f||t||(x(C()),v(null),o({to:".",search:(m=>{const{new:b,...y}=m;return y}),replace:!0}))},[f,t,o]);const A=u.useMemo(()=>!g||a.some(m=>m.id===g.id)?a:[g,...a],[a,g]),c=t??l,T=!t||!A.some(m=>m.id===t),j=u.useCallback(()=>{if(A.some(b=>b.id===c))return;v({id:c,title:`Conversation ${A.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const m=S(e,i,c);o({...m,replace:!0})},[A,c,o,e,i]),k=u.useCallback(()=>{T&&!p&&j()},[T,j,p]);return n.jsx("div",{className:D("flex min-h-0 flex-1 flex-col",r),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(z,{agentId:i,workspaceSlug:e,thread:c,loadHistory:!!t,onFirstUserMessage:k,initialDraft:h,children:n.jsx(H,{afterMessagesContent:d})},`${i}:${c}`)})})}function q({owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:f}){const{isAuthenticated:p}=E(),{isMember:o,isLoading:i}=P(),a=p&&o,{data:l=[],isLoading:x}=M({enabled:a}),g=s??null,v=l.find(c=>c.agentId===g)??null;return a&&x||i?n.jsx(U,{}):v?n.jsx(_,{owner:e,agent:v,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:f,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 G(e){return[...e].sort((s,t)=>t.updatedAt-s.updatedAt)[0]}function J({owner:e,agentId:s,threadId:t,initialDraft:d,forceComposer:r=!1,newChatRequested:h=!1,afterMessagesContent:f,preventAutoNavigate:p}){const o=L(),{data:i=[],isLoading:a}=O($(e,s,{strict:!1})),l=u.useMemo(()=>G(i),[i]);return u.useEffect(()=>{if(t||r||a||!l)return;const x=S(e,s,l.id);o({...x,replace:!0})},[s,a,l,o,e,t,r]),!t&&!r&&(a||l)?n.jsx(W,{}):n.jsx(q,{owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:h,afterMessagesContent:f,preventAutoNavigate:p})}function ft(){const{owner:e,agentId:s}=B.useParams(),{threadId:t}=F({strict:!1}),{new:d,prompt:r}=Q({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 pt-2.5 pb-4 lg:px-6 lg:pb-6",children:n.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:n.jsx(J,{owner:e,agentId:s,threadId:t,initialDraft:r,forceComposer:!t,newChatRequested:!!d})})})}export{ft as component};
2
+ //# sourceMappingURL=_agentId-Cv9goIFf.js.map
@@ -0,0 +1,2 @@
1
+ import{hm as r,j as e}from"./index-008wj-Pz.js";import{A as m}from"./agents-workbench-CmGrMvPC.js";import"./agent-editor-form-QrIDroFL.js";import"./model-selector-3l9lY50C.js";import"./proposal-review-shell-CVkLnnKo.js";import"./runs-lG2ChtOt.js";function c(){const{owner:o,agentId:t}=r.useParams();return e.jsx(m,{owner:o,agentId:t})}export{c as component};
2
+ //# sourceMappingURL=_agentId-emObu67X.js.map
@@ -0,0 +1,2 @@
1
+ import{v as A,t as b,am as L,o as k,ap as C,j as t,gs as R,L as d,gt as _,bi as $,S as B,B as p,bg as D,hd as u,av as S}from"./index-008wj-Pz.js";import{A as y}from"./automation-detail-content-DMYxs6F6.js";import{b as O}from"./use-automations-C4TSie1i.js";import"./create-automation-form-DHW6OUoS.js";import"./cronstrue-xxpD1P2-.js";import"./entity-options-DJv2EhVV.js";import"./connection-label-BobuYiAG.js";import"./model-selector-3l9lY50C.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-BFZa4EIt.js";import"./index-wHFQv1aT.js";import"./use-mention-search-PfZrNbu_.js";import"./proposal-review-shell-CVkLnnKo.js";import"./runs-lG2ChtOt.js";import"./events-feed-VfU4csn2.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./copy-button-Df7QXE0w.js";import"./client-activity-scopes-BLIy1Zc3.js";import"./client-rows-DiJQ5D1z.js";function P({owner:a,automationId:o,view:s,runId:e}){const n=A(),{orgContext:x,hasOrgContext:g}=b(),{data:h,isLoading:r}=L(`/${a}`,x),{isAuthenticated:v}=k(),{isLoading:m}=C(),f=h?.workspace?.id??"",j=v?!g||r||m:r||m,i=O(o,void 0,f).data?.automation,c=i?.automation_name??"Automation",w=()=>void n({to:"/$owner/automations",params:{owner:a}}),l=()=>void n({to:"/$owner/automations/$automationId",params:{owner:a,automationId:o},search:{view:"activity",run_id:void 0}}),N=!e&&s==="definition";return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsxs("div",{className:"mx-auto flex w-full min-w-0 max-w-3xl flex-col gap-4",children:[t.jsx(R,{crumbs:[t.jsx(d,{to:"/$owner/automations",params:{owner:a},className:_,children:"Automations"},"automations")],current:e?"Review change":c}),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($,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),j&&!i?t.jsx(B,{className:"h-5 w-40"}):e?"Review change":c]})}),e?null:N?t.jsx(p,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:l,children:"Done"}):t.jsx(p,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs(d,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:o},search:{view:"definition",run_id:void 0},children:[t.jsx(D,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),t.jsx(y,{owner:a,agentId:i?.managed_agent_id??null,automationId:o,view:s,runId:e,onDone:e?w:l})]})})}function ct(){const{owner:a,automationId:o}=u.useParams(),s=u.useSearch();return t.jsx(S,{owner:a,children:()=>t.jsx(P,{owner:a,automationId:o,view:s.view,runId:s.run_id})})}export{ct as component};
2
+ //# sourceMappingURL=_automationId-CfFFAYK1.js.map
@@ -0,0 +1,2 @@
1
+ import{iE as I,j as e,av as U,v as q,aC as z,aD as J,cn as Q,d6 as X,S as E,B as Y,L as p,aF as Z,ij as K,ik as ee,aT as ne,gt as h,g1 as se,gr as ae,b5 as oe,hW as te,gs as ie,hy as R,aN as ce,F as re}from"./index-008wj-Pz.js";import{R as de,c as me,C as le}from"./device-pin-tombstone-B_te59GE.js";import{a as pe}from"./connector-provenance-BIg8P8WY.js";import{f as ue,C as he,F as xe,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-B6ydKasK.js";import{S as Ne,g as De}from"./runs-panel-LnGpHCAQ.js";import{c as ge}from"./connection-label-BobuYiAG.js";import"./connector-scope-lists-CJYz53YF.js";import"./status-dot-CSBtKT4g.js";import"./entity-options-DJv2EhVV.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./use-automations-C4TSie1i.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./copy-button-Df7QXE0w.js";import"./feed-event-kinds-BYuZCoU4.js";import"./runs-lG2ChtOt.js";import"./filter-bar-COU0sBFQ.js";function ze(){const{owner:m,connectorKey:n,connectionId:v}=I.useParams(),{addFeed:o,feedId:c,settings:x,auth_result:t}=I.useSearch();return e.jsx(U,{owner:m,children:l=>e.jsx($e,{organizationId:l.organizationId,ownerSlug:l.ownerSlug,isWorkspaceLoading:l.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:o===!0,feedId:c,openSettings:x===!0,authResult:t})})}function $e({organizationId:m,ownerSlug:n,isWorkspaceLoading:v,connectorKey:o,connectionId:c,showAddFeed:x,feedId:t,openSettings:l,authResult:y}){const A=q(),{data:B=[]}=z(),{data:M=[],isLoading:P,isError:j,refetch:T}=J(m??"",{connectorKey:o,connectionIds:[c]}),{data:g=[]}=Q(m??""),{data:W=[],isLoading:O,isError:S,refetch:H}=X(t?c:null),s=M.find(i=>i.id===c),a=g.find(i=>i.key===o),r=t?W.find(i=>i.id===t):null;if(v||P||t&&O||!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(E,{className:"h-7 w-56"}),e.jsx(E,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||t&&S)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Y,{variant:"outline",size:"sm",onClick:()=>void(j?T():H()),children:"Retry"})]});if(!s)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",a?.name??o]})]});const $=ge({...s,connector_name:s.connector_name??a?.name??null}),C=!t&&!x,V=()=>void A({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},replace:!0});let u,f=$,F,k,N;t?r?(f=ue(r,a),r.store==="channel_messages"?(u=e.jsx(he,{feed:r,hideHeader:!0}),N="chat channel"):(F=e.jsx(xe,{feed:r,ownerSlug:n}),k=e.jsx(fe,{feed:r}),u=e.jsx(ve,{feed:r,connectorDef:a,ownerSlug:n}))):(u=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),f="Feed"):x&&(u=e.jsx(je,{onClose:V,organizationId:m,connections:[s],connectorDefinitions:g}),f="Add feed",N=Ce);const d=B.find(i=>i.id===s.device_worker_id&&Z(i,n)),w=d?K(d):void 0,D=w?ee(n,w,ne()):void 0,_=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:h,children:"Connectors"},"connectors"),...d&&D?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:D.id},className:h,children:D.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:h,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:h,children:a?.name??o},"connector")]];C||_.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},className:h,children:$},"connection"));const b=C?me(s):null,G=N??b??void 0,L=e.jsx(ae,{breadcrumb:e.jsx(ie,{crumbs:_}),icon:a?e.jsx(oe,{icon:a.icon,name:a.name,faviconDomain:a.favicon_domain??te(a.auth_schema)}):null,title:f,status:F??e.jsx(Ne,{status:De(s.status),showDot:!0,children:s.status}),meta:k,caption:G,captionTone:b?"error":"muted"});return C?d&&a&&ce(a)?e.jsx(re,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},search:{connection:s.id,settings:l||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(R,{header:L,children:[e.jsx(pe,{connectorDef:a,connectorKey:o,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(le,{embedded:!0,connection:s,connectorDef:a,ownerSlug:n,openSettings:l,authResult:y},s.id)]}):e.jsx(R,{header:L,children:e.jsx("div",{className:"mt-0",children:u})})}export{ze as component};
2
+ //# sourceMappingURL=_connectorKey._connectionId-D6NKXSOE.js.map
@@ -0,0 +1,2 @@
1
+ import{az as Se,aA as Pe,aB as De,aL as le,aI as ee,hx as Ye,g3 as Qe,j as e,hy as se,B as j,L as B,aK as oe,gr as te,gs as ne,gt as M,hz as Je,a2 as Ze,hA as Z,r as m,hB as be,hC as Ee,cS as es,hD as Ce,bP as U,hE as ke,H as w,bv as ss,bw as ts,bx as ns,by as as,bz as rs,ht as is,I as P,bG as G,a5 as z,A as we,hF as ls,hG as os,bk as _e,hH as cs,b9 as ce,hI as ds,hJ as us,hK as Fe,hL as Be,hM as Le,dk as Re,V as _,bf as ae,hN as ms,fN as hs,hO as xs,et as Ke,S as k,g4 as T,v as H,hP as ps,dI as js,dK as fs,dJ as gs,hQ as q,hR as vs,av as Ns,u as de,g6 as ue,hS as ys,aO as bs,hT as Cs,hU as ks,g2 as ws,ay as Ae,ax as As,aD as $s,b1 as Ss,aG as F,hV as Oe,b6 as Ie,b5 as me,b2 as Ps,h as Ds,hW as Es}from"./index-008wj-Pz.js";import{C as _s,A as Fs}from"./connect-menu-D2K4tmvW.js";import{C as Bs,A as Ue,a as Me}from"./connections-browser-BMV8bf54.js";import{C as Ls}from"./connector-provenance-BIg8P8WY.js";import{u as Rs}from"./runs-lG2ChtOt.js";import"./connection-label-BobuYiAG.js";import"./status-dot-CSBtKT4g.js";function Ks({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",l=Se({enabled:n}),d=Pe({enabled:n}),u=De({enabled:!n}),c=n?l:u,o=n?d.data?.find(r=>r.slug===a)?.displayName??a:le(a),p=(n?(l.data??[]).filter(r=>r.kind===a).map(r=>({key:`${ee}${r.slug}`,name:r.displayName||r.slug,status:[r.isDefault?"Default":null,r.status].filter(Boolean).join(" · ")})):(u.data?.sandboxes??[]).filter(r=>r.providerKind===a).map(r=>({key:`${Ye}${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:Qe({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:r.key},search:{}})})),h=`${n?ee:oe}${a}`;return e.jsx(se,{header:e.jsx(te,{title:o,breadcrumb:e.jsx(ne,{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:n?e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:h},search:{addAccount:!0},children:"Add connection"})}):e.jsx(Ue,{ownerSlug:s,connectorKey:h})})})}function Os({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:l,onDone:d}){const u=Je(),c=Ze(),o=s.find(i=>i.slug===t)??s[0],p=n&&o&&Z(o)?"oauth":"api-key",[h,r]=m.useState(o?.slug??""),[g,b]=m.useState(a??o?.slug??""),[x,N]=m.useState(o?.displayName??""),[v,A]=m.useState(o?.baseUrl??""),[E,$]=m.useState(l??o?.defaultModel??""),[D,V]=m.useState(""),[X,K]=m.useState(o?.apiKeyPlaceholder??""),[W,O]=m.useState(p),[L,Y]=m.useState(""),[C,re]=m.useState(null),[I,R]=m.useState(!1),[he,xe]=m.useState(!1),f=s.find(i=>i.slug===h),Q=be(f?.modalities??[]),pe=n&&!!f&&Z(f),je=f?Ee(f):!1,fe=pe&&W==="oauth",ge=je&&!fe,S=es().slug,J=m.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Te=m.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),ze=m.useCallback(async()=>{if(!(!S||!f)){R(!0);try{const i=await Ce(S,f.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,f]),Ve=m.useCallback(async()=>{if(!(!S||!f||!L.trim())){R(!0);try{const i=await ke(S,f.slug,{code:L.trim()});if(i.status!=="success")throw new Error(i.error||"Sign-in not complete");J(),U.success(`Signed in with ${f.displayName}`)}catch(i){U.error(i instanceof Error?i.message:"Failed to complete sign-in")}finally{R(!1)}}},[S,f,L,J]),We=m.useCallback(async()=>{if(!(!S||!f)){R(!0);try{const i=await Ce(S,f.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,f]),Ge=m.useCallback(async()=>{if(!(!S||!f||!C)){R(!0);try{const i=await ke(S,f.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(i.status==="success"){J(),U.success(`Signed in with ${f.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,f,C,J]),qe=f?.supportedAuthTypes.includes("device-code")??!1,He=i=>{r(i);const y=s.find(ie=>ie.slug===i);y&&(b(y.slug),N(y.displayName),A(y.baseUrl),$(y.slug===t&&l?l:y.defaultModel??""),K(y.apiKeyPlaceholder),O(n&&Z(y)?"oauth":"api-key"),Y(""),re(null),xe(!1))},ve=/^[a-z0-9][a-z0-9-]*$/.test(g),Ne=ve&&ge&&D.trim().length>0&&!u.isPending,Xe=i=>{if(i.preventDefault(),!Ne)return;const y={};v.trim()&&(y.base_url=v.trim()),E.trim()&&(y.model=E.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;u.mutate({slug:g.trim(),kind:h,displayName:x.trim()||void 0,apiKey:D.trim(),capabilities:ie},{onSuccess:()=>d()})},ye=!!(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:ye&&f?`Connect ${f.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Xe,className:"grid max-w-md gap-3",children:[ye&&f?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(w,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ss,{value:h,onValueChange:He,children:[e.jsx(ts,{id:"ip-provider",className:"w-full",children:e.jsx(ns,{})}),e.jsx(as,{children:s.map(i=>{const y=be(i.modalities);return e.jsx(rs,{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(is,{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(w,{htmlFor:"ip-display",children:"Name"}),e.jsx(P,{id:"ip-display",placeholder:"Friendly name",value:x,onChange:i=>N(i.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(P,{id:"ip-slug",placeholder:"my-provider",value:g,onChange:i=>b(i.target.value),autoComplete:"off",required:!0}),g&&!ve?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."})]}),pe&&je?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{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,ge?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(P,{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(w,{htmlFor:"ip-model",children:"Default model"}),e.jsx(P,{id:"ip-model",placeholder:"gpt-4o-mini",value:E,onChange:i=>$(i.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(P,{id:"ip-key",type:"password",placeholder:X||void 0,value:D,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(G,{onCancel:d,children:e.jsx(j,{type:"submit",disabled:!Ne,children:u.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):fe?e.jsxs("div",{className:"grid gap-3",children:[he?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",f?.displayName??"provider",". This covers your agents in this org."]}):qe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:I||!S,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(P,{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 ",f?.displayName??"provider"," to approve",e.jsx(we,{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 Ge(),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 ze(),disabled:I||!S,children:["Sign in with ",f?.displayName??"provider",e.jsx(we,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(P,{id:"ip-oauth-code",placeholder:"code#state",value:L,onChange:i=>Y(i.target.value),autoComplete:"off"})]}),e.jsx(j,{type:"button",className:"justify-self-start",onClick:()=>void Ve(),disabled:I||!L.trim(),children:I?"Finishing...":"Finish sign-in"})]}),e.jsx(G,{onCancel:d,children:e.jsx(j,{type:"button",onClick:Te,disabled:!he,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(G,{onCancel:d})]})]})]})}const Is={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Us({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[l,d]=m.useState(a?"edit":null),u=os(s.kind,t);m.useEffect(()=>{a&&d("edit")},[a]);const o=(t.find(r=>r.slug===s.kind)?.modalities??["text"]).filter(r=>r!=="text"),p=u&&o.length>0,h=r=>d(g=>g===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 ${_e(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:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),p?e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>h("capabilities"),children:"Configure"}):null,e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>h("edit"),children:"Edit"})]})]}),l==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(Ts,{provider:s,supportsUpstreamConfig:u,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 a=cs(),[n,l]=m.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>l(!1)}),children:[a.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.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:a}){const n=ds(),l=us(),d=Fe(),[u,c]=m.useState(s.displayName??""),[o,p]=m.useState(""),h=s.capabilities.text??{},[r,g]=m.useState(h.base_url??""),[b,x]=m.useState(h.model??""),[N,v]=m.useState(null),A=u.trim().length>0&&u.trim()!==(s.displayName??""),E=t&&o.trim().length>0,$=r.trim()!==(h.base_url??""),D=b.trim()!==(h.model??""),V=t&&($||D),X={base_url:r.trim()||void 0,model:b.trim()||void 0,models_endpoint:h.models_endpoint},K=Be(X),W=t&&V&&Le(K),O=n.isPending||l.isPending||d.isPending,L=(A||E||V)&&!W&&!O,Y=async C=>{if(C.preventDefault(),!!L){v(null);try{await Promise.all([A?n.mutateAsync({providerSlug:s.slug,displayName:u.trim()}):Promise.resolve(),V?d.mutateAsync({providerSlug:s.slug,modality:"text",block:X}):Promise.resolve(),E?l.mutateAsync({providerSlug:s.slug,value:o.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:Y,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(P,{id:`edit-name-${s.slug}`,value:u,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(w,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(P,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:r,onChange:C=>g(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(w,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(P,{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(w,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(P,{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(G,{onCancel:a,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:a}){const n=Fe(),[l,d]=m.useState(!1),[u,c]=m.useState(a.base_url??""),[o,p]=m.useState(a.model??""),[h,r]=m.useState(a.models_endpoint??""),[g,b]=m.useState(!!a.models_endpoint),x=!!(a.base_url||a.model||a.models_endpoint),N={base_url:u.trim()||void 0,model:o.trim()||void 0,models_endpoint:h.trim()||void 0},v=Be(N),A=Le(v),E=()=>{A||n.mutate({providerSlug:s,modality:t,block:N})};return e.jsxs("div",{className:Re,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d($=>!$),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(w,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(P,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:u,onChange:$=>c($.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(w,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(P,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:o,onChange:$=>p($.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),g?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(P,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:h,onChange:$=>r($.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(G,{onCancel:()=>d(!1),children:e.jsx(j,{size:"sm",disabled:A||n.isPending,onClick:E,children:n.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(Gs,{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(([a,n])=>`${a}: ${n}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(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 a=ms(),[n,l]=m.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(z,{}):"Delete permanently"}),e.jsx(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 Gs({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 qs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Hs={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function jt(){const{owner:s,connectorKey:t}=q.useParams(),{instances:a}=q.useSearch(),{kind:n,id:l}=vs(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:u,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Ks,{ownerSlug:d,familyKind:n,familyId:l});switch(n){case"inference":return e.jsx(Qs,{ownerSlug:d,providerSlug:l});case"sandbox":return e.jsx(Ys,{ownerSlug:d,sandboxId:l});case"sandbox-provider":return e.jsx(Xs,{ownerSlug:d,providerKind:l});default:return e.jsx(st,{ownerSlug:d,organizationId:u,isWorkspaceLoading:c,connectorKey:t})}}})}function Xs({ownerSlug:s,providerKind:t}){const a=H();return m.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${oe}${t}`},replace:!0})},[a,s,t]),null}function Ys({ownerSlug:s,sandboxId:t}){const a=H(),{data:n,isLoading:l,isError:d,refetch:u}=De(),c=n?.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(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{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 u(),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 a({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(se,{header:e.jsx(te,{breadcrumb:e.jsx(ne,{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(me,{name:o,faviconDomain:Ps(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(Ie,{facets:Hs})}),children:[e.jsx(Vs,{sandbox:c}),e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Qs({ownerSlug:s,providerSlug:t}){const a=H(),{model:n,reason:l,agentId:d,addAccount:u}=q.useSearch(),{data:c=[],isLoading:o,isError:p,refetch:h}=Se(),r=Pe(),{data:g=[],isLoading:b}=r,x=u?null:c.find(D=>D.slug===t)??null,N=g.find(D=>D.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(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{className:"h-16 w-full rounded-lg"}),e.jsx(k,{className:"h-24 w-full rounded-lg"}),e.jsx(k,{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 h(),children:"Retry"})]})});if(!x&&!N&&!r.isError)return e.jsxs(F,{className:"space-y-3",children:[e.jsx(Oe,{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,E=l?e.jsx(et,{agentId:d,model:n,providerName:v}):n?e.jsx(Zs,{providerName:v,model:n,isConnected:A}):null,$=e.jsx(te,{breadcrumb:e.jsx(ne,{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(me,{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(Ie,{facets:qs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(se,{header:$,children:[E,e.jsx("div",{className:"space-y-6",children:x?e.jsx(Us,{provider:x,catalog:g,autoOpenEdit:!!n}):e.jsx(Js,{ownerSlug:s,providerSlug:t,existingSlugs:c.map(D=>D.slug),catalog:g,catalogError:r.isError?r.error:null,model:n})}),x?e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ms,{provider:x,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Js({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:l,model:d}){const u=H(),c=n.find(h=>h.slug===t),o=a.includes(t)&&!!c&&Z(c);let p=t;for(let h=2;a.includes(p);h++)p=`${t}-${h}`;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&&Ee(c))&&e.jsx(Os,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!o,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void u({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function Zs({providerName:s,model:t,isConnected:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(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}),"."," ",a?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function et({agentId:s,model:t,providerName:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(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:a}),", 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:a,connectorKey:n}){const{data:l=[],isLoading:d,isError:u,refetch:c}=As(t??""),{data:o=[],isLoading:p,isError:h,refetch:r}=$s(t??"",{connectorKey:n}),{setup:g}=q.useSearch(),b=q.useNavigate(),x=m.useMemo(()=>l.find(A=>A.key===n),[l,n]),N=m.useMemo(()=>Ss(n,l,{name:o[0]?.connector_name??n}),[n,l,o]);if(a||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(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{className:"h-16 w-full rounded-lg"}),e.jsx(k,{className:"h-24 w-full rounded-lg"}),e.jsx(k,{className:"h-32 w-full rounded-lg"})]})});if(u||h)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(nt,{connector:x,ownerSlug:s,organizationId:t??void 0,connectionCount:o.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Oe,{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:n,connections:o,isLoading:p,openNewApp:g==="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(Me,{section:!0,connections:o,ownerSlug:s,connectorKey:n}):p?e.jsx(k,{className:"h-8 w-40"}):e.jsx("div",{children:e.jsx(Ue,{ownerSlug:s,connectorKey:n})})]})})}function tt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:l,connections:d,isLoading:u,openNewApp:c,onNewAppHandled:o}){const{isAdmin:p,isLoading:h}=Ke(a),r=(t.operations_summary?.total??0)>0,g=e.jsx(_s,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:o});return e.jsxs(se,{header:s,children:[u?e.jsx(k,{className:"h-8 w-40"}):d.length>0?e.jsx(Me,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:l,action:g}):g,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(ot,{connector:t,organizationId:a,ownerSlug:n}),r&&h?e.jsx(k,{className:"h-20 w-full rounded-lg"}):r&&p?e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}):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,!u&&d.length>0?e.jsx(it,{connectorKey:l,organizationId:a,ownerSlug:n}):null]}),e.jsx(at,{connector:t,organizationId:a,ownerSlug:n})]})}function nt({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(te,{breadcrumb:e.jsx(ne,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:t},className:M,children:"Connectors"},"connectors")]}),icon:e.jsx(me,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Es(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Ls,{connectorDef:s,ownerSlug:t}),a?e.jsx(rt,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function at({connector:s,organizationId:t,ownerSlug:a}){const n=ys(s.auth_schema),l=bs(s.auth_schema),d=Cs(s.auth_schema),u=ks(s.auth_schema),c=n.some(N=>N.type==="env_keys"),o=n.some(N=>N.type==="browser"),p=l.some(N=>N.type==="interactive"),h=!!(d||u||c||o),r=ws(s),{data:g=[]}=Ae(t,{connectorKey:s.key,profileKind:"env"}),{data:b=[]}=Ae(t,{profileKind:"browser_session",connectorKey:s.key});return c&&g.length>0||o&&b.length>0||!h&&(r||p)?e.jsxs("div",{className:"space-y-6",children:[c&&g.length>0?e.jsx($e,{profiles:g,type:"env"}):null,o&&b.length>0?e.jsx($e,{profiles:b,type:"browser_session"}):null,h?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:a},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:a,connectionCount:n}){const l=H(),{isAdmin:d}=Ke(t),u=ps(),[c,o]=m.useState(null),p=s.installed!==!1;if(!d||!p)return null;const h=n>0,r=u.isPending,g=()=>{o(null),u.mutate({connector_key:s.key},{onSuccess:()=>{l({to:"/$owner/connectors",params:{owner:a}})},onError:b=>{o(b instanceof Error?b.message:"Failed to remove connector")}})};return e.jsxs(js,{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(gs,{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."}),h?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(j,{variant:"destructive",size:"sm",disabled:r||h,onClick:g,children:[r?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function it({connectorKey:s,organizationId:t,ownerSlug:a}){const n=de(),{data:l,isLoading:d}=Rs({connectorKey:s},{runTypes:void 0,status:void 0},a);if(d)return e.jsx(k,{className:"h-[62px] w-full rounded-lg"});const u=l?.pages[0],c=u?.total??0,o=u?.runs[0]?.created_at;return e.jsx(ue,{title:"Runs",summary:c===0?"No runs yet":`${c.toLocaleString()} ${c===1?"run":"runs"}${o?` · last ${_e(o)}`:""}`,onOpen:()=>n?.open({href:"",title:"Runs",connectorPanel:{section:"runs",connectorKey:s,organizationId:t,ownerSlug:a}})})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=de();return e.jsx(ue,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function $e({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(T,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:Ds(Re,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:n.display_name}),e.jsx(Fs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function ot({connector:s,organizationId:t,ownerSlug:a}){const n=de(),l=Object.keys(s.feeds_schema??{}).length;return l?e.jsx(ue,{title:"Feeds",summary:`${l} ${l===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{tt as ConnectorDetailShell,rt as ConnectorRemoveButton,jt as component};
2
+ //# sourceMappingURL=_connectorKey.index-DFrkLLTU.js.map
@@ -0,0 +1,2 @@
1
+ import{j as e,cO as A,h as m,j2 as h,j3 as p,j4 as d,j5 as u,j6 as w,r as M,ap as C,aD as k,j7 as z}from"./index-008wj-Pz.js";import{A as N}from"./agent-loading-shells-CamDtzHY.js";import{s as b,R as y,A as O}from"./agent-thread-CsRexwTv.js";import"./app-bridge-C4nPtae3.js";import"./use-mention-search-PfZrNbu_.js";import"./index-wHFQv1aT.js";import"./use-automations-C4TSie1i.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./copy-button-Df7QXE0w.js";import"./events-feed-VfU4csn2.js";import"./client-activity-scopes-BLIy1Zc3.js";import"./client-rows-DiJQ5D1z.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:`#${p.hex}`,path:p.path},whatsapp:{hex:`#${h.hex}`,path:h.path}};function I({platform:s,className:a}){const t=s?T[s]:null;return t?"imgSrc"in t?e.jsx("img",{src:t.imgSrc,alt:"","aria-hidden":"true",className:m("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:m("text-muted-foreground",a),"aria-hidden":"true"})}const L={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(s,a,t){return s==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function S({owner:s,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=w(a,t,{orgSlug:s}),i=M.useMemo(()=>n.map(o=>b(o,{showToolCalls:!0})).filter(o=>o!==null),[n]),[r,g]=t.split(":"),l=L[r]??"the source app",{org:f}=C(),{data:j=[]}=k(f?.id??"",{connectorKey:r}),v=j[0]?.config?.chatMetadata,c=R(r,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})}),c?e.jsxs("a",{href:c,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:r,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 ",l,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",l," →"]})]}):null]})})}function e2(){const{owner:s,agentId:a,conversationId:t}=z.useParams();return e.jsx(S,{owner:s,agentId:a,conversationId:t})}export{e2 as component};
2
+ //# sourceMappingURL=_conversationId-D3vuAQPe.js.map
@@ -0,0 +1,2 @@
1
+ import{E as u,v,j as a,av as x,c6 as d,c7 as f,c8 as h,bu as w,c9 as j}from"./index-008wj-Pz.js";import{E}from"./event-detail-BKSGEOdW.js";import"./events-feed-VfU4csn2.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./use-automations-C4TSie1i.js";import"./clients-8-EpRjsm.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./copy-button-Df7QXE0w.js";import"./client-activity-scopes-BLIy1Zc3.js";import"./client-rows-DiJQ5D1z.js";import"./view-param-filters-DkX4YdDT.js";import"./app-bridge-C4nPtae3.js";import"./filter-bar-COU0sBFQ.js";function P({owner:e,eventId:t,viewKey:s}){const o=u({strict:!1}),p=v(),m=(i,r)=>a.jsx(E,{owner:r,organizationId:i,eventId:t,viewKey:s,params:s?f(o):{},onParamsChange:(n,l,c)=>void p({to:d(r,t,n),search:l,replace:c?.replace??!0}),fullBleed:!0},`${r}/${t}`);return a.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:e==="me"?m(null,e):a.jsx(x,{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 A(){const{owner:e,eventId:t}=h.useParams(),s=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(t);return o===null?null:a.jsx(P,{owner:e,eventId:o,viewKey:s?.viewKey})}export{A as component};
2
+ //# sourceMappingURL=_eventId-BV5SQaUA.js.map
@@ -0,0 +1,2 @@
1
+ import{j1 as a,j as e}from"./index-008wj-Pz.js";import{b as i}from"./agent-guardrails-route-CyoGSxcZ.js";import"./model-selector-3l9lY50C.js";import"./agent-subpage-shell-CLqpn5Tb.js";import"./table-DHM-vCxP.js";import"./agent-loading-shells-CamDtzHY.js";import"./agent-card-controls-DiU7Un5w.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-DjtJMop4.js.map
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-D7yt0PrA.js","assets/index-008wj-Pz.js","assets/index-BiEf5xOE.css","assets/automation-detail-content-DMYxs6F6.js","assets/create-automation-form-DHW6OUoS.js","assets/cronstrue-xxpD1P2-.js","assets/entity-options-DJv2EhVV.js","assets/connection-label-BobuYiAG.js","assets/use-automations-C4TSie1i.js","assets/model-selector-3l9lY50C.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-BFZa4EIt.js","assets/index-wHFQv1aT.js","assets/use-mention-search-PfZrNbu_.js","assets/proposal-review-shell-CVkLnnKo.js","assets/runs-lG2ChtOt.js","assets/events-feed-VfU4csn2.js","assets/event-card-CBlsG32u.js","assets/use-scroll-sentinel-D-fJx_Md.js","assets/clients-8-EpRjsm.js","assets/renderer-AJxSmE3-.js","assets/calendar-DDCCSPW6.js","assets/table-DHM-vCxP.js","assets/card-BCsbrdGs.js","assets/json-diff-LE_vNZrM.js","assets/copy-button-Df7QXE0w.js","assets/client-activity-scopes-BLIy1Zc3.js","assets/client-rows-DiJQ5D1z.js","assets/agent-loading-shells-CamDtzHY.js","assets/agent-thread-CsRexwTv.js","assets/app-bridge-C4nPtae3.js","assets/connection-feed-detail-B6ydKasK.js","assets/runs-panel-LnGpHCAQ.js","assets/filter-bar-COU0sBFQ.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-D2K4tmvW.js","assets/connections-browser-BMV8bf54.js","assets/status-dot-CSBtKT4g.js","assets/connector-scope-lists-CJYz53YF.js","assets/source-record-panels-CjFPgKKJ.js","assets/schema-type-editor-panel-C_Es0qDf.js","assets/entity-type-page-Lf6ONdpf.js","assets/event-detail-BKSGEOdW.js","assets/view-param-filters-DkX4YdDT.js","assets/views-access-required-2ubIf_3N.js","assets/record-session-D07szzqN.js"])))=>i.map(i=>d[i]);
2
+ import{p as x,j as e,r as u,C as b,L as g,u as w,a as k,b as v,c as y,D as j,d as N,e as P,f as R,g as _,h as I,i as E,k as D,B as f,l as S,A,X as C,m as L,_ as z,S as h,R as O,n as T,o as B,q as W,s as $,N as H,O as K}from"./index-008wj-Pz.js";import{R as U}from"./record-session-D07szzqN.js";function p({item:s}){const n=s.href?x(s.href):null;if(!n)return null;const t=n.owner,i=n.kind==="automation"?n.automationId:s.sourceAttribution?.automation_id??null,o=s.sourceAttribution,a=[{label:t,to:"/$owner",params:{owner:t}}];return o?.agent_id&&o.agent_name&&a.push({label:o.agent_name,to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:o.agent_id}}),i!=null&&a.push({label:o?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:t,automationId:String(i)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?a.push({label:"Run details"}):n.kind==="event"?a.push({label:"Event details"}):n.kind==="memory"&&"contentIds"in n&&a.push({label:"Details"}),a.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:a.map((r,l)=>{const c=l===a.length-1,d=e.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:r.label});return e.jsxs(u.Fragment,{children:[l>0?e.jsx(b,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,r.to&&!c?e.jsx(g,{to:r.to,params:r.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:r.label}):d]},r.to??r.label)})})}const V=L(async()=>({default:(await z(async()=>{const{PeekPaneContent:s}=await import("./peek-pane-content-D7yt0PrA.js");return{PeekPaneContent:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]))).PeekPaneContent}));function q(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(h,{className:"h-5 w-2/3"}),e.jsx(h,{className:"h-4 w-full"}),e.jsx(h,{className:"h-24 w-full rounded-lg"})]})}const F=460,G=480;function M({children:s}){const n=u.useRef(null),t=w(),i=k(),o=v(n,F+G),a=!i&&o&&t?.item!=null;return e.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{inert:a,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:s}),e.jsx(Q,{covers:a})]})}function Q({covers:s=!1}){const n=w(),t=k();return n?.item?e.jsx(J,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:t,covers:s}):null}function X(s){const n=s.href?x(s.href):null,t=n?.kind==="record-view"?n.viewKey:null,i=n?.kind==="entity-type"?n:null,o=i?.typeSlug??null,a=E({slug:t?n?.owner:void 0}),{data:r}=D(o?n?.owner??null:null),l=o?r?.find(c=>c.slug===o)?.name:void 0;return t&&a.data?.find(c=>c.key===t)?.name||l&&(i?.view==="activity"?`${l} activity`:l)||s.title}function J({item:s,onClose:n,onBack:t,isNarrow:i,covers:o}){const a=s.href?y(s.href):null,r=X(s);u.useEffect(()=>{if(i)return;const d=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,i]);const l=d=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[t||d?e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:t??n,children:e.jsx(S,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:r}),a?e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:e.jsx(g,{to:a.pathname,search:a.search??{},onClick:n,children:e.jsx(A,{className:"h-4 w-4"})})}):null,e.jsx(f,{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(C,{className:"h-4 w-4"})})]}),c=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(u.Suspense,{fallback:e.jsx(q,{}),children:e.jsx(V,{item:s})})});return i?e.jsx(j,{open:!0,onOpenChange:d=>{d||n()},children:e.jsxs(N,{children:[e.jsx(P,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(R,{"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(_,{className:"sr-only",children:r}),l(!0),e.jsx(p,{item:s}),c]})]})}):e.jsxs("aside",{className:I("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:[l(!1),e.jsx(p,{item:s}),c]})}function ee(){const{owner:s}=O.useParams(),{data:n,isLoading:t,error:i}=T(s==="me"?null:s,{slug:s}),{session:o,isReady:a}=B(),r=W(i)&&!n?.workspace;return $({active:!t&&!r&&a&&!o&&!n?.workspace,owner:s})?null:e.jsx(H,{children:e.jsx(U,{children:e.jsx(M,{children:e.jsx(K,{})})})})}export{ee as component};
3
+ //# sourceMappingURL=_owner-oBX68rb9.js.map
@@ -0,0 +1,2 @@
1
+ import{iR as p,j as m,bt as i}from"./index-008wj-Pz.js";import{M as e}from"./memory-browse-page-p2vIbfkC.js";import"./public-shell-ready-DXUTTGGp.js";import"./connector-boxes-DqZA-FdG.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BMV8bf54.js";import"./status-dot-CSBtKT4g.js";import"./connector-scope-lists-CJYz53YF.js";import"./use-automations-C4TSie1i.js";import"./model-udnQ_S43.js";import"./cronstrue-xxpD1P2-.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C_Es0qDf.js";import"./entity-type-page-Lf6ONdpf.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./code-editor-BFZa4EIt.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./entity-avatar-CEV4ttUQ.js";import"./filter-bar-COU0sBFQ.js";import"./core.esm-A1UnFbGs.js";import"./view-param-filters-DkX4YdDT.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-De75CR7W.js";function C(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{C as component};
2
+ //# sourceMappingURL=_shape-C4lLPAwI.js.map
@@ -0,0 +1,2 @@
1
+ import{i$ as r,j as e}from"./index-008wj-Pz.js";import{b as m}from"./agent-skills-route-D-w3tY_2.js";import"./agent-skill-context-lWbXKEm1.js";import"./core.esm-A1UnFbGs.js";import"./skill-editor-D_W3QlRz.js";import"./agent-subpage-shell-CLqpn5Tb.js";import"./agent-loading-shells-CamDtzHY.js";import"./agent-card-controls-DiU7Un5w.js";function c(){const{owner:t,agentId:o,skillKey:i}=r.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:i})}export{c as component};
2
+ //# sourceMappingURL=_skillKey-Cw-7q6hI.js.map
@@ -1,2 +1,2 @@
1
- import{gc as m,o as x,q as d,fK as y,f9 as c,j as t,bx as g}from"./index-JmEl29py.js";import{E as u}from"./entity-type-page-BzMZttzh.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./code-editor-C8FJbT2P.js";function b(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=x(),o=d(),{data:i=[],isLoading:p}=y(s),e=i.find(l=>l.slug===n)??null,r=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:p?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:r,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
2
- //# sourceMappingURL=_slug-MHQU8ftJ.js.map
1
+ import{gq as m,t as d,v as x,fS as y,f8 as c,j as t,bF as g}from"./index-008wj-Pz.js";import{E as u}from"./entity-type-page-Lf6ONdpf.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./code-editor-BFZa4EIt.js";function b(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=d(),o=x(),{data:i=[],isLoading:p}=y(s),e=i.find(l=>l.slug===n)??null,r=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:p?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:r,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
2
+ //# sourceMappingURL=_slug-B2g5qzn3.js.map
@@ -0,0 +1,2 @@
1
+ import{iY as t,j as m}from"./index-008wj-Pz.js";import{M as i}from"./memory-browse-page-p2vIbfkC.js";import"./public-shell-ready-DXUTTGGp.js";import"./connector-boxes-DqZA-FdG.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BMV8bf54.js";import"./status-dot-CSBtKT4g.js";import"./connector-scope-lists-CJYz53YF.js";import"./use-automations-C4TSie1i.js";import"./model-udnQ_S43.js";import"./cronstrue-xxpD1P2-.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C_Es0qDf.js";import"./entity-type-page-Lf6ONdpf.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./code-editor-BFZa4EIt.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./entity-avatar-CEV4ttUQ.js";import"./filter-bar-COU0sBFQ.js";import"./core.esm-A1UnFbGs.js";import"./view-param-filters-DkX4YdDT.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-De75CR7W.js";function h(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{h as component};
2
+ //# sourceMappingURL=_viewKey-CIKGCtdK.js.map
@@ -0,0 +1,2 @@
1
+ import{j8 as p,j as i,bt as m}from"./index-008wj-Pz.js";import{M as e}from"./memory-browse-page-p2vIbfkC.js";import"./public-shell-ready-DXUTTGGp.js";import"./connector-boxes-DqZA-FdG.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BMV8bf54.js";import"./status-dot-CSBtKT4g.js";import"./connector-scope-lists-CJYz53YF.js";import"./use-automations-C4TSie1i.js";import"./model-udnQ_S43.js";import"./cronstrue-xxpD1P2-.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C_Es0qDf.js";import"./entity-type-page-Lf6ONdpf.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./code-editor-BFZa4EIt.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./entity-avatar-CEV4ttUQ.js";import"./filter-bar-COU0sBFQ.js";import"./core.esm-A1UnFbGs.js";import"./view-param-filters-DkX4YdDT.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-De75CR7W.js";function z(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{z as component};
2
+ //# sourceMappingURL=_viewKey-Dx4kJo7o.js.map
@@ -1,2 +1,2 @@
1
- import{k as l,ab as u,r as c,K as m,j as e,ac as d,ad as h,ae as f,a0 as v,af as x,a9 as g}from"./index-JmEl29py.js";import{F as p}from"./full-page-spinner-DtmqQmgl.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function b(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
2
- //# sourceMappingURL=accept-invitation-D2T_a2dj.js.map
1
+ import{o as l,ad as u,r as c,Q as m,j as e,ae as d,af as h,ag as f,a2 as v,ah as x,ab as g}from"./index-008wj-Pz.js";import{F as p}from"./full-page-spinner-C1Q_jEzD.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function b(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
2
+ //# sourceMappingURL=accept-invitation-38lHBvjO.js.map
@@ -1,2 +1,2 @@
1
- import{c4 as it,c5 as ot,c6 as ct,c7 as L,c8 as rt,c9 as T,ca as O,cb as D,cc as lt,cd as F,ce as dt,cf as E,r as y,cg as ut,ch as mt,ci as xt,j as e,cj as ft,ck as ht,cl as B,be as W,cm as pt,B as N,a3 as gt,cn as jt,co as yt,o as bt,an as Nt,cp as R,bl as A,cq as vt,q as U,ak as kt,cr as _t,bx as K,aR as k,cs as It,ct as _,cu as $t,cv as V,L as b,cw as Ct,bh as At,a$ as Et,cx as Rt,cy as Mt,cz as M,cA as St,cB as wt,T as G,cC as Lt,cD as Tt,cE as Y,cF as Ot,u as Dt,cG as Ft,cH as Pt,b as q,cI as zt,cJ as Ht,b6 as Bt,cK as Wt,cL as Ut,at as Kt}from"./index-JmEl29py.js";import{R as Vt,E as Gt,S as Yt,N as P,M as qt}from"./record-activity-Doeu5kPO.js";import{M as Jt}from"./member-scope-gate-Dit3MXBQ.js";import{u as Qt}from"./client-activity-scopes-CmK3DkSP.js";import{a as Zt}from"./client-rows-fFuxzFtE.js";import{P as Xt}from"./public-shell-ready-_awBxu2Y.js";function te(s,t,r){const c=lt(),a=r?.locale??c.locale??rt,i=it(s,t);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,f]=ot(r?.in,...i>0?[t,s]:[s,t]),n=ct(r?.roundingMethod??"round"),d=f.getTime()-l.getTime(),x=d/F,m=L(f)-L(l),u=(d-m)/F,j=r?.unit;let h;if(j?h=j:x<1?h="second":x<60?h="minute":x<T?h="hour":u<O?h="day":u<D?h="month":h="year",h==="second"){const p=n(d/1e3);return a.formatDistance("xSeconds",p,o)}else if(h==="minute"){const p=n(x);return a.formatDistance("xMinutes",p,o)}else if(h==="hour"){const p=n(x/60);return a.formatDistance("xHours",p,o)}else if(h==="day"){const p=n(u/T);return a.formatDistance("xDays",p,o)}else if(h==="month"){const p=n(u/O);return p===12&&j!=="month"?a.formatDistance("xYears",1,o):a.formatDistance("xMonths",p,o)}else{const p=n(u/D);return a.formatDistance("xYears",p,o)}}function ee(s,t){return te(s,dt(s),t)}const ne=4e3;function se(s){if(s?.kind!=="browser"||!s.url)return null;try{return new URL(s.url).origin}catch{return null}}function ae(s,t){const r=se(t),{data:c=[]}=E(r?s:null),a=y.useMemo(()=>new Set(c.filter(l=>r&&l.browser?.origins.includes(r)).map(l=>l.key)),[c,r]),i=!!s&&a.size>0,{data:o=[]}=ut({...mt.queryOptions(s,{status:"active",enabled:i}),enabled:i,refetchInterval:l=>l.state.data?.some(f=>a.has(f.connector_key)&&f.active_runs>0)?ne:!1});return y.useMemo(()=>o.filter(l=>a.has(l.connector_key)&&l.operations.includes("sync")),[o,a])}function ie(s){return s.active_runs>0?{text:"Syncing…",failed:!1}:s.last_sync_status==="failed"&&s.last_error?{text:s.last_error,failed:!0}:s.last_sync_at?{text:`Last synced ${ee(new Date(s.last_sync_at),{addSuffix:!0})}.`,failed:!1}:{text:"Not synced yet. Sync while you're signed in.",failed:!1}}function oe({organizationId:s,feeds:t}){const{data:r=[]}=E(s),c=xt();return t.length===0?null:e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx("ul",{className:"space-y-1",children:t.map(a=>{const i=ie(a),o=a.active_runs>0||c.isPending&&c.variables===a.id,l=[a.connection_name??a.connector_name??a.connector_key,a.display_name??a.feed_key].join(" · ");return e.jsx("li",{className:"rounded-lg bg-primary/5 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ft,{className:ht,children:e.jsx(B,{source:{platform:a.connector_key},connectorDefinitions:r,label:l,fallback:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"line-clamp-2 min-w-0 text-sm font-medium",children:l}),e.jsx("p",{className:i.failed?"mt-1 line-clamp-3 text-sm text-destructive":"mt-1 text-sm text-muted-foreground",children:i.text}),e.jsx(pt,{tag:"This page",children:a.device_label?`Connection · ${a.device_label}`:"Connection"}),e.jsx("div",{className:"mt-2",children:e.jsxs(N,{type:"button",size:"sm",variant:i.failed?"default":"outline",className:"h-7 text-xs",disabled:o,onClick:()=>c.mutate(a.id),children:[o?e.jsx(gt,{size:"sm",className:"mr-1"}):e.jsx(jt,{className:"mr-1 h-3 w-3"}),o?"Syncing":i.failed?"Try again":"Sync now"]})})]})]})},a.id)})})})}function ce({organizationId:s,ownerSlug:t,typeScope:r,entityScope:c,attentionOnly:a=!1}){const i=yt(),o=ae(s,i),{orgContext:l}=bt(),{isMember:f,isLoading:n}=Nt(),d=f&&!!s,{attentionItems:x,isError:m}=R(t),u=r?A(r):void 0,j=!c&&!u,h=y.useMemo(()=>x.map(g=>({item:g,onPage:i?vt(g,i):!1})).sort((g,w)=>Number(w.onPage)-Number(g.onPage)||w.item.at-g.item.at),[x,i]),p=y.useMemo(()=>h.filter(({onPage:g})=>g),[h]),Q=y.useMemo(()=>new Set(p.flatMap(({item:g})=>g.approvalRunId!=null?[g.approvalRunId]:[])),[p]),Z=U(),X=()=>void Z({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:I,isLoading:$,error:tt}=kt(c?`/${t}/${_t(c)}`:`/${t}`,l),C=c?I?.entity:void 0,et=(c?C?.entity_type??A(c.split("/").at(-2)??""):u)==="$member",nt=c!=null&&!$&&(tt!=null||I?.entity==null),v=c?void 0:I?.counts,st=v?v.connections>0||v.agents>0:!1,at=d&&!n&&!$&&v!=null&&!st,S=c&&$?e.jsx(K,{label:"Loading record…"}):nt?e.jsx(k,{icon:It,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):a&&j?e.jsx(re,{owner:t,items:h,isError:m}):C?e.jsx(Vt,{ownerSlug:t,entity:C,organizationId:s}):e.jsx(Gt,{organizationId:s,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:u?[u]:void 0,pinned:j&&(p.length>0||o.length>0)?{rows:e.jsxs(e.Fragment,{children:[e.jsx(oe,{organizationId:s,feeds:o}),p.length>0?e.jsx("ul",{className:"space-y-1",children:p.map(({item:g})=>e.jsx("li",{children:e.jsx(_,{owner:t,item:g,tone:"relevant",tag:"This page"})},g.id))}):null]}),hiddenApprovalRunIds:Q}:void 0,onShowNotifications:j?X:void 0,emptyState:at?e.jsx(de,{ownerSlug:t}):void 0});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:et?e.jsx(Jt,{children:S}):S})}function re({owner:s,items:t,isError:r}){const c=U();return e.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[e.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),e.jsx(le,{owner:s}),e.jsx(Yt,{value:P.value,withNotifications:!0,onChange:a=>{if(a===P.value)return;const[i,o]=a.split("-");c({to:"/$owner",params:{owner:s},search:$t({sortBy:i,sortOrder:o})})}})]}),r?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?e.jsx(k,{icon:V,title:"All caught up",description:"Nothing needs you right now.",children:e.jsx(N,{asChild:!0,variant:"outline",className:"mt-4",children:e.jsx(b,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):e.jsx("ul",{className:"space-y-1",children:t.map(({item:a,onPage:i})=>e.jsx("li",{children:e.jsx(_,{owner:s,item:a,tone:i?"relevant":"default",tag:i?"This page":void 0})},a.id))})]})}function le({owner:s}){const{visibleUnreadIds:t,markVisibleRead:r,bulkPending:c}=R(s);return t.length===0?null:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:c,onClick:()=>void r(),children:[e.jsx(V,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function de({ownerSlug:s}){return e.jsx("div",{className:"px-6",children:e.jsx(k,{icon:Ct,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(N,{asChild:!0,children:e.jsxs(b,{to:"/$owner/connectors/create",params:{owner:s},children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(N,{asChild:!0,variant:"outline",children:e.jsxs(b,{to:"/$owner/agents",params:{owner:s},children:[e.jsx(At,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const z=12,ue=5e3;function me(s,t){const r=!!s&&!!t.organizationId&&(t.enabled??!0),c=Et({enabled:r}),{data:a}=c,i=a??[],o=y.useMemo(()=>i.map(u=>u.agentId),[i]),{threads:l,isLoading:f,isError:n}=Rt(s,o,{enabled:r&&o.length>0,limit:z}),d=Qt({enabled:r,limit:z,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:u=>u?ue:!1}),x=t.organizationId?d.data:void 0;return{items:y.useMemo(()=>[...l.map(u=>({kind:"conversation",at:u.updatedAt,thread:u})),...(x??[]).map(u=>({kind:"mcp",at:u.lastCallAt,conversation:u}))].sort((u,j)=>j.at-u.at),[x,l]),agents:i,isLoading:r&&(c.isLoading||f||d.isLoading),isError:c.isError||n||d.isError}}function xe(s){return s==="attention"?{attention:"1"}:s==="all"?{}:{tab:s}}function fe(s,t,r,c=[]){const a=new Map(c.map(n=>[n.id,n])),i=new Map;for(const n of[...t.filter(d=>d.kind==="notification"),...r])i.set(n.notification_id!=null?`n:${n.notification_id}`:n.id,n);const o=new Set([...i.values()].flatMap(n=>n.run_id!=null?[n.run_id]:[])),l=new Map,f=new Set(t.flatMap(n=>n.kind==="automation_due"&&n.run_id!=null?[n.run_id]:[]));for(const n of[...t.filter(d=>d.kind!=="notification"&&(d.kind==="automation_due"||d.run_id==null||!f.has(d.run_id))&&(d.run_id==null||!o.has(d.run_id))),...i.values()])l.set(n.id,n);return[...l.values()].map(n=>{const d=n.connection_id!=null?a.get(n.connection_id):void 0,x={...n,platform:n.platform||d?.connector_key,connection_name:n.connection_name||d?.display_name},m=n.kind==="notification"?"notification":n.kind==="sync"?"feed":n.kind==="automation_run"||n.kind==="automation_due"?"automation":"run",u=m==="automation"&&n.automation_id!=null?`automation:${n.automation_id}`:(m==="feed"||m==="run")&&n.connection_id!=null?`connection:${n.connection_id}`:null;return{id:n.id,at:new Date(n.at).getTime(),title:n.title,detail:n.kind==="run"&&n.status&&!M(n.status)?n.status:n.body||n.status,kind:m,subject:u,subjectLabel:n.automation_name||x.connection_name||n.title,href:m!=="notification"&&n.run_id!=null?m==="automation"&&n.automation_id!=null?`/${s}/automations/${n.automation_id}?run_id=${n.run_id}`:`/${s}/events?run_ids=${n.run_id}`:n.href,card:n,source:x}})}function he(s,t,r){return t.map(c=>{if(c.kind==="mcp"){const n=c.conversation,d=s==="me"||n.organizationId==null?"/me/events":`/${s}/agents/connected/${encodeURIComponent(n.clientId)}/activity`,x=new URLSearchParams({mcp_activity_id:n.activityId});return(s==="me"||n.organizationId==null)&&x.set("client_ids",n.clientId),{id:`client:${n.clientId}:${n.activityId}`,at:c.at,title:Zt(n),detail:`${n.clientName||"Connected app"} · ${n.callCount} ${n.callCount===1?"call":"calls"}${n.isLive?" · Active":""}`,href:`${d}?${x}`,kind:"session",subject:`client:${n.clientId}`,subjectLabel:n.clientName||"Connected app",source:{client_id:n.clientId,client_name:n.clientName}}}const a=c.thread,i=r.get(a.agentId)||"Agent",o=a.platform||"web",l=Mt(s,a.agentId,a.id),f=o==="web"?Object.entries(l.params).reduce((n,[d,x])=>n.replace(`$${d}`,encodeURIComponent(x)),l.to):`/${s}/agents/${encodeURIComponent(a.agentId)}/conversations/${encodeURIComponent(a.conversationId??a.id)}`;return{id:`thread:${a.agentId}:${a.id}`,at:c.at,title:a.title||"Conversation",detail:`${i} · ${o==="web"?"Chat":o}${a.isRunning?" · Active":""}`,href:f,kind:"session",subject:`agent:${a.agentId}`,subjectLabel:i,source:{agent_id:a.agentId,agent_name:i,platform:o==="web"?null:o}}})}function pe(s){const t=new Map;for(const r of[...s].sort((c,a)=>a.at-c.at||c.id.localeCompare(a.id))){const c=new Date(r.at),a=`${c.getFullYear()}-${c.getMonth()}-${c.getDate()}`,i=r.subject?`${r.kind}:${r.subject}:${a}`:r.id,o=t.get(i)??{key:i,entries:[]};o.entries.push(r),t.set(i,o)}return[...t.values()]}const ge=[{view:"all",label:"All activity"},{view:"attention",label:"Needs attention"},{view:"sessions",label:"Sessions"},{view:"feeds",label:"Feeds"},{view:"automations",label:"Automations"}];function je({owner:s,view:t,organizationId:r}){const{data:c=[]}=E(r),{data:a=[]}=St(t==="all"||t==="feeds"||t==="automations"?r:null),i=R(s),o=me(s,{organizationId:r,enabled:t==="all"||t==="sessions"}),l=wt(t==="attention"||t==="sessions"?null:s,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),f=y.useMemo(()=>{const m=new Map(o.agents.map(h=>[h.agentId,h.name])),u=t==="all"||t==="sessions"?he(s,o.items,m):[],j=t==="attention"?[]:fe(s,[...l.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],a);return pe([...j,...u])},[s,t,o.agents,o.items,l.data,a,i.attentionCards,i.notificationCards]),n=r==null||(t==="attention"?i.isLoading:t!=="sessions"&&l.isLoading||(t==="all"||t==="sessions")&&o.isLoading||t==="all"&&i.isLoading),d=t==="attention"?i.isError:t!=="sessions"&&l.isError||(t==="all"||t==="sessions")&&o.isError||t==="all"&&i.isError,x=t==="attention"?i.attentionItems.length===0:f.length===0;return e.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Home"}),e.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap gap-x-3 gap-y-2 border-b pb-2",children:ge.map(({view:m,label:u})=>e.jsxs(b,{to:"/$owner",params:{owner:s},search:xe(m),activeOptions:{exact:!0},"aria-current":t===m?"page":void 0,className:G("py-1 text-[13px] transition-colors",t===m?"font-medium text-foreground underline decoration-primary decoration-2 underline-offset-[13px]":"text-muted-foreground hover:text-foreground"),children:[u,m==="attention"&&i.attentionItems.length>0?e.jsx("span",{className:"ml-1.5 text-xs tabular-nums",children:i.attentionItems.length}):null]},m))}),t==="attention"?e.jsx(Lt,{owner:s}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent activity · newest first"}),d?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,n&&x?e.jsx(K,{label:"activity"}):x?d?null:e.jsx(k,{icon:Tt,title:t==="attention"?"All caught up":"No recent activity",description:t==="attention"?"Nothing needs you right now.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?e.jsx("ul",{className:"space-y-1",children:i.attentionItems.map(m=>e.jsx("li",{children:e.jsx(_,{owner:s,item:m})},m.id))}):e.jsx("ul",{className:"divide-y divide-border/60",children:f.map(m=>e.jsx("li",{children:e.jsx(ye,{owner:s,group:m,connectorDefinitions:c})},m.key))}),!x&&t!=="attention"?e.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[t==="all"||t==="feeds"?e.jsx(b,{to:"/$owner/connectors",params:{owner:s},children:"Browse feeds"}):null,t==="all"||t==="automations"?e.jsx(b,{to:"/$owner/automations",params:{owner:s},children:"Automation history"}):null,t==="sessions"?e.jsx(b,{to:"/$owner/agents",params:{owner:s},children:"Browse agents and apps"}):null]}):null]})}function ye({owner:s,group:t,connectorDefinitions:r}){const[c,a]=y.useState(!1),i=y.useId(),o=t.entries[0];if(t.entries.length===1)return e.jsx(H,{owner:s,entry:o,connectorDefinitions:r});const l=t.entries.filter(n=>M(n.card?.status??"")).length,f=o.kind==="session"?"sessions":o.kind==="feed"?"syncs":o.kind==="run"?"operations":"runs";return e.jsxs("div",{children:[e.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":i,onClick:()=>a(!c),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[e.jsx(J,{entry:o,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:o.subjectLabel}),e.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",f,l>0?e.jsxs("span",{className:"text-destructive",children:[" · ",l," failed"]}):null,o.kind==="session"?null:` · ${o.detail??""}`]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(o.at)}),e.jsx(Ot,{"aria-hidden":!0,className:G("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-180")})]}),e.jsxs("ul",{id:i,hidden:!c,className:"ml-4 border-l pl-3",children:[c?t.entries.map(n=>e.jsx("li",{children:e.jsx(H,{owner:s,entry:n,connectorDefinitions:r})},n.id)):null,c&&o.card?.href?e.jsx("li",{children:e.jsx(be,{entry:o})}):null]})]})}function be({entry:s}){const t=q(s.card?.href??"");return e.jsx(b,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:s.kind==="automation"?"View Automation history":"View connection history"})}function J({entry:s,connectorDefinitions:t}){const r=s.kind==="session"?zt:s.kind==="feed"?Ht:s.kind==="automation"?Bt:Wt;return e.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:e.jsx(B,{source:s.source,connectorDefinitions:t,label:s.subjectLabel,fallback:e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})})})}function H({owner:s,entry:t,connectorDefinitions:r}){const c=Dt();if(t.kind==="notification"&&t.card)return e.jsx(_,{owner:s,item:Ft({...t.card,...t.source})});const a=e.jsxs(e.Fragment,{children:[e.jsx(J,{entry:t,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[M(t.card?.status??"")?e.jsx(Pt,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,e.jsx("span",{className:"truncate",children:t.detail})]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(t.at)})]}),i="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return e.jsx("div",{className:i,children:a});const o=q(t.href);return e.jsx(b,{to:o.pathname,search:o.search,className:i,onClick:l=>{!c||!t.card||t.kind==="session"||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0||(l.preventDefault(),c.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:s,sourceAttribution:t.source??t.card}))},children:a})}function Ae({owner:s,search:t,entityScope:r,home:c=!1}){const a=typeof t.type=="string"&&t.type.trim()?A(t.type.trim()):void 0,i=typeof t.tab=="string"?t.tab:"events",o=i==="sessions"||i==="feeds"||i==="automations"?i:"events",l=String(t.attention)==="1",f=Object.entries(t).some(([n,d])=>(Ut.includes(n)||n.startsWith("clf_"))&&d!=null&&d!=="");return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Xt,{}),e.jsx(Kt,{owner:s,children:n=>e.jsx(qt,{organizationId:n.organizationId,isWorkspaceLoading:n.isWorkspaceLoading,children:e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:(c||o!=="events")&&!f&&!a&&!r?e.jsx(je,{owner:n.ownerSlug,organizationId:n.organizationId,view:l?"attention":o==="events"?"all":o}):e.jsx(ce,{organizationId:n.organizationId,ownerSlug:n.ownerSlug,typeScope:a,entityScope:r,attentionOnly:l})})})})]})}export{Ae as A};
2
- //# sourceMappingURL=activity-route-view-_G_lDz5K.js.map
1
+ import{cc as it,cd as ot,ce as ct,cf as L,cg as rt,ch as T,ci as O,cj as D,ck as lt,cl as F,cm as dt,cn as A,r as y,co as ut,aE as mt,cp as xt,j as e,cq as ft,cr as ht,cs as B,bm as W,ct as pt,B as N,a5 as gt,cu as jt,cv as yt,t as bt,ap as Nt,cw as R,bt as E,cx as vt,v as U,am as kt,cy as _t,bF as K,a$ as k,cz as It,cA as _,cB as $t,cC as V,L as b,cD as Ct,bp as Et,b8 as At,cE as Rt,cF as Mt,cG as M,aD as St,cH as wt,h as G,cI as Lt,cJ as Tt,cK as Y,cL as Ot,u as Dt,cM as Ft,cN as Pt,c as q,cO as zt,cP as Ht,be as Bt,cQ as Wt,cR as Ut,av as Kt}from"./index-008wj-Pz.js";import{R as Vt,E as Gt,S as Yt,N as P,M as qt}from"./record-activity-BXhvJbd9.js";import{M as Qt}from"./member-scope-gate-De75CR7W.js";import{u as Jt}from"./client-activity-scopes-BLIy1Zc3.js";import{a as Zt}from"./client-rows-DiJQ5D1z.js";import{P as Xt}from"./public-shell-ready-DXUTTGGp.js";function te(s,t,r){const c=lt(),a=r?.locale??c.locale??rt,i=it(s,t);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,f]=ot(r?.in,...i>0?[t,s]:[s,t]),n=ct(r?.roundingMethod??"round"),d=f.getTime()-l.getTime(),x=d/F,m=L(f)-L(l),u=(d-m)/F,j=r?.unit;let h;if(j?h=j:x<1?h="second":x<60?h="minute":x<T?h="hour":u<O?h="day":u<D?h="month":h="year",h==="second"){const p=n(d/1e3);return a.formatDistance("xSeconds",p,o)}else if(h==="minute"){const p=n(x);return a.formatDistance("xMinutes",p,o)}else if(h==="hour"){const p=n(x/60);return a.formatDistance("xHours",p,o)}else if(h==="day"){const p=n(u/T);return a.formatDistance("xDays",p,o)}else if(h==="month"){const p=n(u/O);return p===12&&j!=="month"?a.formatDistance("xYears",1,o):a.formatDistance("xMonths",p,o)}else{const p=n(u/D);return a.formatDistance("xYears",p,o)}}function ee(s,t){return te(s,dt(s),t)}const ne=4e3;function se(s){if(s?.kind!=="browser"||!s.url)return null;try{return new URL(s.url).origin}catch{return null}}function ae(s,t){const r=se(t),{data:c=[]}=A(r?s:null),a=y.useMemo(()=>new Set(c.filter(l=>r&&l.browser?.origins.includes(r)).map(l=>l.key)),[c,r]),i=!!s&&a.size>0,{data:o=[]}=ut({...mt.queryOptions(s,{status:"active",enabled:i}),enabled:i,refetchInterval:l=>l.state.data?.some(f=>a.has(f.connector_key)&&f.active_runs>0)?ne:!1});return y.useMemo(()=>o.filter(l=>a.has(l.connector_key)&&l.operations.includes("sync")),[o,a])}function ie(s){return s.active_runs>0?{text:"Syncing…",failed:!1}:s.last_sync_status==="failed"&&s.last_error?{text:s.last_error,failed:!0}:s.last_sync_at?{text:`Last synced ${ee(new Date(s.last_sync_at),{addSuffix:!0})}.`,failed:!1}:{text:"Not synced yet. Sync while you're signed in.",failed:!1}}function oe({organizationId:s,feeds:t}){const{data:r=[]}=A(s),c=xt();return t.length===0?null:e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx("ul",{className:"space-y-1",children:t.map(a=>{const i=ie(a),o=a.active_runs>0||c.isPending&&c.variables===a.id,l=[a.connection_name??a.connector_name??a.connector_key,a.display_name??a.feed_key].join(" · ");return e.jsx("li",{className:"rounded-lg bg-primary/5 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ft,{className:ht,children:e.jsx(B,{source:{platform:a.connector_key},connectorDefinitions:r,label:l,fallback:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"line-clamp-2 min-w-0 text-sm font-medium",children:l}),e.jsx("p",{className:i.failed?"mt-1 line-clamp-3 text-sm text-destructive":"mt-1 text-sm text-muted-foreground",children:i.text}),e.jsx(pt,{tag:"This page",children:a.device_label?`Connection · ${a.device_label}`:"Connection"}),e.jsx("div",{className:"mt-2",children:e.jsxs(N,{type:"button",size:"sm",variant:i.failed?"default":"outline",className:"h-7 text-xs",disabled:o,onClick:()=>c.mutate(a.id),children:[o?e.jsx(gt,{size:"sm",className:"mr-1"}):e.jsx(jt,{className:"mr-1 h-3 w-3"}),o?"Syncing":i.failed?"Try again":"Sync now"]})})]})]})},a.id)})})})}function ce({organizationId:s,ownerSlug:t,typeScope:r,entityScope:c,attentionOnly:a=!1}){const i=yt(),o=ae(s,i),{orgContext:l}=bt(),{isMember:f,isLoading:n}=Nt(),d=f&&!!s,{attentionItems:x,isError:m}=R(t),u=r?E(r):void 0,j=!c&&!u,h=y.useMemo(()=>x.map(g=>({item:g,onPage:i?vt(g,i):!1})).sort((g,w)=>Number(w.onPage)-Number(g.onPage)||w.item.at-g.item.at),[x,i]),p=y.useMemo(()=>h.filter(({onPage:g})=>g),[h]),J=y.useMemo(()=>new Set(p.flatMap(({item:g})=>g.approvalRunId!=null?[g.approvalRunId]:[])),[p]),Z=U(),X=()=>void Z({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:I,isLoading:$,error:tt}=kt(c?`/${t}/${_t(c)}`:`/${t}`,l),C=c?I?.entity:void 0,et=(c?C?.entity_type??E(c.split("/").at(-2)??""):u)==="$member",nt=c!=null&&!$&&(tt!=null||I?.entity==null),v=c?void 0:I?.counts,st=v?v.connections>0||v.agents>0:!1,at=d&&!n&&!$&&v!=null&&!st,S=c&&$?e.jsx(K,{label:"Loading record…"}):nt?e.jsx(k,{icon:It,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):a&&j?e.jsx(re,{owner:t,items:h,isError:m}):C?e.jsx(Vt,{ownerSlug:t,entity:C,organizationId:s}):e.jsx(Gt,{organizationId:s,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:u?[u]:void 0,pinned:j&&(p.length>0||o.length>0)?{rows:e.jsxs(e.Fragment,{children:[e.jsx(oe,{organizationId:s,feeds:o}),p.length>0?e.jsx("ul",{className:"space-y-1",children:p.map(({item:g})=>e.jsx("li",{children:e.jsx(_,{owner:t,item:g,tone:"relevant",tag:"This page"})},g.id))}):null]}),hiddenApprovalRunIds:J}:void 0,onShowNotifications:j?X:void 0,emptyState:at?e.jsx(de,{ownerSlug:t}):void 0});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:et?e.jsx(Qt,{children:S}):S})}function re({owner:s,items:t,isError:r}){const c=U();return e.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[e.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),e.jsx(le,{owner:s}),e.jsx(Yt,{value:P.value,withNotifications:!0,onChange:a=>{if(a===P.value)return;const[i,o]=a.split("-");c({to:"/$owner",params:{owner:s},search:$t({sortBy:i,sortOrder:o})})}})]}),r?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?e.jsx(k,{icon:V,title:"All caught up",description:"Nothing needs you right now.",children:e.jsx(N,{asChild:!0,variant:"outline",className:"mt-4",children:e.jsx(b,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):e.jsx("ul",{className:"space-y-1",children:t.map(({item:a,onPage:i})=>e.jsx("li",{children:e.jsx(_,{owner:s,item:a,tone:i?"relevant":"default",tag:i?"This page":void 0})},a.id))})]})}function le({owner:s}){const{visibleUnreadIds:t,markVisibleRead:r,bulkPending:c}=R(s);return t.length===0?null:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:c,onClick:()=>void r(),children:[e.jsx(V,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function de({ownerSlug:s}){return e.jsx("div",{className:"px-6",children:e.jsx(k,{icon:Ct,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(N,{asChild:!0,children:e.jsxs(b,{to:"/$owner/connectors/create",params:{owner:s},children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(N,{asChild:!0,variant:"outline",children:e.jsxs(b,{to:"/$owner/agents",params:{owner:s},children:[e.jsx(Et,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const z=12,ue=5e3;function me(s,t){const r=!!s&&!!t.organizationId&&(t.enabled??!0),c=At({enabled:r}),{data:a}=c,i=a??[],o=y.useMemo(()=>i.map(u=>u.agentId),[i]),{threads:l,isLoading:f,isError:n}=Rt(s,o,{enabled:r&&o.length>0,limit:z}),d=Jt({enabled:r,limit:z,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:u=>u?ue:!1}),x=t.organizationId?d.data:void 0;return{items:y.useMemo(()=>[...l.map(u=>({kind:"conversation",at:u.updatedAt,thread:u})),...(x??[]).map(u=>({kind:"mcp",at:u.lastCallAt,conversation:u}))].sort((u,j)=>j.at-u.at),[x,l]),agents:i,isLoading:r&&(c.isLoading||f||d.isLoading),isError:c.isError||n||d.isError}}function xe(s){return s==="attention"?{attention:"1"}:s==="all"?{}:{tab:s}}function fe(s,t,r,c=[]){const a=new Map(c.map(n=>[n.id,n])),i=new Map;for(const n of[...t.filter(d=>d.kind==="notification"),...r])i.set(n.notification_id!=null?`n:${n.notification_id}`:n.id,n);const o=new Set([...i.values()].flatMap(n=>n.run_id!=null?[n.run_id]:[])),l=new Map,f=new Set(t.flatMap(n=>n.kind==="automation_due"&&n.run_id!=null?[n.run_id]:[]));for(const n of[...t.filter(d=>d.kind!=="notification"&&(d.kind==="automation_due"||d.run_id==null||!f.has(d.run_id))&&(d.run_id==null||!o.has(d.run_id))),...i.values()])l.set(n.id,n);return[...l.values()].map(n=>{const d=n.connection_id!=null?a.get(n.connection_id):void 0,x={...n,platform:n.platform||d?.connector_key,connection_name:n.connection_name||d?.display_name},m=n.kind==="notification"?"notification":n.kind==="sync"?"feed":n.kind==="automation_run"||n.kind==="automation_due"?"automation":"run",u=m==="automation"&&n.automation_id!=null?`automation:${n.automation_id}`:(m==="feed"||m==="run")&&n.connection_id!=null?`connection:${n.connection_id}`:null;return{id:n.id,at:new Date(n.at).getTime(),title:n.title,detail:n.kind==="run"&&n.status&&!M(n.status)?n.status:n.body||n.status,kind:m,subject:u,subjectLabel:n.automation_name||x.connection_name||n.title,href:m!=="notification"&&n.run_id!=null?m==="automation"&&n.automation_id!=null?`/${s}/automations/${n.automation_id}?run_id=${n.run_id}`:`/${s}/events?run_ids=${n.run_id}`:n.href,card:n,source:x}})}function he(s,t,r){return t.map(c=>{if(c.kind==="mcp"){const n=c.conversation,d=s==="me"||n.organizationId==null?"/me/events":`/${s}/agents/connected/${encodeURIComponent(n.clientId)}/activity`,x=new URLSearchParams({mcp_activity_id:n.activityId});return(s==="me"||n.organizationId==null)&&x.set("client_ids",n.clientId),{id:`client:${n.clientId}:${n.activityId}`,at:c.at,title:Zt(n),detail:`${n.clientName||"Connected app"} · ${n.callCount} ${n.callCount===1?"call":"calls"}${n.isLive?" · Active":""}`,href:`${d}?${x}`,kind:"session",subject:`client:${n.clientId}`,subjectLabel:n.clientName||"Connected app",source:{client_id:n.clientId,client_name:n.clientName}}}const a=c.thread,i=r.get(a.agentId)||"Agent",o=a.platform||"web",l=Mt(s,a.agentId,a.id),f=o==="web"?Object.entries(l.params).reduce((n,[d,x])=>n.replace(`$${d}`,encodeURIComponent(x)),l.to):`/${s}/agents/${encodeURIComponent(a.agentId)}/conversations/${encodeURIComponent(a.conversationId??a.id)}`;return{id:`thread:${a.agentId}:${a.id}`,at:c.at,title:a.title||"Conversation",detail:`${i} · ${o==="web"?"Chat":o}${a.isRunning?" · Active":""}`,href:f,kind:"session",subject:`agent:${a.agentId}`,subjectLabel:i,source:{agent_id:a.agentId,agent_name:i,platform:o==="web"?null:o}}})}function pe(s){const t=new Map;for(const r of[...s].sort((c,a)=>a.at-c.at||c.id.localeCompare(a.id))){const c=new Date(r.at),a=`${c.getFullYear()}-${c.getMonth()}-${c.getDate()}`,i=r.subject?`${r.kind}:${r.subject}:${a}`:r.id,o=t.get(i)??{key:i,entries:[]};o.entries.push(r),t.set(i,o)}return[...t.values()]}const ge=[{view:"all",label:"All activity"},{view:"attention",label:"Needs attention"},{view:"sessions",label:"Sessions"},{view:"feeds",label:"Feeds"},{view:"automations",label:"Automations"}];function je({owner:s,view:t,organizationId:r}){const{data:c=[]}=A(r),{data:a=[]}=St(t==="all"||t==="feeds"||t==="automations"?r:null),i=R(s),o=me(s,{organizationId:r,enabled:t==="all"||t==="sessions"}),l=wt(t==="attention"||t==="sessions"?null:s,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),f=y.useMemo(()=>{const m=new Map(o.agents.map(h=>[h.agentId,h.name])),u=t==="all"||t==="sessions"?he(s,o.items,m):[],j=t==="attention"?[]:fe(s,[...l.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],a);return pe([...j,...u])},[s,t,o.agents,o.items,l.data,a,i.attentionCards,i.notificationCards]),n=r==null||(t==="attention"?i.isLoading:t!=="sessions"&&l.isLoading||(t==="all"||t==="sessions")&&o.isLoading||t==="all"&&i.isLoading),d=t==="attention"?i.isError:t!=="sessions"&&l.isError||(t==="all"||t==="sessions")&&o.isError||t==="all"&&i.isError,x=t==="attention"?i.attentionItems.length===0:f.length===0;return e.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Home"}),e.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap gap-x-3 gap-y-2 border-b pb-2",children:ge.map(({view:m,label:u})=>e.jsxs(b,{to:"/$owner",params:{owner:s},search:xe(m),activeOptions:{exact:!0},"aria-current":t===m?"page":void 0,className:G("py-1 text-[13px] transition-colors",t===m?"font-medium text-foreground underline decoration-primary decoration-2 underline-offset-[13px]":"text-muted-foreground hover:text-foreground"),children:[u,m==="attention"&&i.attentionItems.length>0?e.jsx("span",{className:"ml-1.5 text-xs tabular-nums",children:i.attentionItems.length}):null]},m))}),t==="attention"?e.jsx(Lt,{owner:s}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent activity · newest first"}),d?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,n&&x?e.jsx(K,{label:"activity"}):x?d?null:e.jsx(k,{icon:Tt,title:t==="attention"?"All caught up":"No recent activity",description:t==="attention"?"Nothing needs you right now.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?e.jsx("ul",{className:"space-y-1",children:i.attentionItems.map(m=>e.jsx("li",{children:e.jsx(_,{owner:s,item:m})},m.id))}):e.jsx("ul",{className:"divide-y divide-border/60",children:f.map(m=>e.jsx("li",{children:e.jsx(ye,{owner:s,group:m,connectorDefinitions:c})},m.key))}),!x&&t!=="attention"?e.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[t==="all"||t==="feeds"?e.jsx(b,{to:"/$owner/connectors",params:{owner:s},children:"Browse feeds"}):null,t==="all"||t==="automations"?e.jsx(b,{to:"/$owner/automations",params:{owner:s},children:"Automation history"}):null,t==="sessions"?e.jsx(b,{to:"/$owner/agents",params:{owner:s},children:"Browse agents and apps"}):null]}):null]})}function ye({owner:s,group:t,connectorDefinitions:r}){const[c,a]=y.useState(!1),i=y.useId(),o=t.entries[0];if(t.entries.length===1)return e.jsx(H,{owner:s,entry:o,connectorDefinitions:r});const l=t.entries.filter(n=>M(n.card?.status??"")).length,f=o.kind==="session"?"sessions":o.kind==="feed"?"syncs":o.kind==="run"?"operations":"runs";return e.jsxs("div",{children:[e.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":i,onClick:()=>a(!c),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[e.jsx(Q,{entry:o,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:o.subjectLabel}),e.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",f,l>0?e.jsxs("span",{className:"text-destructive",children:[" · ",l," failed"]}):null,o.kind==="session"?null:` · ${o.detail??""}`]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(o.at)}),e.jsx(Ot,{"aria-hidden":!0,className:G("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-180")})]}),e.jsxs("ul",{id:i,hidden:!c,className:"ml-4 border-l pl-3",children:[c?t.entries.map(n=>e.jsx("li",{children:e.jsx(H,{owner:s,entry:n,connectorDefinitions:r})},n.id)):null,c&&o.card?.href?e.jsx("li",{children:e.jsx(be,{entry:o})}):null]})]})}function be({entry:s}){const t=q(s.card?.href??"");return e.jsx(b,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:s.kind==="automation"?"View Automation history":"View connection history"})}function Q({entry:s,connectorDefinitions:t}){const r=s.kind==="session"?zt:s.kind==="feed"?Ht:s.kind==="automation"?Bt:Wt;return e.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:e.jsx(B,{source:s.source,connectorDefinitions:t,label:s.subjectLabel,fallback:e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})})})}function H({owner:s,entry:t,connectorDefinitions:r}){const c=Dt();if(t.kind==="notification"&&t.card)return e.jsx(_,{owner:s,item:Ft({...t.card,...t.source})});const a=e.jsxs(e.Fragment,{children:[e.jsx(Q,{entry:t,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[M(t.card?.status??"")?e.jsx(Pt,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,e.jsx("span",{className:"truncate",children:t.detail})]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(t.at)})]}),i="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return e.jsx("div",{className:i,children:a});const o=q(t.href);return e.jsx(b,{to:o.pathname,search:o.search,className:i,onClick:l=>{!c||!t.card||t.kind==="session"||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0||(l.preventDefault(),c.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:s,sourceAttribution:t.source??t.card}))},children:a})}function Ee({owner:s,search:t,entityScope:r,home:c=!1}){const a=typeof t.type=="string"&&t.type.trim()?E(t.type.trim()):void 0,i=typeof t.tab=="string"?t.tab:"events",o=i==="sessions"||i==="feeds"||i==="automations"?i:"events",l=String(t.attention)==="1",f=Object.entries(t).some(([n,d])=>(Ut.includes(n)||n.startsWith("clf_"))&&d!=null&&d!=="");return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Xt,{}),e.jsx(Kt,{owner:s,children:n=>e.jsx(qt,{organizationId:n.organizationId,isWorkspaceLoading:n.isWorkspaceLoading,children:e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:(c||o!=="events")&&!f&&!a&&!r?e.jsx(je,{owner:n.ownerSlug,organizationId:n.organizationId,view:l?"attention":o==="events"?"all":o}):e.jsx(ce,{organizationId:n.organizationId,ownerSlug:n.ownerSlug,typeScope:a,entityScope:r,attentionOnly:l})})})})]})}export{Ee as A};
2
+ //# sourceMappingURL=activity-route-view-voRYSM3a.js.map
@@ -1,2 +1,2 @@
1
- import{j as e,f4 as i,C as l,T as c}from"./index-JmEl29py.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-ColL5rdd.js.map
1
+ import{j as e,fe as i,C as l,h as c}from"./index-008wj-Pz.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-DiU7Un5w.js.map
@@ -1,5 +1,5 @@
1
- import{j as o,L as u,bi as c}from"./index-JmEl29py.js";const d="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function a(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function l(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return a(t)?n:`${n} --url ${t}`}const i=[{id:"claude-code",label:"Claude Code",tagline:"Shared plugin with Lobu MCP and workspace skills",description:"Connect Claude Code to shared workspace context and governed actions through Lobu's native plugin setup.",installTitle:"Run in your terminal",installText:e=>l("claude-code",e),steps:e=>a(e)?["The CLI adds Lobu's marketplace and installs the shared plugin.","Start a fresh Claude Code session.","Use a Lobu tool, choose this workspace, and complete OAuth when prompted."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill.","Start a fresh Claude Code session and complete OAuth when prompted."],guideLinks:[{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"Add Lobu as a custom ChatGPT connector, or connect the Codex coding agent through the CLI — both reach this workspace with your existing Lobu access.",installTitle:"Pick a surface",installText:e=>["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${l("codex",e)}`].join(`
1
+ import{j as o,L as u,bq as c}from"./index-008wj-Pz.js";const d="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function a(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function l(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return a(t)?n:`${n} --url ${t}`}const i=[{id:"claude-code",label:"Claude Code",tagline:"Shared plugin with Lobu MCP and workspace skills",description:"Connect Claude Code to shared workspace context and governed actions through Lobu's native plugin setup.",installTitle:"Run in your terminal",installText:e=>l("claude-code",e),steps:e=>a(e)?["The CLI adds Lobu's marketplace and installs the shared plugin.","Start a fresh Claude Code session.","Use a Lobu tool, choose this workspace, and complete OAuth when prompted."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill.","Start a fresh Claude Code session and complete OAuth when prompted."],guideLinks:[{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"Add Lobu as a custom ChatGPT connector, or connect the Codex coding agent through the CLI — both reach this workspace with your existing Lobu access.",installTitle:"Pick a surface",installText:e=>["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${l("codex",e)}`].join(`
2
2
  `),steps:e=>["ChatGPT web: turn on developer mode under Settings -> Security -> Developer mode (custom connectors need it).",`ChatGPT web: open Settings -> Connectors -> Create connector, name it Lobu, and use ${e} with OAuth.`,"ChatGPT web: scan tools, complete Lobu sign-in, and start a new chat with Lobu enabled.",...a(e)?["Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"claude-desktop",label:"Claude Desktop",tagline:"Custom MCP connector with Lobu OAuth",description:"Add Lobu as a custom Claude Desktop connector and authorize the workspace with your existing Lobu access.",installTitle:"Add from Claude settings",installText:e=>["Open Settings -> Connectors -> Add Custom Connector","Name: Lobu",`MCP URL: ${e}`].join(`
3
- `),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],h={codex:"chatgpt"};function b(e){const t=h[e]??e;return i.find(n=>n.id===t)}function g(e){const{workspaceName:t,owner:n,mcpUrl:s,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${s}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${d}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
4
- `)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function C({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:i.map((n,s)=>o.jsxs(u,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:p(s,i.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(c,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{C as A,g as b,b as f};
5
- //# sourceMappingURL=agent-client-setup-list-BgyLhJCo.js.map
3
+ `),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],b=["Remember in Lobu that I prefer short answers that lead with the key point.","What does Lobu know about me?","Connect my Gmail to Lobu."],h={codex:"chatgpt"};function g(e){const t=h[e]??e;return i.find(n=>n.id===t)}function C(e){const{workspaceName:t,owner:n,mcpUrl:s,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${s}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${d}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
4
+ `)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function L({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:i.map((n,s)=>o.jsxs(u,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:p(s,i.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(c,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{L as A,b as F,C as b,g as f};
5
+ //# sourceMappingURL=agent-client-setup-list-Bkyw22GW.js.map
@@ -0,0 +1,2 @@
1
+ import{Q as x,j as e,aG as b,gr as N,b0 as v,gs as A,L as p,gt as w,n as L,r as k,hy as P,g4 as o,B as R,A as S,bq as f}from"./index-008wj-Pz.js";import{A as I,f as M,b as $,F as j}from"./agent-client-setup-list-Bkyw22GW.js";import{C as m}from"./copy-button-Df7QXE0w.js";import{u as B}from"./clients-8-EpRjsm.js";import{g as _,c as T}from"./client-rows-DiJQ5D1z.js";function U(t){const n=t?`/mcp/${t}`:"/mcp";if(!x)return`http://localhost:8787${n}`;try{const a=new URL(x);return a.pathname=n,a.toString()}catch{return`${x}${n}`}}const h="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function E(t,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${t===n-1?"":"border-b"}`}function y({owner:t}){return e.jsx(A,{crumbs:[e.jsx(p,{to:"/$owner/agents",params:{owner:t},className:w,children:"Agents"},"agents")]})}function W({owner:t}){return e.jsx("div",{className:h,children:e.jsxs(b,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(N,{breadcrumb:e.jsx(y,{owner:t}),icon:e.jsx(v.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(I,{owner:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Local Automation delivery is separate and is not enabled by connecting an agent."})]})})}function z({owner:t,clientId:n}){const a=M(n),{data:C}=L(t,{slug:t}),{data:u=[]}=B(null,{refetchInterval:2500}),r=k.useMemo(()=>_(u).filter(s=>s.connected),[u]);if(!a)return e.jsx("div",{className:h,children:e.jsxs(b,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(p,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const c=U(t),i=$({workspaceName:C?.workspace?.name??t,owner:t,mcpUrl:c,clientLabel:a.id==="other"?void 0:a.label,terminalLogin:a.terminalLogin}),d=a.setupMode==="agent-prompt",g=d?i:a.installText?.(c)??i;return e.jsx("div",{className:h,children:e.jsxs(P,{header:e.jsx(N,{breadcrumb:e.jsx(y,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:a.label})}),title:a.label,caption:a.description}),children:[e.jsx(o,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:g}),e.jsx(m,{text:g,label:d?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:a.steps(c).map((s,l)=>e.jsxs("li",{children:[l+1,". ",s]},s))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[d?null:e.jsx(m,{text:i,label:"Copy setup prompt"}),a.guideLinks.map(s=>e.jsx(R,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,e.jsx(S,{className:"ml-1.5 h-3.5 w-3.5"})]})},s.href))]})]})}),e.jsx(o,{title:"First prompts",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),e.jsx("div",{className:"overflow-hidden rounded-lg border",children:j.map((s,l)=>e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${l===j.length-1?"":"border-b"}`,children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm",children:s}),e.jsx(m,{text:s,label:"prompt",iconOnly:!0})]},s))})]})}),e.jsx(o,{title:"Connected agents",count:r.length>0?String(r.length):void 0,children:r.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:r.map((s,l)=>e.jsxs(p,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:s.clientId},className:E(l,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:s.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:T(s)})]})]},s.key))})}),e.jsx(o,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:c})]})})]})})}export{W as A,z as a};
2
+ //# sourceMappingURL=agent-connect-pages-CpBxQCpx.js.map
@@ -1,2 +1,2 @@
1
- import{ax as ye,ay as Ne,j as e,B as j,d8 as Ce,ev as Se,b0 as Me,T as Ae,eJ as ke,cS as X,dK as J,d3 as Ie,h3 as Pe,h4 as Te,h5 as Fe,h6 as De,gm as Ee,h7 as Re,bO as _e,bP as $e,az as Le,r as Y,bH as $,fh as Q,bS as Be,E as b,fP as L,I as z,U as Oe,bn as Ue,bo as ze,bp as qe,bq as Ve,br as Z}from"./index-JmEl29py.js";import{b as Ge,s as He}from"./model-selector-BeFuFH7p.js";function Ke(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 We(a,t){const r=new Set(t),x=Ke(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 Xe="__unresolved__";function ee(a){return a.endsWith(`/${Xe}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Je(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 Ye({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=Ge(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}=Je(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(X,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(J,{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(X,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(J,{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 Qe=3,Ze=72,es=2e3;function te(a){return Array.from({length:Qe},(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=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:q}=Ee(s?.agentId,{enabled:c}),V=!o&&g==="active"?k:null,B=V?Re(V.proposal):void 0,N=p,G=s?.agentId??"create",d=_e(G,{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"),[T,re]=d.field("identityMd"),[F,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(G,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=Y.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:We(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:T.trim(),soulMd:F.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:T.trim(),soulMd:F.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,T,o,E,w,x,u,s,R,F,y,m,P,D]),xe=Y.useCallback(async()=>{s&&(await i.mutateAsync(),_(!1),u?.())},[i,u,s,_]),O=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&q)return e.jsx(Q,{rows:6});const f=O||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",K=!o&&t==="settings",W=!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?q?e.jsx(Q,{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:T,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:F,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,K?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(Oe,{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,K?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:Ze,value:n.title,onChange:M=>H(y.map((A,U)=>U===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,U)=>U===h?{...A,message:M.target.value}:A)),disabled:f})]},h))]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Ye,{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,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Ue,{value:S,onValueChange:me,disabled:f,children:[e.jsx(ze,{id:"agent-sandbox",className:"w-full",children:e.jsx(qe,{placeholder:"Built-in"})}),e.jsxs(Ve,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{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:O,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||O,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
2
- //# sourceMappingURL=agent-editor-form-C24p9LLg.js.map
1
+ import{az as ye,aA as Ne,j as e,B as j,de as Ce,eX as Se,b9 as Ae,h as Me,eP as ke,cY as Y,dF as K,d9 as Ie,hh as Pe,hi as Te,hj as Fe,hk as De,gA as _e,hl as Re,bW as Ee,bX as $e,aB as Le,r as J,bP as $,fn as Q,b_ as Be,H as b,ew as L,I as U,W as ze,bv as Oe,bw as Ue,bx as We,by as Xe,bz as Z}from"./index-008wj-Pz.js";import{b as Ve,s as qe}from"./model-selector-3l9lY50C.js";function Ge(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 He(a,t){const r=new Set(t),x=Ge(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 Je({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=Ve(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:Me("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(Ae,{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=qe(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 Qe=3,Ze=72,es=2e3;function te(a){return Array.from({length:Qe},(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=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:W}=_e(s?.agentId,{enabled:c}),X=!o&&g==="active"?k:null,B=X?Re(X.proposal):void 0,N=p,V=s?.agentId??"create",d=Ee(V,{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"),[T,re]=d.field("identityMd"),[F,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[_,oe]=d.field("models"),[R,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,q]=d.field("starters"),[ue,E]=$e(V,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=J.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:He(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:A})=>!!h.trim()!=!!A.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:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,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:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,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,T,o,_,w,x,u,s,R,F,y,m,P,D]),xe=J.useCallback(async()=>{s&&(await i.mutateAsync(),E(!1),u?.())},[i,u,s,E]),z=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&W)return e.jsx(Q,{rows:6});const f=z||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",G=!o&&t==="settings",H=!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?W?e.jsx(Q,{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:T,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:F,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(U,{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,G?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(ze,{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,G?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(U,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Ze,value:n.title,onChange:A=>q(y.map((M,O)=>O===h?{...M,title:A.target.value}:M)),disabled:f}),e.jsx(U,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:A=>q(y.map((M,O)=>O===h?{...M,message:A.target.value}:M)),disabled:f})]},h))]}):null,H?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Je,{value:_,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,H?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(Ue,{id:"agent-sandbox",className:"w-full",children:e.jsx(We,{placeholder:"Built-in"})}),e.jsxs(Xe,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{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:()=>E(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>E(!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:z,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||z,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
2
+ //# sourceMappingURL=agent-editor-form-QrIDroFL.js.map