@lobu/runtime-server 24.8.0 → 24.9.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 +83 -6
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +6 -2
- package/dist/connectors/github.ts +16 -3
- package/dist/connectors/market_quotes.ts +388 -91
- package/dist/connectors/postgres.ts +21 -14
- package/dist/connectors/x-dm-adapter.js +55 -21
- package/dist/connectors/x.ts +1 -1
- package/dist/db/migrations/20261109010000_workspace_navigation.sql +14 -0
- package/dist/db/migrations/20261110010000_view_resources.sql +11 -0
- package/dist/dependencies.bun.lock +61 -61
- package/dist/owletto/dist/assets/_-B2C9B2RM.js +2 -0
- package/dist/owletto/dist/assets/_-CjyiGzwB.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +2 -0
- package/dist/owletto/dist/assets/_agentId-bna2tPsW.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +2 -0
- package/dist/owletto/dist/assets/{_connectorKey.index-DM5MTO8c.js → _connectorKey.index-DqwSv8Zs.js} +2 -2
- package/dist/owletto/dist/assets/{_conversationId-OJrZjd0o.js → _conversationId-zcs-S3dY.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +2 -0
- package/dist/owletto/dist/assets/_owner-DsvIC94q.js +3 -0
- package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +2 -0
- package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-BC-ZIsrf.js → accept-invitation-k1u3zBcn.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +2 -0
- package/dist/owletto/dist/assets/{agent-connect-pages-CdDjrHjn.js → agent-connect-pages-D3mVM_q4.js} +4 -4
- package/dist/owletto/dist/assets/{agent-editor-form-CDAHRNWl.js → agent-editor-form-Bnc_q5WD.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-BupiSjR-.js → agent-loading-shells-xteN-pyK.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-ju7L2M0l.js → agent-permissions-matrix-C_ayr0pd.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B0ZYVE3n.js → agent-skill-context-r0O0BVOu.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-ByU0xhXn.js → agent-subpage-shell-C2KpYdu3.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-DiVKn1WX.js → agent-thread-Bv_chdPy.js} +3 -3
- package/dist/owletto/dist/assets/{app._appId-BQWElSoP.js → app._appId-BUcNaSMS.js} +2 -2
- package/dist/owletto/dist/assets/{assist-composer-igTXq3DL.js → assist-composer-B1LykXpD.js} +2 -2
- package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +2 -0
- package/dist/owletto/dist/assets/{callback-Dmaio9CX.js → callback-kSLa4n5s.js} +2 -2
- package/dist/owletto/dist/assets/{card-rE4Ctuy6.js → card-C01y1O-W.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BN17CPYh.js → claim-Dnux9Lqf.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-B7xVaUA-.js → client-activity-scopes-BBIq16tG.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-B3LULJxW.js → client-rows-DGh1O-Fu.js} +2 -2
- package/dist/owletto/dist/assets/{clients-CydgUHrc.js → clients-BCvjAJDT.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-UppEMWpt.js → code-editor-BdRMYojw.js} +2 -2
- package/dist/owletto/dist/assets/connect-DZeFSGIH.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D4w-JhJW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId-CaF-ZWlZ.js → connected._clientId-BsDzltNz.js} +2 -2
- package/dist/owletto/dist/assets/{connection-D8ZAMHBT.js → connection-C7glVpPE.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CJYqryAV.js → connection-feed-detail-CJju0qiw.js} +2 -2
- package/dist/owletto/dist/assets/{connector-page-shell-C23dWdKz.js → connector-page-shell-BeuyjiB2.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-CW4CXtCz.js → connector-provenance-B2C2cjBg.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-Bp08_KPq.js → connectors-DSQ5AWPf.js} +2 -2
- package/dist/owletto/dist/assets/{consent-_PpYI1cT.js → consent-B6Aw_89N.js} +2 -2
- package/dist/owletto/dist/assets/{copy-button-1ALlvZU1.js → copy-button-BhXeXLIm.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-6koO33th.js → core.esm-CJUp2aNZ.js} +3 -3
- package/dist/owletto/dist/assets/create-CWcza8NT.js +2 -0
- package/dist/owletto/dist/assets/{create-kUevP9Xx.js → create-DUlRsFNn.js} +2 -2
- package/dist/owletto/dist/assets/{create-automation-form-BhujNbRr.js → create-automation-form-D141prEG.js} +3 -3
- package/dist/owletto/dist/assets/{create-Drx9tcnG.js → create-bGOYifof.js} +2 -2
- package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-B_aCgvoZ.js → custom-guardrail-edits-DuQ28xv3.js} +2 -2
- package/dist/owletto/dist/assets/{definition-comparison-3zKUSTt8.js → definition-comparison-BUDNuAN_.js} +2 -2
- package/dist/owletto/dist/assets/{detail-page-skeleton-BmxqqIsH.js → detail-page-skeleton-BRHaq5Sj.js} +2 -2
- package/dist/owletto/dist/assets/{device-D2eUt_nr.js → device-D3fzoIrM.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-BFPbTM_o.js → device-pin-tombstone-BIM-ziCH.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-Dqtmb1Xp.js → device._deviceId-BnPqTgK1.js} +2 -2
- package/dist/owletto/dist/assets/{dynamic-schema-form-D3KnzCsW.js → dynamic-schema-form-OkIZImgp.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-CpeX7iiX.js +2 -0
- package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +2 -0
- package/dist/owletto/dist/assets/{entity-pages-DJNSQrfB.js → entity-pages-18xSANrS.js} +2 -2
- package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-CouHZbc9.js → entity-type-page-MgZ7_0oh.js} +2 -2
- package/dist/owletto/dist/assets/event-detail-D6AH6a2C.js +2 -0
- package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DDTwyYt0.js +3 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B7A6Ycyi.js → full-page-spinner-DWo519BU.js} +2 -2
- package/dist/owletto/dist/assets/index-9tTjJo_J.css +1 -0
- package/dist/owletto/dist/assets/{index-B-dZruj6.js → index-BW7IFKXC.js} +2 -2
- package/dist/owletto/dist/assets/{index-C7QM3aqU.js → index-BYcFrinP.js} +2 -2
- package/dist/owletto/dist/assets/index-BhJsTy-C.js +2 -0
- package/dist/owletto/dist/assets/index-CEcsgXDj.js +2 -0
- package/dist/owletto/dist/assets/index-CPscKk2u.js +2 -0
- package/dist/owletto/dist/assets/{index-DXfYVs5m.js → index-Cd8jMsz8.js} +2 -2
- package/dist/owletto/dist/assets/index-CdDNNAx2.js +7906 -0
- package/dist/owletto/dist/assets/index-CfJ2-EpK.js +2 -0
- package/dist/owletto/dist/assets/{index-BztXeLBN.js → index-D1UCJQl1.js} +2 -2
- package/dist/owletto/dist/assets/index-D5DM4g2w.js +2 -0
- package/dist/owletto/dist/assets/index-DmqnKGqW.js +2 -0
- package/dist/owletto/dist/assets/index-DznAbTOF.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-CJK-gzCt.js → json-diff-C-WQqyIf.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-bQAZ0hQp.js → list-skeleton-0B1bTrAK.js} +2 -2
- package/dist/owletto/dist/assets/{login-DLqL54Rk.js → login-CH7P2AyR.js} +2 -2
- package/dist/owletto/dist/assets/{logout-H0F3IfiO.js → logout-D474YsYQ.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-Doic_6qX.js → member-scope-gate-CH_0jHiM.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BrfaDwIg.js → model-selector-XYmk7Iru.js} +2 -2
- package/dist/owletto/dist/assets/needs-you-list-Bd4iiiqm.js +2 -0
- package/dist/owletto/dist/assets/new-BOsrRqp8.js +2 -0
- package/dist/owletto/dist/assets/{new-5GkxlOuQ.js → new-CJ6TF3Vc.js} +2 -2
- package/dist/owletto/dist/assets/{new-BiA4DGoN.js → new-DGPOjak2.js} +2 -2
- package/dist/owletto/dist/assets/new-Q0XqiZq2.js +2 -0
- package/dist/owletto/dist/assets/{organization-CLrcmgNK.js → organization-hD_Z6TSd.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cc8YX1oy.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-DYYOoCvj.js → pending-seed-D7-ld7as.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BVwOMoq9.js → proposal-review-shell-BWRJidwb.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +2 -0
- package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +2 -0
- package/dist/owletto/dist/assets/{record-session-KuEDuF3S.js → record-session-ClKBr1_C.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-ucwCQmBk.js → renderer-DZ0w2k2r.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-BkiAmXZW.js → reset-password-D2RfrEVZ.js} +2 -2
- package/dist/owletto/dist/assets/{run-initiator-8vdkq-3o.js → run-initiator-B8IRlRd-.js} +2 -2
- package/dist/owletto/dist/assets/runs-CuC7WMtd.js +2 -0
- package/dist/owletto/dist/assets/runs-list-8gUPWjP4.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-CefbtPIY.js → schema-value-k19Ata7u.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-L7h-Ca4u.js +2 -0
- package/dist/owletto/dist/assets/{settings-DvzkRYQy.js → settings-BZqntV3E.js} +2 -2
- package/dist/owletto/dist/assets/{source-record-panels-LJIWGtHb.js → source-record-panels-C4UItfdk.js} +2 -2
- package/dist/owletto/dist/assets/{status-variants-BxHtpMOj.js → status-variants-BR_iGWN5.js} +2 -2
- package/dist/owletto/dist/assets/subDays-hOwerOLo.js +2 -0
- package/dist/owletto/dist/assets/{table-1O-ik4_O.js → table-C3DMoL4K.js} +2 -2
- package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +2 -0
- package/dist/owletto/dist/assets/{use-login-redirect-CfCbEeJR.js → use-login-redirect-CYlVkAhE.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-CA-evCDf.js → use-mention-search-CtbixPEE.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-BerT4Z1d.js → views-access-required-CvIIxdS_.js} +2 -2
- package/dist/owletto/dist/index.html +19 -12
- package/dist/server-main.bundle.mjs +4245 -2432
- package/npm-shrinkwrap.json +328 -328
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +23 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.d.ts +3 -4
- package/vendor/core/dist/classify-error.js +8 -8
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +17 -1
- package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +39 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +11 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +249 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
- package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
- package/vendor/core/dist/contracts/tools/navigation.js +284 -0
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
- package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
- package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
- package/vendor/core/dist/contracts/tools/view-host.js +28 -1
- package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
- package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
- package/vendor/core/dist/errors.d.ts +17 -24
- package/vendor/core/dist/errors.js +17 -24
- package/vendor/core/dist/types.d.ts +0 -6
- package/vendor/core/package.json +11 -1
- package/vendor/views/dist/api.d.ts +30 -5
- package/vendor/views/dist/api.js +22 -8
- package/vendor/views/dist/bridge.d.ts +17 -0
- package/vendor/views/dist/bridge.js +49 -1
- package/vendor/views/dist/components.d.ts +27 -5
- package/vendor/views/dist/components.js +57 -7
- package/vendor/views/dist/embed.d.ts +98 -0
- package/vendor/views/dist/embed.js +418 -0
- package/vendor/views/dist/index.d.ts +3 -1
- package/vendor/views/dist/index.js +1 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-B0tmXZ86.js +0 -2
- package/dist/owletto/dist/assets/_-DwXULq4r.js +0 -3
- package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +0 -2
- package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +0 -2
- package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +0 -2
- package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +0 -2
- package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +0 -3
- package/dist/owletto/dist/assets/_shape-BZidoJMB.js +0 -2
- package/dist/owletto/dist/assets/_slug-R989vOiM.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +0 -2
- package/dist/owletto/dist/assets/connect-OdHpIVV9.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-B9u86bb2.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +0 -2
- package/dist/owletto/dist/assets/create-DULVO0HS.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +0 -2
- package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +0 -2
- package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +0 -2
- package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +0 -2
- package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +0 -2
- package/dist/owletto/dist/assets/index-9PGnv4-5.js +0 -2
- package/dist/owletto/dist/assets/index-C2TCKJDP.js +0 -7901
- package/dist/owletto/dist/assets/index-CWn46a4y.js +0 -2
- package/dist/owletto/dist/assets/index-CxJONizf.js +0 -2
- package/dist/owletto/dist/assets/index-DJhb3li3.js +0 -2
- package/dist/owletto/dist/assets/index-DY-YGnCe.js +0 -2
- package/dist/owletto/dist/assets/index-j3v7ITPb.js +0 -2
- package/dist/owletto/dist/assets/index-oiy6ygaI.js +0 -2
- package/dist/owletto/dist/assets/index-pEgtAY1t.js +0 -2
- package/dist/owletto/dist/assets/index-xAvK3IyQ.css +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +0 -74
- package/dist/owletto/dist/assets/new-M-MX_T5C.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +0 -2
- package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +0 -2
- package/dist/owletto/dist/assets/runs-B_iywKWb.js +0 -2
- package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +0 -2
- package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +0 -2
- package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +0 -2
- package/dist/owletto/dist/assets/use-automations-lV8PuE8L.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-Bp84PUMd.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jx as P,j as e,aT as J,c as X,a_ as Y,cO as K,cQ as ee,dZ as ne,B as M,L as c,cB as te,a$ as se,jg as oe,jh as ae,bb as ie,dw as h,jb as re,aQ as ce,iM as de,dt as R,dv as T,aE as me,P as le,S as pe}from"./index-CdDNNAx2.js";import{f as he,C as ue,a as xe,F as je,b as fe,c as ve,A as Ce,d as De}from"./connection-feed-detail-CJju0qiw.js";import{c as $e,C as ge}from"./device-pin-tombstone-BIM-ziCH.js";import{C as b}from"./connector-page-shell-BeuyjiB2.js";import{a as Ne}from"./connector-provenance-B2C2cjBg.js";import{D as be}from"./detail-page-skeleton-BRHaq5Sj.js";import{S as y,g as O}from"./status-variants-BR_iGWN5.js";import"./scoped-feed-bar-L7h-Ca4u.js";import"./event-kind-options-fHAIXu24.js";import"./filter-editors-DDTwyYt0.js";import"./subDays-hOwerOLo.js";import"./events-feed-BI7wNRUY.js";import"./definition-comparison-BUDNuAN_.js";import"./json-diff-C-WQqyIf.js";import"./code-editor-BdRMYojw.js";import"./index-Vcq4gwWv.js";import"./schema-value-k19Ata7u.js";import"./run-initiator-B8IRlRd-.js";import"./list-skeleton-0B1bTrAK.js";import"./use-automations-CdtiVLCv.js";import"./clients-BCvjAJDT.js";import"./renderer-DZ0w2k2r.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./copy-button-BhXeXLIm.js";import"./device-automation-Dp3faMvp.js";import"./entity-options-CpeX7iiX.js";import"./runs-list-8gUPWjP4.js";import"./feed-event-kinds-BYuZCoU4.js";import"./runs-CuC7WMtd.js";function tn(){const{owner:p,connectorKey:n,connectionId:f}=P.useParams(),{addFeed:o,feedId:i,settings:x,auth_result:a}=P.useSearch();return e.jsx(J,{owner:p,children:d=>e.jsx(we,{organizationId:d.organizationId,ownerSlug:d.ownerSlug,isWorkspaceLoading:d.isWorkspaceLoading,connectorKey:n,connectionId:Number(f),showAddFeed:o===!0,feedId:i,settingsView:x===!0,authResult:a})})}function we({organizationId:p,ownerSlug:n,isWorkspaceLoading:f,connectorKey:o,connectionId:i,showAddFeed:x,feedId:a,settingsView:d,authResult:w}){const W=X(),{data:H=[]}=Y(),{data:S=[],isLoading:Q,isError:v,refetch:V}=K(p??"",{connectorKey:o,connectionIds:[i]}),{data:_=[]}=ee(p??""),{data:z=[],isLoading:G,isError:U,refetch:Z}=ne(a?i:null,{eventCounts:!0}),t=S.find(r=>r.id===i),s=_.find(r=>r.key===o),m=a?z.find(r=>r.id===a):null;if(f||Q||a&&G||!p)return e.jsx(be,{label:a?"Loading feed":"Loading connection"});if(v||a&&U)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",v?"connection":"feed","."]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>void(v?V():Z()),children:"Retry"})]});if(!t)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",s?.name??o]})]});const C=te({...t,connector_name:t.connector_name??s?.name??null}),D=!a&&!x,q=()=>void W({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},replace:!0});let u,j=C,F,k,$;a?m?(j=he(m,s),m.store==="channel_messages"?(u=e.jsx(xe,{feed:m,hideHeader:!0}),$="chat channel"):(F=e.jsx(je,{feed:m,ownerSlug:n}),k=e.jsx(fe,{feed:m}),u=e.jsx(ve,{feed:m,connectorDef:s,ownerSlug:n}))):(u=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),j="Feed"):x&&(u=e.jsx(Ce,{onClose:q,organizationId:p,connections:[t],connectorDefinitions:_}),j="Add feed",$=De);const l=H.find(r=>r.id===t.device_worker_id&&se(r,n)),L=l?oe(l):void 0,g=L?ae(n,L,ie()):void 0,I=[e.jsx(c,{to:"/$owner/connectors",params:{owner:n},className:h,children:"Connectors"},"connectors"),...l&&g?[e.jsx(c,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:g.id},className:h,children:g.name},"app"),e.jsx(c,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:l.id},className:h,children:re(l)},"device")]:[e.jsx(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:h,children:s?.name??o},"connector")]];D||I.push(e.jsx(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},className:h,children:C},"connection"));const N=D?$e(t):null,E=$??N??void 0,A=s?e.jsx(ce,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??de(s.auth_schema)}):null,B=e.jsx(R,{breadcrumb:e.jsx(T,{crumbs:I}),icon:A,title:j,status:F??e.jsx(y,{status:O(t.status),showDot:!0,children:t.status}),meta:k,caption:E,captionTone:N?"error":"muted"});return D?l&&s&&me(s)?e.jsx(le,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:l.id},search:{connection:t.id,settings:d||void 0},hash:`connection-${t.id}`,replace:!0}):!d&&!w?e.jsx(b,{header:e.jsx(R,{breadcrumb:e.jsx(T,{crumbs:[e.jsx(c,{to:"/$owner",params:{owner:n},className:h,children:"Home"},"home")]}),icon:A,title:C,status:e.jsx(y,{status:O(t.status),showDot:!0,children:t.status}),meta:e.jsx(M,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:e.jsxs(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{settings:!0},children:[e.jsx(pe,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Settings"]})}),caption:E,captionTone:N?"error":"muted"}),children:e.jsx(ue,{connection:t,ownerSlug:n})}):e.jsxs(b,{header:B,children:[e.jsx(Ne,{connectorDef:s,connectorKey:o,ownerSlug:n,deviceWorkerId:t.device_worker_id,deviceLabel:t.device_label}),e.jsx(ge,{embedded:!0,connection:t,connectorDef:s,ownerSlug:n,openSettings:d,authResult:w},t.id)]}):e.jsx(b,{header:B,children:e.jsx("div",{className:"mt-0",children:u})})}export{tn as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey._connectionId-dE6im18z.js.map
|
package/dist/owletto/dist/assets/{_connectorKey.index-DM5MTO8c.js → _connectorKey.index-DqwSv8Zs.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aJ as Pe,aK as Se,aL as $e,aS as re,aP as J,hZ as Qe,h_ as Ge,j as e,h$ as Ze,B as g,L as _,aR as le,bb as De,cu as ee,cw as se,cx as U,i0 as Je,ad as es,i1 as Z,r as u,i2 as ye,i3 as Ee,cQ as ss,i4 as Ne,bo as I,i5 as Ce,T as k,bg as ts,bh as ns,bi as as,bj as is,bk as rs,i6 as os,U as S,bI as q,ai as T,A as ke,i7 as ls,i8 as cs,d3 as ds,i9 as us,c1 as ce,ia as ms,ib as xs,ic as _e,id as Le,ie as Fe,dN as Be,a2 as E,a3 as te,ig as hs,gg as ps,ih as gs,eH as Re,ii as Ke,hV as R,c as H,ij as js,e3 as fs,e4 as vs,e7 as bs,ik as W,il as ys,aF as Ns,u as Oe,im as Ie,io as Cs,aV as ks,ip as ws,iq as As,ir as Ps,aI as we,aH as Ss,ct as $s,b2 as Ds,as as M,es as Ue,is as Me,b9 as de,b3 as Es,i as _s,it as Ls}from"./index-C2TCKJDP.js";import{C as Fs,A as Bs}from"./connect-menu-B9u86bb2.js";import{C as ne}from"./connector-page-shell-C23dWdKz.js";import{C as Rs}from"./connector-provenance-CW4CXtCz.js";import{R as Ks,D as ue}from"./detail-page-skeleton-BmxqqIsH.js";import{L as oe}from"./list-skeleton-bQAZ0hQp.js";import"./runs-B_iywKWb.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./runs-list-CJJFRhTl.js";import"./run-initiator-8vdkq-3o.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";function Os({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",o=Pe({enabled:n}),d=Se({enabled:n}),x=$e({enabled:!n}),c=n?o:x,l=n?d.data?.find(i=>i.slug===a)?.displayName??a:re(a),p=(n?(o.data??[]).filter(i=>i.kind===a).map(i=>({key:`${J}${i.slug}`,name:i.displayName||i.slug,status:[i.isDefault?"Default":null,i.status].filter(Boolean).join(" · ")})):(x.data?.sandboxes??[]).filter(i=>i.providerKind===a).map(i=>({key:`${Qe}${i.id}`,name:i.name,status:i.connected?"Connected":"Needs credentials"}))).map(i=>({id:i.key,name:i.name,description:i.status,tone:null,link:Ge({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:i.key},search:{}})})),m=`${n?J:le}${a}`;return e.jsx(ne,{header:e.jsx(ee,{title:l,breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors")]})}),children:e.jsx(Ze,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:n?e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(De,{ownerSlug:s,connectorKey:m})})})}function Is({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:o,onDone:d}){const x=Je(),c=es(),l=s.find(r=>r.slug===t)??s[0],p=n&&l&&Z(l)?"oauth":"api-key",[m,i]=u.useState(l?.slug??""),[f,N]=u.useState(a??l?.slug??""),[h,b]=u.useState(l?.displayName??""),[v,w]=u.useState(l?.baseUrl??""),[D,A]=u.useState(o??l?.defaultModel??""),[$,z]=u.useState(""),[X,B]=u.useState(l?.apiKeyPlaceholder??""),[V,K]=u.useState(p),[L,Y]=u.useState(""),[C,ae]=u.useState(null),[O,F]=u.useState(!1),[me,xe]=u.useState(!1),j=s.find(r=>r.slug===m),Q=ye(j?.modalities??[]),he=n&&!!j&&Z(j),pe=j?Ee(j):!1,ge=he&&V==="oauth",je=pe&&!ge,P=ss().slug,G=u.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Te=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),ze=u.useCallback(async()=>{if(!(!P||!j)){F(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(r.authorizeUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{F(!1)}}},[P,j]),Ve=u.useCallback(async()=>{if(!(!P||!j||!L.trim())){F(!0);try{const r=await Ce(P,j.slug,{code:L.trim()});if(r.status!=="success")throw new Error(r.error||"Sign-in not complete");G(),I.success(`Signed in with ${j.displayName}`)}catch(r){I.error(r instanceof Error?r.message:"Failed to complete sign-in")}finally{F(!1)}}},[P,j,L,G]),qe=u.useCallback(async()=>{if(!(!P||!j)){F(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="device")throw new Error("Unexpected sign-in mode");ae({userCode:r.userCode,deviceAuthId:r.deviceAuthId,verificationUrl:r.verificationUrl}),window.open(r.verificationUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{F(!1)}}},[P,j]),We=u.useCallback(async()=>{if(!(!P||!j||!C)){F(!0);try{const r=await Ce(P,j.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(r.status==="success"){G(),I.success(`Signed in with ${j.displayName}`);return}ae(y=>y&&{...y,message:r.error||"Waiting for approval..."})}catch(r){I.error(r instanceof Error?r.message:"Failed to check status")}finally{F(!1)}}},[P,j,C,G]),He=j?.supportedAuthTypes.includes("device-code")??!1,Xe=r=>{i(r);const y=s.find(ie=>ie.slug===r);y&&(N(y.slug),b(y.displayName),w(y.baseUrl),A(y.slug===t&&o?o:y.defaultModel??""),B(y.apiKeyPlaceholder),K(n&&Z(y)?"oauth":"api-key"),Y(""),ae(null),xe(!1))},fe=/^[a-z0-9][a-z0-9-]*$/.test(f),ve=fe&&je&&$.trim().length>0&&!x.isPending,Ye=r=>{if(r.preventDefault(),!ve)return;const y={};v.trim()&&(y.base_url=v.trim()),D.trim()&&(y.model=D.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;x.mutate({slug:f.trim(),kind:m,displayName:h.trim()||void 0,apiKey:$.trim(),capabilities:ie},{onSuccess:()=>d()})},be=!!(t&&s.some(r=>r.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:be&&j?`Connect ${j.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Ye,className:"grid max-w-md gap-3",children:[be&&j?e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ts,{value:m,onValueChange:Xe,children:[e.jsx(ns,{id:"ip-provider",className:"w-full",children:e.jsx(as,{})}),e.jsx(is,{children:s.map(r=>{const y=ye(r.modalities);return e.jsx(rs,{value:r.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.iconUrl?e.jsx("img",{src:r.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(os,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},r.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx(S,{id:"ip-display",placeholder:"Friendly name",value:h,onChange:r=>b(r.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:r=>N(r.target.value),autoComplete:"off",required:!0}),f&&!fe?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&pe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:V==="oauth"?"secondary":"ghost",onClick:()=>K("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:V==="api-key"?"secondary":"ghost",onClick:()=>K("api-key"),children:"API key"})]})]}):null,je?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(S,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:r=>w(r.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx(S,{id:"ip-model",placeholder:"gpt-4o-mini",value:D,onChange:r=>A(r.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-key",type:"password",placeholder:X||void 0,value:$,onChange:r=>z(r.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(q,{onCancel:d,children:e.jsx(g,{type:"submit",disabled:!ve,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ge?e.jsxs("div",{className:"grid gap-3",children:[me?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",j?.displayName??"provider",". This covers your agents in this org."]}):He?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void qe(),disabled:O||!P,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(S,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",j?.displayName??"provider"," to approve",e.jsx(ke,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:O,children:O?"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 ze(),disabled:O||!P,children:["Sign in with ",j?.displayName??"provider",e.jsx(ke,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(S,{id:"ip-oauth-code",placeholder:"code#state",value:L,onChange:r=>Y(r.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void Ve(),disabled:O||!L.trim(),children:O?"Finishing...":"Finish sign-in"})]}),e.jsx(q,{onCancel:d,children:e.jsx(g,{type:"button",onClick:Te,disabled:!me,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(q,{onCancel:d})]})]})]})}const Us={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Ms({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[o,d]=u.useState(a?"edit":null),x=cs(s.kind,t);u.useEffect(()=>{a&&d("edit")},[a]);const l=(t.find(i=>i.slug===s.kind)?.modalities??["text"]).filter(i=>i!=="text"),p=x&&l.length>0,m=i=>d(f=>f===i?null:i);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 ${ds(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"}),p?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),o==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(zs,{provider:s,supportsUpstreamConfig:x,onDone:()=>d(null)})}):null,o==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),l.map(i=>e.jsx(Vs,{providerSlug:s.slug,modality:i,block:s.capabilities[i]??{}},i))]})}):null]})}function Ts({provider:s,onDeleted:t}){const a=us(),[n,o]=u.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children: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:()=>o(!1)}),children:[a.isPending?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>o(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>o(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function zs({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=ms(),o=xs(),d=_e(),[x,c]=u.useState(s.displayName??""),[l,p]=u.useState(""),m=s.capabilities.text??{},[i,f]=u.useState(m.base_url??""),[N,h]=u.useState(m.model??""),[b,v]=u.useState(null),w=x.trim().length>0&&x.trim()!==(s.displayName??""),D=t&&l.trim().length>0,A=i.trim()!==(m.base_url??""),$=N.trim()!==(m.model??""),z=t&&(A||$),X={base_url:i.trim()||void 0,model:N.trim()||void 0,models_endpoint:m.models_endpoint},B=Le(X),V=t&&z&&Fe(B),K=n.isPending||o.isPending||d.isPending,L=(w||D||z)&&!V&&!K,Y=async C=>{if(C.preventDefault(),!!L){v(null);try{await Promise.all([w?n.mutateAsync({providerSlug:s.slug,displayName:x.trim()}):Promise.resolve(),z?d.mutateAsync({providerSlug:s.slug,modality:"text",block:X}):Promise.resolve(),D?o.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:Y,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(S,{id:`edit-name-${s.slug}`,value:x,onChange:C=>c(C.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(S,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:i,onChange:C=>f(C.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(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(S,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:C=>h(C.target.value),autoComplete:"off"}),B.model?e.jsx("p",{className:"text-xs text-destructive",children:B.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(S,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,b?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:b}):null,e.jsx(q,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!L,children:K?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function Vs({providerSlug:s,modality:t,block:a}){const n=_e(),[o,d]=u.useState(!1),[x,c]=u.useState(a.base_url??""),[l,p]=u.useState(a.model??""),[m,i]=u.useState(a.models_endpoint??""),[f,N]=u.useState(!!a.models_endpoint),h=!!(a.base_url||a.model||a.models_endpoint),b={base_url:x.trim()||void 0,model:l.trim()||void 0,models_endpoint:m.trim()||void 0},v=Le(b),w=Fe(v),D=()=>{w||n.mutate({providerSlug:s,modality:t,block:b})};return e.jsxs("div",{className:Be,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(A=>!A),children:[e.jsx("span",{className:"text-sm font-medium",children:Us[t]}),h?e.jsx(E,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),o?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(S,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:x,onChange:A=>c(A.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(S,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:A=>p(A.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(S,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:A=>i(A.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!0),children:"Advanced"}),e.jsx(q,{onCancel:()=>d(!1),children:e.jsx(g,{size:"sm",disabled:w||n.isPending,onClick:D,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function qs({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Hs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(E,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(E,{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(E,{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(te,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function Ws({sandbox:s,onDeleted:t}){const a=hs(),[n,o]=u.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),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(T,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),children:"Delete sandbox"})]})})}function Hs({kind:s}){return s==="vercel"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 shrink-0 fill-foreground","aria-hidden":!0,children:[e.jsx("title",{children:"Vercel"}),e.jsx("path",{d:"M12 3 22 20H2L12 3Z"})]}):s==="builtin"?e.jsx(ps,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(gs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Xs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Ys={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Nt(){const{owner:s,connectorKey:t}=W.useParams(),{instances:a}=W.useSearch(),{kind:n,id:o}=ys(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:x,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Os,{ownerSlug:d,familyKind:n,familyId:o});switch(n){case"inference":return e.jsx(Zs,{ownerSlug:d,providerSlug:o});case"sandbox":return e.jsx(Gs,{ownerSlug:d,sandboxId:o});case"sandbox-provider":return e.jsx(Qs,{ownerSlug:d,providerKind:o});default:return e.jsx(tt,{ownerSlug:d,organizationId:x,isWorkspaceLoading:c,connectorKey:t})}}})}function Qs({ownerSlug:s,providerKind:t}){const a=H();return u.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${le}${t}`},replace:!0})},[a,s,t]),null}function Gs({ownerSlug:s,sandboxId:t}){const a=H(),{data:n,isLoading:o,isError:d,refetch:x}=$e(),c=n?.sandboxes.find(p=>p.id===t)??null;if(o)return e.jsx(ue,{label:"Loading sandbox",sections:1});if(d)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 x(),children:"Retry"})]})});if(!c)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=c.name||re(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${le}${c.providerKind}`},search:{instances:!0},className:U,children:re(c.providerKind)},"family")]}),icon:e.jsx(de,{name:l,faviconDomain:Es(c.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(E,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(E,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Me,{facets:Ys})}),children:[e.jsx(qs,{sandbox:c}),e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Zs({ownerSlug:s,providerSlug:t}){const a=H(),{model:n,reason:o,agentId:d,addAccount:x}=W.useSearch(),{data:c=[],isLoading:l,isError:p,refetch:m}=Pe(),i=Se(),{data:f=[],isLoading:N}=i,h=x?null:c.find($=>$.slug===t)??null,b=f.find($=>$.slug===(h?.kind??t))??null;if(l||N)return e.jsx(ue,{label:"Loading account"});if(p)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 m(),children:"Retry"})]})});if(!h&&!b&&!i.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Ue,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=h?h.displayName||h.slug:b?.displayName||t,w=h!==null,D=o?e.jsx(st,{agentId:d,model:n,providerName:v}):n?e.jsx(et,{providerName:v,model:n,isConnected:w}):null,A=e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),...h?[e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${h.kind}`},search:{instances:!0},className:U,children:b?.displayName??h.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:b?.iconUrl,name:v}),title:v,badge:h?e.jsxs(e.Fragment,{children:[h.isDefault?e.jsx(E,{variant:"secondary",children:"Default"}):null,h.status?e.jsx(E,{variant:"outline",children:h.status}):null,h.hasCustomUpstream?e.jsx(E,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Me,{facets:Xs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:A,children:[D,e.jsx("div",{className:"space-y-6",children:h?e.jsx(Ms,{provider:h,catalog:f,autoOpenEdit:!!n}):e.jsx(Js,{ownerSlug:s,providerSlug:t,existingSlugs:c.map($=>$.slug),catalog:f,catalogError:i.isError?i.error:null,model:n})}),h?e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ts,{provider:h,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Js({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:o,model:d}){const x=H(),c=n.find(m=>m.slug===t),l=a.includes(t)&&!!c&&Z(c);let p=t;for(let m=2;a.includes(p);m++)p=`${t}-${m}`;return o?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(te,{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:o instanceof Error?o.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(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${t}`},search:{},children:"Open existing connection"})})]}),(!l||c&&Ee(c))&&e.jsx(Is,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!l,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void x({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function et({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(te,{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 st({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(te,{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 tt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:o=[],isLoading:d,isError:x,refetch:c}=Ss(t??""),{data:l=[],isLoading:p,isError:m,refetch:i}=$s(t??"",{connectorKey:n}),{setup:f}=W.useSearch(),N=W.useNavigate(),h=u.useMemo(()=>o.find(w=>w.key===n),[o,n]),b=u.useMemo(()=>Ds(n,o,{name:l[0]?.connector_name??n}),[n,o,l]);if(a||d)return e.jsx(ue,{label:"Loading connector",sections:3});if(x||m)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:()=>{c(),i()},children:"Retry"})]})});const v=h?e.jsx(at,{connector:h,ownerSlug:s,organizationId:t??void 0,connectionCount:l.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ue,{connector:b,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:h&&t?e.jsx(nt,{hero:v,connector:h,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void N({search:w=>({...w,setup:void 0}),replace:!0})}):e.jsxs(M,{className:"space-y-6",children:[v,l.length>0&&!p?e.jsx(Ke,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):p?e.jsx(oe,{label:"Loading connections",rows:2}):e.jsx("div",{children:e.jsx(De,{ownerSlug:s,connectorKey:n})})]})})}function nt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:o,connections:d,isLoading:x,openNewApp:c,onNewAppHandled:l}){const{isAdmin:p,isLoading:m}=Re(a),i=(t.operations_summary?.total??0)>0,f=e.jsx(Fs,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:l});return e.jsxs(ne,{header:s,children:[x?e.jsx(oe,{label:"Loading connections",rows:2}):d.length>0?e.jsx(Ke,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:o,action:f}):f,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}),i&&m?e.jsx(oe,{label:"Loading actions",rows:2}):i&&p?e.jsx(ot,{connector:t,organizationId:a,ownerSlug:n}):i&&!p?e.jsx(R,{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]}),d.length>0?e.jsx(R,{title:"Runs",children:e.jsx(Ks,{scope:{connectorKey:o},ownerSlug:n})}):null,e.jsx(it,{connector:t,organizationId:a,ownerSlug:n})]})}function at({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:t},className:U,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Ls(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Rs,{connectorDef:s,ownerSlug:t}),a?e.jsx(rt,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function it({connector:s,organizationId:t,ownerSlug:a}){const n=Cs(s.auth_schema),o=ks(s.auth_schema),d=ws(s.auth_schema),x=As(s.auth_schema),c=n.some(b=>b.type==="env_keys"),l=n.some(b=>b.type==="browser"),p=o.some(b=>b.type==="interactive"),m=!!(d||x||c||l),i=Ps(s),{data:f=[]}=we(t,{connectorKey:s.key,profileKind:"env"}),{data:N=[]}=we(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||l&&N.length>0||!m&&(i||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(Ae,{profiles:f,type:"env"}):null,l&&N.length>0?e.jsx(Ae,{profiles:N,type:"browser_session"}):null,m?null:i?e.jsx(R,{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(_,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):p?e.jsx(R,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const o=H(),{isAdmin:d}=Re(t),x=js(),[c,l]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=n>0,i=x.isPending,f=()=>{l(null),x.mutate({connector_key:s.key},{onSuccess:()=>{o({to:"/$owner/connectors",params:{owner:a}})},onError:N=>{l(N instanceof Error?N.message:"Failed to remove connector")}})};return e.jsxs(fs,{onOpenChange:()=>l(null),children:[e.jsx(vs,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(bs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),m?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(g,{variant:"destructive",size:"sm",disabled:i||m,onClick:f,children:[i?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function ot({connector:s,organizationId:t,ownerSlug:a}){const n=Oe();return e.jsx(Ie,{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 Ae({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(R,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:_s(Be,"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(Bs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=Oe(),o=Object.keys(s.feeds_schema??{}).length;return o?e.jsx(Ie,{title:"Feeds",summary:`${o} ${o===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{nt as ConnectorDetailShell,rt as ConnectorRemoveButton,Nt as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey.index-
|
|
1
|
+
import{aX as Pe,aY as Se,aZ as $e,b4 as re,b1 as J,ih as Qe,ii as He,j as e,ij as Ze,B as g,L as _,b3 as le,bm as De,dt as ee,dv as se,dw as U,ik as Je,ad as es,il as Z,r as u,im as ye,io as Ee,dN as ss,ip as Ne,bz as I,iq as Ce,T as k,br as ts,bs as ns,bt as as,bu as is,bv as rs,ir as os,U as S,bT as W,ai as T,A as ke,is as ls,it as cs,ex as ds,iu as us,cc as ce,iv as ms,iw as xs,ix as _e,iy as Fe,iz as Le,e8 as Be,a2 as E,a3 as te,iA as hs,gp as ps,iB as gs,cN as Re,iC as Ke,ic as R,c as X,iD as js,aF as fs,aG as vs,aI as bs,iE as q,iF as ys,aT as Ns,u as Oe,iG as Ie,iH as Cs,b6 as ks,iI as ws,iJ as As,iK as Ps,aW as we,aV as Ss,cO as $s,aO as Ds,as as M,eQ as Ue,iL as Me,aQ as de,bf as Es,i as _s,iM as Fs}from"./index-CdDNNAx2.js";import{C as Ls,A as Bs}from"./connect-menu-D4w-JhJW.js";import{C as ne}from"./connector-page-shell-BeuyjiB2.js";import{C as Rs}from"./connector-provenance-B2C2cjBg.js";import{R as Ks,D as ue}from"./detail-page-skeleton-BRHaq5Sj.js";import{L as oe}from"./list-skeleton-0B1bTrAK.js";import"./runs-CuC7WMtd.js";import"./filter-editors-DDTwyYt0.js";import"./subDays-hOwerOLo.js";import"./runs-list-8gUPWjP4.js";import"./run-initiator-B8IRlRd-.js";import"./use-automations-CdtiVLCv.js";import"./clients-BCvjAJDT.js";function Os({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",o=Pe({enabled:n}),d=Se({enabled:n}),x=$e({enabled:!n}),c=n?o:x,l=n?d.data?.find(i=>i.slug===a)?.displayName??a:re(a),p=(n?(o.data??[]).filter(i=>i.kind===a).map(i=>({key:`${J}${i.slug}`,name:i.displayName||i.slug,status:[i.isDefault?"Default":null,i.status].filter(Boolean).join(" · ")})):(x.data?.sandboxes??[]).filter(i=>i.providerKind===a).map(i=>({key:`${Qe}${i.id}`,name:i.name,status:i.connected?"Connected":"Needs credentials"}))).map(i=>({id:i.key,name:i.name,description:i.status,tone:null,link:He({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:i.key},search:{}})})),m=`${n?J:le}${a}`;return e.jsx(ne,{header:e.jsx(ee,{title:l,breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors")]})}),children:e.jsx(Ze,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:n?e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(De,{ownerSlug:s,connectorKey:m})})})}function Is({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:o,onDone:d}){const x=Je(),c=es(),l=s.find(r=>r.slug===t)??s[0],p=n&&l&&Z(l)?"oauth":"api-key",[m,i]=u.useState(l?.slug??""),[f,N]=u.useState(a??l?.slug??""),[h,b]=u.useState(l?.displayName??""),[v,w]=u.useState(l?.baseUrl??""),[D,A]=u.useState(o??l?.defaultModel??""),[$,z]=u.useState(""),[Y,B]=u.useState(l?.apiKeyPlaceholder??""),[V,K]=u.useState(p),[F,G]=u.useState(""),[C,ae]=u.useState(null),[O,L]=u.useState(!1),[me,xe]=u.useState(!1),j=s.find(r=>r.slug===m),Q=ye(j?.modalities??[]),he=n&&!!j&&Z(j),pe=j?Ee(j):!1,ge=he&&V==="oauth",je=pe&&!ge,P=ss().slug,H=u.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Te=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),ze=u.useCallback(async()=>{if(!(!P||!j)){L(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(r.authorizeUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{L(!1)}}},[P,j]),Ve=u.useCallback(async()=>{if(!(!P||!j||!F.trim())){L(!0);try{const r=await Ce(P,j.slug,{code:F.trim()});if(r.status!=="success")throw new Error(r.error||"Sign-in not complete");H(),I.success(`Signed in with ${j.displayName}`)}catch(r){I.error(r instanceof Error?r.message:"Failed to complete sign-in")}finally{L(!1)}}},[P,j,F,H]),We=u.useCallback(async()=>{if(!(!P||!j)){L(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="device")throw new Error("Unexpected sign-in mode");ae({userCode:r.userCode,deviceAuthId:r.deviceAuthId,verificationUrl:r.verificationUrl}),window.open(r.verificationUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{L(!1)}}},[P,j]),qe=u.useCallback(async()=>{if(!(!P||!j||!C)){L(!0);try{const r=await Ce(P,j.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(r.status==="success"){H(),I.success(`Signed in with ${j.displayName}`);return}ae(y=>y&&{...y,message:r.error||"Waiting for approval..."})}catch(r){I.error(r instanceof Error?r.message:"Failed to check status")}finally{L(!1)}}},[P,j,C,H]),Xe=j?.supportedAuthTypes.includes("device-code")??!1,Ye=r=>{i(r);const y=s.find(ie=>ie.slug===r);y&&(N(y.slug),b(y.displayName),w(y.baseUrl),A(y.slug===t&&o?o:y.defaultModel??""),B(y.apiKeyPlaceholder),K(n&&Z(y)?"oauth":"api-key"),G(""),ae(null),xe(!1))},fe=/^[a-z0-9][a-z0-9-]*$/.test(f),ve=fe&&je&&$.trim().length>0&&!x.isPending,Ge=r=>{if(r.preventDefault(),!ve)return;const y={};v.trim()&&(y.base_url=v.trim()),D.trim()&&(y.model=D.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;x.mutate({slug:f.trim(),kind:m,displayName:h.trim()||void 0,apiKey:$.trim(),capabilities:ie},{onSuccess:()=>d()})},be=!!(t&&s.some(r=>r.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:be&&j?`Connect ${j.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Ge,className:"grid max-w-md gap-3",children:[be&&j?e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ts,{value:m,onValueChange:Ye,children:[e.jsx(ns,{id:"ip-provider",className:"w-full",children:e.jsx(as,{})}),e.jsx(is,{children:s.map(r=>{const y=ye(r.modalities);return e.jsx(rs,{value:r.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.iconUrl?e.jsx("img",{src:r.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(os,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},r.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx(S,{id:"ip-display",placeholder:"Friendly name",value:h,onChange:r=>b(r.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:r=>N(r.target.value),autoComplete:"off",required:!0}),f&&!fe?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&pe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:V==="oauth"?"secondary":"ghost",onClick:()=>K("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:V==="api-key"?"secondary":"ghost",onClick:()=>K("api-key"),children:"API key"})]})]}):null,je?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(S,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:r=>w(r.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx(S,{id:"ip-model",placeholder:"gpt-4o-mini",value:D,onChange:r=>A(r.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-key",type:"password",placeholder:Y||void 0,value:$,onChange:r=>z(r.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(W,{onCancel:d,children:e.jsx(g,{type:"submit",disabled:!ve,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ge?e.jsxs("div",{className:"grid gap-3",children:[me?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",j?.displayName??"provider",". This covers your agents in this org."]}):Xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:O||!P,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(S,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",j?.displayName??"provider"," to approve",e.jsx(ke,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void qe(),disabled:O,children:O?"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 ze(),disabled:O||!P,children:["Sign in with ",j?.displayName??"provider",e.jsx(ke,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(S,{id:"ip-oauth-code",placeholder:"code#state",value:F,onChange:r=>G(r.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void Ve(),disabled:O||!F.trim(),children:O?"Finishing...":"Finish sign-in"})]}),e.jsx(W,{onCancel:d,children:e.jsx(g,{type:"button",onClick:Te,disabled:!me,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(W,{onCancel:d})]})]})]})}const Us={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Ms({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[o,d]=u.useState(a?"edit":null),x=cs(s.kind,t);u.useEffect(()=>{a&&d("edit")},[a]);const l=(t.find(i=>i.slug===s.kind)?.modalities??["text"]).filter(i=>i!=="text"),p=x&&l.length>0,m=i=>d(f=>f===i?null:i);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 ${ds(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"}),p?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),o==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(zs,{provider:s,supportsUpstreamConfig:x,onDone:()=>d(null)})}):null,o==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),l.map(i=>e.jsx(Vs,{providerSlug:s.slug,modality:i,block:s.capabilities[i]??{}},i))]})}):null]})}function Ts({provider:s,onDeleted:t}){const a=us(),[n,o]=u.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children: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:()=>o(!1)}),children:[a.isPending?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>o(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>o(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function zs({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=ms(),o=xs(),d=_e(),[x,c]=u.useState(s.displayName??""),[l,p]=u.useState(""),m=s.capabilities.text??{},[i,f]=u.useState(m.base_url??""),[N,h]=u.useState(m.model??""),[b,v]=u.useState(null),w=x.trim().length>0&&x.trim()!==(s.displayName??""),D=t&&l.trim().length>0,A=i.trim()!==(m.base_url??""),$=N.trim()!==(m.model??""),z=t&&(A||$),Y={base_url:i.trim()||void 0,model:N.trim()||void 0,models_endpoint:m.models_endpoint},B=Fe(Y),V=t&&z&&Le(B),K=n.isPending||o.isPending||d.isPending,F=(w||D||z)&&!V&&!K,G=async C=>{if(C.preventDefault(),!!F){v(null);try{await Promise.all([w?n.mutateAsync({providerSlug:s.slug,displayName:x.trim()}):Promise.resolve(),z?d.mutateAsync({providerSlug:s.slug,modality:"text",block:Y}):Promise.resolve(),D?o.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:G,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(S,{id:`edit-name-${s.slug}`,value:x,onChange:C=>c(C.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(S,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:i,onChange:C=>f(C.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(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(S,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:C=>h(C.target.value),autoComplete:"off"}),B.model?e.jsx("p",{className:"text-xs text-destructive",children:B.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(S,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,b?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:b}):null,e.jsx(W,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!F,children:K?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function Vs({providerSlug:s,modality:t,block:a}){const n=_e(),[o,d]=u.useState(!1),[x,c]=u.useState(a.base_url??""),[l,p]=u.useState(a.model??""),[m,i]=u.useState(a.models_endpoint??""),[f,N]=u.useState(!!a.models_endpoint),h=!!(a.base_url||a.model||a.models_endpoint),b={base_url:x.trim()||void 0,model:l.trim()||void 0,models_endpoint:m.trim()||void 0},v=Fe(b),w=Le(v),D=()=>{w||n.mutate({providerSlug:s,modality:t,block:b})};return e.jsxs("div",{className:Be,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(A=>!A),children:[e.jsx("span",{className:"text-sm font-medium",children:Us[t]}),h?e.jsx(E,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),o?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(S,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:x,onChange:A=>c(A.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(S,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:A=>p(A.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(S,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:A=>i(A.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!0),children:"Advanced"}),e.jsx(W,{onCancel:()=>d(!1),children:e.jsx(g,{size:"sm",disabled:w||n.isPending,onClick:D,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function Ws({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(Xs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(E,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(E,{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(E,{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(te,{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 qs({sandbox:s,onDeleted:t}){const a=hs(),[n,o]=u.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),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(T,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),children:"Delete sandbox"})]})})}function Xs({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(ps,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(gs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Ys={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Gs={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Nt(){const{owner:s,connectorKey:t}=q.useParams(),{instances:a}=q.useSearch(),{kind:n,id:o}=ys(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:x,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Os,{ownerSlug:d,familyKind:n,familyId:o});switch(n){case"inference":return e.jsx(Zs,{ownerSlug:d,providerSlug:o});case"sandbox":return e.jsx(Hs,{ownerSlug:d,sandboxId:o});case"sandbox-provider":return e.jsx(Qs,{ownerSlug:d,providerKind:o});default:return e.jsx(tt,{ownerSlug:d,organizationId:x,isWorkspaceLoading:c,connectorKey:t})}}})}function Qs({ownerSlug:s,providerKind:t}){const a=X();return u.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${le}${t}`},replace:!0})},[a,s,t]),null}function Hs({ownerSlug:s,sandboxId:t}){const a=X(),{data:n,isLoading:o,isError:d,refetch:x}=$e(),c=n?.sandboxes.find(p=>p.id===t)??null;if(o)return e.jsx(ue,{label:"Loading sandbox",sections:1});if(d)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 x(),children:"Retry"})]})});if(!c)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=c.name||re(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${le}${c.providerKind}`},search:{instances:!0},className:U,children:re(c.providerKind)},"family")]}),icon:e.jsx(de,{name:l,faviconDomain:Es(c.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(E,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(E,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Me,{facets:Gs})}),children:[e.jsx(Ws,{sandbox:c}),e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(qs,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Zs({ownerSlug:s,providerSlug:t}){const a=X(),{model:n,reason:o,agentId:d,addAccount:x}=q.useSearch(),{data:c=[],isLoading:l,isError:p,refetch:m}=Pe(),i=Se(),{data:f=[],isLoading:N}=i,h=x?null:c.find($=>$.slug===t)??null,b=f.find($=>$.slug===(h?.kind??t))??null;if(l||N)return e.jsx(ue,{label:"Loading account"});if(p)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 m(),children:"Retry"})]})});if(!h&&!b&&!i.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Ue,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=h?h.displayName||h.slug:b?.displayName||t,w=h!==null,D=o?e.jsx(st,{agentId:d,model:n,providerName:v}):n?e.jsx(et,{providerName:v,model:n,isConnected:w}):null,A=e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),...h?[e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${h.kind}`},search:{instances:!0},className:U,children:b?.displayName??h.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:b?.iconUrl,name:v}),title:v,badge:h?e.jsxs(e.Fragment,{children:[h.isDefault?e.jsx(E,{variant:"secondary",children:"Default"}):null,h.status?e.jsx(E,{variant:"outline",children:h.status}):null,h.hasCustomUpstream?e.jsx(E,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Me,{facets:Ys})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:A,children:[D,e.jsx("div",{className:"space-y-6",children:h?e.jsx(Ms,{provider:h,catalog:f,autoOpenEdit:!!n}):e.jsx(Js,{ownerSlug:s,providerSlug:t,existingSlugs:c.map($=>$.slug),catalog:f,catalogError:i.isError?i.error:null,model:n})}),h?e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ts,{provider:h,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Js({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:o,model:d}){const x=X(),c=n.find(m=>m.slug===t),l=a.includes(t)&&!!c&&Z(c);let p=t;for(let m=2;a.includes(p);m++)p=`${t}-${m}`;return o?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(te,{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:o instanceof Error?o.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(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${t}`},search:{},children:"Open existing connection"})})]}),(!l||c&&Ee(c))&&e.jsx(Is,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!l,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void x({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function et({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(te,{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 st({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(te,{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 tt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:o=[],isLoading:d,isError:x,refetch:c}=Ss(t??""),{data:l=[],isLoading:p,isError:m,refetch:i}=$s(t??"",{connectorKey:n}),{setup:f}=q.useSearch(),N=q.useNavigate(),h=u.useMemo(()=>o.find(w=>w.key===n),[o,n]),b=u.useMemo(()=>Ds(n,o,{name:l[0]?.connector_name??n}),[n,o,l]);if(a||d)return e.jsx(ue,{label:"Loading connector",sections:3});if(x||m)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:()=>{c(),i()},children:"Retry"})]})});const v=h?e.jsx(at,{connector:h,ownerSlug:s,organizationId:t??void 0,connectionCount:l.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ue,{connector:b,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:h&&t?e.jsx(nt,{hero:v,connector:h,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void N({search:w=>({...w,setup:void 0}),replace:!0})}):e.jsxs(M,{className:"space-y-6",children:[v,l.length>0&&!p?e.jsx(Ke,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):p?e.jsx(oe,{label:"Loading connections",rows:2}):e.jsx("div",{children:e.jsx(De,{ownerSlug:s,connectorKey:n})})]})})}function nt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:o,connections:d,isLoading:x,openNewApp:c,onNewAppHandled:l}){const{isAdmin:p,isLoading:m}=Re(a),i=(t.operations_summary?.total??0)>0,f=e.jsx(Ls,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:l});return e.jsxs(ne,{header:s,children:[x?e.jsx(oe,{label:"Loading connections",rows:2}):d.length>0?e.jsx(Ke,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:o,action:f}):f,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}),i&&m?e.jsx(oe,{label:"Loading actions",rows:2}):i&&p?e.jsx(ot,{connector:t,organizationId:a,ownerSlug:n}):i&&!p?e.jsx(R,{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]}),d.length>0?e.jsx(R,{title:"Runs",children:e.jsx(Ks,{scope:{connectorKey:o},ownerSlug:n})}):null,e.jsx(it,{connector:t,organizationId:a,ownerSlug:n})]})}function at({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:t},className:U,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Fs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Rs,{connectorDef:s,ownerSlug:t}),a?e.jsx(rt,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function it({connector:s,organizationId:t,ownerSlug:a}){const n=Cs(s.auth_schema),o=ks(s.auth_schema),d=ws(s.auth_schema),x=As(s.auth_schema),c=n.some(b=>b.type==="env_keys"),l=n.some(b=>b.type==="browser"),p=o.some(b=>b.type==="interactive"),m=!!(d||x||c||l),i=Ps(s),{data:f=[]}=we(t,{connectorKey:s.key,profileKind:"env"}),{data:N=[]}=we(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||l&&N.length>0||!m&&(i||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(Ae,{profiles:f,type:"env"}):null,l&&N.length>0?e.jsx(Ae,{profiles:N,type:"browser_session"}):null,m?null:i?e.jsx(R,{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(_,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):p?e.jsx(R,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const o=X(),{isAdmin:d}=Re(t),x=js(),[c,l]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=n>0,i=x.isPending,f=()=>{l(null),x.mutate({connector_key:s.key},{onSuccess:()=>{o({to:"/$owner/connectors",params:{owner:a}})},onError:N=>{l(N instanceof Error?N.message:"Failed to remove connector")}})};return e.jsxs(fs,{onOpenChange:()=>l(null),children:[e.jsx(vs,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(bs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),m?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(g,{variant:"destructive",size:"sm",disabled:i||m,onClick:f,children:[i?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function ot({connector:s,organizationId:t,ownerSlug:a}){const n=Oe();return e.jsx(Ie,{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 Ae({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(R,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:_s(Be,"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(Bs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=Oe(),o=Object.keys(s.feeds_schema??{}).length;return o?e.jsx(Ie,{title:"Feeds",summary:`${o} ${o===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{nt as ConnectorDetailShell,rt as ConnectorRemoveButton,Nt as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey.index-DqwSv8Zs.js.map
|
package/dist/owletto/dist/assets/{_conversationId-OJrZjd0o.js → _conversationId-zcs-S3dY.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,
|
|
2
|
-
//# sourceMappingURL=_conversationId-
|
|
1
|
+
import{j as e,dd as w,i as c,jM as h,jN as p,jO as d,jP as u,jQ as A,r as M,n as C,cO as N,jR as z}from"./index-CdDNNAx2.js";import{A as y}from"./agent-loading-shells-xteN-pyK.js";import{s as O,R as b,A as k}from"./agent-thread-Bv_chdPy.js";import{d as I}from"./events-feed-BI7wNRUY.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-D7-ld7as.js";import"./use-mention-search-CtbixPEE.js";import"./index-Vcq4gwWv.js";import"./use-automations-CdtiVLCv.js";import"./definition-comparison-BUDNuAN_.js";import"./json-diff-C-WQqyIf.js";import"./code-editor-BdRMYojw.js";import"./schema-value-k19Ata7u.js";import"./run-initiator-B8IRlRd-.js";import"./list-skeleton-0B1bTrAK.js";import"./subDays-hOwerOLo.js";import"./clients-BCvjAJDT.js";import"./renderer-DZ0w2k2r.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./copy-button-BhXeXLIm.js";import"./device-automation-Dp3faMvp.js";const P={discord:{hex:`#${u.hex}`,path:u.path},gchat:{hex:`#${d.hex}`,path:d.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${p.hex}`,path:p.path},whatsapp:{hex:`#${h.hex}`,path:h.path}};function R({platform:s,className:a}){const t=s?P[s]:null;return t?"imgSrc"in t?e.jsx("img",{src:t.imgSrc,alt:"","aria-hidden":"true",className:c("rounded-sm",a),loading:"lazy"}):e.jsx("svg",{viewBox:t.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:a,style:{color:t.hex},children:e.jsx("path",{d:t.path})}):e.jsx(w,{className:c("text-muted-foreground",a),"aria-hidden":"true"})}function S(s,a,t){return s==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function T({owner:s,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=A(a,t,{orgSlug:s}),i=M.useMemo(()=>n.map(r=>O(r,{showToolCalls:!0})).filter(r=>r!==null),[n]),[o,g]=t.split(":"),m=I(o)??"the source app",{org:f}=C(),{data:j=[]}=N(f?.id??"",{connectorKey:o}),v=j[0]?.config?.chatMetadata,l=S(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:x?e.jsx(y,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(b,{messages:i,children:e.jsx(k,{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(R,{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 ",m,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",m," →"]})]}):null]})})}function s2(){const{owner:s,agentId:a,conversationId:t}=z.useParams();return e.jsx(T,{owner:s,agentId:a,conversationId:t})}export{s2 as component};
|
|
2
|
+
//# sourceMappingURL=_conversationId-zcs-S3dY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{M as v,c as d,j as r,ar as h,aT as f,cj as x,ck as w,cl as j,cm as P,bq as g,cn as E}from"./index-CdDNNAx2.js";import{E as $}from"./event-detail-D6AH6a2C.js";import"./events-feed-BI7wNRUY.js";import"./definition-comparison-BUDNuAN_.js";import"./json-diff-C-WQqyIf.js";import"./code-editor-BdRMYojw.js";import"./index-Vcq4gwWv.js";import"./schema-value-k19Ata7u.js";import"./run-initiator-B8IRlRd-.js";import"./list-skeleton-0B1bTrAK.js";import"./subDays-hOwerOLo.js";import"./use-automations-CdtiVLCv.js";import"./clients-BCvjAJDT.js";import"./renderer-DZ0w2k2r.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./copy-button-BhXeXLIm.js";import"./device-automation-Dp3faMvp.js";import"./view-param-filters-BdN8OU35.js";import"./app-bridge-C4nPtae3.js";import"./filter-editors-DDTwyYt0.js";function b({owner:e,eventId:t,viewKey:s}){const o=v({strict:!1}),p=d(),m=(i,a)=>r.jsx($,{owner:a,organizationId:i,eventId:t,viewKey:s,params:s?j(o):{},onParamsChange:(n,c,l)=>void p({to:w(a,t,n),search:u=>x(u,c),replace:l?.replace??!0}),fullBleed:!0},`${a}/${t}`);return r.jsx(h,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):r.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):r.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function L(){const{owner:e,eventId:t}=P.useParams(),s=g({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=E(t);return o===null?null:r.jsx(b,{owner:e,eventId:o,viewKey:s?.viewKey})}export{L as component};
|
|
2
|
+
//# sourceMappingURL=_eventId-BVOVizs4.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-Cc8YX1oy.js","assets/index-CdDNNAx2.js","assets/index-9tTjJo_J.css","assets/automation-run-now-CjkJIkaZ.js","assets/event-detail-D6AH6a2C.js","assets/events-feed-BI7wNRUY.js","assets/definition-comparison-BUDNuAN_.js","assets/json-diff-C-WQqyIf.js","assets/code-editor-BdRMYojw.js","assets/index-Vcq4gwWv.js","assets/schema-value-k19Ata7u.js","assets/run-initiator-B8IRlRd-.js","assets/list-skeleton-0B1bTrAK.js","assets/subDays-hOwerOLo.js","assets/use-automations-CdtiVLCv.js","assets/clients-BCvjAJDT.js","assets/renderer-DZ0w2k2r.js","assets/card-C01y1O-W.js","assets/table-C3DMoL4K.js","assets/copy-button-BhXeXLIm.js","assets/device-automation-Dp3faMvp.js","assets/view-param-filters-BdN8OU35.js","assets/app-bridge-C4nPtae3.js","assets/filter-editors-DDTwyYt0.js","assets/needs-you-list-Bd4iiiqm.js","assets/scoped-feed-bar-L7h-Ca4u.js","assets/event-kind-options-fHAIXu24.js","assets/create-automation-form-D141prEG.js","assets/entity-options-CpeX7iiX.js","assets/model-selector-XYmk7Iru.js","assets/skill-editor-D_W3QlRz.js","assets/use-mention-search-CtbixPEE.js","assets/proposal-review-shell-BWRJidwb.js","assets/runs-CuC7WMtd.js","assets/runs-list-8gUPWjP4.js","assets/agent-loading-shells-xteN-pyK.js","assets/agent-thread-Bv_chdPy.js","assets/pending-seed-D7-ld7as.js","assets/connection-feed-detail-CJju0qiw.js","assets/status-variants-BR_iGWN5.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-D4w-JhJW.js","assets/source-record-panels-C4UItfdk.js","assets/entity-type-page-MgZ7_0oh.js","assets/views-access-required-CvIIxdS_.js","assets/dynamic-schema-form-OkIZImgp.js","assets/record-session-ClKBr1_C.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as h,j as t,r as p,C as P,L as k,u as v,a as I,b as R,c as S,d as C,D as A,e as _,f as D,g as E,h as $,i as y,B as x,k as L,S as K,A as z,X as T,l as O,_ as B,m as g,n as N,o as W,q as U,s as H,t as F,v as V,w as q,x as G,R as M,y as Q,z as X,E as J,F as Y,N as Z,O as ee}from"./index-CdDNNAx2.js";import{R as ne}from"./record-session-ClKBr1_C.js";import{u as te}from"./use-automations-CdtiVLCv.js";import{u as ae}from"./clients-BCvjAJDT.js";function j({item:e}){const n=e.href?h(e.href):null;if(!n||n.kind==="event"||n.kind==="automation"&&!("runId"in n&&n.runId!=null))return null;const a=n.owner,o=n.kind==="automation"?n.automationId:e.sourceAttribution?.automation_id??null,i=e.sourceAttribution,s=[{label:a,to:"/$owner",params:{owner:a}}];return i?.agent_id&&i.agent_name&&s.push({label:i.agent_name,to:"/$owner/agents/$agentId",params:{owner:a,agentId:i.agent_id}}),o!=null&&s.push({label:i?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:a,automationId:String(o)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?s.push({label:"Run details"}):n.kind==="memory"&&"contentIds"in n&&s.push({label:"Details"}),s.length<2?null:t.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:s.map((r,u)=>{const c=u===s.length-1,f=t.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:r.label});return t.jsxs(p.Fragment,{children:[u>0?t.jsx(P,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,r.to&&!c?t.jsx(k,{to:r.to,params:r.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:r.label}):f]},r.to??r.label)})})}const se=O(async()=>({default:(await B(async()=>{const{PeekPaneContent:e}=await import("./peek-pane-content-Cc8YX1oy.js");return{PeekPaneContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]))).PeekPaneContent}));function oe(){return t.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[t.jsx(g,{className:"h-5 w-2/3"}),t.jsx(g,{className:"h-4 w-full"}),t.jsx(g,{className:"h-24 w-full rounded-lg"})]})}const re=460,ie=480;function le({children:e}){const n=p.useRef(null),a=v(),o=I(),i=R(n,re+ie),s=!o&&i&&a?.item!=null;return t.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[t.jsx("div",{inert:s,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e}),t.jsx(ue,{covers:s})]})}function ue({covers:e=!1}){const n=v(),a=I();return n?.item?t.jsx(xe,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:a,covers:e}):null}function w({item:e,children:n}){const a=e.href?h(e.href):null;return a?.kind==="automation"&&a.runId==null&&!e.runId?t.jsx(fe,{owner:a.owner,automationId:a.automationId,fallback:e.title,children:n}):a?.kind==="agent"?t.jsx(he,{agentId:a.agentId,clientIds:a.clientIds,fallback:e.title,children:n}):a?.kind==="event"?t.jsx(ce,{owner:a.owner,eventId:a.eventId,fallback:e.title,children:n}):t.jsx(de,{item:e,children:n})}function ce({owner:e,eventId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=F(i?.id??null,void 0,{contentIds:[n]},e),r=s?.pages[0]?.content.find(u=>Number(u.id)===n);return o({title:r?V(r):a,status:null})}function de({item:e,children:n}){const a=e.href?h(e.href):null,o=a?.kind==="record-view"?a.viewKey:null,i=a?.kind==="entity-type"?a:null,s=i?.typeSlug??null,r=q({slug:o?a?.owner:void 0}),{data:u}=G(s?a?.owner??null:null),c=s?u?.find(f=>f.slug===s)?.name:void 0;return n({title:o&&r.data?.find(f=>f.key===o)?.name||c&&(i?.view==="activity"?`${c} activity`:c)||e.title,status:null})}function fe({owner:e,automationId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=te(i?.id,void 0,{includeDetails:!1}),r=s?.find(u=>u.automation_id===n);return o({title:r?.name?.trim()||a,status:r?W(U(r),Date.now()):null})}function he({agentId:e,clientIds:n,fallback:a,children:o}){const i=H({enabled:!!e}),s=ae(null,{enabled:!e&&!!n?.length}),r=e?i.data?.find(u=>u.agentId===e)?.name:s.data?.find(u=>n?.includes(u.id))?.title;return o({title:r?.trim()||a,status:null})}function me(e){const n=e.connectorPanel;if(n?.connectionId!=null)return{label:"Settings",pathname:`/${n.ownerSlug}/connectors/${encodeURIComponent(n.connectorKey)}/${n.connectionId}`,search:{settings:!0}};const a=e.href?h(e.href):null;if(a?.kind==="automation"&&a.runId==null&&!e.runId)return{label:"Edit",pathname:`/${a.owner}/automations/${encodeURIComponent(a.automationId)}`,search:{view:"definition"}};if(a?.kind==="agent"&&a.owner!=="me"){if(a.agentId)return{label:"Agent settings",pathname:`/${a.owner}/agents/${encodeURIComponent(a.agentId)}`};const o=a.clientIds?.[0];if(o)return{label:"Agent settings",pathname:`/${a.owner}/agents/connected/${encodeURIComponent(o)}`}}return null}function xe({item:e,onClose:n,onBack:a,isNarrow:o,covers:i}){const s=S(),r=e.href?h(e.href):null,u=e.runId&&r?.kind==="automation"&&r.view==="activity"?{pathname:`/${r.owner}/events`,search:{run_ids:String(e.runId)}}:e.href?C(e.href):null,c=me(e);p.useEffect(()=>{if(o)return;const d=l=>{l.defaultPrevented||l.key!=="Escape"||(l.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,o]);const f=d=>t.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-1 border-b border-border px-3 py-1.5",children:[a||d?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:a??n,children:t.jsx(L,{className:"h-4 w-4"})}):null,t.jsx(w,{item:e,children:({title:l,status:m})=>t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:l}),m?t.jsx("p",{title:m.text,className:y("truncate text-xs",m.problem?"text-destructive":"text-muted-foreground"),children:m.text}):null]})}),c?t.jsx(x,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",children:t.jsxs(k,{to:c.pathname,search:c.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:c.pathname,search:c.search??{}})))())},children:[t.jsx(K,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),c.label]})}):null,u?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:t.jsx(k,{to:u.pathname,search:u.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:u.pathname,search:u.search??{}})))())},children:t.jsx(z,{className:"h-4 w-4"})})}):null,t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:t.jsx(T,{className:"h-4 w-4"})})]}),b=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(p.Suspense,{fallback:t.jsx(oe,{}),children:t.jsx(w,{item:e,children:({title:d})=>t.jsx(se,{item:d===e.title?e:{...e,title:d}})})})});return o?t.jsx(A,{open:!0,onOpenChange:d=>{d||n()},children:t.jsxs(_,{children:[t.jsx(D,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),t.jsxs(E,{"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:[t.jsx($,{className:"sr-only",children:t.jsx(w,{item:e,children:({title:d})=>d})}),f(!0),t.jsx(j,{item:e}),b]})]})}):t.jsxs("aside",{className:y("flex flex-col border-l border-border bg-background",i?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),t.jsx(j,{item:e}),b]})}function be(){const{owner:e}=M.useParams(),{data:n,isLoading:a,error:o}=Q(e==="me"?null:e,{slug:e}),{session:i,isReady:s}=X();return J({active:Y({settled:!a,authReady:s,session:i,resolved:!!n?.workspace,error:o}),owner:e})?null:t.jsx(Z,{children:t.jsx(ne,{children:t.jsx(le,{children:t.jsx(ee,{})})})})}export{be as component};
|
|
3
|
+
//# sourceMappingURL=_owner-DsvIC94q.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jI as p,j as e,bp as m}from"./index-CdDNNAx2.js";import{M as i}from"./memory-browse-page-Ba4aYavw.js";import"./public-shell-ready-CRyAZATw.js";import"./dynamic-schema-form-OkIZImgp.js";import"./renderer-DZ0w2k2r.js";import"./schema-value-k19Ata7u.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./entity-pages-18xSANrS.js";import"./filter-editors-DDTwyYt0.js";import"./subDays-hOwerOLo.js";import"./entity-schema-graph-uwZ-P0t8.js";import"./core.esm-CJUp2aNZ.js";import"./view-param-filters-BdN8OU35.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-CH_0jHiM.js";function h(){const{owner:t,entityType:o,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:t,typeScope:m(o),create:!1,shape:r})}export{h as component};
|
|
2
|
+
//# sourceMappingURL=_shape-CWjpzcvv.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{dq as l,G as m,c as y,dr as g,ds as u,j as t,ar as c,as as x,bS as E}from"./index-CdDNNAx2.js";import{E as f}from"./entity-type-page-MgZ7_0oh.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-BdRMYojw.js";import"./index-Vcq4gwWv.js";function S(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=m(),o=y(),{data:i=[],isLoading:r}=g(s),e=i.find(d=>d.slug===n)??null,p=e?u(e):!1;return t.jsx(c,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(x,{children:r?t.jsx(E,{label:"entity type",variant:"panel"}):e?t.jsx(f,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner",params:{owner:a},search:{layout:"graph"}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{S as component};
|
|
2
|
+
//# sourceMappingURL=_slug-DuCxYsJk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jS as e,j as p,bp as i}from"./index-CdDNNAx2.js";import{M as m}from"./memory-browse-page-Ba4aYavw.js";import"./public-shell-ready-CRyAZATw.js";import"./dynamic-schema-form-OkIZImgp.js";import"./renderer-DZ0w2k2r.js";import"./schema-value-k19Ata7u.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./entity-pages-18xSANrS.js";import"./filter-editors-DDTwyYt0.js";import"./subDays-hOwerOLo.js";import"./entity-schema-graph-uwZ-P0t8.js";import"./core.esm-CJUp2aNZ.js";import"./view-param-filters-BdN8OU35.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-CH_0jHiM.js";function l(){const{owner:t,entityType:o,viewKey:r}=e.useParams();return p.jsx(m,{ownerSlug:t,typeScope:i(o),create:!1,viewKey:r})}export{l as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-BqVeHB6Z.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jJ as t,j as m}from"./index-CdDNNAx2.js";import{M as i}from"./memory-browse-page-Ba4aYavw.js";import"./public-shell-ready-CRyAZATw.js";import"./dynamic-schema-form-OkIZImgp.js";import"./renderer-DZ0w2k2r.js";import"./schema-value-k19Ata7u.js";import"./card-C01y1O-W.js";import"./table-C3DMoL4K.js";import"./entity-pages-18xSANrS.js";import"./filter-editors-DDTwyYt0.js";import"./subDays-hOwerOLo.js";import"./entity-schema-graph-uwZ-P0t8.js";import"./core.esm-CJUp2aNZ.js";import"./view-param-filters-BdN8OU35.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-CH_0jHiM.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-DzyOCG5U.js.map
|
package/dist/owletto/dist/assets/{accept-invitation-BC-ZIsrf.js → accept-invitation-k1u3zBcn.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z as l,ap as u,r as c,$ as m,j as e,aq as d,ad as h,an as f}from"./index-
|
|
2
|
-
//# sourceMappingURL=accept-invitation-
|
|
1
|
+
import{z as l,ap as u,r as c,$ as m,j as e,aq as d,ad as h,an as f}from"./index-CdDNNAx2.js";import{S as v,A as x,a as g}from"./index-Cd8jMsz8.js";import{F as p}from"./full-page-spinner-DWo519BU.js";function j({alt:t="",...a}){return e.jsx("img",{alt:t,...a,referrerPolicy:"no-referrer"})}function w({children:t}){const a=h(),n=async i=>{await a.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(g,{authClient:f,navigate:i=>{n(()=>{window.location.href=i})},replace:i=>{n(()=>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:a}=l(),{invitationId:n}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{a.isPending||t||!n||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(n)}`,{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(n)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,a.isPending,n]),t&&!n?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(v,{children:e.jsx(x,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
|
|
2
|
+
//# sourceMappingURL=accept-invitation-k1u3zBcn.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{G as ie,n as $e,bp as fe,cq as Pe,M as mt,r as h,cr as ht,cs as Oe,ct as xt,ax as pt,cu as gt,j as e,bS as ft,bd as re,cv as Z,cw as De,cx as yt,B as z,L as O,cy as je,cz as bt,q as jt,cA as vt,cB as Nt,cC as wt,cD as He,cE as kt,cF as St,cG as Ct,T as q,br as de,bs as ue,bt as me,bu as he,bv as ne,cH as Lt,U as We,cI as Et,bT as Tt,cJ as Mt,cK as _t,cL as It,x as Fe,cM as At,c as Rt,u as Ke,cN as Be,cO as Ge,cP as ze,cQ as Ye,cR as $t,cS as Pt,cT as Ue,aO as Ot,aQ as Dt,c2 as Ht,a6 as Wt,i as P,cU as Ve,X as Ft,s as Kt,cV as Bt,cW as Gt,cX as zt,m as W,cY as Yt,cZ as Ut,c_ as Vt,a4 as Xt,c$ as Se,d0 as Qt,d1 as qt,d2 as Zt,d3 as Jt,d4 as en,d5 as tn,d6 as nn,d7 as sn,d8 as an,d9 as on,aD as rn,da as cn,db as ln,dc as dn,dd as un,de as Xe,bg as mn,df as hn,bl as xn,d as Qe,dg as pn,dh as gn,di as fn,dj as yn,dk as bn,dl as jn,dm as vn,dn as Nn,ar as wn,aT as kn,as as Sn}from"./index-CdDNNAx2.js";import{R as Cn,E as Ln,M as En}from"./record-activity-9ux6SfCd.js";import{M as Tn}from"./member-scope-gate-CH_0jHiM.js";import{N as Mn}from"./needs-you-list-Bd4iiiqm.js";import{H as xe,n as pe,s as _n,l as In,b as An,a as Rn,G as $n,c as Pn}from"./entity-schema-graph-uwZ-P0t8.js";import{u as qe}from"./use-automations-CdtiVLCv.js";import{f as On}from"./feed-event-kinds-BYuZCoU4.js";import{a as Ze}from"./list-skeleton-0B1bTrAK.js";import{u as Dn}from"./clients-BCvjAJDT.js";import{u as Hn}from"./client-activity-scopes-BBIq16tG.js";import{g as Wn}from"./client-rows-DGh1O-Fu.js";import{P as Fn}from"./public-shell-ready-CRyAZATw.js";function Kn({organizationId:t,ownerSlug:n,typeScope:s,entityScope:o}){const{orgContext:r}=ie(),{isMember:d,isLoading:a}=$e(),l=d&&!!t,m=s?fe(s):void 0,u=!o&&!m,b=Pe(l?n:null),S=mt({strict:!1}),x=h.useMemo(()=>ht(Oe(b.attentionCards),S),[b.attentionCards,S]),{feeds:p,pageIds:E}=xt(t,h.useMemo(()=>x.map(({item:R})=>R),[x])),i=h.useMemo(()=>[...x].sort((R,w)=>Number(E.has(w.item.id))-Number(E.has(R.item.id))),[x,E]),g=h.useMemo(()=>({approvalRunIds:new Set(i.flatMap(({item:R})=>R.approvalRunId!=null?[R.approvalRunId]:[])),eventIds:new Set(i.flatMap(({item:R,unreadIds:w})=>[...R.notificationId!=null?[R.notificationId]:[],...w]))}),[i]),N=R=>{R.length>0&&b.markManyRead.mutateAsync(R)},{data:y,isLoading:j,error:v}=pt(o?`/${n}/${gt(o)}`:`/${n}`,r),k=o?y?.entity:void 0,$=(o?k?.entity_type??fe(o.split("/").at(-2)??""):m)==="$member",H=o!=null&&!j&&(v!=null||y?.entity==null),I=o?void 0:y?.counts,K=I?I.connections>0||I.agents>0:!1,_=l&&!a&&!j&&I!=null&&!K,F=o&&j?e.jsx(ft,{label:"Loading record…"}):H?e.jsx(re,{icon:Z,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):k?e.jsx(Cn,{ownerSlug:n,entity:k,organizationId:t}):e.jsx(Ln,{organizationId:t,ownerSlug:n,hideSourceFilter:!0,scopedEntityTypes:m?[m]:void 0,pinned:u?{needsYou:b.isError?e.jsx("p",{role:"alert",className:"mb-4 text-sm text-destructive",children:"Could not load what needs you. Refresh to try again."}):e.jsx(Mn,{owner:n,entries:i,pageIds:E,onMarkRead:N,markPending:b.markManyRead.isPending}),rows:p.length>0?e.jsx(De,{organizationId:t,feeds:p}):null,hidden:g}:void 0,toolbar:!0,emptyState:_?e.jsx(Bn,{ownerSlug:n}):void 0});return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[o?null:e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Activity"}),$?e.jsx(Tn,{children:F}):F]})}function Bn({ownerSlug:t}){return e.jsx("div",{className:"px-6",children:e.jsx(re,{icon:yt,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(z,{asChild:!0,children:e.jsxs(O,{to:"/$owner/connectors/create",params:{owner:t},children:[e.jsx(je,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(z,{asChild:!0,variant:"outline",children:e.jsxs(O,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(bt,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const Ce={trigger:"runs on arrival",delivery:"delivers here"};function Gn(t){const n=new Map,s=(o,r,d,a)=>{const l=Number(o);if(!Number.isInteger(l)||l<=0)return;const m=n.get(l)??[],u=m.find(b=>b.automation.automation_id===r.automation_id);if(u){if(u.reason===d)for(const b of a)u.eventTypes.includes(b)||u.eventTypes.push(b);return}m.push({automation:r,reason:d,eventTypes:[...a]}),n.set(l,m)};for(const o of t){for(const r of o.triggers??[]){const d=Array.isArray(r.event_types)?r.event_types.map(String):[];s(r.connection_id,o,"trigger",d)}s(o.delivery_target?.connection_id,o,"delivery",[])}return n}function zn(t){const n=new Map;for(const s of t){const o=n.get(s.connection_id)??[];o.push(s),n.set(s.connection_id,o)}return n}function Yn(t){const n=(s,o,r)=>`${s} ${s===1?o:r}`;return[n(t.feeds,"feed","feeds"),t.actions>0?n(t.actions,"action","actions"):null,t.automations>0?n(t.automations,"Automation","Automations"):null].filter(Boolean).join(" · ")}const ye="connector:",Le=t=>`${ye}${t}`,Un={event:"Zap",schedule:"CalendarClock",manual:"Hand"},Vn=0,Xn=1,Ee=2;function Qn(t,n){const s=new Map;for(const{kind:o,targets:r}of On(t?.feeds_schema?.[n]))for(const{entityType:d,creates:a}of r){const l=s.get(d)??{creates:!1,eventKinds:new Set};l.creates||=a,l.eventKinds.add(o),s.set(d,l)}return s}function qn(t,n){const s=new Map(t.connectorDefs.map(i=>[i.key,i])),o=new Map(t.connectorDefs.map(i=>[i.key,i.name])),r=new Map(t.connections.map(i=>[i.id,i])),d=zn(t.feeds),a=i=>`connection:${i}`,l=i=>`automation:${i}`,m=[],u=(i,g,N,y,j=!1)=>{m.push({id:`flow:${i}->${g}`,source:i,target:g,layoutReversed:j,data:{relationships:[],isSymmetric:!1,flow:{summary:N,details:y}}})},b=new Set(t.connections.map(i=>i.id));for(const i of t.connections){const g=new Map;for(const N of d.get(i.id)??[]){const y=Qn(s.get(i.connector_key),N.feed_key);for(const[j,v]of y){const k=g.get(j)??{creates:!1,eventKinds:new Set};k.creates||=v.creates;for(const T of v.eventKinds)k.eventKinds.add(T);g.set(j,k)}}for(const[N,y]of g){const j=n.get(N);j&&u(a(i.id),j,y.creates?"creates records":"links records",[`From ${[...y.eventKinds].sort().join(", ")} events`])}}const S=Gn(t.automations);for(const[i,g]of S)if(b.has(i))for(const{automation:N,reason:y,eventTypes:j}of g){const v=l(N.automation_id);y==="trigger"?u(a(i),v,Ce.trigger,j.length>0?[`On ${[...j].sort().join(", ")}`]:[]):u(v,a(i),Ce.delivery,[],!0)}const x=[];for(const i of t.automations){const g=l(i.automation_id),N=i.entity_type?n.get(i.entity_type):void 0;N&&u(N,g,"anchored here",[i.entity_name?`On ${i.entity_name}`:""].filter(Boolean));const y=jt(i,o,r),j=vt(i),v=i.health==="degraded"?"Needs attention":void 0;x.push({id:g,lane:Ee,width:pe(`${y.does} ${v??""}`,y.when),height:xe,data:{slug:g,label:y.does,icon:j?Le(j):Un[y.kind],isSystem:!1,badge:v,metaLabel:y.when,ref:{kind:"automation",automationId:i.automation_id}}})}const p=[];for(const i of t.metrics){const g=n.get(i.typeSlug);if(!g)continue;const N=`metric:${i.typeSlug}:${i.name}`;u(g,N,"measures",[i.description].filter(Boolean)),p.push({id:N,lane:Ee,width:pe(i.name,i.agg),height:xe,data:{slug:N,label:i.name,icon:"ChartColumn",isSystem:!1,metaLabel:i.agg,ref:{kind:"metric",typeSlug:i.typeSlug,name:i.name}}})}return{nodes:[...t.connections.map(i=>{const g=Nt(i),N=wt(i,s.get(i.connector_key)),y=Yn({feeds:d.get(i.id)?.length||i.feed_count,actions:i.operations_summary?.total??0,automations:S.get(i.id)?.length??0}),j=N.needsAttention?"Needs attention":i.device_label??void 0;return{id:a(i.id),lane:Vn,width:pe(`${g} ${j??""}`,y),height:xe,data:{slug:a(i.id),label:g,icon:Le(i.connector_key),isSystem:!1,badge:j,metaLabel:y,ref:{kind:"connection",connectorKey:i.connector_key,connectionId:i.id}}}}),...x,...p],edges:m}}function Je(t){switch(t.data.ref?.kind){case"connection":return"connections";case"automation":return"automations";case"metric":return"metrics";default:return"entities"}}function Zn(t,n){const s=new Map;for(const m of t.nodes)(!m.data.organizationSlug||!s.has(m.data.slug))&&s.set(m.data.slug,m.id);const o=qn(n,s),{layers:r}=n,d=[...o.nodes,...t.nodes.map(m=>({...m,lane:Xn}))].filter(m=>r[Je(m)]),a=new Set(d.map(m=>m.id)),l=[...t.edges,...o.edges].filter(m=>a.has(m.source)&&a.has(m.target));return{nodes:d,edges:l}}const Te="__new__";function Me(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function Jn({entityTypes:t,initialSource:n="",initialTarget:s="",onDone:o}){const r=h.useId(),d=`${r}-relationship`,a=`${r}-name`,l=`${r}-symmetric`,m=`${r}-source`,u=`${r}-target`,{orgContext:b}=ie(),{data:S=[]}=He(b),x=kt(),p=St(),[E,i]=h.useState(""),[g,N]=h.useState(""),[y,j]=h.useState(!1),[v,k]=h.useState(n),[T,$]=h.useState(s),[H,I]=h.useState(null),K=E===Te,_=S.filter(w=>w.status==="active"&&w.purpose!==Ct&&(!w.organization_slug||w.organization_slug===b?.slug)),F=x.isPending||p.isPending,R=async()=>{if(I(null),!E)return I("Pick a relationship");if(!v||!T)return I("Pick both ends");try{let w=E;if(K){const G=g.trim();if(!G)return I("Name the relationship");const D=Me(G);if(!D)return I("Name must contain a letter or number");w=(await x.mutateAsync({slug:D,name:G,is_symmetric:y})).relationship_type.slug,i(w)}await p.mutateAsync({slug:w,source_entity_type_slug:v,target_entity_type_slug:T}),o()}catch(w){I(w instanceof Error?w.message:"Could not save")}};return e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-muted/30 p-3",children:[e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"Relationships are defined once for the workspace, then paired with the types they connect."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:d,className:"text-xs after:ml-1 after:text-destructive after:content-['*']",children:"Relationship"}),e.jsxs(de,{value:E,onValueChange:i,children:[e.jsx(ue,{id:d,className:"h-8 text-xs",children:e.jsx(me,{placeholder:"Pick or define one"})}),e.jsxs(he,{children:[_.map(w=>e.jsx(ne,{value:w.slug,children:w.name||w.slug},w.slug)),_.length>0?e.jsx(Lt,{}):null,e.jsx(ne,{value:Te,children:"Define a new one…"})]})]})]}),K?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:a,className:"text-xs after:ml-1 after:text-destructive after:content-['*']",children:"Name"}),e.jsx(We,{id:a,value:g,onChange:w=>N(w.target.value),placeholder:"works at",className:"h-8 text-xs"}),g.trim()?e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Slug: ",e.jsx("code",{children:Me(g)||"—"})]}):null]}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs(q,{htmlFor:l,className:"text-xs font-normal",children:["Symmetric",e.jsx("span",{className:"mt-0.5 block text-[11px] text-muted-foreground",children:"Both ends mean the same thing, like “connected with”."})]}),e.jsx(Et,{id:l,checked:y,onCheckedChange:j})]})]}):null,e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:m,className:"text-xs after:ml-1 after:text-destructive after:content-['*']",children:"From"}),e.jsxs(de,{value:v,onValueChange:k,children:[e.jsx(ue,{id:m,className:"h-8 text-xs",children:e.jsx(me,{placeholder:"Type"})}),e.jsx(he,{children:t.map(w=>e.jsx(ne,{value:w.slug,children:w.label},w.slug))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:u,className:"text-xs after:ml-1 after:text-destructive after:content-['*']",children:"To"}),e.jsxs(de,{value:T,onValueChange:$,children:[e.jsx(ue,{id:u,className:"h-8 text-xs",children:e.jsx(me,{placeholder:"Type"})}),e.jsx(he,{children:t.map(w=>e.jsx(ne,{value:w.slug,children:w.label},w.slug))})]})]}),H?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:H}):null,e.jsx(Tt,{onCancel:o,cancelDisabled:F,className:"[&>button]:h-7 [&>button]:px-3 [&>button]:text-xs",children:e.jsx(z,{type:"button",size:"sm",onClick:R,disabled:F,children:F?"Saving…":"Add relationship"})})]})}const et=288,se=240,ae=720,es=320,ve="lobu.schema-panel-width:v1";function oe(t,n){if(!Number.isFinite(t))return et;const s=Math.max(se,Math.min(ae,n-es));return Math.round(Math.min(s,Math.max(se,t)))}function ts(){const t=Mt(ve);if(t===null)return null;const n=Number.parseInt(t,10);return!Number.isFinite(n)||n<se||n>ae?null:n}function ns(t){_t(ve,String(Math.round(t)))}function ss(){It(ve)}const _e={nodes:[],edges:[]};function as(t,n,s){const{orgContext:o}=ie(),{data:r=[],isLoading:d,isError:a}=Fe(o),{data:l=[],isLoading:m,isError:u}=He(o),b=h.useMemo(()=>_n(l,t),[l,t]),{data:S,isLoading:x,isError:p}=At(o),E=h.useMemo(()=>{const v=new Map(b.map(T=>[T.id,T.slug])),k={};for(const T of S??[]){const $=v.get(T.relationship_type_id);$&&(k[$]??=[]).push(T)}return k},[S,b]),i=h.useMemo(()=>({entityTypes:r,relationshipTypes:b,rulesBySlug:E,ownerSlug:t,targetAspect:n,flow:s}),[r,b,E,t,n,s]),[g,N]=h.useState(null),y=d||m||x,j=a||u||p;return h.useEffect(()=>{if(y||j)return;let v=!1;const k={targetAspect:i.targetAspect};let T;return i.flow?T=In(Zn(An(i),i.flow),k):T=Rn(i,k),T.then($=>{v||N({graph:$,isError:!1})}).catch(()=>{v||N({graph:_e,isError:!0})}),()=>{v=!0}},[i,y,j]),{graph:g?.graph??_e,isLoading:!j&&!g,isError:j||g?.isError===!0}}function Ie(t){const n=t.ruleCount>1?` ×${t.ruleCount}`:"",s=typeof t.linkCount=="number"?` · ${t.linkCount.toLocaleString()}`:"";return`${t.label}${n}${s}`}const be={connections:"--chart-3",entities:"--chart-5",automations:"--chart-2",metrics:"--chart-4"};function os(t,n){const s=t.nodes.some(a=>a.data.ref),o=new Map(t.nodes.map(a=>[a.id,a.data.label])),r=t.nodes.map(a=>({id:a.id,x:a.position.x+a.width/2,y:a.position.y+a.height/2,w:a.width,h:a.height,title:a.data.label,meta:a.data.metaLabel,icon:a.data.icon,badge:a.data.badge??a.data.organizationSlug,muted:a.data.isSystem,dimmed:n?!n.nodes.has(a.id):!1,accent:s?be[Je(a)]:void 0})),d=t.edges.map(a=>{const{relationships:l,isSymmetric:m,flow:u}=a.data;if(u)return{id:a.id,source:a.source,target:a.target,route:a.route??null,summary:u.summary,details:[u.summary,...u.details],directed:!0,dimmed:n?!n.edges.has(a.id):!1,ariaLabel:`${o.get(a.source)??a.source} to ${o.get(a.target)??a.target}: ${u.summary}`};const b=l.map(S=>S.label).join(", ");return{id:a.id,source:a.source,target:a.target,route:a.route??null,summary:l.length===1?Ie(l[0]):`${l.length} relationships`,details:l.map(Ie),directed:!m,dimmed:n?!n.edges.has(a.id):!1,ariaLabel:`${o.get(a.source)??a.source} ${m?"and":"to"} ${o.get(a.target)??a.target}: ${b}`}});return{boxes:r,edges:d}}const Ae=[{key:"connections",label:"Connections"},{key:"entities",label:"Entities"},{key:"automations",label:"Automations"},{key:"metrics",label:"Metrics"}],is={count:"Count",count_distinct:"Distinct count",sum:"Sum",min:"Minimum",max:"Maximum"};function rs({metric:t,ownerSlug:n}){const s=(o,r)=>r.length>0?e.jsxs("section",{className:"flex flex-col gap-1.5",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:o}),e.jsx("ul",{className:"flex flex-col gap-1 text-sm",children:r.map(d=>e.jsxs("li",{children:[e.jsx("span",{className:"font-medium",children:d.name}),d.description?e.jsx("span",{className:"text-muted-foreground",children:` · ${d.description}`}):null]},d.name))})]}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"flex flex-col gap-1",children:[e.jsxs("p",{className:"text-sm",children:[is[t.agg]??t.agg," of"," ",e.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:t.eventSet})," ","events, per ",t.typeLabel]}),t.description?e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}):null]}),s("Data from",t.sources.map(o=>({name:o,description:""}))),s("Group by",t.dimensions),s("Segments",t.segments),e.jsx(z,{asChild:!0,variant:"outline",size:"sm",className:"self-start",children:e.jsxs(O,{to:"/$owner/$entityType",params:{owner:n,entityType:t.typeSlug},children:["Open ",t.typeLabel]})})]})}function cs({ownerSlug:t,metric:n,endpointOptions:s,canAuthor:o,mode:r,onModeChange:d}){const a=()=>d({kind:"index"});return r.kind==="metric"?n?e.jsx(rs,{metric:n,ownerSlug:t}):null:o&&r.kind==="new-relationship"?e.jsx(Jn,{entityTypes:s,initialSource:r.source,initialTarget:r.target,onDone:a},`${r.source??""}|${r.target??""}`):null}function ls(t){const{mode:n,canAuthor:s,onModeChange:o,isPeekOpen:r}=t,d=n.kind==="metric"?n.name:s&&n.kind==="new-relationship"?"New relationship":"Data map",a=h.useRef(null),l=JSON.stringify(n),m=h.useRef(l);return h.useEffect(()=>{m.current!==l&&(m.current=l,a.current?.focus({preventScroll:!0}))},[l]),e.jsx("aside",{style:{"--schema-panel-width":`${t.width}px`},className:P("order-first flex w-full shrink-0 flex-col lg:order-none lg:w-[var(--schema-panel-width)]",n.kind==="index"?"lg:absolute lg:top-0 lg:right-6 lg:z-10 lg:w-max lg:max-w-[calc(100%-3rem)] lg:max-h-[calc(100%-2rem)]":"bg-background lg:relative",r&&"lg:hidden"),children:e.jsxs("div",{className:P("flex min-h-0 flex-1 flex-col",n.kind!=="index"&&"lg:absolute lg:inset-0"),children:[e.jsxs("div",{className:n.kind==="index"?"sr-only":"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[e.jsx("h2",{ref:a,tabIndex:-1,className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground outline-none",children:d}),n.kind!=="index"?e.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close",onClick:()=>o({kind:"index"}),children:e.jsx(Ft,{className:"h-4 w-4"})}):null]}),e.jsx("div",{className:P("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto",n.kind==="index"?"pb-1":"p-4"),children:e.jsx(cs,{...t})})]})})}function tt(t){const n=t.previousElementSibling,s=t.nextElementSibling;if(n instanceof HTMLElement&&s instanceof HTMLElement){const o=n.clientWidth+s.clientWidth;if(o>0)return o}return 0}function ds({width:t,maxWidth:n,onResize:s,onCommit:o,onReset:r,className:d}){const[a,l]=h.useState(!1),m=h.useRef(0),u=x=>{const p=tt(x);return p>0?p:x.parentElement?.clientWidth??0},b=x=>{if(x.button!==0)return;const p=x.currentTarget;if(!p.parentElement)return;x.preventDefault(),m.current=u(p);const i=x.clientX,g=t;l(!0),p.setPointerCapture(x.pointerId);const N=k=>oe(g-(k-i),m.current);let y=g;const j=k=>{y=N(k.clientX),s(y)},v=k=>{p.removeEventListener("pointermove",j),p.removeEventListener("pointerup",v),p.removeEventListener("pointercancel",v),l(!1),o(k.type==="pointercancel"?y:N(k.clientX))};p.addEventListener("pointermove",j),p.addEventListener("pointerup",v),p.addEventListener("pointercancel",v)},S=x=>{const p=u(x.currentTarget),E=i=>{x.preventDefault(),o(oe(t+i,p))};x.key==="ArrowLeft"?E(16):x.key==="ArrowRight"?E(-16):x.key==="Home"&&(x.preventDefault(),r())};return e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize map panel","aria-valuenow":t,"aria-valuemin":se,"aria-valuemax":n,tabIndex:0,onPointerDown:b,onKeyDown:S,onDoubleClick:r,className:P("group hidden shrink-0 cursor-col-resize touch-none items-stretch justify-center px-1.5 outline-none lg:flex",a&&"cursor-col-resize",d),children:e.jsx("div",{className:P("w-px rounded-full bg-border transition-[background-color,width] group-hover:w-0.5 group-hover:bg-primary/60 group-focus-visible:w-0.5 group-focus-visible:bg-primary",a&&"w-0.5 bg-primary")})})}function us({ownerSlug:t,renderToolbar:n}){const s=Rt(),o=Ke(),r=o?.item!=null,{orgContext:d}=ie(),{isAdmin:a}=Be(d.organizationId),[l,m]=h.useState({connections:!0,entities:!0,automations:!0,metrics:!0}),[u,b]=h.useState({kind:"index"}),S=o?.close,x=h.useCallback(c=>{c.kind!=="index"&&r&&S?.(),b(c)},[r,S]),[p,E]=h.useState(),i=h.useRef(null),g=h.useCallback(c=>{if(i.current?.disconnect(),i.current=null,!c||typeof ResizeObserver>"u")return;const f=()=>{if(!c.clientWidth||!c.clientHeight)return;const A=Math.round(c.clientHeight/c.clientWidth*10)/10;E(C=>C===A?C:A)};f();const M=new ResizeObserver(f);M.observe(c),i.current=M},[]),N=d.organizationId,y=Ge(N),j=ze(N),v=Ye(N),k=qe(N??void 0),{data:T}=Fe(d),$=h.useMemo(()=>T?.filter(c=>$t(c,t)),[T,t]),H=h.useMemo(()=>($??[]).flatMap(c=>Object.entries(c.metrics_config?.measures??{}).map(([f,M])=>({typeSlug:c.slug,name:f,agg:M.agg,description:M.description}))),[$]),I=y.isLoading||j.isLoading||v.isLoading||k.isLoading,K=h.useMemo(()=>I?null:{connections:y.data??[],feeds:j.data??[],connectorDefs:v.data??[],automations:k.data??[],metrics:H,layers:l},[I,y.data,j.data,v.data,k.data,H,l]),{graph:_,isLoading:F,isError:R}=as(t,p,K),w=F||I,G={connections:!I&&(y.data??[]).length===0,entities:!1,automations:!I&&(k.data??[]).length===0,metrics:!I&&H.length===0},D=u.kind==="metric"?u:null,Y=h.useMemo(()=>{if(!D)return null;const c=`metric:${D.typeSlug}:${D.name}`,f=_.edges.find(C=>C.target===c);if(!f)return null;const M=f.source,A=_.edges.filter(C=>C.target===M&&_.nodes.find(U=>U.id===C.source)?.data.ref?.kind==="connection");return{typeId:M,nodes:new Set([c,M,...A.map(C=>C.source)]),edges:new Set([f.id,...A.map(C=>C.id)]),sources:A.map(C=>_.nodes.find(U=>U.id===C.source)?.data.label??C.source)}},[D,_]),{boxes:Q,edges:J}=h.useMemo(()=>os(_,Y),[_,Y]),X=h.useMemo(()=>{if(!D)return null;const c=$?.find(A=>A.slug===D.typeSlug),f=c?.metrics_config,M=f?.measures?.[D.name];return!c||!M?null:{name:D.name,typeSlug:c.slug,typeLabel:c.name||c.slug,agg:M.agg,eventSet:M.eventSet,description:M.description,dimensions:Object.entries(f?.dimensions??{}).map(([A,C])=>({name:A,description:C.description})),segments:Object.entries(f?.segments??{}).map(([A,C])=>({name:A,description:C.description})),sources:Y?.sources??[]}},[D,$,Y]),B=h.useMemo(()=>new Map(_.nodes.map(c=>[c.id,c.data.slug])),[_.nodes]),V=h.useMemo(()=>new Map(_.nodes.flatMap(c=>c.data.ref?[[c.id,c.data.ref]]:[])),[_.nodes]),ee=h.useMemo(()=>{const c=new Map;for(const f of _.nodes)f.data.ref||(!f.data.organizationSlug||!c.has(f.data.slug))&&c.set(f.data.slug,{slug:f.data.slug,label:f.data.label});return[...c.values()]},[_.nodes]),L=h.useCallback(c=>{const f=V.get(c);if(f?.kind==="connection"){s({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:f.connectorKey,connectionId:String(f.connectionId)},search:{}});return}if(f?.kind==="metric"){x({kind:"metric",typeSlug:f.typeSlug,name:f.name});return}if(f?.kind==="automation"){s({to:"/$owner/automations/$automationId",params:{owner:t,automationId:f.automationId},search:{view:"activity",run_id:void 0}});return}s(Pt(t,B.get(c)??c))},[s,t,B,V,x]),nt=h.useCallback((c,f)=>{V.has(c)||V.has(f)||x({kind:"new-relationship",source:B.get(c)??c,target:B.get(f)??f})},[B,V,x]),st=h.useCallback(c=>{const f=c.startsWith(ye)?c.slice(ye.length):null;if(!f)return e.jsx(Ue,{icon:c||null,className:"h-4 w-4"});const M=Ot(f,v.data??[],{name:y.data?.find(A=>A.connector_key===f)?.connector_name??f});return e.jsx(Dt,{plain:!0,icon:M.icon,iconUrl:M.iconUrl,name:M.name,faviconDomain:M.faviconDomain})},[v.data,y.data]),at=!_.nodes.some(c=>c.data.ref!=null||!c.data.isSystem&&!c.data.organizationSlug),Ne=u.kind==="metric"||a&&u.kind!=="index",[ot,ce]=h.useState(()=>ts()),we=ot??et,[te,it]=h.useState(null),le=h.useRef(null),rt=h.useCallback(c=>{if(le.current?.disconnect(),le.current=null,!c||typeof ResizeObserver>"u")return;const f=c.children[1];if(!f)return;const M=()=>{const C=tt(f);C>0&&it(U=>U===C?U:C)};M();const A=new ResizeObserver(M);A.observe(c),le.current=A},[]),ke=te===null?we:oe(we,te),ct=te===null?ae:oe(ae,te),lt=h.useCallback(c=>{ce(c),ns(c)},[]),dt=h.useCallback(()=>{ce(null),ss()},[]);if(w)return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[n(null),e.jsx($n,{label:"Loading data map",fill:!0})]});if(R)return e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[n(null),e.jsx(Ht,{label:"data map"})]});const ut=e.jsxs("fieldset",{className:"m-0 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 border-0 p-0 text-sm",children:[e.jsx("legend",{className:"sr-only",children:"Show on the map"}),Ae.map(({key:c,label:f})=>{const M=`memory-map-show-${c}`,A=l[c]&&!G[c]&&Ae.filter(({key:C})=>l[C]&&!G[C]).length===1;return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Wt,{id:M,checked:l[c],disabled:A,style:{borderColor:`var(${be[c]})`,backgroundColor:l[c]?`var(${be[c]})`:void 0},onCheckedChange:C=>m(U=>({...U,[c]:C===!0}))}),e.jsx("label",{htmlFor:M,className:"inline-flex cursor-pointer select-none items-center",children:f})]},c)})]});return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[e.jsx("div",{className:P(Ne&&"hidden lg:block"),children:n(ut)}),e.jsxs("div",{ref:rt,className:"relative flex min-h-0 min-w-0 flex-1 flex-col gap-3 lg:-mr-6 lg:-mb-8 lg:flex-row lg:gap-0",children:[e.jsx("div",{className:P("flex min-w-0 flex-1 flex-col lg:pb-8",Ne&&"hidden lg:flex"),children:e.jsxs("div",{ref:g,className:"flex min-h-[420px] min-w-0 flex-1 flex-col overflow-hidden rounded-lg bg-background",children:[e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(Pn,{boxes:Q,edges:J,label:"Data map",onOpenBox:L,openLabel:c=>`Open ${c.title}`,onConnect:a?nt:void 0,renderIcon:st})}),at?e.jsx(re,{icon:Z,iconElement:e.jsx(Z,{"aria-hidden":"true",className:"mb-2 h-6 w-6 opacity-50"}),title:"No record types yet",description:a?"Add the types of record you track.":"An admin adds the types of record this workspace tracks.",children:a?e.jsx(z,{asChild:!0,size:"sm",className:"mt-3",children:e.jsxs(O,{to:"/$owner/entity-types/new",params:{owner:t},children:[e.jsx(Ve,{className:"mr-1.5 h-4 w-4"}),"Add entity type"]})}):null}):null]})}),e.jsx(ds,{width:ke,maxWidth:ct,onResize:ce,onCommit:lt,onReset:dt,className:r||u.kind==="index"?"lg:hidden":void 0}),e.jsx(ls,{width:ke,metric:X,ownerSlug:t,endpointOptions:ee,canAuthor:a,mode:u,onModeChange:x,isPeekOpen:r})]})]})}const Re=12,ms=5e3;function hs(t,n){const s=!!t&&!!n.organizationId&&(n.enabled??!0),o=Kt({enabled:s}),{data:r}=o,d=r??[],a=h.useMemo(()=>d.map(p=>p.agentId),[d]),{threads:l,isLoading:m,isError:u}=Bt(t,a,{enabled:s&&a.length>0,limit:Re}),b=Hn({enabled:s,limit:Re,excludeCommandClients:!1,organizationId:n.organizationId,refetchInterval:p=>p?ms:!1}),S=n.organizationId?b.data:void 0;return{items:h.useMemo(()=>[...l.map(p=>({kind:"conversation",at:p.updatedAt,thread:p})),...(S??[]).map(p=>({kind:"mcp",at:p.lastCallAt,conversation:p}))].sort((p,E)=>E.at-p.at),[S,l]),agents:d,isLoading:s&&(o.isLoading||m||b.isLoading),isError:o.isError||u||b.isError}}const xs={code:Vt,crm:Ut,network:Yt};function ps({owner:t,onSkip:n}){const s=Gt(t,{requireEntityTypes:!1});if(!s.ready||!s.counts)return e.jsx(fs,{});const o=zt(t,s.counts);return e.jsxs("section",{"aria-label":"Start here",className:"flex min-w-0 flex-col gap-4 pt-2 pb-6",children:[e.jsxs("div",{className:"flex flex-col gap-1 px-1",children:[e.jsx("p",{className:"text-[11px] font-medium tracking-wide text-muted-foreground uppercase",children:"Start here"}),e.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:"Where do you want to start?"}),e.jsx("p",{className:"max-w-2xl text-sm leading-6 text-muted-foreground",children:"Lobu is a live context layer for your agents. Connect the tools you work in; ChatGPT, Claude, Codex, and your own agents resume from the same context. Pick a starting point; everything lands in the same workspace, and you can combine them later."})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:o.map((r,d)=>e.jsx(gs,{recipe:r,className:P(d===o.length-1&&"md:col-span-2 xl:col-span-1")},r.id))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-1 text-xs text-muted-foreground",children:[e.jsx("span",{children:"None of these?"}),e.jsx(O,{to:"/$owner/connectors/create",params:{owner:t},className:"underline decoration-border underline-offset-4 transition-colors hover:text-foreground",children:"Browse all connectors"}),n?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("button",{type:"button",onClick:n,className:"underline decoration-border underline-offset-4 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:"Skip for now"})]}):null]})]})}function gs({recipe:t,className:n}){const s=xs[t.icon];return e.jsxs("article",{className:P("flex min-w-0 flex-col gap-3 rounded-lg border bg-card p-4",n),children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2.5",children:[e.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-muted text-muted-foreground",children:e.jsx(s,{className:"h-4 w-4","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:t.eyebrow}),e.jsx("h3",{className:"text-sm leading-5 font-semibold",children:t.title})]})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:t.description}),e.jsx("ol",{className:"flex flex-col gap-1",children:t.steps.map(o=>{const r=o===t.next;return e.jsx("li",{children:o.complete?e.jsxs("span",{className:"flex min-h-7 items-center gap-2 px-1.5 text-xs text-muted-foreground",children:[e.jsx(Xt,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0",children:o.label})]}):r?e.jsxs(O,{...o.link,"aria-current":"step",className:P("flex min-h-9 items-center gap-2 rounded-md border border-primary/30 bg-primary/10 px-2 text-xs font-medium text-foreground transition-colors","hover:bg-primary/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"),children:[e.jsx(Se,{className:"h-3.5 w-3.5 shrink-0 text-primary","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 flex-1",children:o.label}),e.jsx(Qt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"})]}):e.jsxs("span",{className:"flex min-h-7 items-center gap-2 px-1.5 text-xs text-muted-foreground",children:[e.jsx(Se,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0",children:o.label})]})},o.key)})}),e.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t border-border/60 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium tracking-wide text-muted-foreground uppercase",children:"Then ask your agent"}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:t.prompt}),e.jsx(qt,{text:t.prompt})]})]})}function fs(){return e.jsxs("section",{"aria-label":"Start here",className:"flex min-w-0 flex-col gap-4 pt-2 pb-6",children:[e.jsxs("div",{className:"flex flex-col gap-2 px-1",children:[e.jsx(W,{className:"h-3 w-16"}),e.jsx(W,{className:"h-6 w-full max-w-lg"}),e.jsx(W,{className:"h-4 w-full max-w-xl"})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:[0,1,2].map(t=>e.jsxs("div",{className:P("flex flex-col gap-3 rounded-lg border p-4",t===2&&"md:col-span-2 xl:col-span-1"),children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(W,{className:"h-8 w-8 rounded-md"}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[e.jsx(W,{className:"h-3 w-20"}),e.jsx(W,{className:"h-4 w-40"})]})]}),e.jsx(W,{className:"h-3 w-full"}),e.jsx(W,{className:"h-3 w-5/6"}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(W,{className:"h-6 w-full"}),e.jsx(W,{className:"h-6 w-full"}),e.jsx(W,{className:"h-6 w-full"})]})]},t))})]})}const ys={automation:Xe,connection:je,agent:un,"entity-type":Z},bs={automation:{to:"/$owner",search:{section:"automation"}},connection:{to:"/$owner/connectors",search:{}},agent:{to:"/$owner",search:{section:"agent"}},"entity-type":{to:"/$owner",search:{section:"entity-type"}}},ge={automation:{text:"No Automations yet.",action:{to:"/$owner/automations/new",label:"Start with a template"}},connection:{text:"No connections yet.",action:{to:"/$owner/connectors/create",label:"Connect a source"}},agent:{text:"No agents connected yet.",action:{to:"/$owner/agents/connect",label:"Connect an agent"}},"entity-type":{text:"No entity types yet.",action:{to:"/$owner/entity-types/new",label:"Create one"}}};function js({owner:t,organizationId:n,section:s,layout:o}){const{isMember:r,isPublic:d,isLoading:a}=$e(t),l=d&&!r&&!a,[m,u]=h.useState(""),b=Pe(l?null:t),S=qe(n??void 0,void 0,{includeDetails:!1}),x=Ge(n),p=ze(n),{data:E=[],isLoading:i}=Ye(n),g=hs(t,{organizationId:n,enabled:!l}),N=Dn(null,{enabled:!l}),{visible:y,isTypesLoading:j}=Zt(t),v=h.useMemo(()=>Jt({owner:t,automations:S.data??[],connections:x.data??[],feeds:p.data??[],connectors:new Map(E.map(L=>[L.key,L])),recentItems:g.items,roster:g.agents,clientGroups:Wn(N.data??[]).filter(L=>L.connected),entityTypes:y,attention:Oe(b.attentionCards),now:Date.now()}),[t,S.data,x.data,p.data,E,g.items,g.agents,N.data,y,b.attentionCards]),k=m.trim().toLowerCase(),T=k.length>0,$=h.useMemo(()=>en(v.filter(L=>!k||L.name.toLowerCase().includes(k)),{filtering:T,expanded:s!=null,kinds:s?[s]:l?["automation","connection","entity-type"]:["automation","connection","agent","entity-type"]}),[v,k,T,l,s]),H=tn(l?null:n,nn()),I={automation:S.isLoading,connection:x.isLoading||p.isLoading||i,agent:!l&&(g.isLoading||N.isLoading),"entity-type":j},K=n==null||S.isLoading||x.isLoading||!l&&(g.isLoading||b.isLoading),_=S.isError||x.isError||p.isError||g.isError||b.isError,F=$.every(L=>L.count===0)&&H.length===0,R=$.every(L=>L.kind==="entity-type"||L.count===0),w=`lobu:start-dismissed:${t}`,[G,D]=h.useState(()=>{try{return window.localStorage.getItem(w)==="1"}catch{return!1}}),Y=()=>{D(!0);try{window.localStorage.setItem(w,"1")}catch{}},Q=v.some(L=>L.kind==="connection"),J=v.some(L=>L.kind==="agent"),X=o==="table",B=X&&r&&!K&&!T&&!l&&!G&&!Q&&!J&&R&&H.length===0,V=X&&r&&!K&&!T&&!l&&!G&&!B&&(!Q||!J),ee=L=>e.jsx(vs,{owner:t,organizationId:n,layout:o,layerToggles:L,query:m,onQueryChange:u,canAdd:r&&!l});return e.jsxs("section",{"aria-label":"Home",className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Home"}),V?e.jsx(ws,{owner:t,hasConnection:Q,onHide:Y}):null,B||!X?null:ee(null),X?e.jsxs(e.Fragment,{children:[_&&!B?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some of Home could not be loaded. Refresh to try again."}):null,K&&F?e.jsx(ks,{}):F&&T?e.jsx(re,{icon:sn,title:"Nothing matches",description:"Nothing on Home matches this filter."}):B?e.jsx(ps,{owner:t,onSkip:Y}):e.jsxs(e.Fragment,{children:[H.length>0?e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx(De,{organizationId:n,feeds:H})}):null,$.map(L=>I[L.kind]?e.jsx(Ss,{label:L.label},L.kind):e.jsx(Cs,{owner:t,organizationId:n,section:L,allRows:s===L.kind,connectorDefinitions:E},L.kind))]})]}):e.jsx(us,{ownerSlug:t,renderToolbar:ee})]})}function vs({owner:t,organizationId:n,layout:s,layerToggles:o,query:r,onQueryChange:d,canAdd:a}){const l=[{key:"table",label:"Table",Icon:cn,search:{}},{key:"graph",label:"Graph",Icon:ln,search:{layout:"graph"}}];return e.jsxs("nav",{"aria-label":"Home views",className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("fieldset",{className:"flex items-center rounded-md border p-0.5","aria-label":"Home layout",children:l.map(({key:m,label:u,Icon:b,search:S})=>{const x=s===m;return e.jsx(z,{asChild:!0,variant:"ghost",size:"sm",className:P("h-7 px-2",x&&"bg-accent text-accent-foreground"),children:e.jsx(O,{to:"/$owner",params:{owner:t},search:S,replace:!0,"aria-label":u,"aria-current":x?"page":void 0,title:u,children:e.jsx(b,{className:"h-4 w-4"})})},m)})}),o,e.jsxs("div",{className:"ml-auto flex min-w-0 flex-1 items-center justify-end gap-2",children:[s==="table"?e.jsxs("div",{className:"relative min-w-40 max-w-64 flex-1",children:[e.jsx(dn,{"aria-hidden":"true",className:"absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(We,{type:"search","aria-label":"Filter list",placeholder:"Filter…",maxLength:512,value:r,onChange:m=>d(m.target.value),className:"pl-9"})]}):null,a?e.jsx(Ns,{owner:t,organizationId:n}):null]})]})}function Ns({owner:t,organizationId:n}){const{isAdmin:s}=Be(n??void 0),o=[{to:"/$owner/automations/new",label:"Automation",Icon:Xe},{to:"/$owner/connectors/create",label:"Connection",Icon:je},{to:"/$owner/agents/new",label:"Agent",Icon:jn},...s?[{to:"/$owner/entity-types/new",label:"Entity type",Icon:Z}]:[]];return e.jsxs(gn,{children:[e.jsx(fn,{asChild:!0,children:e.jsxs(z,{size:"sm",children:[e.jsx(Ve,{className:"mr-1.5 h-4 w-4"}),"Add",e.jsx(yn,{className:"ml-1 h-3.5 w-3.5"})]})}),e.jsx(bn,{align:"end",className:"w-44",children:o.map(({to:r,label:d,Icon:a})=>e.jsx(vn,{asChild:!0,children:e.jsxs(O,{to:r,params:{owner:t},children:[e.jsx(a,{}),d]})},r))})]})}function ws({owner:t,hasConnection:n,onHide:s}){const o=an(),r=!n;return e.jsxs("section",{"aria-label":"Next step",className:"flex flex-wrap items-center gap-2 rounded-lg border border-primary/20 bg-primary/5 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:r?"Next: connect a source":"Next: connect an agent"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r?"Your agent is ready. Give Lobu a source to work from.":"Your source is connected. Connect Claude, ChatGPT, or Codex to use it."})]}),e.jsx(z,{asChild:!0,size:"sm",children:e.jsx(O,{to:r?"/$owner/connectors/create":"/$owner/agents/connect",params:{owner:t},children:r?"Connect a source":"Connect an agent"})}),o?e.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground underline decoration-border underline-offset-4 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:"Ask Lobu"}):null,e.jsx("button",{type:"button",onClick:s,className:"text-xs text-muted-foreground underline decoration-border underline-offset-4 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:"Hide"})]})}function ks(){return e.jsx("div",{role:"status","aria-label":"Loading Home",children:[0,1,2].map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"px-1 pt-4 pb-1.5",children:e.jsx(W,{className:"h-4 w-24"})}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2].map(n=>e.jsx(Ze,{},n))})]},t))})}function Ss({label:t}){return e.jsxs("section",{"aria-label":t,className:"min-w-0",children:[e.jsx("div",{className:"px-1 pt-4 pb-1.5",children:e.jsx("h2",{className:"text-sm font-semibold",children:t})}),e.jsx("div",{role:"status","aria-label":`Loading ${t}`,className:"divide-y overflow-hidden rounded-lg border",children:[0,1,2].map(n=>e.jsx(Ze,{},n))})]})}function Cs({owner:t,organizationId:n,section:s,allRows:o,connectorDefinitions:r}){const d=bs[s.kind];return e.jsxs("section",{"aria-label":s.label,className:"min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 px-1 pt-4 pb-1.5",children:[e.jsx("h2",{className:"text-sm font-semibold",children:o?e.jsxs(e.Fragment,{children:[s.label,e.jsx("span",{className:"ml-1.5 font-normal text-muted-foreground tabular-nums",children:s.count})]}):e.jsx(O,{to:d.to,params:{owner:t},search:d.search,className:"underline-offset-4 hover:underline",children:s.label})}),o?e.jsxs(O,{to:"/$owner",params:{owner:t},search:{},className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(on,{"aria-hidden":"true",className:"h-3 w-3"}),"All sections"]}):s.count>s.rows.length?e.jsxs(O,{to:d.to,params:{owner:t},search:d.search,className:"text-xs text-muted-foreground hover:text-foreground",children:["See all ",s.count," →"]}):null]}),s.count===0?e.jsxs("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:[ge[s.kind].text," ",e.jsxs(O,{to:ge[s.kind].action.to,params:{owner:t},className:"underline decoration-border underline-offset-4 transition-colors hover:text-foreground",children:[ge[s.kind].action.label," →"]})]}):null,e.jsx("ul",{className:P("overflow-hidden rounded-lg border",s.rows.length===0&&"hidden"),children:s.rows.map(a=>e.jsxs("li",{className:P("flex min-w-0 items-center border-b last:border-b-0",rn),children:[e.jsx(Ls,{owner:t,organizationId:n,source:a,connectorDefinitions:r}),a.attention.length>0?e.jsx(Es,{owner:t,source:a}):null]},a.key))})]})}function Ls({owner:t,organizationId:n,source:s,connectorDefinitions:o}){const r=ys[s.kind];return e.jsx(Ts,{owner:t,organizationId:n,source:s,className:P(xn,"min-w-0 flex-1"),children:e.jsx(mn,{mark:s.kind==="entity-type"?e.jsx(Ue,{icon:s.icon??null,className:"h-4 w-4 text-muted-foreground"}):e.jsx(hn,{source:s.mark,connectorDefinitions:o,label:s.name,fallback:e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})}),name:s.name,tone:s.attention.length>0?"amber":s.problem?"destructive":null,details:s.status,at:s.at})})}function Es({owner:t,source:n}){const s=n.attention.length,o=Qe(pn(t,n));return e.jsxs(O,{to:o.pathname,search:o.search,className:"mr-3 shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-700 transition-colors hover:bg-amber-500/20 dark:text-amber-400",children:[s," need",s===1?"s":""," you"]})}function Ts({owner:t,organizationId:n,source:s,className:o,children:r}){const d=Ke(),{open:a}=s,l=Qe(a.href),m=u=>{if(!(!d||a.kind==="entity-type"||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||u.button!==0)&&!(a.kind==="connection"&&!n)){if(u.preventDefault(),a.kind==="automation"||a.kind==="agent"){d.open({href:a.href,title:s.name,owner:t});return}d.open({href:a.href,title:s.name,key:s.key,connectorPanel:{section:"data",connectorKey:a.connectorKey,connectionId:a.connectionId,organizationId:n,ownerSlug:t}})}};return e.jsx(O,{to:l.pathname,search:l.search,className:o,onClick:m,children:r})}function Ks({owner:t,search:n,entityScope:s,home:o=!1}){const r=typeof n.type=="string"&&n.type.trim()?fe(n.type.trim()):void 0,d=n.section==="automation"||n.section==="agent"||n.section==="entity-type"?n.section:void 0,a=n.layout==="graph"?"graph":"table",l=Object.entries(n).some(([u,b])=>(Nn.includes(u)||u.startsWith("clf_"))&&b!=null&&b!==""),m=o&&!l&&!r&&!s;return e.jsxs(wn,{className:"gap-6 pt-2.5 pb-8",children:[e.jsx(Fn,{}),e.jsx(kn,{owner:t,children:u=>e.jsx(En,{organizationId:u.organizationId,isWorkspaceLoading:u.isWorkspaceLoading,children:e.jsx(Sn,{wide:o,className:P("flex min-h-0 min-w-0 flex-1 flex-col",m&&a==="graph"&&"max-w-none"),children:m?e.jsx(js,{owner:u.ownerSlug,organizationId:u.organizationId,section:d,layout:a}):e.jsx(Kn,{organizationId:u.organizationId,ownerSlug:u.ownerSlug,typeScope:r,entityScope:s})})})})]})}export{Ks as A};
|
|
2
|
+
//# sourceMappingURL=activity-route-view-jTBMW7a9.js.map
|
package/dist/owletto/dist/assets/{agent-connect-pages-CdDjrHjn.js → agent-connect-pages-D3mVM_q4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t,L as h,
|
|
2
|
-
`),steps:e=>d(e)?["ChatGPT web: open the Lobu listing above and complete sign-in.","Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."]:["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:"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=>b("opencode",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=>b("antigravity",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=>b("cursor",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:[N]},{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:()=>P("OpenClaw"),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:()=>P("Hermes"),guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Not listed here",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:[N]}],I=["Connect my Gmail to Lobu.","Create a Lobu automation that sends me a morning briefing.","In Lobu, design a data model with entities and relationships for tracking deals.","Remember in Lobu that I prefer short answers that lead with the key point."],
|
|
3
|
-
`)}function z(e,a){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===a-1?"":"border-b"}`}function
|
|
4
|
-
//# sourceMappingURL=agent-connect-pages-
|
|
1
|
+
import{j as t,L as h,eK as f,$,ar as C,as as A,dt as M,du as R,be as O,dv as S,dw as _,y as U,r as E,ic as u,B as v,A as y}from"./index-CdDNNAx2.js";import{C as B}from"./connector-page-shell-BeuyjiB2.js";import{C as g}from"./copy-button-BhXeXLIm.js";import{u as G}from"./clients-BCvjAJDT.js";import{g as H,c as D}from"./client-rows-DGh1O-Fu.js";const K="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function d(e){try{const a=new URL(e).hostname;return a==="lobu.ai"||a.endsWith(".lobu.ai")}catch{return!1}}function x(e,a){const n=`npx @lobu/cli@latest connect ${e}`;return d(a)?n:`${n} --url ${a}`}function b(e,a){return`npx @lobu/cli@latest connect ${e} --url ${a}`}const N={label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"};function P(e){return[`Paste the prompt into ${e} and review its proposed setup.`,"Approve Lobu sign-in in your browser or through the email approval link.",`Let ${e} verify access with a harmless read in this workspace.`]}const L=[{id:"claude",label:"Claude",tagline:"Web, desktop, and coding agent for one workspace",description:"Claude web, desktop, and Code apps for this workspace.",installTitle:"Add in one click, or run in your terminal",installLink:e=>({label:"Add Lobu to Claude",href:`https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Lobu&connectorUrl=${encodeURIComponent(e)}`}),installText:e=>x("claude-code",e),promptUrl:e=>`https://claude.ai/new?q=${encodeURIComponent(e)}`,steps:e=>["Claude: open the Add to Claude link above and complete sign-in.",...d(e)?["The CLI adds Lobu's marketplace and installs the shared plugin."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Start a fresh Claude Code session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"},{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:"ChatGPT web connector and Codex coding agent for this workspace.",installTitle:"Pick a surface",installLink:e=>d(e)?{label:"Use Lobu in ChatGPT",href:"https://chatgpt.com/plugins/plugin_asdk_app_6a73b856e4348191a97dc8e3a1e58a94"}:null,promptUrl:e=>`https://chatgpt.com/?q=${encodeURIComponent(e)}`,installText:e=>d(e)?x("codex",e):["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${x("codex",e)}`].join(`
|
|
2
|
+
`),steps:e=>d(e)?["ChatGPT web: open the Lobu listing above and complete sign-in.","Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."]:["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:"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=>b("opencode",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=>b("antigravity",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=>b("cursor",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:[N]},{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:()=>P("OpenClaw"),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:()=>P("Hermes"),guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Not listed here",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:[N]}],I=["Connect my Gmail to Lobu.","Create a Lobu automation that sends me a morning briefing.","In Lobu, design a data model with entities and relationships for tracking deals.","Remember in Lobu that I prefer short answers that lead with the key point."],F={codex:"chatgpt","claude-code":"claude","claude-desktop":"claude"};function W(e){const a=F[e]??e;return L.find(n=>n.id===a)}function q(e){const{workspaceName:a,owner:n,mcpUrl:o,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${a}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${o}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${K}.`,"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(`
|
|
3
|
+
`)}function z(e,a){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===a-1?"":"border-b"}`}function J({owner:e,dashed:a=!1}){return t.jsx("div",{className:`overflow-hidden rounded-lg border ${a?"border-dashed":""}`,children:L.map((n,o)=>t.jsxs(h,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:z(o,L.length),children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:t.jsx(f,{name:n.label})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),t.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}const Q="app.lobu.ai";function V(e,a){const n=a?`/mcp/${a}`:"/mcp";if(!e)return`http://localhost:8787${n}`;try{const o=new URL(e);return o.hostname===Q&&(o.hostname="lobu.ai"),o.pathname=n,o.toString()}catch{return`${e}${n}`}}function X(e){return V($,e)}const w="gap-3 pt-2.5 pb-8";function Y(e,a){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===a-1?"":"border-b"}`}function T({owner:e}){return t.jsx(S,{crumbs:[t.jsx(h,{to:"/$owner",params:{owner:e},search:{section:"agent"},className:_,children:"Agents"},"agents")]})}function ae({owner:e}){return t.jsx(C,{className:w,children:t.jsxs(A,{className:"flex flex-1 flex-col gap-6",children:[t.jsx(M,{breadcrumb:t.jsx(T,{owner:e}),icon:t.jsx(O.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent.",meta:t.jsx(R,{owner:e})}),t.jsx(J,{owner:e})]})})}function oe({owner:e,clientId:a}){const n=W(a),{data:o}=U(e,{slug:e}),{data:r=[]}=G(null,{refetchInterval:2500}),i=E.useMemo(()=>H(r).filter(s=>s.connected),[r]);if(!n)return t.jsx(C,{className:w,children:t.jsxs(A,{className:"space-y-3",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),t.jsx(h,{to:"/$owner/agents/connect",params:{owner:e},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const l=X(e),p=q({workspaceName:o?.workspace?.name??e,owner:e,mcpUrl:l,clientLabel:n.id==="other"?void 0:n.label,terminalLogin:n.terminalLogin}),m=n.setupMode==="agent-prompt",k=m?p:n.installText?.(l)??p;return t.jsx(C,{className:w,children:t.jsxs(B,{header:t.jsx(M,{breadcrumb:t.jsx(T,{owner:e}),icon:t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:t.jsx(f,{name:n.label})}),title:n.label,caption:n.description}),children:[t.jsx(u,{title:"Set up",children:t.jsxs("div",{className:"space-y-4",children:[(()=>{const s=n.installLink?.(l);return s?t.jsx("div",{children:t.jsx(v,{asChild:!0,children:t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,t.jsx(y,{className:"ml-1.5 h-3.5 w-3.5"})]})})}):null})(),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:n.installTitle}),t.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[t.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:k}),t.jsx(g,{text:k,label:m?"Copy setup prompt":"Copy"})]})]}),t.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:n.steps(l).map((s,c)=>t.jsxs("li",{children:[c+1,". ",s]},s))}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[m?null:t.jsx(g,{text:p,label:"Copy setup prompt"}),n.guideLinks.map(s=>t.jsx(v,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,t.jsx(y,{className:"ml-1.5 h-3.5 w-3.5"})]})},s.href))]})]})}),t.jsx(u,{title:"First prompts",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),t.jsx("div",{className:"overflow-hidden rounded-lg border",children:I.map((s,c)=>{const j=n.promptUrl?.(s);return t.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${c===I.length-1?"":"border-b"}`,children:[j?t.jsx("a",{href:j,target:"_blank",rel:"noreferrer",className:"min-w-0 flex-1 text-sm hover:underline",children:s}):t.jsx("p",{className:"min-w-0 flex-1 text-sm",children:s}),t.jsx(g,{text:s,label:"prompt",iconOnly:!0})]},s)})})]})}),t.jsx(u,{title:"Connected agents",count:i.length>0?String(i.length):void 0,children:i.length===0?t.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):t.jsx("div",{className:"overflow-hidden rounded-lg border",children:i.map((s,c)=>t.jsxs(h,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:s.clientId},className:Y(c,i.length),children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:t.jsx(f,{name:s.title})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:D(s)})]})]},s.key))})}),t.jsx(u,{title:"Manual MCP details",children:t.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[t.jsx("dt",{className:"text-muted-foreground",children:"Name"}),t.jsx("dd",{className:"font-mono",children:"lobu"}),t.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),t.jsx("dd",{className:"break-all font-mono",children:l})]})})]})})}export{ae as A,oe as a};
|
|
4
|
+
//# sourceMappingURL=agent-connect-pages-D3mVM_q4.js.map
|