@lobu/runtime-server 24.5.0 → 24.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +342 -4
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/linkedin-identity.ts +43 -0
- package/dist/connectors/linkedin.ts +154 -3
- package/dist/connectors/x-like-follow.ts +329 -0
- package/dist/connectors/x.ts +709 -80
- package/dist/dependencies.bun.lock +18 -18
- package/dist/owletto/dist/assets/_-DT3E3BmS.js +3 -0
- package/dist/owletto/dist/assets/_-c1xy7bLu.js +2 -0
- package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DV8utajn.js +2 -0
- package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +2 -0
- package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +2 -0
- package/dist/owletto/dist/assets/_name-CM1AMywz.js +2 -0
- package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +3 -0
- package/dist/owletto/dist/assets/_shape-DGAkETDp.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +2 -0
- package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +2 -0
- package/dist/owletto/dist/assets/_view-B5I7mmkl.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-pUl-c1KQ.js → accept-invitation-CQZQ0wwC.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-DN0ZEAzr.js → activity-route-view-CZykJXQp.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-C5jNWgfq.js → agent-card-controls-DuQJhtqp.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-DbXtJTsO.js → agent-client-setup-list-CpUTAjXf.js} +2 -2
- package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-Br_ycC0z.js} +2 -2
- package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +2 -0
- package/dist/owletto/dist/assets/{agent-guardrails-route-BJyfalBY.js → agent-guardrails-route-CN7vpC0X.js} +2 -2
- package/dist/owletto/dist/assets/{agent-list-row-rF5LH-3k.js → agent-list-row-BnP6r4pm.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-ClY_O6lb.js → agent-loading-shells-_18OREnx.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-bP1Qihv7.js → agent-permissions-matrix-DSjidWHL.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-1DBn7Xc_.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-Bv5luNdw.js → agent-skills-route-d5jh3oBR.js} +2 -2
- package/dist/owletto/dist/assets/{agent-tab-intro-ednTs4WF.js → agent-tab-intro-DKrC3SQt.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-WNk2HapT.js → agent-thread-FyEO-y44.js} +3 -3
- package/dist/owletto/dist/assets/agents-kXojozTU.js +2 -0
- package/dist/owletto/dist/assets/{agents-workbench-bPTjdVS1.js → agents-workbench-CDpJmUVN.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-DrL5H5lB.js → app._appId-DwNeXRJp.js} +2 -2
- package/dist/owletto/dist/assets/{assist-composer-ClfFEVx7.js → assist-composer-Mn9EfX4X.js} +2 -2
- package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +2 -0
- package/dist/owletto/dist/assets/{automation-row-DCHM--aD.js → automation-row-B5Q1B10y.js} +2 -2
- package/dist/owletto/dist/assets/automation-source-list-Dhucq1sI.js +2 -0
- package/dist/owletto/dist/assets/automations-kXojozTU.js +2 -0
- package/dist/owletto/dist/assets/{callback-DRABUOha.js → callback-9xSHyA12.js} +2 -2
- package/dist/owletto/dist/assets/{card-Bdi7VEwo.js → card-g4yxo4Hr.js} +2 -2
- package/dist/owletto/dist/assets/{change-summary-PBoM6Asb.js → change-summary-DeuXQEpb.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CUIG1Oc-.js → claim-B98IhDra.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-CXOWB5co.js → client-activity-scopes-BD2HBo-_.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-36VnmgMK.js → client-rows-x_CxeWkP.js} +2 -2
- package/dist/owletto/dist/assets/{clients-BJRcMk1A.js → clients-Cmp0LmOp.js} +2 -2
- package/dist/owletto/dist/assets/connect-menu-CezOH3s7.js +2 -0
- package/dist/owletto/dist/assets/connect-zUot_0kG.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId.index-jSnGvzYs.js → connected._clientId.index-DBNP2mZo.js} +2 -2
- package/dist/owletto/dist/assets/{connection-q1bdnxCN.js → connection-B6fM2KHN.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-BIlkK0Pd.js → connection-feed-detail-Ckq-qEbD.js} +2 -2
- package/dist/owletto/dist/assets/{connections-browser-V-3td9DB.js → connections-browser-BXsJqieG.js} +2 -2
- package/dist/owletto/dist/assets/{connector-boxes-lFc-WP83.js → connector-boxes-CbqSFeVm.js} +2 -2
- package/dist/owletto/dist/assets/{connector-page-shell-Cs1SjrYB.js → connector-page-shell-Di6XzkVo.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-aJFeeRIC.js → connector-provenance-BrnasBW4.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists--vNdbOn0.js → connector-scope-lists-dQnZARCD.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-BsvDMdsQ.js → connectors-DnOUxX_U.js} +2 -2
- package/dist/owletto/dist/assets/{consent-DJV78pnz.js → consent-Byli4yMs.js} +2 -2
- package/dist/owletto/dist/assets/{copy-button-DjMWgrBf.js → copy-button-Ddf7lBjZ.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CQzL3ObT.js → core.esm-BsXtvNoI.js} +2 -2
- package/dist/owletto/dist/assets/create-B34eskZ_.js +2 -0
- package/dist/owletto/dist/assets/create-DLB9sXgU.js +2 -0
- package/dist/owletto/dist/assets/{create-jBEuveV1.js → create-YdAnh3ml.js} +2 -2
- package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +2 -0
- package/dist/owletto/dist/assets/definition-comparison-B5WgZILB.js +2 -0
- package/dist/owletto/dist/assets/{device-Ba3RsIgb.js → device-DdCoCj-Q.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +2 -0
- package/dist/owletto/dist/assets/{entity-options-daOOQo7O.js → entity-options-BkU_En_f.js} +2 -2
- package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-D0ghgRgq.js +2 -0
- package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +2 -0
- package/dist/owletto/dist/assets/{event-detail-DkY95e5b.js → event-detail-CmC-DVrK.js} +2 -2
- package/dist/owletto/dist/assets/{events-feed-B9CZHI_P.js → events-feed-CGzA1w3R.js} +2 -2
- package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-BqmckkOf.js → full-page-spinner-B5xXnKtV.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-DkXatmea.js +2 -0
- package/dist/owletto/dist/assets/identity-BwJy3ixB.js +2 -0
- package/dist/owletto/dist/assets/{index--ZWegctR.js → index-35ehGReZ.js} +2 -2
- package/dist/owletto/dist/assets/index-B9hYiwBw.js +2 -0
- package/dist/owletto/dist/assets/{index-C186T2Rw.js → index-BDl1_w6U.js} +2 -2
- package/dist/owletto/dist/assets/{index-ijqrJaRB.js → index-BdNR51Ua.js} +2 -2
- package/dist/owletto/dist/assets/{index-DdBTTN3y.js → index-BjcZVe7n.js} +52 -52
- package/dist/owletto/dist/assets/{index-CsrT07TJ.js → index-BqAVebvY.js} +2 -2
- package/dist/owletto/dist/assets/index-BvK1fS1J.js +2 -0
- package/dist/owletto/dist/assets/{index-DdYWarql.css → index-CNEpTkgw.css} +1 -1
- package/dist/owletto/dist/assets/index-CRc73k1t.js +2 -0
- package/dist/owletto/dist/assets/index-CYGaSD3y.js +2 -0
- package/dist/owletto/dist/assets/index-CfZGe-zn.js +2 -0
- package/dist/owletto/dist/assets/{index-B0kw2lFL.js → index-CkiyxW4w.js} +2 -2
- package/dist/owletto/dist/assets/index-CzLDNB2E.js +2 -0
- package/dist/owletto/dist/assets/{index-BKrdVwW9.js → index-D-o5iOVd.js} +2 -2
- package/dist/owletto/dist/assets/index-DjYVV1Ml.js +2 -0
- package/dist/owletto/dist/assets/{index-ikp_mTsf.js → index-TkPy_P_u.js} +2 -2
- package/dist/owletto/dist/assets/index-VyAX-asP.js +2 -0
- package/dist/owletto/dist/assets/json-diff-DtZtra_g.js +28 -0
- package/dist/owletto/dist/assets/{list-skeleton-CXDLkYTg.js → list-skeleton-CIHWCi2a.js} +2 -2
- package/dist/owletto/dist/assets/{login-u6LCgDYG.js → login-TWR0vF4_.js} +2 -2
- package/dist/owletto/dist/assets/{logout-JhmuWJEH.js → logout-BA5kojS0.js} +2 -2
- package/dist/owletto/dist/assets/{manage-gear-D8LMhehh.js → manage-gear-C-0BAMbC.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-4FQ0aanZ.js → member-scope-gate-BQiRAqtx.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +74 -0
- package/dist/owletto/dist/assets/{model-jL871x2J.js → model-C2q7WDcS.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-CgU8SJMF.js → model-selector-B2cjCn0V.js} +2 -2
- package/dist/owletto/dist/assets/models-CZkH5gtj.js +2 -0
- package/dist/owletto/dist/assets/{nav-pill-DrFkuyUQ.js → nav-pill-Bam6s3jj.js} +2 -2
- package/dist/owletto/dist/assets/new-BJst6K0b.js +2 -0
- package/dist/owletto/dist/assets/{new-DgE1pVV0.js → new-Dc5Bbotb.js} +2 -2
- package/dist/owletto/dist/assets/new-DgbivfDe.js +2 -0
- package/dist/owletto/dist/assets/{organization-CKM_oFX3.js → organization-B9U1L-56.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-sml8Uf6e.js → pending-seed-BP3xHM2d.js} +2 -2
- package/dist/owletto/dist/assets/{permissions-BvA9SATv.js → permissions-BVlbeY4u.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-BED-DO9C.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +2 -0
- package/dist/owletto/dist/assets/{record-activity-C9gVBbF0.js → record-activity-CTLwq8s1.js} +2 -2
- package/dist/owletto/dist/assets/{record-session-R-uHNuby.js → record-session-DOFgdd43.js} +2 -2
- package/dist/owletto/dist/assets/renderer-CHPS-1vD.js +96 -0
- package/dist/owletto/dist/assets/{reset-password-Mx3baeNc.js → reset-password-BmNM-apc.js} +2 -2
- package/dist/owletto/dist/assets/{run-activity-link-CaIBSRQj.js → run-activity-link-Dh1YyCfk.js} +2 -2
- package/dist/owletto/dist/assets/{run-initiator-BvzQJYW9.js → run-initiator-CCxNv0rK.js} +2 -2
- package/dist/owletto/dist/assets/{runs-fFJ1lPnw.js → runs-BntGAKQG.js} +2 -2
- package/dist/owletto/dist/assets/{runs-panel-DEnZHTa5.js → runs-panel-BwTVaRsE.js} +2 -2
- package/dist/owletto/dist/assets/{runs-table-XGnxJl7S.js → runs-table-CYS1jDdL.js} +2 -2
- package/dist/owletto/dist/assets/{schema-type-editor-panel-C0_9VcSs.js → schema-type-editor-panel-v3nR2Oa2.js} +2 -2
- package/dist/owletto/dist/assets/schema-value-BFb7jCBo.js +3 -0
- package/dist/owletto/dist/assets/settings-DBgT60nY.js +2 -0
- package/dist/owletto/dist/assets/{settings-CP4PjMQA.js → settings-DubSpJfg.js} +2 -2
- package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-Bh0n4gGw.js → source-record-panels-m8gECt82.js} +2 -2
- package/dist/owletto/dist/assets/{status-dot-Cpq63I7p.js → status-dot-BnQPFrcU.js} +2 -2
- package/dist/owletto/dist/assets/{table-BUqshjxa.js → table-DALHuXPE.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-BLNjxq2K.js → use-automations-D9hKpufo.js} +2 -2
- package/dist/owletto/dist/assets/{use-login-redirect-CmyQW7GT.js → use-login-redirect-ciwfc-7A.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-dn3ws1WB.js → use-mention-search-CJGCatFS.js} +2 -2
- package/dist/owletto/dist/assets/{use-scroll-sentinel-DRyBMueA.js → use-scroll-sentinel-BWCrmNIB.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-CZ1fvAks.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +5596 -4000
- package/npm-shrinkwrap.json +99 -99
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/view-host.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/view-host.js +28 -0
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -4
- package/vendor/core/dist/contracts/tools/view-runtime.js +19 -7
- package/vendor/core/package.json +11 -1
- package/vendor/views/dist/api.d.ts +9 -4
- package/vendor/views/dist/api.js +33 -2
- package/vendor/views/dist/bridge.d.ts +8 -0
- package/vendor/views/dist/bridge.js +12 -2
- package/vendor/views/dist/components.d.ts +4 -2
- package/vendor/views/dist/components.js +29 -14
- package/vendor/views/dist/index.d.ts +1 -1
- package/vendor/views/dist/index.js +1 -1
- package/vendor/views/dist/native.d.ts +327 -0
- package/vendor/views/dist/native.js +57 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-CCWuGXtQ.js +0 -2
- package/dist/owletto/dist/assets/_-DOJW1D-I.js +0 -3
- package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +0 -2
- package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +0 -2
- package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +0 -2
- package/dist/owletto/dist/assets/_name-D30_V03t.js +0 -2
- package/dist/owletto/dist/assets/_owner-Be8O41u8.js +0 -3
- package/dist/owletto/dist/assets/_shape-C6YbloRh.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +0 -2
- package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +0 -2
- package/dist/owletto/dist/assets/_view-aoFDwEld.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +0 -2
- package/dist/owletto/dist/assets/agents-DY2S2SGE.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +0 -2
- package/dist/owletto/dist/assets/automations-DY2S2SGE.js +0 -2
- package/dist/owletto/dist/assets/calendar-Ck0yOLYu.js +0 -2
- package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +0 -16
- package/dist/owletto/dist/assets/connect-CMcEQWls.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +0 -2
- package/dist/owletto/dist/assets/create-BmKx5vq3.js +0 -2
- package/dist/owletto/dist/assets/create-Rt0RbiD4.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +0 -2
- package/dist/owletto/dist/assets/entity-avatar-TVKjZxWQ.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +0 -2
- package/dist/owletto/dist/assets/event-card-DVUB8my6.js +0 -2
- package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +0 -2
- package/dist/owletto/dist/assets/guardrails-Csusrok2.js +0 -2
- package/dist/owletto/dist/assets/identity-Dmg3STO8.js +0 -2
- package/dist/owletto/dist/assets/index-BUBcNNUY.js +0 -2
- package/dist/owletto/dist/assets/index-BUDr4-Yv.js +0 -2
- package/dist/owletto/dist/assets/index-BYPQWVwD.js +0 -2
- package/dist/owletto/dist/assets/index-BfpaPJPj.js +0 -2
- package/dist/owletto/dist/assets/index-BicNFLBW.js +0 -2
- package/dist/owletto/dist/assets/index-Bsdv5aks.js +0 -2
- package/dist/owletto/dist/assets/index-CX0pJ9j9.js +0 -2
- package/dist/owletto/dist/assets/index-JYEIN8nM.js +0 -2
- package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +0 -14
- package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +0 -74
- package/dist/owletto/dist/assets/models-jdemgIZk.js +0 -2
- package/dist/owletto/dist/assets/new-CcJOd5aH.js +0 -2
- package/dist/owletto/dist/assets/new-OWwrYckd.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +0 -2
- package/dist/owletto/dist/assets/renderer-DXfJaCCa.js +0 -97
- package/dist/owletto/dist/assets/settings-CgaUJMHH.js +0 -2
- package/dist/owletto/dist/assets/skills-D-e_h3a9.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-C_b9itZ2.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o,L as p,
|
|
1
|
+
import{j as o,L as p,ed as h}from"./index-BjcZVe7n.js";const m="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function s(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function i(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return s(t)?n:`${n} --url ${t}`}function r(e,t){return`npx @lobu/cli@latest connect ${e} --url ${t}`}const d={label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"};function u(e){return[`Paste the prompt into ${e} and review its proposed setup.`,"Approve Lobu sign-in in your browser or through the email approval link.",`Let ${e} verify access with a harmless read in this workspace.`]}const l=[{id:"claude",label:"Claude",tagline:"Web, desktop, and coding agent for one workspace",description:"Claude web, desktop, and Code apps for this workspace.",installTitle:"Add in one click, or run in your terminal",installLink:e=>({label:"Add Lobu to Claude",href:`https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Lobu&connectorUrl=${encodeURIComponent(e)}`}),installText:e=>i("claude-code",e),promptUrl:e=>`https://claude.ai/new?q=${encodeURIComponent(e)}`,steps:e=>["Claude: open the Add to Claude link above and complete sign-in.",...s(e)?["The CLI adds Lobu's marketplace and installs the shared plugin."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Start a fresh Claude Code session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"},{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"ChatGPT web connector and Codex coding agent for this workspace.",installTitle:"Pick a surface",installLink:e=>s(e)?{label:"Use Lobu in ChatGPT",href:"https://chatgpt.com/plugins/plugin_asdk_app_6a73b856e4348191a97dc8e3a1e58a94"}:null,promptUrl:e=>`https://chatgpt.com/?q=${encodeURIComponent(e)}`,installText:e=>s(e)?i("codex",e):["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${i("codex",e)}`].join(`
|
|
2
2
|
`),steps:e=>s(e)?["ChatGPT web: open the Lobu listing above and complete sign-in.","Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>r("opencode",e),steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>r("antigravity",e),steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>r("cursor",e),steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[d]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>u("OpenClaw"),guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>u("Hermes"),guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Not listed here",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[d]}],L=["Connect my Gmail to Lobu.","Create a Lobu automation that sends me a morning briefing.","In Lobu, design a data model with entities and relationships for tracking deals.","Remember in Lobu that I prefer short answers that lead with the key point."],g={codex:"chatgpt","claude-code":"claude","claude-desktop":"claude"};function f(e){const t=g[e]??e;return l.find(n=>n.id===t)}function k(e){const{workspaceName:t,owner:n,mcpUrl:a,clientLabel:c}=e;return[`Connect this${c?` ${c}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${a}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${m}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
3
3
|
`)}function b(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function w({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:l.map((n,a)=>o.jsxs(p,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:b(a,l.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(h,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{w as A,L as F,k as b,f};
|
|
4
|
-
//# sourceMappingURL=agent-client-setup-list-
|
|
4
|
+
//# sourceMappingURL=agent-client-setup-list-CpUTAjXf.js.map
|
package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-Br_ycC0z.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Q as k,j as e,ak as h,al as v,
|
|
2
|
-
//# sourceMappingURL=agent-connect-pages-
|
|
1
|
+
import{Q as k,j as e,ak as h,al as v,gS as A,b3 as L,gT as S,L as p,gU as P,o as R,r as _,gl as o,B as b,A as N,ed as C}from"./index-BjcZVe7n.js";import{A as I,f as M,b as T,F as y}from"./agent-client-setup-list-CpUTAjXf.js";import{C as $}from"./connector-page-shell-Di6XzkVo.js";import{C as x}from"./copy-button-Ddf7lBjZ.js";import{u as B}from"./clients-Cmp0LmOp.js";import{g as U,a as E}from"./client-rows-x_CxeWkP.js";const O="app.lobu.ai";function F(s,n){const a=n?`/mcp/${n}`:"/mcp";if(!s)return`http://localhost:8787${a}`;try{const r=new URL(s);return r.hostname===O&&(r.hostname="lobu.ai"),r.pathname=a,r.toString()}catch{return`${s}${a}`}}function D(s){return F(k,s)}const u="gap-3 pt-2.5 pb-8";function H(s,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${s===n-1?"":"border-b"}`}function w({owner:s}){return e.jsx(S,{crumbs:[e.jsx(p,{to:"/$owner/agents",params:{owner:s},className:P,children:"Agents"},"agents")]})}function J({owner:s}){return e.jsx(h,{className:u,children:e.jsxs(v,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(A,{breadcrumb:e.jsx(w,{owner:s}),icon:e.jsx(L.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(I,{owner:s})]})})}function V({owner:s,clientId:n}){const a=M(n),{data:r}=R(s,{slug:s}),{data:g=[]}=B(null,{refetchInterval:2500}),l=_.useMemo(()=>U(g).filter(t=>t.connected),[g]);if(!a)return e.jsx(h,{className:u,children:e.jsxs(v,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(p,{to:"/$owner/agents/connect",params:{owner:s},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const c=D(s),d=T({workspaceName:r?.workspace?.name??s,owner:s,mcpUrl:c,clientLabel:a.id==="other"?void 0:a.label,terminalLogin:a.terminalLogin}),m=a.setupMode==="agent-prompt",f=m?d:a.installText?.(c)??d;return e.jsx(h,{className:u,children:e.jsxs($,{header:e.jsx(A,{breadcrumb:e.jsx(w,{owner:s}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(C,{name:a.label})}),title:a.label,caption:a.description}),children:[e.jsx(o,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[(()=>{const t=a.installLink?.(c);return t?e.jsx("div",{children:e.jsx(b,{asChild:!0,children:e.jsxs("a",{href:t.href,target:"_blank",rel:"noreferrer",children:[t.label,e.jsx(N,{className:"ml-1.5 h-3.5 w-3.5"})]})})}):null})(),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:f}),e.jsx(x,{text:f,label:m?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:a.steps(c).map((t,i)=>e.jsxs("li",{children:[i+1,". ",t]},t))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[m?null:e.jsx(x,{text:d,label:"Copy setup prompt"}),a.guideLinks.map(t=>e.jsx(b,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:t.href,target:"_blank",rel:"noreferrer",children:[t.label,e.jsx(N,{className:"ml-1.5 h-3.5 w-3.5"})]})},t.href))]})]})}),e.jsx(o,{title:"First prompts",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),e.jsx("div",{className:"overflow-hidden rounded-lg border",children:y.map((t,i)=>{const j=a.promptUrl?.(t);return e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${i===y.length-1?"":"border-b"}`,children:[j?e.jsx("a",{href:j,target:"_blank",rel:"noreferrer",className:"min-w-0 flex-1 text-sm hover:underline",children:t}):e.jsx("p",{className:"min-w-0 flex-1 text-sm",children:t}),e.jsx(x,{text:t,label:"prompt",iconOnly:!0})]},t)})})]})}),e.jsx(o,{title:"Connected agents",count:l.length>0?String(l.length):void 0,children:l.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:l.map((t,i)=>e.jsxs(p,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t.clientId},className:H(i,l.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(C,{name:t.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:E(t)})]})]},t.key))})}),e.jsx(o,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:c})]})})]})})}export{J as A,V as a};
|
|
2
|
+
//# sourceMappingURL=agent-connect-pages-Br_ycC0z.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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 +1,2 @@
|
|
|
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,eS as te,B as S,c as P,gZ as G,ja as L,jb as U,hF as B,fL as se,bt as j,h2 as I,bO as ne,b_ as re,b2 as D,h4 as ie,V as oe,iH as le,bQ as q,d6 as de,i as E,j8 as ue}from"./index-DdBTTN3y.js";import{M as ce}from"./model-selector-CgU8SJMF.js";import{b as me,a as ge,A as J}from"./agent-tab-intro-ednTs4WF.js";import{T as he,a as pe,b as O,c as R,d as xe,e as $}from"./table-BUqshjxa.js";import{f as be}from"./agent-loading-shells-ClY_O6lb.js";import{A as je}from"./agent-card-controls-C5jNWgfq.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}=U(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}=U(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}=I(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 M(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:M(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:M(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=[]}=I(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 Me({owner:a,agentId:t}){return e.jsx(J,{children:e.jsx(we,{owner:a,agentId:t})})}function Ue({owner:a,agentId:t,name:n}){return e.jsx(De,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{De as A,Me as a,Ue as b};
|
|
2
|
-
//# sourceMappingURL=agent-guardrails-route-
|
|
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 +1,2 @@
|
|
|
1
|
-
import{j as n,L as i,cu as l,
|
|
2
|
-
//# sourceMappingURL=agent-list-row-
|
|
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 +1,2 @@
|
|
|
1
|
-
import{j as e,S as s,i as n}from"./index-
|
|
2
|
-
//# sourceMappingURL=agent-loading-shells-
|
|
1
|
+
import{j as e,S as s,i as n}from"./index-BjcZVe7n.js";const r="mx-auto w-full max-w-3xl px-4",d="gap-4",i="ml-8 self-end max-w-[80%]",o="mr-8 max-w-[90%]",c="mx-auto w-full max-w-3xl shrink-0 border-t border-border/50 bg-transparent px-4 pb-4 pt-3";function f({rows:l=3}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading list",children:Array.from({length:l}).map((a,x)=>e.jsx(s,{className:"h-16 w-full rounded-lg"},x))})}function t({readOnly:l=!1}){return e.jsxs("div",{role:"status","aria-label":l?"Loading run history":"Loading chat",className:l?"flex min-h-[24rem] min-w-0 flex-1 flex-col":"flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:l?"flex flex-1 flex-col overflow-hidden":"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsxs("div",{className:n(r,"flex flex-1 flex-col overflow-hidden",d),children:[e.jsx("div",{className:i,children:e.jsx(s,{className:"h-12 w-48 rounded-lg"})}),e.jsx("div",{className:o,children:e.jsx(s,{className:n(l?"h-20":"h-16","w-64 rounded-lg")})}),e.jsx("div",{className:i,children:e.jsx(s,{className:"h-10 w-36 rounded-lg"})}),l?e.jsx("div",{className:o,children:e.jsx(s,{className:"h-16 w-52 rounded-lg"})}):null]})}),l?null:e.jsx("div",{className:c,children:e.jsx(s,{className:"h-24 w-full rounded-lg"})})]})}function h(){return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsx(t,{})})}function u(){return e.jsx("div",{className:"flex h-48 w-full items-end gap-2 px-2 pb-2",role:"status","aria-label":"Loading timeline",children:[40,65,45,80,55,70,50,85,60,75].map((l,a)=>e.jsx(s,{className:"flex-1 rounded-sm",style:{height:`${l}%`}},a))})}export{t as A,h as C,u as E,c as a,d as b,r as c,o as d,i as e,f};
|
|
2
|
+
//# sourceMappingURL=agent-loading-shells-_18OREnx.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,bR as B,i as S,a$ as D,b0 as K,b1 as R,
|
|
2
|
-
//# sourceMappingURL=agent-permissions-matrix-
|
|
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
|
package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-1DBn7Xc_.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,bB as
|
|
2
|
-
//# sourceMappingURL=agent-skill-context-
|
|
1
|
+
import{r as p,bB as q,g_ as ge,hv as pe,hG as be,bt as F,j as ve}from"./index-BjcZVe7n.js";import{K as E,d as me,g as he,e as xe,s as Ce,f as Ie,h as Se,i as Y,b as ke,c as ye,j as we,k as Re,C as H,l as Ae}from"./core.esm-BsXtvNoI.js";import{s as De,b as Ee}from"./skill-editor-D_W3QlRz.js";function _(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Le(e,n){return e.reduce((t,r,s)=>{const u=n.get(r);return u&&(t[s]=u),t},Array(e.length))}function P(e){return e!==null&&e>=0}function Te(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ne(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const V=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const u=_(n,r,t),o=n[s],i=u[s];return!i||!o?null:{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}},M={scaleX:1,scaleY:1},We=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:u,overIndex:o}=e;const i=(n=u[t])!=null?n:r;if(!i)return null;if(s===t){const f=u[o];return f?{x:0,y:t<o?f.top+f.height-(i.top+i.height):f.top-i.top,...M}:null}const m=Oe(u,s,t);return s>t&&s<=o?{x:0,y:-i.height-m,...M}:s<t&&s>=o?{x:0,y:i.height+m,...M}:{x:0,y:0,...M}};function Oe(e,n,t){const r=e[n],s=e[n-1],u=e[n+1];return r?t<n?s?r.top-(s.top+s.height):u?u.top-(r.top+r.height):0:u?u.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const W="Sortable",J=q.createContext({activeIndex:-1,containerId:W,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:V,disabled:{draggable:!1,droppable:!1}});function Je(e){let{children:n,id:t,items:r,strategy:s=V,disabled:u=!1}=e;const{active:o,dragOverlay:i,droppableRects:m,over:f,measureDroppableContainers:a}=Ie(),l=Se(W,t),b=i.rect!==null,h=p.useMemo(()=>r.map(d=>typeof d=="object"&&"id"in d?d.id:d),[r]),k=o!=null,w=o?h.indexOf(o.id):-1,C=f?h.indexOf(f.id):-1,R=p.useRef(h),I=!Te(h,R.current),S=C!==-1&&w===-1||I,c=Ne(u);Y(()=>{I&&k&&a(h)},[I,h,k,a]),p.useEffect(()=>{R.current=h},[h]);const g=p.useMemo(()=>({activeIndex:w,containerId:l,disabled:c,disableTransforms:S,items:h,overIndex:C,useDragOverlay:b,sortedRects:Le(h,m),strategy:s}),[w,l,c.draggable,c.droppable,S,h,C,m,b,s]);return q.createElement(J.Provider,{value:g},n)}const Pe=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return _(t,r,s).indexOf(n)},Me=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:u,newIndex:o,previousItems:i,previousContainerId:m,transition:f}=e;return!f||!r||i!==u&&s===o?!1:t?!0:o!==s&&n===m},je={duration:200,easing:"ease"},Q="transform",$e=H.Transition.toString({property:Q,duration:0,easing:"linear"}),ze={roleDescription:"sortable"};function Fe(e){let{disabled:n,index:t,node:r,rect:s}=e;const[u,o]=p.useState(null),i=p.useRef(t);return Y(()=>{if(!n&&t!==i.current&&r.current){const m=s.current;if(m){const f=Ae(r.current,{ignoreTransform:!0}),a={x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height};(a.x||a.y)&&o(a)}}t!==i.current&&(i.current=t)},[n,t,r,s]),p.useEffect(()=>{u&&o(null)},[u]),u}function Qe(e){let{animateLayoutChanges:n=Me,attributes:t,disabled:r,data:s,getNewIndex:u=Pe,id:o,strategy:i,resizeObserverConfig:m,transition:f=je}=e;const{items:a,containerId:l,activeIndex:b,disabled:h,disableTransforms:k,sortedRects:w,overIndex:C,useDragOverlay:R,strategy:I}=p.useContext(J),S=_e(r,h),c=a.indexOf(o),g=p.useMemo(()=>({sortable:{containerId:l,index:c,items:a},...s}),[l,s,c,a]),d=p.useMemo(()=>a.slice(a.indexOf(o)),[a,o]),{rect:v,node:y,isOver:A,setNodeRef:L}=ke({id:o,data:g,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:d,...m}}),{active:D,activatorEvent:te,activeNodeRect:ne,attributes:re,setNodeRef:B,listeners:se,isDragging:$,over:oe,setActivatorNodeRef:ie,transform:ae}=ye({id:o,data:g,attributes:{...ze,...t},disabled:S.draggable}),le=we(L,B),T=!!D,G=T&&!k&&P(b)&&P(C),K=!R&&$,U=K&&G?ae:null,ce=G?U??(i??I)({rects:w,activeNodeRect:ne,activeIndex:b,overIndex:C,index:c}):null,O=P(b)&&P(C)?u({id:o,items:a,activeIndex:b,overIndex:C}):c,N=D?.id,x=p.useRef({activeId:N,items:a,newIndex:O,containerId:l}),ue=a!==x.current.items,X=n({active:D,containerId:l,isDragging:$,isSorting:T,id:o,index:c,items:a,newIndex:x.current.newIndex,previousItems:x.current.items,previousContainerId:x.current.containerId,transition:f,wasDragging:x.current.activeId!=null}),z=Fe({disabled:!X,index:c,node:y,rect:v});return p.useEffect(()=>{T&&x.current.newIndex!==O&&(x.current.newIndex=O),l!==x.current.containerId&&(x.current.containerId=l),a!==x.current.items&&(x.current.items=a)},[T,O,l,a]),p.useEffect(()=>{if(N===x.current.activeId)return;if(N!=null&&x.current.activeId==null){x.current.activeId=N;return}const fe=setTimeout(()=>{x.current.activeId=N},50);return()=>clearTimeout(fe)},[N]),{active:D,activeIndex:b,attributes:re,data:g,rect:v,index:c,newIndex:O,items:a,isOver:A,isSorting:T,isDragging:$,listeners:se,node:y,overIndex:C,over:oe,setNodeRef:le,setActivatorNodeRef:ie,setDroppableNodeRef:L,setDraggableNodeRef:B,transform:z??ce,transition:de()};function de(){if(z||ue&&x.current.newIndex===c)return $e;if(!(K&&!Re(te)||!f)&&(T||X))return H.Transition.toString({...f,property:Q})}}function _e(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}function j(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const Be=[E.Down,E.Right,E.Up,E.Left],Ze=(e,n)=>{let{context:{active:t,collisionRect:r,droppableRects:s,droppableContainers:u,over:o,scrollableAncestors:i}}=n;if(Be.includes(e.code)){if(e.preventDefault(),!t||!r)return;const m=[];u.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const b=s.get(l.id);if(b)switch(e.code){case E.Down:r.top<b.top&&m.push(l);break;case E.Up:r.top>b.top&&m.push(l);break;case E.Left:r.left>b.left&&m.push(l);break;case E.Right:r.left<b.left&&m.push(l);break}});const f=me({collisionRect:r,droppableRects:s,droppableContainers:m});let a=he(f,"id");if(a===o?.id&&f.length>1&&(a=f[1].id),a!=null){const l=u.get(t.id),b=u.get(a),h=b?s.get(b.id):null,k=b?.node.current;if(k&&h&&l&&b){const C=xe(k).some((d,v)=>i[v]!==d),R=Z(l,b),I=Ge(l,b),S=C||!R?{x:0,y:0}:{x:I?r.width-h.width:0,y:I?r.height-h.height:0},c={x:h.left,y:h.top};return S.x&&S.y?c:Ce(c,S)}}}};function Z(e,n){return!j(e)||!j(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function Ge(e,n){return!j(e)||!j(n)||!Z(e,n)?!1:e.data.current.sortable.index<n.data.current.sortable.index}function Ke(e){return{skillsConfig:De(e)}}function Ue(e){return e.repo.startsWith("system/")?["System"]:[]}function et(e,n){return e.filter(t=>!t.hidden&&!n.has(t.repo)).map(t=>({key:t.repo,name:t.name,description:t.description||t.instructions||"Add this skill to give the agent tools and capabilities.",badges:Ue(t)}))}function tt(e,n){const t=n.trim().toLowerCase();return t?e.filter(r=>r.name.toLowerCase().includes(t)||r.description.toLowerCase().includes(t)||r.key.toLowerCase().includes(t)):e}function Xe(e){const n=e.instructions?.trim();return{repo:e.repo,skillId:e.skillId,name:e.name,description:e.description,instructions:n,content:n||e.name,enabled:!0,system:e.repo.startsWith("system/")}}const ee=p.createContext(null);function nt({agentId:e,children:n}){const{data:t,isLoading:r}=ge(e),{data:s,isLoading:u}=pe(e),o=be(e),i=p.useMemo(()=>t?Ee(t,s?.catalog??[]):[],[t,s]),[m,f]=p.useState(null),a=m??i,l=p.useCallback(async(c,g)=>{if(!t)return F.error("Still loading agent settings — try again in a moment"),!1;try{const d=Ke(c);return await o.mutateAsync(d),F.success(g),!0}catch(d){return F.error(d instanceof Error?d.message:"Failed to save skills"),!1}},[t,o]),b=p.useCallback(c=>{const g=s?.catalog.find(d=>d.repo===c);g&&f(d=>{const v=d??i;return v.some(y=>y.repo===c)?v:[...v,Xe(g)]})},[i,s?.catalog]),h=p.useCallback(c=>{const g=c.name.trim();if(!g)return null;const d=`custom/${g.toLowerCase().replace(/[^a-z0-9-]/g,"-")}`,v=c.instructions.trim();return f(y=>{const A=y??i;return A.some(L=>L.repo===d)?A:[...A,{repo:d,skillId:g,name:g,instructions:v||void 0,content:v||g,enabled:!0}]}),d},[i]),k=p.useCallback((c,g)=>{f(d=>(d??i).map(v=>v.repo===c?{...v,...g}:v))},[i]),w=p.useCallback((c,g)=>{f(d=>{const v=d??i,y=v.findIndex(D=>D.repo===c),A=v.findIndex(D=>D.repo===g);if(y<0||A<0||y===A)return v;const L=_(v,y,A);return l(L,"Skill order updated"),L})},[l,i]),C=p.useCallback(async c=>{const g=a.filter(d=>d.repo!==c);return f(g),l(g,"Skill removed")},[l,a]),R=p.useCallback(async(c,g)=>{const d=a.map(v=>v.repo===c?{...v,enabled:g}:v);return f(d),l(d,g?"Skill enabled":"Skill disabled")},[l,a]),I=p.useCallback(async()=>{await l(a,"Skills saved")},[l,a]),S=p.useMemo(()=>({agentId:e,skillRows:a,catalog:s,isLoading:r||u,isSaving:o.isPending,addSkillFromCatalog:b,addCustomSkill:h,updateSkillRow:k,reorderSkills:w,removeSkillAndSave:C,setSkillEnabledAndSave:R,saveSkills:I}),[h,b,e,u,r,w,C,R,I,a,s,o.isPending,k]);return ve.jsx(ee.Provider,{value:S,children:n})}function rt(){const e=p.useContext(ee);if(!e)throw new Error("useAgentSkillEditor must be used within AgentSkillEditorProvider");return e}export{nt as A,Je as S,Ze as a,et as b,Qe as c,tt as f,Ue as s,rt as u,We as v};
|
|
2
|
+
//# sourceMappingURL=agent-skill-context-1DBn7Xc_.js.map
|
package/dist/owletto/dist/assets/{agent-skills-route-Bv5luNdw.js → agent-skills-route-d5jh3oBR.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as D,r as g,j as e,d6 as
|
|
2
|
-
//# sourceMappingURL=agent-skills-route-
|
|
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
|
package/dist/owletto/dist/assets/{agent-tab-intro-ednTs4WF.js → agent-tab-intro-DKrC3SQt.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,al as n,i as a}from"./index-
|
|
2
|
-
//# sourceMappingURL=agent-tab-intro-
|
|
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
|