@lobu/runtime-server 21.1.0 → 21.2.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 (238) hide show
  1. package/dist/catalogs/connectors.json +2 -35
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/README.md +6 -3
  4. package/dist/connectors/github.ts +0 -6
  5. package/dist/connectors/google_calendar.ts +0 -4
  6. package/dist/connectors/google_drive.ts +0 -2
  7. package/dist/connectors/google_gmail.ts +0 -6
  8. package/dist/connectors/market_quotes.ts +0 -1
  9. package/dist/connectors/microsoft_outlook.ts +0 -2
  10. package/dist/connectors/postgres.ts +68 -3
  11. package/dist/connectors/whatsapp_web.ts +2 -8
  12. package/dist/connectors/x.ts +3 -9
  13. package/dist/connectors/youtube.ts +0 -5
  14. package/dist/db/migrations/20260930010000_connector_policy_scopes.sql +113 -0
  15. package/dist/db/migrations/20261002230000_connector_exact_policy_target.sql +36 -0
  16. package/dist/db/migrations/20261003120000_source_backed_entity_identity.sql +109 -0
  17. package/dist/db/migrations/20261003200000_drop_source_backed_entity_identity.sql +111 -0
  18. package/dist/db/migrations/preconditions/20261002230000_connector_exact_policy_target.sql +38 -0
  19. package/dist/db/migrations/preconditions/20261003200000_drop_source_backed_entity_identity.sql +21 -0
  20. package/dist/dependencies.bun.lock +52 -54
  21. package/dist/owletto/dist/assets/_-C1iPVDAS.js +2 -0
  22. package/dist/owletto/dist/assets/_-TlzPuBqI.js +1 -0
  23. package/dist/owletto/dist/assets/_agentId-DutmYPK7.js +1 -0
  24. package/dist/owletto/dist/assets/_agentId-DvhFYLLv.js +1 -0
  25. package/dist/owletto/dist/assets/_automationId-NuFSEFlw.js +1 -0
  26. package/dist/owletto/dist/assets/_connectorKey._connectionId-D_FhMGN1.js +1 -0
  27. package/dist/owletto/dist/assets/_connectorKey.index-B8AZikVg.js +1 -0
  28. package/dist/owletto/dist/assets/{_conversationId-CpuEvflw.js → _conversationId-D1Cx42I0.js} +1 -1
  29. package/dist/owletto/dist/assets/{_deploymentId-BL9tnDFl.js → _deploymentId-BjtZC8Oo.js} +1 -1
  30. package/dist/owletto/dist/assets/_name-DTlirHDv.js +1 -0
  31. package/dist/owletto/dist/assets/_owner-c8L8M4FP.js +1 -0
  32. package/dist/owletto/dist/assets/_shape-DQaUs_O7.js +1 -0
  33. package/dist/owletto/dist/assets/_skillKey-CJSEeyG0.js +1 -0
  34. package/dist/owletto/dist/assets/_slug-Nlm2ziLr.js +1 -0
  35. package/dist/owletto/dist/assets/_viewKey-BK9NZs21.js +1 -0
  36. package/dist/owletto/dist/assets/_viewKey-D-Og614G.js +1 -0
  37. package/dist/owletto/dist/assets/_viewKey-DIFCFECi.js +1 -0
  38. package/dist/owletto/dist/assets/accept-invitation-BfqbITxp.js +1 -0
  39. package/dist/owletto/dist/assets/activity-route-view-CTQEg3Us.js +1 -0
  40. package/dist/owletto/dist/assets/{agent-card-controls-bhTMPoVi.js → agent-card-controls-49SIdmyU.js} +1 -1
  41. package/dist/owletto/dist/assets/{agent-client-setup-list-BBbq_2B1.js → agent-client-setup-list-ChwHMq4Q.js} +1 -1
  42. package/dist/owletto/dist/assets/agent-connect-pages-CJntJskO.js +1 -0
  43. package/dist/owletto/dist/assets/agent-editor-form-CEEFNek5.js +1 -0
  44. package/dist/owletto/dist/assets/agent-guardrails-route-BF_RvzHv.js +1 -0
  45. package/dist/owletto/dist/assets/{agent-loading-shells-BQLjzMPy.js → agent-loading-shells-Cve_XIMW.js} +1 -1
  46. package/dist/owletto/dist/assets/agent-permissions-matrix-DEYa123T.js +1 -0
  47. package/dist/owletto/dist/assets/{agent-skill-context-s42Q4Wjo.js → agent-skill-context-DuS7Ojm_.js} +1 -1
  48. package/dist/owletto/dist/assets/agent-skills-route-BItudd8s.js +1 -0
  49. package/dist/owletto/dist/assets/agent-subpage-shell-BkGzpmv5.js +1 -0
  50. package/dist/owletto/dist/assets/agent-thread-DhCFggHZ.js +8 -0
  51. package/dist/owletto/dist/assets/agents-BIA5SCAT.js +1 -0
  52. package/dist/owletto/dist/assets/agents-workbench-BZaoiFNY.js +1 -0
  53. package/dist/owletto/dist/assets/{app._appId-CqYz3AOO.js → app._appId-0fp8NC9-.js} +1 -1
  54. package/dist/owletto/dist/assets/automation-detail-content-C08Ef137.js +1 -0
  55. package/dist/owletto/dist/assets/automations-BIA5SCAT.js +1 -0
  56. package/dist/owletto/dist/assets/{calendar-CHXehtu0.js → calendar-CvEqJnKS.js} +1 -1
  57. package/dist/owletto/dist/assets/callback-BfjlxUcL.js +1 -0
  58. package/dist/owletto/dist/assets/{card-4Ull9W6d.js → card-MXMmjz9G.js} +1 -1
  59. package/dist/owletto/dist/assets/{claim-BGLCPLXq.js → claim-B5igXpyF.js} +1 -1
  60. package/dist/owletto/dist/assets/{clients-C7ubnFsS.js → clients-DqMOcwpO.js} +1 -1
  61. package/dist/owletto/dist/assets/{code-editor-BHiWR94J.js → code-editor-bpbaa7f6.js} +1 -1
  62. package/dist/owletto/dist/assets/connect-DpQrbviv.js +1 -0
  63. package/dist/owletto/dist/assets/connect._clientId-A_F-UzTr.js +1 -0
  64. package/dist/owletto/dist/assets/connected._clientId-BWVr-PMm.js +1 -0
  65. package/dist/owletto/dist/assets/connection-D-dXA43c.js +1 -0
  66. package/dist/owletto/dist/assets/connection-feed-detail-XYK-ubKG.js +1 -0
  67. package/dist/owletto/dist/assets/{connector-provenance-DRdUEmQ1.js → connector-provenance-RL_DcF2q.js} +1 -1
  68. package/dist/owletto/dist/assets/connectors-B2_PLuXP.js +1 -0
  69. package/dist/owletto/dist/assets/{consent-fmhPPlpi.js → consent-CMrkyIfi.js} +1 -1
  70. package/dist/owletto/dist/assets/{core.esm-C-eNiUAl.js → core.esm-BrIR85HL.js} +1 -1
  71. package/dist/owletto/dist/assets/create-DhxcVjNh.js +1 -0
  72. package/dist/owletto/dist/assets/create-UTXCruIl.js +1 -0
  73. package/dist/owletto/dist/assets/create-automation-form-BHir-pIp.js +2 -0
  74. package/dist/owletto/dist/assets/create-jVkf6V76.js +1 -0
  75. package/dist/owletto/dist/assets/{create._connectorKey-CHAotlsF.js → create._connectorKey-qjd3B6p5.js} +1 -1
  76. package/dist/owletto/dist/assets/{cronstrue-C5yTgk5z.js → cronstrue-BwvvZn_Y.js} +1 -1
  77. package/dist/owletto/dist/assets/deployments-CSJHFlJz.js +1 -0
  78. package/dist/owletto/dist/assets/{deployments-D1gbQwsy.js → deployments-DHAx8TBs.js} +1 -1
  79. package/dist/owletto/dist/assets/{deployments-body-DycIGlnL.js → deployments-body-B54mJoZC.js} +1 -1
  80. package/dist/owletto/dist/assets/{device-DyPnQkhO.js → device-Bi_9KNKQ.js} +1 -1
  81. package/dist/owletto/dist/assets/device-pin-tombstone-Dkmmka9d.js +1 -0
  82. package/dist/owletto/dist/assets/device-rows-CkTAaZ3m.js +1 -0
  83. package/dist/owletto/dist/assets/device._deviceId-B_WqDhY5.js +1 -0
  84. package/dist/owletto/dist/assets/entity-options-Bm1sbpmt.js +1 -0
  85. package/dist/owletto/dist/assets/entity-page-DZUGex-P.js +1 -0
  86. package/dist/owletto/dist/assets/entity-type-page-DSBcVv9e.js +1 -0
  87. package/dist/owletto/dist/assets/event-page-B837JclA.js +1 -0
  88. package/dist/owletto/dist/assets/events-feed-BgvLTppV.js +1 -0
  89. package/dist/owletto/dist/assets/{full-page-spinner-DsU-Cb3L.js → full-page-spinner-ByBsHimW.js} +1 -1
  90. package/dist/owletto/dist/assets/guardrails-cMGe6IIe.js +1 -0
  91. package/dist/owletto/dist/assets/identity-BORtpi5L.js +1 -0
  92. package/dist/owletto/dist/assets/index-B5lGxbbZ.js +1 -0
  93. package/dist/owletto/dist/assets/index-BGz-9DDG.js +1 -0
  94. package/dist/owletto/dist/assets/{index-DwtfHCHB.js → index-Be5BLMwZ.js} +1 -1
  95. package/dist/owletto/dist/assets/index-BmAuAhub.css +1 -0
  96. package/dist/owletto/dist/assets/{index-nOYvNROJ.js → index-BrT0gBIi.js} +1 -1
  97. package/dist/owletto/dist/assets/index-BrzsfXR-.js +1 -0
  98. package/dist/owletto/dist/assets/{index-CpWKAAGX.js → index-C1MV7ajb.js} +1 -1
  99. package/dist/owletto/dist/assets/index-C31QOVZH.js +1 -0
  100. package/dist/owletto/dist/assets/index-C6USRbY8.js +1 -0
  101. package/dist/owletto/dist/assets/{index-D2dcENg2.js → index-Cane2GT3.js} +1 -1
  102. package/dist/owletto/dist/assets/{index-1YrrvVJ4.js → index-DBs2lhwE.js} +8 -8
  103. package/dist/owletto/dist/assets/index-Dh8ubWqr.js +1 -0
  104. package/dist/owletto/dist/assets/index-DjYcFuq9.js +1 -0
  105. package/dist/owletto/dist/assets/index-Dpf0I2N4.js +1 -0
  106. package/dist/owletto/dist/assets/index-DpgsgDFc.js +1 -0
  107. package/dist/owletto/dist/assets/index-DqrjJ9LB.js +1 -0
  108. package/dist/owletto/dist/assets/{index-DtRfQcRH.js → index-GZkujXG1.js} +1595 -1595
  109. package/dist/owletto/dist/assets/index-pFFCzVi5.js +1 -0
  110. package/dist/owletto/dist/assets/{json-diff-DYeX-xLk.js → json-diff-D6sv990W.js} +3 -3
  111. package/dist/owletto/dist/assets/{list-skeleton-s4GPSJ8J.js → list-skeleton-B39wKVT1.js} +1 -1
  112. package/dist/owletto/dist/assets/login-DxnhCvKx.js +1 -0
  113. package/dist/owletto/dist/assets/logout-Lvib6Kk7.js +1 -0
  114. package/dist/owletto/dist/assets/member-scope-gate-CM-GNviT.js +1 -0
  115. package/dist/owletto/dist/assets/{memory-browse-page-Bibfs2sK.js → memory-browse-page-DKmyI1FJ.js} +1 -1
  116. package/dist/owletto/dist/assets/{missing-view-CD4DOaG8.js → missing-view-CAFqvZpi.js} +1 -1
  117. package/dist/owletto/dist/assets/{model-selector-XC5CI2Et.js → model-selector-BoudNhPZ.js} +1 -1
  118. package/dist/owletto/dist/assets/models-B8BuBmLu.js +1 -0
  119. package/dist/owletto/dist/assets/new-CKSjnGM9.js +1 -0
  120. package/dist/owletto/dist/assets/new-Jp_DtYBt.js +1 -0
  121. package/dist/owletto/dist/assets/new-e3C5Yokb.js +1 -0
  122. package/dist/owletto/dist/assets/{oauth-workspace-access-D6epOq0R.js → oauth-workspace-access-DuPiMSr2.js} +1 -1
  123. package/dist/owletto/dist/assets/organization-DUPBruFP.js +1 -0
  124. package/dist/owletto/dist/assets/{permissions-D8uJHINS.js → permissions-DqkX4mTH.js} +1 -1
  125. package/dist/owletto/dist/assets/{proposal-review-shell-C3K-JXjb.js → proposal-review-shell-C04RG1qM.js} +1 -1
  126. package/dist/owletto/dist/assets/{recent-CFcWceBl.js → recent-BmxCZQ8j.js} +1 -1
  127. package/dist/owletto/dist/assets/{renderer-1nRJFMGx.js → renderer-eFSU65zm.js} +1 -1
  128. package/dist/owletto/dist/assets/{reset-password-9RTWhBEb.js → reset-password-BinCwene.js} +1 -1
  129. package/dist/owletto/dist/assets/runs-DwThk2CI.js +1 -0
  130. package/dist/owletto/dist/assets/{runs-panel-B2852xus.js → runs-panel-DfxWCV7K.js} +1 -1
  131. package/dist/owletto/dist/assets/runs-table-Dh7FL3Va.js +1 -0
  132. package/dist/owletto/dist/assets/{schema-value-normalization-BspxVEGy.js → schema-value-normalization-CPLeOm7K.js} +1 -1
  133. package/dist/owletto/dist/assets/settings-CSrpSUqR.js +1 -0
  134. package/dist/owletto/dist/assets/{settings-9lDASETT.js → settings-DLg89oqz.js} +1 -1
  135. package/dist/owletto/dist/assets/skills-PQP0fNxc.js +1 -0
  136. package/dist/owletto/dist/assets/{switch-CxDXvPGE.js → switch-Dcx3_8kM.js} +1 -1
  137. package/dist/owletto/dist/assets/{use-applied-views-DvMT3wap.js → use-applied-views-BpvIIgWG.js} +1 -1
  138. package/dist/owletto/dist/assets/{use-mention-search-CeTEE3oE.js → use-mention-search-Vndny_Gd.js} +1 -1
  139. package/dist/owletto/dist/assets/{view-frame-HoBawpT2.js → view-frame-DxiuLSGA.js} +1 -1
  140. package/dist/owletto/dist/index.html +2 -2
  141. package/dist/server-main.bundle.mjs +4097 -4383
  142. package/npm-shrinkwrap.json +198 -207
  143. package/package.json +1 -1
  144. package/vendor/connector-sdk/dist/connector-runtime.d.ts +1 -1
  145. package/vendor/connector-sdk/dist/connector-runtime.js +1 -1
  146. package/vendor/connector-sdk/dist/connector-types.d.ts +14 -2
  147. package/vendor/connector-sdk/dist/define-connector.d.ts +3 -5
  148. package/vendor/connector-sdk/dist/define-connector.js +1 -1
  149. package/vendor/connector-sdk/dist/device-manifest.d.ts +0 -1
  150. package/vendor/connector-sdk/dist/extension-network.js +1 -2
  151. package/vendor/connector-sdk/package.json +1 -1
  152. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -1
  153. package/vendor/core/dist/contracts/agent-settings.js +0 -1
  154. package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +6 -6
  155. package/vendor/core/dist/contracts/tools/manage-classifiers.js +4 -6
  156. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +0 -1
  157. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -4
  158. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +2 -2
  159. package/vendor/core/dist/contracts/tools/manage-entity.js +4 -2
  160. package/vendor/core/dist/logger.js +13 -2
  161. package/vendor/core/dist/worker/wire.d.ts +1 -6
  162. package/vendor/core/dist/worker/wire.js +1 -1
  163. package/vendor/core/package.json +1 -1
  164. package/vendor/views/package.json +6 -1
  165. package/dist/owletto/dist/assets/_-00GgOtdu.js +0 -1
  166. package/dist/owletto/dist/assets/_-XlUwOWCI.js +0 -2
  167. package/dist/owletto/dist/assets/_agentId-B2DrawIk.js +0 -1
  168. package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +0 -1
  169. package/dist/owletto/dist/assets/_automationId-BLnqLtUv.js +0 -1
  170. package/dist/owletto/dist/assets/_connectorKey._connectionId-DcUWoZ-C.js +0 -1
  171. package/dist/owletto/dist/assets/_connectorKey.index-C_yKycN_.js +0 -1
  172. package/dist/owletto/dist/assets/_name-DlxjWkKk.js +0 -1
  173. package/dist/owletto/dist/assets/_owner-Cg50UU6m.js +0 -1
  174. package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +0 -1
  175. package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +0 -1
  176. package/dist/owletto/dist/assets/_slug-DbD-wv2m.js +0 -1
  177. package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +0 -1
  178. package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +0 -1
  179. package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +0 -1
  180. package/dist/owletto/dist/assets/accept-invitation-BmQKbQem.js +0 -1
  181. package/dist/owletto/dist/assets/activity-route-view-BvtAoGVt.js +0 -1
  182. package/dist/owletto/dist/assets/agent-connect-pages-DkDlFVY5.js +0 -1
  183. package/dist/owletto/dist/assets/agent-editor-form-DwHD9j1Y.js +0 -1
  184. package/dist/owletto/dist/assets/agent-guardrails-route-0PsTrqMC.js +0 -1
  185. package/dist/owletto/dist/assets/agent-permissions-matrix-B-Q5rmuB.js +0 -1
  186. package/dist/owletto/dist/assets/agent-skills-route-Cwq1QrhW.js +0 -1
  187. package/dist/owletto/dist/assets/agent-subpage-shell-DtzoRy6N.js +0 -1
  188. package/dist/owletto/dist/assets/agent-thread-D7AGGjRV.js +0 -8
  189. package/dist/owletto/dist/assets/agents-BqCKU4CT.js +0 -1
  190. package/dist/owletto/dist/assets/agents-workbench-Cl7FO7b3.js +0 -1
  191. package/dist/owletto/dist/assets/automation-detail-content-CKSywvzE.js +0 -1
  192. package/dist/owletto/dist/assets/automations-BqCKU4CT.js +0 -1
  193. package/dist/owletto/dist/assets/callback-DZ3YyXeV.js +0 -1
  194. package/dist/owletto/dist/assets/connect-BNatqg6j.js +0 -1
  195. package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +0 -1
  196. package/dist/owletto/dist/assets/connected._clientId-7RU89sVW.js +0 -1
  197. package/dist/owletto/dist/assets/connection-CTaUGXl6.js +0 -1
  198. package/dist/owletto/dist/assets/connection-feed-detail-B1xieiEh.js +0 -1
  199. package/dist/owletto/dist/assets/connectors-NBwCLuZg.js +0 -1
  200. package/dist/owletto/dist/assets/create-8bBbQJGY.js +0 -1
  201. package/dist/owletto/dist/assets/create-Cl6cfNAp.js +0 -1
  202. package/dist/owletto/dist/assets/create-DrVso8O7.js +0 -1
  203. package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +0 -2
  204. package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +0 -1
  205. package/dist/owletto/dist/assets/device-pin-tombstone-CwJitllC.js +0 -1
  206. package/dist/owletto/dist/assets/device-rows-BBhW1C7Y.js +0 -1
  207. package/dist/owletto/dist/assets/device._deviceId-XswfXHOc.js +0 -1
  208. package/dist/owletto/dist/assets/entity-options-utGBmFX0.js +0 -1
  209. package/dist/owletto/dist/assets/entity-page-BxwuqqWk.js +0 -1
  210. package/dist/owletto/dist/assets/entity-type-page-BrWqk6so.js +0 -1
  211. package/dist/owletto/dist/assets/event-page-LIm4EDmJ.js +0 -1
  212. package/dist/owletto/dist/assets/events-feed-C4L8mQV7.js +0 -1
  213. package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +0 -1
  214. package/dist/owletto/dist/assets/identity-uPYpPogR.js +0 -1
  215. package/dist/owletto/dist/assets/index-BKMafTe4.js +0 -1
  216. package/dist/owletto/dist/assets/index-BsL1-C2-.js +0 -1
  217. package/dist/owletto/dist/assets/index-C58oW727.js +0 -1
  218. package/dist/owletto/dist/assets/index-C8CR2-Ck.css +0 -1
  219. package/dist/owletto/dist/assets/index-CQ4s6nzy.js +0 -1
  220. package/dist/owletto/dist/assets/index-DCK0KhMM.js +0 -1
  221. package/dist/owletto/dist/assets/index-DXqiRON3.js +0 -1
  222. package/dist/owletto/dist/assets/index-DgEc5IvT.js +0 -1
  223. package/dist/owletto/dist/assets/index-DvhM9tuI.js +0 -1
  224. package/dist/owletto/dist/assets/index-DyYFZjh-.js +0 -1
  225. package/dist/owletto/dist/assets/index-oDoJENMF.js +0 -1
  226. package/dist/owletto/dist/assets/index-rPdUEOa3.js +0 -1
  227. package/dist/owletto/dist/assets/login-Di5VF2F_.js +0 -1
  228. package/dist/owletto/dist/assets/logout-BuaQGSnw.js +0 -1
  229. package/dist/owletto/dist/assets/member-scope-gate-CJqJZk7T.js +0 -1
  230. package/dist/owletto/dist/assets/models--8mTFOLz.js +0 -1
  231. package/dist/owletto/dist/assets/new-BzkA1sq2.js +0 -1
  232. package/dist/owletto/dist/assets/new-C3f0BShb.js +0 -1
  233. package/dist/owletto/dist/assets/new-DA5LF6iB.js +0 -1
  234. package/dist/owletto/dist/assets/organization-DOtBRqDQ.js +0 -1
  235. package/dist/owletto/dist/assets/runs-_yVh6PPB.js +0 -1
  236. package/dist/owletto/dist/assets/runs-table--dnFQatY.js +0 -1
  237. package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +0 -1
  238. package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/runtime-server",
3
- "version": "21.1.0",
3
+ "version": "21.2.0",
4
4
  "type": "module",
5
5
  "license": "BUSL-1.1",
6
6
  "repository": {
@@ -54,7 +54,7 @@ export declare abstract class ConnectorRuntime<C = Record<string, unknown>, F =
54
54
  /**
55
55
  * Execute an action on the connected service.
56
56
  *
57
- * Called either inline (low-risk) or by the worker (high-risk with approval).
57
+ * Called by the host after org policy authorizes execution.
58
58
  * Default implementation rejects with "Actions not supported" — connectors
59
59
  * that don't declare any `actions` in their definition need not override.
60
60
  * The `ctx` parameter is part of the public contract (subclasses overriding
@@ -69,7 +69,7 @@ export class ConnectorRuntime {
69
69
  /**
70
70
  * Execute an action on the connected service.
71
71
  *
72
- * Called either inline (low-risk) or by the worker (high-risk with approval).
72
+ * Called by the host after org policy authorizes execution.
73
73
  * Default implementation rejects with "Actions not supported" — connectors
74
74
  * that don't declare any `actions` in their definition need not override.
75
75
  * The `ctx` parameter is part of the public contract (subclasses overriding
@@ -32,6 +32,10 @@ export interface ConnectorDefinition {
32
32
  feeds?: Record<string, FeedDefinition>;
33
33
  /** Available action definitions (keyed by action_key) */
34
34
  actions?: Record<string, ActionDefinition>;
35
+ /** Query filters implemented by this connector. Unsupported filters fail before query(). */
36
+ queryCapabilities?: {
37
+ exactMatch?: boolean;
38
+ };
35
39
  /** Connector-normalized events that can activate Automations. */
36
40
  automationEvents?: ConnectorAutomationEvent[];
37
41
  /**
@@ -654,8 +658,6 @@ export interface ActionDefinition {
654
658
  name: string;
655
659
  /** Description */
656
660
  description?: string;
657
- /** Whether this action requires human approval before execution */
658
- requiresApproval: boolean;
659
661
  /** Semantic effect used by operation discovery and policy. Defaults to write. */
660
662
  kind?: 'read' | 'write';
661
663
  /**
@@ -975,6 +977,16 @@ export interface QueryContext<F = Record<string, unknown>> {
975
977
  column: string;
976
978
  order: 'asc' | 'desc';
977
979
  };
980
+ /**
981
+ * Filter before pagination by the trimmed string of the first non-null
982
+ * projected column, in order. Missing columns count as null; an empty string
983
+ * does not fall through. Values must be bound or safely encoded by the
984
+ * connector, which owns its source dialect. Requires queryCapabilities.exactMatch.
985
+ */
986
+ exactMatch?: {
987
+ columns: string[];
988
+ value: string;
989
+ };
978
990
  }
979
991
  /** Result from ConnectorRuntime.query(). Rows are returned to the caller, never persisted. */
980
992
  export interface QueryResult {
@@ -42,11 +42,9 @@ export type ConnectorFeedSpec<C = Record<string, unknown>, F = Record<string, un
42
42
  sync?: FeedSyncHandler<C, F>;
43
43
  read: FeedReadHandler<F>;
44
44
  });
45
- /** An action's metadata (minus `key`; `requiresApproval` defaults false) plus its `execute` handler. */
46
- export interface ConnectorActionSpec extends Omit<ActionDefinition, "key" | "requiresApproval"> {
47
- /** Whether the action needs human approval before execution. Defaults to `false`. */
48
- requiresApproval?: boolean;
49
- /** Effect handler for this action. Called inline (low-risk) or by the worker. */
45
+ /** An action's metadata (minus `key`) plus its `execute` handler. */
46
+ export interface ConnectorActionSpec extends Omit<ActionDefinition, "key"> {
47
+ /** Effect handler for this action. The host authorizes execution through org policy. */
50
48
  execute(ctx: ActionContext): Promise<ActionResult>;
51
49
  }
52
50
  /** Functional connector spec: connector metadata plus handler-bearing feeds/actions. */
@@ -39,6 +39,7 @@ function buildDefinition(spec) {
39
39
  description: spec.description,
40
40
  authSchema: spec.authSchema,
41
41
  optionsSchema: spec.optionsSchema,
42
+ queryCapabilities: spec.queryCapabilities,
42
43
  faviconDomain: spec.faviconDomain,
43
44
  mcpConfig: spec.mcpConfig,
44
45
  openapiConfig: spec.openapiConfig,
@@ -73,7 +74,6 @@ function buildDefinition(spec) {
73
74
  key,
74
75
  name: action.name,
75
76
  description: action.description,
76
- requiresApproval: action.requiresApproval ?? false,
77
77
  // `kind` and `requiredScopes` are semantic policy inputs (read/write
78
78
  // classification and the per-action scope gate). Dropping them here
79
79
  // would silently publish scoped/observational actions with neither,
@@ -48,7 +48,6 @@ export interface DeviceActionDefinition extends DeviceManifestSchema {
48
48
  key: string;
49
49
  name: string;
50
50
  description?: string;
51
- requiresApproval?: boolean;
52
51
  kind?: 'read' | 'write';
53
52
  annotations?: DeviceManifestSchema;
54
53
  inputSchema?: DeviceManifestSchema;
@@ -37,7 +37,7 @@ export async function extensionNetworkSync(opts) {
37
37
  // completes before our start() listener attaches and we miss them.
38
38
  const blankNavObs = await opts.dispatcher.dispatch('navigate', {
39
39
  url: 'about:blank',
40
- open_in_new_tab: true,
40
+ new_tab: true,
41
41
  wait_for_load: true,
42
42
  ...allowedOriginsInput,
43
43
  });
@@ -70,7 +70,6 @@ export async function extensionNetworkSync(opts) {
70
70
  const navObs = await opts.dispatcher.dispatch('navigate', {
71
71
  tab_id: tabId,
72
72
  url: opts.url,
73
- open_in_new_tab: false,
74
73
  wait_for_load: true,
75
74
  ...allowedOriginsInput,
76
75
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/connector-sdk",
3
- "version": "21.1.0",
3
+ "version": "21.2.0",
4
4
  "description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -168,7 +168,6 @@ export declare const AgentSettingsStoredSchema: import("@sinclair/typebox").TObj
168
168
  sandboxId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
169
169
  verboseLogging: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
170
170
  showToolCalls: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
171
- preApprovedTools: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
172
171
  updatedAt: import("@sinclair/typebox").TNumber;
173
172
  }>;
174
173
  export type AgentSettingsStored = Static<typeof AgentSettingsStoredSchema>;
@@ -136,7 +136,6 @@ exports.AgentSettingsStoredSchema = typebox_1.Type.Object({
136
136
  sandboxId: typebox_1.Type.Optional(typebox_1.Type.String()),
137
137
  verboseLogging: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
138
138
  showToolCalls: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
139
- preApprovedTools: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
140
139
  updatedAt: typebox_1.Type.Number(),
141
140
  });
142
141
  //# sourceMappingURL=agent-settings.js.map
@@ -9,7 +9,7 @@ export declare const CreateClassifierAction: import("@sinclair/typebox").TObject
9
9
  attribute_key: import("@sinclair/typebox").TString;
10
10
  attribute_values: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
11
11
  description: import("@sinclair/typebox").TString;
12
- examples: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
12
+ examples: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
13
13
  }>>;
14
14
  created_by: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
15
15
  }>;
@@ -27,11 +27,11 @@ export declare const ClassifyContentAction: import("@sinclair/typebox").TObject<
27
27
  classifier_slug: import("@sinclair/typebox").TString;
28
28
  content_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
29
29
  value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
30
- confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
30
+ confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
31
31
  classifications: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
32
32
  content_id: import("@sinclair/typebox").TNumber;
33
33
  value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
34
- confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
34
+ confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
35
35
  reasoning: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
36
36
  }>>>;
37
37
  source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"llm">, import("@sinclair/typebox").TLiteral<"user">]>>;
@@ -46,7 +46,7 @@ export declare const ManageClassifiersSchema: import("@sinclair/typebox").TUnion
46
46
  attribute_key: import("@sinclair/typebox").TString;
47
47
  attribute_values: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
48
48
  description: import("@sinclair/typebox").TString;
49
- examples: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
49
+ examples: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
50
50
  }>>;
51
51
  created_by: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
52
52
  }>, import("@sinclair/typebox").TObject<{
@@ -61,11 +61,11 @@ export declare const ManageClassifiersSchema: import("@sinclair/typebox").TUnion
61
61
  classifier_slug: import("@sinclair/typebox").TString;
62
62
  content_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
63
63
  value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
64
- confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
64
+ confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
65
65
  classifications: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
66
66
  content_id: import("@sinclair/typebox").TNumber;
67
67
  value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
68
- confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
68
+ confidence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
69
69
  reasoning: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
70
70
  }>>>;
71
71
  source: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"llm">, import("@sinclair/typebox").TLiteral<"user">]>>;
@@ -18,10 +18,8 @@ const ClassifierId = typebox_1.Type.Number({
18
18
  const ClassifierSlug = typebox_1.Type.String({
19
19
  description: '[classify] Classifier slug (e.g., "sentiment", "bug-severity")',
20
20
  });
21
- const Confidence = typebox_1.Type.Number({
22
- minimum: 0,
23
- maximum: 1,
24
- description: "[classify] Confidence in the value, 0..1 (default: 1)",
21
+ const Confidence = typebox_1.Type.Union([typebox_1.Type.Number({ minimum: 0, maximum: 1 }), typebox_1.Type.Null()], {
22
+ description: "[classify] Confidence in the value, 0..1. Omitted or null: unscored for an 'llm' label, 1 for a 'user' label",
25
23
  });
26
24
  exports.CreateClassifierAction = typebox_1.Type.Object({
27
25
  action: typebox_1.Type.Literal("create", {
@@ -38,7 +36,7 @@ exports.CreateClassifierAction = typebox_1.Type.Object({
38
36
  }),
39
37
  attribute_values: typebox_1.Type.Record(typebox_1.Type.String({ minLength: 1 }), typebox_1.Type.Object({
40
38
  description: typebox_1.Type.String(),
41
- examples: typebox_1.Type.Array(typebox_1.Type.String()),
39
+ examples: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
42
40
  }, { additionalProperties: false }), {
43
41
  minProperties: 1,
44
42
  description: "[create] Map of attribute values to descriptions and examples.",
@@ -85,7 +83,7 @@ exports.ClassifyContentAction = typebox_1.Type.Object({
85
83
  description: "[classify] Array of classifications to update (batch mode)",
86
84
  })),
87
85
  source: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Literal("llm"), typebox_1.Type.Literal("user")], {
88
- description: '[classify] Classification source: "llm" (AI-generated, e.g. an Automation) or "user" (manual). Defaults to "user". Only "user" labels are manual, and they win over "llm" labels at read time.',
86
+ description: '[classify] Classification source: "llm" (AI-generated) or "user" (manual). Defaults to "user" for a person and "llm" for an Automation or agent, which cannot write "user". Only "user" labels are manual, and they win over "llm" labels at read time.',
89
87
  })),
90
88
  reasoning: typebox_1.Type.Optional(typebox_1.Type.String({
91
89
  description: "[classify] Reasoning/justification for the classification(s)",
@@ -516,7 +516,6 @@ export declare const ManageConnectionsResultSchema: import("@sinclair/typebox").
516
516
  version_exists: import("@sinclair/typebox").TBoolean;
517
517
  actions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
518
518
  kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"read">, import("@sinclair/typebox").TLiteral<"write">]>;
519
- requires_approval: import("@sinclair/typebox").TBoolean;
520
519
  required_scopes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
521
520
  }>>;
522
521
  feed_keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -414,7 +414,7 @@ exports.UpdateConnectorDefaultConfigAction = typebox_1.Type.Object({
414
414
  }),
415
415
  connector_key: typebox_1.Type.String({ description: "Connector key" }),
416
416
  default_connection_config: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Any(), {
417
- description: "Default connection config (action_modes, etc.)",
417
+ description: "Default connection config",
418
418
  }),
419
419
  });
420
420
  const CHANNEL_ID_DESC = "Platform channel id (may be platform-prefixed, e.g. 'slack:C…').";
@@ -694,12 +694,11 @@ exports.ManageConnectionsResultSchema = typebox_1.Type.Union([
694
694
  installed: typebox_1.Type.Boolean(),
695
695
  active_version: typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
696
696
  version_exists: typebox_1.Type.Boolean(),
697
- // Extracted per-action semantic-policy summary (kind / requires_approval /
698
- // required_scopes), keyed by action key, so an author can confirm those
697
+ // Extracted per-action semantic-policy summary (kind / required_scopes),
698
+ // keyed by action key, so an author can confirm those
699
699
  // fields survived extraction before persisting. Plus the extracted feed keys.
700
700
  actions: typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Object({
701
701
  kind: typebox_1.Type.Union([typebox_1.Type.Literal("read"), typebox_1.Type.Literal("write")]),
702
- requires_approval: typebox_1.Type.Boolean(),
703
702
  required_scopes: typebox_1.Type.Array(typebox_1.Type.String()),
704
703
  })),
705
704
  feed_keys: typebox_1.Type.Array(typebox_1.Type.String()),
@@ -51,7 +51,7 @@ export declare const ListEntitiesAction: import("@sinclair/typebox").TObject<{
51
51
  offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
52
52
  action: import("@sinclair/typebox").TLiteral<"list">;
53
53
  entity_type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
54
- parent_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
54
+ parent_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
55
55
  search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
56
56
  category: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
57
57
  main_market: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -191,7 +191,7 @@ export declare const ManageEntitySchema: import("@sinclair/typebox").TUnion<[imp
191
191
  offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
192
192
  action: import("@sinclair/typebox").TLiteral<"list">;
193
193
  entity_type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
194
- parent_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
194
+ parent_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
195
195
  search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
196
196
  category: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
197
197
  main_market: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -35,7 +35,7 @@ const EntityFields = {
35
35
  pattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
36
36
  }),
37
37
  parent_id: typebox_1.Type.Number({
38
- description: "[create/update/list] Parent entity ID (for hierarchical entities). On list, only that parent's children.",
38
+ description: "[create/update] Parent entity ID (for hierarchical entities).",
39
39
  }),
40
40
  domain: typebox_1.Type.String({
41
41
  description: "[create/update] Primary domain (e.g., spotify.com)",
@@ -159,7 +159,9 @@ exports.ListEntitiesAction = typebox_1.Type.Object({
159
159
  description: "Paginated entity list with filters.",
160
160
  }),
161
161
  entity_type: typebox_1.Type.Optional(EntityType),
162
- parent_id: typebox_1.Type.Optional(EntityFields.parent_id),
162
+ parent_id: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Number(), typebox_1.Type.Null()], {
163
+ description: "[list] Parent filter: omit for all entities, null for roots, or an ID for that parent's children.",
164
+ })),
163
165
  search: typebox_1.Type.Optional(typebox_1.Type.String({ description: "[list] Search by name" })),
164
166
  category: typebox_1.Type.Optional(EntityFields.category),
165
167
  main_market: typebox_1.Type.Optional(EntityFields.main_market),
@@ -51,7 +51,7 @@ function createConsoleLogger(serviceName) {
51
51
  };
52
52
  const currentLevel = levels[level] ?? 2;
53
53
  const formatMessage = (lvl, message, ...args) => {
54
- const timestamp = new Date().toISOString().replace("T", " ").slice(0, 19);
54
+ const timestamp = new Date().toISOString();
55
55
  let msgStr;
56
56
  // Handle pino-style format: logger.info({ key: value }, "message")
57
57
  if (typeof message === "object" &&
@@ -73,11 +73,22 @@ function createConsoleLogger(serviceName) {
73
73
  else {
74
74
  msgStr = String(message);
75
75
  }
76
+ if (USE_JSON_FORMAT) {
77
+ return safeStringify({
78
+ timestamp,
79
+ level: lvl,
80
+ service: serviceName,
81
+ message: msgStr,
82
+ ...(args.length > 0
83
+ ? { data: args.length === 1 ? args[0] : args }
84
+ : {}),
85
+ });
86
+ }
76
87
  // Append remaining args
77
88
  if (args.length > 0) {
78
89
  msgStr += ` ${safeStringify(args.length === 1 ? args[0] : args)}`;
79
90
  }
80
- return `[${timestamp}] [${lvl}] [${serviceName}] ${msgStr}`;
91
+ return `[${timestamp.replace("T", " ").slice(0, 19)}] [${lvl}] [${serviceName}] ${msgStr}`;
81
92
  };
82
93
  return {
83
94
  error: (message, ...args) => {
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Before this lived in core, the worker had its own `MessagePayload`
10
10
  * declaration that was a structural subset of the gateway's (missing
11
- * `organizationId`, `networkConfig`, `nixConfig`, `preApprovedTools`). At
11
+ * `organizationId`, `networkConfig`, `nixConfig`). At
12
12
  * runtime the worker's zod schema was patched with
13
13
  * `.passthrough()` so the extra fields survived parsing, but the static type
14
14
  * silently lied. Hoisting closes the gap.
@@ -108,11 +108,6 @@ export interface MessagePayload {
108
108
  guardrailsInline?: AgentInlineGuardrail[];
109
109
  /** Nix environment configuration for the agent workspace. */
110
110
  nixConfig?: NixConfig;
111
- /**
112
- * MCP tool grant patterns the operator has pre-approved.
113
- * Synced to the grant store at deployment time to bypass the approval card.
114
- */
115
- preApprovedTools?: string[];
116
111
  /**
117
112
  * Digest of the org's connector-contributed agent tooling (which connections
118
113
  * contribute, which installation each points at, and what it declares),
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Before this lived in core, the worker had its own `MessagePayload`
11
11
  * declaration that was a structural subset of the gateway's (missing
12
- * `organizationId`, `networkConfig`, `nixConfig`, `preApprovedTools`). At
12
+ * `organizationId`, `networkConfig`, `nixConfig`). At
13
13
  * runtime the worker's zod schema was patched with
14
14
  * `.passthrough()` so the extra fields survived parsing, but the static type
15
15
  * silently lied. Hoisting closes the gap.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/core",
3
- "version": "21.1.0",
3
+ "version": "21.2.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": "21.1.0",
3
+ "version": "21.2.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",
@@ -29,6 +29,11 @@
29
29
  "node": ">=18"
30
30
  },
31
31
  "license": "Apache-2.0",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/lobu-ai/lobu.git",
35
+ "directory": "packages/views"
36
+ },
32
37
  "publishConfig": {
33
38
  "access": "public"
34
39
  }
@@ -1 +0,0 @@
1
- import{cg as t,j as p,ch as m}from"./index-DtRfQcRH.js";import{A as e}from"./activity-route-view-BvtAoGVt.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-C7ubnFsS.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./events-feed-C4L8mQV7.js";import"./use-applied-views-DvMT3wap.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./calendar-CHXehtu0.js";import"./agent-loading-shells-BQLjzMPy.js";import"./member-scope-gate-CJqJZk7T.js";function v(){const{owner:o,_splat:r}=t.useParams(),i=t.useSearch();return p.jsx(e,{owner:o,search:i,attentionLens:!1,entityScope:m(r||"").path})}export{v as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-BxwuqqWk.js","assets/index-DtRfQcRH.js","assets/index-C8CR2-Ck.css","assets/schema-value-normalization-BspxVEGy.js","assets/calendar-CHXehtu0.js","assets/view-frame-HoBawpT2.js","assets/app-bridge-BH3g2mKG.js","assets/missing-view-CD4DOaG8.js","assets/use-applied-views-DvMT3wap.js"])))=>i.map(i=>d[i]);
2
- import{r as n,a$ as j,b0 as m,b1 as v,b2 as P,p as R,v as _,a4 as b,a0 as E,j as e,b3 as S,b4 as w,b5 as N}from"./index-DtRfQcRH.js";function h(){return n.useEffect(()=>{j()},[]),null}const F=w(async()=>({default:(await N(async()=>{const{EntityPage:s}=await import("./entity-page-BxwuqqWk.js");return{EntityPage:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]))).EntityPage}));function r(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(S,{})})}function A(){const{owner:s,_splat:x}=m.useParams(),a=m.useSearch(),i=v(x||""),o=i?.viewKey,{path:f}=P(s,i?.entityPath),{data:t,isLoading:c,error:d}=R(f,{slug:s},{includeBootstrap:!0}),{session:y,isReady:l}=_(),u=b();if(n.useEffect(()=>{t?.redirect&&u({to:t.redirect.to,replace:!0})},[t?.redirect,u]),E({active:!c&&l&&!y&&(!!d||!t),owner:s}),c||!l&&!t)return e.jsx(r,{});if(t?.redirect)return e.jsx(r,{});if(d||!t||!t.entity)return e.jsxs(e.Fragment,{children:[e.jsx(h,{}),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."})]})]});const g=!o&&typeof a.merged_from=="string"&&t.entity.merged_records?.some(p=>p.name===a.merged_from)?a.merged_from:void 0;return e.jsxs(e.Fragment,{children:[e.jsx(h,{}),e.jsx(n.Suspense,{fallback:e.jsx(r,{}),children:e.jsx(F,{namespace:t.workspace,path:t.path,entity:t.entity,mergedFrom:g,viewKey:o})})]})}export{A as component};
@@ -1 +0,0 @@
1
- import{a4 as b,gk as w,r as u,j as n,al as D,cp as k,v as P,w as E,bz as M,bq as N,bL as R,cr as O,gl as $,gm as z,bW as B,a9 as Q}from"./index-DtRfQcRH.js";import{L as W,A as q}from"./agent-thread-D7AGGjRV.js";import{n as L}from"./agent-thread-storage-U6htL3ad.js";import{A as F,C as H}from"./agent-loading-shells-BQLjzMPy.js";import"./app-bridge-BH3g2mKG.js";import"./pending-seed-CPbfgnLX.js";import"./use-mention-search-CeTEE3oE.js";import"./index-Vcq4gwWv.js";function U({owner:t,agent:s,threadId:e,afterMessagesContent:d,className:i,initialDraft:x,newChatRequested:m=!1,preventAutoNavigate:g}){const o=b(),r=s.agentId,{data:a=[]}=w(r,{orgSlug:t}),[l,p]=u.useState(()=>L()),[h,A]=u.useState(null);u.useEffect(()=>{!m||e||(p(L()),A(null),o({to:".",search:(f=>{const{new:C,...S}=f;return S}),replace:!0}))},[m,e,o]);const v=u.useMemo(()=>!h||a.some(f=>f.id===h.id)?a:[h,...a],[a,h]),c=e??l,T=!e||!v.some(f=>f.id===e),j=u.useCallback(()=>{if(v.some(C=>C.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const f=k(t,r,c);o({...f,replace:!0})},[v,c,o,t,r]),y=u.useCallback(()=>{T&&!g&&j()},[T,j,g]);return n.jsx("div",{className:D("flex min-h-0 flex-1 flex-col",i),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(W,{agentId:r,workspaceSlug:t,thread:c,loadHistory:!!e,onFirstUserMessage:y,initialDraft:x,children:n.jsx(q,{afterMessagesContent:d})},`${r}:${c}`)})})}function _({owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:i,afterMessagesContent:x,preventAutoNavigate:m}){const{isAuthenticated:g}=P(),{isMember:o,isLoading:r}=E(),a=g&&o,{data:l=[],isLoading:p}=M({enabled:a}),h=s??null,A=l.find(c=>c.agentId===h)??null;return a&&p||r?n.jsx(F,{}):A?n.jsx(U,{owner:t,agent:A,threadId:e,initialDraft:d,newChatRequested:i,afterMessagesContent:x,preventAutoNavigate:m,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(t){return[...t].sort((s,e)=>e.updatedAt-s.updatedAt)[0]}function J({owner:t,agentId:s,threadId:e,initialDraft:d,forceComposer:i=!1,newChatRequested:x=!1,afterMessagesContent:m,preventAutoNavigate:g}){const o=b(),{data:r=[],isLoading:a}=O($(t,s,{strict:!1})),l=u.useMemo(()=>G(r),[r]);return u.useEffect(()=>{if(e||i||a||!l)return;const p=k(t,s,l.id);o({...p,replace:!0})},[s,a,l,o,t,e,i]),!e&&!i&&(a||l)?n.jsx(H,{}):n.jsx(_,{owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:x,afterMessagesContent:m,preventAutoNavigate:g})}function se(){const{owner:t,agentId:s}=z.useParams(),{threadId:e}=B({strict:!1}),{new:d,prompt:i}=Q({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 lg:px-6 lg:py-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:t,agentId:s,threadId:e,initialDraft:i,forceComposer:!e,newChatRequested:!!d})})})}export{se as component};
@@ -1 +0,0 @@
1
- import{gv as r,j as e}from"./index-DtRfQcRH.js";import{A as n}from"./agents-workbench-Cl7FO7b3.js";import"./agent-editor-form-DwHD9j1Y.js";import"./model-selector-XC5CI2Et.js";import"./proposal-review-shell-C3K-JXjb.js";import"./runs-_yVh6PPB.js";function c(){const{owner:o,agentId:t}=r.useParams();return e.jsx(n,{owner:o,agentId:t})}export{c as component};
@@ -1 +0,0 @@
1
- import{a4 as N,a3 as k,p as A,v as L,w as C,M as y,j as t,B as n,ez as b,bL as R,S as _,L as $,N as z,go as p,aY as D}from"./index-DtRfQcRH.js";import{a as O}from"./automation-detail-content-CKSywvzE.js";import"./create-automation-form-De8J-JD5.js";import"./cronstrue-C5yTgk5z.js";import"./entity-options-utGBmFX0.js";import"./connection-label-BobuYiAG.js";import"./switch-CxDXvPGE.js";import"./device-automation-BIjs7DZJ.js";import"./model-selector-XC5CI2Et.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-BHiWR94J.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-CeTEE3oE.js";import"./proposal-review-shell-C3K-JXjb.js";import"./runs-_yVh6PPB.js";import"./json-diff-DYeX-xLk.js";import"./deployments-D1gbQwsy.js";import"./agent-loading-shells-BQLjzMPy.js";import"./agent-thread-D7AGGjRV.js";import"./app-bridge-BH3g2mKG.js";import"./pending-seed-CPbfgnLX.js";import"./events-feed-C4L8mQV7.js";import"./use-applied-views-DvMT3wap.js";import"./clients-C7ubnFsS.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";function P({owner:o,automationId:a,view:e,runId:s}){const r=N(),{orgContext:u,hasOrgContext:x}=k(),{data:g,isLoading:m}=A(`/${o}`,u),{isAuthenticated:h}=L(),{isLoading:c}=C(),v=g?.workspace?.id??"",f=h?!x||m||c:m||c,i=y(a,void 0,v).data?.automation,j=i?.automation_name??"Automation",l=()=>void r({to:"/$owner/automations",params:{owner:o}}),d=()=>void r({to:"/$owner/automations/$automationId",params:{owner:o,automationId:a},search:{view:"activity",run_id:void 0}}),w=!s&&e==="definition";return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:t.jsxs("div",{className:"mx-auto flex w-full min-w-0 max-w-3xl flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsxs(n,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:l,children:[t.jsx(b,{className:"h-3.5 w-3.5"}),"Automations"]}),t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx(R,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),f&&!i?t.jsx(_,{className:"h-5 w-40"}):s?"Review change":j]})]}),s?null:w?t.jsx(n,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:d,children:"Done"}):t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs($,{to:"/$owner/automations/$automationId",params:{owner:o,automationId:a},search:{view:"definition",run_id:void 0},children:[t.jsx(z,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),t.jsx(O,{owner:o,agentId:i?.managed_agent_id??null,automationId:a,view:e,runId:s,onDone:s?l:d})]})})}function ct(){const{owner:o,automationId:a}=p.useParams(),e=p.useSearch();return t.jsx(D,{owner:o,children:()=>t.jsx(P,{owner:o,automationId:a,view:e.view,runId:e.run_id})})}export{ct as component};
@@ -1 +0,0 @@
1
- import{hH as F,j as e,aY as P,a4 as H,bf as W,a as O,d1 as V,n as G,S as L,L as h,gi as v,gg as U,bv as Y,d8 as q,gh as z,h0 as R,aa as J}from"./index-DtRfQcRH.js";import{R as Q,c as X,C as Z}from"./device-pin-tombstone-CwJitllC.js";import{a as K}from"./connector-provenance-DRdUEmQ1.js";import{f as ee,C as ne,F as se,b as ae,a as oe,A as te,c as ce}from"./connection-feed-detail-B1xieiEh.js";import{S as ie,g as re}from"./runs-table--dnFQatY.js";import{c as de}from"./connection-label-BobuYiAG.js";import{c as le}from"./device-rows-BBhW1C7Y.js";import"./runs-panel-B2852xus.js";import"./runs-_yVh6PPB.js";import"./entity-options-utGBmFX0.js";function Ne(){const{owner:r,connectorKey:a,connectionId:f}=F.useParams(),{addFeed:o,feedId:d,settings:u,auth_result:c}=F.useSearch();return e.jsx(P,{owner:r,children:l=>e.jsx(me,{organizationId:l.organizationId,ownerSlug:l.ownerSlug,isWorkspaceLoading:l.isWorkspaceLoading,connectorKey:a,connectionId:Number(f),showAddFeed:o===!0,feedId:d,openSettings:u===!0,authResult:c})})}function me({organizationId:r,ownerSlug:a,isWorkspaceLoading:f,connectorKey:o,connectionId:d,showAddFeed:u,feedId:c,openSettings:l,authResult:A}){const I=H(),{data:S=[]}=W(),{data:E=[],isLoading:M}=O(r??"",{connectorKey:o}),{data:C=[]}=V(r??""),{data:T=[]}=G(c?d:null),n=E.find(t=>t.id===d),s=C.find(t=>t.key===o),i=c?T.find(t=>t.id===c):null;if(f||M||!r)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(L,{className:"h-7 w-56"}),e.jsx(L,{className:"h-4 w-24"})]}),e.jsx(Q,{})]});if(!n)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(h,{to:"/$owner/connectors/$connectorKey",params:{owner:a,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",s?.name??o]})]});const D=de({...n,connector_name:n.connector_name??s?.name??null}),p=!c&&!u,y=()=>void I({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:a,connectorKey:o,connectionId:String(d)},search:{},replace:!0});let m,x=D,g,N,j;c?i?(x=ee(i,s),i.store==="channel_messages"?(m=e.jsx(ne,{feed:i,hideHeader:!0}),j="chat channel"):(g=e.jsx(se,{feed:i,ownerSlug:a}),N=e.jsx(ae,{feed:i}),m=e.jsx(oe,{feed:i,connectorDef:s,ownerSlug:a}))):(m=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),x="Feed"):u&&(m=e.jsx(te,{onClose:y,organizationId:r,connections:[n],connectorDefinitions:C}),x="Add feed",j=ce);const _=[e.jsx(h,{to:"/$owner/connectors",params:{owner:a},className:v,children:"Connectors"},"connectors"),e.jsx(h,{to:"/$owner/connectors/$connectorKey",params:{owner:a,connectorKey:o},search:{},className:v,children:s?.name??o},"connector")];p||_.push(e.jsx(h,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:a,connectorKey:o,connectionId:String(d)},search:{},className:v,children:D},"connection"));const b=p?X(n):null,B=j??b??void 0,$=e.jsx(U,{breadcrumb:e.jsx(z,{crumbs:_}),icon:s?e.jsx(Y,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??q(s.auth_schema)}):null,title:x,status:g??e.jsx(ie,{status:re(n.status),showDot:!0,children:n.status}),meta:N,caption:B,captionTone:b?"error":"muted"});if(!p)return e.jsx(R,{header:$,children:e.jsx("div",{className:"mt-0",children:m})});const k=s&&le(s)?S.find(t=>t.id===n.device_worker_id&&t.connectors.some(w=>w.connection_id===n.id&&w.organization_slug===a)):void 0;return k?e.jsx(J,{to:"/$owner/connectors/device/$deviceId",params:{owner:a,deviceId:k.id},search:{connection:n.id,settings:l||void 0},hash:`connection-${n.id}`,replace:!0}):e.jsxs(R,{header:$,children:[e.jsx(K,{connectorDef:s,connectorKey:o,ownerSlug:a,deviceWorkerId:n.device_worker_id,deviceLabel:n.device_label}),e.jsx(Z,{connection:n,connectorDef:s,ownerSlug:a,openSettings:l,authResult:A},n.id)]})}export{Ne as component};
@@ -1 +0,0 @@
1
- import{gM as He,as as Ze,gN as re,r as h,gO as ye,gP as Je,cq as es,gQ as Ne,aG as K,gR as be,j as e,ac as P,bX as we,bY as Se,bZ as Ae,b_ as _e,b$ as Pe,gC as ss,ad as F,B as g,dT as q,s as z,Y as Ce,gS as ts,gT as as,E as ns,gU as rs,bA as ie,gV as is,gW as ls,gX as De,gY as $e,gZ as Fe,aV as J,ah as M,bJ as ae,g_ as os,fY as cs,g$ as ds,g as G,h0 as le,h1 as us,S as $,eH as I,v as ms,h2 as hs,h3 as xs,h4 as ps,h5 as fs,h6 as gs,h7 as js,h8 as vs,h9 as ys,c6 as Z,ha as Ns,hb as bs,k as Cs,ed as ks,d_ as ws,al as ee,dF as Ss,F as As,P as Le,hc as se,hd as _s,aY as Ps,he as Oe,bb as te,t as Ee,eJ as Re,bj as Ds,hf as Ue,eI as $s,hg as Be,L as Q,hh as Fs,eg as Ls,u as Os,a as Es,br as Rs,bg as V,cx as Ie,a4 as Y,hi as Us,be as Bs,hj as Is,gg as oe,bw as Me,bv as ce,bs as Ms,gh as de,gi as ue,bc as Ts,bd as zs,hk as Ks,d8 as Vs}from"./index-DtRfQcRH.js";import{C as Ys}from"./connector-provenance-DRdUEmQ1.js";import{a as qs}from"./runs-table--dnFQatY.js";import{R as Gs}from"./runs-panel-B2852xus.js";import"./connection-label-BobuYiAG.js";import"./runs-_yVh6PPB.js";function Qs({catalog:s,initialProvider:t,initialModel:a,onDone:n}){const r=He(),i=Ze(),o=s.find(l=>l.slug===t)??s[0],p=o&&re(o)?"oauth":"api-key",[d,x]=h.useState(o?.slug??""),[u,c]=h.useState(o?.slug??""),[v,y]=h.useState(o?.displayName??""),[j,N]=h.useState(o?.baseUrl??""),[C,D]=h.useState(a??o?.defaultModel??""),[S,k]=h.useState(""),[T,w]=h.useState(o?.apiKeyPlaceholder??""),[R,L]=h.useState(p),[E,U]=h.useState(""),[f,m]=h.useState(null),[A,B]=h.useState(!1),[W,me]=h.useState(!1),b=s.find(l=>l.slug===d),X=ye(b?.modalities??[]),he=b?re(b):!1,xe=b?Je(b):!1,pe=he&&R==="oauth",fe=xe&&!pe,O=es().slug,H=h.useCallback(()=>{me(!0),i.invalidateQueries({queryKey:["inference-providers"]})},[i]),Ke=h.useCallback(()=>{i.invalidateQueries({queryKey:["inference-providers"]}),n()},[i,n]),Ve=h.useCallback(async()=>{if(!(!O||!b)){B(!0);try{const l=await Ne(O,b.slug);if(l.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(l.authorizeUrl,"_blank","noreferrer")}catch(l){K.error(l instanceof Error?l.message:"Failed to start sign-in")}finally{B(!1)}}},[O,b]),Ye=h.useCallback(async()=>{if(!(!O||!b||!E.trim())){B(!0);try{const l=await be(O,b.slug,{code:E.trim()});if(l.status!=="success")throw new Error(l.error||"Sign-in not complete");H(),K.success(`Signed in with ${b.displayName}`)}catch(l){K.error(l instanceof Error?l.message:"Failed to complete sign-in")}finally{B(!1)}}},[O,b,E,H]),qe=h.useCallback(async()=>{if(!(!O||!b)){B(!0);try{const l=await Ne(O,b.slug);if(l.mode!=="device")throw new Error("Unexpected sign-in mode");m({userCode:l.userCode,deviceAuthId:l.deviceAuthId,verificationUrl:l.verificationUrl}),window.open(l.verificationUrl,"_blank","noreferrer")}catch(l){K.error(l instanceof Error?l.message:"Failed to start sign-in")}finally{B(!1)}}},[O,b]),Ge=h.useCallback(async()=>{if(!(!O||!b||!f)){B(!0);try{const l=await be(O,b.slug,{deviceAuthId:f.deviceAuthId,userCode:f.userCode});if(l.status==="success"){H(),K.success(`Signed in with ${b.displayName}`);return}m(_=>_&&{..._,message:l.error||"Waiting for approval..."})}catch(l){K.error(l instanceof Error?l.message:"Failed to check status")}finally{B(!1)}}},[O,b,f,H]),Qe=b?.supportedAuthTypes.includes("device-code")??!1,We=l=>{x(l);const _=s.find(ne=>ne.slug===l);_&&(c(_.slug),y(_.displayName),N(_.baseUrl),D(_.slug===t&&a?a:_.defaultModel??""),w(_.apiKeyPlaceholder),L(re(_)?"oauth":"api-key"),U(""),m(null),me(!1))},ge=/^[a-z0-9][a-z0-9-]*$/.test(u),je=ge&&fe&&S.trim().length>0&&!r.isPending,Xe=l=>{if(l.preventDefault(),!je)return;const _={};j.trim()&&(_.base_url=j.trim()),C.trim()&&(_.model=C.trim());const ne=Object.keys(_).length>0?{text:_}:void 0;r.mutate({slug:u.trim(),kind:d,displayName:v.trim()||void 0,apiKey:S.trim(),capabilities:ne},{onSuccess:()=>n()})},ve=!!(t&&s.some(l=>l.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ve&&b?`Connect ${b.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Xe,className:"grid max-w-md gap-3",children:[ve&&b?e.jsx("p",{className:"text-xs text-muted-foreground",children:X.length>0?`Serves text, plus ${X.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(we,{value:d,onValueChange:We,children:[e.jsx(Se,{id:"ip-provider",className:"w-full",children:e.jsx(Ae,{})}),e.jsx(_e,{children:s.map(l=>{const _=ye(l.modalities);return e.jsx(Pe,{value:l.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[l.iconUrl?e.jsx("img",{src:l.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(ss,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),l.displayName,_.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",_.join(", ")]}):null]})},l.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:X.length>0?`Serves text, plus ${X.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-display",children:"Name"}),e.jsx(F,{id:"ip-display",placeholder:"Friendly name",value:v,onChange:l=>y(l.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(P,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-slug",placeholder:"my-provider",value:u,onChange:l=>c(l.target.value),autoComplete:"off",required:!0}),u&&!ge?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:R==="oauth"?"secondary":"ghost",onClick:()=>L("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:R==="api-key"?"secondary":"ghost",onClick:()=>L("api-key"),children:"API key"})]})]}):null,fe?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(F,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:j,onChange:l=>N(l.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(P,{htmlFor:"ip-model",children:"Default model"}),e.jsx(F,{id:"ip-model",placeholder:"gpt-4o-mini",value:C,onChange:l=>D(l.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(P,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-key",type:"password",placeholder:T||void 0,value:S,onChange:l=>k(l.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(q,{onCancel:n,children:e.jsx(g,{type:"submit",disabled:!je,children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):pe?e.jsxs("div",{className:"grid gap-3",children:[W?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",b?.displayName??"provider",". This covers your agents in this org."]}):Qe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void qe(),disabled:A||!O,children:f?"Get a new code":"Get device code"}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(F,{id:"ip-device-code",readOnly:!0,value:f.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:f.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",b?.displayName??"provider"," to approve",e.jsx(Ce,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:f.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Ge(),disabled:A,children:A?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Ve(),disabled:A||!O,children:["Sign in with ",b?.displayName??"provider",e.jsx(Ce,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(F,{id:"ip-oauth-code",placeholder:"code#state",value:E,onChange:l=>U(l.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void Ye(),disabled:A||!E.trim(),children:A?"Finishing...":"Finish sign-in"})]}),e.jsx(q,{onCancel:n,children:e.jsx(g,{type:"button",onClick:Ke,disabled:!W,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(q,{onCancel:n})]})]})]})}const Ws={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Xs({provider:s,catalog:t,autoOpenEdit:a}){const n=ts(),[r,i]=h.useState(a?"edit":null),o=as(s.kind,t);h.useEffect(()=>{a&&i("edit")},[a]);const d=(t.find(c=>c.slug===s.kind)?.modalities??["text"]).filter(c=>c!=="text"),x=o&&d.length>0,u=c=>i(v=>v===c?null:c);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 ${ns(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),x?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("edit"),children:"Edit"})]})]}),r==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(Zs,{provider:s,supportsUpstreamConfig:o,onDone:()=>i(null)})}):null,r==="capabilities"&&x?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."})]}),d.map(c=>e.jsx(Js,{providerSlug:s.slug,modality:c,block:s.capabilities[c]??{}},c))]})}):null]})}function Hs({provider:s,onDeleted:t}){const a=rs(),[n,r]=h.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>r(!1)}),children:[a.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>r(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>r(!0),children:[e.jsx(ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function Zs({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=is(),r=ls(),i=De(),[o,p]=h.useState(s.displayName??""),[d,x]=h.useState(""),u=s.capabilities.text??{},[c,v]=h.useState(u.base_url??""),[y,j]=h.useState(u.model??""),[N,C]=h.useState(null),D=o.trim().length>0&&o.trim()!==(s.displayName??""),S=t&&d.trim().length>0,k=c.trim()!==(u.base_url??""),T=y.trim()!==(u.model??""),w=t&&(k||T),R={base_url:c.trim()||void 0,model:y.trim()||void 0,models_endpoint:u.models_endpoint},L=$e(R),E=t&&w&&Fe(L),U=n.isPending||r.isPending||i.isPending,f=(D||S||w)&&!E&&!U,m=async A=>{if(A.preventDefault(),!!f){C(null);try{await Promise.all([D?n.mutateAsync({providerSlug:s.slug,displayName:o.trim()}):Promise.resolve(),w?i.mutateAsync({providerSlug:s.slug,modality:"text",block:R}):Promise.resolve(),S?r.mutateAsync({providerSlug:s.slug,value:d.trim()}):Promise.resolve()]),a()}catch{C("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:m,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(F,{id:`edit-name-${s.slug}`,value:o,onChange:A=>p(A.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(P,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(F,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:c,onChange:A=>v(A.target.value),autoComplete:"off"}),L.base_url?e.jsx("p",{className:"text-xs text-destructive",children:L.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(F,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:y,onChange:A=>j(A.target.value),autoComplete:"off"}),L.model?e.jsx("p",{className:"text-xs text-destructive",children:L.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(F,{id:`edit-key-${s.slug}`,type:"password",value:d,onChange:A=>x(A.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(q,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!f,children:U?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function Js({providerSlug:s,modality:t,block:a}){const n=De(),[r,i]=h.useState(!1),[o,p]=h.useState(a.base_url??""),[d,x]=h.useState(a.model??""),[u,c]=h.useState(a.models_endpoint??""),[v,y]=h.useState(!!a.models_endpoint),j=!!(a.base_url||a.model||a.models_endpoint),N={base_url:o.trim()||void 0,model:d.trim()||void 0,models_endpoint:u.trim()||void 0},C=$e(N),D=Fe(C),S=()=>{D||n.mutate({providerSlug:s,modality:t,block:N})};return e.jsxs("div",{className:J,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>i(k=>!k),children:[e.jsx("span",{className:"text-sm font-medium",children:Ws[t]}),j?e.jsx(M,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),r?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(F,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:o,onChange:k=>p(k.target.value),autoComplete:"off"}),C.base_url?e.jsx("p",{className:"text-xs text-destructive",children:C.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(F,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:d,onChange:k=>x(k.target.value),autoComplete:"off"}),C.model?e.jsx("p",{className:"text-xs text-destructive",children:C.model}):null]}),v?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(F,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:u,onChange:k=>c(k.target.value),autoComplete:"off"}),C.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:C.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:()=>y(!0),children:"Advanced"}),e.jsx(q,{onCancel:()=>i(!1),children:e.jsx(g,{size:"sm",disabled:D||n.isPending,onClick:S,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function et({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(tt,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(M,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(M,{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(M,{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 st({sandbox:s,onDeleted:t}){const a=os(),[n,r]=h.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(ie,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(z,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>r(!0),children:"Delete sandbox"})]})})}function tt({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(cs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(ds,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const at={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},nt={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Dt(){const{owner:s,connectorKey:t}=se.useParams(),{kind:a,id:n}=_s(t);return e.jsx(Ps,{owner:s,children:({ownerSlug:r,organizationId:i,isWorkspaceLoading:o})=>{switch(a){case"inference":return e.jsx(lt,{ownerSlug:r,providerSlug:n});case"sandbox":return e.jsx(it,{ownerSlug:r,sandboxId:n});case"sandbox-provider":return e.jsx(rt,{ownerSlug:r,providerKind:n});default:return e.jsx(ut,{ownerSlug:r,organizationId:i,isWorkspaceLoading:o,connectorKey:t})}}})}function rt({ownerSlug:s,providerKind:t}){const a=Y();return h.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${Us}${t}`},replace:!0})},[a,s,t]),null}function it({ownerSlug:s,sandboxId:t}){const a=Y(),{data:n,isLoading:r}=Bs(),i=n?.sandboxes.find(p=>p.id===t)??null;if(r)return e.jsxs(V,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-6 w-6 rounded"}),e.jsx($,{className:"h-5 w-40"})]}),e.jsx($,{className:"h-24 w-full rounded-lg"})]});if(!i)return e.jsxs(V,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const o=i.name||Is(i.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:e.jsx(oe,{breadcrumb:e.jsx(de,{crumbs:[e.jsx(Q,{to:"/$owner/connectors",params:{owner:s},className:ue,children:"Connectors"},"connectors")]}),icon:e.jsx(ce,{name:o,faviconDomain:Ms(i.providerKind)}),title:o,badge:e.jsxs(e.Fragment,{children:[e.jsx(M,{variant:"secondary",children:i.providerKind}),i.connected?e.jsx(M,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(M,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Me,{facets:nt})}),children:[e.jsx(et,{sandbox:i}),e.jsx(I,{title:"Settings",muted:!0,children:e.jsx(st,{sandbox:i,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function lt({ownerSlug:s,providerSlug:t}){const a=Y(),{model:n,reason:r,agentId:i}=se.useSearch(),{data:o=[],isLoading:p}=Ts(),d=zs(),{data:x=[],isLoading:u}=d,c=o.find(D=>D.slug===t)??null,v=x.find(D=>D.slug===(c?.kind??t))??null;if(p||u)return e.jsx("div",{children:e.jsxs(V,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-6 w-6 rounded"}),e.jsx($,{className:"h-5 w-40"})]}),e.jsx($,{className:"h-16 w-full rounded-lg"}),e.jsx($,{className:"h-24 w-full rounded-lg"}),e.jsx($,{className:"h-32 w-full rounded-lg"})]})});if(!c&&!v&&!d.isError)return e.jsxs(V,{className:"space-y-3",children:[e.jsx(Ie,{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 y=c?.displayName||v?.displayName||t,j=c!==null,N=r?e.jsx(dt,{agentId:i,model:n,providerName:y}):n?e.jsx(ct,{providerName:y,model:n,isConnected:j}):null,C=e.jsx(oe,{breadcrumb:e.jsx(de,{crumbs:[e.jsx(Q,{to:"/$owner/connectors",params:{owner:s},className:ue,children:"Connectors"},"connectors")]}),icon:e.jsx(ce,{iconUrl:v?.iconUrl,name:y}),title:y,badge:c?e.jsxs(e.Fragment,{children:[c.isDefault?e.jsx(M,{variant:"secondary",children:"Default"}):null,c.status?e.jsx(M,{variant:"outline",children:c.status}):null,c.hasCustomUpstream?e.jsx(M,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Me,{facets:at})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:C,children:[N,e.jsx("div",{className:"space-y-6",children:c?e.jsx(Xs,{provider:c,catalog:x,autoOpenEdit:!!n}):e.jsx(ot,{ownerSlug:s,providerSlug:t,catalog:x,catalogError:d.isError?d.error:null,model:n})}),c?e.jsx(I,{title:"Settings",muted:!0,children:e.jsx(Hs,{provider:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function ot({ownerSlug:s,providerSlug:t,catalog:a,catalogError:n,model:r}){const i=Y();return n?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:n instanceof Error?n.message:"Check the workspace URL and try again."})]})]})}):e.jsx("div",{className:"rounded-lg border p-4",children:e.jsx(Qs,{catalog:a,initialProvider:t,initialModel:r?.includes("/")?r.split("/").slice(1).join("/"):r,onDone:()=>void i({to:"/$owner/connectors",params:{owner:s}})},`${a.length}:${t}`)})}function ct({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 dt({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 ut({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:r=[],isLoading:i}=Os(t??""),{data:o=[],isLoading:p,refetch:d}=Es(t??"",{connectorKey:n}),x=h.useMemo(()=>r.find(v=>v.key===n),[r,n]),u=h.useMemo(()=>Rs(n,r,{name:o[0]?.connector_name??n}),[n,r,o]);if(a||i)return e.jsx("div",{children:e.jsxs(V,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-6 w-6 rounded"}),e.jsx($,{className:"h-5 w-40"})]}),e.jsx($,{className:"h-16 w-full rounded-lg"}),e.jsx($,{className:"h-24 w-full rounded-lg"}),e.jsx($,{className:"h-32 w-full rounded-lg"})]})});const c=x?e.jsx(ht,{connector:x,ownerSlug:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ie,{connector:u,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(mt,{hero:c,connector:x,organizationId:t,ownerSlug:s,connectorKey:n,connections:o,isLoading:p,refetchConnections:d}):e.jsxs(V,{className:"space-y-6",children:[c,e.jsx(Te,{organizationId:t??"",ownerSlug:s,connectorKey:n,connections:o,isLoading:p})]})})}function mt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:o,refetchConnections:p}){const{isAdmin:d,isLoading:x}=G(a),u=(t.operations_summary?.total??0)>0;return e.jsxs(le,{header:s,children:[e.jsx(us,{organizationId:a,connectorKey:r}),e.jsx(vt,{connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:o,refetchConnections:p}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(qs,{connections:i,connectorDef:t,organizationId:a,ownerSlug:n,connectorKey:r,isLoading:o}),e.jsx(Nt,{connector:t,organizationId:a,ownerSlug:n}),u&&x?e.jsx($,{className:"h-20 w-full rounded-lg"}):u&&d?e.jsx(ft,{connector:t,organizationId:a,ownerSlug:n}):u&&!d?e.jsx(I,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(xt,{connector:t,organizationId:a,ownerSlug:n,connectionCount:i.length}),!o&&i.length>0?e.jsx(I,{title:"Recent activity",children:e.jsx(Gs,{scope:{connectorKey:r},ownerSlug:n})}):null]})}function ht({connector:s,ownerSlug:t}){return e.jsx(oe,{breadcrumb:e.jsx(de,{crumbs:[e.jsx(Q,{to:"/$owner/connectors",params:{owner:t},className:ue,children:"Connectors"},"connectors")]}),icon:e.jsx(ce,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Vs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsx(Ys,{connectorDef:s,ownerSlug:t}),caption:s.description})}function xt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Oe(s.auth_schema),i=Ds(s.auth_schema),o=r.find(S=>S.type==="oauth"),p=Ue(s.auth_schema),d=r.some(S=>S.type==="env_keys"),x=r.some(S=>S.type==="browser"),u=i.some(S=>S.type==="interactive"),c=!!(o||p||d||x),v=$s(s),{isAdmin:y}=G(t),{data:j=[]}=te(t,{connectorKey:s.key,profileKind:"env"}),{data:N=[]}=te(t,{profileKind:"browser_session"}),C=y&&s.installed!==!1;return!!(o||p)||d&&j.length>0||x&&N.length>0||!c||C?e.jsxs("div",{className:"space-y-6",children:[o?e.jsx(gt,{connector:s,organizationId:t,oauthMethod:o}):null,p?e.jsx(I,{title:"App installation",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install the ",s.name," app to create or repair the workspace connection."]}),e.jsx(Be,{organizationId:t,connectorKey:s.key,provider:p.provider,providerLabel:s.name,installShape:p.installShape,variant:"outline"})]})}):null,d&&j.length>0?e.jsx(ke,{profiles:j,type:"env"}):null,x&&N.length>0?e.jsx(ke,{profiles:N,type:"browser_session"}):null,c?null:v?e.jsx(I,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(Q,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):u?e.jsx(I,{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."]})}):e.jsx(I,{title:"Authentication",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector doesn't need workspace credentials. Create a connection from Overview to get started."})}),e.jsx(pt,{connector:s,organizationId:t,ownerSlug:a,connectionCount:n})]}):null}function pt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Y(),{isAdmin:i}=G(t),o=Ks(),[p,d]=h.useState(!1),[x,u]=h.useState(null),c=s.installed!==!1;if(!i||!c)return null;const v=n>0,y=o.isPending,j=()=>{u(null),o.mutate({connector_key:s.key},{onSuccess:()=>{r({to:"/$owner/connectors",params:{owner:a}})},onError:N=>{u(N instanceof Error?N.message:"Failed to remove connector"),d(!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:"Remove connector"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Archives ",s.name," in this workspace. Existing synced data stays in memory."]}),v?e.jsxs("p",{className:"mt-2 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,x?e.jsx("p",{className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}):null,e.jsx("div",{className:"mt-3",children:p?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:y,onClick:j,children:[y?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm remove"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:y,onClick:()=>d(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:y||v,onClick:()=>d(!0),children:[e.jsx(ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove connector"]})})]})}function ft({connector:s,organizationId:t,ownerSlug:a}){const n=Ee();return e.jsx(Re,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · workspace approval defaults`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function gt({connector:s,organizationId:t,oauthMethod:a}){const{isAdmin:n,isLoading:r}=G(t),{setup:i}=se.useSearch(),o=se.useNavigate(),{data:p=[],refetch:d,isLoading:x,isError:u}=te(t,{connectorKey:s.key,provider:a.provider}),c=p.filter(v=>v.profile_kind==="oauth_app");return r||x?e.jsx($,{className:"h-28 w-full"}):u?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load OAuth apps. Reload the page to try again."}):e.jsx(jt,{connector:s,oauthMethod:a,appProfiles:c,isAdmin:n,initialOpen:i==="oauth_app",onClose:()=>{i==="oauth_app"&&o({search:v=>({...v,setup:void 0}),hash:"",replace:!0})},refetchProfiles:d})}function jt({initialOpen:s=!1,onClose:t,connector:a,oauthMethod:n,appProfiles:r,isAdmin:i,refetchProfiles:o}){const p=vs(),d=ys(),[x,u]=Z(a.key,s&&i),[c,v]=h.useState(!1);h.useEffect(()=>{s&&i&&u(!0)},[s,i,u]);const y=`${Ns()}/connect/oauth/callback`,[j,N]=Z(a.key,`${a.name} OAuth App`),[C,D]=Z(a.key,""),[S,k]=Z(a.key,null),T=bs(n),w=Cs(`${a.key}:${x}`,ks(T),T),{values:R,setValues:L}=w,E=r.find(f=>f.is_default_for_connector&&f.connector_key===a.key),U=()=>{w.canSubmit&&(k(null),p.mutate({connector_key:a.key,profile_kind:"oauth_app",display_name:j.trim()||`${a.name} OAuth App`,slug:C.trim()||void 0,credentials:Ct(Ls(R))},{onSuccess:f=>{const m=f.auth_profile?.slug;m&&!E&&d.mutate({connector_key:a.key,auth_profile_slug:m}),u(!1),t?.(),N(`${a.name} OAuth App`),D(""),o()},onError:f=>{k(f instanceof Error?f.message:"Failed to add OAuth app")}}))};return e.jsxs(I,{id:"connector-oauth-apps",title:`${bt(n.provider)} app configuration`,action:i&&!x?e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[e.jsx(Le,{className:"size-3.5"}),"Add OAuth app"]}):null,children:[i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{children:"OAuth callback URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs",children:y}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(y).then(()=>v(!0)).catch(()=>k("Could not copy the callback URL. Select and copy it above."))},children:[e.jsx(ws,{className:"mr-1.5 h-3.5 w-3.5"}),c?"Copied":"Copy callback URL"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Register this exact URL in your provider’s app settings before saving the client configuration."})]}),r.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No app configured on this server. Choose a managed option if available, or add your own app here."}):e.jsx("div",{className:"space-y-2",children:r.map(f=>e.jsxs("div",{className:ee(J,"flex flex-wrap items-center gap-3 p-3"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:f.display_name}),f.is_default_for_connector&&f.connector_key===a.key?e.jsx(M,{variant:"secondary",className:"text-[10px]",children:"Default"}):null,e.jsx(ze,{status:f.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:f.slug})]}),i&&!f.is_default_for_connector&&f.connector_key===a.key&&f.status==="active"?e.jsx(g,{variant:"outline",size:"sm",disabled:d.isPending,onClick:()=>d.mutate({connector_key:a.key,auth_profile_slug:f.slug}),children:"Set default"}):null]},f.slug))}),i&&x?e.jsxs("div",{className:ee(J,"space-y-3 p-3"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(P,{htmlFor:"oauth-app-name",children:"Display name"}),e.jsx(F,{id:"oauth-app-name",value:j,onChange:f=>N(f.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(P,{htmlFor:"oauth-app-slug",children:"Slug"}),e.jsx(F,{id:"oauth-app-slug",placeholder:"optional",value:C,onChange:f=>D(f.target.value)})]}),e.jsx(Ss,{schema:w.revision??void 0,values:R,onValuesChange:L,fieldIdPrefix:"oauth-app-"}),e.jsx(As,{visible:w.hasConflict,onReload:w.reset}),S?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:S}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",disabled:p.isPending,onClick:()=>{u(!1),t?.()},children:"Cancel"}),e.jsxs(g,{size:"sm",disabled:p.isPending||!w.canSubmit,onClick:U,children:[p.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Save OAuth app"]})]})]}):null]})}function vt({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i,refetchConnections:o}){const d=Oe(s.auth_schema).find(y=>y.type==="oauth"),{data:x=[],refetch:u,isLoading:c,isError:v}=te(t,{connectorKey:s.key,provider:d?.provider});if(d){if(v)return e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load accounts. Reload the page to try again."});const y=x.filter(N=>N.profile_kind==="oauth_app"),j=x.filter(N=>N.profile_kind==="oauth_account");return e.jsx(yt,{connector:s,organizationId:t,oauthMethod:d,appProfiles:y,accounts:j,connections:r,isLoading:i||c,refetchProfiles:u,refetchConnections:o})}return e.jsx(Te,{connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i})}function yt({connector:s,organizationId:t,oauthMethod:a,appProfiles:n,accounts:r,connections:i,isLoading:o,refetchProfiles:p,refetchConnections:d}){const{session:x}=ms(),{isAdmin:u,isLoading:c}=G(t),v=hs(),y=xs(),j=ps(),[N,C]=h.useState(""),[D,S]=h.useState([]),k=n.filter(m=>m.status==="active"),T=k.find(m=>m.is_default_for_connector&&m.connector_key===s.key),w=(u?k.find(m=>m.slug===N):void 0)??T??(u&&k.length===1?k[0]:void 0),R=new Set(i.map(m=>m.auth_profile_slug)),L=r.filter(m=>m.created_by===x?.user?.id),E=L.filter(m=>!R.has(m.slug)),U=!i.some(m=>m.created_by===x?.user?.id)&&L.length===0;if(o||c||!x?.user?.id||!U&&E.length===0&&!j.error&&!j.continueUrl)return null;const f=m=>j.begin(async()=>{const A=await v.mutateAsync({connector_key:s.key,app_auth_profile_slug:m,requested_scopes:Fs(a,D)});return p(),d(),A});return e.jsxs(I,{title:U?"Connect your account":"Your accounts",children:[U&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your own account to grant access. Your connection is private to you."}),u&&k.length>1?e.jsxs("div",{className:"space-y-1",children:[e.jsx(P,{children:"App used for this account"}),e.jsxs(we,{value:w?.slug??"",onValueChange:C,children:[e.jsx(Se,{"aria-label":"App used for this account",children:e.jsx(Ae,{placeholder:"Choose an OAuth app"})}),e.jsx(_e,{children:k.map(m=>e.jsxs(Pe,{value:m.slug,children:[m.display_name,m.is_default_for_connector&&m.connector_key===s.key?" (workspace default)":""]},m.slug))})]})]}):w?e.jsxs("p",{className:"text-sm",children:["App: ",w.display_name,w.is_default_for_connector&&w.connector_key===s.key?" (workspace default)":""]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Configure an OAuth app below, then connect your account.":"Ask an administrator to configure and set the workspace-default OAuth app."}),w&&e.jsx(fs,{requiredScopes:js(a),optionalScopes:gs(a),selectedOptionalScopes:D,onToggleOptionalScope:(m,A)=>S(B=>A?[...new Set([...B,m])]:B.filter(W=>W!==m))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{size:"sm",disabled:!w||j.pending,onClick:()=>{w&&f(w.slug)},children:"Connect account"}),u&&e.jsx(g,{asChild:!0,size:"sm",variant:"outline",children:e.jsx("a",{href:"#connector-oauth-apps",children:"Manage app"})})]})]}),E.map(m=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2",children:[e.jsx("span",{className:"text-sm",children:m.display_name}),e.jsx(g,{variant:"outline",size:"sm",disabled:j.pending,onClick:()=>void j.begin(()=>m.status==="active"?v.mutateAsync({connector_key:s.key,auth_profile_slug:m.slug}):y.mutateAsync({auth_profile_slug:m.slug})),children:m.status==="active"?"Use this account":"Reconnect"})]},m.slug)),j.error&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j.error}),j.continueUrl&&e.jsx("a",{href:j.continueUrl,target:"_blank",rel:"noreferrer",className:"text-sm underline",children:"Continue authorization in your browser"})]})}function ke({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(I,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:ee(J,"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(ze,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function Nt({connector:s,organizationId:t,ownerSlug:a}){const n=Ee(),r=Object.keys(s.feeds_schema??{}).length;return r?e.jsx(Re,{title:"Feeds",summary:`${r} ${r===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}function Te({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i}){const o=Y(),p=Ue(s?.auth_schema);if(i)return e.jsxs("div",{className:"space-y-2",children:[e.jsx($,{className:"h-4 w-24"}),e.jsx($,{className:"h-16 w-full rounded-lg"})]});if(r.length===0){const d=s&&p?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Be,{organizationId:t,connectorKey:n,provider:p.provider,providerLabel:s.name,installShape:p.installShape,size:"default",label:`Install ${s.name}`}),e.jsx(g,{asChild:!0,variant:"outline",children:e.jsx(Q,{to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n},children:"Use your own app"})})]}):e.jsxs(g,{size:"default",onClick:()=>o({to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n}}),children:[e.jsx(Le,{className:"mr-1.5 h-4 w-4"}),"Create connection"]});return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:d})}return null}function ze({status:s}){const t=s==="active"?"text-green-500":s==="error"||s==="revoked"?"text-destructive":"text-amber-500";return e.jsxs("span",{className:ee("text-xs",t),children:["· ",s]})}function bt(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Ct(s){const t={};for(const[a,n]of Object.entries(s))typeof n=="string"&&n.trim()?t[a]=n.trim():(typeof n=="number"||typeof n=="boolean")&&(t[a]=String(n));return t}export{mt as ConnectorDetailShell,yt as OAuthAccountsSection,jt as OAuthAppProfilesSection,Dt as component};
@@ -1 +0,0 @@
1
- import{h_ as a,j as e}from"./index-DtRfQcRH.js";import{b as i}from"./agent-guardrails-route-0PsTrqMC.js";import"./model-selector-XC5CI2Et.js";import"./agent-subpage-shell-DtzoRy6N.js";import"./agent-loading-shells-BQLjzMPy.js";import"./agent-card-controls-bhTMPoVi.js";import"./switch-CxDXvPGE.js";function x(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{x as component};