@lobu/runtime-server 24.6.0 → 24.7.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/component.json +1 -1
- package/dist/owletto/dist/assets/_-CZgmjLR9.js +2 -0
- package/dist/owletto/dist/assets/_-Cm5OgtYD.js +3 -0
- package/dist/owletto/dist/assets/_agentId-Cci6NFc1.js +2 -0
- package/dist/owletto/dist/assets/_agentId-GhWTlPO2.js +2 -0
- package/dist/owletto/dist/assets/_automationId-KUlxSTK2.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-Zpy7Hvml.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-CYDRp9UX.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-NNqDdije.js +2 -0
- package/dist/owletto/dist/assets/_eventId-0BSX6VHj.js +2 -0
- package/dist/owletto/dist/assets/_owner-C-CD22NB.js +3 -0
- package/dist/owletto/dist/assets/_shape-CvXp4omb.js +2 -0
- package/dist/owletto/dist/assets/_slug-DgK7zpKA.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-cH54P0zY.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-m0B5j7L9.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CQZQ0wwC.js → accept-invitation-CX7Egv-p.js} +2 -2
- package/dist/owletto/dist/assets/activity-link-rXNpmppV.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-B0m7_g9q.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-CpUTAjXf.js → agent-client-setup-list-BmD3-_Ox.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-Br_ycC0z.js → agent-connect-pages-BtOTCsTU.js} +2 -2
- package/dist/owletto/dist/assets/agent-editor-form-CirqCpcM.js +2 -0
- package/dist/owletto/dist/assets/agent-list-row-SyACVYX7.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-_18OREnx.js → agent-loading-shells-DHvKiEUB.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-Dsc26dyW.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-1DBn7Xc_.js → agent-skill-context-DF5q0Dfr.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-Pi5cECga.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-FyEO-y44.js → agent-thread-B1ZepGZc.js} +4 -4
- package/dist/owletto/dist/assets/agents-D1FHZ0jR.js +2 -0
- package/dist/owletto/dist/assets/app._appId-01I0CJal.js +2 -0
- package/dist/owletto/dist/assets/{assist-composer-Mn9EfX4X.js → assist-composer-BD9msDk3.js} +2 -2
- package/dist/owletto/dist/assets/automation-detail-content-BFv1TglZ.js +2 -0
- package/dist/owletto/dist/assets/automation-row-CmTpAD4r.js +2 -0
- package/dist/owletto/dist/assets/{automation-source-list-Dhucq1sI.js → automation-source-list-D8ZSavQU.js} +2 -2
- package/dist/owletto/dist/assets/automations-D1FHZ0jR.js +2 -0
- package/dist/owletto/dist/assets/{callback-9xSHyA12.js → callback-Ckrxv0eo.js} +2 -2
- package/dist/owletto/dist/assets/{card-g4yxo4Hr.js → card-DT9mSjSp.js} +2 -2
- package/dist/owletto/dist/assets/{change-summary-DeuXQEpb.js → change-summary-CGrKEJ04.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B98IhDra.js → claim-Bzby28tT.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-BD2HBo-_.js → client-activity-scopes-DoIErdUy.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-x_CxeWkP.js → client-rows-BbVQy5Ti.js} +2 -2
- package/dist/owletto/dist/assets/{clients-Cmp0LmOp.js → clients-6aJvabvS.js} +2 -2
- package/dist/owletto/dist/assets/connect-BmDziBzI.js +2 -0
- package/dist/owletto/dist/assets/{connect-menu-CezOH3s7.js → connect-menu-Bs8mxsga.js} +2 -2
- package/dist/owletto/dist/assets/connect._clientId-t5aKu3aa.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DswMAw8l.js +2 -0
- package/dist/owletto/dist/assets/{connection-B6fM2KHN.js → connection-BOaMa324.js} +2 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BLCjhP-H.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-BAP_f77M.js +2 -0
- package/dist/owletto/dist/assets/{connector-page-shell-Di6XzkVo.js → connector-page-shell-ClOmVPJr.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-BrnasBW4.js → connector-provenance-wmYu5jwO.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-DnOUxX_U.js → connectors-D5F5rHxX.js} +2 -2
- package/dist/owletto/dist/assets/{consent-Byli4yMs.js → consent-RqHNkmm8.js} +2 -2
- package/dist/owletto/dist/assets/{copy-button-Ddf7lBjZ.js → copy-button-D6zpsZLi.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-BsXtvNoI.js → core.esm-BIE97rfo.js} +3 -3
- package/dist/owletto/dist/assets/create-BPxsKwk7.js +2 -0
- package/dist/owletto/dist/assets/{create-YdAnh3ml.js → create-GT8_yF0R.js} +2 -2
- package/dist/owletto/dist/assets/create-Yx2qBMBy.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-B12yTrmj.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-CzXqSkuI.js +2 -0
- package/dist/owletto/dist/assets/custom-guardrail-edits-B9plaLBN.js +2 -0
- package/dist/owletto/dist/assets/{definition-comparison-B5WgZILB.js → definition-comparison-C3k6Wa9B.js} +2 -2
- package/dist/owletto/dist/assets/detail-page-skeleton-I5_7FkKx.js +2 -0
- package/dist/owletto/dist/assets/{device-DdCoCj-Q.js → device-CadaiNF4.js} +2 -2
- package/dist/owletto/dist/assets/device-automation-Dp3faMvp.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-U7Bx05P6.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-DTZqj1HS.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-DyT_9iVE.js +2 -0
- package/dist/owletto/dist/assets/entity-options-CGTjLlcS.js +2 -0
- package/dist/owletto/dist/assets/entity-page-DHHMmA8V.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-eYbG2FDT.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-D0ghgRgq.js → entity-type-page-CjFqxSdL.js} +2 -2
- package/dist/owletto/dist/assets/event-card-BtTUuf2q.js +2 -0
- package/dist/owletto/dist/assets/event-detail-8xHiplt_.js +2 -0
- package/dist/owletto/dist/assets/events-feed-zFnTSE27.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-Dd5R2Etd.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B5xXnKtV.js → full-page-spinner-CCU4PkRv.js} +2 -2
- package/dist/owletto/dist/assets/home-stream-IVsNEkwp.js +2 -0
- package/dist/owletto/dist/assets/index-2oaMOFKe.js +2 -0
- package/dist/owletto/dist/assets/index-B-Ab8srM.js +7899 -0
- package/dist/owletto/dist/assets/index-B4RZgvvI.js +2 -0
- package/dist/owletto/dist/assets/{index-BDl1_w6U.js → index-B72KYdN1.js} +2 -2
- package/dist/owletto/dist/assets/index-BBZM53p8.js +2 -0
- package/dist/owletto/dist/assets/index-BOb0a5f9.js +2 -0
- package/dist/owletto/dist/assets/{index-BdNR51Ua.js → index-BYFDMIQC.js} +2 -2
- package/dist/owletto/dist/assets/index-BwnFQcMe.js +2 -0
- package/dist/owletto/dist/assets/index-CvYsWYlF.js +2 -0
- package/dist/owletto/dist/assets/{index-CkiyxW4w.js → index-DIXIvtnM.js} +2 -2
- package/dist/owletto/dist/assets/index-DLwokXHW.js +2 -0
- package/dist/owletto/dist/assets/index-_nlPHus1.js +2 -0
- package/dist/owletto/dist/assets/index-cwOgj4-i.js +2 -0
- package/dist/owletto/dist/assets/{index-TkPy_P_u.js → index-pmr1WUoG.js} +2 -2
- package/dist/owletto/dist/assets/index-pp4qmhkA.js +2 -0
- package/dist/owletto/dist/assets/index-tTbno-PX.css +1 -0
- package/dist/owletto/dist/assets/{json-diff-DtZtra_g.js → json-diff-B-1Swv_y.js} +2 -2
- package/dist/owletto/dist/assets/list-skeleton-BAqT0vxo.js +2 -0
- package/dist/owletto/dist/assets/{login-TWR0vF4_.js → login-D5bIjMtf.js} +2 -2
- package/dist/owletto/dist/assets/{logout-BA5kojS0.js → logout-JYZvxz8v.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-BQiRAqtx.js → member-scope-gate-Lj9m4RL2.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-rAKfVdQ_.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-B2cjCn0V.js → model-selector-onvGA9Ww.js} +2 -2
- package/dist/owletto/dist/assets/{new-Dc5Bbotb.js → new-B-Jd-vBl.js} +2 -2
- package/dist/owletto/dist/assets/new-BmehH1uR.js +2 -0
- package/dist/owletto/dist/assets/new-KDi15LWZ.js +2 -0
- package/dist/owletto/dist/assets/{organization-B9U1L-56.js → organization-B9bh20Xo.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-Bqus80Mq.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-BP3xHM2d.js → pending-seed-CoFPQ835.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BED-DO9C.js → proposal-review-shell-CnACXCUg.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-Dlh-eWz0.js +2 -0
- package/dist/owletto/dist/assets/record-activity-6CfR95Ul.js +2 -0
- package/dist/owletto/dist/assets/{record-session-DOFgdd43.js → record-session-Bpx4_LGk.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-CHPS-1vD.js → renderer-CgaQKMoG.js} +26 -26
- package/dist/owletto/dist/assets/{reset-password-BmNM-apc.js → reset-password-C-4Jnuqk.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-BvruBM5H.js +2 -0
- package/dist/owletto/dist/assets/{runs-BntGAKQG.js → runs-BMzp7j7j.js} +2 -2
- package/dist/owletto/dist/assets/runs-list-DVhrTr3v.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-v3nR2Oa2.js → schema-type-editor-panel-Bdeumkux.js} +2 -2
- package/dist/owletto/dist/assets/{schema-value-BFb7jCBo.js → schema-value-BUgC0Ro8.js} +2 -2
- package/dist/owletto/dist/assets/{settings-DubSpJfg.js → settings-DYYvrrZ4.js} +2 -2
- package/dist/owletto/dist/assets/skill-route-key-sF006xiz.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CBV9tsR3.js +2 -0
- package/dist/owletto/dist/assets/status-variants-DT61YfsU.js +2 -0
- package/dist/owletto/dist/assets/{table-DALHuXPE.js → table-B6yimlsZ.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-D9hKpufo.js → use-automations-II_YJWtN.js} +2 -2
- package/dist/owletto/dist/assets/{use-login-redirect-ciwfc-7A.js → use-login-redirect-BqtEilid.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-CJGCatFS.js → use-mention-search-Bxlpd6Dp.js} +3 -3
- package/dist/owletto/dist/assets/view-param-filters-DYlqBocg.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-CZ1fvAks.js → views-access-required-BVtMfgLh.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +84 -5
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-DT3E3BmS.js +0 -3
- package/dist/owletto/dist/assets/_-c1xy7bLu.js +0 -2
- package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DV8utajn.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +0 -2
- package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +0 -2
- package/dist/owletto/dist/assets/_name-CM1AMywz.js +0 -2
- package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +0 -3
- package/dist/owletto/dist/assets/_shape-DGAkETDp.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +0 -2
- package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +0 -2
- package/dist/owletto/dist/assets/_view-B5I7mmkl.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CZykJXQp.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-DuQJhtqp.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CN7vpC0X.js +0 -2
- package/dist/owletto/dist/assets/agent-list-row-BnP6r4pm.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-DSjidWHL.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-d5jh3oBR.js +0 -2
- package/dist/owletto/dist/assets/agent-tab-intro-DKrC3SQt.js +0 -2
- package/dist/owletto/dist/assets/agents-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-CDpJmUVN.js +0 -2
- package/dist/owletto/dist/assets/app._appId-DwNeXRJp.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +0 -2
- package/dist/owletto/dist/assets/automation-row-B5Q1B10y.js +0 -2
- package/dist/owletto/dist/assets/automations-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/connect-zUot_0kG.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DBNP2mZo.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-Ckq-qEbD.js +0 -2
- package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-BXsJqieG.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-CbqSFeVm.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-dQnZARCD.js +0 -2
- package/dist/owletto/dist/assets/create-B34eskZ_.js +0 -2
- package/dist/owletto/dist/assets/create-DLB9sXgU.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BkU_En_f.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +0 -2
- package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CmC-DVrK.js +0 -2
- package/dist/owletto/dist/assets/events-feed-CGzA1w3R.js +0 -2
- package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +0 -2
- package/dist/owletto/dist/assets/guardrails-DkXatmea.js +0 -2
- package/dist/owletto/dist/assets/identity-BwJy3ixB.js +0 -2
- package/dist/owletto/dist/assets/index-35ehGReZ.js +0 -2
- package/dist/owletto/dist/assets/index-B9hYiwBw.js +0 -2
- package/dist/owletto/dist/assets/index-BjcZVe7n.js +0 -7899
- package/dist/owletto/dist/assets/index-BqAVebvY.js +0 -2
- package/dist/owletto/dist/assets/index-BvK1fS1J.js +0 -2
- package/dist/owletto/dist/assets/index-CNEpTkgw.css +0 -1
- package/dist/owletto/dist/assets/index-CRc73k1t.js +0 -2
- package/dist/owletto/dist/assets/index-CYGaSD3y.js +0 -2
- package/dist/owletto/dist/assets/index-CfZGe-zn.js +0 -2
- package/dist/owletto/dist/assets/index-CzLDNB2E.js +0 -2
- package/dist/owletto/dist/assets/index-D-o5iOVd.js +0 -2
- package/dist/owletto/dist/assets/index-DjYVV1Ml.js +0 -2
- package/dist/owletto/dist/assets/index-VyAX-asP.js +0 -2
- package/dist/owletto/dist/assets/list-skeleton-CIHWCi2a.js +0 -2
- package/dist/owletto/dist/assets/manage-gear-C-0BAMbC.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +0 -74
- package/dist/owletto/dist/assets/model-C2q7WDcS.js +0 -2
- package/dist/owletto/dist/assets/models-CZkH5gtj.js +0 -2
- package/dist/owletto/dist/assets/nav-pill-Bam6s3jj.js +0 -2
- package/dist/owletto/dist/assets/new-BJst6K0b.js +0 -2
- package/dist/owletto/dist/assets/new-DgbivfDe.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +0 -2
- package/dist/owletto/dist/assets/permissions-BVlbeY4u.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CTLwq8s1.js +0 -2
- package/dist/owletto/dist/assets/run-activity-link-Dh1YyCfk.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-CCxNv0rK.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-BwTVaRsE.js +0 -2
- package/dist/owletto/dist/assets/runs-table-CYS1jDdL.js +0 -2
- package/dist/owletto/dist/assets/settings-DBgT60nY.js +0 -2
- package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-m8gECt82.js +0 -2
- package/dist/owletto/dist/assets/status-dot-BnQPFrcU.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BWCrmNIB.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aD as Ae,aE as Se,aF as Pe,aO as le,aL as ee,hP as He,gk as Qe,j as e,B as j,L,aN as oe,gS as se,gT as te,gU as M,hQ as Ge,a6 as Ze,hR as J,r as u,hS as Ne,hT as $e,cO as Je,hU as ye,bt as U,hV as be,H as k,bl as es,bm as ss,bn as ts,bo as as,bp as ns,hL as rs,I as $,bP as X,ab as z,A as Ce,hW as is,hX as ls,ek as os,hY as cs,bc as ce,hZ as ds,h_ as us,h$ as Ee,i0 as De,i1 as _e,dh as Fe,V as _,W as ae,i2 as ms,f_ as hs,i3 as xs,eI as Le,S as w,gl as T,b8 as de,i4 as ps,c as q,i5 as js,dT as gs,dV as fs,dU as vs,i6 as Y,i7 as Ns,az as ys,u as Be,gn as Re,i8 as bs,aR as Cs,i9 as ks,ia as ws,gj as As,aC as ke,aB as Ss,aH as Ps,b4 as $s,al as F,ez as Ke,b9 as Oe,b5 as Es,i as Ds}from"./index-BjcZVe7n.js";import{C as _s,A as Fs}from"./connect-menu-CezOH3s7.js";import{C as Ls,A as Ie,a as Ue}from"./connections-browser-BXsJqieG.js";import{C as ne}from"./connector-page-shell-Di6XzkVo.js";import{C as Bs}from"./connector-provenance-BrnasBW4.js";import{R as Rs}from"./run-activity-link-Dh1YyCfk.js";import"./connection-label-BobuYiAG.js";import"./status-dot-BnQPFrcU.js";function Ks({ownerSlug:s,familyKind:t,familyId:n}){const a=t==="inference",l=Ae({enabled:a}),d=Se({enabled:a}),h=Pe({enabled:!a}),c=a?l:h,o=a?d.data?.find(r=>r.slug===n)?.displayName??n:le(n),p=(a?(l.data??[]).filter(r=>r.kind===n).map(r=>({key:`${ee}${r.slug}`,name:r.displayName||r.slug,status:[r.isDefault?"Default":null,r.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(r=>r.providerKind===n).map(r=>({key:`${He}${r.id}`,name:r.name,status:r.connected?"Connected":"Needs credentials"}))).map(r=>({id:r.key,name:r.name,description:r.status,tone:null,link:Qe({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:r.key},search:{}})})),m=`${a?ee:oe}${n}`;return e.jsx(ne,{header:e.jsx(se,{title:o,breadcrumb:e.jsx(te,{crumbs:[e.jsx(L,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors")]})}),children:e.jsx(Ls,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:a?e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(L,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(Ie,{ownerSlug:s,connectorKey:m})})})}function Os({catalog:s,initialProvider:t,initialSlug:n,allowOAuth:a=!0,initialModel:l,onDone:d}){const h=Ge(),c=Ze(),o=s.find(i=>i.slug===t)??s[0],p=a&&o&&J(o)?"oauth":"api-key",[m,r]=u.useState(o?.slug??""),[f,b]=u.useState(n??o?.slug??""),[x,N]=u.useState(o?.displayName??""),[v,A]=u.useState(o?.baseUrl??""),[D,S]=u.useState(l??o?.defaultModel??""),[E,V]=u.useState(""),[H,K]=u.useState(o?.apiKeyPlaceholder??""),[W,O]=u.useState(p),[B,Q]=u.useState(""),[C,re]=u.useState(null),[I,R]=u.useState(!1),[ue,me]=u.useState(!1),g=s.find(i=>i.slug===m),G=Ne(g?.modalities??[]),he=a&&!!g&&J(g),xe=g?$e(g):!1,pe=he&&W==="oauth",je=xe&&!pe,P=Je().slug,Z=u.useCallback(()=>{me(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Me=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),Te=u.useCallback(async()=>{if(!(!P||!g)){R(!0);try{const i=await ye(P,g.slug);if(i.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(i.authorizeUrl,"_blank","noreferrer")}catch(i){U.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[P,g]),ze=u.useCallback(async()=>{if(!(!P||!g||!B.trim())){R(!0);try{const i=await be(P,g.slug,{code:B.trim()});if(i.status!=="success")throw new Error(i.error||"Sign-in not complete");Z(),U.success(`Signed in with ${g.displayName}`)}catch(i){U.error(i instanceof Error?i.message:"Failed to complete sign-in")}finally{R(!1)}}},[P,g,B,Z]),Ve=u.useCallback(async()=>{if(!(!P||!g)){R(!0);try{const i=await ye(P,g.slug);if(i.mode!=="device")throw new Error("Unexpected sign-in mode");re({userCode:i.userCode,deviceAuthId:i.deviceAuthId,verificationUrl:i.verificationUrl}),window.open(i.verificationUrl,"_blank","noreferrer")}catch(i){U.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[P,g]),We=u.useCallback(async()=>{if(!(!P||!g||!C)){R(!0);try{const i=await be(P,g.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(i.status==="success"){Z(),U.success(`Signed in with ${g.displayName}`);return}re(y=>y&&{...y,message:i.error||"Waiting for approval..."})}catch(i){U.error(i instanceof Error?i.message:"Failed to check status")}finally{R(!1)}}},[P,g,C,Z]),Xe=g?.supportedAuthTypes.includes("device-code")??!1,Ye=i=>{r(i);const y=s.find(ie=>ie.slug===i);y&&(b(y.slug),N(y.displayName),A(y.baseUrl),S(y.slug===t&&l?l:y.defaultModel??""),K(y.apiKeyPlaceholder),O(a&&J(y)?"oauth":"api-key"),Q(""),re(null),me(!1))},ge=/^[a-z0-9][a-z0-9-]*$/.test(f),fe=ge&&je&&E.trim().length>0&&!h.isPending,qe=i=>{if(i.preventDefault(),!fe)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;h.mutate({slug:f.trim(),kind:m,displayName:x.trim()||void 0,apiKey:E.trim(),capabilities:ie},{onSuccess:()=>d()})},ve=!!(t&&s.some(i=>i.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ve&&g?`Connect ${g.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:qe,className:"grid max-w-md gap-3",children:[ve&&g?e.jsx("p",{className:"text-xs text-muted-foreground",children:G.length>0?`Serves text, plus ${G.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(es,{value:m,onValueChange:Ye,children:[e.jsx(ss,{id:"ip-provider",className:"w-full",children:e.jsx(ts,{})}),e.jsx(as,{children:s.map(i=>{const y=Ne(i.modalities);return e.jsx(ns,{value:i.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[i.iconUrl?e.jsx("img",{src:i.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(rs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},i.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:G.length>0?`Serves text, plus ${G.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx($,{id:"ip-display",placeholder:"Friendly name",value:x,onChange:i=>N(i.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($,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:i=>b(i.target.value),autoComplete:"off",required:!0}),f&&!ge?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(j,{type:"button",size:"sm",variant:W==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(j,{type:"button",size:"sm",variant:W==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,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($,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:i=>A(i.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx($,{id:"ip-model",placeholder:"gpt-4o-mini",value:D,onChange:i=>S(i.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($,{id:"ip-key",type:"password",placeholder:H||void 0,value:E,onChange:i=>V(i.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(X,{onCancel:d,children:e.jsx(j,{type:"submit",disabled:!fe,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):pe?e.jsxs("div",{className:"grid gap-3",children:[ue?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",g?.displayName??"provider",". This covers your agents in this org."]}):Xe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Ve(),disabled:I||!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($,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(j,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",g?.displayName??"provider"," to approve",e.jsx(Ce,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:I,children:I?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void Te(),disabled:I||!P,children:["Sign in with ",g?.displayName??"provider",e.jsx(Ce,{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($,{id:"ip-oauth-code",placeholder:"code#state",value:B,onChange:i=>Q(i.target.value),autoComplete:"off"})]}),e.jsx(j,{type:"button",className:"justify-self-start",onClick:()=>void ze(),disabled:I||!B.trim(),children:I?"Finishing...":"Finish sign-in"})]}),e.jsx(X,{onCancel:d,children:e.jsx(j,{type:"button",onClick:Me,disabled:!ue,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(X,{onCancel:d})]})]})]})}const Is={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Us({provider:s,catalog:t,autoOpenEdit:n}){const a=is(),[l,d]=u.useState(n?"edit":null),h=ls(s.kind,t);u.useEffect(()=>{n&&d("edit")},[n]);const o=(t.find(r=>r.slug===s.kind)?.modalities??["text"]).filter(r=>r!=="text"),p=h&&o.length>0,m=r=>d(f=>f===r?null:r);return e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:"Credential"}),e.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[s.slug,s.createdAt?` · created ${os(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug}),children:"Set as default"}),p?e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),l==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(Ts,{provider:s,supportsUpstreamConfig:h,onDone:()=>d(null)})}):null,l==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),o.map(r=>e.jsx(zs,{providerSlug:s.slug,modality:r,block:s.capabilities[r]??{}},r))]})}):null]})}function Ms({provider:s,onDeleted:t}){const n=cs(),[a,l]=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:a?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>l(!1)}),children:[n.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:n.isPending,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:n.isPending,onClick:()=>l(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function Ts({provider:s,supportsUpstreamConfig:t,onDone:n}){const a=ds(),l=us(),d=Ee(),[h,c]=u.useState(s.displayName??""),[o,p]=u.useState(""),m=s.capabilities.text??{},[r,f]=u.useState(m.base_url??""),[b,x]=u.useState(m.model??""),[N,v]=u.useState(null),A=h.trim().length>0&&h.trim()!==(s.displayName??""),D=t&&o.trim().length>0,S=r.trim()!==(m.base_url??""),E=b.trim()!==(m.model??""),V=t&&(S||E),H={base_url:r.trim()||void 0,model:b.trim()||void 0,models_endpoint:m.models_endpoint},K=De(H),W=t&&V&&_e(K),O=a.isPending||l.isPending||d.isPending,B=(A||D||V)&&!W&&!O,Q=async C=>{if(C.preventDefault(),!!B){v(null);try{await Promise.all([A?a.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),V?d.mutateAsync({providerSlug:s.slug,modality:"text",block:H}):Promise.resolve(),D?l.mutateAsync({providerSlug:s.slug,value:o.trim()}):Promise.resolve()]),n()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:Q,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($,{id:`edit-name-${s.slug}`,value:h,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($,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:r,onChange:C=>f(C.target.value),autoComplete:"off"}),K.base_url?e.jsx("p",{className:"text-xs text-destructive",children:K.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx($,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:b,onChange:C=>x(C.target.value),autoComplete:"off"}),K.model?e.jsx("p",{className:"text-xs text-destructive",children:K.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx($,{id:`edit-key-${s.slug}`,type:"password",value:o,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,N?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:N}):null,e.jsx(X,{onCancel:n,children:e.jsx(j,{type:"submit",disabled:!B,children:O?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function zs({providerSlug:s,modality:t,block:n}){const a=Ee(),[l,d]=u.useState(!1),[h,c]=u.useState(n.base_url??""),[o,p]=u.useState(n.model??""),[m,r]=u.useState(n.models_endpoint??""),[f,b]=u.useState(!!n.models_endpoint),x=!!(n.base_url||n.model||n.models_endpoint),N={base_url:h.trim()||void 0,model:o.trim()||void 0,models_endpoint:m.trim()||void 0},v=De(N),A=_e(v),D=()=>{A||a.mutate({providerSlug:s,modality:t,block:N})};return e.jsxs("div",{className:Fe,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(S=>!S),children:[e.jsx("span",{className:"text-sm font-medium",children:Is[t]}),x?e.jsx(_,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),l?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx($,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:h,onChange:S=>c(S.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($,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:o,onChange:S=>p(S.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($,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:S=>r(S.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:"Advanced"}),e.jsx(X,{onCancel:()=>d(!1),children:e.jsx(j,{size:"sm",disabled:A||a.isPending,onClick:D,children:a.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function Vs({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Xs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(_,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(_,{className:"h-4 border-transparent bg-emerald-500/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",className:"h-4 border-transparent bg-destructive/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-destructive",children:"No credential"})]}),t.length>0?e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:t.map(([n,a])=>`${n}: ${a}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function Ws({sandbox:s,onDeleted:t}){const n=ms(),[a,l]=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."})]})]}),a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"destructive",size:"sm",disabled:n.isPending,onClick:()=>n.mutate({id:s.id},{onSuccess:t}),children:n.isPending?e.jsx(z,{}):"Delete permanently"}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"})]}):e.jsx(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>l(!0),children:"Delete sandbox"})]})})}function 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(hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(xs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Ys={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},qs={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function jt(){const{owner:s,connectorKey:t}=Y.useParams(),{instances:n}=Y.useSearch(),{kind:a,id:l}=Ns(t);return e.jsx(ys,{owner:s,children:({ownerSlug:d,organizationId:h,isWorkspaceLoading:c})=>{if(n&&(a==="inference"||a==="sandbox-provider"))return e.jsx(Ks,{ownerSlug:d,familyKind:a,familyId:l});switch(a){case"inference":return e.jsx(Gs,{ownerSlug:d,providerSlug:l});case"sandbox":return e.jsx(Qs,{ownerSlug:d,sandboxId:l});case"sandbox-provider":return e.jsx(Hs,{ownerSlug:d,providerKind:l});default:return e.jsx(st,{ownerSlug:d,organizationId:h,isWorkspaceLoading:c,connectorKey:t})}}})}function Hs({ownerSlug:s,providerKind:t}){const n=q();return u.useEffect(()=>{n({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${oe}${t}`},replace:!0})},[n,s,t]),null}function Qs({ownerSlug:s,sandboxId:t}){const n=q(),{data:a,isLoading:l,isError:d,refetch:h}=Pe(),c=a?.sandboxes.find(p=>p.id===t)??null;if(l)return e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-24 w-full rounded-lg"})]});if(d)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(j,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!c)return e.jsxs(F,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(j,{variant:"outline",size:"sm",onClick:()=>void n({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const o=c.name||le(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(L,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),e.jsx(L,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${oe}${c.providerKind}`},search:{instances:!0},className:M,children:le(c.providerKind)},"family")]}),icon:e.jsx(de,{name:o,faviconDomain:Es(c.providerKind)}),title:o,badge:e.jsxs(e.Fragment,{children:[e.jsx(_,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(_,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Oe,{facets:qs})}),children:[e.jsx(Vs,{sandbox:c}),e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void n({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Gs({ownerSlug:s,providerSlug:t}){const n=q(),{model:a,reason:l,agentId:d,addAccount:h}=Y.useSearch(),{data:c=[],isLoading:o,isError:p,refetch:m}=Ae(),r=Se(),{data:f=[],isLoading:b}=r,x=h?null:c.find(E=>E.slug===t)??null,N=f.find(E=>E.slug===(x?.kind??t))??null;if(o||b)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-16 w-full rounded-lg"}),e.jsx(w,{className:"h-24 w-full rounded-lg"}),e.jsx(w,{className:"h-32 w-full rounded-lg"})]})});if(p)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(j,{variant:"outline",onClick:()=>void m(),children:"Retry"})]})});if(!x&&!N&&!r.isError)return e.jsxs(F,{className:"space-y-3",children:[e.jsx(Ke,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=x?x.displayName||x.slug:N?.displayName||t,A=x!==null,D=l?e.jsx(et,{agentId:d,model:a,providerName:v}):a?e.jsx(Js,{providerName:v,model:a,isConnected:A}):null,S=e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(L,{to:"/$owner/connectors",params:{owner:s},className:M,children:"Connectors"},"connectors"),...x?[e.jsx(L,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${x.kind}`},search:{instances:!0},className:M,children:N?.displayName??x.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:N?.iconUrl,name:v}),title:v,badge:x?e.jsxs(e.Fragment,{children:[x.isDefault?e.jsx(_,{variant:"secondary",children:"Default"}):null,x.status?e.jsx(_,{variant:"outline",children:x.status}):null,x.hasCustomUpstream?e.jsx(_,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Oe,{facets:Ys})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:S,children:[D,e.jsx("div",{className:"space-y-6",children:x?e.jsx(Us,{provider:x,catalog:f,autoOpenEdit:!!a}):e.jsx(Zs,{ownerSlug:s,providerSlug:t,existingSlugs:c.map(E=>E.slug),catalog:f,catalogError:r.isError?r.error:null,model:a})}),x?e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ms,{provider:x,onDeleted:()=>void n({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Zs({ownerSlug:s,providerSlug:t,existingSlugs:n,catalog:a,catalogError:l,model:d}){const h=q(),c=a.find(m=>m.slug===t),o=n.includes(t)&&!!c&&J(c);let p=t;for(let m=2;n.includes(p);m++)p=`${t}-${m}`;return l?e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Failed to load provider catalog."}),e.jsx("p",{className:"mt-1 text-xs",children:l instanceof Error?l.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[o&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(L,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${t}`},search:{},children:"Open existing connection"})})]}),(!o||c&&$e(c))&&e.jsx(Os,{catalog:a,initialProvider:t,initialSlug:p,allowOAuth:!o,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${a.length}:${t}`)]})}function Js({providerName:s,model:t,isConnected:n}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review ",e.jsx("strong",{children:s})," for model"," ",e.jsx("strong",{children:t}),"."," ",n?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function et({agentId:s,model:t,providerName:n}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"This agent needs a model provider before it can reply."}),e.jsxs("p",{children:[s?e.jsxs("span",{children:["Agent ",e.jsx("strong",{children:s})," is"," "]}):null,"configured to use ",t?e.jsx("strong",{children:t}):"a model"," ","from ",e.jsx("strong",{children:n}),", but that provider is not ready in this workspace."]}),e.jsx("p",{children:"Connect the provider below, then retry the message."})]})]})})}function st({ownerSlug:s,organizationId:t,isWorkspaceLoading:n,connectorKey:a}){const{data:l=[],isLoading:d,isError:h,refetch:c}=Ss(t??""),{data:o=[],isLoading:p,isError:m,refetch:r}=Ps(t??"",{connectorKey:a}),{setup:f}=Y.useSearch(),b=Y.useNavigate(),x=u.useMemo(()=>l.find(A=>A.key===a),[l,a]),N=u.useMemo(()=>$s(a,l,{name:o[0]?.connector_name??a}),[a,l,o]);if(n||d)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-6 w-6 rounded"}),e.jsx(w,{className:"h-5 w-40"})]}),e.jsx(w,{className:"h-16 w-full rounded-lg"}),e.jsx(w,{className:"h-24 w-full rounded-lg"}),e.jsx(w,{className:"h-32 w-full rounded-lg"})]})});if(h||m)return e.jsx(F,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(j,{variant:"outline",onClick:()=>{c(),r()},children:"Retry"})]})});const v=x?e.jsx(at,{connector:x,ownerSlug:s,organizationId:t??void 0,connectionCount:o.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ke,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",o.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:x&&t?e.jsx(tt,{hero:v,connector:x,organizationId:t,ownerSlug:s,connectorKey:a,connections:o,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void b({search:A=>({...A,setup:void 0}),replace:!0})}):e.jsxs(F,{className:"space-y-6",children:[v,o.length>0&&!p?e.jsx(Ue,{section:!0,connections:o,ownerSlug:s,connectorKey:a}):p?e.jsx(w,{className:"h-8 w-40"}):e.jsx("div",{children:e.jsx(Ie,{ownerSlug:s,connectorKey:a})})]})})}function tt({hero:s,connector:t,organizationId:n,ownerSlug:a,connectorKey:l,connections:d,isLoading:h,openNewApp:c,onNewAppHandled:o}){const{isAdmin:p,isLoading:m}=Le(n),r=(t.operations_summary?.total??0)>0,f=e.jsx(_s,{connector:t,organizationId:n,ownerSlug:a,connections:d,openNewApp:c,onNewAppHandled:o});return e.jsxs(ne,{header:s,children:[h?e.jsx(w,{className:"h-8 w-40"}):d.length>0?e.jsx(Ue,{section:!0,connections:d,connector:t,ownerSlug:a,connectorKey:l,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:n,ownerSlug:a}),r&&m?e.jsx(w,{className:"h-20 w-full rounded-lg"}):r&&p?e.jsx(it,{connector:t,organizationId:n,ownerSlug:a}):r&&!p?e.jsx(T,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(nt,{connector:t,organizationId:n,ownerSlug:a})]})}function at({connector:s,ownerSlug:t,organizationId:n,connectionCount:a}){return e.jsx(se,{breadcrumb:e.jsx(te,{crumbs:[e.jsx(L,{to:"/$owner/connectors",params:{owner:t},className:M,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??ps(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{connectorDef:s,ownerSlug:t}),n?e.jsx(rt,{connector:s,organizationId:n,ownerSlug:t,connectionCount:a}):null]}),caption:s.description,meta:e.jsx(Rs,{owner:t,filters:{connectorKey:s.key},name:s.name})})}function nt({connector:s,organizationId:t,ownerSlug:n}){const a=bs(s.auth_schema),l=Cs(s.auth_schema),d=ks(s.auth_schema),h=ws(s.auth_schema),c=a.some(N=>N.type==="env_keys"),o=a.some(N=>N.type==="browser"),p=l.some(N=>N.type==="interactive"),m=!!(d||h||c||o),r=As(s),{data:f=[]}=ke(t,{connectorKey:s.key,profileKind:"env"}),{data:b=[]}=ke(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||o&&b.length>0||!m&&(r||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(we,{profiles:f,type:"env"}):null,o&&b.length>0?e.jsx(we,{profiles:b,type:"browser_session"}):null,m?null:r?e.jsx(T,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(L,{to:"/$owner/connectors",params:{owner:n},search:{},children:"View devices"})})]})}):p?e.jsx(T,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:n,connectionCount:a}){const l=q(),{isAdmin:d}=Le(t),h=js(),[c,o]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=a>0,r=h.isPending,f=()=>{o(null),h.mutate({connector_key:s.key},{onSuccess:()=>{l({to:"/$owner/connectors",params:{owner:n}})},onError:b=>{o(b instanceof Error?b.message:"Failed to remove connector")}})};return e.jsxs(gs,{onOpenChange:()=>o(null),children:[e.jsx(fs,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(vs,{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:[a," connection",a===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(j,{variant:"destructive",size:"sm",disabled:r||m,onClick:f,children:[r?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function it({connector:s,organizationId:t,ownerSlug:n}){const a=Be();return e.jsx(Re,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>a?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:n}})})}function we({profiles:s,type:t}){const n=t==="env"?"Credentials":"Browser sessions";return e.jsx(T,{title:n,children:e.jsx("div",{className:"space-y-2",children:s.map(a=>e.jsxs("div",{className:Ds(Fe,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:a.display_name}),e.jsx(Fs,{status:a.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]},a.slug))})})}function lt({connector:s,organizationId:t,ownerSlug:n}){const a=Be(),l=Object.keys(s.feeds_schema??{}).length;return l?e.jsx(Re,{title:"Feeds",summary:`${l} ${l===1?"feed type":"feed types"}`,onOpen:()=>a?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:n}})}):null}export{tt as ConnectorDetailShell,at as ConnectorHero,rt as ConnectorRemoveButton,jt as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey.index-tnMwC67b.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,cA as A,i as c,jj as p,jk as h,jl as d,jm as u,jn as w,r as M,at as k,aH as C,jo as z}from"./index-BjcZVe7n.js";import{A as N}from"./agent-loading-shells-_18OREnx.js";import{s as b,R as y,A as O}from"./agent-thread-FyEO-y44.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-BP3xHM2d.js";import"./use-mention-search-CJGCatFS.js";import"./index-Vcq4gwWv.js";import"./use-automations-D9hKpufo.js";import"./event-card-CjA_dLzq.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./run-initiator-CCxNv0rK.js";import"./clients-Cmp0LmOp.js";import"./renderer-CHPS-1vD.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./change-summary-DeuXQEpb.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./client-rows-x_CxeWkP.js";import"./automation-row-B5Q1B10y.js";import"./model-C2q7WDcS.js";import"./connection-label-BobuYiAG.js";import"./events-feed-CGzA1w3R.js";import"./client-activity-scopes-BD2HBo-_.js";import"./use-scroll-sentinel-BWCrmNIB.js";const T={discord:{hex:`#${u.hex}`,path:u.path},gchat:{hex:`#${d.hex}`,path:d.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${h.hex}`,path:h.path},whatsapp:{hex:`#${p.hex}`,path:p.path}};function I({platform:o,className:a}){const t=o?T[o]: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(A,{className:c("text-muted-foreground",a),"aria-hidden":"true"})}const L={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(o,a,t){return o==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function S({owner:o,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=w(a,t,{orgSlug:o}),i=M.useMemo(()=>n.map(s=>b(s,{showToolCalls:!0})).filter(s=>s!==null),[n]),[r,g]=t.split(":"),m=L[r]??"the source app",{org:f}=k(),{data:j=[]}=C(f?.id??"",{connectorKey:r}),v=j[0]?.config?.chatMetadata,l=R(r,g,v);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:x?e.jsx(N,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(y,{messages:i,children:e.jsx(O,{readOnly:!0})}),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(I,{platform:r,className:"size-5 shrink-0"}),e.jsxs("span",{className:"text-muted-foreground",children:["This is a read-only copy. Continue the conversation with this agent in ",m,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",m," →"]})]}):null]})})}function l2(){const{owner:o,agentId:a,conversationId:t}=z.useParams();return e.jsx(S,{owner:o,agentId:a,conversationId:t})}export{l2 as component};
|
|
2
|
-
//# sourceMappingURL=_conversationId-DXN_8m88.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as u,c as v,j as a,ak as d,az as f,cg as h,ch as x,ci as j,bk as w,cj as P}from"./index-BjcZVe7n.js";import{E as g}from"./event-detail-CmC-DVrK.js";import"./events-feed-CGzA1w3R.js";import"./event-card-CjA_dLzq.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./run-initiator-CCxNv0rK.js";import"./use-automations-D9hKpufo.js";import"./clients-Cmp0LmOp.js";import"./renderer-CHPS-1vD.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./change-summary-DeuXQEpb.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./client-rows-x_CxeWkP.js";import"./automation-row-B5Q1B10y.js";import"./model-C2q7WDcS.js";import"./connection-label-BobuYiAG.js";import"./client-activity-scopes-BD2HBo-_.js";import"./use-scroll-sentinel-BWCrmNIB.js";import"./view-param-filters-CDvwie_f.js";import"./app-bridge-C4nPtae3.js";import"./filter-bar-CQ_oE7a9.js";function E({owner:e,eventId:t,viewKey:o}){const s=u({strict:!1}),p=v(),m=(i,r)=>a.jsx(g,{owner:r,organizationId:i,eventId:t,viewKey:o,params:o?x(s):{},onParamsChange:(n,c,l)=>void p({to:h(r,t,n),search:c,replace:l?.replace??!0}),fullBleed:!0},`${r}/${t}`);return a.jsx(d,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):a.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:r})=>i?m(i,r):a.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function X(){const{owner:e,eventId:t}=j.useParams(),o=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),s=P(t);return s===null?null:a.jsx(E,{owner:e,eventId:s,viewKey:o?.viewKey})}export{X as component};
|
|
2
|
-
//# sourceMappingURL=_eventId-SdpFT7jB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ji as a,j as e}from"./index-BjcZVe7n.js";import{b as i}from"./agent-guardrails-route-CN7vpC0X.js";import"./model-selector-B2cjCn0V.js";import"./agent-tab-intro-DKrC3SQt.js";import"./table-DALHuXPE.js";import"./agent-loading-shells-_18OREnx.js";import"./agent-card-controls-DuQJhtqp.js";function l(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{l as component};
|
|
2
|
-
//# sourceMappingURL=_name-CM1AMywz.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-Cq8P38s3.js","assets/index-BjcZVe7n.js","assets/index-CNEpTkgw.css","assets/automation-detail-content-Bs3vwAPd.js","assets/create-automation-form-C9PMX7N8.js","assets/model-C2q7WDcS.js","assets/entity-options-BkU_En_f.js","assets/connection-label-BobuYiAG.js","assets/use-automations-D9hKpufo.js","assets/model-selector-B2cjCn0V.js","assets/skill-editor-D_W3QlRz.js","assets/json-diff-DtZtra_g.js","assets/index-Vcq4gwWv.js","assets/use-mention-search-CJGCatFS.js","assets/automation-source-list-Dhucq1sI.js","assets/proposal-review-shell-BED-DO9C.js","assets/runs-BntGAKQG.js","assets/events-feed-CGzA1w3R.js","assets/event-card-CjA_dLzq.js","assets/definition-comparison-B5WgZILB.js","assets/schema-value-BFb7jCBo.js","assets/run-initiator-CCxNv0rK.js","assets/clients-Cmp0LmOp.js","assets/renderer-CHPS-1vD.js","assets/card-g4yxo4Hr.js","assets/table-DALHuXPE.js","assets/change-summary-DeuXQEpb.js","assets/copy-button-Ddf7lBjZ.js","assets/agent-list-row-BnP6r4pm.js","assets/client-rows-x_CxeWkP.js","assets/automation-row-B5Q1B10y.js","assets/client-activity-scopes-BD2HBo-_.js","assets/use-scroll-sentinel-BWCrmNIB.js","assets/agent-loading-shells-_18OREnx.js","assets/agent-thread-FyEO-y44.js","assets/app-bridge-C4nPtae3.js","assets/pending-seed-BP3xHM2d.js","assets/connection-feed-detail-Ckq-qEbD.js","assets/runs-table-CYS1jDdL.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-CezOH3s7.js","assets/connections-browser-BXsJqieG.js","assets/status-dot-BnQPFrcU.js","assets/connector-scope-lists-dQnZARCD.js","assets/source-record-panels-m8gECt82.js","assets/schema-type-editor-panel-v3nR2Oa2.js","assets/entity-type-page-D0ghgRgq.js","assets/event-detail-CmC-DVrK.js","assets/view-param-filters-CDvwie_f.js","assets/filter-bar-CQ_oE7a9.js","assets/views-access-required-CZ1fvAks.js","assets/dynamic-schema-form-qWSRtOAv.js","assets/record-session-DOFgdd43.js","assets/runs-panel-BwTVaRsE.js","assets/manage-gear-C-0BAMbC.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{p as m,j as e,r as h,C as j,L as y,u as v,a as b,b as N,c as P,d as R,D as I,e as _,f as D,g as A,h as E,i as w,k as S,l as C,B as p,m as L,A as O,X as T,n as z,_ as K,S as x,R as $,o as B,q as W,s as H,t as V,N as q,O as F}from"./index-BjcZVe7n.js";import{R as G}from"./record-session-DOFgdd43.js";function k({item:t}){const n=t.href?m(t.href):null;if(!n)return null;const s=n.owner,i=n.kind==="automation"?n.automationId:t.sourceAttribution?.automation_id??null,o=t.sourceAttribution,r=[{label:s,to:"/$owner",params:{owner:s}}];return o?.agent_id&&o.agent_name&&r.push({label:o.agent_name,to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:o.agent_id}}),i!=null&&r.push({label:o?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:s,automationId:String(i)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?r.push({label:"Run details"}):n.kind==="event"?r.push({label:"Event details"}):n.kind==="memory"&&"contentIds"in n&&r.push({label:"Details"}),r.length<2?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:r.map((a,l)=>{const c=l===r.length-1,f=e.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:a.label});return e.jsxs(h.Fragment,{children:[l>0?e.jsx(j,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,a.to&&!c?e.jsx(y,{to:a.to,params:a.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:a.label}):f]},a.to??a.label)})})}const M=z(async()=>({default:(await K(async()=>{const{PeekPaneContent:t}=await import("./peek-pane-content-Cq8P38s3.js");return{PeekPaneContent:t}},__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,47,48,49,50,51,52,53,54]))).PeekPaneContent}));function Q(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(x,{className:"h-5 w-2/3"}),e.jsx(x,{className:"h-4 w-full"}),e.jsx(x,{className:"h-24 w-full rounded-lg"})]})}const U=460,X=480;function J({children:t}){const n=h.useRef(null),s=v(),i=b(),o=N(n,U+X),r=!i&&o&&s?.item!=null;return e.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{inert:r,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:t}),e.jsx(Y,{covers:r})]})}function Y({covers:t=!1}){const n=v(),s=b();return n?.item?e.jsx(ee,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:s,covers:t}):null}function Z(t){const n=t.href?m(t.href):null,s=n?.kind==="record-view"?n.viewKey:null,i=n?.kind==="entity-type"?n:null,o=i?.typeSlug??null,r=S({slug:s?n?.owner:void 0}),{data:a}=C(o?n?.owner??null:null),l=o?a?.find(c=>c.slug===o)?.name:void 0;return s&&r.data?.find(c=>c.key===s)?.name||l&&(i?.view==="activity"?`${l} activity`:l)||t.title}function ee({item:t,onClose:n,onBack:s,isNarrow:i,covers:o}){const r=P(),a=t.href?m(t.href):null,l=t.runId&&a?.kind==="automation"&&a.view==="activity"?{pathname:`/${a.owner}/events`,search:{run_ids:String(t.runId)}}:t.href?R(t.href):null,c=Z(t);h.useEffect(()=>{if(i)return;const d=u=>{u.defaultPrevented||u.key!=="Escape"||(u.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,i]);const f=d=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[s||d?e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:s??n,children:e.jsx(L,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:c}),l?e.jsx(p,{type:"button",variant:"ghost",size:a?.kind==="runs"?"sm":"icon",className:w("h-7 shrink-0 text-muted-foreground hover:text-foreground",a?.kind==="runs"?"gap-1 px-2 text-xs":"w-7"),"aria-label":a?.kind==="runs"?"Open in Activity":"Open full page",asChild:!0,children:e.jsxs(y,{to:l.pathname,search:l.search??{},onClick:u=>{u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||(u.preventDefault(),(async()=>(await n(),await r({to:l.pathname,search:l.search??{}})))())},children:[a?.kind==="runs"?"Open in Activity":null,e.jsx(O,{className:"h-4 w-4"})]})}):null,e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:e.jsx(T,{className:"h-4 w-4"})})]}),g=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(h.Suspense,{fallback:e.jsx(Q,{}),children:e.jsx(M,{item:t})})});return i?e.jsx(I,{open:!0,onOpenChange:d=>{d||n()},children:e.jsxs(_,{children:[e.jsx(D,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(A,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(E,{className:"sr-only",children:c}),f(!0),e.jsx(k,{item:t}),g]})]})}):e.jsxs("aside",{className:w("flex flex-col border-l border-border bg-background",o?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),e.jsx(k,{item:t}),g]})}function ae(){const{owner:t}=$.useParams(),{data:n,isLoading:s,error:i}=B(t==="me"?null:t,{slug:t}),{session:o,isReady:r}=W();return H({active:V({settled:!s,authReady:r,session:o,resolved:!!n?.workspace,error:i}),owner:t})?null:e.jsx(q,{children:e.jsx(G,{children:e.jsx(J,{children:e.jsx(F,{})})})})}export{ae as component};
|
|
3
|
-
//# sourceMappingURL=_owner-CaGsXXBW.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j6 as p,j as m,bj as i}from"./index-BjcZVe7n.js";import{M as e}from"./memory-browse-page-Ba32-vVL.js";import"./public-shell-ready-Diq15_QW.js";import"./connector-boxes-CbqSFeVm.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BXsJqieG.js";import"./status-dot-BnQPFrcU.js";import"./connector-scope-lists-dQnZARCD.js";import"./use-automations-D9hKpufo.js";import"./model-C2q7WDcS.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-v3nR2Oa2.js";import"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-qWSRtOAv.js";import"./renderer-CHPS-1vD.js";import"./schema-value-BFb7jCBo.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./filter-bar-CQ_oE7a9.js";import"./entity-pages-DxgbjLMt.js";import"./core.esm-BsXtvNoI.js";import"./view-param-filters-CDvwie_f.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-Bam6s3jj.js";import"./member-scope-gate-BQiRAqtx.js";function D(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{D as component};
|
|
2
|
-
//# sourceMappingURL=_shape-DGAkETDp.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jg as e,j as i}from"./index-BjcZVe7n.js";import{b as m}from"./agent-skills-route-d5jh3oBR.js";import"./agent-skill-context-1DBn7Xc_.js";import"./core.esm-BsXtvNoI.js";import"./skill-editor-D_W3QlRz.js";import"./agent-tab-intro-DKrC3SQt.js";import"./agent-loading-shells-_18OREnx.js";import"./agent-card-controls-DuQJhtqp.js";function x(){const{owner:t,agentId:o,skillKey:r}=e.useParams();return i.jsx(m,{owner:t,agentId:o,skillKey:r})}export{x as component};
|
|
2
|
-
//# sourceMappingURL=_skillKey-Dd4ZHPY8.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{gR as m,v as y,c as d,g6 as g,fo as u,j as t,ak as c,al as x,bO as f}from"./index-BjcZVe7n.js";import{E}from"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";function b(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=y(),o=d(),{data:i=[],isLoading:r}=g(s),e=i.find(l=>l.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(f,{label:"entity type",variant:"panel"}):e?t.jsx(E,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
|
|
2
|
-
//# sourceMappingURL=_slug-cRvJQtNo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{bH as t,bI as p,j as e}from"./index-BjcZVe7n.js";import{A as s,h as a}from"./activity-route-view-CZykJXQp.js";import"./record-activity-CTLwq8s1.js";import"./filter-bar-CQ_oE7a9.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-C-0BAMbC.js";import"./runs-BntGAKQG.js";import"./source-record-panels-m8gECt82.js";import"./event-card-CjA_dLzq.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./run-initiator-CCxNv0rK.js";import"./use-automations-D9hKpufo.js";import"./clients-Cmp0LmOp.js";import"./renderer-CHPS-1vD.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./change-summary-DeuXQEpb.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./client-rows-x_CxeWkP.js";import"./automation-row-B5Q1B10y.js";import"./model-C2q7WDcS.js";import"./events-feed-CGzA1w3R.js";import"./client-activity-scopes-BD2HBo-_.js";import"./use-scroll-sentinel-BWCrmNIB.js";import"./agent-loading-shells-_18OREnx.js";import"./member-scope-gate-BQiRAqtx.js";import"./runs-panel-BwTVaRsE.js";import"./runs-table-CYS1jDdL.js";import"./nav-pill-Bam6s3jj.js";import"./public-shell-ready-Diq15_QW.js";function O(){const{owner:r,view:i}=t.useParams(),m=t.useSearch(),o=a(i);if(!o)throw p();return e.jsx(s,{owner:r,search:m,homeView:o})}export{O as component};
|
|
2
|
-
//# sourceMappingURL=_view-B5I7mmkl.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jp as p,j as i,bj as m}from"./index-BjcZVe7n.js";import{M as e}from"./memory-browse-page-Ba32-vVL.js";import"./public-shell-ready-Diq15_QW.js";import"./connector-boxes-CbqSFeVm.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BXsJqieG.js";import"./status-dot-BnQPFrcU.js";import"./connector-scope-lists-dQnZARCD.js";import"./use-automations-D9hKpufo.js";import"./model-C2q7WDcS.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-v3nR2Oa2.js";import"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-qWSRtOAv.js";import"./renderer-CHPS-1vD.js";import"./schema-value-BFb7jCBo.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./filter-bar-CQ_oE7a9.js";import"./entity-pages-DxgbjLMt.js";import"./core.esm-BsXtvNoI.js";import"./view-param-filters-CDvwie_f.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-Bam6s3jj.js";import"./member-scope-gate-BQiRAqtx.js";function A(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{A as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-Bwn0dyLo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jd as t,j as m}from"./index-BjcZVe7n.js";import{M as i}from"./memory-browse-page-Ba32-vVL.js";import"./public-shell-ready-Diq15_QW.js";import"./connector-boxes-CbqSFeVm.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BXsJqieG.js";import"./status-dot-BnQPFrcU.js";import"./connector-scope-lists-dQnZARCD.js";import"./use-automations-D9hKpufo.js";import"./model-C2q7WDcS.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-v3nR2Oa2.js";import"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-qWSRtOAv.js";import"./renderer-CHPS-1vD.js";import"./schema-value-BFb7jCBo.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./filter-bar-CQ_oE7a9.js";import"./entity-pages-DxgbjLMt.js";import"./core.esm-BsXtvNoI.js";import"./view-param-filters-CDvwie_f.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-Bam6s3jj.js";import"./member-scope-gate-BQiRAqtx.js";function q(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{q as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-YjSYD0wc.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as rt,at as Z,ck as K,bj as O,cl as Q,r as v,c as B,aq as ut,cm as dt,j as o,bO as X,b2 as M,cn as mt,co as V,cp as pt,cq as tt,B as T,L as j,cr as nt,cs as ft,ct as gt,cu as xt,cv as F,bb as ht,cw as vt,cx as bt,cy as et,cz as jt,cA as at,cB as ot,cC as st,cD as yt,aH as kt,cE as _t,cF as Nt,cG as At,cH as it,cI as It,i as $t,u as Rt,cJ as St,cK as Et,d as ct,cL as Ct,cM as Lt,cN as Tt,w as Mt,ak as Ft,az as Ot,al as Pt}from"./index-BjcZVe7n.js";import{R as Ht,E as Kt,S as Bt,N as U,M as Wt}from"./record-activity-CTLwq8s1.js";import{M as wt}from"./member-scope-gate-BQiRAqtx.js";import{o as P,F as Dt}from"./filter-bar-CQ_oE7a9.js";import{W as Ut}from"./runs-panel-BwTVaRsE.js";import{u as zt}from"./client-activity-scopes-BD2HBo-_.js";import{n as Gt}from"./nav-pill-Bam6s3jj.js";import{c as qt}from"./client-rows-x_CxeWkP.js";import{P as Yt}from"./public-shell-ready-Diq15_QW.js";function Jt({organizationId:n,ownerSlug:t,typeScope:e,entityScope:a,attentionOnly:i=!1}){const{orgContext:r}=rt(),{isMember:c,isLoading:d}=Z(),p=c&&!!n,{attentionItems:s,isError:u}=K(t),g=e?O(e):void 0,m=!a&&!g,{feeds:l,rows:h,pageRows:f}=Q(n,s),y=v.useMemo(()=>new Set(f.flatMap(({item:D})=>D.approvalRunId!=null?[D.approvalRunId]:[])),[f]),b=B(),_=()=>void b({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:k,isLoading:N,error:C}=ut(a?`/${t}/${dt(a)}`:`/${t}`,r),A=a?k?.entity:void 0,L=(a?A?.entity_type??O(a.split("/").at(-2)??""):g)==="$member",$=a!=null&&!N&&(C!=null||k?.entity==null),x=a?void 0:k?.counts,R=x?x.connections>0||x.agents>0:!1,w=p&&!d&&!N&&x!=null&&!R,S=a&&N?o.jsx(X,{label:"Loading record…"}):$?o.jsx(M,{icon:mt,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):i&&m?o.jsx(Zt,{owner:t,items:h,isError:u}):A?o.jsx(Ht,{ownerSlug:t,entity:A,organizationId:n}):o.jsx(Kt,{organizationId:n,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:g?[g]:void 0,pinned:m&&(f.length>0||l.length>0)?{rows:o.jsx(V,{owner:t,organizationId:n,feeds:l,rows:f}),hiddenApprovalRunIds:y}:void 0,onShowNotifications:m?_:void 0,emptyState:w?o.jsx(Xt,{ownerSlug:t}):void 0});return o.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:L?o.jsx(wt,{children:S}):S})}function Zt({owner:n,items:t,isError:e}){const a=B();return o.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[o.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),o.jsx(Qt,{owner:n}),o.jsx(Bt,{value:U.value,withNotifications:!0,onChange:i=>{if(i===U.value)return;const[r,c]=i.split("-");a({to:"/$owner",params:{owner:n},search:pt({sortBy:r,sortOrder:c})})}})]}),e?o.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?o.jsx(M,{icon:tt,title:"All caught up",description:"Nothing needs you right now.",children:o.jsx(T,{asChild:!0,variant:"outline",className:"mt-4",children:o.jsx(j,{to:"/$owner",params:{owner:n},children:"See all activity"})})}):o.jsx(nt,{owner:n,rows:t})]})}function Qt({owner:n}){const{visibleUnreadIds:t,markVisibleRead:e,bulkPending:a}=K(n);return t.length===0?null:o.jsxs(T,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:a,onClick:()=>void e(),children:[o.jsx(tt,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function Xt({ownerSlug:n}){return o.jsx("div",{className:"px-6",children:o.jsx(M,{icon:ft,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:o.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[o.jsx(T,{asChild:!0,children:o.jsxs(j,{to:"/$owner/connectors/create",params:{owner:n},children:[o.jsx(gt,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),o.jsx(T,{asChild:!0,variant:"outline",children:o.jsxs(j,{to:"/$owner/agents",params:{owner:n},children:[o.jsx(xt,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const H={agent:null,connection:null,automation:null,status:null,attentionKind:null};function E(n,t){const e=n[t];return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"&&Number.isFinite(e)?String(e):null}function Vt(n){const t=E(n,"home_status"),e=E(n,"home_kind");return{agent:E(n,"home_agent"),connection:E(n,"home_connection"),automation:E(n,"home_automation"),status:t==="failed"||t==="running"||t==="completed"?t:null,attentionKind:e==="approval"||e==="notification"||e==="draft"?e:null}}function tn(n){return{home_agent:n.agent??void 0,home_connection:n.connection??void 0,home_automation:n.automation??void 0,home_status:n.status??void 0,home_kind:n.attentionKind??void 0}}function nn(n){return Object.values(n).some(t=>t!=null)}function en(n,t){const e=n.card?.status;return e?t==="failed"?F(e):t==="running"?e==="pending"||e==="claimed"||e==="running":e==="completed":!1}function an(n,t){return!(t.agent&&n.source?.agent_id!==t.agent||t.connection&&String(n.source?.connection_id??"")!==t.connection||t.automation&&String(n.source?.automation_id??"")!==t.automation||t.status&&!en(n,t.status))}function on(n,t){const e=n.notification;return t.agent&&e?.agent_id!==t.agent||t.connection&&String(e?.connection_id??"")!==t.connection||t.automation&&String(e?.automation_id??"")!==t.automation?!1:t.attentionKind==="draft"?n.browserUrl!=null:t.attentionKind==="approval"?n.approvalRunId!=null||n.interactionType==="approval"||n.interactionType==="authorization":t.attentionKind==="notification"?n.notification!=null&&n.approvalRunId==null:!0}function sn(n){const t=new Map;for(const e of n){const a=e.source?.agent_id;a&&t.set(a,e.source?.agent_name??a)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function cn(n){const t=new Map;for(const e of n){const a=e.source?.automation_id;a!=null&&t.set(String(a),e.source?.automation_name||e.subjectLabel||`Automation ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function ln(n){return n.map(t=>({value:String(t.id),label:t.display_name||t.connector_key})).sort((t,e)=>t.label.localeCompare(e.label))}function rn(n){const t=new Map;for(const e of n){const a=e.notification?.agent_id;a&&t.set(a,e.notification?.agent_name??a)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function un(n){const t=new Map;for(const e of n){const a=e.notification?.automation_id;a!=null&&t.set(String(a),e.notification?.automation_name??`Automation ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}function dn(n){const t=new Map;for(const e of n){const a=e.notification?.connection_id;a!=null&&t.set(String(a),e.notification?.connection_name??`Connection ${a}`)}return[...t].map(([e,a])=>({value:e,label:a})).sort((e,a)=>e.label.localeCompare(a.label))}const z=[{value:"failed",label:"Failed"},{value:"running",label:"Running"},{value:"completed",label:"Completed"}],G=[{value:"approval",label:"Approvals"},{value:"notification",label:"Notifications"},{value:"draft",label:"Browser drafts"}];function I(n,t,e,a){return P({searchPlaceholder:`Search ${n.toLowerCase()}...`,emptyText:`No ${n.toLowerCase()} in this view`,options:t,selected:e?[e]:[],onSelect:a})}function mn({view:n,entries:t,attentionItems:e=[],connections:a,filters:i,onChange:r}){const c=n==="attention",d=[],p=c?rn(e):sn(t),s=c?un(e):cn(t),u=c?dn(e):ln(a);c?((()=>{d.push({key:"agent",label:"Agent",editor:I("agents",p,i.agent,l=>r({agent:l}))}),d.push({key:"connection",label:"Connection",editor:I("connections",u,i.connection,l=>r({connection:l}))}),d.push({key:"automation",label:"Automation",editor:I("automations",s,i.automation,l=>r({automation:l}))})})(),d.push({key:"attentionKind",label:"Type",editor:P({searchPlaceholder:"Search types...",options:G,selected:i.attentionKind?[i.attentionKind]:[],onSelect:l=>r({attentionKind:l})})})):((n==="all"||n==="sessions")&&d.push({key:"agent",label:"Agent",editor:I("agents",p,i.agent,l=>r({agent:l}))}),(n==="all"||n==="feeds")&&d.push({key:"connection",label:"Connection",editor:I("connections",u,i.connection,l=>r({connection:l}))}),(n==="all"||n==="automations")&&d.push({key:"automation",label:"Automation",editor:I("automations",s,i.automation,l=>r({automation:l}))}),n!=="sessions"&&d.push({key:"status",label:"Status",editor:P({searchPlaceholder:"Search statuses...",options:z,selected:i.status?[i.status]:[],onSelect:l=>r({status:l})})}));const m=[];if(i.agent&&m.push({id:"agent",label:"Agent",op:"is",value:p.find(l=>l.value===i.agent)?.label??i.agent,onRemove:()=>r({agent:null})}),i.connection){const l=u.find(h=>h.value===i.connection)?.label??i.connection;m.push({id:"connection",label:"Connection",op:"is",value:l,onRemove:()=>r({connection:null})})}return i.automation&&m.push({id:"automation",label:"Automation",op:"is",value:s.find(l=>l.value===i.automation)?.label??i.automation,onRemove:()=>r({automation:null})}),i.status&&!c&&m.push({id:"status",label:"Status",op:"is",value:z.find(l=>l.value===i.status)?.label??i.status,onRemove:()=>r({status:null})}),i.attentionKind&&c&&m.push({id:"attentionKind",label:"Type",op:"is",value:G.find(l=>l.value===i.attentionKind)?.label??i.attentionKind,onRemove:()=>r({attentionKind:null})}),o.jsx(Dt,{label:"Home filters",fields:d,chips:m,onClearAll:()=>r(H)})}const q=12,pn=5e3;function fn(n,t){const e=!!n&&!!t.organizationId&&(t.enabled??!0),a=ht({enabled:e}),{data:i}=a,r=i??[],c=v.useMemo(()=>r.map(l=>l.agentId),[r]),{threads:d,isLoading:p,isError:s}=vt(n,c,{enabled:e&&c.length>0,limit:q}),u=zt({enabled:e,limit:q,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:l=>l?pn:!1}),g=t.organizationId?u.data:void 0;return{items:v.useMemo(()=>[...d.map(l=>({kind:"conversation",at:l.updatedAt,thread:l})),...(g??[]).map(l=>({kind:"mcp",at:l.lastCallAt,conversation:l}))].sort((l,h)=>h.at-l.at),[g,d]),agents:r,isLoading:e&&(a.isLoading||p||u.isLoading),isError:a.isError||s||u.isError}}function gn(n){return n==="all"?"activity":n}function Tn(n){switch(n){case"attention":return"attention";case"activity":return"all";case"sessions":return"sessions";case"feeds":return"feeds";case"runs":return"runs";case"automations":return"automations";default:return null}}function xn(n,t){return t==="attention"?{to:"/$owner",params:{owner:n}}:{to:"/$owner/views/$view",params:{owner:n,view:gn(t)}}}function hn(n,t,e,a=[]){const i=new Map(a.map(s=>[s.id,s])),r=new Map;for(const s of[...t.filter(u=>u.kind==="notification"),...e])r.set(s.notification_id!=null?`n:${s.notification_id}`:s.id,s);const c=new Set([...r.values()].flatMap(s=>s.run_id!=null?[s.run_id]:[])),d=new Map,p=new Set(t.flatMap(s=>s.kind==="automation_due"&&s.run_id!=null?[s.run_id]:[]));for(const s of[...t.filter(u=>u.kind!=="notification"&&(u.kind==="automation_due"||u.run_id==null||!p.has(u.run_id))&&(u.run_id==null||!c.has(u.run_id))),...r.values()])d.set(s.id,s);return[...d.values()].map(s=>{const u=s.connection_id!=null?i.get(s.connection_id):void 0,g={...s,platform:s.platform||u?.connector_key,connection_name:s.connection_name||u?.display_name},m=s.kind==="notification"?"notification":s.kind==="sync"?"feed":s.kind==="automation_run"||s.kind==="automation_due"?"automation":"run",l=m==="automation"&&s.automation_id!=null?`automation:${s.automation_id}`:(m==="feed"||m==="run")&&s.connection_id!=null?`connection:${s.connection_id}`:null;return{id:s.id,at:new Date(s.at).getTime(),title:s.title,detail:s.kind==="run"&&s.status&&!F(s.status)?s.status:s.body||s.status,kind:m,subject:l,subjectLabel:s.automation_name||g.connection_name||s.title,href:m!=="notification"&&s.run_id!=null?m==="automation"&&s.automation_id!=null?`/${n}/automations/${s.automation_id}?view=activity&run_id=${s.run_id}`:`/${n}/events?run_ids=${s.run_id}`:s.href,card:s,source:g}})}function vn(n,t,e){return t.map(a=>{if(a.kind==="mcp"){const s=a.conversation,u=n==="me"||s.organizationId==null?"/me/events":`/${n}/agents/connected/${encodeURIComponent(s.clientId)}/activity`,g=new URLSearchParams({mcp_activity_id:s.activityId});return(n==="me"||s.organizationId==null)&&g.set("client_ids",s.clientId),{id:`client:${s.clientId}:${s.activityId}`,at:a.at,title:qt(s),detail:`${s.clientName||"Connected app"} · ${s.callCount} ${s.callCount===1?"call":"calls"}${s.isLive?" · Active":""}`,href:`${u}?${g}`,kind:"session",subject:`client:${s.clientId}`,subjectLabel:s.clientName||"Connected app",source:{client_id:s.clientId,client_name:s.clientName}}}const i=a.thread,r=e.get(i.agentId)||"Agent",c=i.platform||"web",d=bt(n,i.agentId,i.id),p=c==="web"?Object.entries(d.params).reduce((s,[u,g])=>s.replace(`$${u}`,encodeURIComponent(g)),d.to):`/${n}/agents/${encodeURIComponent(i.agentId)}/conversations/${encodeURIComponent(i.conversationId??i.id)}`;return{id:`thread:${i.agentId}:${i.id}`,at:a.at,title:i.title||"Conversation",detail:`${r} · ${c==="web"?"Chat":c}${i.isRunning?" · Active":""}`,href:p,kind:"session",subject:`agent:${i.agentId}`,subjectLabel:r,source:{agent_id:i.agentId,agent_name:r,platform:c==="web"?null:c}}})}function bn(n){const t=new Map;for(const e of[...n].sort((a,i)=>i.at-a.at||a.id.localeCompare(i.id))){const a=new Date(e.at),i=`${a.getFullYear()}-${a.getMonth()}-${a.getDate()}`,r=e.subject?`${e.kind}:${e.subject}:${i}`:e.id,c=t.get(r)??{key:r,entries:[]};c.entries.push(e),t.set(r,c)}return[...t.values()]}const Y=[{view:"attention",label:"Needs attention",icon:et},{view:"all",label:"Activity",icon:jt},{view:"sessions",label:"Sessions",icon:at},{view:"feeds",label:"Feeds",icon:ot},{view:"runs",label:"Runs",icon:st}];function jn({owner:n,view:t,organizationId:e,filters:a,onFiltersChange:i}){const{isMember:r,isPublic:c,isLoading:d}=Z(n),p=c&&!r&&!d,s=p&&(t==="attention"||t==="sessions")?"all":t,u=p?Y.filter(m=>m.view!=="attention"&&m.view!=="sessions"):Y,g=K(p?null:n);return o.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[o.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap items-center gap-1.5",children:u.map(({view:m,label:l,icon:h})=>{const f=xn(n,m);return o.jsxs(j,{to:f.to,params:f.params,activeOptions:{exact:!0},"aria-current":s===m?"page":void 0,className:Gt(s===m,"h-7 gap-1.5 px-2 text-xs"),children:[o.jsx(h,{"aria-hidden":"true",className:"size-3.5"}),l,m==="attention"&&g.attentionItems.length>0?o.jsx("span",{className:"text-xs tabular-nums",children:g.attentionItems.length}):null]},m)})}),s==="runs"?o.jsx(Ut,{ownerSlug:n}):o.jsx(yn,{owner:n,view:s,visitor:p,organizationId:e,attention:g,filters:a,onFiltersChange:i})]})}function yn({owner:n,view:t,visitor:e,organizationId:a,attention:i,filters:r,onFiltersChange:c}){const[d,p]=v.useState(H),s=c!=null,u=r??d,g=x=>{if(c){c(x);return}p(R=>({...R,...x}))};v.useEffect(()=>{s||p(H)},[t,s]);const{data:m=[]}=yt(a),{data:l=[]}=kt(t==="all"||t==="feeds"||t==="automations"?a:null),h=Q(e?null:a,i.attentionItems),f=nn(u),y=t==="all"&&!f&&(h.feeds.length>0||h.pageRows.length>0),b=fn(n,{organizationId:a,enabled:!e&&(t==="all"||t==="sessions")}),_=_t(t==="attention"||t==="sessions"?null:n,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),k=v.useMemo(()=>{const x=new Map(b.agents.map(S=>[S.agentId,S.name])),R=t==="all"||t==="sessions"?vn(n,b.items,x):[];return[...t==="attention"?[]:hn(n,[..._.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],l),...R]},[n,t,b.agents,b.items,_.data,l,i.attentionCards,i.notificationCards]),N=v.useMemo(()=>new Set(t==="all"?h.pageRows.map(({item:x})=>x.id):[]),[t,h.pageRows]),C=v.useMemo(()=>bn(k.filter(x=>!N.has(x.id)&&an(x,u))),[k,N,u]),A=v.useMemo(()=>h.rows.filter(({item:x})=>on(x,u)),[h.rows,u]),W=a==null||(t==="attention"?i.isLoading:t!=="sessions"&&_.isLoading||(t==="all"||t==="sessions")&&b.isLoading||t==="all"&&i.isLoading),L=t==="attention"?i.isError:t!=="sessions"&&_.isError||(t==="all"||t==="sessions")&&b.isError||t==="all"&&i.isError,$=t==="attention"?A.length===0:C.length===0&&!y;return o.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[o.jsx(mn,{view:t,entries:k,attentionItems:i.attentionItems,connections:l,filters:u,onChange:g}),t==="attention"&&!f?o.jsx(Nt,{owner:n}):null,L?o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,W&&$?o.jsx(X,{label:"activity"}):$?L?null:o.jsx(M,{icon:At,title:t==="attention"?f?"No notifications match":"All caught up":e?"No public activity":"No recent activity",description:t==="attention"?f?"No notifications match these filters. Try another filter.":"Nothing needs you right now.":f?"No activity matches these filters. Try another filter.":e?"Runs on this workspace's public connections show up here.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?o.jsx(nt,{owner:n,rows:A}):o.jsxs(o.Fragment,{children:[y?o.jsx("div",{className:"space-y-1",children:o.jsx(V,{owner:n,organizationId:a,feeds:h.feeds,rows:h.pageRows})}):null,o.jsx("ul",{className:"divide-y divide-border/60",children:C.map(x=>o.jsx("li",{children:o.jsx(kn,{owner:n,group:x,connectorDefinitions:m})},x.key))})]}),!$&&t!=="attention"?o.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[e&&t==="all"?o.jsx(j,{to:"/$owner/data",params:{owner:n},children:"Browse memory"}):null,t==="all"||t==="feeds"?o.jsx(j,{to:"/$owner/connectors",params:{owner:n},children:"Browse feeds"}):null,t==="all"||t==="automations"?o.jsx(j,{to:"/$owner",params:{owner:n},search:{tab:"runs",run_type:"automation"},children:"Automation history"}):null,t==="sessions"?o.jsx(j,{to:"/$owner/agents",params:{owner:n},children:"Browse agents and apps"}):null]}):null]})}function kn({owner:n,group:t,connectorDefinitions:e}){const[a,i]=v.useState(!1),r=v.useId(),c=t.entries[0];if(t.entries.length===1)return o.jsx(J,{owner:n,entry:c,connectorDefinitions:e});const d=t.entries.filter(s=>F(s.card?.status??"")).length,p=c.kind==="session"?"sessions":c.kind==="feed"?"syncs":c.kind==="run"?"operations":"runs";return o.jsxs("div",{children:[o.jsxs("button",{type:"button","aria-expanded":a,"aria-controls":r,onClick:()=>i(!a),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[o.jsx(lt,{entry:c,connectorDefinitions:e}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:c.subjectLabel}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",p,d>0?o.jsxs("span",{className:"text-destructive",children:[" · ",d," failed"]}):null,c.kind==="session"?null:` · ${c.detail??""}`]})]}),o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:it(c.at)}),o.jsx(It,{"aria-hidden":!0,className:$t("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",a&&"rotate-180")})]}),o.jsxs("ul",{id:r,hidden:!a,className:"ml-4 border-l pl-3",children:[a?t.entries.map(s=>o.jsx("li",{children:o.jsx(J,{owner:n,entry:s,connectorDefinitions:e})},s.id)):null,a&&c.card?.href?o.jsx("li",{children:o.jsx(_n,{entry:c})}):null]})]})}function _n({entry:n}){const t=ct(n.card?.href??"");return o.jsx(j,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:n.kind==="automation"?"View Automation history":"View connection history"})}function lt({entry:n,connectorDefinitions:t}){const e=n.kind==="session"?at:n.kind==="feed"?ot:n.kind==="automation"?Ct:st;return o.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:o.jsx(Lt,{source:n.source,connectorDefinitions:t,label:n.subjectLabel,fallback:o.jsx(e,{className:"h-4 w-4 text-muted-foreground"})})})}function J({owner:n,entry:t,connectorDefinitions:e}){const a=Rt();if(t.kind==="notification"&&t.card)return o.jsx(St,{owner:n,item:Et({...t.card,...t.source})});const i=o.jsxs(o.Fragment,{children:[o.jsx(lt,{entry:t,connectorDefinitions:e}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[F(t.card?.status??"")?o.jsx(et,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,o.jsx("span",{className:"truncate",children:t.detail})]})]}),o.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:it(t.at)})]}),r="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return o.jsx("div",{className:r,children:i});const c=ct(t.href);return o.jsx(j,{to:c.pathname,search:c.search,className:r,onClick:d=>{!a||!t.card||t.kind==="session"||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||d.button!==0||(d.preventDefault(),a.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:n,sourceAttribution:t.source??t.card}))},children:i})}function Mn({owner:n,search:t,entityScope:e,home:a=!1,homeView:i}){const r=typeof t.type=="string"&&t.type.trim()?O(t.type.trim()):void 0,c=typeof t.tab=="string"?t.tab:void 0,p=i??(a?c==="sessions"||c==="feeds"||c==="runs"?c:c==="automations"?"runs":"attention":null),s=String(t.attention)==="1",u=Object.entries(t).some(([f,y])=>(Tt.includes(f)||f.startsWith("clf_"))&&y!=null&&y!==""),g=B(),{pathname:m}=Mt(),l=Vt(t),h=f=>{const y={...l,...f};g({to:m,search:(b=>({...b,...tn(y)})),replace:!0})};return o.jsxs(Ft,{className:"gap-6 pt-2.5 pb-8",children:[o.jsx(Yt,{}),o.jsx(Ot,{owner:n,children:f=>o.jsx(Wt,{organizationId:f.organizationId,isWorkspaceLoading:f.isWorkspaceLoading,children:o.jsx(Pt,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:p!=null&&(!u||p==="runs")&&!r&&!e?o.jsx(jn,{owner:f.ownerSlug,organizationId:f.organizationId,view:p,filters:l,onFiltersChange:h}):o.jsx(Jt,{organizationId:f.organizationId,ownerSlug:f.ownerSlug,typeScope:r,entityScope:e,attentionOnly:s})})})})]})}export{Mn as A,Tn as h};
|
|
2
|
-
//# sourceMappingURL=activity-route-view-CZykJXQp.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,fu as i,C as l,i as c}from"./index-BjcZVe7n.js";function x({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{x as A};
|
|
2
|
-
//# sourceMappingURL=agent-card-controls-DuQJhtqp.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aD as ae,aE as ie,j as e,B as p,db as re,e$ as oe,bc as le,i as de,gu as ce,cU as O,Y as G,d6 as me,hD as ue,hE as ge,hF as fe,hG as xe,g_ as pe,hH as he,c2 as be,c3 as ve,aF as je,r as V,bt as F,f5 as ye,er as we,c7 as Ce}from"./index-BjcZVe7n.js";import{D as Ne,A as Ae,e as Se}from"./definition-comparison-B5WgZILB.js";import{b as Me,s as Pe}from"./model-selector-B2cjCn0V.js";function ke(t){const n=t.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(n?/^[a-z]/.test(n)&&n.length>=3?n:`agent-${n}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function De(t,n){const i=new Set(n),g=ke(t);let x=g,m=2;for(;i.has(x);){const l=`-${m}`;x=`${g.slice(0,Math.max(1,60-l.length)).replace(/-+$/g,"")||"agent"}${l}`,m+=1}return x}const Ie="__unresolved__";function H(t){return t.endsWith(`/${Ie}`)}function W(t){const n=t.indexOf("/");return n===-1?{slug:t,model:""}:{slug:t.slice(0,n),model:t.slice(n+1)}}function Ee(t,n){const{slug:i,model:g}=W(t);return{provider:n.find(l=>l.value===t)?.provider??n.find(l=>W(l.value).slug===i)?.provider??i,model:g}}function Fe({value:t,onChange:n,disabled:i}){const{data:g=[]}=ae(),{data:x=[]}=ie(),m=Me(g,x),l=(s,d)=>{const a=s+d;if(a<0||a>=t.length)return;const c=[...t];[c[s],c[a]]=[c[a],c[s]],n(c)},S=s=>{n(t.filter((d,a)=>a!==s))},v=s=>{t.includes(s)||n([...t,s])},u=m.filter(s=>!t.includes(s.value)&&!H(s.value));return e.jsxs("div",{className:"grid gap-2",children:[t.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:t.map((s,d)=>{const a=H(s),{provider:c,model:o}=Ee(s,m);return e.jsxs("li",{className:de("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",a&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:c}),d===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:a?"no model selected":o})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:i||d===0,onClick:()=>l(d,-1),children:e.jsx(re,{className:"h-4 w-4"})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:i||d===t.length-1,onClick:()=>l(d,1),children:e.jsx(oe,{className:"h-4 w-4"})}),e.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:i,onClick:()=>S(d),children:e.jsx(le,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ce,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(p,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:i,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(me,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,d)=>{const a=d.trim(),c=Pe(a,m)&&!t.includes(a);return e.jsxs(e.Fragment,{children:[u.map(o=>e.jsxs(O,{value:`${o.provider} ${o.model} ${o.value}`,onSelect:()=>{v(o.value),s()},className:"cursor-pointer",children:[e.jsx(G,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[o.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:o.model}),o.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},o.value)),c?e.jsxs(O,{value:`__custom__ ${a}`,onSelect:()=>{v(a),s()},className:"cursor-pointer",children:[e.jsx(G,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:a})]})]}):null]})}})]})}const _e=3;function Y(t){return Array.from({length:_e},(n,i)=>t?.[i]??{title:"",message:""})}function q(t){return t.map(({title:n,message:i})=>({title:n.trim(),message:i.trim()})).filter(({title:n,message:i})=>n&&i)}function Le({mode:t,section:n="identity",existingAgentIds:i=[],onCreated:g,onCancel:x,onDone:m,reviewMode:l="none",reviewProposal:S=null,reviewControlsDisabled:v=!1}){const u=t.kind==="create",s=t.kind==="edit"?t.agent:null,d=!u&&n!=="platforms"&&n!=="skills"&&!!s,a=ue(),c=ge(s?.agentId??""),o=fe(s?.agentId??""),M=xe(s?.agentId??""),{data:f,isLoading:L}=pe(s?.agentId,{enabled:d}),U=!u&&l==="active",y=U?S:null,_=y?he(y.proposal):void 0,j=f,z=s?.agentId??"create",r=be(z,{name:_?.name??s?.name??"",description:_?.description??s?.description??"",identityMd:_?.identityMd??f?.identityMd??"",soulMd:f?.soulMd??"",userMd:f?.userMd??"",models:j?.models??j?.settings?.models??[],showToolCalls:j?.showToolCalls??j?.settings?.showToolCalls??!1,sandboxId:j?.sandboxId??j?.settings?.sandboxId??"builtin",starters:Y(f?.starters)}),[b]=r.field("name"),[w]=r.field("description"),[P]=r.field("identityMd"),[k]=r.field("soulMd"),[D]=r.field("userMd"),[C,J]=r.field("models"),[I]=r.field("showToolCalls"),[N]=r.field("sandboxId"),[A]=r.field("starters"),[K,E]=ve(z,!1),{data:Q}=je({enabled:n==="models"&&!u}),X=V.useCallback(async R=>{if(R.preventDefault(),!(v||l==="active"||l==="loading"||l==="error"||!r.canSubmit)){if(u){const h=await a.mutateAsync({agentId:De(b,i),name:b.trim(),description:w.trim()||void 0});g?await g(h.agentId):m?.();return}if(s){if(!f){F.error("Still loading agent settings — try again in a moment");return}if(A.some(({title:h,message:T})=>!!h.trim()!=!!T.trim())){F.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([c.mutateAsync({name:b.trim()||s.name,description:w.trim()||void 0}),M.mutateAsync({identityMd:P.trim(),soulMd:k.trim(),userMd:D.trim(),models:C,authProfiles:f.authProfiles??[],skillsConfig:f.skillsConfig,showToolCalls:I,sandboxId:N==="builtin"?void 0:N,starters:q(A)})]),r.accept(r.values,{name:b.trim()||s.name,description:w.trim()||s.description||"",identityMd:P.trim(),soulMd:k.trim(),userMd:D.trim(),models:C,showToolCalls:I,sandboxId:N,starters:Y(q(A))}),F.success("Agent saved"),m?.()}catch(h){F.error(h instanceof Error?h.message:"Failed to save agent")}}}},[f,a,w,r.accept,r.values,r.canSubmit,v,l,N,i,P,u,C,b,g,m,s,I,k,A,c,M,D]),Z=V.useCallback(async()=>{s&&(await o.mutateAsync(),E(!1),m?.())},[o,m,s,E]),$=a.isPending||c.isPending||o.isPending||M.isPending,ee=u||!!f;if(d&&L)return e.jsx(ye,{rows:6});const B=$||v,se=l==="none"||l==="gone",te=b.trim().length>0&&ee,ne=!u&&n==="settings";if(U&&y){const{current:R,proposed:h}=we(y);return e.jsx(Ne,{current:R,proposed:h,render:T=>e.jsx(Ae,{value:T})},y.runId)}return e.jsxs("form",{onSubmit:X,className:"flex min-h-0 flex-col",children:[e.jsx(Ce,{visible:r.hasConflict,onReload:r.reset}),e.jsx(Se,{value:{name:b,description:w,identityMd:P,soulMd:k,userMd:D,models:C,showToolCalls:I,sandboxId:N,starters:A},onChange:r.setValues,section:n,create:u,disabled:B,loading:L,sandboxes:Q?.sandboxes,modelsEditor:e.jsx(Fe,{value:C,onChange:J,disabled:B})}),se?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[ne?K?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(p,{type:"button",variant:"destructive",onClick:()=>void Z(),disabled:o.isPending,children:o.isPending?"Deleting...":"Delete agent"}),e.jsx(p,{type:"button",variant:"outline",onClick:()=>E(!1),disabled:o.isPending,children:"Cancel"})]}):e.jsx(p,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>E(!0),disabled:o.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[x?e.jsx(p,{type:"button",variant:"outline",onClick:x,disabled:$,children:"Cancel"}):null,e.jsx(p,{type:"submit",disabled:!r.canSubmit||!te||$,children:u?a.isPending?"Creating...":"Create agent":c.isPending||M.isPending?"Saving...":"Save changes"})]})]}):null]})}export{Le as A};
|
|
2
|
-
//# sourceMappingURL=agent-editor-form-BXQBFHSv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as y,j as e,H as w,I as k,bl as K,bm as X,bn as Y,bo as ee,bp as ae,eL as te,B as S,c as P,g_ as G,jb as L,jc as M,hG as B,f5 as se,bt as j,h3 as U,bO as ne,b_ as re,b2 as D,h5 as ie,V as oe,iI as le,bQ as q,d6 as de,i as E,j9 as ue}from"./index-BjcZVe7n.js";import{M as ce}from"./model-selector-B2cjCn0V.js";import{b as me,a as ge,A as J}from"./agent-tab-intro-DKrC3SQt.js";import{T as he,a as pe,b as O,c as R,d as xe,e as $}from"./table-DALHuXPE.js";import{f as be}from"./agent-loading-shells-_18OREnx.js";import{A as je}from"./agent-card-controls-DuQJhtqp.js";const fe=[{value:"input",label:"Input",hint:"the user message, before the agent runs"},{value:"output",label:"Output",hint:"the agent's reply, before the user sees it"},{value:"pre-tool",label:"Pre-tool",hint:"a tool call, before it executes"},{value:"egress",label:"Egress",hint:"an outbound request to a judged domain"}];function H({initial:a,judgeModelDefault:t,submitLabel:n,submitting:s,onSubmit:o,onCancel:r}){const[i,d]=y.useState(a?.name??""),[h,f]=y.useState(a?.stage??"input"),[p,N]=y.useState(a?.policy??""),[x,C]=y.useState(a?.model??""),[b,u]=y.useState((a?.tools??[]).join(", ")),[l,m]=y.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",Q=c=>{c.preventDefault();const _=b.split(",").map(T=>T.trim()).filter(Boolean);o({name:i,stage:h,...g?{kind:g}:{},policy:p,model:x.trim()||void 0,tools:(v||h==="pre-tool")&&_.length>0?_:void 0,domains:h==="egress"&&l.trim()?l.split(",").map(T=>T.trim()).filter(Boolean):void 0,enabled:a?.enabled??!0})};return e.jsxs("form",{onSubmit:Q,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-name",value:i,onChange:c=>d(c.target.value),placeholder:"no-competitor-mentions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Shown in the list and on every trip. Must be unique."})]}),v?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-stage",children:"Stage"}),e.jsxs(K,{value:h,onValueChange:c=>f(c),disabled:s,children:[e.jsx(X,{id:"guardrail-stage",children:e.jsx(Y,{})}),e.jsx(ee,{children:fe.map(c=>e.jsxs(ae,{value:c.value,children:[c.label," — ",c.hint]},c.value))})]})]}),v?e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-required-tools",children:["Required tools ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-required-tools",value:b,onChange:c=>u(c.target.value),placeholder:"suggest_actions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated. The turn trips if the agent finishes without calling every one of these. No judge model runs — this is a lookup against the tools the turn actually used."})]}):null,v?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-policy",children:["Policy ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(te,{id:"guardrail-policy",rows:5,value:p,onChange:c=>N(c.target.value),placeholder:"Deny any response that names a competitor (Acme, Globex) or quotes their pricing.",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"A judge model reads this and the text at the chosen stage, then allows or denies. Write it as an instruction to a reviewer."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-model",children:["Judge model",t?null:e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(ce,{value:x,onChange:C,placeholder:t?`Default (${t})`:"Select a model",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?"Optional. Leave blank to use the gateway's default judge model.":"Required: the gateway has no default judge model (EGRESS_JUDGE_MODEL is unset)."})]})]}),!v&&h==="pre-tool"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-tools",children:"Tool scope"}),e.jsx(k,{id:"guardrail-tools",value:b,onChange:c=>u(c.target.value),placeholder:"github.delete_repo, fs.delete",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Optional, comma-separated. Leave blank to judge every tool call."})]}):null,h==="egress"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-domains",children:"Domains"}),e.jsx(k,{id:"guardrail-domains",value:l,onChange:c=>m(c.target.value),placeholder:"api.github.com, .slack.com",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated hostnames this judge gates — exact (api.github.com) or wildcard (.slack.com). Leave blank to route nothing."})]}):null,e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[r?e.jsx(S,{type:"button",variant:"outline",onClick:r,disabled:s,children:"Cancel"}):null,e.jsx(S,{type:"submit",disabled:s,children:s?"Saving…":n})]})]})}function z(a){return a.kind==="require-tool"}function V(a,t,n,s,o){const r=a.name.trim();return r?/^[a-zA-Z0-9][a-zA-Z0-9 _-]*$/.test(r)?n.includes(r)?`"${r}" is a built-in guardrail name — pick another.`:t.some(d=>d.name===r&&d.name!==o)?`A custom guardrail named "${r}" already exists.`:z(a)?a.stage!=="output"?"A required-tool guardrail only runs at the output stage.":a.tools?.some(d=>d.trim())?null:"List at least one tool that must be used.":a.policy.trim()?!s&&!a.model?.trim()?"Judge model is required — the gateway has no default (EGRESS_JUDGE_MODEL is unset).":null:"Policy is required.":"Name may use letters, numbers, spaces, hyphens, and underscores.":"Name is required."}function W(a){const t=z(a),s=(t||a.stage==="pre-tool")&&a.tools&&a.tools.length>0?a.tools.map(d=>d.trim()).filter(Boolean):void 0,o=a.stage==="egress"&&a.domains&&a.domains.length>0?a.domains.map(d=>d.trim()).filter(Boolean):void 0,r=a.model?.trim()||void 0,i=a.policy.trim();return{name:a.name.trim(),enabled:a.enabled,stage:a.stage,...t?{kind:"require-tool"}:{},...t?i?{policy:i}:{}:{policy:i},...r?{model:r}:{},...s&&s.length>0?{tools:s}:{},...o&&o.length>0?{domains:o}:{}}}function ve(a,t){return[...a,W(t)]}function ye(a,t,n){return a.map(s=>s.name===t?W(n):s)}function Ne(a,t){return a.filter(n=>n.name!==t)}function Ce(a,t,n){return a.map(s=>s.name===t?{...s,enabled:n}:s)}function we({owner:a,agentId:t}){const n=P(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=L(t),{data:d=null,isLoading:h}=M(t),f=o||i||h,p=B(t),N=s?.guardrailsInline??[],x=(r??[]).map(u=>u.name),C=async u=>{if(!s){j.error("Still loading agent settings — try again in a moment");return}const l=V(u,N,x,d);if(l){j.error(l);return}try{await p.mutateAsync({guardrailsInline:ve(N,u)}),j.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){j.error(m instanceof Error?m.message:"Failed to create guardrail")}},b=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),f?e.jsx(se,{rows:4}):e.jsx(H,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:p.isPending,onSubmit:C,onCancel:b})]})}function F(a,t){const n=new Set(a?.guardrails??[]),s=new Set(t.map(i=>i.name)),o=t.map(i=>({name:i.name,stages:i.stages,description:i.description,enabled:n.has(i.name),unknown:!1})),r=(a?.guardrails??[]).filter(i=>!s.has(i)).map(i=>({name:i,stages:[],enabled:!0,unknown:!0}));return[...o,...r]}function Se(a){return a.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function ke(a,t,n){return Se(a.map(s=>s.name===t&&!s.unknown?{...s,enabled:n}:s))}const A={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function Ae(a){const t=new Date(a);return Number.isNaN(t.getTime())?a:le(t,{addSuffix:!0})}function Ge({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=L(t),r=y.useMemo(()=>F(s,o??[]).find(d=>d.name===n)??null,[s,o,n]),i=(s?.guardrailsInline??[]).find(d=>d.name===n);return i?e.jsx(Te,{owner:a,agentId:t,guardrail:i}):r?e.jsx(Le,{agentId:t,name:n,row:r}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Le({agentId:a,name:t,row:n}){return e.jsxs("div",{className:"space-y-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:n.description??(n.stages.length>0?`Built-in. Short-circuits this agent's ${n.stages.map(s=>A[s].toLowerCase()).join(", ")} stage${n.stages.length>1?"s":""} when it matches.`:"Configured out of band — toggling is managed via lobu apply.")}),e.jsx(Z,{agentId:a,guardrail:t})]})}function Te({owner:a,agentId:t,guardrail:n}){const s=P(),{data:o}=G(t),{data:r}=L(t),{data:i=null}=M(t),d=B(t),[h,f]=y.useState(!1),p=o?.guardrailsInline??[],N=(r??[]).map(u=>u.name),x=async(u,l)=>{if(!o)return j.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),j.success(l),!0}catch(m){return j.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=V(u,p,N,i,n.name);if(l){j.error(l);return}await x(ye(p,n.name,u),"Guardrail saved")&&u.name.trim()!==n.name&&s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(u.name.trim())}})},b=async()=>{await x(Ne(p,n.name),"Guardrail deleted")&&s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:n.kind==="require-tool"?"Required tools":"Policy"}),e.jsx(H,{initial:n,judgeModelDefault:i,submitLabel:"Save changes",submitting:d.isPending,onSubmit:C})]}),e.jsx("div",{className:"flex justify-end",children:h?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{type:"button",variant:"destructive",onClick:()=>void b(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>f(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(S,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>f(!0),children:["Delete ",n.name]})}),e.jsx(Z,{agentId:t,guardrail:n.name})]})}function Z({agentId:a,guardrail:t}){const{data:n=[],isLoading:s,isError:o}=U(a,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),s?e.jsx(ne,{label:"catches",variant:"table",rows:4}):o?e.jsx(re,{label:"catches"}):n.length===0?e.jsx(D,{icon:ie,title:"No catches yet",description:"This guardrail hasn't short-circuited anything on this agent."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsxs(he,{children:[e.jsx(pe,{children:e.jsxs(O,{children:[e.jsx(R,{className:"w-[180px]",children:"When"}),e.jsx(R,{className:"w-[120px]",children:"Stage"}),e.jsx(R,{children:"Reason"})]})}),e.jsx(xe,{children:n.map(r=>e.jsxs(O,{children:[e.jsx($,{className:"text-xs text-muted-foreground",title:r.occurredAt,children:Ae(r.occurredAt)}),e.jsx($,{children:e.jsx(oe,{variant:"outline",className:"text-[10px]",children:A[r.stage]})}),e.jsx($,{className:"text-sm text-muted-foreground",children:r.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},r.id))})]})})]})}function I(a,t){return a.get(t)??0}function Ee(a,t,n){const s=a.map(r=>{const i=r.stages.map(d=>A[d]);return r.unknown&&i.push("Unknown"),{id:r.name,name:r.name,kind:"builtin",description:r.description,stages:r.stages,enabled:r.enabled,unknown:r.unknown,badges:i,tripCount:I(n,r.name)}}),o=t.map(r=>{const i=[A[r.stage],"Custom"];return{id:r.name,name:r.name,kind:"custom",description:r.policy,stages:[r.stage],enabled:r.enabled,unknown:!1,badges:i,tripCount:I(n,r.name)}});return[...s,...o]}function Re({owner:a,agentId:t,expandedName:n}){const s=P(),{data:o,isLoading:r}=G(t),{data:i,isLoading:d}=L(t),{data:h=[]}=U(t),f=B(t),p=async(l,m)=>{if(!o){j.error("Still loading agent settings — try again in a moment");return}try{if(l.kind==="custom")await f.mutateAsync({guardrailsInline:Ce(o.guardrailsInline??[],l.name,m)});else{const g=F(o,i??[]);await f.mutateAsync({guardrails:ke(g,l.name,m)})}j.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){j.error(g instanceof Error?g.message:"Failed to save guardrail")}},N=i===null,x=y.useMemo(()=>{const l=F(o,i??[]),m=o?.guardrailsInline??[],g=new Map;for(const v of h)g.set(v.guardrailName,(g.get(v.guardrailName)??0)+1);return Ee(l,m,g)},[o,i,h]),C=l=>{if(l===n){s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return}s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(l)}})},b=()=>{s({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:a,agentId:t}})},u=r||d;return!u&&x.length===0?e.jsx("div",{className:"space-y-6",children:N?e.jsx(D,{icon:q,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:b}):e.jsx(D,{icon:q,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:b})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(ge,{description:"Each guardrail short-circuits this agent's input, output, or tool-call stages. Built-ins are toggle-only; add a custom guardrail to judge messages against a policy you write.",action:u?void 0:e.jsxs(S,{type:"button",onClick:b,children:[e.jsx(de,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(be,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((l,m)=>{const g=l.name===n;return e.jsx($e,{card:l,expanded:g,isLast:m===x.length-1,onToggle:()=>C(l.name),onToggleEnabled:v=>void p(l,v),toggleDisabled:l.unknown||f.isPending,children:g?e.jsx(Ge,{owner:a,agentId:t,name:l.name}):null},l.id)})})]})}function $e({card:a,expanded:t,isLast:n,onToggle:s,onToggleEnabled:o,toggleDisabled:r,children:i}){return e.jsxs("div",{className:E("bg-background",!n||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:s,"aria-expanded":t,className:E("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!a.enabled&&!a.unknown&&!t&&"opacity-70"),children:[e.jsx(q,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:E("truncate text-sm text-foreground",a.unknown&&"font-mono text-xs"),children:a.name}),a.kind==="custom"&&a.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:a.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a.tripCount>0?`${a.tripCount} recent ${a.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(ue,{badges:a.badges})]})]}),e.jsx(je,{enabled:a.enabled,name:a.name,expanded:t,onToggleEnabled:o,toggleDisabled:r,onToggle:s})]}),t&&i?e.jsx("div",{className:"border-t border-border px-4 py-4",children:i}):null]})}function De({owner:a,agentId:t,expandedName:n}){return e.jsx(J,{children:e.jsx(Re,{owner:a,agentId:t,expandedName:n})})}function Ie({owner:a,agentId:t}){return e.jsx(J,{children:e.jsx(we,{owner:a,agentId:t})})}function Me({owner:a,agentId:t,name:n}){return e.jsx(De,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{De as A,Ie as a,Me as b};
|
|
2
|
-
//# sourceMappingURL=agent-guardrails-route-CN7vpC0X.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as n,L as i,cu as l,ed as d}from"./index-BjcZVe7n.js";import{a as u}from"./client-rows-x_CxeWkP.js";function g({owner:s,item:t,last:c,appearance:r="row"}){const a=r==="inline"?"inline-flex items-center gap-1.5 rounded-md bg-accent px-1.5 py-0.5 text-sm font-medium":`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${c?"":"border-b"}`;if(t.kind==="managed"){const e=t.agent,o=[e.status===void 0?null:e.status==="active"?"Working":"Idle",e.connectionCount===void 0?null:`${e.connectionCount} ${e.connectionCount===1?"connection":"connections"}`,e.userCount===void 0?null:`${e.userCount} ${e.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return n.jsxs(i,{to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:e.agentId},search:{run_id:void 0},className:a,children:[n.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:n.jsx(l,{className:"h-4 w-4"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:e.name}),r==="row"&&(o||e.description)?n.jsx("p",{className:"truncate text-xs",children:o||e.description}):null]}),e.status==="active"?n.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(t.kind==="connected"){const e=t.group;return n.jsxs(i,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:e.clientId},className:a,children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:n.jsx(d,{name:e.title})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:e.title}),n.jsxs("p",{className:"truncate text-xs",children:["Connected · ",u(e)]})]}),n.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}export{g as A};
|
|
2
|
-
//# sourceMappingURL=agent-list-row-BnP6r4pm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,bR as B,i as S,a$ as D,b0 as K,b1 as R,gz as X,a6 as G,bK as Y,bJ as Z,bW as V,gA as ee,bX as P,bt as F,bY as se,bS as ne,bZ as te,bT as re,r as A,gB as ae,gC as ie,bO as le,b_ as oe,L as w,gD as de,gE as ce,d5 as W,gF as ue,gG as me,gH as ge,gI as k,cU as L,X as fe,gJ as q,gK as z,gu as xe,d6 as he,gL as be,gM as ye,c1 as pe,gN as je}from"./index-BjcZVe7n.js";const ve={auto:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",approval:"bg-amber-500/15 text-amber-600 dark:text-amber-400",deny:"bg-red-500/15 text-red-600 dark:text-red-400"};function Ne({options:n,value:t,floor:o,onChange:a,disabled:i,ariaLabel:m,compact:u}){return e.jsx("div",{role:"radiogroup","aria-label":m,className:S("inline-flex shrink-0 items-stretch gap-0.5 rounded-lg border border-border bg-muted/40 p-0.5"),children:n.map(l=>{const b=X({option:l,floor:o}),h=l===t,g=b.disabled&&!h,y=B[l],f=e.jsx("button",{type:"button",role:"radio","aria-checked":h,disabled:i||g,onClick:()=>{!h&&!g&&!i&&a(l)},className:S("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",u?"min-w-[3rem] rounded-md px-2.5 py-1.5 text-xs leading-none":"min-w-[3.25rem] rounded-md px-3 py-1.5 text-sm leading-none",h?S(ve[l],""):"text-muted-foreground hover:bg-background/60 hover:text-foreground",g&&"cursor-not-allowed opacity-40",i&&!g&&"cursor-not-allowed opacity-60"),children:y},l);return g&&b.reason?e.jsxs(D,{children:[e.jsx(K,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:f})}),e.jsx(R,{children:b.reason})]},l):f})})}function M({children:n,controls:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 px-3 py-2",children:[e.jsx("div",{className:"min-w-40 flex-1 text-sm",children:n}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t})]})}const _e=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every entity type."},{resourceClass:"agent_config",title:"Agents",sub:"Defaults for reading and managing agents."}];function Ae(n,t,o,a,i=null){const m=q(n.floor,t,o,a,i),u=z(n.floor,t,o,a,i)?m:"auto";return(a!==null||i!==null)&&be(n.agent,t,o)?ye(u,k(n,t,o,null)):u}function Se({label:n,response:t,resourceClass:o,action:a,entityTypeSlug:i,targetAgentId:m=null,dimmed:u,pending:l,onSave:b}){const h=q(t.floor,o,a,i,m),g=z(t.floor,o,a,i,m),y=k(t,o,a,i,m),f=Ae(t,o,a,i,m),j=pe(o,a),p=e.jsx("div",{className:S("inline-flex shrink-0",u&&"opacity-45"),children:e.jsx(Ne,{options:j,value:y,floor:f,disabled:l,compact:!0,ariaLabel:n,onChange:b})});return g?e.jsxs(D,{children:[e.jsx(K,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:p})}),e.jsxs(R,{children:["Org floor ",B[h]," — can only go stricter"]})]}):p}function ke(n,t){const o=i=>i.resource_class===t.resource_class&&(i.entity_type_slug??null)===(t.entity_type_slug??null)&&(i.operation_key??null)===(t.operation_key??null)&&(i.target_agent_id??null)===(t.target_agent_id??null),a=n.map(i=>o(i)?t:i);return a.some(o)?a:[...a,t]}function Ce(n,t,o,a,i,m){const u=je(n,t,o,a);return u[i]=m,u}const $="font-medium text-foreground hover:text-primary hover:underline";function Ee({type:n}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(W,{icon:n.icon,className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:n.slug})]})}function Q({label:n,disabled:t,hint:o,searchPlaceholder:a,emptyText:i,children:m}){return t?e.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[n,o?` ${o}`:""]}):e.jsx(xe,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:a,emptyText:i,trigger:u=>e.jsxs("button",{type:"button","aria-expanded":u,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[e.jsx(he,{className:"h-3 w-3"}),n]}),children:u=>m(u)})}function Te({pending:n,onClick:t,label:o}){return e.jsx("button",{type:"button",disabled:n,onClick:t,"aria-label":o,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:e.jsx(fe,{className:"h-3 w-3"})})}function $e({owner:n,agentId:t,variant:o="agent"}){const a=o==="org-floor",i=G(),m=Y(n,t??"",{enabled:!a&&!!t}),u=Z(n,{enabled:a}),{data:l,isLoading:b,isError:h,error:g}=a?u:m,y=a?V(n):ee(n,t??""),f=P({mutationFn:r=>a?se(n,r):ne(n,t??"",r),onSuccess:r=>{i.setQueryData(y,c=>c&&{...c,agent:ke(c.agent,r)}),i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to save permission")}}),j=P({mutationFn:r=>a?te(n,r):re(n,t??"",r),onSuccess:()=>{i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to remove override")}}),p=f.isPending||j.isPending,C=A.useMemo(()=>l?ae(l):[],[l]),E=A.useMemo(()=>{if(!l)return[];const r=new Set(C.map(c=>c.slug));return l.entity_types.filter(c=>!r.has(c.slug))},[l,C]),v=A.useMemo(()=>l?ie(l):[],[l]),N=A.useMemo(()=>{if(!l)return[];const r=new Set(v.map(c=>c.id));return l.agents.filter(c=>(a||c.id!==t)&&!r.has(c.id))},[l,v,t,a]);if(b)return e.jsx(le,{label:"permissions",variant:"cards",cards:2});if(h||!l)return e.jsx(oe,{label:g instanceof Error?g.message:"permissions"});const x=l,H=(r,c,T,_,s=null)=>{const d=Ce(x,r,c,s,T,_);f.mutate({resource_class:r,effects:d,entity_type_slug:c,target_agent_id:s})},I=x.entity_types.length===0?"— none yet":E.length===0?"— all covered":null,J=N.length===0&&v.length===0?"— no other agents":N.length===0?"— all covered":null;return e.jsxs("div",{className:"space-y-4",children:[a?null:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage connector rules and agent restrictions in"," ",e.jsx(w,{to:"/$owner/settings/organization",params:{owner:n},search:{agent:t},hash:"policies",className:$,children:"Organization policies"}),"."]}),_e.map(r=>{const c=r.resourceClass==="entity",T=r.resourceClass==="agent_config",_=[{key:"default",label:"Default",name:"Default",entityTypeSlug:null,targetAgentId:null,owned:!1,diffs:0},...c?C.map(s=>({key:`entity:${s.slug}`,name:s.name,label:e.jsx(w,{to:"/$owner/entity-types/$slug",params:{owner:n,slug:s.slug},className:$,title:`Open ${s.name}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(W,{icon:s.icon,className:"h-3.5 w-3.5 shrink-0"}),s.name]})}),entityTypeSlug:s.slug,targetAgentId:null,owned:ce(x,s.slug),diffs:de(x,s.slug)})):v.map(s=>({key:`agent:${s.id}`,name:s.name,label:e.jsx(w,{to:"/$owner/agents/$agentId/settings",params:{owner:n,agentId:s.id},search:{run_id:void 0},className:$,title:`Open ${s.name}`,children:s.name}),entityTypeSlug:null,targetAgentId:s.id,owned:me(x,s.id),diffs:ue(x,s.id)}))];return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-medium",children:r.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]}),e.jsxs("div",{className:"divide-y overflow-hidden rounded-lg border",children:[_.map(s=>e.jsxs("div",{className:"divide-y",children:[_.length>1&&e.jsx("div",{className:"bg-muted/30",children:e.jsx(M,{controls:s.owned?e.jsx(Te,{pending:p,label:`Remove ${s.name} exception`,onClick:()=>j.mutate({resource_class:r.resourceClass,entity_type_slug:s.entityTypeSlug,target_agent_id:s.targetAgentId})}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s.label,s.key!=="default"&&!s.owned?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Organization minimum"}):s.diffs>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.diffs," ",s.diffs===1?"change":"changes"]}):null]})})}),e.jsx("div",{className:"divide-y",children:ge[r.resourceClass].filter(d=>!s.targetAgentId||d!=="create").map(d=>{const O=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c?"entities":"agents"}`;return e.jsx(M,{controls:e.jsx(Se,{label:`${s.name}: ${O}`,response:x,resourceClass:r.resourceClass,action:d,entityTypeSlug:s.entityTypeSlug,targetAgentId:s.targetAgentId,dimmed:s.key!=="default"&&k(x,r.resourceClass,d,s.entityTypeSlug,s.targetAgentId)===k(x,r.resourceClass,d,null),pending:p,onSave:U=>H(r.resourceClass,s.entityTypeSlug,d,U,s.targetAgentId)}),children:O},d)})})]},s.key)),e.jsxs("div",{className:"border-t",children:[c?e.jsx(Q,{label:"Add type",disabled:p||E.length===0,hint:I,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:s=>E.map(d=>e.jsx(L,{value:`${d.name} ${d.slug}`,onSelect:()=>{f.mutate({resource_class:"entity",effects:{},entity_type_slug:d.slug}),s()},className:"cursor-pointer",children:e.jsx(Ee,{type:d})},d.slug))}):null,T?e.jsx(Q,{label:"Add agent",disabled:p||N.length===0,hint:J,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:s=>N.map(d=>e.jsxs(L,{value:`${d.name} ${d.id}`,onSelect:()=>{f.mutate({resource_class:"agent_config",effects:{},target_agent_id:d.id}),s()},className:"cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:d.name}),e.jsx("span",{className:"ml-1.5 font-mono text-[10px] text-muted-foreground",children:d.id})]},d.id))}):null]})]})]},r.resourceClass)})]})}export{$e as A,Ne as P,M as a};
|
|
2
|
-
//# sourceMappingURL=agent-permissions-matrix-DSjidWHL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as D,r as g,j as e,d6 as F,H as N,I as K,eL as P,bP as O,B as C,i as R,dh as _,hx as H,hy as z,b2 as G,hJ as Q,fP as Y,j9 as J}from"./index-BjcZVe7n.js";import{u as w,b as V,f as X,s as q,a as U,S as W,v as Z,c as ee}from"./agent-skill-context-1DBn7Xc_.js";import{b as se,a as te,A as E}from"./agent-tab-intro-DKrC3SQt.js";import{u as ae,a as L,m as ne,P as le,D as ie,n as oe,C as re}from"./core.esm-BsXtvNoI.js";import{f as ce}from"./agent-loading-shells-_18OREnx.js";import{A as de}from"./agent-card-controls-DuQJhtqp.js";const T=":";function A(s){const t=s.indexOf("/");return t<0?s:`${s.slice(0,t)}${T}${s.slice(t+1)}`}function B(s){const t=s.indexOf(T);return t<0?s:`${s.slice(0,t)}/${s.slice(t+1)}`}function me({owner:s,agentId:t}){const a=D(),[n,i]=g.useState(""),[o,d]=g.useState(!1),[x,k]=g.useState(""),[r,b]=g.useState(""),{skillRows:m,catalog:p,isLoading:u,addSkillFromCatalog:h,addCustomSkill:S}=w(),v=g.useMemo(()=>new Set(m.map(c=>c.repo)),[m]),f=g.useMemo(()=>V(p?.catalog??[],v),[p?.catalog,v]),l=g.useMemo(()=>X(f,n),[f,n]),y=c=>{h(c),a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(c)}})},j=()=>{const c=S({name:x,instructions:r});c&&a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(c)}})},$=e.jsx(se,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."});return e.jsxs("div",{className:"space-y-6",children:[$,e.jsx("div",{className:R(_,"w-full"),children:o?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(K,{id:"custom-skill-name",value:x,onChange:c=>k(c.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:r,onChange:c=>b(c.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(O,{onCancel:()=>d(!1),children:e.jsx(C,{type:"button",size:"sm",onClick:j,disabled:!x.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>d(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(F,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),u?e.jsx(H,{}):e.jsx(z,{items:l,searchQuery:n,onSearchChange:i,onSelect:c=>y(c.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:n.trim()?`No skills match "${n}"`:f.length===0?"All catalog skills are already configured":"No skills available"})]})}function ue({row:s}){const{isSaving:t,updateSkillRow:a}=w(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"skill-name",children:"Name"}),e.jsx(K,{id:"skill-name",value:s.name,onChange:i=>a(s.repo,{name:i.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(P,{id:"skill-instructions",value:s.instructions??"",onChange:i=>{const o=i.target.value;a(s.repo,{instructions:o,content:o.trim()||s.name})},rows:4,disabled:t})]})]})})}function ge({owner:s,agentId:t,skillKey:a}){const n=D(),[i,o]=g.useState(!1),d=B(a),{skillRows:x,catalog:k,isSaving:r,saveSkills:b,removeSkillAndSave:m,addSkillFromCatalog:p}=w(),u=x.find(f=>f.repo===d)??null,h=k?.catalog.find(f=>f.repo===d);g.useEffect(()=>{!u&&h&&p(d)},[p,h,d,u]);const S=async()=>{await m(d)&&(o(!1),n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}}))};if(!u)return h?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const v=!u.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(ue,{row:u}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[v?i?e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"button",variant:"destructive",onClick:()=>void S(),disabled:r,children:r?"Removing...":"Remove skill"}),e.jsx(C,{type:"button",variant:"outline",onClick:()=>o(!1),disabled:r,children:"Cancel"})]}):e.jsxs(C,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),disabled:r,children:["Remove ",u.name]}):null,e.jsx(C,{type:"button",onClick:()=>void b(),disabled:r||i,children:r?"Saving...":"Save changes"})]})]})}function xe(s){return s.map(t=>{const a=q(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const I="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function M({owner:s,agentId:t,expandedRepo:a}){const n=D(),{skillRows:i,catalog:o,isLoading:d,isSaving:x,reorderSkills:k,setSkillEnabledAndSave:r,addSkillFromCatalog:b}=w();g.useEffect(()=>{a&&(i.some(l=>l.repo===a)||o?.catalog.some(l=>l.repo===a)&&b(a))},[a,i,o,b]);const m=g.useMemo(()=>xe(i),[i]),p=g.useMemo(()=>m.map(l=>l.repo),[m]),u=ae(L(le,{activationConstraint:{distance:8}}),L(ne,{coordinateGetter:U})),h=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},S=e.jsxs(C,{type:"button",onClick:h,children:[e.jsx(F,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),v=l=>{if(l===a){n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}});return}n({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:A(l)}})},f=l=>{const{active:y,over:j}=l;!j||y.id===j.id||k(String(y.id),String(j.id))};return d?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(ce,{rows:2})]}):m.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(G,{icon:Q,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:h})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(te,{description:I,action:S}),e.jsx(ie,{sensors:u,collisionDetection:oe,onDragEnd:f,children:e.jsx(W,{items:p,strategy:Z,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:m.map((l,y)=>{const j=l.repo===a;return e.jsx(he,{card:l,rank:y+1,disabled:x,expanded:j,isLast:y===m.length-1,onToggle:()=>v(l.repo),onToggleEnabled:$=>void r(l.repo,$),toggleDisabled:x,children:j?e.jsx(ge,{owner:s,agentId:t,skillKey:A(l.repo)}):null},l.id)})})})})]})}function he({card:s,rank:t,disabled:a,expanded:n,isLast:i,onToggle:o,onToggleEnabled:d,toggleDisabled:x,children:k}){const r=a||n,{attributes:b,listeners:m,setNodeRef:p,transform:u,transition:h,isDragging:S}=ee({id:s.repo,disabled:r}),v={transform:re.Transform.toString(u),transition:h};return e.jsxs("div",{ref:p,style:v,className:R("bg-background",!i||n?"border-b":"",S&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:r,...b,...m,children:e.jsx(Y,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:R("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:o,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(J,{badges:s.badges})]})]}),e.jsx(de,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:d,toggleDisabled:x,onToggle:o})]}),n&&k?e.jsx("div",{className:"border-t border-border px-4 py-4",children:k}):null]})}function Se({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t})})}function ye({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(me,{owner:s,agentId:t})})}function Ce({owner:s,agentId:t,skillKey:a}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t,expandedRepo:B(a)})})}export{Se as A,ye as a,Ce as b};
|
|
2
|
-
//# sourceMappingURL=agent-skills-route-d5jh3oBR.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,al as n,i as a}from"./index-BjcZVe7n.js";function l({children:t,className:s}){return e.jsx(n,{className:a("pb-8",s),children:t})}function x({title:t,description:s}){return e.jsxs("div",{className:"mb-2 space-y-1",children:[e.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:s})]})}function c({description:t,action:s}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:t}),s?e.jsx("div",{className:"shrink-0",children:s}):null]})}export{l as A,c as a,x as b};
|
|
2
|
-
//# sourceMappingURL=agent-tab-intro-DKrC3SQt.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as M,w as I,q as L,at as N,bb as w,r as O,hJ as R,hK as W,c5 as E,hL as _,hM as D,j as t,ak as U,al as y,gT as B,L as f,gU as k,O as F,i as G,v as P,eI as q,aq as K}from"./index-BjcZVe7n.js";import{A as z}from"./agent-editor-form-BXQBFHSv.js";import{P as H}from"./proposal-review-shell-BED-DO9C.js";import{n as J}from"./nav-pill-Bam6s3jj.js";const b=[{key:"skills",label:"Skills",icon:R},{key:"guardrails",label:"Guardrails",icon:W},{key:"permissions",label:"Permissions",icon:E,adminOnly:!0},{key:"models",label:"Models",icon:_},{key:"settings",label:"Settings",icon:D}];function T(s){return b.filter(e=>!e.adminOnly||s)}function Q(s,e){if(e===`${s}/conversations`||e.startsWith(`${s}/conversations/`))return null;for(const{key:n}of b)if(e===`${s}/${n}`||e.startsWith(`${s}/${n}/`))return n;return e===`${s}/identity`||e===`${s}/identity/`?"settings":null}function V(s){return s.trim().charAt(0).toUpperCase()||"?"}function X({owner:s,agentId:e,agentName:n,activeDest:a}){const{orgContext:r}=P(),{isAdmin:l}=q(r.organizationId),c=T(!!l);return t.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-2",children:[t.jsxs(f,{to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:e},search:{run_id:void 0},className:"flex min-w-0 items-center gap-2 rounded-md outline-none transition-colors hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",title:"Agent settings",children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-foreground",children:V(n)}),t.jsx("h1",{className:"min-w-0 truncate text-base font-semibold tracking-tight",children:n})]}),t.jsx("nav",{"aria-label":"Agent sections",className:"flex min-w-0 max-w-full flex-wrap items-center justify-center gap-1",children:c.map(({key:d,label:u,icon:g})=>{const o=d===a;return t.jsxs(f,{to:`/$owner/agents/$agentId/${d}`,params:{owner:s,agentId:e},"aria-current":o?"page":void 0,className:J(o,"shrink-0 gap-1.5 px-2.5 py-1 text-sm"),children:[t.jsx(g,{className:"h-3.5 w-3.5 shrink-0"}),u]},d)})})]})}function ns({owner:s,agentId:e}){const n=M(),{pathname:a}=I(),{isAuthenticated:r}=L(),{isMember:l}=N(),c=r&&l,{data:d=[],isLoading:u}=w({enabled:c}),g=d.find(A=>A.agentId===e)??null,o=!g&&!u&&c,m=`/${s}/agents/${e}`,x=`${m}/conversations`,h=a===x||a.startsWith(`${x}/`),i=Q(m,a);O.useEffect(()=>{o&&n({to:"/$owner",params:{owner:s},replace:!0})},[o,n,s]);const v=g?.name??"Agent",j=b.find(A=>A.key===i)?.label??"Conversations",p=a.slice(m.length+1).split("/")[1],C=i==="settings"&&!p,S=C?v:p?p==="create"?i==="skills"?"Add a skill":"New custom guardrail":i==="skills"?"Skill details":i==="guardrails"?"Guardrail details":"Conversation":j;return t.jsxs(U,{className:"gap-3 overflow-hidden pt-2.5 pb-8",children:[t.jsx(y,{children:t.jsx(B,{crumbs:[t.jsx(f,{to:"/$owner/agents",params:{owner:s},className:k,children:"Agents"},"agents"),...C?[]:[t.jsx(f,{to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:e},search:{run_id:void 0},className:k,children:v},"agent")],...p&&i?[t.jsx(f,{to:`/$owner/agents/$agentId/${i}`,params:{owner:s,agentId:e},className:k,children:j},"section")]:[]],current:S})}),t.jsx(X,{owner:s,agentId:e,agentName:v,activeDest:i}),t.jsx("div",{className:G("flex min-h-0 min-w-0 flex-1 flex-col",h?"overflow-hidden":"overflow-y-auto"),children:t.jsx(F,{})})]})}function Y({agent:s,tab:e,runId:n}){return t.jsx(y,{className:"pb-6",children:t.jsx(H,{resource:{kind:"agent",agentId:s.agentId},runId:n,children:({reviewMode:a,proposal:r,controlsDisabled:l})=>t.jsx(z,{mode:{kind:"edit",agent:s},section:e,reviewMode:a,reviewProposal:r,reviewControlsDisabled:l},s.agentId)})})}function as({owner:s,agentId:e,tab:n,runId:a}){const{orgContext:r,hasOrgContext:l}=P(),{isLoading:c}=K(`/${s}`,r),{isAuthenticated:d}=L(),{isMember:u,isLoading:g}=N(),o=d&&u,{data:m=[],isLoading:x}=w({enabled:o}),$=o?!l||c||x||g:c||g,h=m.find(i=>i.agentId===e)??null;return $||!h?null:t.jsx(Y,{agent:h,tab:n,runId:a})}export{ns as A,as as a};
|
|
2
|
-
//# sourceMappingURL=agents-workbench-CDpJmUVN.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as c,iF as b,aW as w,aG as y,b7 as C,aJ as u,j as e,al as k,L as o,gl as j,B as v,gk as A,iR as P,gi as g,gS as R,gT as B,gU as D,A as $,Y as I,fg as L,iS as M,az as z}from"./index-BjcZVe7n.js";import{C as E}from"./connector-page-shell-Di6XzkVo.js";import{C as O}from"./connections-browser-BXsJqieG.js";import"./connection-label-BobuYiAG.js";import"./status-dot-BnQPFrcU.js";function T({ownerSlug:s,appId:a}){const n=c.useMemo(()=>b(s,a,w()),[s,a]),{data:r=[],isLoading:l,isError:d,refetch:N}=y(),[m,x]=c.useMemo(()=>{const t=n?.devicePlatforms;if(!t?.length)return[[],[]];const h=r.filter(i=>{const f=C(i);return f!=null&&t.includes(f)});return[h.filter(i=>u(i,s)),h.filter(i=>!u(i,s))]},[n,r,s]);if(!n)return e.jsxs(k,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no app by that name."}),e.jsx(o,{to:"/$owner/connectors",params:{owner:s},search:{},className:"text-sm text-primary hover:underline",children:"Back to connectors"})]});const p=(n.devicePlatforms?.length??0)>0;return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(E,{header:e.jsx(R,{breadcrumb:e.jsx(B,{crumbs:[e.jsx(o,{to:"/$owner/connectors",params:{owner:s},search:{},className:D,children:"Connectors"},"connectors")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:n.icon}),title:n.name,caption:n.description}),children:[e.jsx("div",{id:"setup",className:"scroll-mt-40",children:e.jsx(j,{title:m.length>0?a==="owletto-chrome"?"Connect another profile":"Connect another device":"Set up",children:e.jsx("div",{className:"space-y-3",children:n.steps.map(t=>e.jsx(_,{step:t},t.label))})})}),p?e.jsx(O,{entries:m.map(t=>({id:t.id,name:g(t),description:P(t,s),tone:t.online?null:"muted",link:A({to:"/$owner/connectors/device/$deviceId",params:{owner:s,deviceId:t.id}})})),isLoading:l,isError:d,onRetry:()=>void N(),action:e.jsx(v,{asChild:!0,variant:"outline",size:"sm",children:e.jsx("a",{href:"#setup",children:"Add connection"})})}):null,p&&!l&&!d&&x.length>0?e.jsxs(j,{title:"Your devices in other workspaces",children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Open a device to connect its capabilities here. Moving it is confirmed first and pauses its connections where it is now."}),e.jsx("ul",{className:"divide-y border-y",children:x.map(t=>e.jsx("li",{children:e.jsxs(o,{to:"/$owner/connectors/device/$deviceId",params:{owner:s,deviceId:t.id},className:"flex items-center justify-between gap-3 py-2.5 text-sm hover:text-primary",children:[e.jsx("span",{className:"font-medium",children:g(t)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Attached to"," ",t.organization_name??"another workspace"]})]})},t.id))})]}):null]})})}function _({step:s}){const[a,n]=c.useState(!1);if(s.href)return e.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium text-primary hover:bg-accent/50",children:[s.label,e.jsx($,{className:"h-3 w-3"})]});const r=s.command??"";return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-xs leading-relaxed",children:r}),e.jsxs(v,{variant:"ghost",size:"sm",className:"h-6 shrink-0 px-1.5 text-xs",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})},children:[a?e.jsx(I,{className:"h-3.5 w-3.5"}):e.jsx(L,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"sr-only",children:"Copy"})]})]})]})}function H(){const{owner:s,appId:a}=M.useParams();return e.jsx(z,{owner:s,children:({ownerSlug:n})=>e.jsx(T,{ownerSlug:n,appId:a})})}export{H as component};
|
|
2
|
-
//# sourceMappingURL=app._appId-DwNeXRJp.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v,j as n,L as N,cp as b,aq as S,q as w,at as D,r as h,cP as R,u as O,hA as T,S as $,cQ as E,bN as F}from"./index-BjcZVe7n.js";import{C as L,A as P}from"./create-automation-form-C9PMX7N8.js";import{P as q}from"./proposal-review-shell-BED-DO9C.js";import{E as J}from"./events-feed-CGzA1w3R.js";import{D as M,a as B}from"./definition-comparison-B5WgZILB.js";import{b as A}from"./use-automations-D9hKpufo.js";import{b as H}from"./model-C2q7WDcS.js";function C({automationId:i}){const{currentOwner:t}=v();return t?n.jsx(N,{to:"/$owner/events",params:{owner:t},search:b({semanticTypes:["change"],eventCategory:"config",resourceKind:"automation",resourceId:i}),className:"text-sm text-primary underline underline-offset-4",children:"View definition history in Events"}):null}function k(i){const{orgContext:t,hasOrgContext:r}=v(),{data:o,isLoading:a}=S(`/${i}`,t),{isAuthenticated:d}=w(),{isMember:u,isLoading:c}=D(),g=d&&u,s=o?.workspace,f=g?!r||a||c:a||c;return{organizationId:s?.id??"",isLoading:f}}function z(i){return k(i)}function K({owner:i,automationId:t,organizationId:r}){const o=Number(t),a=h.useMemo(()=>({producedByAutomationId:o}),[o]),d=O(),u=A(t,void 0,r),c=u.data?.automation?.automation_name?.trim()||null,g=H(u.data?.automation),{data:s}=T(g,t,{orgSlug:i}),f=h.useMemo(()=>(s?.runs??[]).map(e=>({runId:e.runId,status:e.status,completedAt:e.completedAt})),[s]),p=h.useCallback(e=>{d?.open({href:`/${i}/automations/${t}?view=activity&run_id=${e}`,title:c!=null?`${c} · Run #${e}`:`Automation run #${e}`,runId:e})},[d,i,t,c]);return Number.isFinite(o)?n.jsx(J,{organizationId:r,ownerSlug:i,filters:a,groupByRun:!0,onRunSelect:p,runs:f,hideRunAction:!0,hideAttribution:!0,emptyState:n.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"This Automation hasn't written anything yet. Runs appear here with the events they created; clicking a run opens its conversation."})}):null}function Q({agentId:i,automationId:t,runId:r,organizationId:o,onDone:a}){const[d,u]=h.useState({ready:!1,triggers:[]}),c=h.useCallback(l=>{u(m=>JSON.stringify(m)===JSON.stringify(l)?m:l)},[]),g=A(t,void 0,o,{includeVersions:!0}),s=g.data?.automation,{currentOwner:f}=v(),p=R({queryKey:["automations-list",f,"editor",t,s?.status],enabled:!!f&&!!o&&!!s,queryFn:async()=>{const m=(await E("manage_automations",{action:"list",automation_id:t,status:s?.status,include_details:!0,limit:1},{slug:f})).automations.find(y=>y.automation_id===t);if(!m)throw new F("Automation not found",404);return m},staleTime:3e4}),e=p.data,x=h.useMemo(()=>s&&e?{automation_id:s.automation_id,name:e.name,slug:e.slug,description:e.description,prompt:e.prompt,sources:e.sources,reaction_script:s.reaction_script,managed_agent_id:e.managed_agent_id,device_worker_id:e.device_worker_id,agent_kind:e.agent_kind,delivery_target:e.delivery_target??void 0,execution_config:e.execution_config??void 0,model_config:e.model_config,tags:e.tags,keying_config:s.keying_config,reactions_guidance:e.reactions_guidance,triggers:e.triggers}:void 0,[s,e]),_=n.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(l=>n.jsx($,{className:"h-16 w-full rounded-lg"},l))}),j=p.isError?n.jsxs("div",{role:"alert",className:"space-y-2 text-sm",children:[n.jsx("p",{children:"Could not load the saved Automation definition."}),n.jsx("button",{type:"button",className:"text-primary underline underline-offset-4",onClick:()=>void p.refetch(),children:"Retry"})]}):g.isLoading||s&&p.isPending?_:x?n.jsx(L,{organizationId:o,prefillAgentId:i??void 0,editingAutomation:x,createFields:{triggers:d.triggers},triggerFields:n.jsx(P,{organizationId:o,initialTriggers:x.triggers??[],onChange:c},JSON.stringify(x.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!d.ready,onClose:a}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return i?n.jsxs("div",{className:"space-y-6",children:[n.jsx(q,{resource:{kind:"automation",agentId:i,automationId:t},runId:r,onDone:a,children:({reviewMode:l,proposal:m})=>l==="active"?n.jsx(M,{current:m?.current??null,proposed:{...m?.current??{},...m?.proposedAfter??{}},render:y=>n.jsx(B,{value:y})}):l==="loading"?_:l==="error"?null:j}),n.jsx(C,{automationId:t})]}):n.jsxs("div",{className:"space-y-6",children:[j,n.jsx(C,{automationId:t})]})}function I({owner:i,agentId:t,automationId:r,view:o,runId:a,onDone:d}){const{organizationId:u}=k(i),c=A(r,void 0,u),g=t??c.data?.automation?.managed_agent_id??null;return a||o==="definition"?n.jsx(Q,{agentId:g,automationId:r,runId:a,organizationId:u,onDone:d},`${i}/${r}`):n.jsx(K,{owner:i,automationId:r,organizationId:u})}export{I as A,z as u};
|
|
2
|
-
//# sourceMappingURL=automation-detail-content-Bs3vwAPd.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{fh as b,fi as g,cL as k,j as e,L as j,V as r,b8 as y,W as C,fj as d,fk as A,d1 as $,ek as p,eq as M,ct as I}from"./index-BjcZVe7n.js";const m="bg-muted text-muted-foreground",R={event:{label:"Event",icon:k},schedule:{label:"Schedule",icon:g},manual:{label:"Manual",icon:b}};function S({agentName:n,deviceLabel:s,executorKind:i}){const t=i==="script"?{label:"Script",icon:d}:i==="external"?{label:"External executor",icon:d}:s?{label:s,icon:A}:n?{label:n,icon:$}:{label:"Manual · any client",icon:d},{label:l,icon:c}=t;return e.jsxs(r,{variant:"secondary",className:m,children:[e.jsx(c,{className:"h-3 w-3"}),l]})}function E({lastRunAt:n,nextRunAt:s,repliesToSource:i}){const t=n?`Ran ${p(n)}`:s?`Next run ${p(s)}`:i?"Replies to incoming messages":"Never run";return e.jsxs(r,{variant:"secondary",className:m,children:[e.jsx(M,{className:"h-3 w-3"}),t]})}function L({count:n}){return n<=0?null:e.jsxs(r,{variant:"secondary",className:m,children:[e.jsx(I,{className:"h-3 w-3"}),n," ",n===1?"client":"clients"]})}function B({automation:n,agentName:s,deviceLabel:i,connectorDisplay:t,owner:l,actions:c,rowClass:v,appearance:N="row"}){const a=n.automation,o=a.execution_config?.executor,_=o&&typeof o=="object"?o.kind:void 0,u=a.automation_id,x=R[n.kind],w=a.entity_name&&a.entity_type?`${a.entity_name} · ${a.entity_type}`:null,h=[n.when,w].filter(Boolean).join(" — "),f=a.health==="degraded"?a.health_reasons?.[0]||"Needs attention":null;return N==="inline"?e.jsxs(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:u},search:{view:"definition",run_id:void 0},className:"inline-flex items-center gap-1.5 rounded-md bg-accent px-1.5 py-0.5 text-sm font-medium",children:[e.jsx(x.icon,{className:"h-3.5 w-3.5 shrink-0"}),n.does,a.status==="archived"?e.jsx(r,{variant:"outline",children:"Archived"}):null]}):e.jsxs("div",{className:v,children:[e.jsxs(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:u},search:{view:"definition",run_id:void 0},className:"flex min-w-0 flex-1 items-center gap-3",children:[t?e.jsx(y,{icon:t.icon,iconUrl:t.iconUrl,name:t.name,faviconDomain:t.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}):e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(x.icon,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:n.does}),a.status==="archived"?e.jsx(r,{variant:"outline",children:"Archived"}):null,e.jsx(S,{agentName:s,deviceLabel:i,executorKind:_}),e.jsx(E,{lastRunAt:a.last_run_completed_at??a.last_fired_at??null,nextRunAt:a.next_run_at??null,repliesToSource:n.output.destination==="source"}),e.jsx(L,{count:a.processing_client_count??0}),f?e.jsxs(r,{variant:"secondary",className:"max-w-full whitespace-normal bg-amber-500/10 text-left text-amber-700 dark:text-amber-400",children:[e.jsx(C,{className:"h-3 w-3 shrink-0"}),f]}):null]}),h?e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:h}):null]})]}),c]})}export{B as A};
|
|
2
|
-
//# sourceMappingURL=automation-row-B5Q1B10y.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j0 as n,j as t,az as a}from"./index-BjcZVe7n.js";import{a as i}from"./agent-connect-pages-Br_ycC0z.js";import"./agent-client-setup-list-CpUTAjXf.js";import"./connector-page-shell-Di6XzkVo.js";import"./copy-button-Ddf7lBjZ.js";import"./clients-Cmp0LmOp.js";import"./client-rows-x_CxeWkP.js";function l(){const{owner:o,clientId:e}=n.useParams();return t.jsx(a,{owner:o,children:({ownerSlug:r})=>t.jsx(i,{owner:r,clientId:e})})}export{l as component};
|
|
2
|
-
//# sourceMappingURL=connect._clientId-nsGxe6yO.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as w,az as N,r as y,gS as p,gT as x,L as r,gU as o,F as _,ed as j,b2 as L,dw as A,B as $,A as k,je as g}from"./index-BjcZVe7n.js";import{C as u}from"./connector-page-shell-Di6XzkVo.js";import{E as B}from"./events-feed-CGzA1w3R.js";import{u as E}from"./client-activity-scopes-BD2HBo-_.js";import{u as P}from"./clients-Cmp0LmOp.js";import{g as S,c as R}from"./client-rows-x_CxeWkP.js";import"./event-card-CjA_dLzq.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./run-initiator-CCxNv0rK.js";import"./use-automations-D9hKpufo.js";import"./renderer-CHPS-1vD.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./change-summary-DeuXQEpb.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./automation-row-B5Q1B10y.js";import"./model-C2q7WDcS.js";import"./connection-label-BobuYiAG.js";import"./use-scroll-sentinel-BWCrmNIB.js";const T="gap-3 pt-2.5 pb-8";function D({owner:s,clientId:a,mcpActivityId:t}){return e.jsx(w,{className:T,children:e.jsx(N,{owner:s,children:({organizationId:n,ownerSlug:m})=>e.jsx(O,{ownerSlug:m,organizationId:n,clientId:a,mcpActivityId:t})})})}function O({ownerSlug:s,organizationId:a,clientId:t,mcpActivityId:n}){const{data:m=[],isLoading:f}=P(null),i=y.useMemo(()=>S(m).find(h=>h.clientIds.includes(t)),[t,m]),l=i?.clientIds??[],{data:C=[],isLoading:b}=E({enabled:!!i&&!!a,limit:100,clientIds:l,organizationId:a}),c=n?C.find(h=>h.activityId===n)??null:null,d=i?.title??"Connected agent",v=c?R(c):"Conversation";return!a||f||n&&b?e.jsx(u,{header:e.jsx(p,{breadcrumb:e.jsx(x,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"py-3 text-xs text-muted-foreground",children:"Loading…"})}):n&&(!i||!c||c.organizationId===null)?e.jsx(_,{to:"/$owner/events",params:{owner:"me"},search:{client_ids:i?l.join(","):t,mcp_activity_id:n},replace:!0}):i?n?e.jsx(u,{header:e.jsx(p,{breadcrumb:e.jsx(x,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:d},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:c?.clientName??d})}),title:v,meta:e.jsx($,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(r,{to:"/$owner/events",params:{owner:s},search:{client_ids:l.join(","),mcp_activity_id:n},children:["See in Activity",e.jsx(k,{className:"h-3.5 w-3.5"})]})})}),children:e.jsx(B,{organizationId:a,ownerSlug:s,filters:{clientIds:l,mcpActivityId:n,sortBy:"date",sortOrder:"desc"},hideOriginator:!0,foldConsecutiveCalls:!0,emptyState:e.jsx(L,{icon:A,title:"No activity in this conversation yet",description:"Calls this app makes will appear here."})})}):e.jsx(u,{header:e.jsx(p,{breadcrumb:e.jsx(x,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:d},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:d})}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a conversation on this app's page to see its activity."})}):e.jsx(u,{header:e.jsx(p,{breadcrumb:e.jsx(x,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This app isn't connected to this workspace, so its activity isn't available."})})}function ce(){const{owner:s,clientId:a}=g.useParams(),t=g.useSearch();return e.jsx(D,{owner:s,clientId:a,mcpActivityId:typeof t.mcp_activity_id=="string"?t.mcp_activity_id:null})}export{ce as component};
|
|
2
|
-
//# sourceMappingURL=connected._clientId.activity-CDB8atTX.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,V as R,c as $,L as N,ek as E,A as M,v as _,eI as D,r as u,S as I,cR as H,cH as K,gl as y,B as f,ab as G,ak as O,gS as Q,ed as V,gT as W,gU as q,j7 as F,az as J}from"./index-BjcZVe7n.js";import{T as X,a as Y,b as S,c as d,d as Z,e as x}from"./table-DALHuXPE.js";import{c as w,g as P}from"./client-rows-x_CxeWkP.js";import{u as A}from"./client-activity-scopes-BD2HBo-_.js";import{u as T,a as ee}from"./clients-Cmp0LmOp.js";import{C as se}from"./connector-page-shell-Di6XzkVo.js";function te({isLive:n}){return e.jsx(R,{variant:n?"default":"secondary",className:`shrink-0 text-[10px] ${n?"":"text-muted-foreground"}`,title:n?"Live MCP transport":"No live MCP transport; activity history is retained",children:n?"Active":"Ended"})}function L({scopes:n,ownerSlug:i}){const l=$(),o=s=>s.organizationId===null?{to:"/$owner/events",params:{owner:"me"},search:{client_ids:s.clientId,mcp_activity_id:s.activityId}}:{to:"/$owner/agents/connected/$clientId/activity",params:{owner:i,clientId:s.clientId},search:{mcp_activity_id:s.activityId}},r=s=>{l(o(s))};return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(X,{children:[e.jsx(Y,{children:e.jsxs(S,{children:[e.jsx(d,{className:"px-3 py-1.5 text-xs",children:"Conversation"}),e.jsx(d,{className:"px-3 py-1.5 text-xs",children:"Calls"}),e.jsx(d,{className:"px-3 py-1.5 text-xs",children:"Last action"}),e.jsx(d,{className:"px-3 py-1.5 text-xs",children:"Last active"}),e.jsx(d,{className:"w-8 px-3 py-1.5"})]})}),e.jsx(Z,{children:n.map(s=>e.jsxs(S,{className:"cursor-pointer transition-colors hover:bg-accent/50",onClick:()=>r(s),children:[e.jsx(x,{className:"max-w-0 px-3 py-2 text-xs font-medium",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{...o(s),onClick:c=>c.stopPropagation(),className:"truncate hover:underline",children:w(s)}),s.activityKind==="session"?e.jsx(te,{isLive:s.isLive}):null,s.unreadNotificationCount>0?e.jsxs(R,{variant:"secondary",className:"shrink-0 text-[10px]",children:[s.unreadNotificationCount," unread"]}):null]})}),e.jsx(x,{className:"px-3 py-2 font-mono text-xs text-muted-foreground",children:s.callCount}),e.jsx(x,{className:"max-w-0 truncate px-3 py-2 text-xs text-muted-foreground",children:s.lastAction||"—"}),e.jsx(x,{className:"px-3 py-2 text-xs text-muted-foreground",children:E(s.lastCallAt)}),e.jsx(x,{className:"px-3 py-2 text-right",children:e.jsx("button",{type:"button","aria-label":`View ${w(s)} activity`,className:"text-muted-foreground hover:text-foreground",tabIndex:-1,children:e.jsx(M,{className:"h-3.5 w-3.5"})})})]},`${s.clientId}:${s.activityId}`))})]})})}function ne({ownerSlug:n,clientId:i}){const{orgContext:l}=_(),{isAdmin:o}=D(l.organizationId),{data:r=[],isLoading:s}=T(null),c=ee(),[z,h]=u.useState(!1),t=u.useMemo(()=>P(r),[r]).find(a=>a.clientIds.includes(i)),b=t?.clientIds??[],g=A({enabled:!!t,limit:100,clientIds:b,activityKind:"conversation",organizationId:l?.organizationId??null}),p=A({enabled:!!t,limit:100,clientIds:b,activityKind:"session",organizationId:l?.organizationId??null,refetchInterval:a=>a?5e3:!1}),m=g.data??[],v=p.data??[],B=u.useMemo(()=>r.filter(a=>t?.clientIds.includes(a.id)),[r,t]);if(s)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(I,{className:"h-16 w-full rounded-lg"}),e.jsx(I,{className:"h-24 w-full rounded-lg"})]});if(!t)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"This app isn't connected to this workspace, so its details aren't available."});const j=B[0],C=j?.details?.redirectUris??[],k=t.linkedUserEntitySlug?H(n,[{entity_type:"$member",slug:t.linkedUserEntitySlug}]):null,U=[{label:"Registered",value:t.title},{label:t.clientIds.length===1?"Client ID":"Client IDs",value:e.jsx("div",{className:"space-y-1",children:t.clientIds.map(a=>e.jsx("code",{className:"block break-all",children:a},a))})},...t.drivenBy&&t.drivenBy!==t.title?[{label:"Driven by",value:t.drivenBy}]:[],...j?.platform?[{label:"Software",value:j.platform}]:[],...C.length>0?[{label:"Redirects",value:C.join(", ")}]:[],{label:"Granted by",value:k&&t.linkedUser?e.jsx(N,{to:k,className:"font-medium text-primary hover:underline",children:t.linkedUser}):t.linkedUser??"—"},{label:"Last active",value:t.connected?K(t.lastSeenAt):"disconnected"},{label:"Registrations",value:String(t.clientIds.length)}];return e.jsxs("div",{className:"space-y-7",children:[e.jsx(y,{title:"Settings",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"overflow-hidden rounded-lg border text-xs",children:e.jsx("dl",{className:"divide-y",children:U.map(a=>e.jsxs("div",{className:"flex gap-3 px-3 py-2",children:[e.jsx("dt",{className:"w-28 shrink-0 text-muted-foreground",children:a.label}),e.jsx("dd",{className:"min-w-0 flex-1 break-words",children:a.value})]},a.label))})}),o&&t.connected?e.jsxs("div",{className:"space-y-2 rounded-lg border p-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Revoking disconnects every registration this app holds",t.clientIds.length>1?` (${t.clientIds.length} of them)`:""," ","and kills its live sessions. It can reconnect by authorizing again."]}),z?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{variant:"destructive",size:"sm",className:"h-7 px-2 text-xs",disabled:c.isPending,onClick:()=>c.mutate({clientId:t.clientIds[0],scope:"all"},{onSettled:()=>h(!1)}),children:c.isPending?"Revoking…":"Confirm revoke"}),e.jsx(f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:c.isPending,onClick:()=>h(!1),children:"Cancel"})]}):e.jsx(f,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive",onClick:()=>h(!0),children:"Revoke"})]}):null]})}),e.jsx(y,{title:"Conversations",count:m.length>0?String(m.length):void 0,children:g.isLoading||p.isLoading?e.jsxs("div",{className:"flex items-center py-4 text-xs text-muted-foreground",children:[e.jsx(G,{className:"mr-2"})," Loading client activity…"]}):g.isError||p.isError?e.jsx("p",{className:"py-3 text-xs text-destructive",children:"Could not load this app's activity."}):m.length===0?e.jsx("p",{className:"py-3 text-xs text-muted-foreground",children:"No recent conversations."}):e.jsx(L,{scopes:m,ownerSlug:n})}),v.length>0?e.jsx(y,{title:"Sessions",count:String(v.length),children:e.jsx(L,{scopes:v,ownerSlug:n})}):null]})}function ae({owner:n,clientId:i}){const{data:l=[]}=T(null),r=u.useMemo(()=>P(l).find(s=>s.clientIds.includes(i)),[i,l])?.title??"Connected agent";return e.jsx(O,{className:"gap-3 pt-2.5 pb-8",children:e.jsx(se,{header:e.jsx(Q,{breadcrumb:e.jsx(W,{crumbs:[e.jsx(N,{to:"/$owner/agents",params:{owner:n},className:q,children:"Agents"},"agents")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(V,{name:r})}),title:r,caption:"An external agent connected to this workspace through Lobu. Review its Lobu conversations, activity, and access."}),children:e.jsx(ne,{ownerSlug:n,clientId:i},i)})})}function me(){const{owner:n,clientId:i}=F.useParams();return e.jsx(J,{owner:n,children:({ownerSlug:l})=>e.jsx(ae,{owner:l,clientId:i})})}export{me as component};
|
|
2
|
-
//# sourceMappingURL=connected._clientId.index-DBNP2mZo.js.map
|