@lobu/runtime-server 24.2.0 → 24.4.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 +24 -2
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/postgres.ts +9 -5
- package/dist/db/migrations/20261101010000_public_source_type_references.sql +157 -0
- package/dist/dependencies.bun.lock +117 -178
- package/dist/owletto/dist/assets/_-DIK0ae_S.js +2 -0
- package/dist/owletto/dist/assets/_-gTbcArpS.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DOmcJZfk.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DW6wRCVC.js +2 -0
- package/dist/owletto/dist/assets/_automationId-B9IcDYBu.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-C6PmMPTA.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-BrJ8Pzze.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-BpJAeYYW.js +2 -0
- package/dist/owletto/dist/assets/_eventId-DarQJo0G.js +2 -0
- package/dist/owletto/dist/assets/_name-DtmNTcUm.js +2 -0
- package/dist/owletto/dist/assets/_owner-Db8at3hk.js +3 -0
- package/dist/owletto/dist/assets/_shape-6iFA8A86.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CXkHn3Nl.js +2 -0
- package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-DBOuBLoX.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-DC27aIN9.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DuYDieln.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-BbDCVvur.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-V4ftmSN7.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-99mG6H5k.js} +2 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-kMmqQSrf.js +4 -0
- package/dist/owletto/dist/assets/agent-connect-pages-B-NPTFs6.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-DfMTSIvj.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-BvGgfd-h.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-Dnmb6W5Y.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CbhXlbgY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-V__2i6Vl.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-DFXr_bHp.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-DWzljvFb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-DQIr20H-.js} +4 -4
- package/dist/owletto/dist/assets/agents-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-C8bTa2rv.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
- package/dist/owletto/dist/assets/{app._appId-A51tx2jU.js → app._appId-Bsq40nak.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-C9Cgr5Zj.js} +2 -2
- package/dist/owletto/dist/assets/automations-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/calendar-DMq3Dtqy.js +2 -0
- package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-B-CAz-bK.js} +2 -2
- package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-SFtxv9f2.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-DrxIRWKt.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-boZOHuPW.js +2 -0
- package/dist/owletto/dist/assets/client-rows-BJ2PxM4J.js +2 -0
- package/dist/owletto/dist/assets/clients-C7Lnuc3S.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-rX0t1g5C.js} +2 -2
- package/dist/owletto/dist/assets/connect-BcwgytDV.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-BF-AlunU.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-sDypRDeN.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-C9OkW1tv.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dc6HYr55.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-C6qbqgwF.js +2 -0
- package/dist/owletto/dist/assets/connection-88YzIBK9.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-D7pnWaFB.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-DDJQh8Na.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DDX7Ebc4.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-Th8ymGec.js +2 -0
- package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-BibdzKl1.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BqwgLUUK.js} +2 -2
- package/dist/owletto/dist/assets/consent-BR5U7dwb.js +2 -0
- package/dist/owletto/dist/assets/{copy-button-kcjg8Giw.js → copy-button-2swYh4jb.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-CHnfRiEM.js} +2 -2
- package/dist/owletto/dist/assets/{create-CQE5rD0i.js → create-BsPVnRpG.js} +2 -2
- package/dist/owletto/dist/assets/create-CVPYVOR5.js +2 -0
- package/dist/owletto/dist/assets/create-QFjmhOEU.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DmCOFbRT.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLDDVtLS.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-CKwjNYgj.js} +2 -2
- package/dist/owletto/dist/assets/device-CKup7kvB.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-xGhCTU5_.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-B1H_ivDT.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-HloBoalJ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-BSW_EG0W.js +2 -0
- package/dist/owletto/dist/assets/entity-page-D-WDWrAe.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-BCBdFndu.js +2 -0
- package/dist/owletto/dist/assets/event-card-Mcxv56DG.js +2 -0
- package/dist/owletto/dist/assets/event-detail-DXifj49J.js +2 -0
- package/dist/owletto/dist/assets/events-feed-BysC9HgU.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-BQm-ubB1.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-BMiXl54z.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-D7W80sJO.js +2 -0
- package/dist/owletto/dist/assets/identity-N0cAO9BR.js +2 -0
- package/dist/owletto/dist/assets/index-4gCDI7m4.js +7950 -0
- package/dist/owletto/dist/assets/index-B4wXJwQY.js +2 -0
- package/dist/owletto/dist/assets/index-BNaI5GpS.js +2 -0
- package/dist/owletto/dist/assets/index-BUUrHuJJ.js +2 -0
- package/dist/owletto/dist/assets/index-BqrvJmLh.js +2 -0
- package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-C-WaHj1Y.js} +2 -2
- package/dist/owletto/dist/assets/index-CnvQEA5V.js +2 -0
- package/dist/owletto/dist/assets/index-Cq7P2c_E.js +2 -0
- package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-CzoK57xp.js} +2 -2
- package/dist/owletto/dist/assets/index-D3omC3Us.js +2 -0
- package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-D4-uel59.js} +2 -2
- package/dist/owletto/dist/assets/index-DDGdlQrt.css +1 -0
- package/dist/owletto/dist/assets/index-DFEW7hMg.js +2 -0
- package/dist/owletto/dist/assets/index-DVV-WWuT.js +2 -0
- package/dist/owletto/dist/assets/index-DduQ_e9q.js +2 -0
- package/dist/owletto/dist/assets/index-DutlI1d-.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-E5D-NGYT.js} +4 -4
- package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Bp4HNgJ9.js} +2 -2
- package/dist/owletto/dist/assets/login-7F48UJGx.js +2 -0
- package/dist/owletto/dist/assets/logout-DxmfsVKD.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-vp3FihBD.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-CfDmjhDl.js +74 -0
- package/dist/owletto/dist/assets/model-Dn40BUzs.js +2 -0
- package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-88PJnyTq.js} +2 -2
- package/dist/owletto/dist/assets/models-BBK_n2RP.js +2 -0
- package/dist/owletto/dist/assets/new-4ruWHLR5.js +2 -0
- package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-CvX8_gIb.js} +2 -2
- package/dist/owletto/dist/assets/new-gMD1PHTL.js +2 -0
- package/dist/owletto/dist/assets/oauth-workspace-access-D9BNmyMY.js +2 -0
- package/dist/owletto/dist/assets/organization-BHcp5Pzg.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-0sa10jER.js +2 -0
- package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-hhxosugv.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-B4CSiyLB.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-CsenJeXa.js +2 -0
- package/dist/owletto/dist/assets/record-activity-D7bRaMk2.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-CWXnCVln.js} +2 -2
- package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-7EGgTVX0.js} +30 -30
- package/dist/owletto/dist/assets/reset-password-CFUzxH7m.js +2 -0
- package/dist/owletto/dist/assets/runs-BPtQBTRN.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-Bj63_hb9.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-CAhOB648.js} +2 -2
- package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-Dg6nxKyw.js} +2 -2
- package/dist/owletto/dist/assets/settings-KJJ6WihO.js +2 -0
- package/dist/owletto/dist/assets/skills-ayt06_o2.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-Bh5F4C5K.js +2 -0
- package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-D3FoDRcc.js} +2 -2
- package/dist/owletto/dist/assets/table-DFcJRNk7.js +2 -0
- package/dist/owletto/dist/assets/use-automations-BHoV0dLs.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-C3rWLuKm.js} +2 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-Ct-jt7O0.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-mKoqDsaD.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-DHrDO333.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +100623 -98589
- package/npm-shrinkwrap.json +615 -960
- package/package.json +7 -10
- package/vendor/@better-auth-kysely-adapter/.bun-tag-abf95749a412716 +0 -0
- package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
- package/vendor/@better-auth-kysely-adapter/README.md +17 -0
- package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
- package/vendor/@better-auth-kysely-adapter/package.json +52 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/connector-sdk/dist/redact.js +130 -0
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +49 -20
- package/vendor/core/dist/contracts/tools/manage-entity.js +23 -5
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
- package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/index.d.ts +1 -0
- package/vendor/core/dist/index.js +4 -1
- package/vendor/core/dist/logger.js +8 -2
- package/vendor/core/dist/otel.d.ts +13 -2
- package/vendor/core/dist/otel.js +98 -44
- package/vendor/core/dist/trace-context.d.ts +12 -0
- package/vendor/core/dist/trace-context.js +50 -0
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/package.json +26 -5
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-Cjvw31gU.js +0 -2
- package/dist/owletto/dist/assets/_-iToIRRFt.js +0 -3
- package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +0 -2
- package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +0 -2
- package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +0 -2
- package/dist/owletto/dist/assets/_name-BsOZmvlH.js +0 -2
- package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +0 -3
- package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-_G_lDz5K.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-BgyLhJCo.js +0 -5
- package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +0 -2
- package/dist/owletto/dist/assets/agents-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/automations-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/client-activity-scopes-CmK3DkSP.js +0 -2
- package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +0 -2
- package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +0 -2
- package/dist/owletto/dist/assets/connection-DJd9bnEc.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-IO6G5QjL.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-bmBJJ9B4.js +0 -2
- package/dist/owletto/dist/assets/consent-C_WBfmQ8.js +0 -2
- package/dist/owletto/dist/assets/create-DQNlRTUX.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +0 -3
- package/dist/owletto/dist/assets/create-lOFSQV_5.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +0 -2
- package/dist/owletto/dist/assets/device-Br9JHadR.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +0 -2
- package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +0 -2
- package/dist/owletto/dist/assets/event-detail-C25TvOb_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +0 -2
- package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +0 -2
- package/dist/owletto/dist/assets/identity-BkK8ggdp.js +0 -2
- package/dist/owletto/dist/assets/index-Bw5iV_J7.js +0 -2
- package/dist/owletto/dist/assets/index-C3dpyynY.js +0 -2
- package/dist/owletto/dist/assets/index-C3zAbslo.js +0 -2
- package/dist/owletto/dist/assets/index-CGKN_WN_.js +0 -2
- package/dist/owletto/dist/assets/index-CgRaCOzW.js +0 -2
- package/dist/owletto/dist/assets/index-DfIoxD5Q.js +0 -2
- package/dist/owletto/dist/assets/index-DijuudSs.js +0 -2
- package/dist/owletto/dist/assets/index-Dr7bouPX.css +0 -1
- package/dist/owletto/dist/assets/index-JmEl29py.js +0 -7950
- package/dist/owletto/dist/assets/index-NK2VKPoL.js +0 -2
- package/dist/owletto/dist/assets/index-_5qsmBkt.js +0 -2
- package/dist/owletto/dist/assets/index-qkOKpRYs.js +0 -2
- package/dist/owletto/dist/assets/index-wzYkECAe.js +0 -2
- package/dist/owletto/dist/assets/login-XL5XxN6y.js +0 -2
- package/dist/owletto/dist/assets/logout-CMxdhLbM.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +0 -74
- package/dist/owletto/dist/assets/models-BAVaDnKN.js +0 -2
- package/dist/owletto/dist/assets/new-1QLuS1o-.js +0 -2
- package/dist/owletto/dist/assets/new-D21LGMl6.js +0 -2
- package/dist/owletto/dist/assets/oauth-workspace-access-D15LYKSe.js +0 -2
- package/dist/owletto/dist/assets/organization-CoUJYXx7.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CmLy1MZf.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +0 -2
- package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +0 -2
- package/dist/owletto/dist/assets/reset-password-Y-WO77iR.js +0 -2
- package/dist/owletto/dist/assets/runs-B0zVYb-w.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +0 -2
- package/dist/owletto/dist/assets/runs-table-9OVdfPXZ.js +0 -2
- package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +0 -2
- package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +0 -2
- package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c4 as it,c5 as ot,c6 as ct,c7 as L,c8 as rt,c9 as T,ca as O,cb as D,cc as lt,cd as F,ce as dt,cf as E,r as y,cg as ut,ch as mt,ci as xt,j as e,cj as ft,ck as ht,cl as B,be as W,cm as pt,B as N,a3 as gt,cn as jt,co as yt,o as bt,an as Nt,cp as R,bl as A,cq as vt,q as U,ak as kt,cr as _t,bx as K,aR as k,cs as It,ct as _,cu as $t,cv as V,L as b,cw as Ct,bh as At,a$ as Et,cx as Rt,cy as Mt,cz as M,cA as St,cB as wt,T as G,cC as Lt,cD as Tt,cE as Y,cF as Ot,u as Dt,cG as Ft,cH as Pt,b as q,cI as zt,cJ as Ht,b6 as Bt,cK as Wt,cL as Ut,at as Kt}from"./index-JmEl29py.js";import{R as Vt,E as Gt,S as Yt,N as P,M as qt}from"./record-activity-Doeu5kPO.js";import{M as Jt}from"./member-scope-gate-Dit3MXBQ.js";import{u as Qt}from"./client-activity-scopes-CmK3DkSP.js";import{a as Zt}from"./client-rows-fFuxzFtE.js";import{P as Xt}from"./public-shell-ready-_awBxu2Y.js";function te(s,t,r){const c=lt(),a=r?.locale??c.locale??rt,i=it(s,t);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,f]=ot(r?.in,...i>0?[t,s]:[s,t]),n=ct(r?.roundingMethod??"round"),d=f.getTime()-l.getTime(),x=d/F,m=L(f)-L(l),u=(d-m)/F,j=r?.unit;let h;if(j?h=j:x<1?h="second":x<60?h="minute":x<T?h="hour":u<O?h="day":u<D?h="month":h="year",h==="second"){const p=n(d/1e3);return a.formatDistance("xSeconds",p,o)}else if(h==="minute"){const p=n(x);return a.formatDistance("xMinutes",p,o)}else if(h==="hour"){const p=n(x/60);return a.formatDistance("xHours",p,o)}else if(h==="day"){const p=n(u/T);return a.formatDistance("xDays",p,o)}else if(h==="month"){const p=n(u/O);return p===12&&j!=="month"?a.formatDistance("xYears",1,o):a.formatDistance("xMonths",p,o)}else{const p=n(u/D);return a.formatDistance("xYears",p,o)}}function ee(s,t){return te(s,dt(s),t)}const ne=4e3;function se(s){if(s?.kind!=="browser"||!s.url)return null;try{return new URL(s.url).origin}catch{return null}}function ae(s,t){const r=se(t),{data:c=[]}=E(r?s:null),a=y.useMemo(()=>new Set(c.filter(l=>r&&l.browser?.origins.includes(r)).map(l=>l.key)),[c,r]),i=!!s&&a.size>0,{data:o=[]}=ut({...mt.queryOptions(s,{status:"active",enabled:i}),enabled:i,refetchInterval:l=>l.state.data?.some(f=>a.has(f.connector_key)&&f.active_runs>0)?ne:!1});return y.useMemo(()=>o.filter(l=>a.has(l.connector_key)&&l.operations.includes("sync")),[o,a])}function ie(s){return s.active_runs>0?{text:"Syncing…",failed:!1}:s.last_sync_status==="failed"&&s.last_error?{text:s.last_error,failed:!0}:s.last_sync_at?{text:`Last synced ${ee(new Date(s.last_sync_at),{addSuffix:!0})}.`,failed:!1}:{text:"Not synced yet. Sync while you're signed in.",failed:!1}}function oe({organizationId:s,feeds:t}){const{data:r=[]}=E(s),c=xt();return t.length===0?null:e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx("ul",{className:"space-y-1",children:t.map(a=>{const i=ie(a),o=a.active_runs>0||c.isPending&&c.variables===a.id,l=[a.connection_name??a.connector_name??a.connector_key,a.display_name??a.feed_key].join(" · ");return e.jsx("li",{className:"rounded-lg bg-primary/5 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ft,{className:ht,children:e.jsx(B,{source:{platform:a.connector_key},connectorDefinitions:r,label:l,fallback:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"line-clamp-2 min-w-0 text-sm font-medium",children:l}),e.jsx("p",{className:i.failed?"mt-1 line-clamp-3 text-sm text-destructive":"mt-1 text-sm text-muted-foreground",children:i.text}),e.jsx(pt,{tag:"This page",children:a.device_label?`Connection · ${a.device_label}`:"Connection"}),e.jsx("div",{className:"mt-2",children:e.jsxs(N,{type:"button",size:"sm",variant:i.failed?"default":"outline",className:"h-7 text-xs",disabled:o,onClick:()=>c.mutate(a.id),children:[o?e.jsx(gt,{size:"sm",className:"mr-1"}):e.jsx(jt,{className:"mr-1 h-3 w-3"}),o?"Syncing":i.failed?"Try again":"Sync now"]})})]})]})},a.id)})})})}function ce({organizationId:s,ownerSlug:t,typeScope:r,entityScope:c,attentionOnly:a=!1}){const i=yt(),o=ae(s,i),{orgContext:l}=bt(),{isMember:f,isLoading:n}=Nt(),d=f&&!!s,{attentionItems:x,isError:m}=R(t),u=r?A(r):void 0,j=!c&&!u,h=y.useMemo(()=>x.map(g=>({item:g,onPage:i?vt(g,i):!1})).sort((g,w)=>Number(w.onPage)-Number(g.onPage)||w.item.at-g.item.at),[x,i]),p=y.useMemo(()=>h.filter(({onPage:g})=>g),[h]),Q=y.useMemo(()=>new Set(p.flatMap(({item:g})=>g.approvalRunId!=null?[g.approvalRunId]:[])),[p]),Z=U(),X=()=>void Z({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:I,isLoading:$,error:tt}=kt(c?`/${t}/${_t(c)}`:`/${t}`,l),C=c?I?.entity:void 0,et=(c?C?.entity_type??A(c.split("/").at(-2)??""):u)==="$member",nt=c!=null&&!$&&(tt!=null||I?.entity==null),v=c?void 0:I?.counts,st=v?v.connections>0||v.agents>0:!1,at=d&&!n&&!$&&v!=null&&!st,S=c&&$?e.jsx(K,{label:"Loading record…"}):nt?e.jsx(k,{icon:It,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):a&&j?e.jsx(re,{owner:t,items:h,isError:m}):C?e.jsx(Vt,{ownerSlug:t,entity:C,organizationId:s}):e.jsx(Gt,{organizationId:s,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:u?[u]:void 0,pinned:j&&(p.length>0||o.length>0)?{rows:e.jsxs(e.Fragment,{children:[e.jsx(oe,{organizationId:s,feeds:o}),p.length>0?e.jsx("ul",{className:"space-y-1",children:p.map(({item:g})=>e.jsx("li",{children:e.jsx(_,{owner:t,item:g,tone:"relevant",tag:"This page"})},g.id))}):null]}),hiddenApprovalRunIds:Q}:void 0,onShowNotifications:j?X:void 0,emptyState:at?e.jsx(de,{ownerSlug:t}):void 0});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:et?e.jsx(Jt,{children:S}):S})}function re({owner:s,items:t,isError:r}){const c=U();return e.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[e.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),e.jsx(le,{owner:s}),e.jsx(Yt,{value:P.value,withNotifications:!0,onChange:a=>{if(a===P.value)return;const[i,o]=a.split("-");c({to:"/$owner",params:{owner:s},search:$t({sortBy:i,sortOrder:o})})}})]}),r?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?e.jsx(k,{icon:V,title:"All caught up",description:"Nothing needs you right now.",children:e.jsx(N,{asChild:!0,variant:"outline",className:"mt-4",children:e.jsx(b,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):e.jsx("ul",{className:"space-y-1",children:t.map(({item:a,onPage:i})=>e.jsx("li",{children:e.jsx(_,{owner:s,item:a,tone:i?"relevant":"default",tag:i?"This page":void 0})},a.id))})]})}function le({owner:s}){const{visibleUnreadIds:t,markVisibleRead:r,bulkPending:c}=R(s);return t.length===0?null:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:c,onClick:()=>void r(),children:[e.jsx(V,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function de({ownerSlug:s}){return e.jsx("div",{className:"px-6",children:e.jsx(k,{icon:Ct,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(N,{asChild:!0,children:e.jsxs(b,{to:"/$owner/connectors/create",params:{owner:s},children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(N,{asChild:!0,variant:"outline",children:e.jsxs(b,{to:"/$owner/agents",params:{owner:s},children:[e.jsx(At,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const z=12,ue=5e3;function me(s,t){const r=!!s&&!!t.organizationId&&(t.enabled??!0),c=Et({enabled:r}),{data:a}=c,i=a??[],o=y.useMemo(()=>i.map(u=>u.agentId),[i]),{threads:l,isLoading:f,isError:n}=Rt(s,o,{enabled:r&&o.length>0,limit:z}),d=Qt({enabled:r,limit:z,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:u=>u?ue:!1}),x=t.organizationId?d.data:void 0;return{items:y.useMemo(()=>[...l.map(u=>({kind:"conversation",at:u.updatedAt,thread:u})),...(x??[]).map(u=>({kind:"mcp",at:u.lastCallAt,conversation:u}))].sort((u,j)=>j.at-u.at),[x,l]),agents:i,isLoading:r&&(c.isLoading||f||d.isLoading),isError:c.isError||n||d.isError}}function xe(s){return s==="attention"?{attention:"1"}:s==="all"?{}:{tab:s}}function fe(s,t,r,c=[]){const a=new Map(c.map(n=>[n.id,n])),i=new Map;for(const n of[...t.filter(d=>d.kind==="notification"),...r])i.set(n.notification_id!=null?`n:${n.notification_id}`:n.id,n);const o=new Set([...i.values()].flatMap(n=>n.run_id!=null?[n.run_id]:[])),l=new Map,f=new Set(t.flatMap(n=>n.kind==="automation_due"&&n.run_id!=null?[n.run_id]:[]));for(const n of[...t.filter(d=>d.kind!=="notification"&&(d.kind==="automation_due"||d.run_id==null||!f.has(d.run_id))&&(d.run_id==null||!o.has(d.run_id))),...i.values()])l.set(n.id,n);return[...l.values()].map(n=>{const d=n.connection_id!=null?a.get(n.connection_id):void 0,x={...n,platform:n.platform||d?.connector_key,connection_name:n.connection_name||d?.display_name},m=n.kind==="notification"?"notification":n.kind==="sync"?"feed":n.kind==="automation_run"||n.kind==="automation_due"?"automation":"run",u=m==="automation"&&n.automation_id!=null?`automation:${n.automation_id}`:(m==="feed"||m==="run")&&n.connection_id!=null?`connection:${n.connection_id}`:null;return{id:n.id,at:new Date(n.at).getTime(),title:n.title,detail:n.kind==="run"&&n.status&&!M(n.status)?n.status:n.body||n.status,kind:m,subject:u,subjectLabel:n.automation_name||x.connection_name||n.title,href:m!=="notification"&&n.run_id!=null?m==="automation"&&n.automation_id!=null?`/${s}/automations/${n.automation_id}?run_id=${n.run_id}`:`/${s}/events?run_ids=${n.run_id}`:n.href,card:n,source:x}})}function he(s,t,r){return t.map(c=>{if(c.kind==="mcp"){const n=c.conversation,d=s==="me"||n.organizationId==null?"/me/events":`/${s}/agents/connected/${encodeURIComponent(n.clientId)}/activity`,x=new URLSearchParams({mcp_activity_id:n.activityId});return(s==="me"||n.organizationId==null)&&x.set("client_ids",n.clientId),{id:`client:${n.clientId}:${n.activityId}`,at:c.at,title:Zt(n),detail:`${n.clientName||"Connected app"} · ${n.callCount} ${n.callCount===1?"call":"calls"}${n.isLive?" · Active":""}`,href:`${d}?${x}`,kind:"session",subject:`client:${n.clientId}`,subjectLabel:n.clientName||"Connected app",source:{client_id:n.clientId,client_name:n.clientName}}}const a=c.thread,i=r.get(a.agentId)||"Agent",o=a.platform||"web",l=Mt(s,a.agentId,a.id),f=o==="web"?Object.entries(l.params).reduce((n,[d,x])=>n.replace(`$${d}`,encodeURIComponent(x)),l.to):`/${s}/agents/${encodeURIComponent(a.agentId)}/conversations/${encodeURIComponent(a.conversationId??a.id)}`;return{id:`thread:${a.agentId}:${a.id}`,at:c.at,title:a.title||"Conversation",detail:`${i} · ${o==="web"?"Chat":o}${a.isRunning?" · Active":""}`,href:f,kind:"session",subject:`agent:${a.agentId}`,subjectLabel:i,source:{agent_id:a.agentId,agent_name:i,platform:o==="web"?null:o}}})}function pe(s){const t=new Map;for(const r of[...s].sort((c,a)=>a.at-c.at||c.id.localeCompare(a.id))){const c=new Date(r.at),a=`${c.getFullYear()}-${c.getMonth()}-${c.getDate()}`,i=r.subject?`${r.kind}:${r.subject}:${a}`:r.id,o=t.get(i)??{key:i,entries:[]};o.entries.push(r),t.set(i,o)}return[...t.values()]}const ge=[{view:"all",label:"All activity"},{view:"attention",label:"Needs attention"},{view:"sessions",label:"Sessions"},{view:"feeds",label:"Feeds"},{view:"automations",label:"Automations"}];function je({owner:s,view:t,organizationId:r}){const{data:c=[]}=E(r),{data:a=[]}=St(t==="all"||t==="feeds"||t==="automations"?r:null),i=R(s),o=me(s,{organizationId:r,enabled:t==="all"||t==="sessions"}),l=wt(t==="attention"||t==="sessions"?null:s,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),f=y.useMemo(()=>{const m=new Map(o.agents.map(h=>[h.agentId,h.name])),u=t==="all"||t==="sessions"?he(s,o.items,m):[],j=t==="attention"?[]:fe(s,[...l.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],a);return pe([...j,...u])},[s,t,o.agents,o.items,l.data,a,i.attentionCards,i.notificationCards]),n=r==null||(t==="attention"?i.isLoading:t!=="sessions"&&l.isLoading||(t==="all"||t==="sessions")&&o.isLoading||t==="all"&&i.isLoading),d=t==="attention"?i.isError:t!=="sessions"&&l.isError||(t==="all"||t==="sessions")&&o.isError||t==="all"&&i.isError,x=t==="attention"?i.attentionItems.length===0:f.length===0;return e.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Home"}),e.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap gap-x-3 gap-y-2 border-b pb-2",children:ge.map(({view:m,label:u})=>e.jsxs(b,{to:"/$owner",params:{owner:s},search:xe(m),activeOptions:{exact:!0},"aria-current":t===m?"page":void 0,className:G("py-1 text-[13px] transition-colors",t===m?"font-medium text-foreground underline decoration-primary decoration-2 underline-offset-[13px]":"text-muted-foreground hover:text-foreground"),children:[u,m==="attention"&&i.attentionItems.length>0?e.jsx("span",{className:"ml-1.5 text-xs tabular-nums",children:i.attentionItems.length}):null]},m))}),t==="attention"?e.jsx(Lt,{owner:s}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent activity · newest first"}),d?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,n&&x?e.jsx(K,{label:"activity"}):x?d?null:e.jsx(k,{icon:Tt,title:t==="attention"?"All caught up":"No recent activity",description:t==="attention"?"Nothing needs you right now.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?e.jsx("ul",{className:"space-y-1",children:i.attentionItems.map(m=>e.jsx("li",{children:e.jsx(_,{owner:s,item:m})},m.id))}):e.jsx("ul",{className:"divide-y divide-border/60",children:f.map(m=>e.jsx("li",{children:e.jsx(ye,{owner:s,group:m,connectorDefinitions:c})},m.key))}),!x&&t!=="attention"?e.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[t==="all"||t==="feeds"?e.jsx(b,{to:"/$owner/connectors",params:{owner:s},children:"Browse feeds"}):null,t==="all"||t==="automations"?e.jsx(b,{to:"/$owner/automations",params:{owner:s},children:"Automation history"}):null,t==="sessions"?e.jsx(b,{to:"/$owner/agents",params:{owner:s},children:"Browse agents and apps"}):null]}):null]})}function ye({owner:s,group:t,connectorDefinitions:r}){const[c,a]=y.useState(!1),i=y.useId(),o=t.entries[0];if(t.entries.length===1)return e.jsx(H,{owner:s,entry:o,connectorDefinitions:r});const l=t.entries.filter(n=>M(n.card?.status??"")).length,f=o.kind==="session"?"sessions":o.kind==="feed"?"syncs":o.kind==="run"?"operations":"runs";return e.jsxs("div",{children:[e.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":i,onClick:()=>a(!c),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[e.jsx(J,{entry:o,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:o.subjectLabel}),e.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",f,l>0?e.jsxs("span",{className:"text-destructive",children:[" · ",l," failed"]}):null,o.kind==="session"?null:` · ${o.detail??""}`]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(o.at)}),e.jsx(Ot,{"aria-hidden":!0,className:G("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-180")})]}),e.jsxs("ul",{id:i,hidden:!c,className:"ml-4 border-l pl-3",children:[c?t.entries.map(n=>e.jsx("li",{children:e.jsx(H,{owner:s,entry:n,connectorDefinitions:r})},n.id)):null,c&&o.card?.href?e.jsx("li",{children:e.jsx(be,{entry:o})}):null]})]})}function be({entry:s}){const t=q(s.card?.href??"");return e.jsx(b,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:s.kind==="automation"?"View Automation history":"View connection history"})}function J({entry:s,connectorDefinitions:t}){const r=s.kind==="session"?zt:s.kind==="feed"?Ht:s.kind==="automation"?Bt:Wt;return e.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:e.jsx(B,{source:s.source,connectorDefinitions:t,label:s.subjectLabel,fallback:e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})})})}function H({owner:s,entry:t,connectorDefinitions:r}){const c=Dt();if(t.kind==="notification"&&t.card)return e.jsx(_,{owner:s,item:Ft({...t.card,...t.source})});const a=e.jsxs(e.Fragment,{children:[e.jsx(J,{entry:t,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[M(t.card?.status??"")?e.jsx(Pt,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,e.jsx("span",{className:"truncate",children:t.detail})]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(t.at)})]}),i="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return e.jsx("div",{className:i,children:a});const o=q(t.href);return e.jsx(b,{to:o.pathname,search:o.search,className:i,onClick:l=>{!c||!t.card||t.kind==="session"||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0||(l.preventDefault(),c.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:s,sourceAttribution:t.source??t.card}))},children:a})}function Ae({owner:s,search:t,entityScope:r,home:c=!1}){const a=typeof t.type=="string"&&t.type.trim()?A(t.type.trim()):void 0,i=typeof t.tab=="string"?t.tab:"events",o=i==="sessions"||i==="feeds"||i==="automations"?i:"events",l=String(t.attention)==="1",f=Object.entries(t).some(([n,d])=>(Ut.includes(n)||n.startsWith("clf_"))&&d!=null&&d!=="");return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Xt,{}),e.jsx(Kt,{owner:s,children:n=>e.jsx(qt,{organizationId:n.organizationId,isWorkspaceLoading:n.isWorkspaceLoading,children:e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:(c||o!=="events")&&!f&&!a&&!r?e.jsx(je,{owner:n.ownerSlug,organizationId:n.organizationId,view:l?"attention":o==="events"?"all":o}):e.jsx(ce,{organizationId:n.organizationId,ownerSlug:n.ownerSlug,typeScope:a,entityScope:r,attentionOnly:l})})})})]})}export{Ae as A};
|
|
2
|
-
//# sourceMappingURL=activity-route-view-_G_lDz5K.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as o,L as u,bi as c}from"./index-JmEl29py.js";const d="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function a(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function l(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return a(t)?n:`${n} --url ${t}`}const i=[{id:"claude-code",label:"Claude Code",tagline:"Shared plugin with Lobu MCP and workspace skills",description:"Connect Claude Code to shared workspace context and governed actions through Lobu's native plugin setup.",installTitle:"Run in your terminal",installText:e=>l("claude-code",e),steps:e=>a(e)?["The CLI adds Lobu's marketplace and installs the shared plugin.","Start a fresh Claude Code session.","Use a Lobu tool, choose this workspace, and complete OAuth when prompted."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill.","Start a fresh Claude Code session and complete OAuth when prompted."],guideLinks:[{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"Add Lobu as a custom ChatGPT connector, or connect the Codex coding agent through the CLI — both reach this workspace with your existing Lobu access.",installTitle:"Pick a surface",installText:e=>["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${l("codex",e)}`].join(`
|
|
2
|
-
`),steps:e=>["ChatGPT web: turn on developer mode under Settings -> Security -> Developer mode (custom connectors need it).",`ChatGPT web: open Settings -> Connectors -> Create connector, name it Lobu, and use ${e} with OAuth.`,"ChatGPT web: scan tools, complete Lobu sign-in, and start a new chat with Lobu enabled.",...a(e)?["Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"claude-desktop",label:"Claude Desktop",tagline:"Custom MCP connector with Lobu OAuth",description:"Add Lobu as a custom Claude Desktop connector and authorize the workspace with your existing Lobu access.",installTitle:"Add from Claude settings",installText:e=>["Open Settings -> Connectors -> Add Custom Connector","Name: Lobu",`MCP URL: ${e}`].join(`
|
|
3
|
-
`),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],h={codex:"chatgpt"};function b(e){const t=h[e]??e;return i.find(n=>n.id===t)}function g(e){const{workspaceName:t,owner:n,mcpUrl:s,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${s}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${d}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
4
|
-
`)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function C({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:i.map((n,s)=>o.jsxs(u,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:p(s,i.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(c,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{C as A,g as b,b as f};
|
|
5
|
-
//# sourceMappingURL=agent-client-setup-list-BgyLhJCo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{K as d,j as e,aC as j,gd as b,aS as y,ge as v,L as m,gf as A,i as L,r as w,hD as k,hV as x,B as S,A as P,bi as g}from"./index-JmEl29py.js";import{A as R,f as I,b as M}from"./agent-client-setup-list-BgyLhJCo.js";import{C as f}from"./copy-button-kcjg8Giw.js";import{u as $,g as B,c as U}from"./client-rows-fFuxzFtE.js";function _(t){const n=t?`/mcp/${t}`:"/mcp";if(!d)return`http://localhost:8787${n}`;try{const s=new URL(d);return s.pathname=n,s.toString()}catch{return`${d}${n}`}}const p="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function E(t,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 ${t===n-1?"":"border-b"}`}function N({owner:t}){return e.jsx(v,{crumbs:[e.jsx(m,{to:"/$owner/agents",params:{owner:t},className:A,children:"Agents"},"agents")]})}function K({owner:t}){return e.jsx("div",{className:p,children:e.jsxs(j,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(b,{breadcrumb:e.jsx(N,{owner:t}),icon:e.jsx(y.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(R,{owner:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Local Automation delivery is separate and is not enabled by connecting an agent."})]})})}function W({owner:t,clientId:n}){const s=I(n),{data:C}=L(t,{slug:t}),{data:h=[]}=$(null,{refetchInterval:2500}),r=w.useMemo(()=>B(h).filter(a=>a.connected),[h]);if(!s)return e.jsx("div",{className:p,children:e.jsxs(j,{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(m,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const l=_(t),c=M({workspaceName:C?.workspace?.name??t,owner:t,mcpUrl:l,clientLabel:s.id==="other"?void 0:s.label,terminalLogin:s.terminalLogin}),o=s.setupMode==="agent-prompt",u=o?c:s.installText?.(l)??c;return e.jsx("div",{className:p,children:e.jsxs(k,{header:e.jsx(b,{breadcrumb:e.jsx(N,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(g,{name:s.label})}),title:s.label,caption:s.description}),children:[e.jsx(x,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.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:u}),e.jsx(f,{text:u,label:o?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:s.steps(l).map((a,i)=>e.jsxs("li",{children:[i+1,". ",a]},a))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[o?null:e.jsx(f,{text:c,label:"Copy setup prompt"}),s.guideLinks.map(a=>e.jsx(S,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:a.href,target:"_blank",rel:"noreferrer",children:[a.label,e.jsx(P,{className:"ml-1.5 h-3.5 w-3.5"})]})},a.href))]})]})}),e.jsx(x,{title:"Connected agents",count:r.length>0?String(r.length):void 0,children:r.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:r.map((a,i)=>e.jsxs(m,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:a.clientId},className:E(i,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(g,{name:a.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:a.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:U(a)})]})]},a.key))})}),e.jsx(x,{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:l})]})})]})})}export{K as A,W as a};
|
|
2
|
-
//# sourceMappingURL=agent-connect-pages-BryZas7Z.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as y,j as e,E as w,I as k,bn as Q,bo as X,bp as Y,bq as ee,br as ae,fP as te,B as S,q as F,gm as G,j1 as T,j2 as U,h6 as B,fh as se,bH as f,gt as I,bx as ne,bK as re,aR as D,gv as ie,er as oe,es as le,et as M,eu as E,ex as de,ey as R,Q as ue,iA as ce,bz as q,d3 as me,T as $,i$ as ge}from"./index-JmEl29py.js";import{M as he}from"./model-selector-BeFuFH7p.js";import{a as xe,A as J}from"./agent-subpage-shell-D49f-bzP.js";import{f as pe}from"./agent-loading-shells-jkf9DjdO.js";import{A as je}from"./agent-card-controls-ColL5rdd.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 z({initial:a,judgeModelDefault:t,submitLabel:n,submitting:s,onSubmit:o,onCancel:r}){const[i,d]=y.useState(a?.name??""),[h,b]=y.useState(a?.stage??"input"),[x,N]=y.useState(a?.policy??""),[p,C]=y.useState(a?.model??""),[j,u]=y.useState((a?.tools??[]).join(", ")),[l,m]=y.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",K=c=>{c.preventDefault();const _=j.split(",").map(L=>L.trim()).filter(Boolean);o({name:i,stage:h,...g?{kind:g}:{},policy:x,model:p.trim()||void 0,tools:(v||h==="pre-tool")&&_.length>0?_:void 0,domains:h==="egress"&&l.trim()?l.split(",").map(L=>L.trim()).filter(Boolean):void 0,enabled:a?.enabled??!0})};return e.jsxs("form",{onSubmit:K,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(Q,{value:h,onValueChange:c=>b(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:j,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:x,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(he,{value:p,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:j,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 H(a){return a.kind==="require-tool"}function W(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.`:H(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 V(a){const t=H(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 be(a,t){return[...a,V(t)]}function ve(a,t,n){return a.map(s=>s.name===t?V(n):s)}function ye(a,t){return a.filter(n=>n.name!==t)}function Ne(a,t,n){return a.map(s=>s.name===t?{...s,enabled:n}:s)}function Ce({owner:a,agentId:t}){const n=F(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=T(t),{data:d=null,isLoading:h}=U(t),b=o||i||h,x=B(t),N=s?.guardrailsInline??[],p=(r??[]).map(u=>u.name),C=async u=>{if(!s){f.error("Still loading agent settings — try again in a moment");return}const l=W(u,N,p,d);if(l){f.error(l);return}try{await x.mutateAsync({guardrailsInline:be(N,u)}),f.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){f.error(m instanceof Error?m.message:"Failed to create guardrail")}},j=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(xe,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),b?e.jsx(se,{rows:4}):e.jsx(z,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:x.isPending,onSubmit:C,onCancel:j})]})}function P(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 we(a){return a.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function Se(a,t,n){return we(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 ke(a){const t=new Date(a);return Number.isNaN(t.getTime())?a:ce(t,{addSuffix:!0})}function Ae({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=T(t),r=y.useMemo(()=>P(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(Ge,{agentId:t,name:n,row:r}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Ge({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=F(),{data:o}=G(t),{data:r}=T(t),{data:i=null}=U(t),d=B(t),[h,b]=y.useState(!1),x=o?.guardrailsInline??[],N=(r??[]).map(u=>u.name),p=async(u,l)=>{if(!o)return f.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),f.success(l),!0}catch(m){return f.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=W(u,x,N,i,n.name);if(l){f.error(l);return}await p(ve(x,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())}})},j=async()=>{await p(ye(x,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(z,{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 j(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>b(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(S,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>b(!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(oe,{children:[e.jsx(le,{children:e.jsxs(M,{children:[e.jsx(E,{className:"w-[180px]",children:"When"}),e.jsx(E,{className:"w-[120px]",children:"Stage"}),e.jsx(E,{children:"Reason"})]})}),e.jsx(de,{children:n.map(r=>e.jsxs(M,{children:[e.jsx(R,{className:"text-xs text-muted-foreground",title:r.occurredAt,children:ke(r.occurredAt)}),e.jsx(R,{children:e.jsx(ue,{variant:"outline",className:"text-[10px]",children:A[r.stage]})}),e.jsx(R,{className:"text-sm text-muted-foreground",children:r.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},r.id))})]})})]})}function Le({description:a,action:t}){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-center text-sm text-muted-foreground",children:a}),t?e.jsx("div",{className:"shrink-0",children:t}):null]})}function O(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:O(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:O(n,r.name)}});return[...s,...o]}function Re({owner:a,agentId:t,expandedName:n}){const s=F(),{data:o,isLoading:r}=G(t),{data:i,isLoading:d}=T(t),{data:h=[]}=I(t),b=B(t),x=async(l,m)=>{if(!o){f.error("Still loading agent settings — try again in a moment");return}try{if(l.kind==="custom")await b.mutateAsync({guardrailsInline:Ne(o.guardrailsInline??[],l.name,m)});else{const g=P(o,i??[]);await b.mutateAsync({guardrails:Se(g,l.name,m)})}f.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){f.error(g instanceof Error?g.message:"Failed to save guardrail")}},N=i===null,p=y.useMemo(()=>{const l=P(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)}})},j=()=>{s({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:a,agentId:t}})},u=r||d;return!u&&p.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:j}):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:j})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(Le,{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:j,children:[e.jsx(me,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(pe,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:p.map((l,m)=>{const g=l.name===n;return e.jsx($e,{card:l,expanded:g,isLast:m===p.length-1,onToggle:()=>C(l.name),onToggleEnabled:v=>void x(l,v),toggleDisabled:l.unknown||b.isPending,children:g?e.jsx(Ae,{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:$("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:$("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:$("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(ge,{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(Ce,{owner:a,agentId:t})})}function Oe({owner:a,agentId:t,name:n}){return e.jsx(De,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{De as A,Me as a,Oe as b};
|
|
2
|
-
//# sourceMappingURL=agent-guardrails-route-D9PpDgR-.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h9 as he,ha as Pe,r as a,hb as me,j as r,fW as A,hc as h,hd as K,he as De,gq as Ae,hf as xe,hg as Sn,hh as Pn,hi as Ne,hj as re,hk as Dn,hl as An,hm as Nn,hn as Tn,ho as jn,hp as kn,hq as On,hr as Fn,hs as Ln,ht as Gn,hu as Te,T as $,cF as $n,q as je,s as Kn,k as ke,an as Oe,a$ as Fe,hv as Un,hw as Bn,bQ as Wn,hx as Vn,hy as Yn,ge as Hn,L as ne,gf as fe,O as Xn,o as Le,fb as zn,ak as qn}from"./index-JmEl29py.js";import{A as Qn}from"./agent-editor-form-C24p9LLg.js";import{P as Zn}from"./proposal-review-shell-CmLy1MZf.js";var pe="rovingFocusGroup.onEntryFocus",Jn={bubbles:!1,cancelable:!0},z="RovingFocusGroup",[ge,Ge,et]=Pe(z),[nt,$e]=he(z,[et]),[tt,ot]=nt(z),Ke=a.forwardRef((e,t)=>r.jsx(ge.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(ge.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(rt,{...e,ref:t})})}));Ke.displayName=z;var rt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:p,onEntryFocus:f,preventScrollOnEntryFocus:u=!1,...i}=e,g=a.useRef(null),w=K(t,g),v=De(c),[M,x]=Ae({prop:d,defaultProp:l??null,onChange:p,caller:z}),[C,S]=a.useState(!1),_=xe(f),I=Ge(n),P=a.useRef(!1),[Z,N]=a.useState(0);return a.useEffect(()=>{const b=g.current;if(b)return b.addEventListener(pe,_),()=>b.removeEventListener(pe,_)},[_]),r.jsx(tt,{scope:n,orientation:o,dir:v,loop:s,currentTabStopId:M,onItemFocus:a.useCallback(b=>x(b),[x]),onItemShiftTab:a.useCallback(()=>S(!0),[]),onFocusableItemAdd:a.useCallback(()=>N(b=>b+1),[]),onFocusableItemRemove:a.useCallback(()=>N(b=>b-1),[]),children:r.jsx(A.div,{tabIndex:C||Z===0?-1:0,"data-orientation":o,...i,ref:w,style:{outline:"none",...e.style},onMouseDown:h(e.onMouseDown,()=>{P.current=!0}),onFocus:h(e.onFocus,b=>{const F=!P.current;if(b.target===b.currentTarget&&F&&!C){const T=new CustomEvent(pe,Jn);if(b.currentTarget.dispatchEvent(T),!T.defaultPrevented){const U=I().filter(D=>D.focusable),B=U.find(D=>D.active),J=U.find(D=>D.id===M),ue=[B,J,...U].filter(Boolean).map(D=>D.ref.current);We(ue,u)}}P.current=!1}),onBlur:h(e.onBlur,()=>S(!1))})})}),Ue="RovingFocusGroupItem",Be=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:c,children:d,...l}=e,p=me(),f=c||p,u=ot(Ue,n),i=u.currentTabStopId===f,g=Ge(n),{onFocusableItemAdd:w,onFocusableItemRemove:v,currentTabStopId:M}=u;return a.useEffect(()=>{if(o)return w(),()=>v()},[o,w,v]),r.jsx(ge.ItemSlot,{scope:n,id:f,focusable:o,active:s,children:r.jsx(A.span,{tabIndex:i?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:h(e.onMouseDown,x=>{o?u.onItemFocus(f):x.preventDefault()}),onFocus:h(e.onFocus,()=>u.onItemFocus(f)),onKeyDown:h(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const C=ct(x,u.orientation,u.dir);if(C!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=g().filter(I=>I.focusable).map(I=>I.ref.current);if(C==="last")_.reverse();else if(C==="prev"||C==="next"){C==="prev"&&_.reverse();const I=_.indexOf(x.currentTarget);_=u.loop?it(_,I+1):_.slice(I+1)}setTimeout(()=>We(_))}}),children:typeof d=="function"?d({isCurrentTabStop:i,hasTabStop:M!=null}):d})})});Be.displayName=Ue;var st={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function at(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ct(e,t,n){const o=at(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return st[o]}function We(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function it(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var ut=Ke,dt=Be,ve=["Enter"," "],lt=["ArrowDown","PageUp","Home"],Ve=["ArrowUp","PageDown","End"],ft=[...lt,...Ve],pt={ltr:[...ve,"ArrowRight"],rtl:[...ve,"ArrowLeft"]},mt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},q="Menu",[H,gt,vt]=Pe(q),[k,Ye]=he(q,[vt,Ne,$e]),se=Ne(),He=$e(),[ht,O]=k(q),[xt,Q]=k(q),Xe=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:s,onOpenChange:c,modal:d=!0}=e,l=se(t),[p,f]=a.useState(null),u=a.useRef(!1),i=xe(c),g=De(s);return a.useEffect(()=>{const w=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),a.useEffect(()=>{if(!n)return;const w=()=>i(!1);return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[n,i]),r.jsx(Sn,{...l,children:r.jsx(ht,{scope:t,open:n,onOpenChange:i,content:p,onContentChange:f,children:r.jsx(xt,{scope:t,onClose:a.useCallback(()=>i(!1),[i]),isUsingKeyboardRef:u,dir:g,modal:d,children:o})})})};Xe.displayName=q;var wt="MenuAnchor",we=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,s=se(n);return r.jsx(Pn,{...s,...o,ref:t})});we.displayName=wt;var Me="MenuPortal",[Mt,ze]=k(Me,{forceMount:void 0}),qe=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:s}=e,c=O(Me,t);return r.jsx(Mt,{scope:t,forceMount:n,children:r.jsx(re,{present:n||c.open,children:r.jsx(Dn,{asChild:!0,container:s,children:o})})})};qe.displayName=Me;var E="MenuContent",[Ct,Ce]=k(E),Qe=a.forwardRef((e,t)=>{const n=ze(E,e.__scopeMenu),{forceMount:o=n.forceMount,...s}=e,c=O(E,e.__scopeMenu),d=Q(E,e.__scopeMenu);return r.jsx(H.Provider,{scope:e.__scopeMenu,children:r.jsx(re,{present:o||c.open,children:r.jsx(H.Slot,{scope:e.__scopeMenu,children:d.modal?r.jsx(_t,{...s,ref:t}):r.jsx(bt,{...s,ref:t})})})})}),_t=a.forwardRef((e,t)=>{const n=O(E,e.__scopeMenu),o=a.useRef(null),s=K(t,o);return a.useEffect(()=>{const c=o.current;if(c)return An(c)},[]),r.jsx(_e,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bt=a.forwardRef((e,t)=>{const n=O(E,e.__scopeMenu);return r.jsx(_e,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rt=Ln("MenuContent.ScrollLock"),_e=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:l,onEntryFocus:p,onEscapeKeyDown:f,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:g,onDismiss:w,disableOutsideScroll:v,...M}=e,x=O(E,n),C=Q(E,n),S=se(n),_=He(n),I=gt(n),[P,Z]=a.useState(null),N=a.useRef(null),b=K(t,N,x.onContentChange),F=a.useRef(0),T=a.useRef(""),U=a.useRef(0),B=a.useRef(null),J=a.useRef("right"),ee=a.useRef(0),ue=v?jn:a.Fragment,D=v?{as:Rt,allowPinchZoom:!0}:void 0,En=m=>{const G=T.current+m,j=I().filter(y=>!y.disabled),W=document.activeElement,de=j.find(y=>y.ref.current===W)?.textValue,le=j.map(y=>y.textValue),ye=Ot(le,G,de),V=j.find(y=>y.textValue===ye)?.ref.current;(function y(Ee){T.current=Ee,window.clearTimeout(F.current),Ee!==""&&(F.current=window.setTimeout(()=>y(""),1e3))})(G),V&&setTimeout(()=>V.focus())};a.useEffect(()=>()=>window.clearTimeout(F.current),[]),Tn();const L=a.useCallback(m=>J.current===B.current?.side&&Lt(m,B.current?.area),[]);return r.jsx(Ct,{scope:n,searchRef:T,onItemEnter:a.useCallback(m=>{L(m)&&m.preventDefault()},[L]),onItemLeave:a.useCallback(m=>{L(m)||(N.current?.focus(),Z(null))},[L]),onTriggerLeave:a.useCallback(m=>{L(m)&&m.preventDefault()},[L]),pointerGraceTimerRef:U,onPointerGraceIntentChange:a.useCallback(m=>{B.current=m},[]),children:r.jsx(ue,{...D,children:r.jsx(kn,{asChild:!0,trapped:s,onMountAutoFocus:h(c,m=>{m.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:r.jsx(On,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:g,onDismiss:w,children:r.jsx(ut,{asChild:!0,..._,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:Z,onEntryFocus:h(p,m=>{C.isUsingKeyboardRef.current||m.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(Fn,{role:"menu","aria-orientation":"vertical","data-state":mn(x.open),"data-radix-menu-content":"",dir:C.dir,...S,...M,ref:b,style:{outline:"none",...M.style},onKeyDown:h(M.onKeyDown,m=>{const j=m.target.closest("[data-radix-menu-content]")===m.currentTarget,W=m.ctrlKey||m.altKey||m.metaKey,de=m.key.length===1;j&&(m.key==="Tab"&&m.preventDefault(),!W&&de&&En(m.key));const le=N.current;if(m.target!==le||!ft.includes(m.key))return;m.preventDefault();const V=I().filter(y=>!y.disabled).map(y=>y.ref.current);Ve.includes(m.key)&&V.reverse(),jt(V)}),onBlur:h(e.onBlur,m=>{m.currentTarget.contains(m.target)||(window.clearTimeout(F.current),T.current="")}),onPointerMove:h(e.onPointerMove,X(m=>{const G=m.target,j=ee.current!==m.clientX;if(m.currentTarget.contains(G)&&j){const W=m.clientX>ee.current?"right":"left";J.current=W,ee.current=m.clientX}}))})})})})})})});Qe.displayName=E;var It="MenuGroup",be=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(A.div,{role:"group",...o,ref:t})});be.displayName=It;var yt="MenuLabel",Ze=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(A.div,{...o,ref:t})});Ze.displayName=yt;var te="MenuItem",Se="menu.itemSelect",ae=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...s}=e,c=a.useRef(null),d=Q(te,e.__scopeMenu),l=Ce(te,e.__scopeMenu),p=K(t,c),f=a.useRef(!1),u=()=>{const i=c.current;if(!n&&i){const g=new CustomEvent(Se,{bubbles:!0,cancelable:!0});i.addEventListener(Se,w=>o?.(w),{once:!0}),Nn(i,g),g.defaultPrevented?f.current=!1:d.onClose()}};return r.jsx(Je,{...s,ref:p,disabled:n,onClick:h(e.onClick,u),onPointerDown:i=>{e.onPointerDown?.(i),f.current=!0},onPointerUp:h(e.onPointerUp,i=>{f.current||i.currentTarget?.click()}),onKeyDown:h(e.onKeyDown,i=>{const g=l.searchRef.current!=="";n||g&&i.key===" "||ve.includes(i.key)&&(i.currentTarget.click(),i.preventDefault())})})});ae.displayName=te;var Je=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:s,...c}=e,d=Ce(te,n),l=He(n),p=a.useRef(null),f=K(t,p),[u,i]=a.useState(!1),[g,w]=a.useState("");return a.useEffect(()=>{const v=p.current;v&&w((v.textContent??"").trim())},[c.children]),r.jsx(H.ItemSlot,{scope:n,disabled:o,textValue:s??g,children:r.jsx(dt,{asChild:!0,...l,focusable:!o,children:r.jsx(A.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:f,onPointerMove:h(e.onPointerMove,X(v=>{o?d.onItemLeave(v):(d.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:h(e.onPointerLeave,X(v=>d.onItemLeave(v))),onFocus:h(e.onFocus,()=>i(!0)),onBlur:h(e.onBlur,()=>i(!1))})})})}),Et="MenuCheckboxItem",en=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...s}=e;return r.jsx(sn,{scope:e.__scopeMenu,checked:n,children:r.jsx(ae,{role:"menuitemcheckbox","aria-checked":oe(n)?"mixed":n,...s,ref:t,"data-state":Ie(n),onSelect:h(s.onSelect,()=>o?.(oe(n)?!0:!n),{checkForDefaultPrevented:!1})})})});en.displayName=Et;var nn="MenuRadioGroup",[St,Pt]=k(nn,{value:void 0,onValueChange:()=>{}}),tn=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...s}=e,c=xe(o);return r.jsx(St,{scope:e.__scopeMenu,value:n,onValueChange:c,children:r.jsx(be,{...s,ref:t})})});tn.displayName=nn;var on="MenuRadioItem",rn=a.forwardRef((e,t)=>{const{value:n,...o}=e,s=Pt(on,e.__scopeMenu),c=n===s.value;return r.jsx(sn,{scope:e.__scopeMenu,checked:c,children:r.jsx(ae,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":Ie(c),onSelect:h(o.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rn.displayName=on;var Re="MenuItemIndicator",[sn,Dt]=k(Re,{checked:!1}),an=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...s}=e,c=Dt(Re,n);return r.jsx(re,{present:o||oe(c.checked)||c.checked===!0,children:r.jsx(A.span,{...s,ref:t,"data-state":Ie(c.checked)})})});an.displayName=Re;var At="MenuSeparator",cn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(A.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});cn.displayName=At;var Nt="MenuArrow",un=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,s=se(n);return r.jsx(Gn,{...s,...o,ref:t})});un.displayName=Nt;var Tt="MenuSub",[Go,dn]=k(Tt),Y="MenuSubTrigger",ln=a.forwardRef((e,t)=>{const n=O(Y,e.__scopeMenu),o=Q(Y,e.__scopeMenu),s=dn(Y,e.__scopeMenu),c=Ce(Y,e.__scopeMenu),d=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:p}=c,f={__scopeMenu:e.__scopeMenu},u=a.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return a.useEffect(()=>u,[u]),a.useEffect(()=>{const i=l.current;return()=>{window.clearTimeout(i),p(null)}},[l,p]),r.jsx(we,{asChild:!0,...f,children:r.jsx(Je,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?s.contentId:void 0,"data-state":mn(n.open),...e,ref:Te(t,s.onTriggerChange),onClick:i=>{e.onClick?.(i),!(e.disabled||i.defaultPrevented)&&(i.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:h(e.onPointerMove,X(i=>{c.onItemEnter(i),!i.defaultPrevented&&!e.disabled&&!n.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:h(e.onPointerLeave,X(i=>{u();const g=n.content?.getBoundingClientRect();if(g){const w=n.content?.dataset.side,v=w==="right",M=v?-5:5,x=g[v?"left":"right"],C=g[v?"right":"left"];c.onPointerGraceIntentChange({area:[{x:i.clientX+M,y:i.clientY},{x,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x,y:g.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(i),i.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:h(e.onKeyDown,i=>{const g=c.searchRef.current!=="";e.disabled||g&&i.key===" "||pt[o.dir].includes(i.key)&&(n.onOpenChange(!0),n.content?.focus(),i.preventDefault())})})})});ln.displayName=Y;var fn="MenuSubContent",pn=a.forwardRef((e,t)=>{const n=ze(E,e.__scopeMenu),{forceMount:o=n.forceMount,align:s="start",...c}=e,d=O(E,e.__scopeMenu),l=Q(E,e.__scopeMenu),p=dn(fn,e.__scopeMenu),f=a.useRef(null),u=K(t,f);return r.jsx(H.Provider,{scope:e.__scopeMenu,children:r.jsx(re,{present:o||d.open,children:r.jsx(H.Slot,{scope:e.__scopeMenu,children:r.jsx(_e,{id:p.contentId,"aria-labelledby":p.triggerId,...c,ref:u,align:s,side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:i=>{l.isUsingKeyboardRef.current&&f.current?.focus(),i.preventDefault()},onCloseAutoFocus:i=>i.preventDefault(),onFocusOutside:h(e.onFocusOutside,i=>{i.target!==p.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:h(e.onEscapeKeyDown,i=>{l.onClose(),i.preventDefault()}),onKeyDown:h(e.onKeyDown,i=>{const g=i.currentTarget.contains(i.target),w=mt[l.dir].includes(i.key);g&&w&&(d.onOpenChange(!1),p.trigger?.focus(),i.preventDefault())})})})})})});pn.displayName=fn;function mn(e){return e?"open":"closed"}function oe(e){return e==="indeterminate"}function Ie(e){return oe(e)?"indeterminate":e?"checked":"unchecked"}function jt(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function kt(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Ot(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,c=n?e.indexOf(n):-1;let d=kt(e,Math.max(c,0));s.length===1&&(d=d.filter(f=>f!==n));const p=d.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return p!==n?p:void 0}function Ft(e,t){const{x:n,y:o}=e;let s=!1;for(let c=0,d=t.length-1;c<t.length;d=c++){const l=t[c],p=t[d],f=l.x,u=l.y,i=p.x,g=p.y;u>o!=g>o&&n<(i-f)*(o-u)/(g-u)+f&&(s=!s)}return s}function Lt(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Ft(n,t)}function X(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Gt=Xe,$t=we,Kt=qe,Ut=Qe,Bt=be,Wt=Ze,Vt=ae,Yt=en,Ht=tn,Xt=rn,zt=an,qt=cn,Qt=un,Zt=ln,Jt=pn,ce="DropdownMenu",[eo]=he(ce,[Ye]),R=Ye(),[no,gn]=eo(ce),vn=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:s,defaultOpen:c,onOpenChange:d,modal:l=!0}=e,p=R(t),f=a.useRef(null),[u,i]=Ae({prop:s,defaultProp:c??!1,onChange:d,caller:ce});return r.jsx(no,{scope:t,triggerId:me(),triggerRef:f,contentId:me(),open:u,onOpenChange:i,onOpenToggle:a.useCallback(()=>i(g=>!g),[i]),modal:l,children:r.jsx(Gt,{...p,open:u,onOpenChange:i,dir:o,modal:l,children:n})})};vn.displayName=ce;var hn="DropdownMenuTrigger",xn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...s}=e,c=gn(hn,n),d=R(n);return r.jsx($t,{asChild:!0,...d,children:r.jsx(A.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:Te(t,c.triggerRef),onPointerDown:h(e.onPointerDown,l=>{!o&&l.button===0&&l.ctrlKey===!1&&(c.onOpenToggle(),c.open||l.preventDefault())}),onKeyDown:h(e.onKeyDown,l=>{o||(["Enter"," "].includes(l.key)&&c.onOpenToggle(),l.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});xn.displayName=hn;var to="DropdownMenuPortal",wn=e=>{const{__scopeDropdownMenu:t,...n}=e,o=R(t);return r.jsx(Kt,{...o,...n})};wn.displayName=to;var Mn="DropdownMenuContent",Cn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=gn(Mn,n),c=R(n),d=a.useRef(!1);return r.jsx(Ut,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...o,ref:t,onCloseAutoFocus:h(e.onCloseAutoFocus,l=>{d.current||s.triggerRef.current?.focus(),d.current=!1,l.preventDefault()}),onInteractOutside:h(e.onInteractOutside,l=>{const p=l.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0,u=p.button===2||f;(!s.modal||u)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cn.displayName=Mn;var oo="DropdownMenuGroup",ro=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Bt,{...s,...o,ref:t})});ro.displayName=oo;var so="DropdownMenuLabel",ao=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Wt,{...s,...o,ref:t})});ao.displayName=so;var co="DropdownMenuItem",_n=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Vt,{...s,...o,ref:t})});_n.displayName=co;var io="DropdownMenuCheckboxItem",uo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Yt,{...s,...o,ref:t})});uo.displayName=io;var lo="DropdownMenuRadioGroup",fo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Ht,{...s,...o,ref:t})});fo.displayName=lo;var po="DropdownMenuRadioItem",mo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Xt,{...s,...o,ref:t})});mo.displayName=po;var go="DropdownMenuItemIndicator",vo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(zt,{...s,...o,ref:t})});vo.displayName=go;var ho="DropdownMenuSeparator",xo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(qt,{...s,...o,ref:t})});xo.displayName=ho;var wo="DropdownMenuArrow",Mo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Qt,{...s,...o,ref:t})});Mo.displayName=wo;var Co="DropdownMenuSubTrigger",_o=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Zt,{...s,...o,ref:t})});_o.displayName=Co;var bo="DropdownMenuSubContent",Ro=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=R(n);return r.jsx(Jt,{...s,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ro.displayName=bo;var Io=vn,yo=xn,Eo=wn,bn=Cn,Rn=_n;const So=Io,Po=yo,In=a.forwardRef(({className:e,sideOffset:t=4,...n},o)=>r.jsx(Eo,{children:r.jsx(bn,{ref:o,sideOffset:t,className:$("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground ","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));In.displayName=bn.displayName;const yn=a.forwardRef(({className:e,inset:t,...n},o)=>r.jsx(Rn,{ref:o,className:$("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));yn.displayName=Rn.displayName;function Do({identity:e,sections:t,activeSection:n,activeItem:o,onSectionSelect:s,sectionLabel:c,highlightSection:d=!0,className:l}){const p=o??t.find(u=>u.key===n)??t[0];if(!p)return null;const f=p.icon;return r.jsx("div",{className:$("flex shrink-0 flex-col items-center px-4 lg:px-6",l),children:r.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap items-center justify-center gap-x-3 gap-y-2",children:[e,r.jsxs(So,{children:[r.jsx(Po,{asChild:!0,children:r.jsxs("button",{type:"button",className:$("inline-flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",d?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),"aria-label":c,children:[r.jsx(f,{className:"h-3.5 w-3.5 shrink-0"}),p.label,r.jsx($n,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]})}),r.jsx(In,{align:"center",className:"min-w-[11rem]",children:t.map(({key:u,label:i,icon:g})=>r.jsxs(yn,{className:$(u===n&&"bg-accent font-medium"),onSelect:()=>s(u),children:[r.jsx(g,{className:"h-4 w-4"}),r.jsx("span",{children:i})]},u))})]})]})})}const ie=[{key:"skills",label:"Skills",icon:Un},{key:"guardrails",label:"Guardrails",icon:Bn},{key:"permissions",label:"Permissions",icon:Wn,adminOnly:!0},{key:"models",label:"Models",icon:Vn},{key:"settings",label:"Settings",icon:Yn}];function Ao(e){return ie.filter(t=>!t.adminOnly||e)}function No(e,t){if(t===`${e}/conversations`||t.startsWith(`${e}/conversations/`))return null;for(const{key:n}of ie)if(t===`${e}/${n}`||t.startsWith(`${e}/${n}/`))return n;return t===`${e}/identity`||t===`${e}/identity/`?"settings":null}function To(e){return e.trim().charAt(0).toUpperCase()||"?"}function jo({owner:e,agentId:t,agentName:n,activeDest:o}){const s=je(),{orgContext:c}=Le(),{isAdmin:d}=zn(c.organizationId),l=Ao(!!d),p=o??"settings",f=ie.find(u=>u.key===p);return r.jsx(Do,{identity:r.jsxs(ne,{to:"/$owner/agents/$agentId/settings",params:{owner:e,agentId:t},search:{run_id:void 0},className:"flex min-w-0 items-center gap-2 rounded-md outline-none transition-colors hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",title:"Agent settings",children:[r.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-foreground",children:To(n)}),r.jsx("h1",{className:"min-w-0 truncate text-base font-semibold tracking-tight",children:n})]}),sections:l,activeSection:p,activeItem:f,sectionLabel:"Agent section",highlightSection:o!==null,onSectionSelect:u=>{s({to:`/$owner/agents/$agentId/${u}`,params:{owner:e,agentId:t}})}})}function $o({owner:e,agentId:t}){const n=je(),{pathname:o}=Kn(),{isAuthenticated:s}=ke(),{isMember:c}=Oe(),d=s&&c,{data:l=[],isLoading:p}=Fe({enabled:d}),f=l.find(P=>P.agentId===t)??null,u=!f&&!p&&d,i=`/${e}/agents/${t}`,g=`${i}/conversations`,v=o===g||o.startsWith(`${g}/`),M=No(i,o);a.useEffect(()=>{u&&n({to:"/$owner",params:{owner:e},replace:!0})},[u,n,e]);const x=f?.name??"Agent",C=ie.find(P=>P.key===M)?.label??"Conversations",S=o.slice(i.length+1).split("/")[1],_=M==="settings"&&!S,I=_?x:S?S==="create"?M==="skills"?"Add a skill":"New custom guardrail":M==="skills"?"Skill details":M==="guardrails"?"Guardrail details":"Conversation":C;return r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-hidden py-4 md:py-6",children:[r.jsx("div",{className:"mx-auto w-full max-w-3xl px-4 lg:px-6",children:r.jsx(Hn,{crumbs:[r.jsx(ne,{to:"/$owner/agents",params:{owner:e},className:fe,children:"Agents"},"agents"),..._?[]:[r.jsx(ne,{to:"/$owner/agents/$agentId/settings",params:{owner:e,agentId:t},search:{run_id:void 0},className:fe,children:x},"agent")],...S&&M?[r.jsx(ne,{to:`/$owner/agents/$agentId/${M}`,params:{owner:e,agentId:t},className:fe,children:C},"section")]:[]],current:I})}),r.jsx(jo,{owner:e,agentId:t,agentName:x,activeDest:M}),r.jsx("div",{className:$("flex min-h-0 min-w-0 flex-1 flex-col px-4 lg:px-6",v?"overflow-hidden":"overflow-y-auto"),children:r.jsx(Xn,{})})]})}function ko({agent:e,tab:t,runId:n}){return r.jsx("div",{className:"mx-auto w-full max-w-3xl pb-6",children:r.jsx(Zn,{resource:{kind:"agent",agentId:e.agentId},runId:n,children:({reviewMode:o,proposal:s,controlsDisabled:c})=>r.jsx(Qn,{mode:{kind:"edit",agent:e},section:t,reviewMode:o,reviewProposal:s,reviewControlsDisabled:c},e.agentId)})})}function Ko({owner:e,agentId:t,tab:n,runId:o}){const{orgContext:s,hasOrgContext:c}=Le(),{isLoading:d}=qn(`/${e}`,s),{isAuthenticated:l}=ke(),{isMember:p,isLoading:f}=Oe(),u=l&&p,{data:i=[],isLoading:g}=Fe({enabled:u}),w=u?!c||d||g||f:d||f,v=i.find(M=>M.agentId===t)??null;return w||!v?null:r.jsx(ko,{agent:v,tab:n,runId:o})}export{$o as A,Ko as a};
|
|
2
|
-
//# sourceMappingURL=agents-workbench-D1YL3VAB.js.map
|