@lobu/runtime-server 24.3.0 → 24.4.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 (211) hide show
  1. package/dist/catalogs/skills.json +1 -1
  2. package/dist/component.json +1 -1
  3. package/dist/db/migrations/20261101010000_public_source_type_references.sql +157 -0
  4. package/dist/dependencies.bun.lock +59 -57
  5. package/dist/owletto/dist/assets/_-DIK0ae_S.js +2 -0
  6. package/dist/owletto/dist/assets/_-gTbcArpS.js +3 -0
  7. package/dist/owletto/dist/assets/_agentId-DOmcJZfk.js +2 -0
  8. package/dist/owletto/dist/assets/_agentId-DW6wRCVC.js +2 -0
  9. package/dist/owletto/dist/assets/{_automationId-CfFFAYK1.js → _automationId-B9IcDYBu.js} +2 -2
  10. package/dist/owletto/dist/assets/_connectorKey._connectionId-C6PmMPTA.js +2 -0
  11. package/dist/owletto/dist/assets/_connectorKey.index-BrJ8Pzze.js +2 -0
  12. package/dist/owletto/dist/assets/{_conversationId-D3vuAQPe.js → _conversationId-BpJAeYYW.js} +2 -2
  13. package/dist/owletto/dist/assets/_eventId-DarQJo0G.js +2 -0
  14. package/dist/owletto/dist/assets/_name-DtmNTcUm.js +2 -0
  15. package/dist/owletto/dist/assets/{_owner-oBX68rb9.js → _owner-Db8at3hk.js} +3 -3
  16. package/dist/owletto/dist/assets/_shape-6iFA8A86.js +2 -0
  17. package/dist/owletto/dist/assets/_skillKey-CXkHn3Nl.js +2 -0
  18. package/dist/owletto/dist/assets/{_slug-B2g5qzn3.js → _slug-DBOuBLoX.js} +2 -2
  19. package/dist/owletto/dist/assets/_viewKey-DC27aIN9.js +2 -0
  20. package/dist/owletto/dist/assets/_viewKey-DuYDieln.js +2 -0
  21. package/dist/owletto/dist/assets/{accept-invitation-38lHBvjO.js → accept-invitation-BbDCVvur.js} +2 -2
  22. package/dist/owletto/dist/assets/activity-route-view-V4ftmSN7.js +2 -0
  23. package/dist/owletto/dist/assets/{agent-card-controls-DiU7Un5w.js → agent-card-controls-99mG6H5k.js} +2 -2
  24. package/dist/owletto/dist/assets/agent-client-setup-list-kMmqQSrf.js +4 -0
  25. package/dist/owletto/dist/assets/agent-connect-pages-B-NPTFs6.js +2 -0
  26. package/dist/owletto/dist/assets/{agent-editor-form-QrIDroFL.js → agent-editor-form-DfMTSIvj.js} +2 -2
  27. package/dist/owletto/dist/assets/{agent-guardrails-route-CyoGSxcZ.js → agent-guardrails-route-BvGgfd-h.js} +2 -2
  28. package/dist/owletto/dist/assets/{agent-loading-shells-CamDtzHY.js → agent-loading-shells-Dnmb6W5Y.js} +2 -2
  29. package/dist/owletto/dist/assets/{agent-permissions-matrix-CgsQ8BK_.js → agent-permissions-matrix-CbhXlbgY.js} +2 -2
  30. package/dist/owletto/dist/assets/{agent-skill-context-lWbXKEm1.js → agent-skill-context-V__2i6Vl.js} +2 -2
  31. package/dist/owletto/dist/assets/{agent-skills-route-D-w3tY_2.js → agent-skills-route-DFXr_bHp.js} +2 -2
  32. package/dist/owletto/dist/assets/{agent-subpage-shell-CLqpn5Tb.js → agent-subpage-shell-DWzljvFb.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-thread-CsRexwTv.js → agent-thread-DQIr20H-.js} +4 -4
  34. package/dist/owletto/dist/assets/agents-CLbeiqTR.js +2 -0
  35. package/dist/owletto/dist/assets/{agents-workbench-CmGrMvPC.js → agents-workbench-C8bTa2rv.js} +2 -2
  36. package/dist/owletto/dist/assets/{app._appId-BO7G38fL.js → app._appId-Bsq40nak.js} +2 -2
  37. package/dist/owletto/dist/assets/{automation-detail-content-DMYxs6F6.js → automation-detail-content-C9Cgr5Zj.js} +2 -2
  38. package/dist/owletto/dist/assets/automations-CLbeiqTR.js +2 -0
  39. package/dist/owletto/dist/assets/{calendar-DDCCSPW6.js → calendar-DMq3Dtqy.js} +2 -2
  40. package/dist/owletto/dist/assets/{callback-DFciMR8u.js → callback-B-CAz-bK.js} +2 -2
  41. package/dist/owletto/dist/assets/{card-BCsbrdGs.js → card-SFtxv9f2.js} +2 -2
  42. package/dist/owletto/dist/assets/{claim-BRua2b_7.js → claim-DrxIRWKt.js} +2 -2
  43. package/dist/owletto/dist/assets/client-activity-scopes-boZOHuPW.js +2 -0
  44. package/dist/owletto/dist/assets/{client-rows-DiJQ5D1z.js → client-rows-BJ2PxM4J.js} +2 -2
  45. package/dist/owletto/dist/assets/clients-C7Lnuc3S.js +2 -0
  46. package/dist/owletto/dist/assets/{code-editor-BFZa4EIt.js → code-editor-rX0t1g5C.js} +2 -2
  47. package/dist/owletto/dist/assets/connect-BcwgytDV.js +2 -0
  48. package/dist/owletto/dist/assets/{connect-menu-D2K4tmvW.js → connect-menu-BF-AlunU.js} +2 -2
  49. package/dist/owletto/dist/assets/connect._clientId-sDypRDeN.js +2 -0
  50. package/dist/owletto/dist/assets/connected._clientId-C9OkW1tv.js +2 -0
  51. package/dist/owletto/dist/assets/connected._clientId.activity-Dc6HYr55.js +2 -0
  52. package/dist/owletto/dist/assets/{connected._clientId.index-BTI5JXA3.js → connected._clientId.index-C6qbqgwF.js} +2 -2
  53. package/dist/owletto/dist/assets/connection-88YzIBK9.js +2 -0
  54. package/dist/owletto/dist/assets/connection-feed-detail-D7pnWaFB.js +2 -0
  55. package/dist/owletto/dist/assets/{connections-browser-BMV8bf54.js → connections-browser-DDJQh8Na.js} +2 -2
  56. package/dist/owletto/dist/assets/{connector-boxes-DqZA-FdG.js → connector-boxes-DDX7Ebc4.js} +2 -2
  57. package/dist/owletto/dist/assets/connector-provenance-Th8ymGec.js +2 -0
  58. package/dist/owletto/dist/assets/{connector-scope-lists-CJYz53YF.js → connector-scope-lists-BibdzKl1.js} +2 -2
  59. package/dist/owletto/dist/assets/{connectors-BroKpwhB.js → connectors-BqwgLUUK.js} +2 -2
  60. package/dist/owletto/dist/assets/consent-BR5U7dwb.js +2 -0
  61. package/dist/owletto/dist/assets/copy-button-2swYh4jb.js +2 -0
  62. package/dist/owletto/dist/assets/{core.esm-A1UnFbGs.js → core.esm-CHnfRiEM.js} +2 -2
  63. package/dist/owletto/dist/assets/{create-c94SPL21.js → create-BsPVnRpG.js} +2 -2
  64. package/dist/owletto/dist/assets/create-CVPYVOR5.js +2 -0
  65. package/dist/owletto/dist/assets/create-QFjmhOEU.js +2 -0
  66. package/dist/owletto/dist/assets/{create-automation-form-DHW6OUoS.js → create-automation-form-DmCOFbRT.js} +3 -3
  67. package/dist/owletto/dist/assets/create._connectorKey-DLDDVtLS.js +2 -0
  68. package/dist/owletto/dist/assets/{cronstrue-xxpD1P2-.js → cronstrue-CKwjNYgj.js} +2 -2
  69. package/dist/owletto/dist/assets/device-CKup7kvB.js +2 -0
  70. package/dist/owletto/dist/assets/{device-pin-tombstone-B_te59GE.js → device-pin-tombstone-xGhCTU5_.js} +2 -2
  71. package/dist/owletto/dist/assets/{device._deviceId-ZU09qrot.js → device._deviceId-B1H_ivDT.js} +2 -2
  72. package/dist/owletto/dist/assets/{entity-avatar-CEV4ttUQ.js → entity-avatar-HloBoalJ.js} +2 -2
  73. package/dist/owletto/dist/assets/{entity-options-DJv2EhVV.js → entity-options-BSW_EG0W.js} +2 -2
  74. package/dist/owletto/dist/assets/entity-page-D-WDWrAe.js +2 -0
  75. package/dist/owletto/dist/assets/entity-type-page-BCBdFndu.js +2 -0
  76. package/dist/owletto/dist/assets/{event-card-CBlsG32u.js → event-card-Mcxv56DG.js} +2 -2
  77. package/dist/owletto/dist/assets/event-detail-DXifj49J.js +2 -0
  78. package/dist/owletto/dist/assets/{events-feed-VfU4csn2.js → events-feed-BysC9HgU.js} +2 -2
  79. package/dist/owletto/dist/assets/{filter-bar-COU0sBFQ.js → filter-bar-BQm-ubB1.js} +2 -2
  80. package/dist/owletto/dist/assets/{full-page-spinner-C1Q_jEzD.js → full-page-spinner-BMiXl54z.js} +2 -2
  81. package/dist/owletto/dist/assets/guardrails-D7W80sJO.js +2 -0
  82. package/dist/owletto/dist/assets/identity-N0cAO9BR.js +2 -0
  83. package/dist/owletto/dist/assets/{index-008wj-Pz.js → index-4gCDI7m4.js} +1601 -1601
  84. package/dist/owletto/dist/assets/{index-DQxzeM37.js → index-B4wXJwQY.js} +2 -2
  85. package/dist/owletto/dist/assets/{index-BrDP4PCs.js → index-BNaI5GpS.js} +2 -2
  86. package/dist/owletto/dist/assets/index-BUUrHuJJ.js +2 -0
  87. package/dist/owletto/dist/assets/index-BqrvJmLh.js +2 -0
  88. package/dist/owletto/dist/assets/{index-DNtYqkiA.js → index-C-WaHj1Y.js} +2 -2
  89. package/dist/owletto/dist/assets/index-CnvQEA5V.js +2 -0
  90. package/dist/owletto/dist/assets/index-Cq7P2c_E.js +2 -0
  91. package/dist/owletto/dist/assets/{index-DFyBbp7b.js → index-CzoK57xp.js} +2 -2
  92. package/dist/owletto/dist/assets/index-D3omC3Us.js +2 -0
  93. package/dist/owletto/dist/assets/{index-yIub2xUM.js → index-D4-uel59.js} +2 -2
  94. package/dist/owletto/dist/assets/index-DDGdlQrt.css +1 -0
  95. package/dist/owletto/dist/assets/index-DFEW7hMg.js +2 -0
  96. package/dist/owletto/dist/assets/index-DVV-WWuT.js +2 -0
  97. package/dist/owletto/dist/assets/{index-CAVcR9za.js → index-DduQ_e9q.js} +2 -2
  98. package/dist/owletto/dist/assets/index-DutlI1d-.js +2 -0
  99. package/dist/owletto/dist/assets/{json-diff-LE_vNZrM.js → json-diff-E5D-NGYT.js} +2 -2
  100. package/dist/owletto/dist/assets/{list-skeleton-Kzxi2OXB.js → list-skeleton-Bp4HNgJ9.js} +2 -2
  101. package/dist/owletto/dist/assets/login-7F48UJGx.js +2 -0
  102. package/dist/owletto/dist/assets/{logout-Dt_VDilG.js → logout-DxmfsVKD.js} +2 -2
  103. package/dist/owletto/dist/assets/{member-scope-gate-De75CR7W.js → member-scope-gate-vp3FihBD.js} +2 -2
  104. package/dist/owletto/dist/assets/memory-browse-page-CfDmjhDl.js +74 -0
  105. package/dist/owletto/dist/assets/{model-udnQ_S43.js → model-Dn40BUzs.js} +2 -2
  106. package/dist/owletto/dist/assets/{model-selector-3l9lY50C.js → model-selector-88PJnyTq.js} +2 -2
  107. package/dist/owletto/dist/assets/models-BBK_n2RP.js +2 -0
  108. package/dist/owletto/dist/assets/{new-BOwIHkre.js → new-4ruWHLR5.js} +2 -2
  109. package/dist/owletto/dist/assets/{new-BbdwuJPm.js → new-CvX8_gIb.js} +2 -2
  110. package/dist/owletto/dist/assets/new-gMD1PHTL.js +2 -0
  111. package/dist/owletto/dist/assets/oauth-workspace-access-D9BNmyMY.js +2 -0
  112. package/dist/owletto/dist/assets/organization-BHcp5Pzg.js +2 -0
  113. package/dist/owletto/dist/assets/peek-pane-content-0sa10jER.js +2 -0
  114. package/dist/owletto/dist/assets/{permissions-CfoY4WFY.js → permissions-hhxosugv.js} +2 -2
  115. package/dist/owletto/dist/assets/proposal-review-shell-B4CSiyLB.js +2 -0
  116. package/dist/owletto/dist/assets/public-shell-ready-CsenJeXa.js +2 -0
  117. package/dist/owletto/dist/assets/record-activity-D7bRaMk2.js +2 -0
  118. package/dist/owletto/dist/assets/{record-session-D07szzqN.js → record-session-CWXnCVln.js} +2 -2
  119. package/dist/owletto/dist/assets/{renderer-AJxSmE3-.js → renderer-7EGgTVX0.js} +2 -2
  120. package/dist/owletto/dist/assets/reset-password-CFUzxH7m.js +2 -0
  121. package/dist/owletto/dist/assets/runs-BPtQBTRN.js +2 -0
  122. package/dist/owletto/dist/assets/{runs-panel-LnGpHCAQ.js → runs-panel-Bj63_hb9.js} +2 -2
  123. package/dist/owletto/dist/assets/{schema-type-editor-panel-C_Es0qDf.js → schema-type-editor-panel-CAhOB648.js} +2 -2
  124. package/dist/owletto/dist/assets/{settings-gGYXbFfd.js → settings-Dg6nxKyw.js} +2 -2
  125. package/dist/owletto/dist/assets/settings-KJJ6WihO.js +2 -0
  126. package/dist/owletto/dist/assets/skills-ayt06_o2.js +2 -0
  127. package/dist/owletto/dist/assets/{source-record-panels-CjFPgKKJ.js → source-record-panels-Bh5F4C5K.js} +2 -2
  128. package/dist/owletto/dist/assets/{status-dot-CSBtKT4g.js → status-dot-D3FoDRcc.js} +2 -2
  129. package/dist/owletto/dist/assets/{table-DHM-vCxP.js → table-DFcJRNk7.js} +2 -2
  130. package/dist/owletto/dist/assets/{use-automations-C4TSie1i.js → use-automations-BHoV0dLs.js} +2 -2
  131. package/dist/owletto/dist/assets/{use-mention-search-PfZrNbu_.js → use-mention-search-C3rWLuKm.js} +2 -2
  132. package/dist/owletto/dist/assets/{use-scroll-sentinel-D-fJx_Md.js → use-scroll-sentinel-Ct-jt7O0.js} +2 -2
  133. package/dist/owletto/dist/assets/view-param-filters-mKoqDsaD.js +2 -0
  134. package/dist/owletto/dist/assets/{views-access-required-2ubIf_3N.js → views-access-required-DHrDO333.js} +2 -2
  135. package/dist/owletto/dist/index.html +2 -2
  136. package/dist/server-main.bundle.mjs +1978 -1199
  137. package/npm-shrinkwrap.json +286 -272
  138. package/package.json +1 -1
  139. package/vendor/connector-sdk/package.json +1 -1
  140. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +45 -20
  141. package/vendor/core/dist/contracts/tools/manage-entity.js +17 -5
  142. package/vendor/core/dist/index.d.ts +1 -0
  143. package/vendor/core/dist/index.js +4 -1
  144. package/vendor/core/dist/logger.js +8 -2
  145. package/vendor/core/dist/otel.d.ts +13 -2
  146. package/vendor/core/dist/otel.js +67 -41
  147. package/vendor/core/dist/trace-context.d.ts +12 -0
  148. package/vendor/core/dist/trace-context.js +50 -0
  149. package/vendor/core/package.json +1 -1
  150. package/vendor/views/package.json +1 -1
  151. package/dist/owletto/dist/assets/_-XKF0m81R.js +0 -3
  152. package/dist/owletto/dist/assets/_-e8MbEBtw.js +0 -2
  153. package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +0 -2
  154. package/dist/owletto/dist/assets/_agentId-emObu67X.js +0 -2
  155. package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +0 -2
  156. package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +0 -2
  157. package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +0 -2
  158. package/dist/owletto/dist/assets/_name-DjtJMop4.js +0 -2
  159. package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +0 -2
  160. package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +0 -2
  161. package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +0 -2
  162. package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +0 -2
  163. package/dist/owletto/dist/assets/activity-route-view-voRYSM3a.js +0 -2
  164. package/dist/owletto/dist/assets/agent-client-setup-list-Bkyw22GW.js +0 -5
  165. package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +0 -2
  166. package/dist/owletto/dist/assets/agents-DzH_FFKU.js +0 -2
  167. package/dist/owletto/dist/assets/automations-DzH_FFKU.js +0 -2
  168. package/dist/owletto/dist/assets/client-activity-scopes-BLIy1Zc3.js +0 -2
  169. package/dist/owletto/dist/assets/clients-8-EpRjsm.js +0 -2
  170. package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +0 -2
  171. package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +0 -2
  172. package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +0 -2
  173. package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +0 -2
  174. package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +0 -2
  175. package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +0 -2
  176. package/dist/owletto/dist/assets/connector-provenance-BIg8P8WY.js +0 -2
  177. package/dist/owletto/dist/assets/consent-fzLN-Qy7.js +0 -2
  178. package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +0 -2
  179. package/dist/owletto/dist/assets/create-BjwsYarn.js +0 -2
  180. package/dist/owletto/dist/assets/create-Dzr4mlr0.js +0 -2
  181. package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +0 -2
  182. package/dist/owletto/dist/assets/device-C3AEoL5c.js +0 -2
  183. package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +0 -2
  184. package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +0 -2
  185. package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +0 -2
  186. package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +0 -2
  187. package/dist/owletto/dist/assets/identity-BaFLmbSo.js +0 -2
  188. package/dist/owletto/dist/assets/index-BaetvYLa.js +0 -2
  189. package/dist/owletto/dist/assets/index-BiEf5xOE.css +0 -1
  190. package/dist/owletto/dist/assets/index-BuXIeK7D.js +0 -2
  191. package/dist/owletto/dist/assets/index-CMLfWGPU.js +0 -2
  192. package/dist/owletto/dist/assets/index-D0YEYP7N.js +0 -2
  193. package/dist/owletto/dist/assets/index-DkO0nPex.js +0 -2
  194. package/dist/owletto/dist/assets/index-KlRId0g6.js +0 -2
  195. package/dist/owletto/dist/assets/index-Ywnqi4A6.js +0 -2
  196. package/dist/owletto/dist/assets/index-xnxhf3Op.js +0 -2
  197. package/dist/owletto/dist/assets/login-DWOT6jtS.js +0 -2
  198. package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +0 -74
  199. package/dist/owletto/dist/assets/models-CQj7GIOp.js +0 -2
  200. package/dist/owletto/dist/assets/new-DTuFCQhV.js +0 -2
  201. package/dist/owletto/dist/assets/oauth-workspace-access-QPo4YwRX.js +0 -2
  202. package/dist/owletto/dist/assets/organization-BDzjnqPf.js +0 -2
  203. package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +0 -2
  204. package/dist/owletto/dist/assets/proposal-review-shell-CVkLnnKo.js +0 -2
  205. package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +0 -2
  206. package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +0 -2
  207. package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +0 -2
  208. package/dist/owletto/dist/assets/runs-lG2ChtOt.js +0 -2
  209. package/dist/owletto/dist/assets/settings-CEAOg7fr.js +0 -2
  210. package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +0 -2
  211. package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +0 -2
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseTraceparent = parseTraceparent;
4
+ exports.formatTraceparent = formatTraceparent;
5
+ exports.traceparentHeader = traceparentHeader;
6
+ exports.currentTraceLogFields = currentTraceLogFields;
7
+ const api_1 = require("@opentelemetry/api");
8
+ // The only W3C `traceparent` parser and formatter. Depends on the OTel API
9
+ // alone, so the logger can import it without a cycle through otel.ts.
10
+ /** The remote parent a valid `traceparent` names, or null for anything else. */
11
+ function parseTraceparent(value) {
12
+ if (typeof value !== "string" || value !== value.toLowerCase())
13
+ return null;
14
+ const [version, traceId, spanId, flags, ...rest] = value.split("-");
15
+ if (version !== "00" || rest.length > 0 || flags?.length !== 2)
16
+ return null;
17
+ const traceFlags = Number.parseInt(flags, 16);
18
+ const spanContext = {
19
+ traceId: traceId ?? "",
20
+ spanId: spanId ?? "",
21
+ traceFlags,
22
+ isRemote: true,
23
+ };
24
+ // The round trip rejects non-hex and signed flags without a pattern.
25
+ return traceFlags >= 0 &&
26
+ formatFlags(traceFlags) === flags &&
27
+ api_1.trace.isSpanContextValid(spanContext)
28
+ ? spanContext
29
+ : null;
30
+ }
31
+ function formatTraceparent(spanContext) {
32
+ return `00-${spanContext.traceId}-${spanContext.spanId}-${formatFlags(spanContext.traceFlags)}`;
33
+ }
34
+ function formatFlags(traceFlags) {
35
+ return traceFlags.toString(16).padStart(2, "0");
36
+ }
37
+ /** A W3C `traceparent` value, or null when the input is not one. */
38
+ function traceparentHeader(value) {
39
+ const spanContext = parseTraceparent(value);
40
+ return spanContext ? formatTraceparent(spanContext) : null;
41
+ }
42
+ /** W3C ids of the active span. Empty when the log is outside a real span. */
43
+ function currentTraceLogFields() {
44
+ const spanContext = api_1.trace.getActiveSpan()?.spanContext();
45
+ if (!spanContext || !api_1.trace.isSpanContextValid(spanContext)) {
46
+ return {};
47
+ }
48
+ return { trace_id: spanContext.traceId, span_id: spanContext.spanId };
49
+ }
50
+ //# sourceMappingURL=trace-context.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "24.3.0",
3
+ "version": "24.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core types and utilities for Lobu agent platform",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "24.3.0",
3
+ "version": "24.4.0",
4
4
  "description": "Authoring runtime for Lobu views — React modules rendered in the sandboxed MCP Apps frame",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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
@@ -1,2 +0,0 @@
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 +0,0 @@
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
@@ -1,2 +0,0 @@
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 +0,0 @@
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,5 +0,0 @@
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
- `),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/"}]}],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
@@ -1,2 +0,0 @@
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 +0,0 @@
1
- import{j as t,O as o}from"./index-008wj-Pz.js";const n=()=>t.jsx(o,{});export{n as component};
2
- //# sourceMappingURL=agents-DzH_FFKU.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as o}from"./index-008wj-Pz.js";const n=()=>t.jsx(o,{});export{n as component};
2
- //# sourceMappingURL=automations-DzH_FFKU.js.map
@@ -1,2 +0,0 @@
1
- import{o as m,co as y,$ as f,Q as I,dQ as v}from"./index-008wj-Pz.js";function w(t){const{session:r,isReady:u}=m(),c=u?r?.user.id:void 0,l=t?.limit??20,i=(t?.clientIds??[]).join(","),a=t?.activityKind??null,d=t?.excludeCommandClients??!1,n=t?.organizationId??null,s=t?.refetchInterval;return y({queryKey:["client-activity-scopes",c,l,i,a,d,n],queryFn:async()=>{const e=new URLSearchParams({limit:String(l)});i&&e.set("client_ids",i),a&&e.set("activity_kind",a),d&&e.set("exclude_command_clients","true"),n&&e.set("organization_id",n);const o=await f(`${I}/api/me/clients/activity-scopes?${e}`,{credentials:"include"});return await v(o,"Failed to load client activity"),(await o.json()).scopes??[]},enabled:!!c&&(t?.enabled??!0),staleTime:15e3,refetchInterval:typeof s=="function"?e=>s((e.state.data?.length??0)>0):s})}export{w as u};
2
- //# sourceMappingURL=client-activity-scopes-BLIy1Zc3.js.map
@@ -1,2 +0,0 @@
1
- import{cS as c,co as u,a2 as d,bO as p,bP as r,$ as o,dQ as i,Q as w}from"./index-008wj-Pz.js";function l(t,a="",e){const n=`${w}/api/${t}/clients${a}`,s=e?.toString();return s?`${n}?${s}`:n}function h(t,a){const e=a?.ownerSlug??c().slug;return u({queryKey:["connected-clients",e,t??null],queryFn:async()=>{if(!e)throw new Error("Workspace required");const n=new URLSearchParams;t&&n.set("agentId",t);const s=await o(l(e,"",n),{credentials:"include"});return await i(s,"Failed to load connected clients"),(await s.json()).clients??[]},enabled:!!e&&(a?.enabled??!0),staleTime:15e3,refetchInterval:a?.refetchInterval})}function y(){const{slug:t}=c(),a=d();return p({mutationFn:async e=>{if(!t)throw new Error("Workspace required");const n=new URLSearchParams;e.scope==="all"&&n.set("scope","all");const s=await o(l(t,`/mcp/${encodeURIComponent(e.clientId)}`,n),{method:"DELETE",credentials:"include"});return await i(s,"Failed to revoke client"),await s.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["connected-clients",t]}),r.success("App access revoked")},onError:e=>{r.error(e.message||"Failed to revoke app access")}})}export{y as a,h as u};
2
- //# sourceMappingURL=clients-8-EpRjsm.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as o}from"./index-008wj-Pz.js";const n=()=>t.jsx(o,{});export{n as component};
2
- //# sourceMappingURL=connect-C0cHE9Xl.js.map
@@ -1,2 +0,0 @@
1
- import{iL as r,j as t,av as a}from"./index-008wj-Pz.js";import{a as i}from"./agent-connect-pages-CpBxQCpx.js";import"./agent-client-setup-list-Bkyw22GW.js";import"./copy-button-Df7QXE0w.js";import"./clients-8-EpRjsm.js";import"./client-rows-DiJQ5D1z.js";function j(){const{owner:e,clientId:o}=r.useParams();return t.jsx(a,{owner:e,children:({ownerSlug:n})=>t.jsx(i,{owner:n,clientId:o})})}export{j as component};
2
- //# sourceMappingURL=connect._clientId-D4EG5a0v.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as n}from"./index-008wj-Pz.js";function e(){return t.jsx(n,{})}export{e as component};
2
- //# sourceMappingURL=connected._clientId-DhoCT6sT.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,av as w,r as y,hy as p,gr as x,gs as u,L as r,gt as o,F as N,bq as j,a$ as _,dz as L,B as $,A,iZ as g}from"./index-008wj-Pz.js";import{E as B}from"./events-feed-VfU4csn2.js";import{u as E}from"./client-activity-scopes-BLIy1Zc3.js";import{u as k}from"./clients-8-EpRjsm.js";import{g as P,a as R}from"./client-rows-DiJQ5D1z.js";import"./event-card-CBlsG32u.js";import"./use-scroll-sentinel-D-fJx_Md.js";import"./use-automations-C4TSie1i.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";const S="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function D({owner:s,clientId:a,mcpActivityId:t}){return e.jsx("div",{className:S,children:e.jsx(w,{owner:s,children:({organizationId:n,ownerSlug:l})=>e.jsx(O,{ownerSlug:l,organizationId:n,clientId:a,mcpActivityId:t})})})}function O({ownerSlug:s,organizationId:a,clientId:t,mcpActivityId:n}){const{data:l=[],isLoading:f}=k(null),i=y.useMemo(()=>P(l).find(h=>h.clientIds.includes(t)),[t,l]),d=i?.clientIds??[],{data:v=[],isLoading:C}=E({enabled:!!i&&!!a,limit:100,clientIds:d,organizationId:a}),c=n?v.find(h=>h.activityId===n)??null:null,m=i?.title??"Connected agent",b=c?R(c):"Conversation";return!a||f||n&&C?e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(u,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"py-3 text-xs text-muted-foreground",children:"Loading…"})}):n&&(!i||!c||c.organizationId===null)?e.jsx(N,{to:"/$owner/events",params:{owner:"me"},search:{client_ids:i?d.join(","):t,mcp_activity_id:n},replace:!0}):i?n?e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(u,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:m},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:c?.clientName??m})}),title:b,meta:e.jsx($,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(r,{to:"/$owner/events",params:{owner:s},search:{client_ids:d.join(","),mcp_activity_id:n},children:["See in Activity",e.jsx(A,{className:"h-3.5 w-3.5"})]})})}),children:e.jsx(B,{organizationId:a,ownerSlug:s,filters:{clientIds:d,mcpActivityId:n,sortBy:"date",sortOrder:"desc"},hideOriginator:!0,foldConsecutiveCalls:!0,emptyState:e.jsx(_,{icon:L,title:"No activity in this conversation yet",description:"Calls this app makes will appear here."})})}):e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(u,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:m},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:m})}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a conversation on this app's page to see its activity."})}):e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(u,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This app isn't connected to this workspace, so its activity isn't available."})})}function Y(){const{owner:s,clientId:a}=g.useParams(),t=g.useSearch();return e.jsx(D,{owner:s,clientId:a,mcpActivityId:typeof t.mcp_activity_id=="string"?t.mcp_activity_id:null})}export{Y as component};
2
- //# sourceMappingURL=connected._clientId.activity-Dn4qw2Us.js.map
@@ -1,2 +0,0 @@
1
- import{bu as W,E as F,r as l,$ as z,Q as R,j as e,a5 as N,B as f,bv as V,bw as q,bx as M,by as Y,bz as E,I as B,x as D,a6 as G,ab as J,a1 as K,a8 as H,J as Q}from"./index-008wj-Pz.js";import{C as X,a as Z,b as ee,c as ne}from"./card-BCsbrdGs.js";const w="__new_org__";function te(r){return r.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function C(r){return G.find(i=>i.provider===r)?.name??r}function re(r,i){return`${window.location.origin}/connector/${encodeURIComponent(r)}/connection?${new URLSearchParams({ref:i})}`}function ie(r,i){return r==="account_already_linked_to_different_user"?`This ${i} account belongs to a different Lobu account than the one you are signed in to. Sign out, then continue with ${i} to finish setup as that account.`:`We couldn’t verify your ${i} account for this setup. Sign out, then continue with ${i} to try again.`}function oe(r,i){const[s,n]=l.useState({}),o=i?`${i}:${r}`:null;return l.useEffect(()=>{if(!o||!i||o in s)return;let c=!1;return D(i).then(h=>h.find(g=>g.key===r)?.name??null).catch(()=>null).then(h=>{c||n(g=>({...g,[o]:h}))}),()=>{c=!0}},[o,r,s,i]),o?s[o]??null:null}function I(r,i,s){if(!r)return"/";const n=`/${encodeURIComponent(r)}/`;if(s?.startsWith(n)){const o=new URL(s,window.location.origin);if(o.origin===window.location.origin&&o.pathname.startsWith(n))return o.pathname+o.search}return`${n}connectors/${encodeURIComponent(i)}?connected=1`}function se(r,i){return r==="not_admin"?`You must be an admin or owner to connect ${i} to Lobu.`:`You don't have permission to connect ${i} to Lobu.`}function T(r,i,s){switch(r){case"not_authorized":return se(i,s);case"no_pending":return`No Lobu install was found for ${s}. Add Lobu from the marketplace to get started.`;case"no_org":return`Your account has no Lobu organization to connect ${s} to.`;default:return`Something went wrong while connecting ${s}. Please try again.`}}function le(){const{name:r}=W({from:"/connector/$name/connection"}),{ref:i,error:s}=F({from:"/connector/$name/connection"}),[n,o]=l.useState({kind:"loading"}),[c,h]=l.useState(""),[g,O]=l.useState(""),[x,$]=l.useState(!1),[_,p]=l.useState(null),[j,k]=l.useState(null),u=oe(r,n.kind==="confirm"?n.orgs[0]?.slug??null:n.kind==="already_connected"?n.orgSlug:null),m=n.kind==="confirm"&&n.subjectKind||"connection",S=n.kind==="confirm"&&n.subjectName?n.subjectName:u?`this ${u} ${m}`:`this ${m}`,P=l.useCallback(async()=>{if(!i){o({kind:"error",message:"This connection link is missing its reference."});return}o({kind:"loading"});try{const t=await(await z(`${R}/api/connector/${encodeURIComponent(r)}/connection/claim-context?ref=${encodeURIComponent(i)}`,{credentials:"include"})).json();if("error"in t){if(t.error==="unauthenticated"){o({kind:"signin",signinProvider:t.signinProvider??r,linkAccount:!1});return}if(t.error==="signin_required"){o(s?{kind:"link_failed",signinProvider:t.signinProvider??r,error:s}:{kind:"signin",signinProvider:t.signinProvider??r,linkAccount:!0});return}o({kind:"error",message:T(t.error,t.code,"this connection")});return}if("alreadyConnected"in t){o({kind:"already_connected",orgSlug:t.orgSlug,nextUrl:t.nextUrl});return}h(t.orgs[0]?.slug??""),o({kind:"confirm",subjectKind:t.subjectKind,subjectName:t.subjectName,orgs:t.orgs})}catch{o({kind:"error",message:"We couldn’t load this connection link. Please try again."})}},[r,i,s]);l.useEffect(()=>{P()},[P]);const L=async d=>{if(!i)return;const t=re(r,i);if(n.kind==="signin"&&n.linkAccount){const y=await J.linkSocial({provider:d,callbackURL:t,errorCallbackURL:t});y.error&&o({kind:"error",message:y.error.message??"Couldn’t verify this account."});return}n.kind==="link_failed"&&await K(),await H.social({provider:d,callbackURL:t,errorCallbackURL:t})},U=async(d=!1)=>{if(!(!i||!c)){$(!0),p(null),k(null);try{let t=c;if(c===w){const b=g.trim();if(!b){p("Enter a name for the new organization.");return}const v=await Q.create({name:b,slug:te(b)});if(v.error||!v.data){p(v.error?.message??"Couldn’t create the organization.");return}t=v.data.slug}const a=await(await z(`${R}/api/connector/${encodeURIComponent(r)}/connection/claim`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ref:i,org:t,confirmMove:d})})).json();if("error"in a){if(a.error==="signin_required"||a.error==="unauthenticated"){o({kind:"signin",signinProvider:a.signinProvider??r,linkAccount:a.error==="signin_required"});return}if((a.error==="already_connected_elsewhere"||a.error==="enterprise_scope_overlap")&&a.existing){k({kind:a.error,existing:a.existing});return}p(T(a.error,a.code,S));return}window.location.href=I(a.orgSlug,r,a.nextUrl)}catch{p(`Something went wrong while connecting this ${m}. Please try again.`)}finally{$(!1)}}},A=n.kind==="signin"?"Sign in to continue":n.kind==="link_failed"?"Use a different account":n.kind==="error"?`Can’t connect this ${m}`:n.kind==="already_connected"?"Already connected":u?`Connect ${u} to Lobu`:"Connect to Lobu";return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md p-8",children:e.jsxs(X,{children:[e.jsx(Z,{children:e.jsx(ee,{asChild:!0,children:e.jsx("h1",{children:A})})}),e.jsxs(ne,{children:[n.kind==="loading"&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(N,{size:"lg"}),e.jsx("span",{children:"Checking this connection link…"})]}),n.kind==="error"&&e.jsx("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:n.message}),n.kind==="already_connected"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This ",u?`${u} `:"",m," is already connected to Lobu."]}),e.jsx(f,{className:"w-full",asChild:!0,children:e.jsx("a",{href:I(n.orgSlug,r,n.nextUrl),children:n.nextUrl?"Choose an agent":"Open Lobu"})})]}),n.kind==="signin"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sign in with ",C(n.signinProvider)," to verify you can connect this ",m,"."]}),e.jsxs(f,{className:"w-full",onClick:()=>L(n.signinProvider),children:["Sign in with ",C(n.signinProvider)]})]}),n.kind==="link_failed"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{role:"alert",className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:ie(n.error,C(n.signinProvider))}),e.jsxs(f,{className:"w-full",onClick:()=>L(n.signinProvider),children:["Sign out and continue with"," ",C(n.signinProvider)]})]}),n.kind==="confirm"&&(()=>{const d=n.subjectName||S;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Connecting"," ",e.jsx("strong",{className:"font-medium text-foreground",children:d}),". Choose the organization to connect it to:"]}),e.jsxs(V,{value:c,onValueChange:t=>{k(null),h(t)},children:[e.jsx(q,{children:e.jsx(M,{placeholder:"Select an organization"})}),e.jsxs(Y,{children:[n.orgs.map(t=>e.jsxs(E,{value:t.slug,children:[t.name,t.isPersonal&&e.jsx("span",{className:"ml-1 text-muted-foreground",children:"(personal)"})]},t.id)),e.jsx(E,{value:w,children:"+ New organization"})]})]}),c===w&&e.jsx(B,{autoFocus:!0,value:g,onChange:t=>O(t.target.value),placeholder:"New organization name","aria-label":"New organization name"}),_&&e.jsx("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:_}),j&&(()=>{const t=j.existing.orgName??j.existing.orgSlug??"another organization";return j.kind==="already_connected_elsewhere"?e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/40 px-3 py-3",children:[e.jsxs("p",{className:"text-sm text-foreground",children:[d," is already connected in"," ",e.jsx("strong",{className:"font-medium",children:t}),". Move it here?"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{className:"flex-1",onClick:()=>U(!0),disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Moving…"})]}):"Move it here"}),e.jsx(f,{className:"flex-1",variant:"outline",onClick:()=>k(null),disabled:x,children:"Cancel"})]})]}):e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:["This ",u?`${u} `:"","Enterprise Grid is already connected in"," ",e.jsx("strong",{className:"font-medium",children:t}),"; ","connecting this ",m," here may change how its messages route. Contact support to move it."]})})(),e.jsx(f,{className:"w-full",onClick:()=>U(),disabled:x||j!==null||!c||c===w&&!g.trim(),children:x?e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Connecting…"})]}):`Connect ${d}`})]})})()]})]})})})}export{le as component};
2
- //# sourceMappingURL=connection-X9VU9Ijm.js.map
@@ -1,2 +0,0 @@
1
- import{g$ as q,r,j as e,eP as G,cY as J,dF as Q,h as F,B as N,eR as X,iF as Y,bW as O,eB as E,h3 as $,bv as Z,bw as ee,bx as se,by as te,bz as ne,eC as R,b_ as B,bG as ae,a5 as V,iG as ce,cO as ie,cU as le,iH as re,dk as oe,iI as de,iJ as me,cp as ue,iK as xe,cQ as he,cu as ge,cN as pe,L as z,g4 as D,V as K,bk as T}from"./index-008wj-Pz.js";import{f as fe,C as je}from"./entity-options-DJv2EhVV.js";import{s as L}from"./event-card-CBlsG32u.js";import{V as ve,b as ye,S as M,g as I}from"./runs-panel-LnGpHCAQ.js";import{f as Ne}from"./feed-event-kinds-BYuZCoU4.js";function be({organizationId:s,value:t,onChange:i,entities:a,className:d}){const{data:c=[]}=q(a?void 0:s),o=r.useMemo(()=>a??fe(c),[a,c]),x=new Set(t),l=o.filter(n=>x.has(n.id)),g=n=>{const u=new Set(x);u.has(n)?u.delete(n):u.add(n),i(Array.from(u).sort((v,y)=>v-y))},j=l.length===0?"All entities":l.length===1?l[0].name:`${l.length} entities selected`;return e.jsx(G,{contentClassName:"w-[320px]",searchPlaceholder:"Filter entities...",emptyText:"No entities found.",trigger:n=>e.jsxs(N,{variant:"outline",role:"combobox","aria-expanded":n,className:F("justify-between",d),children:[j,e.jsx(X,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:()=>o.map(n=>{const u=x.has(n.id);return e.jsxs(J,{value:`${n.name} ${n.entityType}`,onSelect:()=>g(n.id),className:"cursor-pointer",children:[e.jsx(Q,{className:F("mr-2 h-4 w-4",u?"opacity-100":"opacity-0")}),e.jsxs("span",{children:[n.name," ",e.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",n.entityType,")"]})]})]},n.id)})})}function _e(s){return s?.feeds_schema?Object.entries(s.feeds_schema).map(([t,i])=>({key:t,name:i.name??t,description:i.description,configSchema:i.configSchema})):[]}const Ve="Feeds are optional scheduled sync targets for an existing connection.";function De({organizationId:s,connections:t,connectorDefinitions:i,entityId:a,onClose:d}){const c=t.length===1,[o,x]=r.useState(c?String(t[0].id):""),[l,g]=r.useState(""),[j,n]=r.useState(a?[a]:[]),[u,v]=r.useState(null),y=Y(),w=r.useMemo(()=>new Map(i.map(m=>[m.key,m])),[i]),p=r.useMemo(()=>t.find(m=>String(m.id)===o),[t,o]),b=r.useMemo(()=>p?_e(w.get(p.connector_key)):[],[p,w]),_=r.useMemo(()=>b.find(m=>m.key===l)??null,[b,l]),h=O(`${o}:${l}`,E(_?.configSchema),_?.configSchema),{values:S,setValues:C}=h,f=r.useCallback(()=>{x(c?String(t[0].id):""),g(""),n(a?[a]:[]),v(null)},[a,c,t]),k=r.useCallback(()=>{f(),d()},[d,f]),U=r.useCallback(async()=>{if(!h.canSubmit||!p||!l)return;v(null);const m=$(S);try{await y.mutateAsync({connection_id:p.id,feed_key:l,config:Object.keys(m).length>0?m:void 0,entity_ids:a?[a]:j.length>0?j:void 0}),k()}catch(A){v(A instanceof Error?A.message:"Failed to create feed")}},[S,h.canSubmit,y,a,k,p,j,l]),W=e.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto py-6 pr-1",children:[!c&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Connection"}),e.jsx(je,{connections:t,value:o,onValueChange:m=>{x(m),g(""),v(null)},placeholder:"Select a connection"})]}),p&&b.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Feed Type"}),e.jsxs(Z,{value:l,onValueChange:g,children:[e.jsx(ee,{children:e.jsx(se,{placeholder:"Select feed type"})}),e.jsx(te,{children:b.map(m=>e.jsx(ne,{value:m.key,children:e.jsxs("div",{children:[e.jsx("span",{children:m.name}),m.description&&e.jsxs("span",{className:"text-muted-foreground ml-1 text-xs",children:["— ",m.description]})]})},m.key))})]})]}),a?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Target Entity"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This feed will be attached to the current entity."})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Target Entities"}),e.jsx(be,{organizationId:s,value:j,onChange:n,className:"w-full"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Leave empty to create an unscoped feed."})]}),h.revision&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Feed Configuration"}),e.jsx(R,{schema:h.revision,values:S,onValuesChange:C})]}),p&&b.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector has no configurable feed types."}),e.jsx(B,{visible:h.hasConflict,onReload:h.reset}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u})]}),H=e.jsx(ae,{onCancel:k,className:"mt-2",children:e.jsxs(N,{disabled:!h.canSubmit||!l||y.isPending,onClick:()=>void U(),children:[y.isPending&&e.jsx(V,{size:"lg",className:"mr-2"}),"Create Feed"]})});return e.jsxs("div",{className:"flex flex-col",children:[W,H]})}function Ae({feed:s,onClose:t,hideHeader:i=!1}){const a=s.display_name?.trim()||s.feed_key,d=s.feed_key.includes(":")?s.feed_key.slice(s.feed_key.indexOf(":")+1):s.feed_key,c=s.external_tenant_id,o=s.connector_key==="slack"&&c?`https://app.slack.com/client/${c}/${d}`:void 0;return e.jsxs("div",{className:"flex max-w-xl flex-col gap-4",children:[i?null:e.jsxs(e.Fragment,{children:[t?e.jsxs("button",{type:"button",onClick:t,className:"inline-flex w-fit items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(ce,{className:"h-3 w-3"}),"Back to connection"]}):null,e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h2",{className:"text-lg font-semibold leading-tight",children:a}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"chat channel"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Messages captured for this channel are available to Lobu Automations. Open Slack to read the channel history."}),o?e.jsx(N,{asChild:!0,variant:"outline",className:"w-full justify-center",children:e.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(le,{className:"mr-2 h-4 w-4"}),"Open in Slack"]})}):null,e.jsxs("div",{className:F(oe,"flex flex-col gap-3 p-4"),children:[e.jsx("div",{className:"text-xs font-medium uppercase text-muted-foreground",children:"Channel"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[e.jsx(re,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"break-all",children:a})]}),c?e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Workspace"}),e.jsx("span",{className:"break-all font-mono text-xs",children:c})]}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages the bot sees here are captured as they arrive. Open the channel in Slack to read the full history."})]})]})}function Te(s,t){return s.display_name?s.display_name:t?.feeds_schema?.[s.feed_key]?.name??s.feed_key}function Se(s,t){const i=s?.feeds_schema;if(!i)return;if(i[t])return i[t];const a=Object.values(i);return a.find(d=>d?.key===t)??(a.length===1?a[0]:void 0)}const P=8;function Ce({kinds:s}){const[t,i]=r.useState(!1),a=t?s:s.slice(0,P);return e.jsxs(D,{title:"Event types",count:`${s.length} ${s.length===1?"kind":"kinds"}`,children:[e.jsx("ul",{className:"divide-y",children:a.map(({kind:d,description:c,targets:o})=>e.jsxs("li",{className:"flex flex-col gap-1 py-2 sm:flex-row sm:items-start sm:gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:L(d)}),e.jsx("code",{className:"truncate font-mono text-[11px] text-muted-foreground",children:d})]}),c?e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",title:c,children:c}):null]}),o.length>0?e.jsx("div",{className:"flex flex-wrap gap-1 sm:max-w-[40%] sm:justify-end",children:o.map(({entityType:x,creates:l})=>e.jsx(K,{variant:"secondary",className:"font-normal",title:l?`Creates ${x} records`:`Links to existing ${x} records`,children:L(x)},x))}):null]},d))}),s.length>P?e.jsx(N,{variant:"ghost",size:"sm",className:"mt-1 h-7 px-2 text-xs text-muted-foreground",onClick:()=>i(d=>!d),children:t?"Show fewer":`Show all ${s.length}`}):null]})}function Le({feed:s,ownerSlug:t}){return e.jsxs(e.Fragment,{children:[e.jsx(M,{status:I(s.status),showDot:!0,children:s.status}),s.connection_status&&s.connection_status!==s.status&&e.jsxs(M,{status:I(s.connection_status),showDot:!0,children:["Connection: ",s.connection_status]}),s.device_worker_id?e.jsx(z,{to:"/$owner/connectors/device/$deviceId",params:{owner:t,deviceId:s.device_worker_id},children:e.jsx(K,{variant:s.device_status==="offline"?"secondary":"outline",className:"text-xs hover:bg-accent",children:s.device_status==="offline"?`Waiting for ${s.device_label||s.device_platform||"device"}`:`On ${s.device_label||s.device_platform||"device"}`})}):null]})}function Me({feed:s}){return s.operations.includes("sync")?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Last sync: ",s.last_sync_at?T(s.last_sync_at):"—"]}),e.jsxs("span",{children:["Next: ",s.next_run_at?T(s.next_run_at):"—"]}),e.jsxs("span",{className:"font-mono",children:[(s.event_count??0).toLocaleString()," events"]})]}):e.jsx("span",{children:"Read live when queried"})}function Ie({feed:s,connectorDef:t,ownerSlug:i}){const{data:a,refetch:d}=de(s.id),c=me(),o=ue(),x=a?.recent_runs?.some(f=>["running","pending","claimed"].includes(f.status));r.useEffect(()=>{if(!x)return;const f=setInterval(()=>d(),5e3);return()=>clearInterval(f)},[x,d]);const l=r.useMemo(()=>Se(t,s.feed_key),[t,s.feed_key]),g=l?.configSchema,j=r.useMemo(()=>Ne(l).sort((f,k)=>f.kind.localeCompare(k.kind)),[l]),n=O(s.id,E(g,s.config??{}),g),{values:u,setValues:v,dirty:y}=n,w=r.useCallback(async()=>{n.canSubmit&&(await c.mutateAsync({feed_id:s.id,config:$(u)}),n.accept(u,E(g,$(u))))},[c,s.id,u,g,n.canSubmit,n.accept]),p=r.useCallback(async()=>{const f=s.status==="active"?"paused":"active";await c.mutateAsync({feed_id:s.id,status:f})},[c,s.id,s.status]),b=r.useCallback(async()=>{await o.mutateAsync(s.id)},[o,s.id]),_=s.status==="active",h=s.operations.includes("sync"),S=s.auth_profile_status&&s.auth_profile_status!=="active",C=c.isPending||o.isPending;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(N,{variant:"outline",size:"sm",disabled:C,onClick:()=>void p(),children:[_?e.jsx(xe,{className:"h-3.5 w-3.5 mr-1.5"}):e.jsx(he,{className:"h-3.5 w-3.5 mr-1.5"}),_?"Pause":"Resume"]}),h?e.jsxs(N,{variant:"outline",size:"sm",disabled:C||!_,onClick:()=>void b(),children:[o.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):e.jsx(ge,{className:"h-3.5 w-3.5 mr-1.5"}),"Sync now"]}):null,e.jsx(ve,{ownerSlug:i,scope:{kind:"feed",id:s.id},variant:"ghost",label:"View in memory"})]}),S&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-amber-50 dark:bg-amber-950/20 px-3 py-2 text-sm",children:[e.jsx(pe,{className:"h-4 w-4 text-amber-500 shrink-0"}),e.jsxs("span",{className:"text-amber-700 dark:text-amber-400",children:["Authentication issue: ",s.auth_profile_status]}),e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"ml-auto h-7 text-xs",children:e.jsx(z,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:i,connectorKey:s.connector_key,connectionId:String(s.connection_id)},search:{settings:!0},children:"Fix auth"})})]}),n.revision?e.jsx(D,{title:"Settings",children:e.jsxs("div",{className:"max-w-xl space-y-4",children:[e.jsx(R,{schema:n.revision,values:u,onValuesChange:v}),e.jsx(B,{visible:n.hasConflict,onReload:n.reset}),y&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(N,{size:"sm",disabled:C||!n.canSubmit,onClick:()=>void w(),children:[c.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Save"]})})]})}):null,j.length>0?e.jsx(Ce,{kinds:j}):null,h?e.jsx(D,{title:"Recent syncs",children:a?.recent_runs&&a.recent_runs.length>0?e.jsx(ye,{runs:a.recent_runs,ownerSlug:i}):e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"No syncs yet."})}):null]})}export{De as A,Ae as C,Le as F,Me as a,Ie as b,Ve as c,Te as f};
2
- //# sourceMappingURL=connection-feed-detail-B6ydKasK.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,dI as m,dK as u,dJ as h,cU as v,V as x,L as c}from"./index-008wj-Pz.js";function N({connectorDef:s,connectorKey:t,ownerSlug:n,deviceWorkerId:i,deviceLabel:o}){return s?e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5 text-[11.5px] text-muted-foreground",children:[e.jsx("span",{children:"Runs on"}),e.jsx(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:t},className:"underline underline-offset-2 hover:text-foreground",children:s.name}),e.jsx(f,{deviceWorkerId:i,deviceLabel:o,connectorDef:s,ownerSlug:n})]}):null}function f({connectorDef:s,ownerSlug:t,deviceWorkerId:n,deviceLabel:i}){return e.jsxs(m,{children:[e.jsxs(u,{className:"rounded border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:["v",s.version||"unknown"]}),e.jsx(h,{align:"start",className:"w-80 p-0",children:e.jsx(j,{connectorDef:s,ownerSlug:t,deviceWorkerId:n,deviceLabel:i})})]})}function j({connectorDef:s,ownerSlug:t,deviceWorkerId:n,deviceLabel:i}){const o=s.runtime?.platforms??[],d=s.runtime?.scopes??[],r=s.source_uri?.trim()||null,p=!!r&&(r.startsWith("http://")||r.startsWith("https://")),l=[{label:"Key",value:e.jsx("span",{className:"font-mono",children:s.key})},{label:"Version",value:e.jsx("span",{className:"font-mono",children:s.version?`v${s.version}`:"unknown"})}];return s.catalog_origin&&l.push({label:"Origin",value:s.catalog_origin==="org"?e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:"Built in this workspace"}):e.jsx("span",{children:"Lobu catalog"})}),r&&l.push({label:"Source",value:p?e.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",className:"inline-flex max-w-full items-start gap-1 break-all font-mono text-primary hover:underline",children:[r,e.jsx(v,{className:"mt-0.5 h-3 w-3 shrink-0"})]}):e.jsx("span",{className:"break-all font-mono",children:r})}),o.length>0&&l.push({label:"Platforms",value:e.jsx("span",{className:"flex flex-wrap gap-1",children:o.map(a=>e.jsx(x,{variant:"secondary",className:"h-4 px-1 py-0 font-mono text-[10px]",children:a},a))})}),s.required_capability&&l.push({label:"Capability",value:e.jsx("span",{className:"font-mono",children:s.required_capability})}),d.length>0&&l.push({label:"Scopes",value:e.jsx("span",{className:"flex flex-wrap gap-1",children:d.map(a=>e.jsx(x,{variant:"secondary",className:"h-4 px-1 py-0 font-mono text-[10px]",children:a},a))})}),e.jsxs("div",{className:"text-xs",children:[e.jsx("dl",{className:"divide-y",children:l.map(a=>e.jsxs("div",{className:"flex gap-3 px-3 py-2",children:[e.jsx("dt",{className:"w-20 shrink-0 text-muted-foreground",children:a.label}),e.jsx("dd",{className:"min-w-0 flex-1",children:a.value})]},a.label))}),o.length>0?e.jsx("div",{className:"border-t px-3 py-2 text-muted-foreground",children:n?e.jsxs(e.Fragment,{children:["Runs on"," ",e.jsx(c,{to:"/$owner/connectors/device/$deviceId",params:{owner:t,deviceId:n},className:"text-primary hover:underline",children:i||"this device"}),"."]}):"Runs on a linked device."}):null]})}export{f as C,N as a};
2
- //# sourceMappingURL=connector-provenance-BIg8P8WY.js.map
@@ -1,2 +0,0 @@
1
- import{T as I,o as T,r,j as e,B as M,Q as D,U as B}from"./index-008wj-Pz.js";import{u as $,b as F,a as H,s as Q,g as G,A as J,W as K}from"./oauth-workspace-access-QPo4YwRX.js";import{C as V,a as X,b as Y,d as Z,c as ee}from"./card-BCsbrdGs.js";const se=["client_id","redirect_uri","scope","code_challenge","code_challenge_method"];function ce(){const s=I.useSearch(),f=s.workspace_grants==="1",{session:y,isReady:N}=T(),j=!N,{orgList:L,workspaceAccess:P,setWorkspaceAccess:q,selectedOrgIds:w,toggleSelectedOrgId:E,orgsLoading:O,orgsError:b,retryOrgs:W,workspaceSelectionReady:_}=$({allowMultiple:f}),[n,A]=r.useState(null),[k,a]=r.useState(null);F(!!y,j);const h=r.useMemo(()=>se.filter(t=>!s[t]||s[t]?.length===0),[s]),o=h.length===0,U=s.client_name?.trim()||null,i=r.useMemo(()=>Array.from(new Set((s.scope||"").split(" ").map(t=>t.trim()).filter(Boolean))),[s.scope]),g=H(i),[l,v]=r.useState(g);r.useEffect(()=>{v(g)},[g]);const d=r.useMemo(()=>Q(i,l),[l,i]),S=r.useMemo(()=>d.some(t=>t.startsWith("mcp:")),[d]),x=l,u=r.useMemo(()=>G(s.resource),[s.resource]),m=S&&!u,z=()=>{const t=new URL("/auth/login",window.location.origin);t.searchParams.set("callbackUrl",window.location.href),window.location.href=t.toString()},C=async t=>{if(!o){a(`Missing required query params: ${h.join(", ")}`);return}if(t&&m&&!_){a(b?"Workspaces could not be loaded. Retry before approving.":"Choose at least one workspace before approving.");return}A(t?"approve":"deny"),a(null);try{const c=await fetch(`${D}/oauth/authorize/consent`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({client_id:s.client_id,redirect_uri:s.redirect_uri,scope:t?d.join(" "):s.scope,state:s.state??"",code_challenge:s.code_challenge,code_challenge_method:s.code_challenge_method,client_name:s.client_name,resource:s.resource,authorization_intent:s.authorization_intent,approved:t,...t&&m?{workspace_access:P,organization_ids:w}:{}})}),p=await c.json().catch(()=>null);if(c.status===401){z();return}if(!c.ok)throw new Error(p?.error_description||p?.message||p?.error||`Failed to ${t?"approve":"deny"} OAuth consent`);const R=B(p?.redirect_url);if(!R)throw new Error("Consent response did not include a valid redirect URL");window.location.href=R}catch(c){A(null),a(c instanceof Error?c.message:"Unexpected error while submitting consent")}};return j||!y?e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking authentication..."})}):e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(V,{className:"w-full max-w-lg",children:[e.jsxs(X,{children:[e.jsx(Y,{asChild:!0,children:e.jsx("h1",{children:"Authorize application"})}),e.jsx(Z,{children:"Review the application, access level, and workspaces."})]}),e.jsxs(ee,{className:"space-y-5","aria-busy":n!==null,children:[e.jsx(J,{idPrefix:"oauth-consent",clientName:U,requestedScopes:i,accessLevel:l,onAccessLevelChange:v,disabled:n!==null}),m&&e.jsx(K,{idPrefix:"oauth-consent",allowMultiple:f,orgList:L,selectedOrgIds:w,onWorkspaceAccessChange:q,onSelectedOrgChange:E,orgsLoading:O,orgsError:b,onRetry:W,disabled:n!==null||!o}),(u||s.resource)&&e.jsx("section",{className:"rounded-md border bg-muted/20 p-3 text-sm text-muted-foreground space-y-1",children:s.resource&&e.jsx("p",{children:e.jsx("span",{className:"font-medium text-foreground",children:s.resource})})}),S&&u&&e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",u]}),e.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"If this workspace is public, the app can read public data immediately after approval."}),x==="write"&&e.jsx("li",{children:"If you are not already a member, this connection will stay read-only. Ask an organization admin to grant write access, then reconnect the MCP client."}),x==="admin"&&e.jsx("li",{children:"If you are not already an admin or owner, elevated actions will stay blocked. Ask an organization owner to grant the required role, then reconnect the MCP client."}),x==="read"&&e.jsx("li",{children:"Public read access does not require membership."})]})]}),k&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:k}),!o&&e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Missing required query params: ",h.join(", ")]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx(M,{type:"button",variant:"outline",onClick:()=>C(!1),disabled:n!==null||!o,children:n==="deny"?"Denying...":"Deny"}),e.jsx(M,{type:"button",onClick:()=>C(!0),disabled:n!==null||!o||d.length===0||m&&!_,children:n==="approve"?"Approving...":"Approve"})]})]})]})})}export{ce as component};
2
- //# sourceMappingURL=consent-fzLN-Qy7.js.map
@@ -1,2 +0,0 @@
1
- import{r as s,j as a,B as p,dF as n,f3 as d,bP as i}from"./index-008wj-Pz.js";function m({text:u,label:o,iconOnly:t=!1}){const[r,c]=s.useState(!1),e=s.useRef(void 0);return s.useEffect(()=>()=>clearTimeout(e.current),[]),a.jsxs(p,{type:"button",variant:t?"ghost":"outline",size:t?"icon":"sm",className:t?"h-6 w-6 shrink-0":"h-8 text-xs","aria-label":t?`Copy ${o}`:void 0,onClick:async()=>{try{await navigator.clipboard.writeText(u),c(!0),i.success("Copied to clipboard"),clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1500)}catch{i.error("Could not copy. Please select and copy the text.")}},children:[r?a.jsx(n,{className:"h-3.5 w-3.5"}):a.jsx(d,{className:"h-3.5 w-3.5"}),!t&&(r?"Copied":o)]})}export{m as C};
2
- //# sourceMappingURL=copy-button-Df7QXE0w.js.map
@@ -1,2 +0,0 @@
1
- import{i_ as r,j as e}from"./index-008wj-Pz.js";import{a as i}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 x(){const{owner:t,agentId:o}=r.useParams();return e.jsx(i,{owner:t,agentId:o})}export{x as component};
2
- //# sourceMappingURL=create-BjwsYarn.js.map
@@ -1,2 +0,0 @@
1
- import{j0 as o,j as e}from"./index-008wj-Pz.js";import{a}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 j(){const{owner:r,agentId:t}=o.useParams();return e.jsx(a,{owner:r,agentId:t})}export{j as component};
2
- //# sourceMappingURL=create-Dzr4mlr0.js.map
@@ -1,2 +0,0 @@
1
- import{iB as e,j as t,hw as r}from"./index-008wj-Pz.js";function a(){const{owner:n,connectorKey:o}=e.useParams();return t.jsx(r,{owner:n,initialConnectorKey:o})}export{a as component};
2
- //# sourceMappingURL=create._connectorKey-DLLn2nej.js.map
@@ -1,2 +0,0 @@
1
- import{M as we,o as ye,r as c,P as be,j as e,I as je,B as R,Q as ie}from"./index-008wj-Pz.js";import{s as ke,g as Ce,u as Ne,a as Se,b as Ae,A as Re,W as _e}from"./oauth-workspace-access-QPo4YwRX.js";import{C as oe,a as re,b as ne,d as ce,c as H}from"./card-BCsbrdGs.js";import{w as ae}from"./workspace-label-o_QfBuCM.js";function M(t){return t.trim().toUpperCase()}const Le=15e3;async function Te(t){const n=new AbortController,j=window.setTimeout(()=>n.abort(),Le);try{const a=await fetch(`${ie}/oauth/device/info?user_code=${encodeURIComponent(t)}`,{credentials:"include",signal:n.signal}),x=await a.json().catch(()=>null);return{response:a,data:x}}catch(a){throw n.signal.aborted?new Error("Verification timed out. Check your connection and try again."):a}finally{window.clearTimeout(j)}}function q(t,n){return typeof t?.error_description=="string"&&t.error_description||typeof t?.error=="string"&&t.error||n}function ze(){const t=we.useSearch(),{session:n,isReady:j}=ye(),a=!j,[x,_]=c.useState(t.user_code||""),[r,m]=c.useState(null),[h,o]=c.useState(null),[i,le]=c.useState(null),[F,L]=c.useState(null),[T,D]=c.useState(null),[E,I]=c.useState(!1),[de,V]=c.useState(null),w=c.useRef(0),k=be(t.return_to),B=k?"app":"terminal",ue=!!t.user_code,N=M(x),d=F?.code===N?F:null,g=d!==null,C=d?.scopes??[],me=c.useMemo(()=>ke(C,T),[T,C]),$=C.some(s=>s.startsWith("mcp:")),G=C.includes("device_worker:run"),he=C.includes("connections:token"),Y=G||he,S=Ce(d?.resource),U=g&&$&&!S,J=d?.multiWorkspaceGrantsEnabled===!0,y=g&&G&&!S,{orgList:W,workspaceAccess:pe,setWorkspaceAccess:fe,selectedOrgIds:Q,toggleSelectedOrgId:ge,resetWorkspaceSelection:ve,deviceHomeOrgId:z,orgsLoading:O,orgsError:A,retryOrgs:K,workspaceSelectionReady:xe}=Ne({requireDeviceHome:y,deviceHomeOrgId:de,allowMultiple:J}),b=W.find(s=>s.id===z)??null,X=U?xe:!y||!O&&!A&&b!==null,P=c.useCallback(async s=>{const p=++w.current;m("verify"),o(null),I(!1);try{const{response:v,data:l}=await Te(s);if(p!==w.current)return;if(v.status===401){const f=new URL("/auth/login",window.location.origin);f.searchParams.set("callbackUrl",window.location.href),window.location.href=f.toString();return}if(!v.ok||!l)throw new Error(q(l,"Failed to verify device authorization code"));const u=Array.isArray(l.scopes)?l.scopes:[];L({code:s,clientName:l.client_name??null,scopes:u,resource:typeof l.resource=="string"?l.resource:null,multiWorkspaceGrantsEnabled:l.multi_workspace_grants_enabled===!0}),D(Se(u))}catch(v){if(p!==w.current)return;L(null),o(v instanceof Error?v.message:"Unexpected error")}finally{p===w.current&&m(null)}},[]);Ae(!!n,a),c.useEffect(()=>{if(!(a||!n||!t.user_code))return P(M(t.user_code)),()=>{w.current+=1}},[n,a,t.user_code,P]);const Z=async s=>{const p=N;if(!p){o(`Please enter the code shown in your ${B}.`);return}if(!g){o("Verify the device code before approving or denying access.");return}if(s&&Y&&!E){o("Confirm that you initiated this request and that the device code matches.");return}if(s&&!X){o(A?"Workspaces could not be loaded. Retry before approving.":y&&!b?"Choose a workspace for this device before approving.":"Choose at least one workspace before approving.");return}const v=d?.clientName??null,l=y&&b?ae(b):null;m(s?"approve":"deny"),o(null);try{const u=await fetch(`${ie}/oauth/device/approve`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({user_code:p,approved:s,...s?{scope:me.join(" ")}:{},...s&&U?{workspace_access:pe,organization_ids:Q}:{},...s&&y&&b?{organization_id:b.id}:{}})}),f=await u.json().catch(()=>null);if(u.status===401){const te=new URL("/auth/login",window.location.origin);te.searchParams.set("callbackUrl",window.location.href),window.location.href=te.toString();return}if(!u.ok)throw new Error(q(f,"Failed to process device authorization"));const ee=s?"approved":"denied";if(f?.status!==ee)throw new Error(q(f,s?"The server did not confirm this approval. The device is still waiting — try again.":"The server did not confirm this denial. Try again."));const se=typeof f.user_code=="string"?M(f.user_code):null;if(se!==null&&se!==p)throw new Error("The server confirmed a different device code. Re-check the code shown on your device.");m(null),le({outcome:ee,code:p,clientName:v,deviceHomeLabel:l})}catch(u){m(null),o(u instanceof Error?u.message:"Unexpected error")}};return c.useEffect(()=>{if(i?.outcome!=="approved"||!k)return;const s=window.setTimeout(()=>{window.location.href=k},600);return()=>window.clearTimeout(s)},[i,k]),a||!n?e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking authentication..."})}):i?e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(oe,{className:"w-full max-w-lg",role:"status","aria-live":"polite",children:[e.jsxs(re,{children:[e.jsx(ne,{children:i.outcome==="approved"?ue?"Access Authorized":"Device Authorized":"Authorization Denied"}),e.jsx(ce,{children:i.outcome==="approved"?k?"You can close this tab and return to the Lobu app.":"You can close this tab and return to your terminal.":"The device was not authorized. You can close this tab."})]}),i.outcome==="approved"&&i.deviceHomeLabel?e.jsxs(H,{className:"text-sm text-muted-foreground",children:["This device now lives in ",i.deviceHomeLabel,". Change its workspace or share its connections from the device page under Connectors."]}):null,e.jsx(H,{className:"text-sm",children:e.jsxs("dl",{className:"space-y-1",children:[e.jsx("dt",{className:"text-muted-foreground",children:i.outcome==="approved"?"Approved code":"Denied code"}),e.jsx("dd",{className:"font-mono text-base tracking-widest text-foreground",children:i.code}),i.clientName?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Requested by"}),e.jsx("dd",{className:"text-foreground",children:i.clientName})]}):null]})})]})}):e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(oe,{className:"w-full max-w-lg",children:[e.jsxs(re,{children:[e.jsx(ne,{asChild:!0,children:e.jsx("h1",{children:g?"Authorize application":"Connect a device"})}),e.jsx(ce,{children:g?"Review the application, access level, and workspaces.":`Enter the code shown in your ${B}.`})]}),e.jsxs(H,{className:"space-y-5","aria-busy":r!==null,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"user-code",className:"text-sm font-medium",children:"Device code"}),e.jsx(je,{id:"user-code",value:x,disabled:r==="approve"||r==="deny",onChange:s=>{w.current+=1,_(s.target.value.toUpperCase()),L(null),D(null),ve(),V(null),I(!1),m(null),o(null)},placeholder:"ABCD-1234",className:"font-mono text-center text-lg tracking-widest",maxLength:9,autoFocus:!t.user_code})]}),y&&e.jsx(De,{deviceName:d?.clientName??null,orgList:W,deviceHomeOrgId:z,onChange:V,orgsLoading:O,orgsError:A,onRetry:K,disabled:r!==null}),d&&e.jsx(Re,{idPrefix:"oauth-device",clientName:d.clientName,requestedScopes:d.scopes,accessLevel:T,onAccessLevelChange:D,sensitiveScopesAcknowledged:E,onSensitiveScopesAcknowledgedChange:I,disabled:r!==null}),U&&e.jsx(_e,{idPrefix:"oauth-device",allowMultiple:J,orgList:W,selectedOrgIds:Q,onWorkspaceAccessChange:fe,onSelectedOrgChange:ge,orgsLoading:O,orgsError:A,onRetry:K,disabled:r!==null,deviceHomeOrgId:z}),g&&$&&S&&e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-1",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",S]}),e.jsx("p",{className:"text-muted-foreground",children:"This request is fixed to the workspace in the MCP resource URL."})]}),h&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:h}),e.jsx("div",{className:"flex items-center justify-end gap-3",children:g?e.jsxs(e.Fragment,{children:[e.jsx(R,{type:"button",variant:"outline",onClick:()=>Z(!1),disabled:r!==null,children:r==="deny"?"Denying...":"Deny"}),e.jsx(R,{type:"button",onClick:()=>Z(!0),disabled:r!==null||!X||Y&&!E,children:r==="approve"?"Approving...":"Approve"})]}):e.jsx(R,{type:"button",onClick:()=>P(N),disabled:r!==null||!N,children:r==="verify"?"Verifying...":"Continue"})})]})]})})}function De({deviceName:t,orgList:n,deviceHomeOrgId:j,onChange:a,orgsLoading:x,orgsError:_,onRetry:r,disabled:m}){const h=n.find(o=>o.id===j)??null;return e.jsxs("section",{className:"space-y-2 rounded-md border border-primary/20 bg-primary/5 p-3 text-sm",children:[e.jsx("label",{htmlFor:"oauth-device-home",className:"block font-medium text-foreground",children:"Device workspace"}),x?e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground",children:"Loading your workspaces..."}):_?e.jsxs("div",{role:"alert",className:"space-y-2 text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(R,{type:"button",variant:"outline",size:"sm",onClick:r,children:"Retry"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("select",{id:"oauth-device-home",value:h?.id??"",disabled:m,onChange:o=>a(o.target.value),className:"flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[h?null:e.jsx("option",{value:"",disabled:!0,children:"Choose a workspace"}),n.map(o=>e.jsx("option",{value:o.id,children:ae(o)},o.id))]}),h&&!h.isPersonal?e.jsxs("p",{role:"note",className:"rounded-md bg-amber-500/10 px-3 py-2 text-amber-700 dark:text-amber-400",children:[t??"This device"," will be added to ",h.name,". Its Shell and Browser connections will be private to you — teammates can't use them unless you share them from the device page."]}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:"This applies to a newly paired device. A device that is already paired keeps its workspace; change it from the Devices page."})]})]})}export{ze as component};
2
- //# sourceMappingURL=device-C3AEoL5c.js.map