@lobu/runtime-server 22.0.0 → 23.0.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.
- package/dist/catalogs/connectors.json +1353 -181
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +14 -1
- package/dist/connectors/google_gmail.ts +1 -0
- package/dist/connectors/jira-helpers.ts +313 -0
- package/dist/connectors/jira.ts +29 -221
- package/dist/connectors/linkedin-browser-script.ts +13 -0
- package/dist/connectors/linkedin-draft-page.js +104 -0
- package/dist/connectors/linkedin-drafts.ts +73 -0
- package/dist/connectors/linkedin-identity.ts +32 -0
- package/dist/connectors/linkedin-inbox-adapter.js +1185 -0
- package/dist/connectors/linkedin-inbox.ts +156 -0
- package/dist/connectors/linkedin-like.ts +114 -0
- package/dist/connectors/linkedin-takeout.ts +577 -0
- package/dist/connectors/linkedin.ts +3998 -0
- package/dist/connectors/takeout-utils.ts +240 -0
- package/dist/connectors/tiktok-inbox-page.js +9 -9
- package/dist/connectors/tiktok-web-page.js +21 -15
- package/dist/connectors/tiktok_web.ts +63 -30
- package/dist/connectors/whatsapp-web-adapter.js +64 -564
- package/dist/connectors/whatsapp-web-helpers.ts +30 -444
- package/dist/connectors/whatsapp-web-identity.ts +20 -6
- package/dist/connectors/whatsapp_web.ts +45 -645
- package/dist/connectors/x-dm-adapter.js +556 -0
- package/dist/connectors/x-identity.ts +31 -2
- package/dist/connectors/x.ts +266 -120
- package/dist/db/migrations/20261017120000_drop_feeds_kind_virtual.sql +26 -0
- package/dist/db/migrations/20261017130000_drop_retired_dead_code_columns.sql +46 -0
- package/dist/dependencies.bun.lock +41 -41
- package/dist/guest.bundle.js +288 -148
- package/dist/owletto/dist/assets/_-3J-IrxWk.js +2 -0
- package/dist/owletto/dist/assets/{_-CEPl6gU4.js → _-DYUE3ix4.js} +3 -3
- package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-CBC_SadO.js → _agentId-Cam7Z0N7.js} +2 -2
- package/dist/owletto/dist/assets/{_automationId-YTTNksw6.js → _automationId-CXEiKVZJ.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-fK0h7RAp.js → _connectorKey._connectionId-CS85l61t.js} +2 -2
- package/dist/owletto/dist/assets/{_connectorKey.index-C7TPS598.js → _connectorKey.index-clVDIyW0.js} +2 -2
- package/dist/owletto/dist/assets/{_conversationId-CEhxlTIo.js → _conversationId-Ci2k-BuN.js} +2 -2
- package/dist/owletto/dist/assets/{_deploymentId-BQfYN1U2.js → _deploymentId-BuUzGtVL.js} +2 -2
- package/dist/owletto/dist/assets/{_eventId-Cl8GSdjg.js → _eventId-B0662F8h.js} +2 -2
- package/dist/owletto/dist/assets/_name-CwWePlOl.js +2 -0
- package/dist/owletto/dist/assets/{_owner-cUtGHqSw.js → _owner-dTWkrKsK.js} +3 -3
- package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +2 -0
- package/dist/owletto/dist/assets/{_slug-CU1PuHB9.js → _slug-DQHutM41.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-w17IFTtf.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-DQglkhXU.js → activity-route-view-CMqYiiKM.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-mnTN2AZt.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-B2SvH7xD.js → agent-client-setup-list-Bg3hBfUV.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-B6uKvT_X.js → agent-connect-pages-B_vrqLVc.js} +2 -2
- package/dist/owletto/dist/assets/{agent-editor-form-oUnIYHd7.js → agent-editor-form-hTs7eO_U.js} +2 -2
- package/dist/owletto/dist/assets/{agent-guardrails-route-BaV1VpDh.js → agent-guardrails-route-BOrCXcAl.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-CtZJM2Gc.js → agent-loading-shells-Dqcvky-k.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-Ds48KFK9.js → agent-permissions-matrix-BOo_4r_4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-DPk5r08w.js → agent-skill-context-CCdvtlmH.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-DYpB5H1J.js → agent-skills-route-BUxIswuq.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-B3K_jPYR.js → agent-subpage-shell-D92imvSt.js} +2 -2
- package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +6 -0
- package/dist/owletto/dist/assets/agents-9XjpDj_S.js +2 -0
- package/dist/owletto/dist/assets/{agents-workbench-CMyk4PI7.js → agents-workbench-Bt5QCYQ7.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-DH1Qutz6.js → app._appId-CKv7_squ.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-CEDNboId.js → automation-detail-content-vUwVumXf.js} +2 -2
- package/dist/owletto/dist/assets/automations-9XjpDj_S.js +2 -0
- package/dist/owletto/dist/assets/{callback-CU-hb8JB.js → callback-BRgcL8gz.js} +2 -2
- package/dist/owletto/dist/assets/{card-DIF8SF9b.js → card-Djgp00r_.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DELEa-gH.js → claim-BYUZnyMp.js} +2 -2
- package/dist/owletto/dist/assets/{clients-CpG676mg.js → clients-D3Zbjxin.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-V27Z4o3P.js → code-editor-DHeyRGZI.js} +2 -2
- package/dist/owletto/dist/assets/connect-CfsFsy9P.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId.activity-DQWcUqKM.js → connected._clientId.activity-Ckdz6I0y.js} +2 -2
- package/dist/owletto/dist/assets/{connected._clientId.index-BC3R303A.js → connected._clientId.index-CNxafNeo.js} +2 -2
- package/dist/owletto/dist/assets/{connection-DySpRE9x.js → connection-C3XXFEqh.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-C_D68j6d.js → connection-feed-detail-CIJJLDP8.js} +2 -2
- package/dist/owletto/dist/assets/{connections-browser-Cnv2iBbZ.js → connections-browser-CKZjzRz6.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-CNXtzYg5.js → connector-provenance-8-d8hl10.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-BKDetNDc.js → connector-scope-lists-CadPVsI3.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-BJnk1z_2.js → connectors-lvLJ30lo.js} +2 -2
- package/dist/owletto/dist/assets/{consent-BVzxrAO9.js → consent-CdSvVCgx.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-DfZGICl7.js → conversations-table-BdXoZAfc.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-DiTpULFl.js → core.esm-CYvgWCuv.js} +2 -2
- package/dist/owletto/dist/assets/create-0xW9eXxG.js +2 -0
- package/dist/owletto/dist/assets/{create-JRFM8mMf.js → create-B0qhrrX4.js} +2 -2
- package/dist/owletto/dist/assets/create-CAfF-yI1.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-CtSSeYj3.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-DPXl0qA2.js → cronstrue-n4qGUraE.js} +2 -2
- package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +2 -0
- package/dist/owletto/dist/assets/{deployments-DCQdFdwG.js → deployments-RvUdVkj3.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-body-D6TAWs_6.js → deployments-body-BMp7UsMo.js} +2 -2
- package/dist/owletto/dist/assets/{device-CntqYW65.js → device-CPU6CjkJ.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-Bz4JHHMK.js → device-pin-tombstone-CrjG7gPo.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-D4plO3GM.js → device._deviceId-Cs3ZmXWo.js} +2 -2
- package/dist/owletto/dist/assets/{entity-options-UJs64GdQ.js → entity-options-uXjgT7y9.js} +2 -2
- package/dist/owletto/dist/assets/{entity-page-Djz6T50J.js → entity-page-Dc0LGr5U.js} +2 -2
- package/dist/owletto/dist/assets/{entity-type-page-OznRag6A.js → entity-type-page-CwZxa0BR.js} +2 -2
- package/dist/owletto/dist/assets/{event-detail-04qOUGIP.js → event-detail-ve2d6Gbb.js} +2 -2
- package/dist/owletto/dist/assets/{events-feed-fucGZSJR.js → events-feed-BtvhZF1f.js} +2 -2
- package/dist/owletto/dist/assets/{filter-editors-DCQgGLyR.js → filter-editors-Cj-v6NtH.js} +2 -2
- package/dist/owletto/dist/assets/{full-page-spinner-KpV2FS2u.js → full-page-spinner-DqpH99np.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +2 -0
- package/dist/owletto/dist/assets/identity-BigVSBCl.js +2 -0
- package/dist/owletto/dist/assets/{index-BEvyBdOU.js → index-B9uPN6FC.js} +2 -2
- package/dist/owletto/dist/assets/{index-BNh2cidi.js → index-BQVliQW1.js} +2 -2
- package/dist/owletto/dist/assets/index-BfedB4Rc.js +2 -0
- package/dist/owletto/dist/assets/index-CUw3aKBI.js +2 -0
- package/dist/owletto/dist/assets/index-CXhxUkv3.js +2 -0
- package/dist/owletto/dist/assets/{index-_oPeVpL_.js → index-Cr5hwh-C.js} +66 -66
- package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +2 -0
- package/dist/owletto/dist/assets/index-DKSx8JN_.js +2 -0
- package/dist/owletto/dist/assets/{index-D3s8rhG9.js → index-DVk7Ug0d.js} +2 -2
- package/dist/owletto/dist/assets/index-DmZuKGf8.js +2 -0
- package/dist/owletto/dist/assets/{index-DCdkwg9H.js → index-Hio-HRfo.js} +2 -2
- package/dist/owletto/dist/assets/{index-BJXkc60S.js → index-ICgKp3YK.js} +2 -2
- package/dist/owletto/dist/assets/index-cPcroOH0.js +2 -0
- package/dist/owletto/dist/assets/{index-BOzuAbvi.js → index-n7sTbNv4.js} +2 -2
- package/dist/owletto/dist/assets/index-xiFpcWKv.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-D_Ym3Uku.js → json-diff-DBoag_OS.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-Bl0OS39L.js → list-skeleton-C_GuoxAH.js} +2 -2
- package/dist/owletto/dist/assets/{login-QHdxqX-4.js → login-Ci6ixHuL.js} +2 -2
- package/dist/owletto/dist/assets/{logout-DUccApuZ.js → logout-CLGgeZB7.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-CFbrq1by.js → member-scope-gate-B44INDPY.js} +2 -2
- package/dist/owletto/dist/assets/{memory-browse-page-IrIXuZTF.js → memory-browse-page-DyQiRvzl.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-CB1BDvlW.js → model-selector-dAbDgJvx.js} +2 -2
- package/dist/owletto/dist/assets/models-DpVP7ZwX.js +2 -0
- package/dist/owletto/dist/assets/{new-BWo8_Pms.js → new-BUb7AnEW.js} +2 -2
- package/dist/owletto/dist/assets/{new-B5UsLiy6.js → new-BkdULx2r.js} +2 -2
- package/dist/owletto/dist/assets/{new-DpmDXmFI.js → new-CHOr-EcI.js} +2 -2
- package/dist/owletto/dist/assets/{oauth-workspace-access-PGyTnW2K.js → oauth-workspace-access-BxsjwgdH.js} +2 -2
- package/dist/owletto/dist/assets/{organization-BH8PYlVu.js → organization-gxGeDjIV.js} +2 -2
- package/dist/owletto/dist/assets/{peek-pane-content-B2AFNTzP.js → peek-pane-content-CHoQHe2H.js} +2 -2
- package/dist/owletto/dist/assets/{permissions-CwN_YP3u.js → permissions-aPHaKLec.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-DKKGu4Ww.js → proposal-review-shell-UcZr87_Q.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +2 -0
- package/dist/owletto/dist/assets/{recent-DqdZE_TI.js → recent-D-65Pgu-.js} +2 -2
- package/dist/owletto/dist/assets/{record-activity-CvgZyCmw.js → record-activity-CBXH6v1d.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-BL6VcwQH.js → renderer-mEDnVW0O.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-DAvBYkiI.js → reset-password-uX_V6bip.js} +2 -2
- package/dist/owletto/dist/assets/{runs-BWtc5rmc.js → runs-C0rCgGwX.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +2 -0
- package/dist/owletto/dist/assets/{runs-table-DxIiqrSk.js → runs-table-syPJ6r6T.js} +2 -2
- package/dist/owletto/dist/assets/{settings-Crxlwps-.js → settings-9NkNA1G1.js} +2 -2
- package/dist/owletto/dist/assets/settings-E-10sLQX.js +2 -0
- package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CRIPMWfN.js → source-record-panels-CPyzlfD1.js} +2 -2
- package/dist/owletto/dist/assets/{status-dot-C5KDvvm9.js → status-dot-B-EWMgq6.js} +2 -2
- package/dist/owletto/dist/assets/{tabs-B4Er9hJj.js → tabs-DqIIkCX-.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-DqEykWl_.js → use-mention-search-By8RZyKW.js} +2 -2
- package/dist/owletto/dist/assets/{view-param-filters-Cylutoy1.js → view-param-filters-CqLZQrnO.js} +2 -2
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +11447 -10762
- package/npm-shrinkwrap.json +160 -160
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
- package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
- package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
- package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -0
- package/vendor/connector-sdk/dist/index.js +2 -0
- package/vendor/connector-sdk/package.json +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +0 -1
- package/vendor/core/dist/connector-query-errors.d.ts +32 -0
- package/vendor/core/dist/connector-query-errors.js +41 -1
- package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +8 -131
- package/vendor/core/dist/contracts/worker/protocol.js +9 -61
- package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
- package/vendor/core/dist/device-pin-tombstones.js +57 -0
- package/vendor/core/dist/index.d.ts +2 -1
- package/vendor/core/dist/index.js +1 -0
- package/vendor/core/dist/logger.js +10 -25
- package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
- package/vendor/core/dist/worker/wire.d.ts +0 -10
- package/vendor/core/package.json +6 -6
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-C_zNZben.js +0 -2
- package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +0 -2
- package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +0 -2
- package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +0 -6
- package/dist/owletto/dist/assets/agents-F4mGI2oF.js +0 -2
- package/dist/owletto/dist/assets/automations-F4mGI2oF.js +0 -2
- package/dist/owletto/dist/assets/connect-B2YL6qIK.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +0 -2
- package/dist/owletto/dist/assets/create-CUqO6Kfk.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +0 -3
- package/dist/owletto/dist/assets/create-iHcxV0xd.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +0 -2
- package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +0 -2
- package/dist/owletto/dist/assets/guardrails-molekzAF.js +0 -2
- package/dist/owletto/dist/assets/identity-BJcaG66g.js +0 -2
- package/dist/owletto/dist/assets/index-B04ON9Jv.js +0 -2
- package/dist/owletto/dist/assets/index-BOsK-K-2.js +0 -2
- package/dist/owletto/dist/assets/index-Bk1x7A67.js +0 -2
- package/dist/owletto/dist/assets/index-CFnx5huL.js +0 -2
- package/dist/owletto/dist/assets/index-Dbd1jusf.js +0 -2
- package/dist/owletto/dist/assets/index-DqZuqC08.js +0 -2
- package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +0 -2
- package/dist/owletto/dist/assets/index-KPOvMVa-.js +0 -2
- package/dist/owletto/dist/assets/models-DnMb3n-Z.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +0 -2
- package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +0 -2
- package/dist/owletto/dist/assets/skills-D0X430X8.js +0 -2
- package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
- package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=_connectorKey._connectionId-
|
|
1
|
+
import{i7 as I,j as e,ah as z,m as G,az as q,cN as J,cL as Q,ct as X,S as A,B as Y,L as p,aA as Z,hT as K,hU as ee,aO as ne,fN as u,hO as se,fL as ae,aV as te,hD as oe,fM as ce,h0 as E,aI as ie,w as re}from"./index-Cr5hwh-C.js";import{R as de,c as le,C as me}from"./device-pin-tombstone-CrjG7gPo.js";import{a as pe}from"./connector-provenance-8-d8hl10.js";import{f as he,C as ue,F as xe,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-CIJJLDP8.js";import{S as Ne,g as De}from"./runs-table-syPJ6r6T.js";import{c as $e}from"./connection-label-BobuYiAG.js";import"./runs-panel-Du1JMjg5.js";import"./runs-C0rCgGwX.js";import"./filter-editors-Cj-v6NtH.js";import"./connector-scope-lists-CadPVsI3.js";import"./status-dot-B-EWMgq6.js";import"./entity-options-uXjgT7y9.js";function Me(){const{owner:l,connectorKey:n,connectionId:v}=I.useParams(),{addFeed:t,feedId:i,settings:x,auth_result:o}=I.useSearch();return e.jsx(z,{owner:l,children:m=>e.jsx(ge,{organizationId:m.organizationId,ownerSlug:m.ownerSlug,isWorkspaceLoading:m.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:t===!0,feedId:i,openSettings:x===!0,authResult:o})})}function ge({organizationId:l,ownerSlug:n,isWorkspaceLoading:v,connectorKey:t,connectionId:i,showAddFeed:x,feedId:o,openSettings:m,authResult:R}){const y=G(),{data:B=[]}=q(),{data:M=[],isLoading:T,isError:j,refetch:O}=J(l??"",{connectorKey:t,connectionIds:[i]}),{data:$=[]}=Q(l??""),{data:P=[],isLoading:W,isError:S,refetch:H}=X(o?i:null),s=M.find(c=>c.id===i),a=$.find(c=>c.key===t),r=o?P.find(c=>c.id===o):null;if(v||T||o&&W||!l)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(A,{className:"h-7 w-56"}),e.jsx(A,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||o&&S)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Y,{variant:"outline",size:"sm",onClick:()=>void(j?O():H()),children:"Retry"})]});if(!s)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:t},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",a?.name??t]})]});const g=$e({...s,connector_name:s.connector_name??a?.name??null}),C=!o&&!x,V=()=>void y({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:t,connectionId:String(i)},search:{},replace:!0});let h,f=g,w,_,N;o?r?(f=he(r,a),r.store==="channel_messages"?(h=e.jsx(ue,{feed:r,hideHeader:!0}),N="chat channel"):(w=e.jsx(xe,{feed:r,ownerSlug:n}),_=e.jsx(fe,{feed:r}),h=e.jsx(ve,{feed:r,connectorDef:a,ownerSlug:n}))):(h=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),f="Feed"):x&&(h=e.jsx(je,{onClose:V,organizationId:l,connections:[s],connectorDefinitions:$}),f="Add feed",N=Ce);const d=B.find(c=>c.id===s.device_worker_id&&Z(c,n)),k=d?K(d):void 0,D=k?ee(n,k,ne()):void 0,F=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:u,children:"Connectors"},"connectors"),...d&&D?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:D.id},className:u,children:D.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:u,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:t},search:{},className:u,children:a?.name??t},"connector")]];C||F.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:t,connectionId:String(i)},search:{},className:u,children:g},"connection"));const L=C?le(s):null,U=N??L??void 0,b=e.jsx(ae,{breadcrumb:e.jsx(ce,{crumbs:F}),icon:a?e.jsx(te,{icon:a.icon,name:a.name,faviconDomain:a.favicon_domain??oe(a.auth_schema)}):null,title:f,status:w??e.jsx(Ne,{status:De(s.status),showDot:!0,children:s.status}),meta:_,caption:U,captionTone:L?"error":"muted"});return C?d&&a&&ie(a)?e.jsx(re,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},search:{connection:s.id,settings:m||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(E,{header:b,children:[e.jsx(pe,{connectorDef:a,connectorKey:t,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(me,{embedded:!0,connection:s,connectorDef:a,ownerSlug:n,openSettings:m,authResult:R},s.id)]}):e.jsx(E,{header:b,children:e.jsx("div",{className:"mt-0",children:h})})}export{Me as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey._connectionId-CS85l61t.js.map
|
package/dist/owletto/dist/assets/{_connectorKey.index-C7TPS598.js → _connectorKey.index-clVDIyW0.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aw as $e,ax as De,ay as Ee,aG as me,aD as ae,h1 as ls,h2 as os,j as e,h3 as le,B as j,L as K,aF as he,fL as oe,fM as ce,fN as G,h4 as cs,Z as ds,h5 as te,r as p,h6 as we,h7 as Fe,cb as us,h8 as Ae,bH as Y,h9 as _e,y as P,bn as Le,bo as Re,bp as Oe,bq as Be,br as Ke,gW as ms,I as F,by as H,a1 as V,A as Se,ha as hs,hb as xs,bc as ps,hc as fs,a_ as xe,hd as js,he as gs,hf as Ue,hg as Ie,hh as ze,ae as ne,M as U,b7 as de,hi as vs,eW as ys,hj as Ns,eq as Z,hk as bs,S as D,hl as B,g as Cs,hm as ks,hn as ws,ho as As,hp as _s,hq as Ss,hr as Ps,hs as $s,ht as Ds,bP as se,hu as Es,hv as Fs,bO as Ls,dL as Rs,gD as Os,P as re,dM as Bs,bS as Ks,cy as Me,hw as Q,hx as Us,ah as Is,hy as Te,av as ie,u as qe,hz as Ve,aJ as zs,hA as We,hB as Ms,hC as Ye,hD as Ts,dN as qs,au as Vs,cN as Ws,aR as Ys,aB as M,hE as Ge,m as X,aW as Xe,aV as pe,aS as Gs,hF as Xs,hG as Hs}from"./index-_oPeVpL_.js";import{C as Qs,a as He}from"./connections-browser-Cnv2iBbZ.js";import{C as Zs}from"./connector-provenance-CNXtzYg5.js";import{R as Js}from"./runs-panel-BO3h5RkS.js";import"./status-dot-C5KDvvm9.js";import"./connection-label-BobuYiAG.js";import"./runs-BWtc5rmc.js";import"./filter-editors-DCQgGLyR.js";import"./runs-table-DxIiqrSk.js";function et({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",r=$e({enabled:n}),i=De({enabled:n}),h=Ee({enabled:!n}),o=n?r:h,l=n?i.data?.find(c=>c.slug===a)?.displayName??a:me(a),x=(n?(r.data??[]).filter(c=>c.kind===a).map(c=>({key:`${ae}${c.slug}`,name:c.displayName||c.slug,status:[c.isDefault?"Default":null,c.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(c=>c.providerKind===a).map(c=>({key:`${ls}${c.id}`,name:c.name,status:c.connected?"Connected":"Needs credentials"}))).map(c=>({id:c.key,name:c.name,description:c.status,tone:null,link:os({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:c.key},search:{}})})),u=`${n?ae:he}${a}`;return e.jsx(le,{header:e.jsx(oe,{title:l,breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:G,children:"Connectors"},"connectors")]})}),children:e.jsx(Qs,{entries:x,isLoading:o.isLoading,isError:o.isError,onRetry:()=>void o.refetch(),action:e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:n?e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:u},search:{addAccount:!0},children:"Add connection"}):e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:u},children:"Add connection"})})})})}function st({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:r,onDone:i}){const h=cs(),o=ds(),l=s.find(d=>d.slug===t)??s[0],x=n&&l&&te(l)?"oauth":"api-key",[u,c]=p.useState(l?.slug??""),[g,N]=p.useState(a??l?.slug??""),[m,y]=p.useState(l?.displayName??""),[b,$]=p.useState(l?.baseUrl??""),[w,k]=p.useState(r??l?.defaultModel??""),[E,_]=p.useState(""),[z,R]=p.useState(l?.apiKeyPlaceholder??""),[I,O]=p.useState(x),[v,f]=p.useState(""),[A,W]=p.useState(null),[T,q]=p.useState(!1),[fe,je]=p.useState(!1),C=s.find(d=>d.slug===u),J=we(C?.modalities??[]),ge=n&&!!C&&te(C),ve=C?Fe(C):!1,ye=ge&&I==="oauth",Ne=ve&&!ye,L=us().slug,ee=p.useCallback(()=>{je(!0),o.invalidateQueries({queryKey:["inference-providers"]})},[o]),Je=p.useCallback(()=>{o.invalidateQueries({queryKey:["inference-providers"]}),i()},[o,i]),es=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(d.authorizeUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),ss=p.useCallback(async()=>{if(!(!L||!C||!v.trim())){q(!0);try{const d=await _e(L,C.slug,{code:v.trim()});if(d.status!=="success")throw new Error(d.error||"Sign-in not complete");ee(),Y.success(`Signed in with ${C.displayName}`)}catch(d){Y.error(d instanceof Error?d.message:"Failed to complete sign-in")}finally{q(!1)}}},[L,C,v,ee]),ts=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="device")throw new Error("Unexpected sign-in mode");W({userCode:d.userCode,deviceAuthId:d.deviceAuthId,verificationUrl:d.verificationUrl}),window.open(d.verificationUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),as=p.useCallback(async()=>{if(!(!L||!C||!A)){q(!0);try{const d=await _e(L,C.slug,{deviceAuthId:A.deviceAuthId,userCode:A.userCode});if(d.status==="success"){ee(),Y.success(`Signed in with ${C.displayName}`);return}W(S=>S&&{...S,message:d.error||"Waiting for approval..."})}catch(d){Y.error(d instanceof Error?d.message:"Failed to check status")}finally{q(!1)}}},[L,C,A,ee]),ns=C?.supportedAuthTypes.includes("device-code")??!1,rs=d=>{c(d);const S=s.find(ue=>ue.slug===d);S&&(N(S.slug),y(S.displayName),$(S.baseUrl),k(S.slug===t&&r?r:S.defaultModel??""),R(S.apiKeyPlaceholder),O(n&&te(S)?"oauth":"api-key"),f(""),W(null),je(!1))},be=/^[a-z0-9][a-z0-9-]*$/.test(g),Ce=be&&Ne&&E.trim().length>0&&!h.isPending,is=d=>{if(d.preventDefault(),!Ce)return;const S={};b.trim()&&(S.base_url=b.trim()),w.trim()&&(S.model=w.trim());const ue=Object.keys(S).length>0?{text:S}:void 0;h.mutate({slug:g.trim(),kind:u,displayName:m.trim()||void 0,apiKey:E.trim(),capabilities:ue},{onSuccess:()=>i()})},ke=!!(t&&s.some(d=>d.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ke&&C?`Connect ${C.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:is,className:"grid max-w-md gap-3",children:[ke&&C?e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(Le,{value:u,onValueChange:rs,children:[e.jsx(Re,{id:"ip-provider",className:"w-full",children:e.jsx(Oe,{})}),e.jsx(Be,{children:s.map(d=>{const S=we(d.modalities);return e.jsx(Ke,{value:d.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[d.iconUrl?e.jsx("img",{src:d.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(ms,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.displayName,S.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",S.join(", ")]}):null]})},d.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.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:m,onChange:d=>y(d.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:g,onChange:d=>N(d.target.value),autoComplete:"off",required:!0}),g&&!be?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."})]}),ge&&ve?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(j,{type:"button",size:"sm",variant:I==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(j,{type:"button",size:"sm",variant:I==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,Ne?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:b,onChange:d=>$(d.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:w,onChange:d=>k(d.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:z||void 0,value:E,onChange:d=>_(d.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(H,{onCancel:i,children:e.jsx(j,{type:"submit",disabled:!Ce,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ye?e.jsxs("div",{className:"grid gap-3",children:[fe?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",C?.displayName??"provider",". This covers your agents in this org."]}):ns?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ts(),disabled:T||!L,children:A?"Get a new code":"Get device code"}),A?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:A.userCode}),e.jsx(j,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:A.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",C?.displayName??"provider"," to approve",e.jsx(Se,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void as(),disabled:T,children:T?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void es(),disabled:T||!L,children:["Sign in with ",C?.displayName??"provider",e.jsx(Se,{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:v,onChange:d=>f(d.target.value),autoComplete:"off"})]}),e.jsx(j,{type:"button",className:"justify-self-start",onClick:()=>void ss(),disabled:T||!v.trim(),children:T?"Finishing...":"Finish sign-in"})]}),e.jsx(H,{onCancel:i,children:e.jsx(j,{type:"button",onClick:Je,disabled:!fe,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(H,{onCancel:i})]})]})]})}const tt={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function at({provider:s,catalog:t,autoOpenEdit:a}){const n=hs(),[r,i]=p.useState(a?"edit":null),h=xs(s.kind,t);p.useEffect(()=>{a&&i("edit")},[a]);const l=(t.find(c=>c.slug===s.kind)?.modalities??["text"]).filter(c=>c!=="text"),x=h&&l.length>0,u=c=>i(g=>g===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 ${ps(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),x?e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("capabilities"),children:"Configure"}):null,e.jsx(j,{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(rt,{provider:s,supportsUpstreamConfig:h,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."})]}),l.map(c=>e.jsx(it,{providerSlug:s.slug,modality:c,block:s.capabilities[c]??{}},c))]})}):null]})}function nt({provider:s,onDeleted:t}){const a=fs(),[n,r]=p.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>r(!1)}),children:[a.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>r(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>r(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function rt({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=js(),r=gs(),i=Ue(),[h,o]=p.useState(s.displayName??""),[l,x]=p.useState(""),u=s.capabilities.text??{},[c,g]=p.useState(u.base_url??""),[N,m]=p.useState(u.model??""),[y,b]=p.useState(null),$=h.trim().length>0&&h.trim()!==(s.displayName??""),w=t&&l.trim().length>0,k=c.trim()!==(u.base_url??""),E=N.trim()!==(u.model??""),_=t&&(k||E),z={base_url:c.trim()||void 0,model:N.trim()||void 0,models_endpoint:u.models_endpoint},R=Ie(z),I=t&&_&&ze(R),O=n.isPending||r.isPending||i.isPending,v=($||w||_)&&!I&&!O,f=async A=>{if(A.preventDefault(),!!v){b(null);try{await Promise.all([$?n.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),_?i.mutateAsync({providerSlug:s.slug,modality:"text",block:z}):Promise.resolve(),w?r.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{b("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:f,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:h,onChange:A=>o(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=>g(A.target.value),autoComplete:"off"}),R.base_url?e.jsx("p",{className:"text-xs text-destructive",children:R.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:N,onChange:A=>m(A.target.value),autoComplete:"off"}),R.model?e.jsx("p",{className:"text-xs text-destructive",children:R.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:l,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,y?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:y}):null,e.jsx(H,{onCancel:a,children:e.jsx(j,{type:"submit",disabled:!v,children:O?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function it({providerSlug:s,modality:t,block:a}){const n=Ue(),[r,i]=p.useState(!1),[h,o]=p.useState(a.base_url??""),[l,x]=p.useState(a.model??""),[u,c]=p.useState(a.models_endpoint??""),[g,N]=p.useState(!!a.models_endpoint),m=!!(a.base_url||a.model||a.models_endpoint),y={base_url:h.trim()||void 0,model:l.trim()||void 0,models_endpoint:u.trim()||void 0},b=Ie(y),$=ze(b),w=()=>{$||n.mutate({providerSlug:s,modality:t,block:y})};return e.jsxs("div",{className:ne,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:tt[t]}),m?e.jsx(U,{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:h,onChange:k=>o(k.target.value),autoComplete:"off"}),b.base_url?e.jsx("p",{className:"text-xs text-destructive",children:b.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:l,onChange:k=>x(k.target.value),autoComplete:"off"}),b.model?e.jsx("p",{className:"text-xs text-destructive",children:b.model}):null]}),g?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"}),b.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:b.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:()=>N(!0),children:"Advanced"}),e.jsx(H,{onCancel:()=>i(!1),children:e.jsx(j,{size:"sm",disabled:$||n.isPending,onClick:w,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function lt({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(ct,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(U,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(U,{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(U,{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(de,{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 ot({sandbox:s,onDeleted:t}){const a=vs(),[n,r]=p.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(xe,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(V,{}):"Delete permanently"}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"})]}):e.jsx(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>r(!0),children:"Delete sandbox"})]})})}function ct({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(ys,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ns,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const dt={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},ut={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function It(){const{owner:s,connectorKey:t}=Q.useParams(),{instances:a}=Q.useSearch(),{kind:n,id:r}=Us(t);return e.jsx(Is,{owner:s,children:({ownerSlug:i,organizationId:h,isWorkspaceLoading:o})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(et,{ownerSlug:i,familyKind:n,familyId:r});switch(n){case"inference":return e.jsx(xt,{ownerSlug:i,providerSlug:r});case"sandbox":return e.jsx(ht,{ownerSlug:i,sandboxId:r});case"sandbox-provider":return e.jsx(mt,{ownerSlug:i,providerKind:r});default:return e.jsx(gt,{ownerSlug:i,organizationId:h,isWorkspaceLoading:o,connectorKey:t})}}})}function mt({ownerSlug:s,providerKind:t}){const a=X();return p.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${he}${t}`},replace:!0})},[a,s,t]),null}function ht({ownerSlug:s,sandboxId:t}){const a=X(),{data:n,isLoading:r,isError:i,refetch:h}=Ee(),o=n?.sandboxes.find(x=>x.id===t)??null;if(r)return e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-24 w-full rounded-lg"})]});if(i)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(j,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!o)return e.jsxs(M,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(j,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const l=o.name||me(o.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:G,children:"Connectors"},"connectors"),e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${he}${o.providerKind}`},search:{instances:!0},className:G,children:me(o.providerKind)},"family")]}),icon:e.jsx(pe,{name:l,faviconDomain:Gs(o.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"secondary",children:o.providerKind}),o.connected?e.jsx(U,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(U,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Xe,{facets:ut})}),children:[e.jsx(lt,{sandbox:o}),e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(ot,{sandbox:o,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function xt({ownerSlug:s,providerSlug:t}){const a=X(),{model:n,reason:r,agentId:i,addAccount:h}=Q.useSearch(),{data:o=[],isLoading:l,isError:x,refetch:u}=$e(),c=De(),{data:g=[],isLoading:N}=c,m=h?null:o.find(E=>E.slug===t)??null,y=g.find(E=>E.slug===(m?.kind??t))??null;if(l||N)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(x)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(j,{variant:"outline",onClick:()=>void u(),children:"Retry"})]})});if(!m&&!y&&!c.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Ge,{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 b=m?m.displayName||m.slug:y?.displayName||t,$=m!==null,w=r?e.jsx(jt,{agentId:i,model:n,providerName:b}):n?e.jsx(ft,{providerName:b,model:n,isConnected:$}):null,k=e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:G,children:"Connectors"},"connectors"),...m?[e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${m.kind}`},search:{instances:!0},className:G,children:y?.displayName??m.kind},"family")]:[]]}),icon:e.jsx(pe,{iconUrl:y?.iconUrl,name:b}),title:b,badge:m?e.jsxs(e.Fragment,{children:[m.isDefault?e.jsx(U,{variant:"secondary",children:"Default"}):null,m.status?e.jsx(U,{variant:"outline",children:m.status}):null,m.hasCustomUpstream?e.jsx(U,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Xe,{facets:dt})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:k,children:[w,e.jsx("div",{className:"space-y-6",children:m?e.jsx(at,{provider:m,catalog:g,autoOpenEdit:!!n}):e.jsx(pt,{ownerSlug:s,providerSlug:t,existingSlugs:o.map(E=>E.slug),catalog:g,catalogError:c.isError?c.error:null,model:n})}),m?e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(nt,{provider:m,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function pt({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:r,model:i}){const h=X(),o=n.find(u=>u.slug===t),l=a.includes(t)&&!!o&&te(o);let x=t;for(let u=2;a.includes(x);u++)x=`${t}-${u}`;return r?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(de,{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:r instanceof Error?r.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${t}`},search:{},children:"Open existing connection"})})]}),(!l||o&&Fe(o))&&e.jsx(st,{catalog:n,initialProvider:t,initialSlug:x,allowOAuth:!l,initialModel:i?.includes("/")?i.split("/").slice(1).join("/"):i,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function ft({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(de,{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 jt({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(de,{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 gt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:r=[],isLoading:i,isError:h,refetch:o}=Vs(t??""),{data:l=[],isLoading:x,isError:u,refetch:c}=Ws(t??"",{connectorKey:n}),g=p.useMemo(()=>r.find(y=>y.key===n),[r,n]),N=p.useMemo(()=>Ys(n,r,{name:l[0]?.connector_name??n}),[n,r,l]);if(a||i)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(h||u)return e.jsx(M,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(j,{variant:"outline",onClick:()=>{o(),c()},children:"Retry"})]})});const m=g?e.jsx(yt,{connector:g,ownerSlug:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ge,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",l.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:g&&t?e.jsx(vt,{hero:m,connector:g,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:x,refetchConnections:c}):e.jsxs(M,{className:"space-y-6",children:[m,l.length>0&&!x?e.jsx(He,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):e.jsx(Qe,{organizationId:t??"",ownerSlug:s,connectorKey:n,connections:l,isLoading:x})]})})}function vt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}){const{isAdmin:l,isLoading:x}=Z(a),u=(t.operations_summary?.total??0)>0;return e.jsxs(le,{header:s,children:[e.jsx(bs,{organizationId:a,connectorKey:r}),e.jsx(At,{connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}),i.length>0?e.jsx(He,{section:!0,connections:i,connector:t,ownerSlug:n,connectorKey:r}):null,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(St,{connector:t,organizationId:a,ownerSlug:n}),u&&x?e.jsx(D,{className:"h-20 w-full rounded-lg"}):u&&l?e.jsx(Ct,{connector:t,organizationId:a,ownerSlug:n}):u&&!l?e.jsx(B,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(Nt,{connector:t,organizationId:a,ownerSlug:n,connectionCount:i.length}),!h&&i.length>0?e.jsx(B,{title:"Recent activity",children:e.jsx(Js,{scope:{connectorKey:r},ownerSlug:n})}):null]})}function yt({connector:s,ownerSlug:t}){return e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:t},className:G,children:"Connectors"},"connectors")]}),icon:e.jsx(pe,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Hs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsx(Zs,{connectorDef:s,ownerSlug:t}),caption:s.description})}function Nt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Te(s.auth_schema),i=zs(s.auth_schema),h=r.find(w=>w.type==="oauth"),o=We(s.auth_schema),l=r.some(w=>w.type==="env_keys"),x=r.some(w=>w.type==="browser"),u=i.some(w=>w.type==="interactive"),c=!!(h||o||l||x),g=Ms(s),{isAdmin:N}=Z(t),{data:m=[]}=ie(t,{connectorKey:s.key,profileKind:"env"}),{data:y=[]}=ie(t,{profileKind:"browser_session",connectorKey:s.key}),b=N&&s.installed!==!1;return!!(h||o)||l&&m.length>0||x&&y.length>0||!c||b?e.jsxs("div",{className:"space-y-6",children:[h?e.jsx(kt,{connector:s,organizationId:t,oauthMethod:h}):null,o?e.jsx(B,{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(Ye,{organizationId:t,connectorKey:s.key,provider:o.provider,providerLabel:s.name,installShape:o.installShape,variant:"outline"})]})}):null,l&&m.length>0?e.jsx(Pe,{profiles:m,type:"env"}):null,x&&y.length>0?e.jsx(Pe,{profiles:y,type:"browser_session"}):null,c?null:g?e.jsx(B,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):u?e.jsx(B,{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(B,{title:"Authentication",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector doesn't need workspace credentials. Create a connection above to get started."})}),e.jsx(bt,{connector:s,organizationId:t,ownerSlug:a,connectionCount:n})]}):null}function bt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=X(),{isAdmin:i}=Z(t),h=Xs(),[o,l]=p.useState(!1),[x,u]=p.useState(null),c=s.installed!==!1;if(!i||!c)return null;const g=n>0,N=h.isPending,m=()=>{u(null),h.mutate({connector_key:s.key},{onSuccess:()=>{r({to:"/$owner/connectors",params:{owner:a}})},onError:y=>{u(y instanceof Error?y.message:"Failed to remove connector"),l(!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."]}),g?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:o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:N,onClick:m,children:[N?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Confirm remove"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:N,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:N||g,onClick:()=>l(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove connector"]})})]})}function Ct({connector:s,organizationId:t,ownerSlug:a}){const n=qe();return e.jsx(Ve,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function kt({connector:s,organizationId:t,oauthMethod:a}){const{isAdmin:n,isLoading:r}=Z(t),{setup:i}=Q.useSearch(),h=Q.useNavigate(),{data:o=[],refetch:l,isLoading:x,isError:u}=ie(t,{connectorKey:s.key,provider:a.provider}),c=o.filter(g=>g.profile_kind==="oauth_app");return r||x?e.jsx(D,{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(wt,{connector:s,oauthMethod:a,appProfiles:c,isAdmin:n,initialOpen:i==="oauth_app",onClose:()=>{i==="oauth_app"&&h({search:g=>({...g,setup:void 0}),hash:"",replace:!0})},refetchProfiles:l})}function wt({initialOpen:s=!1,onClose:t,connector:a,oauthMethod:n,appProfiles:r,isAdmin:i,refetchProfiles:h}){const o=$s(),l=Ds(),[x,u]=se(a.key,s&&i),[c,g]=p.useState(!1);p.useEffect(()=>{s&&i&&u(!0)},[s,i,u]);const N=`${Es()}/connect/oauth/callback`,[m,y]=se(a.key,`${a.name} OAuth App`),[b,$]=se(a.key,""),[w,k]=se(a.key,null),E=Fs(n),_=Ls(`${a.key}:${x}`,Rs(E),E),{values:z,setValues:R}=_,I=r.find(v=>v.is_default_for_connector&&v.connector_key===a.key),O=()=>{_.canSubmit&&(k(null),o.mutate({connector_key:a.key,profile_kind:"oauth_app",display_name:m.trim()||`${a.name} OAuth App`,slug:b.trim()||void 0,credentials:$t(qs(z))},{onSuccess:v=>{const f=v.auth_profile?.slug;f&&!I&&l.mutate({connector_key:a.key,auth_profile_slug:f}),u(!1),t?.(),y(`${a.name} OAuth App`),$(""),h()},onError:v=>{k(v instanceof Error?v.message:"Failed to add OAuth app")}}))};return e.jsxs(B,{id:"connector-oauth-apps",title:`${Pt(n.provider)} app configuration`,action:i&&!x?e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[e.jsx(Me,{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:N}),e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(N).then(()=>g(!0)).catch(()=>k("Could not copy the callback URL. Select and copy it above."))},children:[e.jsx(Os,{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(v=>e.jsxs("div",{className:re(ne,"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:v.display_name}),v.is_default_for_connector&&v.connector_key===a.key?e.jsx(U,{variant:"secondary",className:"text-[10px]",children:"Default"}):null,e.jsx(Ze,{status:v.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:v.slug})]}),i&&!v.is_default_for_connector&&v.connector_key===a.key&&v.status==="active"?e.jsx(j,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate({connector_key:a.key,auth_profile_slug:v.slug}),children:"Set default"}):null]},v.slug))}),i&&x?e.jsxs("div",{className:re(ne,"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:m,onChange:v=>y(v.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:b,onChange:v=>$(v.target.value)})]}),e.jsx(Bs,{schema:_.revision??void 0,values:z,onValuesChange:R,fieldIdPrefix:"oauth-app-"}),e.jsx(Ks,{visible:_.hasConflict,onReload:_.reset}),w?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(j,{variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>{u(!1),t?.()},children:"Cancel"}),e.jsxs(j,{size:"sm",disabled:o.isPending||!_.canSubmit,onClick:O,children:[o.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Save OAuth app"]})]})]}):null]})}function At({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i,refetchConnections:h}){const l=Te(s.auth_schema).find(N=>N.type==="oauth"),{data:x=[],refetch:u,isLoading:c,isError:g}=ie(t,{connectorKey:s.key,provider:l?.provider});if(l){if(g)return e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load accounts. Reload the page to try again."});const N=x.filter(y=>y.profile_kind==="oauth_app"),m=x.filter(y=>y.profile_kind==="oauth_account");return e.jsx(_t,{connector:s,organizationId:t,oauthMethod:l,appProfiles:N,accounts:m,connections:r,isLoading:i||c,refetchProfiles:u,refetchConnections:h})}return e.jsx(Qe,{connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i})}function _t({connector:s,organizationId:t,oauthMethod:a,appProfiles:n,accounts:r,connections:i,isLoading:h,refetchProfiles:o,refetchConnections:l}){const{session:x}=Cs(),{isAdmin:u,isLoading:c}=Z(t),g=ks(),N=ws(),m=As(),[y,b]=p.useState(""),[$,w]=p.useState([]),k=n.filter(f=>f.status==="active"),E=k.find(f=>f.is_default_for_connector&&f.connector_key===s.key),_=(u?k.find(f=>f.slug===y):void 0)??E??(u&&k.length===1?k[0]:void 0),z=new Set(i.map(f=>f.auth_profile_slug)),R=r.filter(f=>f.created_by===x?.user?.id),I=R.filter(f=>!z.has(f.slug)),O=!i.some(f=>f.created_by===x?.user?.id)&&R.length===0;if(h||c||!x?.user?.id||!O&&I.length===0&&!m.error&&!m.continueUrl)return null;const v=f=>m.begin(async()=>{const A=await g.mutateAsync({connector_key:s.key,app_auth_profile_slug:f,requested_scopes:Ts(a,$)});return o(),l(),A});return e.jsxs(B,{title:O?"Connect your account":"Your accounts",children:[O&&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(Le,{value:_?.slug??"",onValueChange:b,children:[e.jsx(Re,{"aria-label":"App used for this account",children:e.jsx(Oe,{placeholder:"Choose an OAuth app"})}),e.jsx(Be,{children:k.map(f=>e.jsxs(Ke,{value:f.slug,children:[f.display_name,f.is_default_for_connector&&f.connector_key===s.key?" (workspace default)":""]},f.slug))})]})]}):_?e.jsxs("p",{className:"text-sm",children:["App: ",_.display_name,_.is_default_for_connector&&_.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."}),_&&e.jsx(_s,{requiredScopes:Ps(a),optionalScopes:Ss(a),selectedOptionalScopes:$,onToggleOptionalScope:(f,A)=>w(W=>A?[...new Set([...W,f])]:W.filter(T=>T!==f))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(j,{size:"sm",disabled:!_||m.pending,onClick:()=>{_&&v(_.slug)},children:"Connect account"}),u&&e.jsx(j,{asChild:!0,size:"sm",variant:"outline",children:e.jsx("a",{href:"#connector-oauth-apps",children:"Manage app"})})]})]}),I.map(f=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2",children:[e.jsx("span",{className:"text-sm",children:f.display_name}),e.jsx(j,{variant:"outline",size:"sm",disabled:m.pending,onClick:()=>void m.begin(()=>f.status==="active"?g.mutateAsync({connector_key:s.key,auth_profile_slug:f.slug}):N.mutateAsync({auth_profile_slug:f.slug})),children:f.status==="active"?"Use this account":"Reconnect"})]},f.slug)),m.error&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m.error}),m.continueUrl&&e.jsx("a",{href:m.continueUrl,target:"_blank",rel:"noreferrer",className:"text-sm underline",children:"Continue authorization in your browser"})]})}function Pe({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(B,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:re(ne,"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 St({connector:s,organizationId:t,ownerSlug:a}){const n=qe(),r=Object.keys(s.feeds_schema??{}).length;return r?e.jsx(Ve,{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 Qe({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i}){const h=X(),o=We(s?.auth_schema);if(i)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-4 w-24"}),e.jsx(D,{className:"h-16 w-full rounded-lg"})]});if(r.length===0){const l=s&&o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ye,{organizationId:t,connectorKey:n,provider:o.provider,providerLabel:s.name,installShape:o.installShape,size:"default",label:`Install ${s.name}`}),e.jsx(j,{asChild:!0,variant:"outline",children:e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n},children:"Use your own app"})})]}):e.jsxs(j,{size:"default",onClick:()=>h({to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n}}),children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Create connection"]});return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:l})}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:re("text-xs",t),children:["· ",s]})}function Pt(s){return s.charAt(0).toUpperCase()+s.slice(1)}function $t(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{vt as ConnectorDetailShell,_t as OAuthAccountsSection,wt as OAuthAppProfilesSection,It as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey.index-
|
|
1
|
+
import{aw as Pe,ax as De,ay as Ee,aG as me,aD as ae,g_ as ls,g$ as os,j as e,h0 as le,B as g,L as K,aF as he,fL as oe,fM as ce,fN as X,h1 as cs,Z as ds,h2 as te,r as p,h3 as we,h4 as Fe,cb as us,h5 as Ae,bH as Y,h6 as _e,y as $,bn as Le,bo as Re,bp as Oe,bq as Be,br as Ke,gT as ms,I as F,by as H,a1 as V,A as Se,h7 as hs,h8 as xs,bc as ps,h9 as fs,a_ as xe,ha as gs,hb as js,hc as Ue,hd as Ie,he as ze,ae as ne,M as U,b7 as de,hf as vs,eW as ys,hg as Ns,eq as Z,hh as bs,S as D,hi as B,g as Cs,hj as ks,hk as ws,hl as As,hm as _s,hn as Ss,ho as $s,hp as Ps,hq as Ds,bP as se,hr as Es,hs as Fs,bO as Ls,dL as Rs,gA as Os,P as re,dM as Bs,bS as Ks,cy as Me,ht as Q,hu as Us,ah as Is,hv as Te,av as ie,u as qe,hw as Ve,aJ as zs,hx as We,hy as Ms,hz as Ye,hA as Ts,dN as qs,au as Vs,cN as Ws,aR as Ys,aB as M,hB as Xe,m as G,aW as Ge,aV as pe,aS as Xs,hC as Gs,hD as Hs}from"./index-Cr5hwh-C.js";import{C as Qs,a as He}from"./connections-browser-CKZjzRz6.js";import{C as Zs}from"./connector-provenance-8-d8hl10.js";import{R as Js}from"./runs-panel-Du1JMjg5.js";import"./status-dot-B-EWMgq6.js";import"./connection-label-BobuYiAG.js";import"./runs-C0rCgGwX.js";import"./filter-editors-Cj-v6NtH.js";import"./runs-table-syPJ6r6T.js";function et({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",r=Pe({enabled:n}),i=De({enabled:n}),h=Ee({enabled:!n}),o=n?r:h,l=n?i.data?.find(c=>c.slug===a)?.displayName??a:me(a),x=(n?(r.data??[]).filter(c=>c.kind===a).map(c=>({key:`${ae}${c.slug}`,name:c.displayName||c.slug,status:[c.isDefault?"Default":null,c.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(c=>c.providerKind===a).map(c=>({key:`${ls}${c.id}`,name:c.name,status:c.connected?"Connected":"Needs credentials"}))).map(c=>({id:c.key,name:c.name,description:c.status,tone:null,link:os({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:c.key},search:{}})})),u=`${n?ae:he}${a}`;return e.jsx(le,{header:e.jsx(oe,{title:l,breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors")]})}),children:e.jsx(Qs,{entries:x,isLoading:o.isLoading,isError:o.isError,onRetry:()=>void o.refetch(),action:e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:n?e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:u},search:{addAccount:!0},children:"Add connection"}):e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:u},children:"Add connection"})})})})}function st({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:r,onDone:i}){const h=cs(),o=ds(),l=s.find(d=>d.slug===t)??s[0],x=n&&l&&te(l)?"oauth":"api-key",[u,c]=p.useState(l?.slug??""),[j,N]=p.useState(a??l?.slug??""),[m,y]=p.useState(l?.displayName??""),[b,P]=p.useState(l?.baseUrl??""),[w,k]=p.useState(r??l?.defaultModel??""),[E,_]=p.useState(""),[z,R]=p.useState(l?.apiKeyPlaceholder??""),[I,O]=p.useState(x),[v,f]=p.useState(""),[A,W]=p.useState(null),[T,q]=p.useState(!1),[fe,ge]=p.useState(!1),C=s.find(d=>d.slug===u),J=we(C?.modalities??[]),je=n&&!!C&&te(C),ve=C?Fe(C):!1,ye=je&&I==="oauth",Ne=ve&&!ye,L=us().slug,ee=p.useCallback(()=>{ge(!0),o.invalidateQueries({queryKey:["inference-providers"]})},[o]),Je=p.useCallback(()=>{o.invalidateQueries({queryKey:["inference-providers"]}),i()},[o,i]),es=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(d.authorizeUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),ss=p.useCallback(async()=>{if(!(!L||!C||!v.trim())){q(!0);try{const d=await _e(L,C.slug,{code:v.trim()});if(d.status!=="success")throw new Error(d.error||"Sign-in not complete");ee(),Y.success(`Signed in with ${C.displayName}`)}catch(d){Y.error(d instanceof Error?d.message:"Failed to complete sign-in")}finally{q(!1)}}},[L,C,v,ee]),ts=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="device")throw new Error("Unexpected sign-in mode");W({userCode:d.userCode,deviceAuthId:d.deviceAuthId,verificationUrl:d.verificationUrl}),window.open(d.verificationUrl,"_blank","noreferrer")}catch(d){Y.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),as=p.useCallback(async()=>{if(!(!L||!C||!A)){q(!0);try{const d=await _e(L,C.slug,{deviceAuthId:A.deviceAuthId,userCode:A.userCode});if(d.status==="success"){ee(),Y.success(`Signed in with ${C.displayName}`);return}W(S=>S&&{...S,message:d.error||"Waiting for approval..."})}catch(d){Y.error(d instanceof Error?d.message:"Failed to check status")}finally{q(!1)}}},[L,C,A,ee]),ns=C?.supportedAuthTypes.includes("device-code")??!1,rs=d=>{c(d);const S=s.find(ue=>ue.slug===d);S&&(N(S.slug),y(S.displayName),P(S.baseUrl),k(S.slug===t&&r?r:S.defaultModel??""),R(S.apiKeyPlaceholder),O(n&&te(S)?"oauth":"api-key"),f(""),W(null),ge(!1))},be=/^[a-z0-9][a-z0-9-]*$/.test(j),Ce=be&&Ne&&E.trim().length>0&&!h.isPending,is=d=>{if(d.preventDefault(),!Ce)return;const S={};b.trim()&&(S.base_url=b.trim()),w.trim()&&(S.model=w.trim());const ue=Object.keys(S).length>0?{text:S}:void 0;h.mutate({slug:j.trim(),kind:u,displayName:m.trim()||void 0,apiKey:E.trim(),capabilities:ue},{onSuccess:()=>i()})},ke=!!(t&&s.some(d=>d.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ke&&C?`Connect ${C.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:is,className:"grid max-w-md gap-3",children:[ke&&C?e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(Le,{value:u,onValueChange:rs,children:[e.jsx(Re,{id:"ip-provider",className:"w-full",children:e.jsx(Oe,{})}),e.jsx(Be,{children:s.map(d=>{const S=we(d.modalities);return e.jsx(Ke,{value:d.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[d.iconUrl?e.jsx("img",{src:d.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(ms,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.displayName,S.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",S.join(", ")]}):null]})},d.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-display",children:"Name"}),e.jsx(F,{id:"ip-display",placeholder:"Friendly name",value:m,onChange:d=>y(d.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs($,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-slug",placeholder:"my-provider",value:j,onChange:d=>N(d.target.value),autoComplete:"off",required:!0}),j&&!be?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."})]}),je&&ve?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{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:I==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:I==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,Ne?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(F,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:b,onChange:d=>P(d.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($,{htmlFor:"ip-model",children:"Default model"}),e.jsx(F,{id:"ip-model",placeholder:"gpt-4o-mini",value:w,onChange:d=>k(d.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs($,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-key",type:"password",placeholder:z||void 0,value:E,onChange:d=>_(d.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(H,{onCancel:i,children:e.jsx(g,{type:"submit",disabled:!Ce,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ye?e.jsxs("div",{className:"grid gap-3",children:[fe?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",C?.displayName??"provider",". This covers your agents in this org."]}):ns?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ts(),disabled:T||!L,children:A?"Get a new code":"Get device code"}),A?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(F,{id:"ip-device-code",readOnly:!0,value:A.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:A.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",C?.displayName??"provider"," to approve",e.jsx(Se,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A.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 as(),disabled:T,children:T?"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 es(),disabled:T||!L,children:["Sign in with ",C?.displayName??"provider",e.jsx(Se,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(F,{id:"ip-oauth-code",placeholder:"code#state",value:v,onChange:d=>f(d.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void ss(),disabled:T||!v.trim(),children:T?"Finishing...":"Finish sign-in"})]}),e.jsx(H,{onCancel:i,children:e.jsx(g,{type:"button",onClick:Je,disabled:!fe,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(H,{onCancel:i})]})]})]})}const tt={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function at({provider:s,catalog:t,autoOpenEdit:a}){const n=hs(),[r,i]=p.useState(a?"edit":null),h=xs(s.kind,t);p.useEffect(()=>{a&&i("edit")},[a]);const l=(t.find(c=>c.slug===s.kind)?.modalities??["text"]).filter(c=>c!=="text"),x=h&&l.length>0,u=c=>i(j=>j===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 ${ps(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(rt,{provider:s,supportsUpstreamConfig:h,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."})]}),l.map(c=>e.jsx(it,{providerSlug:s.slug,modality:c,block:s.capabilities[c]??{}},c))]})}):null]})}function nt({provider:s,onDeleted:t}){const a=fs(),[n,r]=p.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(V,{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(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function rt({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=gs(),r=js(),i=Ue(),[h,o]=p.useState(s.displayName??""),[l,x]=p.useState(""),u=s.capabilities.text??{},[c,j]=p.useState(u.base_url??""),[N,m]=p.useState(u.model??""),[y,b]=p.useState(null),P=h.trim().length>0&&h.trim()!==(s.displayName??""),w=t&&l.trim().length>0,k=c.trim()!==(u.base_url??""),E=N.trim()!==(u.model??""),_=t&&(k||E),z={base_url:c.trim()||void 0,model:N.trim()||void 0,models_endpoint:u.models_endpoint},R=Ie(z),I=t&&_&&ze(R),O=n.isPending||r.isPending||i.isPending,v=(P||w||_)&&!I&&!O,f=async A=>{if(A.preventDefault(),!!v){b(null);try{await Promise.all([P?n.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),_?i.mutateAsync({providerSlug:s.slug,modality:"text",block:z}):Promise.resolve(),w?r.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{b("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:f,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(F,{id:`edit-name-${s.slug}`,value:h,onChange:A=>o(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($,{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=>j(A.target.value),autoComplete:"off"}),R.base_url?e.jsx("p",{className:"text-xs text-destructive",children:R.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(F,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:A=>m(A.target.value),autoComplete:"off"}),R.model?e.jsx("p",{className:"text-xs text-destructive",children:R.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(F,{id:`edit-key-${s.slug}`,type:"password",value:l,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,y?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:y}):null,e.jsx(H,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!v,children:O?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function it({providerSlug:s,modality:t,block:a}){const n=Ue(),[r,i]=p.useState(!1),[h,o]=p.useState(a.base_url??""),[l,x]=p.useState(a.model??""),[u,c]=p.useState(a.models_endpoint??""),[j,N]=p.useState(!!a.models_endpoint),m=!!(a.base_url||a.model||a.models_endpoint),y={base_url:h.trim()||void 0,model:l.trim()||void 0,models_endpoint:u.trim()||void 0},b=Ie(y),P=ze(b),w=()=>{P||n.mutate({providerSlug:s,modality:t,block:y})};return e.jsxs("div",{className:ne,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:tt[t]}),m?e.jsx(U,{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($,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(F,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:h,onChange:k=>o(k.target.value),autoComplete:"off"}),b.base_url?e.jsx("p",{className:"text-xs text-destructive",children:b.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(F,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:k=>x(k.target.value),autoComplete:"off"}),b.model?e.jsx("p",{className:"text-xs text-destructive",children:b.model}):null]}),j?e.jsxs("div",{className:"grid gap-2",children:[e.jsx($,{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"}),b.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:b.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:()=>N(!0),children:"Advanced"}),e.jsx(H,{onCancel:()=>i(!1),children:e.jsx(g,{size:"sm",disabled:P||n.isPending,onClick:w,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function lt({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(ct,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(U,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(U,{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(U,{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(de,{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 ot({sandbox:s,onDeleted:t}){const a=vs(),[n,r]=p.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(xe,{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(V,{}):"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 ct({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(ys,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ns,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const dt={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},ut={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function It(){const{owner:s,connectorKey:t}=Q.useParams(),{instances:a}=Q.useSearch(),{kind:n,id:r}=Us(t);return e.jsx(Is,{owner:s,children:({ownerSlug:i,organizationId:h,isWorkspaceLoading:o})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(et,{ownerSlug:i,familyKind:n,familyId:r});switch(n){case"inference":return e.jsx(xt,{ownerSlug:i,providerSlug:r});case"sandbox":return e.jsx(ht,{ownerSlug:i,sandboxId:r});case"sandbox-provider":return e.jsx(mt,{ownerSlug:i,providerKind:r});default:return e.jsx(jt,{ownerSlug:i,organizationId:h,isWorkspaceLoading:o,connectorKey:t})}}})}function mt({ownerSlug:s,providerKind:t}){const a=G();return p.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${he}${t}`},replace:!0})},[a,s,t]),null}function ht({ownerSlug:s,sandboxId:t}){const a=G(),{data:n,isLoading:r,isError:i,refetch:h}=Ee(),o=n?.sandboxes.find(x=>x.id===t)??null;if(r)return e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-24 w-full rounded-lg"})]});if(i)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(g,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!o)return e.jsxs(M,{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 l=o.name||me(o.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors"),e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${he}${o.providerKind}`},search:{instances:!0},className:X,children:me(o.providerKind)},"family")]}),icon:e.jsx(pe,{name:l,faviconDomain:Xs(o.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"secondary",children:o.providerKind}),o.connected?e.jsx(U,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(U,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Ge,{facets:ut})}),children:[e.jsx(lt,{sandbox:o}),e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(ot,{sandbox:o,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function xt({ownerSlug:s,providerSlug:t}){const a=G(),{model:n,reason:r,agentId:i,addAccount:h}=Q.useSearch(),{data:o=[],isLoading:l,isError:x,refetch:u}=Pe(),c=De(),{data:j=[],isLoading:N}=c,m=h?null:o.find(E=>E.slug===t)??null,y=j.find(E=>E.slug===(m?.kind??t))??null;if(l||N)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(x)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(g,{variant:"outline",onClick:()=>void u(),children:"Retry"})]})});if(!m&&!y&&!c.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Xe,{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 b=m?m.displayName||m.slug:y?.displayName||t,P=m!==null,w=r?e.jsx(gt,{agentId:i,model:n,providerName:b}):n?e.jsx(ft,{providerName:b,model:n,isConnected:P}):null,k=e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:X,children:"Connectors"},"connectors"),...m?[e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${m.kind}`},search:{instances:!0},className:X,children:y?.displayName??m.kind},"family")]:[]]}),icon:e.jsx(pe,{iconUrl:y?.iconUrl,name:b}),title:b,badge:m?e.jsxs(e.Fragment,{children:[m.isDefault?e.jsx(U,{variant:"secondary",children:"Default"}):null,m.status?e.jsx(U,{variant:"outline",children:m.status}):null,m.hasCustomUpstream?e.jsx(U,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Ge,{facets:dt})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:k,children:[w,e.jsx("div",{className:"space-y-6",children:m?e.jsx(at,{provider:m,catalog:j,autoOpenEdit:!!n}):e.jsx(pt,{ownerSlug:s,providerSlug:t,existingSlugs:o.map(E=>E.slug),catalog:j,catalogError:c.isError?c.error:null,model:n})}),m?e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(nt,{provider:m,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function pt({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:r,model:i}){const h=G(),o=n.find(u=>u.slug===t),l=a.includes(t)&&!!o&&te(o);let x=t;for(let u=2;a.includes(x);u++)x=`${t}-${u}`;return r?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(de,{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:r instanceof Error?r.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${t}`},search:{},children:"Open existing connection"})})]}),(!l||o&&Fe(o))&&e.jsx(st,{catalog:n,initialProvider:t,initialSlug:x,allowOAuth:!l,initialModel:i?.includes("/")?i.split("/").slice(1).join("/"):i,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function ft({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(de,{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 gt({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(de,{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 jt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:r=[],isLoading:i,isError:h,refetch:o}=Vs(t??""),{data:l=[],isLoading:x,isError:u,refetch:c}=Ws(t??"",{connectorKey:n}),j=p.useMemo(()=>r.find(y=>y.key===n),[r,n]),N=p.useMemo(()=>Ys(n,r,{name:l[0]?.connector_name??n}),[n,r,l]);if(a||i)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"h-6 w-6 rounded"}),e.jsx(D,{className:"h-5 w-40"})]}),e.jsx(D,{className:"h-16 w-full rounded-lg"}),e.jsx(D,{className:"h-24 w-full rounded-lg"}),e.jsx(D,{className:"h-32 w-full rounded-lg"})]})});if(h||u)return e.jsx(M,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(g,{variant:"outline",onClick:()=>{o(),c()},children:"Retry"})]})});const m=j?e.jsx(yt,{connector:j,ownerSlug:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Xe,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",l.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:j&&t?e.jsx(vt,{hero:m,connector:j,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:x,refetchConnections:c}):e.jsxs(M,{className:"space-y-6",children:[m,l.length>0&&!x?e.jsx(He,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):e.jsx(Qe,{organizationId:t??"",ownerSlug:s,connectorKey:n,connections:l,isLoading:x})]})})}function vt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}){const{isAdmin:l,isLoading:x}=Z(a),u=(t.operations_summary?.total??0)>0;return e.jsxs(le,{header:s,children:[e.jsx(bs,{organizationId:a,connectorKey:r}),e.jsx(At,{connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}),i.length>0?e.jsx(He,{section:!0,connections:i,connector:t,ownerSlug:n,connectorKey:r}):null,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(St,{connector:t,organizationId:a,ownerSlug:n}),u&&x?e.jsx(D,{className:"h-20 w-full rounded-lg"}):u&&l?e.jsx(Ct,{connector:t,organizationId:a,ownerSlug:n}):u&&!l?e.jsx(B,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(Nt,{connector:t,organizationId:a,ownerSlug:n,connectionCount:i.length}),!h&&i.length>0?e.jsx(B,{title:"Recent activity",children:e.jsx(Js,{scope:{connectorKey:r},ownerSlug:n})}):null]})}function yt({connector:s,ownerSlug:t}){return e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:t},className:X,children:"Connectors"},"connectors")]}),icon:e.jsx(pe,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Hs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsx(Zs,{connectorDef:s,ownerSlug:t}),caption:s.description})}function Nt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Te(s.auth_schema),i=zs(s.auth_schema),h=r.find(w=>w.type==="oauth"),o=We(s.auth_schema),l=r.some(w=>w.type==="env_keys"),x=r.some(w=>w.type==="browser"),u=i.some(w=>w.type==="interactive"),c=!!(h||o||l||x),j=Ms(s),{isAdmin:N}=Z(t),{data:m=[]}=ie(t,{connectorKey:s.key,profileKind:"env"}),{data:y=[]}=ie(t,{profileKind:"browser_session",connectorKey:s.key}),b=N&&s.installed!==!1;return!!(h||o)||l&&m.length>0||x&&y.length>0||!c||b?e.jsxs("div",{className:"space-y-6",children:[h?e.jsx(kt,{connector:s,organizationId:t,oauthMethod:h}):null,o?e.jsx(B,{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(Ye,{organizationId:t,connectorKey:s.key,provider:o.provider,providerLabel:s.name,installShape:o.installShape,variant:"outline"})]})}):null,l&&m.length>0?e.jsx($e,{profiles:m,type:"env"}):null,x&&y.length>0?e.jsx($e,{profiles:y,type:"browser_session"}):null,c?null:j?e.jsx(B,{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(K,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):u?e.jsx(B,{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(B,{title:"Authentication",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector doesn't need workspace credentials. Create a connection above to get started."})}),e.jsx(bt,{connector:s,organizationId:t,ownerSlug:a,connectionCount:n})]}):null}function bt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=G(),{isAdmin:i}=Z(t),h=Gs(),[o,l]=p.useState(!1),[x,u]=p.useState(null),c=s.installed!==!1;if(!i||!c)return null;const j=n>0,N=h.isPending,m=()=>{u(null),h.mutate({connector_key:s.key},{onSuccess:()=>{r({to:"/$owner/connectors",params:{owner:a}})},onError:y=>{u(y instanceof Error?y.message:"Failed to remove connector"),l(!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."]}),j?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:o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:N,onClick:m,children:[N?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Confirm remove"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:N,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:N||j,onClick:()=>l(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove connector"]})})]})}function Ct({connector:s,organizationId:t,ownerSlug:a}){const n=qe();return e.jsx(Ve,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function kt({connector:s,organizationId:t,oauthMethod:a}){const{isAdmin:n,isLoading:r}=Z(t),{setup:i}=Q.useSearch(),h=Q.useNavigate(),{data:o=[],refetch:l,isLoading:x,isError:u}=ie(t,{connectorKey:s.key,provider:a.provider}),c=o.filter(j=>j.profile_kind==="oauth_app");return r||x?e.jsx(D,{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(wt,{connector:s,oauthMethod:a,appProfiles:c,isAdmin:n,initialOpen:i==="oauth_app",onClose:()=>{i==="oauth_app"&&h({search:j=>({...j,setup:void 0}),hash:"",replace:!0})},refetchProfiles:l})}function wt({initialOpen:s=!1,onClose:t,connector:a,oauthMethod:n,appProfiles:r,isAdmin:i,refetchProfiles:h}){const o=Ps(),l=Ds(),[x,u]=se(a.key,s&&i),[c,j]=p.useState(!1);p.useEffect(()=>{s&&i&&u(!0)},[s,i,u]);const N=`${Es()}/connect/oauth/callback`,[m,y]=se(a.key,`${a.name} OAuth App`),[b,P]=se(a.key,""),[w,k]=se(a.key,null),E=Fs(n),_=Ls(`${a.key}:${x}`,Rs(E),E),{values:z,setValues:R}=_,I=r.find(v=>v.is_default_for_connector&&v.connector_key===a.key),O=()=>{_.canSubmit&&(k(null),o.mutate({connector_key:a.key,profile_kind:"oauth_app",display_name:m.trim()||`${a.name} OAuth App`,slug:b.trim()||void 0,credentials:Pt(qs(z))},{onSuccess:v=>{const f=v.auth_profile?.slug;f&&!I&&l.mutate({connector_key:a.key,auth_profile_slug:f}),u(!1),t?.(),y(`${a.name} OAuth App`),P(""),h()},onError:v=>{k(v instanceof Error?v.message:"Failed to add OAuth app")}}))};return e.jsxs(B,{id:"connector-oauth-apps",title:`${$t(n.provider)} app configuration`,action:i&&!x?e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[e.jsx(Me,{className:"size-3.5"}),"Add OAuth app"]}):null,children:[i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx($,{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:N}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(N).then(()=>j(!0)).catch(()=>k("Could not copy the callback URL. Select and copy it above."))},children:[e.jsx(Os,{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(v=>e.jsxs("div",{className:re(ne,"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:v.display_name}),v.is_default_for_connector&&v.connector_key===a.key?e.jsx(U,{variant:"secondary",className:"text-[10px]",children:"Default"}):null,e.jsx(Ze,{status:v.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:v.slug})]}),i&&!v.is_default_for_connector&&v.connector_key===a.key&&v.status==="active"?e.jsx(g,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate({connector_key:a.key,auth_profile_slug:v.slug}),children:"Set default"}):null]},v.slug))}),i&&x?e.jsxs("div",{className:re(ne,"space-y-3 p-3"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{htmlFor:"oauth-app-name",children:"Display name"}),e.jsx(F,{id:"oauth-app-name",value:m,onChange:v=>y(v.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx($,{htmlFor:"oauth-app-slug",children:"Slug"}),e.jsx(F,{id:"oauth-app-slug",placeholder:"optional",value:b,onChange:v=>P(v.target.value)})]}),e.jsx(Bs,{schema:_.revision??void 0,values:z,onValuesChange:R,fieldIdPrefix:"oauth-app-"}),e.jsx(Ks,{visible:_.hasConflict,onReload:_.reset}),w?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>{u(!1),t?.()},children:"Cancel"}),e.jsxs(g,{size:"sm",disabled:o.isPending||!_.canSubmit,onClick:O,children:[o.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Save OAuth app"]})]})]}):null]})}function At({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i,refetchConnections:h}){const l=Te(s.auth_schema).find(N=>N.type==="oauth"),{data:x=[],refetch:u,isLoading:c,isError:j}=ie(t,{connectorKey:s.key,provider:l?.provider});if(l){if(j)return e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load accounts. Reload the page to try again."});const N=x.filter(y=>y.profile_kind==="oauth_app"),m=x.filter(y=>y.profile_kind==="oauth_account");return e.jsx(_t,{connector:s,organizationId:t,oauthMethod:l,appProfiles:N,accounts:m,connections:r,isLoading:i||c,refetchProfiles:u,refetchConnections:h})}return e.jsx(Qe,{connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i})}function _t({connector:s,organizationId:t,oauthMethod:a,appProfiles:n,accounts:r,connections:i,isLoading:h,refetchProfiles:o,refetchConnections:l}){const{session:x}=Cs(),{isAdmin:u,isLoading:c}=Z(t),j=ks(),N=ws(),m=As(),[y,b]=p.useState(""),[P,w]=p.useState([]),k=n.filter(f=>f.status==="active"),E=k.find(f=>f.is_default_for_connector&&f.connector_key===s.key),_=(u?k.find(f=>f.slug===y):void 0)??E??(u&&k.length===1?k[0]:void 0),z=new Set(i.map(f=>f.auth_profile_slug)),R=r.filter(f=>f.created_by===x?.user?.id),I=R.filter(f=>!z.has(f.slug)),O=!i.some(f=>f.created_by===x?.user?.id)&&R.length===0;if(h||c||!x?.user?.id||!O&&I.length===0&&!m.error&&!m.continueUrl)return null;const v=f=>m.begin(async()=>{const A=await j.mutateAsync({connector_key:s.key,app_auth_profile_slug:f,requested_scopes:Ts(a,P)});return o(),l(),A});return e.jsxs(B,{title:O?"Connect your account":"Your accounts",children:[O&&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($,{children:"App used for this account"}),e.jsxs(Le,{value:_?.slug??"",onValueChange:b,children:[e.jsx(Re,{"aria-label":"App used for this account",children:e.jsx(Oe,{placeholder:"Choose an OAuth app"})}),e.jsx(Be,{children:k.map(f=>e.jsxs(Ke,{value:f.slug,children:[f.display_name,f.is_default_for_connector&&f.connector_key===s.key?" (workspace default)":""]},f.slug))})]})]}):_?e.jsxs("p",{className:"text-sm",children:["App: ",_.display_name,_.is_default_for_connector&&_.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."}),_&&e.jsx(_s,{requiredScopes:$s(a),optionalScopes:Ss(a),selectedOptionalScopes:P,onToggleOptionalScope:(f,A)=>w(W=>A?[...new Set([...W,f])]:W.filter(T=>T!==f))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{size:"sm",disabled:!_||m.pending,onClick:()=>{_&&v(_.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"})})]})]}),I.map(f=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2",children:[e.jsx("span",{className:"text-sm",children:f.display_name}),e.jsx(g,{variant:"outline",size:"sm",disabled:m.pending,onClick:()=>void m.begin(()=>f.status==="active"?j.mutateAsync({connector_key:s.key,auth_profile_slug:f.slug}):N.mutateAsync({auth_profile_slug:f.slug})),children:f.status==="active"?"Use this account":"Reconnect"})]},f.slug)),m.error&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m.error}),m.continueUrl&&e.jsx("a",{href:m.continueUrl,target:"_blank",rel:"noreferrer",className:"text-sm underline",children:"Continue authorization in your browser"})]})}function $e({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(B,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:re(ne,"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 St({connector:s,organizationId:t,ownerSlug:a}){const n=qe(),r=Object.keys(s.feeds_schema??{}).length;return r?e.jsx(Ve,{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 Qe({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i}){const h=G(),o=We(s?.auth_schema);if(i)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(D,{className:"h-4 w-24"}),e.jsx(D,{className:"h-16 w-full rounded-lg"})]});if(r.length===0){const l=s&&o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ye,{organizationId:t,connectorKey:n,provider:o.provider,providerLabel:s.name,installShape:o.installShape,size:"default",label:`Install ${s.name}`}),e.jsx(g,{asChild:!0,variant:"outline",children:e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n},children:"Use your own app"})})]}):e.jsxs(g,{size:"default",onClick:()=>h({to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n}}),children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Create connection"]});return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:l})}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:re("text-xs",t),children:["· ",s]})}function $t(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Pt(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{vt as ConnectorDetailShell,_t as OAuthAccountsSection,wt as OAuthAppProfilesSection,It as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey.index-clVDIyW0.js.map
|
package/dist/owletto/dist/assets/{_conversationId-CEhxlTIo.js → _conversationId-Ci2k-BuN.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,dW as M,P as h,
|
|
2
|
-
//# sourceMappingURL=_conversationId-
|
|
1
|
+
import{j as e,dW as M,P as h,iA as w,r as j,t as z,cN as C,iB as N}from"./index-Cr5hwh-C.js";import{A as k}from"./agent-loading-shells-Dqcvky-k.js";import{s as b,R as y,A as L}from"./agent-thread-BJOijbT0.js";import"./app-bridge-BCm4muqj.js";import"./use-mention-search-By8RZyKW.js";import"./index-Vcq4gwWv.js";import"./events-feed-BtvhZF1f.js";import"./conversations-table-BdXoZAfc.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./clients-D3Zbjxin.js";const m={path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z",hex:"5865F2"},p={path:"M1.637 0C.733 0 0 .733 0 1.637v16.5c0 .904.733 1.636 1.637 1.636h3.955v3.323c0 .804.97 1.207 1.539.638l3.963-3.96h11.27c.903 0 1.636-.733 1.636-1.637V5.592L18.408 0Zm3.955 5.592h12.816v8.59H8.455l-2.863 2.863Z",hex:"34A853"},d={path:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z",hex:"26A5E4"},x={path:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z",hex:"25D366"},O={discord:{hex:`#${m.hex}`,path:m.path},gchat:{hex:`#${p.hex}`,path:p.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${d.hex}`,path:d.path},whatsapp:{hex:`#${x.hex}`,path:x.path}};function T({platform:s,className:t}){const a=s?O[s]:null;return a?"imgSrc"in a?e.jsx("img",{src:a.imgSrc,alt:"","aria-hidden":"true",className:h("rounded-sm",t),loading:"lazy"}):e.jsx("svg",{viewBox:a.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:t,style:{color:a.hex},children:e.jsx("path",{d:a.path})}):e.jsx(M,{className:h("text-muted-foreground",t),"aria-hidden":"true"})}const I={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function P(s,t,a){return s==="slack"&&a?.teamId&&t?`https://app.slack.com/client/${a.teamId}/${t}`:null}function R({owner:s,agentId:t,conversationId:a}){const{data:n=[],isLoading:u}=w(t,a,{orgSlug:s}),c=j.useMemo(()=>n.map(r=>b(r,{showToolCalls:!0})).filter(r=>r!==null),[n]),[o,g]=a.split(":"),i=I[o]??"the source app",{org:f}=z(),{data:A=[]}=C(f?.id??"",{connectorKey:o}),v=A[0]?.config?.chatMetadata,l=P(o,g,v);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:u?e.jsx(k,{readOnly:!0}):c.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(y,{messages:c,children:e.jsx(L,{readOnly:!0})}),l?e.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm transition-colors hover:bg-muted",children:[e.jsx(T,{platform:o,className:"size-5 shrink-0"}),e.jsxs("span",{className:"text-muted-foreground",children:["This is a read-only copy. Continue the conversation with this agent in ",i,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",i," →"]})]}):null]})})}function q(){const{owner:s,agentId:t,conversationId:a}=N.useParams();return e.jsx(R,{owner:s,agentId:t,conversationId:a})}export{q as component};
|
|
2
|
+
//# sourceMappingURL=_conversationId-Ci2k-BuN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,L as h,gj as f,bx as g,bK as j,aQ as d,
|
|
2
|
-
//# sourceMappingURL=_deploymentId-
|
|
1
|
+
import{j as e,L as h,gj as f,bx as g,bK as j,aQ as d,gX as y,gW as N,dt as m,bc as o,M as b,P as v,ae as D,gA as w,bH as S,i3 as A}from"./index-Cr5hwh-C.js";import{c as x,d as C}from"./deployments-body-BMp7UsMo.js";import{J as I}from"./json-diff-DBoag_OS.js";import{b as B,a as L}from"./deployments-RvUdVkj3.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";const c="change-";function k({owner:t,deploymentId:s}){const a=s.startsWith(c),r=B(a?null:s),l=L(a?s.slice(c.length):null),i=a?l:r;return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs(h,{to:"/$owner/connectors/deployments",params:{owner:t},className:"inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(f,{className:"h-3 w-3"}),"All deployments"]}),i.isLoading?e.jsx(g,{label:"deployment",variant:"panel"}):i.isError?e.jsx(j,{label:"deployment"}):a?l.data?e.jsx(E,{change:l.data}):e.jsx(d,{icon:y,title:"Change not found",description:"This config change is not in the audit trail, or the server predates the deployments API."}):r.data?e.jsx($,{detail:r.data}):e.jsx(d,{icon:N,title:"Deployment not found",description:"This apply run is not in the audit trail, or the server predates the deployments API."})]})}function $({detail:t}){const{deployment:s,changes:a}=t;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("h2",{className:"text-lg font-semibold",children:["Deployment ",s.applyId?.slice(4,12)??s.id]}),C(s.status),s.gitDirty?e.jsx(b,{variant:"outline",children:"Dirty working tree"}):null]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[m(s.createdAt)," (",o(s.createdAt),")",s.createdBy?` · by ${s.createdBy}`:""]}),e.jsxs("dl",{className:"grid gap-1.5 text-xs",children:[s.applyId?e.jsx(n,{label:"Apply id",value:s.applyId,copyable:!0}):null,s.manifestHash?e.jsx(n,{label:"Manifest hash",value:s.manifestHash,copyable:!0}):null,s.gitSha?e.jsx(n,{label:"Git SHA",value:s.gitDirty?`${s.gitSha} (dirty)`:s.gitSha,copyValue:s.gitSha,copyable:!0}):null,s.cliVersion?e.jsx(n,{label:"CLI version",value:s.cliVersion,copyable:!0}):null]}),s.status==="partial_failure"&&s.error?e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:s.error}):null]}),s.gitSha?e.jsxs("section",{className:v(D,"space-y-2 p-4"),children:[e.jsx("p",{className:"text-sm font-medium",children:"Rollback"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Rollback is git-first: revert the commit that produced this deployment, then re-apply."}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"font-mono text-xs",children:["git revert ",s.gitSha," && lobu apply"]}),e.jsx(p,{value:`git revert ${s.gitSha} && lobu apply`,label:"rollback command"})]})]}):null,e.jsxs("section",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-sm font-medium",children:["Changes",e.jsx("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:a.length})]}),a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No config changes in this apply run."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:a.map((r,l)=>e.jsx(u,{change:r,isLast:l===a.length-1},r.id))})]})]})}function E({change:t}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("h2",{className:"text-lg font-semibold",children:[t.resourceKind??"config",t.resourceId?e.jsxs("span",{className:"text-muted-foreground",children:[" ",t.resourceId]}):null]}),x(t.op)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[m(t.createdAt)," (",o(t.createdAt),")",t.actorSource?` · via ${t.actorSource}`:"",t.createdBy?` · by ${t.createdBy}`:""]})]}),e.jsx("section",{className:"overflow-hidden rounded-lg border",children:e.jsx(u,{change:t,isLast:!0})})]})}function u({change:t,isLast:s}){return e.jsxs("div",{className:`px-3 py-2.5 ${s?"":"border-b"}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[t.resourceKind??"config",t.resourceId?e.jsxs("span",{className:"text-muted-foreground",children:[" ",t.resourceId]}):null]}),x(t.op),e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:o(t.createdAt)})]}),t.changedFields&&t.changedFields.length>0?e.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:["Changed: ",t.changedFields.join(", ")]}):null,e.jsx(I,{before:t.before,after:t.after})]})}function n({label:t,value:s,copyValue:a,copyable:r}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("dt",{className:"w-24 shrink-0 text-muted-foreground",children:t}),e.jsxs("dd",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("span",{className:"truncate font-mono",children:s}),r?e.jsx(p,{value:a??s,label:t}):null]})]})}function p({value:t,label:s}){return e.jsx("button",{type:"button","aria-label":`Copy ${s}`,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>{navigator.clipboard.writeText(t),S.success("Copied to clipboard")},children:e.jsx(w,{className:"h-3 w-3"})})}function K(){const{owner:t,deploymentId:s}=A.useParams();return e.jsx(k,{owner:t,deploymentId:s})}export{K as component};
|
|
2
|
+
//# sourceMappingURL=_deploymentId-BuUzGtVL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as u,m as v,j as t,ah as x,bZ as d,b_ as f,b$ as h,bm as w,c0 as j}from"./index-
|
|
2
|
-
//# sourceMappingURL=_eventId-
|
|
1
|
+
import{v as u,m as v,j as t,ah as x,bZ as d,b_ as f,b$ as h,bm as w,c0 as j}from"./index-Cr5hwh-C.js";import{E as P}from"./event-detail-ve2d6Gbb.js";import"./events-feed-BtvhZF1f.js";import"./conversations-table-BdXoZAfc.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./clients-D3Zbjxin.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./filter-editors-Cj-v6NtH.js";function g({owner:e,eventId:a,viewKey:r}){const o=u({strict:!1}),i=v(),m=(n,s)=>t.jsx(P,{owner:s,organizationId:n,eventId:a,viewKey:r,params:r?f(o):{},onParamsChange:(l,p,c)=>void i({to:d(s,a,l),search:p,replace:c?.replace??!0}),fullBleed:!0},`${s}/${a}`);return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:e==="me"?m(null,e):t.jsx(x,{owner:e,children:({organizationId:n,ownerSlug:s})=>n?m(n,s):t.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function D(){const{owner:e,eventId:a}=h.useParams(),r=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(a);return o===null?null:t.jsx(g,{owner:e,eventId:o,viewKey:r?.viewKey})}export{D as component};
|
|
2
|
+
//# sourceMappingURL=_eventId-B0662F8h.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iz as a,j as e}from"./index-Cr5hwh-C.js";import{b as i}from"./agent-guardrails-route-BOrCXcAl.js";import"./model-selector-dAbDgJvx.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function l(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{l as component};
|
|
2
|
+
//# sourceMappingURL=_name-CwWePlOl.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-
|
|
2
|
-
import{u as f,a as h,j as e,p as m,r as x,D as p,b as g,c as k,d as w,e as j,B as c,C as b,L as v,A as y,X as N,l as P,_ as R,S as d,R as E,f as S,g as z,i as L,h as C,N as D,O}from"./index-
|
|
3
|
-
//# sourceMappingURL=_owner-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-CHoQHe2H.js","assets/index-Cr5hwh-C.js","assets/index-BLEcy9-T.css","assets/automation-detail-content-vUwVumXf.js","assets/create-automation-form-CtSSeYj3.js","assets/cronstrue-n4qGUraE.js","assets/entity-options-uXjgT7y9.js","assets/connection-label-BobuYiAG.js","assets/model-selector-dAbDgJvx.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-DHeyRGZI.js","assets/index-CDz3-ieP.js","assets/index-Vcq4gwWv.js","assets/use-mention-search-By8RZyKW.js","assets/proposal-review-shell-UcZr87_Q.js","assets/runs-C0rCgGwX.js","assets/json-diff-DBoag_OS.js","assets/deployments-RvUdVkj3.js","assets/events-feed-BtvhZF1f.js","assets/conversations-table-BdXoZAfc.js","assets/renderer-mEDnVW0O.js","assets/card-Djgp00r_.js","assets/clients-D3Zbjxin.js","assets/agent-loading-shells-Dqcvky-k.js","assets/agent-thread-BJOijbT0.js","assets/app-bridge-BCm4muqj.js","assets/connection-feed-detail-CIJJLDP8.js","assets/runs-table-syPJ6r6T.js","assets/connector-scope-lists-CadPVsI3.js","assets/status-dot-B-EWMgq6.js","assets/connections-browser-CKZjzRz6.js","assets/source-record-panels-CPyzlfD1.js","assets/event-detail-ve2d6Gbb.js","assets/view-param-filters-CqLZQrnO.js","assets/filter-editors-Cj-v6NtH.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as f,a as h,j as e,p as m,r as x,D as p,b as g,c as k,d as w,e as j,B as c,C as b,L as v,A as y,X as N,l as P,_ as R,S as d,R as E,f as S,g as z,i as L,h as C,N as D,O}from"./index-Cr5hwh-C.js";const _=P(async()=>({default:(await R(async()=>{const{PeekPaneContent:a}=await import("./peek-pane-content-CHoQHe2H.js");return{PeekPaneContent:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))).PeekPaneContent}));function A(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(d,{className:"h-5 w-2/3"}),e.jsx(d,{className:"h-4 w-full"}),e.jsx(d,{className:"h-24 w-full rounded-lg"})]})}function I(){const a=f(),s=h();return a?.item?e.jsx(B,{item:a.item,onClose:a.close,onBack:a.back,isNarrow:s}):null}function B({item:a,onClose:s,onBack:o,isNarrow:t}){const r=a.href?m(a.href):null;x.useEffect(()=>{if(t)return;const n=u=>{u.key==="Escape"&&(u.preventDefault(),s())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[s,t]);const i=n=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[o||n?e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:o??s,children:e.jsx(b,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:a.title}),r?e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:e.jsx(v,{to:r.pathname,search:r.search??{},onClick:s,children:e.jsx(y,{className:"h-4 w-4"})})}):null,e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:s,children:e.jsx(N,{className:"h-4 w-4"})})]}),l=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(x.Suspense,{fallback:e.jsx(A,{}),children:e.jsx(_,{item:a})})});return t?e.jsx(p,{open:!0,onOpenChange:n=>{n||s()},children:e.jsxs(g,{children:[e.jsx(k,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(w,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(j,{className:"sr-only",children:a.title}),i(!0),l]})]})}):e.jsxs("aside",{className:"flex w-[460px] max-w-[45vw] shrink-0 flex-col border-l border-border bg-background",children:[i(!1),l]})}function W(){const{owner:a}=E.useParams(),{data:s,isLoading:o,error:t}=S(a==="me"?null:a,{slug:a}),{session:r,isReady:i}=z(),l=L(t)&&!s?.workspace;return C({active:!o&&!l&&i&&!r&&!s?.workspace,owner:a})?null:e.jsx(D,{children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e.jsx(O,{})}),e.jsx(I,{})]})})}export{W as component};
|
|
3
|
+
//# sourceMappingURL=_owner-dTWkrKsK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{im as p,j as e,bl as m}from"./index-Cr5hwh-C.js";import{M as i}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function d(){const{owner:t,entityType:o,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:t,typeScope:m(o),create:!1,shape:r})}export{d as component};
|
|
2
|
+
//# sourceMappingURL=_shape-BtS3y4M9.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ix as r,j as e}from"./index-Cr5hwh-C.js";import{b as m}from"./agent-skills-route-BUxIswuq.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-skill-context-CCdvtlmH.js";import"./core.esm-CYvgWCuv.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function c(){const{owner:t,agentId:o,skillKey:i}=r.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:i})}export{c as component};
|
|
2
|
+
//# sourceMappingURL=_skillKey-Dc9m-nlR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{fK as l,k as x,m as d,em as y,ch as c,j as t,bx as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=_slug-
|
|
1
|
+
import{fK as l,k as x,m as d,em as y,ch as c,j as t,bx as g}from"./index-Cr5hwh-C.js";import{E as u}from"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";function N(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=x(),o=d(),{data:i=[],isLoading:r}=y(s),e=i.find(p=>p.slug===n)??null,m=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 py-6 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:r?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:m,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{N as component};
|
|
2
|
+
//# sourceMappingURL=_slug-DQHutM41.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iC as e,j as i,bl as p}from"./index-Cr5hwh-C.js";import{M as m}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function M(){const{owner:t,entityType:o,viewKey:r}=e.useParams();return i.jsx(m,{ownerSlug:t,typeScope:p(o),create:!1,viewKey:r})}export{M as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-B30ik8ma.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iu as t,j as m}from"./index-Cr5hwh-C.js";import{M as i}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function R(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{R as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-CUHypQnF.js.map
|
package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-w17IFTtf.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as l,a9 as u,r as c,H as m,j as e,aa as d,ab as h,ac as f,Z as v,ad as x,a7 as g}from"./index-
|
|
2
|
-
//# sourceMappingURL=accept-invitation-
|
|
1
|
+
import{g as l,a9 as u,r as c,H as m,j as e,aa as d,ab as h,ac as f,Z as v,ad as x,a7 as g}from"./index-Cr5hwh-C.js";import{F as p}from"./full-page-spinner-DqpH99np.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function b(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
|
|
2
|
+
//# sourceMappingURL=accept-invitation-w17IFTtf.js.map
|
package/dist/owletto/dist/assets/{activity-route-view-DQglkhXU.js → activity-route-view-CMqYiiKM.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c3 as K,j as e,c4 as Q,r as _,k as q,t as D,a as H,c5 as J,P as c,L as d,bl as N,an as U,c6 as X,c7 as Y,aj as Z,bx as A,aQ as E,c8 as S,B,be as ee,bh as te,c9 as ne,ah as se,ca as oe}from"./index-
|
|
2
|
-
//# sourceMappingURL=activity-route-view-
|
|
1
|
+
import{c3 as K,j as e,c4 as Q,r as _,k as q,t as D,a as H,c5 as J,P as c,L as d,bl as N,an as U,c6 as X,c7 as Y,aj as Z,bx as A,aQ as E,c8 as S,B,be as ee,bh as te,c9 as ne,ah as se,ca as oe}from"./index-Cr5hwh-C.js";import{R as ae,E as re,M as ie}from"./record-activity-CBXH6v1d.js";import{M as ce}from"./member-scope-gate-B44INDPY.js";import{P as de}from"./public-shell-ready-DcnlADmj.js";function le(n){const t=K();return e.jsx(xe,{...n,context:t},`${n.ownerSlug}:${n.attentionLens}:${Q(t)}`)}function xe({organizationId:n,ownerSlug:t,typeScope:x,entityScope:o,attentionLens:m=!1,activityTab:f="events",context:a}){const[y,I]=_.useState(m?"relevant":"activity"),r=a?y!=="activity":m,{orgContext:R}=q(),{isMember:T,isLoading:M}=D(),O=T&&!!n,l=H(),i=f==="sessions"&&l,{attentionItems:W}=J(t),k=W.length,u=a?e.jsx("fieldset",{"aria-label":"Activity view",className:c("flex min-w-0 max-w-full items-center gap-1",l&&"justify-center"),children:[["relevant","Relevant here"],["attention","Needs attention"],["activity","All activity"]].map(([s,g])=>e.jsxs("button",{type:"button","aria-pressed":y===s,onClick:()=>I(s),className:"flex min-w-0 items-center justify-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors aria-pressed:bg-muted aria-pressed:text-foreground hover:text-foreground",children:[g,s==="attention"?e.jsx(P,{count:k}):null]},s))}):e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>({...s??{}}),"aria-current":r?void 0:"page",className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r?"text-muted-foreground hover:text-foreground":"bg-muted text-foreground"),children:"All activity"}),e.jsxs(d,{to:"/$owner",params:{owner:t},search:s=>({...s??{}}),"aria-current":r?"page":void 0,className:c("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:["Needs attention",e.jsx(P,{count:k})]})]}),h=x?N(x):void 0,{data:v,isLoading:b,error:z}=U(o?`/${t}/${X(o)}`:r?`/${t}`:"",R),j=o?v?.entity:void 0,F=(o?j?.entity_type??N(o.split("/").at(-2)??""):h)==="$member",L=o!=null&&!b&&(z!=null||v?.entity==null),C=M||b,p=v?.counts,G=p?p.connections>0||p.agents>0:!1,V=O&&!C&&p!=null&&!G,w=!l&&!i&&!L,$=o&&b?e.jsx(A,{label:"Loading record…"}):L?e.jsx(E,{icon:ne,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):j?e.jsx(ae,{ownerSlug:t,filterBarLeading:w?u:void 0,entity:j,organizationId:n}):e.jsx(re,{organizationId:n,ownerSlug:t,filterBarLeading:w?u:void 0,hideSourceFilter:!0,scopedEntityTypes:!o&&h?[h]:void 0});if(r){const s=C?e.jsx(A,{label:"workspace setup",variant:"panel",className:"px-6 py-8"}):V?e.jsx("div",{className:"px-6",children:e.jsx(E,{icon:S,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(B,{asChild:!0,children:e.jsxs(d,{to:"/$owner/connectors/create",params:{owner:t},children:[e.jsx(ee,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(B,{asChild:!0,variant:"outline",children:e.jsxs(d,{to:"/$owner/agents",params:{owner:t},children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})}):e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"Nothing needs attention right now."});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:e.jsx(Y,{context:a,relevant:y==="relevant",owner:t,emptyState:s,tabs:u})})}return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[w?null:e.jsxs("div",{className:c("sticky top-0 z-20 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 bg-background pt-1",l?"justify-center":"justify-between"),children:[u,l?e.jsxs("div",{className:"flex items-center rounded-lg bg-muted/60 p-0.5 text-xs",children:[e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>{const g={...s??{}};return delete g.tab,g},"aria-current":i?void 0:"page",className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i?"text-muted-foreground hover:text-foreground":"bg-background text-foreground "),children:"Events"}),e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>({...s??{},tab:"sessions"}),"aria-current":i?"page":void 0,className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:"Sessions"})]}):null]}),i?e.jsx(Z,{owner:t,tone:"page",empty:"message"}):F?e.jsx(ce,{children:$}):$]})}function P({count:n}){return n===0?null:e.jsx("span",{role:"img","aria-label":`${n} item${n===1?"":"s"} need attention`,className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:n})}function ye({owner:n,search:t,attentionLens:x,entityScope:o}){const m=typeof t.type=="string"&&t.type.trim()?N(t.type.trim()):void 0,f=t.tab==="sessions"?"sessions":"events";return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:[e.jsx(de,{}),e.jsx(se,{owner:n,children:a=>e.jsx(ie,{organizationId:a.organizationId,isWorkspaceLoading:a.isWorkspaceLoading,children:e.jsxs("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:[e.jsx(le,{organizationId:a.organizationId,ownerSlug:a.ownerSlug,typeScope:m,entityScope:o,attentionLens:x,activityTab:f}),e.jsx(oe,{ownerSlug:a.ownerSlug})]})})})]})}export{ye as A};
|
|
2
|
+
//# sourceMappingURL=activity-route-view-CMqYiiKM.js.map
|
package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-mnTN2AZt.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,ei as i,dj as l,P as c}from"./index-
|
|
2
|
-
//# sourceMappingURL=agent-card-controls-
|
|
1
|
+
import{j as e,ei as i,dj as l,P as c}from"./index-Cr5hwh-C.js";function d({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{d as A};
|
|
2
|
+
//# sourceMappingURL=agent-card-controls-mnTN2AZt.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as o,L as u,bi as c}from"./index-
|
|
1
|
+
import{j as o,L as u,bi as c}from"./index-Cr5hwh-C.js";const d="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function a(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function l(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return a(t)?n:`${n} --url ${t}`}const i=[{id:"claude-code",label:"Claude Code",tagline:"Shared plugin with Lobu MCP and workspace skills",description:"Connect Claude Code to shared workspace context and governed actions through Lobu's native plugin setup.",installTitle:"Run in your terminal",installText:e=>l("claude-code",e),steps:e=>a(e)?["The CLI adds Lobu's marketplace and installs the shared plugin.","Start a fresh Claude Code session.","Use a Lobu tool, choose this workspace, and complete OAuth when prompted."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill.","Start a fresh Claude Code session and complete OAuth when prompted."],guideLinks:[{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"Add Lobu as a custom ChatGPT connector, or connect the Codex coding agent through the CLI — both reach this workspace with your existing Lobu access.",installTitle:"Pick a surface",installText:e=>["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${l("codex",e)}`].join(`
|
|
2
2
|
`),steps:e=>["ChatGPT web: turn on developer mode under Settings -> Security -> Developer mode (custom connectors need it).",`ChatGPT web: open Settings -> Connectors -> Create connector, name it Lobu, and use ${e} with OAuth.`,"ChatGPT web: scan tools, complete Lobu sign-in, and start a new chat with Lobu enabled.",...a(e)?["Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"claude-desktop",label:"Claude Desktop",tagline:"Custom MCP connector with Lobu OAuth",description:"Add Lobu as a custom Claude Desktop connector and authorize the workspace with your existing Lobu access.",installTitle:"Add from Claude settings",installText:e=>["Open Settings -> Connectors -> Add Custom Connector","Name: Lobu",`MCP URL: ${e}`].join(`
|
|
3
3
|
`),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],h={codex:"chatgpt"};function b(e){const t=h[e]??e;return i.find(n=>n.id===t)}function g(e){const{workspaceName:t,owner:n,mcpUrl:s,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${s}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${d}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
4
4
|
`)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function C({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:i.map((n,s)=>o.jsxs(u,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:p(s,i.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(c,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{C as A,g as b,b as f};
|
|
5
|
-
//# sourceMappingURL=agent-client-setup-list-
|
|
5
|
+
//# sourceMappingURL=agent-client-setup-list-Bg3hBfUV.js.map
|