@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ce as t,w as m,j as e,cf as a,ap as s}from"./index-4gCDI7m4.js";import{A as n}from"./activity-route-view-V4ftmSN7.js";import"./record-activity-D7bRaMk2.js";import"./filter-bar-BQm-ubB1.js";import"./calendar-DMq3Dtqy.js";import"./connection-label-BobuYiAG.js";import"./runs-BPtQBTRN.js";import"./source-record-panels-Bh5F4C5K.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./use-automations-BHoV0dLs.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./copy-button-2swYh4jb.js";import"./events-feed-BysC9HgU.js";import"./client-activity-scopes-boZOHuPW.js";import"./client-rows-BJ2PxM4J.js";import"./agent-loading-shells-Dnmb6W5Y.js";import"./member-scope-gate-vp3FihBD.js";import"./public-shell-ready-CsenJeXa.js";function z(){const{owner:o}=t.useParams(),r=m({select:p=>p.pathname}),i=t.useSearch();return e.jsx(n,{owner:o,search:i,entityScope:a(s(r,1)).path})}export{z as component};
|
|
2
|
+
//# sourceMappingURL=_-DIK0ae_S.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-D-WDWrAe.js","assets/index-4gCDI7m4.js","assets/index-DDGdlQrt.css","assets/record-activity-D7bRaMk2.js","assets/filter-bar-BQm-ubB1.js","assets/calendar-DMq3Dtqy.js","assets/connection-label-BobuYiAG.js","assets/runs-BPtQBTRN.js","assets/source-record-panels-Bh5F4C5K.js","assets/event-card-Mcxv56DG.js","assets/use-scroll-sentinel-Ct-jt7O0.js","assets/use-automations-BHoV0dLs.js","assets/clients-C7Lnuc3S.js","assets/renderer-7EGgTVX0.js","assets/table-DFcJRNk7.js","assets/card-SFtxv9f2.js","assets/json-diff-E5D-NGYT.js","assets/index-wHFQv1aT.js","assets/copy-button-2swYh4jb.js","assets/events-feed-BysC9HgU.js","assets/client-activity-scopes-boZOHuPW.js","assets/client-rows-BJ2PxM4J.js","assets/agent-loading-shells-Dnmb6W5Y.js","assets/member-scope-gate-vp3FihBD.js","assets/views-access-required-DHrDO333.js","assets/record-session-CWXnCVln.js","assets/entity-avatar-HloBoalJ.js","assets/view-param-filters-mKoqDsaD.js","assets/app-bridge-C4nPtae3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{an as p,w as x,ao as y,ap as j,aq as P,ar as g,o as R,s as f,j as e,r as v,as as w,m as E,_ as S}from"./index-4gCDI7m4.js";import{P as r}from"./public-shell-ready-CsenJeXa.js";const _=E(async()=>({default:(await S(async()=>{const{EntityPage:a}=await import("./entity-page-D-WDWrAe.js");return{EntityPage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(w,{})})}function L(){const{owner:a}=p.useParams(),l=x({select:m=>m.pathname}),s=y(j(l)),d=s?.viewKey,{path:u}=P(a,s?.entityPath),{data:t,isLoading:n,error:o}=g(u,{slug:a},{includeBootstrap:!0}),{session:h,isReady:i}=R();return f({active:!n&&i&&!h&&(!!o||!t),owner:a}),n||!i&&!t?e.jsx(c,{}):o||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't resolve this path."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsx(v.Suspense,{fallback:e.jsx(c,{}),children:e.jsx(_,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})]})}export{L as component};
|
|
3
|
+
//# sourceMappingURL=_-gTbcArpS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as L,go as w,r as u,gp as C,j as n,h as D,cq as S,o as E,au as P,bd as M,b4 as N,bm as R,cI as O,gq as $,gr as q,by as B,E as Q}from"./index-4gCDI7m4.js";import{L as z,A as F}from"./agent-thread-DQIr20H-.js";import{A as H,C as U}from"./agent-loading-shells-Dnmb6W5Y.js";import"./app-bridge-C4nPtae3.js";import"./use-mention-search-C3rWLuKm.js";import"./index-wHFQv1aT.js";import"./use-automations-BHoV0dLs.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./copy-button-2swYh4jb.js";import"./events-feed-BysC9HgU.js";import"./client-activity-scopes-boZOHuPW.js";import"./client-rows-BJ2PxM4J.js";function W({owner:e,agent:s,threadId:t,afterMessagesContent:d,className:r,initialDraft:h,newChatRequested:f=!1,preventAutoNavigate:p}){const o=L(),i=s.agentId,{data:a=[]}=w(i,{orgSlug:e}),[l,x]=u.useState(()=>C()),[g,A]=u.useState(null);u.useEffect(()=>{!f||t||(x(C()),A(null),o({to:".",search:(m=>{const{new:b,...y}=m;return y}),replace:!0}))},[f,t,o]);const v=u.useMemo(()=>!g||a.some(m=>m.id===g.id)?a:[g,...a],[a,g]),c=t??l,T=!t||!v.some(m=>m.id===t),j=u.useCallback(()=>{if(v.some(b=>b.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const m=S(e,i,c);o({...m,replace:!0})},[v,c,o,e,i]),k=u.useCallback(()=>{T&&!p&&j()},[T,j,p]);return n.jsx("div",{className:D("flex min-h-0 flex-1 flex-col",r),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(z,{agentId:i,workspaceSlug:e,thread:c,loadHistory:!!t,onFirstUserMessage:k,initialDraft:h,children:n.jsx(F,{afterMessagesContent:d})},`${i}:${c}`)})})}function _({owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:f}){const{isAuthenticated:p}=E(),{isMember:o,isLoading:i}=P(),a=p&&o,{data:l=[],isLoading:x}=M({enabled:a}),g=s??null,A=l.find(c=>c.agentId===g)??null;return a&&x||i?n.jsx(H,{}):A?n.jsx(W,{owner:e,agent:A,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:h,preventAutoNavigate:f,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(N,{icon:R,title:"Agent not found",description:"This agent may have been removed."})}function G(e){return[...e].sort((s,t)=>t.updatedAt-s.updatedAt)[0]}function J({owner:e,agentId:s,threadId:t,initialDraft:d,forceComposer:r=!1,newChatRequested:h=!1,afterMessagesContent:f,preventAutoNavigate:p}){const o=L(),{data:i=[],isLoading:a}=O($(e,s,{strict:!1})),l=u.useMemo(()=>G(i),[i]);return u.useEffect(()=>{if(t||r||a||!l)return;const x=S(e,s,l.id);o({...x,replace:!0})},[s,a,l,o,e,t,r]),!t&&!r&&(a||l)?n.jsx(U,{}):n.jsx(_,{owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:h,afterMessagesContent:f,preventAutoNavigate:p})}function ft(){const{owner:e,agentId:s}=q.useParams(),{threadId:t}=B({strict:!1}),{new:d,prompt:r}=Q({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 pt-2.5 pb-4 lg:px-6 lg:pb-6",children:n.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:n.jsx(J,{owner:e,agentId:s,threadId:t,initialDraft:r,forceComposer:!t,newChatRequested:!!d})})})}export{ft as component};
|
|
2
|
+
//# sourceMappingURL=_agentId-DOmcJZfk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{he as r,j as e}from"./index-4gCDI7m4.js";import{A as n}from"./agents-workbench-C8bTa2rv.js";import"./agent-editor-form-DfMTSIvj.js";import"./model-selector-88PJnyTq.js";import"./proposal-review-shell-B4CSiyLB.js";import"./runs-BPtQBTRN.js";function c(){const{owner:o,agentId:t}=r.useParams();return e.jsx(n,{owner:o,agentId:t})}export{c as component};
|
|
2
|
+
//# sourceMappingURL=_agentId-DW6wRCVC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as A,t as b,ar as k,o as L,au as C,j as t,gl as R,L as d,gm as _,bm as $,S as B,B as p,bk as D,h5 as u,aA as S}from"./index-4gCDI7m4.js";import{A as y}from"./automation-detail-content-C9Cgr5Zj.js";import{b as O}from"./use-automations-BHoV0dLs.js";import"./create-automation-form-DmCOFbRT.js";import"./cronstrue-CKwjNYgj.js";import"./entity-options-BSW_EG0W.js";import"./connection-label-BobuYiAG.js";import"./model-selector-88PJnyTq.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-rX0t1g5C.js";import"./index-wHFQv1aT.js";import"./use-mention-search-C3rWLuKm.js";import"./proposal-review-shell-B4CSiyLB.js";import"./runs-BPtQBTRN.js";import"./events-feed-BysC9HgU.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./copy-button-2swYh4jb.js";import"./client-activity-scopes-boZOHuPW.js";import"./client-rows-BJ2PxM4J.js";function P({owner:a,automationId:o,view:s,runId:e}){const n=A(),{orgContext:x,hasOrgContext:g}=b(),{data:h,isLoading:r}=k(`/${a}`,x),{isAuthenticated:v}=L(),{isLoading:m}=C(),f=h?.workspace?.id??"",j=v?!g||r||m:r||m,i=O(o,void 0,f).data?.automation,c=i?.automation_name??"Automation",w=()=>void n({to:"/$owner/automations",params:{owner:a}}),l=()=>void n({to:"/$owner/automations/$automationId",params:{owner:a,automationId:o},search:{view:"activity",run_id:void 0}}),N=!e&&s==="definition";return t.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsxs("div",{className:"mx-auto flex w-full min-w-0 max-w-3xl flex-col gap-4",children:[t.jsx(R,{crumbs:[t.jsx(d,{to:"/$owner/automations",params:{owner:a},className:_,children:"Automations"},"automations")],current:e?"Review change":c}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"flex min-w-0 items-center gap-2",children:t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx($,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),j&&!i?t.jsx(B,{className:"h-5 w-40"}):e?"Review change":c]})}),e?null:N?t.jsx(p,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:l,children:"Done"}):t.jsx(p,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs(d,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:o},search:{view:"definition",run_id:void 0},children:[t.jsx(D,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),t.jsx(y,{owner:a,agentId:i?.managed_agent_id??null,automationId:o,view:s,runId:e,onDone:e?w:l})]})})}function ct(){const{owner:a,automationId:o}=u.useParams(),s=u.useSearch();return t.jsx(S,{owner:a,children:()=>t.jsx(P,{owner:a,automationId:o,view:s.view,runId:s.run_id})})}export{ct as component};
|
|
2
|
+
//# sourceMappingURL=_automationId-B9IcDYBu.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iv as L,j as e,aA as G,v as U,aH as X,aI as Y,cw as z,cX as J,S as A,B as Q,L as p,aK as Z,ia as K,ib as ee,aY as ne,gm as h,fW as se,gk as ae,ba as oe,hO as te,gl as ie,hq as R,aS as ce,F as re}from"./index-4gCDI7m4.js";import{R as de,c as me,C as le}from"./device-pin-tombstone-xGhCTU5_.js";import{a as pe}from"./connector-provenance-Th8ymGec.js";import{f as ue,C as he,F as xe,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-D7pnWaFB.js";import{S as Ne,g as De}from"./runs-panel-Bj63_hb9.js";import{c as ge}from"./connection-label-BobuYiAG.js";import"./connector-scope-lists-BibdzKl1.js";import"./status-dot-D3FoDRcc.js";import"./entity-options-BSW_EG0W.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./use-automations-BHoV0dLs.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./copy-button-2swYh4jb.js";import"./feed-event-kinds-BYuZCoU4.js";import"./runs-BPtQBTRN.js";import"./filter-bar-BQm-ubB1.js";function Xe(){const{owner:m,connectorKey:n,connectionId:v}=L.useParams(),{addFeed:o,feedId:c,settings:x,auth_result:t}=L.useSearch();return e.jsx(G,{owner:m,children:l=>e.jsx($e,{organizationId:l.organizationId,ownerSlug:l.ownerSlug,isWorkspaceLoading:l.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:o===!0,feedId:c,openSettings:x===!0,authResult:t})})}function $e({organizationId:m,ownerSlug:n,isWorkspaceLoading:v,connectorKey:o,connectionId:c,showAddFeed:x,feedId:t,openSettings:l,authResult:E}){const y=U(),{data:B=[]}=X(),{data:M=[],isLoading:P,isError:j,refetch:W}=Y(m??"",{connectorKey:o,connectionIds:[c]}),{data:g=[]}=z(m??""),{data:O=[],isLoading:S,isError:T,refetch:H}=J(t?c:null),s=M.find(i=>i.id===c),a=g.find(i=>i.key===o),r=t?O.find(i=>i.id===t):null;if(v||P||t&&S||!m)return e.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[e.jsx(A,{className:"h-7 w-56"}),e.jsx(A,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||t&&T)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Q,{variant:"outline",size:"sm",onClick:()=>void(j?W():H()),children:"Retry"})]});if(!s)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",a?.name??o]})]});const $=ge({...s,connector_name:s.connector_name??a?.name??null}),C=!t&&!x,V=()=>void y({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},replace:!0});let u,f=$,k,w,N;t?r?(f=ue(r,a),r.store==="channel_messages"?(u=e.jsx(he,{feed:r,hideHeader:!0}),N="chat channel"):(k=e.jsx(xe,{feed:r,ownerSlug:n}),w=e.jsx(fe,{feed:r}),u=e.jsx(ve,{feed:r,connectorDef:a,ownerSlug:n}))):(u=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),f="Feed"):x&&(u=e.jsx(je,{onClose:V,organizationId:m,connections:[s],connectorDefinitions:g}),f="Add feed",N=Ce);const d=B.find(i=>i.id===s.device_worker_id&&Z(i,n)),F=d?K(d):void 0,D=F?ee(n,F,ne()):void 0,b=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:h,children:"Connectors"},"connectors"),...d&&D?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:D.id},className:h,children:D.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:h,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:h,children:a?.name??o},"connector")]];C||b.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},className:h,children:$},"connection"));const _=C?me(s):null,q=N??_??void 0,I=e.jsx(ae,{breadcrumb:e.jsx(ie,{crumbs:b}),icon:a?e.jsx(oe,{icon:a.icon,name:a.name,faviconDomain:a.favicon_domain??te(a.auth_schema)}):null,title:f,status:k??e.jsx(Ne,{status:De(s.status),showDot:!0,children:s.status}),meta:w,caption:q,captionTone:_?"error":"muted"});return C?d&&a&&ce(a)?e.jsx(re,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},search:{connection:s.id,settings:l||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(R,{header:I,children:[e.jsx(pe,{connectorDef:a,connectorKey:o,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(le,{embedded:!0,connection:s,connectorDef:a,ownerSlug:n,openSettings:l,authResult:E},s.id)]}):e.jsx(R,{header:I,children:e.jsx("div",{className:"mt-0",children:u})})}export{Xe as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey._connectionId-C6PmMPTA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aE as Pe,aF as Se,aG as De,aQ as le,aN as ee,hp as Ye,fY as Qe,j as e,hq as se,B as j,L as B,aP as oe,gk as te,gl as ne,gm as U,hr as Ze,a5 as Je,hs as J,r as m,ht as be,hu as Ee,cH as es,hv as Ce,bT as M,hw as ke,H as w,bz as ss,bA as ts,bB as ns,bC as as,bD as rs,hl as is,I as S,bK as q,aa as z,A as we,hx as ls,hy as os,bo as _e,hz as cs,be as ce,hA as ds,hB as us,hC as Fe,hD as Be,hE as Le,d9 as Re,V as _,W as ae,hF as ms,fG as hs,hG as xs,em as Ke,S as k,fZ as T,v as H,hH as ps,dx as js,dz as fs,dy as gs,hI as G,hJ as vs,aA as Ns,u as de,f$ as ue,hK as ys,aT as bs,hL as Cs,hM as ks,fX as ws,aD as Ae,aC as As,aI as $s,b6 as Ps,aL as F,hN as Oe,bb as Ie,ba as me,b7 as Ss,h as Ds,hO as Es}from"./index-4gCDI7m4.js";import{C as _s,A as Fs}from"./connect-menu-BF-AlunU.js";import{C as Bs,A as Me,a as Ue}from"./connections-browser-DDJQh8Na.js";import{C as Ls}from"./connector-provenance-Th8ymGec.js";import{u as Rs}from"./runs-BPtQBTRN.js";import"./connection-label-BobuYiAG.js";import"./status-dot-D3FoDRcc.js";function Ks({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",l=Pe({enabled:n}),d=Se({enabled:n}),u=De({enabled:!n}),c=n?l:u,o=n?d.data?.find(r=>r.slug===a)?.displayName??a:le(a),p=(n?(l.data??[]).filter(r=>r.kind===a).map(r=>({key:`${ee}${r.slug}`,name:r.displayName||r.slug,status:[r.isDefault?"Default":null,r.status].filter(Boolean).join(" · ")})):(u.data?.sandboxes??[]).filter(r=>r.providerKind===a).map(r=>({key:`${Ye}${r.id}`,name:r.name,status:r.connected?"Connected":"Needs credentials"}))).map(r=>({id:r.key,name:r.name,description:r.status,tone:null,link:Qe({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:r.key},search:{}})})),h=`${n?ee:oe}${a}`;return e.jsx(se,{header:e.jsx(te,{title:o,breadcrumb:e.jsx(ne,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors")]})}),children:e.jsx(Bs,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:n?e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:h},search:{addAccount:!0},children:"Add connection"})}):e.jsx(Me,{ownerSlug:s,connectorKey:h})})})}function Os({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:l,onDone:d}){const u=Ze(),c=Je(),o=s.find(i=>i.slug===t)??s[0],p=n&&o&&J(o)?"oauth":"api-key",[h,r]=m.useState(o?.slug??""),[g,b]=m.useState(a??o?.slug??""),[x,N]=m.useState(o?.displayName??""),[v,A]=m.useState(o?.baseUrl??""),[E,$]=m.useState(l??o?.defaultModel??""),[D,V]=m.useState(""),[X,K]=m.useState(o?.apiKeyPlaceholder??""),[W,O]=m.useState(p),[L,Y]=m.useState(""),[C,re]=m.useState(null),[I,R]=m.useState(!1),[he,xe]=m.useState(!1),f=s.find(i=>i.slug===h),Q=be(f?.modalities??[]),pe=n&&!!f&&J(f),je=f?Ee(f):!1,fe=pe&&W==="oauth",ge=je&&!fe,P=es().slug,Z=m.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Te=m.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),ze=m.useCallback(async()=>{if(!(!P||!f)){R(!0);try{const i=await Ce(P,f.slug);if(i.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(i.authorizeUrl,"_blank","noreferrer")}catch(i){M.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[P,f]),Ve=m.useCallback(async()=>{if(!(!P||!f||!L.trim())){R(!0);try{const i=await ke(P,f.slug,{code:L.trim()});if(i.status!=="success")throw new Error(i.error||"Sign-in not complete");Z(),M.success(`Signed in with ${f.displayName}`)}catch(i){M.error(i instanceof Error?i.message:"Failed to complete sign-in")}finally{R(!1)}}},[P,f,L,Z]),We=m.useCallback(async()=>{if(!(!P||!f)){R(!0);try{const i=await Ce(P,f.slug);if(i.mode!=="device")throw new Error("Unexpected sign-in mode");re({userCode:i.userCode,deviceAuthId:i.deviceAuthId,verificationUrl:i.verificationUrl}),window.open(i.verificationUrl,"_blank","noreferrer")}catch(i){M.error(i instanceof Error?i.message:"Failed to start sign-in")}finally{R(!1)}}},[P,f]),qe=m.useCallback(async()=>{if(!(!P||!f||!C)){R(!0);try{const i=await ke(P,f.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(i.status==="success"){Z(),M.success(`Signed in with ${f.displayName}`);return}re(y=>y&&{...y,message:i.error||"Waiting for approval..."})}catch(i){M.error(i instanceof Error?i.message:"Failed to check status")}finally{R(!1)}}},[P,f,C,Z]),Ge=f?.supportedAuthTypes.includes("device-code")??!1,He=i=>{r(i);const y=s.find(ie=>ie.slug===i);y&&(b(y.slug),N(y.displayName),A(y.baseUrl),$(y.slug===t&&l?l:y.defaultModel??""),K(y.apiKeyPlaceholder),O(n&&J(y)?"oauth":"api-key"),Y(""),re(null),xe(!1))},ve=/^[a-z0-9][a-z0-9-]*$/.test(g),Ne=ve&&ge&&D.trim().length>0&&!u.isPending,Xe=i=>{if(i.preventDefault(),!Ne)return;const y={};v.trim()&&(y.base_url=v.trim()),E.trim()&&(y.model=E.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;u.mutate({slug:g.trim(),kind:h,displayName:x.trim()||void 0,apiKey:D.trim(),capabilities:ie},{onSuccess:()=>d()})},ye=!!(t&&s.some(i=>i.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ye&&f?`Connect ${f.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Xe,className:"grid max-w-md gap-3",children:[ye&&f?e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ss,{value:h,onValueChange:He,children:[e.jsx(ts,{id:"ip-provider",className:"w-full",children:e.jsx(ns,{})}),e.jsx(as,{children:s.map(i=>{const y=be(i.modalities);return e.jsx(rs,{value:i.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[i.iconUrl?e.jsx("img",{src:i.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(is,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},i.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-display",children:"Name"}),e.jsx(S,{id:"ip-display",placeholder:"Friendly name",value:x,onChange:i=>N(i.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-slug",placeholder:"my-provider",value:g,onChange:i=>b(i.target.value),autoComplete:"off",required:!0}),g&&!ve?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),pe&&je?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(j,{type:"button",size:"sm",variant:W==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(j,{type:"button",size:"sm",variant:W==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,ge?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(S,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:i=>A(i.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-model",children:"Default model"}),e.jsx(S,{id:"ip-model",placeholder:"gpt-4o-mini",value:E,onChange:i=>$(i.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-key",type:"password",placeholder:X||void 0,value:D,onChange:i=>V(i.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(q,{onCancel:d,children:e.jsx(j,{type:"submit",disabled:!Ne,children:u.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):fe?e.jsxs("div",{className:"grid gap-3",children:[he?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",f?.displayName??"provider",". This covers your agents in this org."]}):Ge?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:I||!P,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(S,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(j,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",f?.displayName??"provider"," to approve",e.jsx(we,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void qe(),disabled:I,children:I?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(j,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ze(),disabled:I||!P,children:["Sign in with ",f?.displayName??"provider",e.jsx(we,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(S,{id:"ip-oauth-code",placeholder:"code#state",value:L,onChange:i=>Y(i.target.value),autoComplete:"off"})]}),e.jsx(j,{type:"button",className:"justify-self-start",onClick:()=>void Ve(),disabled:I||!L.trim(),children:I?"Finishing...":"Finish sign-in"})]}),e.jsx(q,{onCancel:d,children:e.jsx(j,{type:"button",onClick:Te,disabled:!he,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(q,{onCancel:d})]})]})]})}const Is={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Ms({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[l,d]=m.useState(a?"edit":null),u=os(s.kind,t);m.useEffect(()=>{a&&d("edit")},[a]);const o=(t.find(r=>r.slug===s.kind)?.modalities??["text"]).filter(r=>r!=="text"),p=u&&o.length>0,h=r=>d(g=>g===r?null:r);return e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:"Credential"}),e.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[s.slug,s.createdAt?` · created ${_e(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),p?e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>h("capabilities"),children:"Configure"}):null,e.jsx(j,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>h("edit"),children:"Edit"})]})]}),l==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(Ts,{provider:s,supportsUpstreamConfig:u,onDone:()=>d(null)})}):null,l==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),o.map(r=>e.jsx(zs,{providerSlug:s.slug,modality:r,block:s.capabilities[r]??{}},r))]})}):null]})}function Us({provider:s,onDeleted:t}){const a=cs(),[n,l]=m.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>l(!1)}),children:[a.isPending?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(j,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>l(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function Ts({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=ds(),l=us(),d=Fe(),[u,c]=m.useState(s.displayName??""),[o,p]=m.useState(""),h=s.capabilities.text??{},[r,g]=m.useState(h.base_url??""),[b,x]=m.useState(h.model??""),[N,v]=m.useState(null),A=u.trim().length>0&&u.trim()!==(s.displayName??""),E=t&&o.trim().length>0,$=r.trim()!==(h.base_url??""),D=b.trim()!==(h.model??""),V=t&&($||D),X={base_url:r.trim()||void 0,model:b.trim()||void 0,models_endpoint:h.models_endpoint},K=Be(X),W=t&&V&&Le(K),O=n.isPending||l.isPending||d.isPending,L=(A||E||V)&&!W&&!O,Y=async C=>{if(C.preventDefault(),!!L){v(null);try{await Promise.all([A?n.mutateAsync({providerSlug:s.slug,displayName:u.trim()}):Promise.resolve(),V?d.mutateAsync({providerSlug:s.slug,modality:"text",block:X}):Promise.resolve(),E?l.mutateAsync({providerSlug:s.slug,value:o.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:Y,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(S,{id:`edit-name-${s.slug}`,value:u,onChange:C=>c(C.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(S,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:r,onChange:C=>g(C.target.value),autoComplete:"off"}),K.base_url?e.jsx("p",{className:"text-xs text-destructive",children:K.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(S,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:b,onChange:C=>x(C.target.value),autoComplete:"off"}),K.model?e.jsx("p",{className:"text-xs text-destructive",children:K.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(S,{id:`edit-key-${s.slug}`,type:"password",value:o,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,N?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:N}):null,e.jsx(q,{onCancel:a,children:e.jsx(j,{type:"submit",disabled:!L,children:O?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function zs({providerSlug:s,modality:t,block:a}){const n=Fe(),[l,d]=m.useState(!1),[u,c]=m.useState(a.base_url??""),[o,p]=m.useState(a.model??""),[h,r]=m.useState(a.models_endpoint??""),[g,b]=m.useState(!!a.models_endpoint),x=!!(a.base_url||a.model||a.models_endpoint),N={base_url:u.trim()||void 0,model:o.trim()||void 0,models_endpoint:h.trim()||void 0},v=Be(N),A=Le(v),E=()=>{A||n.mutate({providerSlug:s,modality:t,block:N})};return e.jsxs("div",{className:Re,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d($=>!$),children:[e.jsx("span",{className:"text-sm font-medium",children:Is[t]}),x?e.jsx(_,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),l?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(S,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:u,onChange:$=>c($.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(S,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:o,onChange:$=>p($.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),g?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(S,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:h,onChange:$=>r($.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:"Advanced"}),e.jsx(q,{onCancel:()=>d(!1),children:e.jsx(j,{size:"sm",disabled:A||n.isPending,onClick:E,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(z,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function Vs({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(qs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(_,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(_,{className:"h-4 border-transparent bg-emerald-500/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",className:"h-4 border-transparent bg-destructive/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-destructive",children:"No credential"})]}),t.length>0?e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:t.map(([a,n])=>`${a}: ${n}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function Ws({sandbox:s,onDeleted:t}){const a=ms(),[n,l]=m.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(z,{}):"Delete permanently"}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"})]}):e.jsx(j,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>l(!0),children:"Delete sandbox"})]})})}function qs({kind:s}){return s==="vercel"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 shrink-0 fill-foreground","aria-hidden":!0,children:[e.jsx("title",{children:"Vercel"}),e.jsx("path",{d:"M12 3 22 20H2L12 3Z"})]}):s==="builtin"?e.jsx(hs,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(xs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Gs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Hs={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function jt(){const{owner:s,connectorKey:t}=G.useParams(),{instances:a}=G.useSearch(),{kind:n,id:l}=vs(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:u,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Ks,{ownerSlug:d,familyKind:n,familyId:l});switch(n){case"inference":return e.jsx(Qs,{ownerSlug:d,providerSlug:l});case"sandbox":return e.jsx(Ys,{ownerSlug:d,sandboxId:l});case"sandbox-provider":return e.jsx(Xs,{ownerSlug:d,providerKind:l});default:return e.jsx(st,{ownerSlug:d,organizationId:u,isWorkspaceLoading:c,connectorKey:t})}}})}function Xs({ownerSlug:s,providerKind:t}){const a=H();return m.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${oe}${t}`},replace:!0})},[a,s,t]),null}function Ys({ownerSlug:s,sandboxId:t}){const a=H(),{data:n,isLoading:l,isError:d,refetch:u}=De(),c=n?.sandboxes.find(p=>p.id===t)??null;if(l)return e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{className:"h-24 w-full rounded-lg"})]});if(d)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(j,{variant:"outline",onClick:()=>void u(),children:"Retry"})]})});if(!c)return e.jsxs(F,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(j,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const o=c.name||le(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(se,{header:e.jsx(te,{breadcrumb:e.jsx(ne,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${oe}${c.providerKind}`},search:{instances:!0},className:U,children:le(c.providerKind)},"family")]}),icon:e.jsx(me,{name:o,faviconDomain:Ss(c.providerKind)}),title:o,badge:e.jsxs(e.Fragment,{children:[e.jsx(_,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(_,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(_,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Ie,{facets:Hs})}),children:[e.jsx(Vs,{sandbox:c}),e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Qs({ownerSlug:s,providerSlug:t}){const a=H(),{model:n,reason:l,agentId:d,addAccount:u}=G.useSearch(),{data:c=[],isLoading:o,isError:p,refetch:h}=Pe(),r=Se(),{data:g=[],isLoading:b}=r,x=u?null:c.find(D=>D.slug===t)??null,N=g.find(D=>D.slug===(x?.kind??t))??null;if(o||b)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{className:"h-16 w-full rounded-lg"}),e.jsx(k,{className:"h-24 w-full rounded-lg"}),e.jsx(k,{className:"h-32 w-full rounded-lg"})]})});if(p)return e.jsx(F,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(j,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!x&&!N&&!r.isError)return e.jsxs(F,{className:"space-y-3",children:[e.jsx(Oe,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=x?x.displayName||x.slug:N?.displayName||t,A=x!==null,E=l?e.jsx(et,{agentId:d,model:n,providerName:v}):n?e.jsx(Js,{providerName:v,model:n,isConnected:A}):null,$=e.jsx(te,{breadcrumb:e.jsx(ne,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),...x?[e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${x.kind}`},search:{instances:!0},className:U,children:N?.displayName??x.kind},"family")]:[]]}),icon:e.jsx(me,{iconUrl:N?.iconUrl,name:v}),title:v,badge:x?e.jsxs(e.Fragment,{children:[x.isDefault?e.jsx(_,{variant:"secondary",children:"Default"}):null,x.status?e.jsx(_,{variant:"outline",children:x.status}):null,x.hasCustomUpstream?e.jsx(_,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Ie,{facets:Gs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(se,{header:$,children:[E,e.jsx("div",{className:"space-y-6",children:x?e.jsx(Ms,{provider:x,catalog:g,autoOpenEdit:!!n}):e.jsx(Zs,{ownerSlug:s,providerSlug:t,existingSlugs:c.map(D=>D.slug),catalog:g,catalogError:r.isError?r.error:null,model:n})}),x?e.jsx(T,{title:"Settings",muted:!0,children:e.jsx(Us,{provider:x,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Zs({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:l,model:d}){const u=H(),c=n.find(h=>h.slug===t),o=a.includes(t)&&!!c&&J(c);let p=t;for(let h=2;a.includes(p);h++)p=`${t}-${h}`;return l?e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Failed to load provider catalog."}),e.jsx("p",{className:"mt-1 text-xs",children:l instanceof Error?l.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[o&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ee}${t}`},search:{},children:"Open existing connection"})})]}),(!o||c&&Ee(c))&&e.jsx(Os,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!o,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void u({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function Js({providerName:s,model:t,isConnected:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review ",e.jsx("strong",{children:s})," for model"," ",e.jsx("strong",{children:t}),"."," ",a?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function et({agentId:s,model:t,providerName:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"This agent needs a model provider before it can reply."}),e.jsxs("p",{children:[s?e.jsxs("span",{children:["Agent ",e.jsx("strong",{children:s})," is"," "]}):null,"configured to use ",t?e.jsx("strong",{children:t}):"a model"," ","from ",e.jsx("strong",{children:a}),", but that provider is not ready in this workspace."]}),e.jsx("p",{children:"Connect the provider below, then retry the message."})]})]})})}function st({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:l=[],isLoading:d,isError:u,refetch:c}=As(t??""),{data:o=[],isLoading:p,isError:h,refetch:r}=$s(t??"",{connectorKey:n}),{setup:g}=G.useSearch(),b=G.useNavigate(),x=m.useMemo(()=>l.find(A=>A.key===n),[l,n]),N=m.useMemo(()=>Ps(n,l,{name:o[0]?.connector_name??n}),[n,l,o]);if(a||d)return e.jsx("div",{children:e.jsxs(F,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{className:"h-6 w-6 rounded"}),e.jsx(k,{className:"h-5 w-40"})]}),e.jsx(k,{className:"h-16 w-full rounded-lg"}),e.jsx(k,{className:"h-24 w-full rounded-lg"}),e.jsx(k,{className:"h-32 w-full rounded-lg"})]})});if(u||h)return e.jsx(F,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(j,{variant:"outline",onClick:()=>{c(),r()},children:"Retry"})]})});const v=x?e.jsx(nt,{connector:x,ownerSlug:s,organizationId:t??void 0,connectionCount:o.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Oe,{connector:N,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",o.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:x&&t?e.jsx(tt,{hero:v,connector:x,organizationId:t,ownerSlug:s,connectorKey:n,connections:o,isLoading:p,openNewApp:g==="oauth_app",onNewAppHandled:()=>void b({search:A=>({...A,setup:void 0}),replace:!0})}):e.jsxs(F,{className:"space-y-6",children:[v,o.length>0&&!p?e.jsx(Ue,{section:!0,connections:o,ownerSlug:s,connectorKey:n}):p?e.jsx(k,{className:"h-8 w-40"}):e.jsx("div",{children:e.jsx(Me,{ownerSlug:s,connectorKey:n})})]})})}function tt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:l,connections:d,isLoading:u,openNewApp:c,onNewAppHandled:o}){const{isAdmin:p,isLoading:h}=Ke(a),r=(t.operations_summary?.total??0)>0,g=e.jsx(_s,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:o});return e.jsxs(se,{header:s,children:[u?e.jsx(k,{className:"h-8 w-40"}):d.length>0?e.jsx(Ue,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:l,action:g}):g,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(ot,{connector:t,organizationId:a,ownerSlug:n}),r&&h?e.jsx(k,{className:"h-20 w-full rounded-lg"}):r&&p?e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}):r&&!p?e.jsx(T,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null,!u&&d.length>0?e.jsx(it,{connectorKey:l,organizationId:a,ownerSlug:n}):null]}),e.jsx(at,{connector:t,organizationId:a,ownerSlug:n})]})}function nt({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(te,{breadcrumb:e.jsx(ne,{crumbs:[e.jsx(B,{to:"/$owner/connectors",params:{owner:t},className:U,children:"Connectors"},"connectors")]}),icon:e.jsx(me,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Es(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Ls,{connectorDef:s,ownerSlug:t}),a?e.jsx(rt,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function at({connector:s,organizationId:t,ownerSlug:a}){const n=ys(s.auth_schema),l=bs(s.auth_schema),d=Cs(s.auth_schema),u=ks(s.auth_schema),c=n.some(N=>N.type==="env_keys"),o=n.some(N=>N.type==="browser"),p=l.some(N=>N.type==="interactive"),h=!!(d||u||c||o),r=ws(s),{data:g=[]}=Ae(t,{connectorKey:s.key,profileKind:"env"}),{data:b=[]}=Ae(t,{profileKind:"browser_session",connectorKey:s.key});return c&&g.length>0||o&&b.length>0||!h&&(r||p)?e.jsxs("div",{className:"space-y-6",children:[c&&g.length>0?e.jsx($e,{profiles:g,type:"env"}):null,o&&b.length>0?e.jsx($e,{profiles:b,type:"browser_session"}):null,h?null:r?e.jsx(T,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(j,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(B,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):p?e.jsx(T,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const l=H(),{isAdmin:d}=Ke(t),u=ps(),[c,o]=m.useState(null),p=s.installed!==!1;if(!d||!p)return null;const h=n>0,r=u.isPending,g=()=>{o(null),u.mutate({connector_key:s.key},{onSuccess:()=>{l({to:"/$owner/connectors",params:{owner:a}})},onError:b=>{o(b instanceof Error?b.message:"Failed to remove connector")}})};return e.jsxs(js,{onOpenChange:()=>o(null),children:[e.jsx(fs,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(gs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),h?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(j,{variant:"destructive",size:"sm",disabled:r||h,onClick:g,children:[r?e.jsx(z,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function it({connectorKey:s,organizationId:t,ownerSlug:a}){const n=de(),{data:l,isLoading:d}=Rs({connectorKey:s},{runTypes:void 0,status:void 0},a);if(d)return e.jsx(k,{className:"h-[62px] w-full rounded-lg"});const u=l?.pages[0],c=u?.total??0,o=u?.runs[0]?.created_at;return e.jsx(ue,{title:"Runs",summary:c===0?"No runs yet":`${c.toLocaleString()} ${c===1?"run":"runs"}${o?` · last ${_e(o)}`:""}`,onOpen:()=>n?.open({href:"",title:"Runs",connectorPanel:{section:"runs",connectorKey:s,organizationId:t,ownerSlug:a}})})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=de();return e.jsx(ue,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function $e({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(T,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:Ds(Re,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:n.display_name}),e.jsx(Fs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function ot({connector:s,organizationId:t,ownerSlug:a}){const n=de(),l=Object.keys(s.feeds_schema??{}).length;return l?e.jsx(ue,{title:"Feeds",summary:`${l} ${l===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{tt as ConnectorDetailShell,rt as ConnectorRemoveButton,jt as component};
|
|
2
|
+
//# sourceMappingURL=_connectorKey.index-BrJ8Pzze.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,cu as j,h as m,iX as h,iY as p,iZ as d,i_ as u,i$ as w,r as M,au as C,aI as k,j0 as z}from"./index-4gCDI7m4.js";import{A as N}from"./agent-loading-shells-Dnmb6W5Y.js";import{s as b,R as y,A as I}from"./agent-thread-DQIr20H-.js";import"./app-bridge-C4nPtae3.js";import"./use-mention-search-C3rWLuKm.js";import"./index-wHFQv1aT.js";import"./use-automations-BHoV0dLs.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./copy-button-2swYh4jb.js";import"./events-feed-BysC9HgU.js";import"./client-activity-scopes-boZOHuPW.js";import"./client-rows-BJ2PxM4J.js";const O={discord:{hex:`#${u.hex}`,path:u.path},gchat:{hex:`#${d.hex}`,path:d.path},slack:{hex:"#4A154B",path:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},teams:{imgSrc:"https://www.google.com/s2/favicons?domain=teams.microsoft.com&sz=64"},telegram:{hex:`#${p.hex}`,path:p.path},whatsapp:{hex:`#${h.hex}`,path:h.path}};function T({platform:s,className:a}){const t=s?O[s]:null;return t?"imgSrc"in t?e.jsx("img",{src:t.imgSrc,alt:"","aria-hidden":"true",className:m("rounded-sm",a),loading:"lazy"}):e.jsx("svg",{viewBox:t.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:a,style:{color:t.hex},children:e.jsx("path",{d:t.path})}):e.jsx(j,{className:m("text-muted-foreground",a),"aria-hidden":"true"})}const L={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(s,a,t){return s==="slack"&&t?.teamId&&a?`https://app.slack.com/client/${t.teamId}/${a}`:null}function S({owner:s,agentId:a,conversationId:t}){const{data:n=[],isLoading:x}=w(a,t,{orgSlug:s}),i=M.useMemo(()=>n.map(o=>b(o,{showToolCalls:!0})).filter(o=>o!==null),[n]),[r,g]=t.split(":"),l=L[r]??"the source app",{org:f}=C(),{data:v=[]}=k(f?.id??"",{connectorKey:r}),A=v[0]?.config?.chatMetadata,c=R(r,g,A);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:x?e.jsx(N,{readOnly:!0}):i.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No messages in this conversation."}):e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[e.jsx(y,{messages:i,children:e.jsx(I,{readOnly:!0})}),c?e.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center gap-3 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm transition-colors hover:bg-muted",children:[e.jsx(T,{platform:r,className:"size-5 shrink-0"}),e.jsxs("span",{className:"text-muted-foreground",children:["This is a read-only copy. Continue the conversation with this agent in ",l,"."]}),e.jsxs("span",{className:"ml-auto shrink-0 whitespace-nowrap font-medium text-foreground",children:["Open ",l," →"]})]}):null]})})}function e2(){const{owner:s,agentId:a,conversationId:t}=z.useParams();return e.jsx(S,{owner:s,agentId:a,conversationId:t})}export{e2 as component};
|
|
2
|
+
//# sourceMappingURL=_conversationId-BpJAeYYW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as u,v,j as r,aA as x,ca as d,cb as f,cc as h,by as w,cd as j}from"./index-4gCDI7m4.js";import{E}from"./event-detail-DXifj49J.js";import"./events-feed-BysC9HgU.js";import"./event-card-Mcxv56DG.js";import"./use-scroll-sentinel-Ct-jt7O0.js";import"./use-automations-BHoV0dLs.js";import"./clients-C7Lnuc3S.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./copy-button-2swYh4jb.js";import"./client-activity-scopes-boZOHuPW.js";import"./client-rows-BJ2PxM4J.js";import"./view-param-filters-mKoqDsaD.js";import"./app-bridge-C4nPtae3.js";import"./filter-bar-BQm-ubB1.js";function P({owner:e,eventId:t,viewKey:s}){const o=u({strict:!1}),p=v(),m=(i,a)=>r.jsx(E,{owner:a,organizationId:i,eventId:t,viewKey:s,params:s?f(o):{},onParamsChange:(n,l,c)=>void p({to:d(a,t,n),search:l,replace:c?.replace??!0}),fullBleed:!0},`${a}/${t}`);return r.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:e==="me"?m(null,e):r.jsx(x,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):r.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function q(){const{owner:e,eventId:t}=h.useParams(),s=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(t);return o===null?null:r.jsx(P,{owner:e,eventId:o,viewKey:s?.viewKey})}export{q as component};
|
|
2
|
+
//# sourceMappingURL=_eventId-DarQJo0G.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iW as a,j as e}from"./index-4gCDI7m4.js";import{b as i}from"./agent-guardrails-route-BvGgfd-h.js";import"./model-selector-88PJnyTq.js";import"./agent-subpage-shell-DWzljvFb.js";import"./table-DFcJRNk7.js";import"./agent-loading-shells-Dnmb6W5Y.js";import"./agent-card-controls-99mG6H5k.js";function x(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{x as component};
|
|
2
|
+
//# sourceMappingURL=_name-DtmNTcUm.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-0sa10jER.js","assets/index-4gCDI7m4.js","assets/index-DDGdlQrt.css","assets/automation-detail-content-C9Cgr5Zj.js","assets/create-automation-form-DmCOFbRT.js","assets/cronstrue-CKwjNYgj.js","assets/entity-options-BSW_EG0W.js","assets/connection-label-BobuYiAG.js","assets/use-automations-BHoV0dLs.js","assets/model-selector-88PJnyTq.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-rX0t1g5C.js","assets/index-wHFQv1aT.js","assets/use-mention-search-C3rWLuKm.js","assets/proposal-review-shell-B4CSiyLB.js","assets/runs-BPtQBTRN.js","assets/events-feed-BysC9HgU.js","assets/event-card-Mcxv56DG.js","assets/use-scroll-sentinel-Ct-jt7O0.js","assets/clients-C7Lnuc3S.js","assets/renderer-7EGgTVX0.js","assets/calendar-DMq3Dtqy.js","assets/table-DFcJRNk7.js","assets/card-SFtxv9f2.js","assets/json-diff-E5D-NGYT.js","assets/copy-button-2swYh4jb.js","assets/client-activity-scopes-boZOHuPW.js","assets/client-rows-BJ2PxM4J.js","assets/agent-loading-shells-Dnmb6W5Y.js","assets/agent-thread-DQIr20H-.js","assets/app-bridge-C4nPtae3.js","assets/connection-feed-detail-D7pnWaFB.js","assets/runs-panel-Bj63_hb9.js","assets/filter-bar-BQm-ubB1.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-BF-AlunU.js","assets/connections-browser-DDJQh8Na.js","assets/status-dot-D3FoDRcc.js","assets/connector-scope-lists-BibdzKl1.js","assets/source-record-panels-Bh5F4C5K.js","assets/schema-type-editor-panel-CAhOB648.js","assets/entity-type-page-BCBdFndu.js","assets/event-detail-DXifj49J.js","assets/view-param-filters-mKoqDsaD.js","assets/views-access-required-DHrDO333.js","assets/record-session-CWXnCVln.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as x,j as e,r as u,C as b,L as g,u as w,a as k,b as v,c as y,D as j,d as N,e as P,f as R,g as _,h as I,i as E,k as D,B as f,l as S,A,X as C,m as L,_ as z,S as h,R as O,n as T,o as B,q as W,s as $,N as H,O as K}from"./index-4gCDI7m4.js";import{R as U}from"./record-session-CWXnCVln.js";function p({item:s}){const n=s.href?x(s.href):null;if(!n)return null;const t=n.owner,i=n.kind==="automation"?n.automationId:s.sourceAttribution?.automation_id??null,o=s.sourceAttribution,a=[{label:t,to:"/$owner",params:{owner:t}}];return o?.agent_id&&o.agent_name&&a.push({label:o.agent_name,to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:o.agent_id}}),i!=null&&a.push({label:o?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:t,automationId:String(i)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?a.push({label:"Run details"}):n.kind==="event"?a.push({label:"Event details"}):n.kind==="memory"&&"contentIds"in n&&a.push({label:"Details"}),a.length<2?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:a.map((r,l)=>{const c=l===a.length-1,d=e.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:r.label});return e.jsxs(u.Fragment,{children:[l>0?e.jsx(b,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,r.to&&!c?e.jsx(g,{to:r.to,params:r.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:r.label}):d]},r.to??r.label)})})}const V=L(async()=>({default:(await z(async()=>{const{PeekPaneContent:s}=await import("./peek-pane-content-0sa10jER.js");return{PeekPaneContent:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]))).PeekPaneContent}));function q(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(h,{className:"h-5 w-2/3"}),e.jsx(h,{className:"h-4 w-full"}),e.jsx(h,{className:"h-24 w-full rounded-lg"})]})}const F=460,G=480;function M({children:s}){const n=u.useRef(null),t=w(),i=k(),o=v(n,F+G),a=!i&&o&&t?.item!=null;return e.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{inert:a,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:s}),e.jsx(Q,{covers:a})]})}function Q({covers:s=!1}){const n=w(),t=k();return n?.item?e.jsx(J,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:t,covers:s}):null}function X(s){const n=s.href?x(s.href):null,t=n?.kind==="record-view"?n.viewKey:null,i=n?.kind==="entity-type"?n:null,o=i?.typeSlug??null,a=E({slug:t?n?.owner:void 0}),{data:r}=D(o?n?.owner??null:null),l=o?r?.find(c=>c.slug===o)?.name:void 0;return t&&a.data?.find(c=>c.key===t)?.name||l&&(i?.view==="activity"?`${l} activity`:l)||s.title}function J({item:s,onClose:n,onBack:t,isNarrow:i,covers:o}){const a=s.href?y(s.href):null,r=X(s);u.useEffect(()=>{if(i)return;const d=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,i]);const l=d=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[t||d?e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:t??n,children:e.jsx(S,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:r}),a?e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:e.jsx(g,{to:a.pathname,search:a.search??{},onClick:n,children:e.jsx(A,{className:"h-4 w-4"})})}):null,e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:e.jsx(C,{className:"h-4 w-4"})})]}),c=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(u.Suspense,{fallback:e.jsx(q,{}),children:e.jsx(V,{item:s})})});return i?e.jsx(j,{open:!0,onOpenChange:d=>{d||n()},children:e.jsxs(N,{children:[e.jsx(P,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(R,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(_,{className:"sr-only",children:r}),l(!0),e.jsx(p,{item:s}),c]})]})}):e.jsxs("aside",{className:I("flex flex-col border-l border-border bg-background",o?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[l(!1),e.jsx(p,{item:s}),c]})}function ee(){const{owner:s}=O.useParams(),{data:n,isLoading:t,error:i}=T(s==="me"?null:s,{slug:s}),{session:o,isReady:a}=B(),r=W(i)&&!n?.workspace;return $({active:!t&&!r&&a&&!o&&!n?.workspace,owner:s})?null:e.jsx(H,{children:e.jsx(U,{children:e.jsx(M,{children:e.jsx(K,{})})})})}export{ee as component};
|
|
3
|
+
//# sourceMappingURL=_owner-Db8at3hk.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iK as p,j as m,bx as i}from"./index-4gCDI7m4.js";import{M as e}from"./memory-browse-page-CfDmjhDl.js";import"./public-shell-ready-CsenJeXa.js";import"./connector-boxes-DDX7Ebc4.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-DDJQh8Na.js";import"./status-dot-D3FoDRcc.js";import"./connector-scope-lists-BibdzKl1.js";import"./use-automations-BHoV0dLs.js";import"./model-Dn40BUzs.js";import"./cronstrue-CKwjNYgj.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-CAhOB648.js";import"./entity-type-page-BCBdFndu.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./code-editor-rX0t1g5C.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./entity-avatar-HloBoalJ.js";import"./filter-bar-BQm-ubB1.js";import"./core.esm-CHnfRiEM.js";import"./view-param-filters-mKoqDsaD.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-vp3FihBD.js";function A(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{A as component};
|
|
2
|
+
//# sourceMappingURL=_shape-6iFA8A86.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iU as r,j as e}from"./index-4gCDI7m4.js";import{b as m}from"./agent-skills-route-DFXr_bHp.js";import"./agent-skill-context-V__2i6Vl.js";import"./core.esm-CHnfRiEM.js";import"./skill-editor-D_W3QlRz.js";import"./agent-subpage-shell-DWzljvFb.js";import"./agent-loading-shells-Dnmb6W5Y.js";import"./agent-card-controls-99mG6H5k.js";function c(){const{owner:t,agentId:o,skillKey:i}=r.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:i})}export{c as component};
|
|
2
|
+
//# sourceMappingURL=_skillKey-CXkHn3Nl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=_slug-
|
|
1
|
+
import{gj as m,t as d,v as x,fL as y,f1 as c,j as t,bJ as g}from"./index-4gCDI7m4.js";import{E as u}from"./entity-type-page-BCBdFndu.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./code-editor-rX0t1g5C.js";function b(){const{owner:a,slug:n}=m.useParams(),{orgContext:s}=d(),o=x(),{data:i=[],isLoading:p}=y(s),e=i.find(l=>l.slug===n)??null,r=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:p?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:r,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
|
|
2
|
+
//# sourceMappingURL=_slug-DBOuBLoX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iR as t,j as m}from"./index-4gCDI7m4.js";import{M as i}from"./memory-browse-page-CfDmjhDl.js";import"./public-shell-ready-CsenJeXa.js";import"./connector-boxes-DDX7Ebc4.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-DDJQh8Na.js";import"./status-dot-D3FoDRcc.js";import"./connector-scope-lists-BibdzKl1.js";import"./use-automations-BHoV0dLs.js";import"./model-Dn40BUzs.js";import"./cronstrue-CKwjNYgj.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-CAhOB648.js";import"./entity-type-page-BCBdFndu.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./code-editor-rX0t1g5C.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./entity-avatar-HloBoalJ.js";import"./filter-bar-BQm-ubB1.js";import"./core.esm-CHnfRiEM.js";import"./view-param-filters-mKoqDsaD.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-vp3FihBD.js";function k(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{k as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-DC27aIN9.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j1 as p,j as i,bx as m}from"./index-4gCDI7m4.js";import{M as e}from"./memory-browse-page-CfDmjhDl.js";import"./public-shell-ready-CsenJeXa.js";import"./connector-boxes-DDX7Ebc4.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-DDJQh8Na.js";import"./status-dot-D3FoDRcc.js";import"./connector-scope-lists-BibdzKl1.js";import"./use-automations-BHoV0dLs.js";import"./model-Dn40BUzs.js";import"./cronstrue-CKwjNYgj.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-CAhOB648.js";import"./entity-type-page-BCBdFndu.js";import"./json-diff-E5D-NGYT.js";import"./index-wHFQv1aT.js";import"./code-editor-rX0t1g5C.js";import"./renderer-7EGgTVX0.js";import"./calendar-DMq3Dtqy.js";import"./table-DFcJRNk7.js";import"./card-SFtxv9f2.js";import"./entity-avatar-HloBoalJ.js";import"./filter-bar-BQm-ubB1.js";import"./core.esm-CHnfRiEM.js";import"./view-param-filters-mKoqDsaD.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-vp3FihBD.js";function z(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{z as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-DuYDieln.js.map
|
package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-BbDCVvur.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=accept-invitation-
|
|
1
|
+
import{o as l,ai as u,r as c,Q as m,j as e,aj as d,ak as h,al as f,a5 as v,am as x,ag as g}from"./index-4gCDI7m4.js";import{F as p}from"./full-page-spinner-BMiXl54z.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function y(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{y as component};
|
|
2
|
+
//# sourceMappingURL=accept-invitation-BbDCVvur.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as at,au as H,cg as C,bx as R,ch as W,r as y,v as V,ar as it,ci as ot,j as t,bJ as D,b4 as A,cj as ct,ck as z,cl as lt,cm as U,B as _,L as g,cn as G,co as rt,bq as dt,bt as ut,bd as mt,cp as xt,cq as ht,cr as L,cs as pt,ct as K,cu as q,cv as Y,bj as J,cw as ft,aI as gt,cx as vt,h as Z,cy as jt,cz as bt,cA as Q,cB as wt,u as yt,cC as kt,cD as Nt,c as X,cE as It,cF as $t,cG as _t,aA as At}from"./index-4gCDI7m4.js";import{R as Et,E as Rt,S as Ct,N as P,M as Lt}from"./record-activity-D7bRaMk2.js";import{M as Mt}from"./member-scope-gate-vp3FihBD.js";import{u as St}from"./client-activity-scopes-boZOHuPW.js";import{a as Tt}from"./client-rows-BJ2PxM4J.js";import{P as Pt}from"./public-shell-ready-CsenJeXa.js";function Ft({organizationId:s,ownerSlug:n,typeScope:c,entityScope:i,attentionOnly:l=!1}){const{orgContext:r}=at(),{isMember:o,isLoading:a}=H(),p=o&&!!s,{attentionItems:e,isError:u}=C(n),d=c?R(c):void 0,m=!i&&!d,{feeds:x,rows:f,pageRows:v}=W(s,e),N=y.useMemo(()=>new Set(v.flatMap(({item:T})=>T.approvalRunId!=null?[T.approvalRunId]:[])),[v]),E=V(),I=()=>void E({to:"/$owner",params:{owner:n},search:{attention:"1"}}),{data:b,isLoading:h,error:k}=it(i?`/${n}/${ot(i)}`:`/${n}`,r),w=i?b?.entity:void 0,j=(i?w?.entity_type??R(i.split("/").at(-2)??""):d)==="$member",et=i!=null&&!h&&(k!=null||b?.entity==null),$=i?void 0:b?.counts,nt=$?$.connections>0||$.agents>0:!1,st=p&&!a&&!h&&$!=null&&!nt,S=i&&h?t.jsx(D,{label:"Loading record…"}):et?t.jsx(A,{icon:ct,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):l&&m?t.jsx(Ot,{owner:n,items:f,isError:u}):w?t.jsx(Et,{ownerSlug:n,entity:w,organizationId:s}):t.jsx(Rt,{organizationId:s,ownerSlug:n,hideSourceFilter:!0,scopedEntityTypes:d?[d]:void 0,pinned:m&&(v.length>0||x.length>0)?{rows:t.jsx(z,{owner:n,organizationId:s,feeds:x,rows:v}),hiddenApprovalRunIds:N}:void 0,onShowNotifications:m?I:void 0,emptyState:st?t.jsx(Ht,{ownerSlug:n}):void 0});return t.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:j?t.jsx(Mt,{children:S}):S})}function Ot({owner:s,items:n,isError:c}){const i=V();return t.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[t.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:n.length>0?`${n.length} ${n.length===1?"notification":"notifications"}`:null}),t.jsx(Bt,{owner:s}),t.jsx(Ct,{value:P.value,withNotifications:!0,onChange:l=>{if(l===P.value)return;const[r,o]=l.split("-");i({to:"/$owner",params:{owner:s},search:lt({sortBy:r,sortOrder:o})})}})]}),c?t.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):n.length===0?t.jsx(A,{icon:U,title:"All caught up",description:"Nothing needs you right now.",children:t.jsx(_,{asChild:!0,variant:"outline",className:"mt-4",children:t.jsx(g,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):t.jsx(G,{owner:s,rows:n})]})}function Bt({owner:s}){const{visibleUnreadIds:n,markVisibleRead:c,bulkPending:i}=C(s);return n.length===0?null:t.jsxs(_,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:i,onClick:()=>void c(),children:[t.jsx(U,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function Ht({ownerSlug:s}){return t.jsx("div",{className:"px-6",children:t.jsx(A,{icon:rt,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:t.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[t.jsx(_,{asChild:!0,children:t.jsxs(g,{to:"/$owner/connectors/create",params:{owner:s},children:[t.jsx(dt,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),t.jsx(_,{asChild:!0,variant:"outline",children:t.jsxs(g,{to:"/$owner/agents",params:{owner:s},children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const F=12,Wt=5e3;function Vt(s,n){const c=!!s&&!!n.organizationId&&(n.enabled??!0),i=mt({enabled:c}),{data:l}=i,r=l??[],o=y.useMemo(()=>r.map(x=>x.agentId),[r]),{threads:a,isLoading:p,isError:e}=xt(s,o,{enabled:c&&o.length>0,limit:F}),u=St({enabled:c,limit:F,excludeCommandClients:!1,organizationId:n.organizationId,refetchInterval:x=>x?Wt:!1}),d=n.organizationId?u.data:void 0;return{items:y.useMemo(()=>[...a.map(x=>({kind:"conversation",at:x.updatedAt,thread:x})),...(d??[]).map(x=>({kind:"mcp",at:x.lastCallAt,conversation:x}))].sort((x,f)=>f.at-x.at),[d,a]),agents:r,isLoading:c&&(i.isLoading||p||u.isLoading),isError:i.isError||e||u.isError}}function Dt(s){return s==="attention"?{attention:"1"}:s==="all"?{}:{tab:s}}function zt(s,n,c,i=[]){const l=new Map(i.map(e=>[e.id,e])),r=new Map;for(const e of[...n.filter(u=>u.kind==="notification"),...c])r.set(e.notification_id!=null?`n:${e.notification_id}`:e.id,e);const o=new Set([...r.values()].flatMap(e=>e.run_id!=null?[e.run_id]:[])),a=new Map,p=new Set(n.flatMap(e=>e.kind==="automation_due"&&e.run_id!=null?[e.run_id]:[]));for(const e of[...n.filter(u=>u.kind!=="notification"&&(u.kind==="automation_due"||u.run_id==null||!p.has(u.run_id))&&(u.run_id==null||!o.has(u.run_id))),...r.values()])a.set(e.id,e);return[...a.values()].map(e=>{const u=e.connection_id!=null?l.get(e.connection_id):void 0,d={...e,platform:e.platform||u?.connector_key,connection_name:e.connection_name||u?.display_name},m=e.kind==="notification"?"notification":e.kind==="sync"?"feed":e.kind==="automation_run"||e.kind==="automation_due"?"automation":"run",x=m==="automation"&&e.automation_id!=null?`automation:${e.automation_id}`:(m==="feed"||m==="run")&&e.connection_id!=null?`connection:${e.connection_id}`:null;return{id:e.id,at:new Date(e.at).getTime(),title:e.title,detail:e.kind==="run"&&e.status&&!L(e.status)?e.status:e.body||e.status,kind:m,subject:x,subjectLabel:e.automation_name||d.connection_name||e.title,href:m!=="notification"&&e.run_id!=null?m==="automation"&&e.automation_id!=null?`/${s}/automations/${e.automation_id}?run_id=${e.run_id}`:`/${s}/events?run_ids=${e.run_id}`:e.href,card:e,source:d}})}function Ut(s,n,c){return n.map(i=>{if(i.kind==="mcp"){const e=i.conversation,u=s==="me"||e.organizationId==null?"/me/events":`/${s}/agents/connected/${encodeURIComponent(e.clientId)}/activity`,d=new URLSearchParams({mcp_activity_id:e.activityId});return(s==="me"||e.organizationId==null)&&d.set("client_ids",e.clientId),{id:`client:${e.clientId}:${e.activityId}`,at:i.at,title:Tt(e),detail:`${e.clientName||"Connected app"} · ${e.callCount} ${e.callCount===1?"call":"calls"}${e.isLive?" · Active":""}`,href:`${u}?${d}`,kind:"session",subject:`client:${e.clientId}`,subjectLabel:e.clientName||"Connected app",source:{client_id:e.clientId,client_name:e.clientName}}}const l=i.thread,r=c.get(l.agentId)||"Agent",o=l.platform||"web",a=ht(s,l.agentId,l.id),p=o==="web"?Object.entries(a.params).reduce((e,[u,d])=>e.replace(`$${u}`,encodeURIComponent(d)),a.to):`/${s}/agents/${encodeURIComponent(l.agentId)}/conversations/${encodeURIComponent(l.conversationId??l.id)}`;return{id:`thread:${l.agentId}:${l.id}`,at:i.at,title:l.title||"Conversation",detail:`${r} · ${o==="web"?"Chat":o}${l.isRunning?" · Active":""}`,href:p,kind:"session",subject:`agent:${l.agentId}`,subjectLabel:r,source:{agent_id:l.agentId,agent_name:r,platform:o==="web"?null:o}}})}function Gt(s){const n=new Map;for(const c of[...s].sort((i,l)=>l.at-i.at||i.id.localeCompare(l.id))){const i=new Date(c.at),l=`${i.getFullYear()}-${i.getMonth()}-${i.getDate()}`,r=c.subject?`${c.kind}:${c.subject}:${l}`:c.id,o=n.get(r)??{key:r,entries:[]};o.entries.push(c),n.set(r,o)}return[...n.values()]}const O=[{view:"all",label:"Activity",icon:pt},{view:"attention",label:"Needs attention",icon:K},{view:"sessions",label:"Sessions",icon:q},{view:"feeds",label:"Feeds",icon:Y},{view:"automations",label:"Automations",icon:J}];function Kt({owner:s,view:n,organizationId:c}){const{isMember:i,isPublic:l,isLoading:r}=H(s),o=l&&!i&&!r,a=o&&(n==="attention"||n==="sessions")?"all":n,p=o?O.filter(h=>h.view!=="attention"&&h.view!=="sessions"):O,{data:e=[]}=ft(c),{data:u=[]}=gt(a==="all"||a==="feeds"||a==="automations"?c:null),d=C(o?null:s),m=W(o?null:c,d.attentionItems),x=a==="all"&&(m.feeds.length>0||m.pageRows.length>0),f=Vt(s,{organizationId:c,enabled:!o&&(a==="all"||a==="sessions")}),v=vt(a==="attention"||a==="sessions"?null:s,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:a==="feeds"?["sync"]:a==="automations"?["automation","automation_due"]:void 0}),N=y.useMemo(()=>{const h=new Map(f.agents.map(j=>[j.agentId,j.name])),k=a==="all"||a==="sessions"?Ut(s,f.items,h):[],w=a==="attention"?[]:zt(s,[...v.data??[],...a==="all"?d.notificationCards:[]],a==="all"?d.attentionCards:[],u),M=new Set(a==="all"?m.pageRows.map(({item:j})=>j.id):[]);return Gt([...w,...k].filter(j=>!M.has(j.id)))},[s,m.pageRows,a,f.agents,f.items,v.data,u,d.attentionCards,d.notificationCards]),E=c==null||(a==="attention"?d.isLoading:a!=="sessions"&&v.isLoading||(a==="all"||a==="sessions")&&f.isLoading||a==="all"&&d.isLoading),I=a==="attention"?d.isError:a!=="sessions"&&v.isError||(a==="all"||a==="sessions")&&f.isError||a==="all"&&d.isError,b=a==="attention"?d.attentionItems.length===0:N.length===0&&!x;return t.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[t.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap items-center gap-1.5",children:p.map(({view:h,label:k,icon:w})=>t.jsxs(g,{to:"/$owner",params:{owner:s},search:Dt(h),activeOptions:{exact:!0},"aria-current":a===h?"page":void 0,className:Z("inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium transition-colors",a===h?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[t.jsx(w,{"aria-hidden":"true",className:"size-3.5"}),k,h==="attention"&&d.attentionItems.length>0?t.jsx("span",{className:"text-xs tabular-nums",children:d.attentionItems.length}):null]},h))}),a==="attention"?t.jsx(jt,{owner:s}):null,I?t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,E&&b?t.jsx(D,{label:"activity"}):b?I?null:t.jsx(A,{icon:bt,title:a==="attention"?"All caught up":o?"No public activity":"No recent activity",description:a==="attention"?"Nothing needs you right now.":o?"Runs on this workspace's public connections show up here.":"New activity will appear here as your agents, apps, and feeds work."}):a==="attention"?t.jsx(G,{owner:s,rows:m.rows}):t.jsxs(t.Fragment,{children:[x?t.jsx("div",{className:"space-y-1",children:t.jsx(z,{owner:s,organizationId:c,feeds:m.feeds,rows:m.pageRows})}):null,t.jsx("ul",{className:"divide-y divide-border/60",children:N.map(h=>t.jsx("li",{children:t.jsx(qt,{owner:s,group:h,connectorDefinitions:e})},h.key))})]}),!b&&a!=="attention"?t.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[o&&a==="all"?t.jsx(g,{to:"/$owner/data",params:{owner:s},children:"Browse memory"}):null,a==="all"||a==="feeds"?t.jsx(g,{to:"/$owner/connectors",params:{owner:s},children:"Browse feeds"}):null,a==="all"||a==="automations"?t.jsx(g,{to:"/$owner/automations",params:{owner:s},children:"Automation history"}):null,a==="sessions"?t.jsx(g,{to:"/$owner/agents",params:{owner:s},children:"Browse agents and apps"}):null]}):null]})}function qt({owner:s,group:n,connectorDefinitions:c}){const[i,l]=y.useState(!1),r=y.useId(),o=n.entries[0];if(n.entries.length===1)return t.jsx(B,{owner:s,entry:o,connectorDefinitions:c});const a=n.entries.filter(e=>L(e.card?.status??"")).length,p=o.kind==="session"?"sessions":o.kind==="feed"?"syncs":o.kind==="run"?"operations":"runs";return t.jsxs("div",{children:[t.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":r,onClick:()=>l(!i),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[t.jsx(tt,{entry:o,connectorDefinitions:c}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm font-medium",children:o.subjectLabel}),t.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[n.entries.length," recent ",p,a>0?t.jsxs("span",{className:"text-destructive",children:[" · ",a," failed"]}):null,o.kind==="session"?null:` · ${o.detail??""}`]})]}),t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Q(o.at)}),t.jsx(wt,{"aria-hidden":!0,className:Z("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",i&&"rotate-180")})]}),t.jsxs("ul",{id:r,hidden:!i,className:"ml-4 border-l pl-3",children:[i?n.entries.map(e=>t.jsx("li",{children:t.jsx(B,{owner:s,entry:e,connectorDefinitions:c})},e.id)):null,i&&o.card?.href?t.jsx("li",{children:t.jsx(Yt,{entry:o})}):null]})]})}function Yt({entry:s}){const n=X(s.card?.href??"");return t.jsx(g,{to:n.pathname,search:n.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 tt({entry:s,connectorDefinitions:n}){const c=s.kind==="session"?q:s.kind==="feed"?Y:s.kind==="automation"?J:It;return t.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:t.jsx($t,{source:s.source,connectorDefinitions:n,label:s.subjectLabel,fallback:t.jsx(c,{className:"h-4 w-4 text-muted-foreground"})})})}function B({owner:s,entry:n,connectorDefinitions:c}){const i=yt();if(n.kind==="notification"&&n.card)return t.jsx(kt,{owner:s,item:Nt({...n.card,...n.source})});const l=t.jsxs(t.Fragment,{children:[t.jsx(tt,{entry:n,connectorDefinitions:c}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm font-medium",children:n.title}),t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[L(n.card?.status??"")?t.jsx(K,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,t.jsx("span",{className:"truncate",children:n.detail})]})]}),t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Q(n.at)})]}),r="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!n.href)return t.jsx("div",{className:r,children:l});const o=X(n.href);return t.jsx(g,{to:o.pathname,search:o.search,className:r,onClick:a=>{!i||!n.card||n.kind==="session"||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.button!==0||(a.preventDefault(),i.open({href:n.href??"",title:n.title,runId:n.card.run_id??void 0,body:n.card.body,createdAt:n.card.at,owner:s,sourceAttribution:n.source??n.card}))},children:l})}function ne({owner:s,search:n,entityScope:c,home:i=!1}){const l=typeof n.type=="string"&&n.type.trim()?R(n.type.trim()):void 0,r=typeof n.tab=="string"?n.tab:"events",o=r==="sessions"||r==="feeds"||r==="automations"?r:"events",a=String(n.attention)==="1",p=Object.entries(n).some(([e,u])=>(_t.includes(e)||e.startsWith("clf_"))&&u!=null&&u!=="");return t.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[t.jsx(Pt,{}),t.jsx(At,{owner:s,children:e=>t.jsx(Lt,{organizationId:e.organizationId,isWorkspaceLoading:e.isWorkspaceLoading,children:t.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:(i||o!=="events")&&!p&&!l&&!c?t.jsx(Kt,{owner:e.ownerSlug,organizationId:e.organizationId,view:a?"attention":o==="events"?"all":o}):t.jsx(Ft,{organizationId:e.organizationId,ownerSlug:e.ownerSlug,typeScope:l,entityScope:c,attentionOnly:a})})})})]})}export{ne as A};
|
|
2
|
+
//# sourceMappingURL=activity-route-view-V4ftmSN7.js.map
|
package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-99mG6H5k.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,
|
|
2
|
-
//# sourceMappingURL=agent-card-controls-
|
|
1
|
+
import{j as e,f7 as i,C as l,h as c}from"./index-4gCDI7m4.js";function x({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{x as A};
|
|
2
|
+
//# sourceMappingURL=agent-card-controls-99mG6H5k.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{j as o,L as p,bu as h}from"./index-4gCDI7m4.js";const m="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function s(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function i(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return s(t)?n:`${n} --url ${t}`}function r(e,t){return`npx @lobu/cli@latest connect ${e} --url ${t}`}const d={label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"};function u(e){return[`Paste the prompt into ${e} and review its proposed setup.`,"Approve Lobu sign-in in your browser or through the email approval link.",`Let ${e} verify access with a harmless read in this workspace.`]}const l=[{id:"claude",label:"Claude",tagline:"Web, desktop, and coding agent for one workspace",description:"Claude web, desktop, and Code apps for this workspace.",installTitle:"Add in one click, or run in your terminal",installLink:e=>({label:"Add Lobu to Claude",href:`https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Lobu&connectorUrl=${encodeURIComponent(e)}`}),installText:e=>i("claude-code",e),promptUrl:e=>`https://claude.ai/new?q=${encodeURIComponent(e)}`,steps:e=>["Claude: open the Add to Claude link above and complete sign-in.",...s(e)?["The CLI adds Lobu's marketplace and installs the shared plugin."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Start a fresh Claude Code session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"},{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"ChatGPT web connector and Codex coding agent for this workspace.",installTitle:"Pick a surface",installLink:e=>s(e)?{label:"Use Lobu in ChatGPT",href:"https://chatgpt.com/plugins/plugin_asdk_app_6a73b856e4348191a97dc8e3a1e58a94"}:null,promptUrl:e=>`https://chatgpt.com/?q=${encodeURIComponent(e)}`,installText:e=>s(e)?i("codex",e):["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${i("codex",e)}`].join(`
|
|
2
|
+
`),steps:e=>s(e)?["ChatGPT web: open the Lobu listing above and complete sign-in.","Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>r("opencode",e),steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>r("antigravity",e),steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>r("cursor",e),steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[d]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>u("OpenClaw"),guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>u("Hermes"),guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Not listed here",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[d]}],L=["Connect my Gmail to Lobu.","Create a Lobu automation that sends me a morning briefing.","In Lobu, design a data model with entities and relationships for tracking deals.","Remember in Lobu that I prefer short answers that lead with the key point."],g={codex:"chatgpt","claude-code":"claude","claude-desktop":"claude"};function f(e){const t=g[e]??e;return l.find(n=>n.id===t)}function k(e){const{workspaceName:t,owner:n,mcpUrl:a,clientLabel:c}=e;return[`Connect this${c?` ${c}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${a}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${m}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
3
|
+
`)}function b(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function w({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:l.map((n,a)=>o.jsxs(p,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:b(a,l.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(h,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{w as A,L as F,k as b,f};
|
|
4
|
+
//# sourceMappingURL=agent-client-setup-list-kMmqQSrf.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Q as w,j as e,aL as y,gk as v,b5 as L,gl as k,L as h,gm as P,n as S,r as R,hq as _,fZ as o,B as j,A as b,bu as N}from"./index-4gCDI7m4.js";import{A as I,f as M,b as $,F as C}from"./agent-client-setup-list-kMmqQSrf.js";import{C as m}from"./copy-button-2swYh4jb.js";import{u as B}from"./clients-C7Lnuc3S.js";import{g as T,c as E}from"./client-rows-BJ2PxM4J.js";const O="app.lobu.ai";function U(s,a){const n=a?`/mcp/${a}`:"/mcp";if(!s)return`http://localhost:8787${n}`;try{const r=new URL(s);return r.hostname===O&&(r.hostname="lobu.ai"),r.pathname=n,r.toString()}catch{return`${s}${n}`}}function F(s){return U(w,s)}const p="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function D(s,a){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${s===a-1?"":"border-b"}`}function A({owner:s}){return e.jsx(k,{crumbs:[e.jsx(h,{to:"/$owner/agents",params:{owner:s},className:P,children:"Agents"},"agents")]})}function K({owner:s}){return e.jsx("div",{className:p,children:e.jsxs(y,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(v,{breadcrumb:e.jsx(A,{owner:s}),icon:e.jsx(L.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(I,{owner:s})]})})}function Q({owner:s,clientId:a}){const n=M(a),{data:r}=S(s,{slug:s}),{data:u=[]}=B(null,{refetchInterval:2500}),l=R.useMemo(()=>T(u).filter(t=>t.connected),[u]);if(!n)return e.jsx("div",{className:p,children:e.jsxs(y,{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(h,{to:"/$owner/agents/connect",params:{owner:s},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const c=F(s),d=$({workspaceName:r?.workspace?.name??s,owner:s,mcpUrl:c,clientLabel:n.id==="other"?void 0:n.label,terminalLogin:n.terminalLogin}),x=n.setupMode==="agent-prompt",g=x?d:n.installText?.(c)??d;return e.jsx("div",{className:p,children:e.jsxs(_,{header:e.jsx(v,{breadcrumb:e.jsx(A,{owner:s}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(N,{name:n.label})}),title:n.label,caption:n.description}),children:[e.jsx(o,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[(()=>{const t=n.installLink?.(c);return t?e.jsx("div",{children:e.jsx(j,{asChild:!0,children:e.jsxs("a",{href:t.href,target:"_blank",rel:"noreferrer",children:[t.label,e.jsx(b,{className:"ml-1.5 h-3.5 w-3.5"})]})})}):null})(),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n.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:g}),e.jsx(m,{text:g,label:x?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:n.steps(c).map((t,i)=>e.jsxs("li",{children:[i+1,". ",t]},t))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[x?null:e.jsx(m,{text:d,label:"Copy setup prompt"}),n.guideLinks.map(t=>e.jsx(j,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:t.href,target:"_blank",rel:"noreferrer",children:[t.label,e.jsx(b,{className:"ml-1.5 h-3.5 w-3.5"})]})},t.href))]})]})}),e.jsx(o,{title:"First prompts",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),e.jsx("div",{className:"overflow-hidden rounded-lg border",children:C.map((t,i)=>{const f=n.promptUrl?.(t);return e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${i===C.length-1?"":"border-b"}`,children:[f?e.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"min-w-0 flex-1 text-sm hover:underline",children:t}):e.jsx("p",{className:"min-w-0 flex-1 text-sm",children:t}),e.jsx(m,{text:t,label:"prompt",iconOnly:!0})]},t)})})]})}),e.jsx(o,{title:"Connected agents",count:l.length>0?String(l.length):void 0,children:l.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:l.map((t,i)=>e.jsxs(h,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t.clientId},className:D(i,l.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(N,{name:t.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:E(t)})]})]},t.key))})}),e.jsx(o,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:c})]})})]})})}export{K as A,Q as a};
|
|
2
|
+
//# sourceMappingURL=agent-connect-pages-B-NPTFs6.js.map
|
package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-DfMTSIvj.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ax as ye,ay as Ne,j as e,B as j,d8 as Ce,ev as Se,b0 as Me,T as Ae,eJ as ke,cS as X,dK as J,d3 as Ie,h3 as Pe,h4 as Te,h5 as Fe,h6 as De,gm as Ee,h7 as Re,bO as _e,bP as $e,az as Le,r as Y,bH as $,fh as Q,bS as Be,E as b,fP as L,I as z,U as Oe,bn as Ue,bo as ze,bp as qe,bq as Ve,br as Z}from"./index-JmEl29py.js";import{b as Ge,s as He}from"./model-selector-BeFuFH7p.js";function Ke(a){const t=a.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(t?/^[a-z]/.test(t)&&t.length>=3?t:`agent-${t}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function We(a,t){const r=new Set(t),x=Ke(a);let v=x,u=2;for(;r.has(v);){const g=`-${u}`;v=`${x.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return v}const Xe="__unresolved__";function ee(a){return a.endsWith(`/${Xe}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Je(a,t){const{slug:r,model:x}=se(a);return{provider:t.find(g=>g.value===a)?.provider??t.find(g=>se(g.value).slug===r)?.provider??r,model:x}}function Ye({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=Ge(x,v),g=(s,c)=>{const l=s+c;if(l<0||l>=a.length)return;const m=[...a];[m[s],m[l]]=[m[l],m[s]],t(m)},k=s=>{t(a.filter((c,l)=>l!==s))},I=s=>{a.includes(s)||t([...a,s])},o=u.filter(s=>!a.includes(s.value)&&!ee(s.value));return e.jsxs("div",{className:"grid gap-2",children:[a.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:a.map((s,c)=>{const l=ee(s),{provider:m,model:i}=Je(s,u);return e.jsxs("li",{className:Ae("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",l&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:m}),c===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:l?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:r||c===0,onClick:()=>g(c,-1),children:e.jsx(Ce,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:r||c===a.length-1,onClick:()=>g(c,1),children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:r,onClick:()=>k(c),children:e.jsx(Me,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ke,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(j,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:r,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(Ie,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,c)=>{const l=c.trim(),m=He(l,u)&&!a.includes(l);return e.jsxs(e.Fragment,{children:[o.map(i=>e.jsxs(X,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(J,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),m?e.jsxs(X,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(J,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:l})]})]}):null]})}})]})}const Qe=3,Ze=72,es=2e3;function te(a){return Array.from({length:Qe},(t,r)=>a?.[r]??{title:"",message:""})}function ae(a){return a.map(({title:t,message:r})=>({title:t.trim(),message:r.trim()})).filter(({title:t,message:r})=>t&&r)}function ns({mode:a,section:t="identity",existingAgentIds:r=[],onCreated:x,onCancel:v,onDone:u,reviewMode:g="none",reviewProposal:k=null,reviewControlsDisabled:I=!1}){const o=a.kind==="create",s=a.kind==="edit"?a.agent:null,c=!o&&t!=="platforms"&&t!=="skills"&&!!s,l=Pe(),m=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:q}=Ee(s?.agentId,{enabled:c}),V=!o&&g==="active"?k:null,B=V?Re(V.proposal):void 0,N=p,G=s?.agentId??"create",d=_e(G,{name:B?.name??s?.name??"",description:B?.description??s?.description??"",identityMd:B?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:N?.models??N?.settings?.models??[],showToolCalls:N?.showToolCalls??N?.settings?.showToolCalls??!1,sandboxId:N?.sandboxId??N?.settings?.sandboxId??"builtin",starters:te(p?.starters)}),[w,ne]=d.field("name"),[C,le]=d.field("description"),[T,re]=d.field("identityMd"),[F,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[E,oe]=d.field("models"),[R,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,H]=d.field("starters"),[ue,_]=$e(G,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=Y.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:We(w,r),name:w.trim(),description:C.trim()||void 0});x?await x(h.agentId):u?.();return}if(s){if(!p){$.error("Still loading agent settings — try again in a moment");return}if(y.some(({title:h,message:M})=>!!h.trim()!=!!M.trim())){$.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([m.mutateAsync({name:w.trim()||s.name,description:C.trim()||void 0}),P.mutateAsync({identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:E,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:R,sandboxId:S==="builtin"?void 0:S,starters:ae(y)})]),d.accept(d.values,{name:w.trim()||s.name,description:C.trim()||s.description||"",identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:E,showToolCalls:R,sandboxId:S,starters:te(ae(y))}),$.success("Agent saved"),u?.()}catch(h){$.error(h instanceof Error?h.message:"Failed to save agent")}}}},[p,l,C,d.accept,d.values,d.canSubmit,S,r,T,o,E,w,x,u,s,R,F,y,m,P,D]),xe=Y.useCallback(async()=>{s&&(await i.mutateAsync(),_(!1),u?.())},[i,u,s,_]),O=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&q)return e.jsx(Q,{rows:6});const f=O||I,fe=g==="none"||g==="gone",ve=w.trim().length>0&&pe,be=o||t==="settings",je=!o&&(t==="identity"||t==="settings"),we=!o&&t==="settings",K=!o&&t==="settings",W=!o&&t==="models";return e.jsxs("form",{onSubmit:he,className:"flex min-h-0 flex-col",children:[e.jsx(Be,{visible:d.hasConflict,onReload:d.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[je?q?e.jsx(Q,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx(L,{id:"identity-md",rows:6,value:T,onChange:n=>re(n.target.value),disabled:f,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx(L,{id:"soul-md",rows:6,value:F,onChange:n=>ie(n.target.value),disabled:f,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx(L,{id:"user-md",rows:6,value:D,onChange:n=>de(n.target.value),disabled:f,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,be?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(z,{id:"agent-name",placeholder:"Support Bot",value:w,onChange:n=>ne(n.target.value),disabled:f,required:!0}),o?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),o?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx(L,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:C,onChange:n=>le(n.target.value),disabled:f,rows:3})]})]}):null,K?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(Oe,{id:"show-tool-calls",checked:R,onCheckedChange:n=>ce(n===!0),disabled:f,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,K?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Conversation starters"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to three prompts offered on a new chat, on the web and in Slack. The message is sent as the user when tapped."}),y.map((n,h)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[12rem_1fr]",children:[e.jsx(z,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Ze,value:n.title,onChange:M=>H(y.map((A,U)=>U===h?{...A,title:M.target.value}:A)),disabled:f}),e.jsx(z,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:M=>H(y.map((A,U)=>U===h?{...A,message:M.target.value}:A)),disabled:f})]},h))]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Ye,{value:E,onChange:oe,disabled:f}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Ue,{value:S,onValueChange:me,disabled:f,children:[e.jsx(ze,{id:"agent-sandbox",className:"w-full",children:e.jsx(qe,{placeholder:"Built-in"})}),e.jsxs(Ve,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{value:n.id,children:[n.name," (",n.providerKind,")",n.connected?"":" — no credential"]},n.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),fe?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[we?ue?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(j,{type:"button",variant:"destructive",onClick:()=>void xe(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>_(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v?e.jsx(j,{type:"button",variant:"outline",onClick:v,disabled:O,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||O,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
|
|
2
|
-
//# sourceMappingURL=agent-editor-form-
|
|
1
|
+
import{aE as ye,aF as Ne,j as e,B as j,d3 as Ce,eQ as Se,be as Me,h as Ae,eI as ke,cN as Y,du as K,c_ as Ie,h9 as Pe,ha as Te,hb as Fe,hc as De,gt as _e,hd as Ee,b_ as Re,b$ as $e,aG as Le,r as Q,bT as $,fg as J,c2 as Be,H as b,ep as L,I as U,Y as ze,bz as Oe,bA as Ue,bB as Ge,bC as Ve,bD as Z}from"./index-4gCDI7m4.js";import{b as qe,s as He}from"./model-selector-88PJnyTq.js";function We(a){const t=a.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(t?/^[a-z]/.test(t)&&t.length>=3?t:`agent-${t}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function Xe(a,t){const r=new Set(t),x=We(a);let v=x,u=2;for(;r.has(v);){const g=`-${u}`;v=`${x.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return v}const Ye="__unresolved__";function ee(a){return a.endsWith(`/${Ye}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Ke(a,t){const{slug:r,model:x}=se(a);return{provider:t.find(g=>g.value===a)?.provider??t.find(g=>se(g.value).slug===r)?.provider??r,model:x}}function Qe({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=qe(x,v),g=(s,c)=>{const l=s+c;if(l<0||l>=a.length)return;const m=[...a];[m[s],m[l]]=[m[l],m[s]],t(m)},k=s=>{t(a.filter((c,l)=>l!==s))},I=s=>{a.includes(s)||t([...a,s])},o=u.filter(s=>!a.includes(s.value)&&!ee(s.value));return e.jsxs("div",{className:"grid gap-2",children:[a.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:a.map((s,c)=>{const l=ee(s),{provider:m,model:i}=Ke(s,u);return e.jsxs("li",{className:Ae("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",l&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:m}),c===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:l?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:r||c===0,onClick:()=>g(c,-1),children:e.jsx(Ce,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:r||c===a.length-1,onClick:()=>g(c,1),children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:r,onClick:()=>k(c),children:e.jsx(Me,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ke,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(j,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:r,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(Ie,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,c)=>{const l=c.trim(),m=He(l,u)&&!a.includes(l);return e.jsxs(e.Fragment,{children:[o.map(i=>e.jsxs(Y,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),m?e.jsxs(Y,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:l})]})]}):null]})}})]})}const Je=3,Ze=72,es=2e3;function te(a){return Array.from({length:Je},(t,r)=>a?.[r]??{title:"",message:""})}function ae(a){return a.map(({title:t,message:r})=>({title:t.trim(),message:r.trim()})).filter(({title:t,message:r})=>t&&r)}function ns({mode:a,section:t="identity",existingAgentIds:r=[],onCreated:x,onCancel:v,onDone:u,reviewMode:g="none",reviewProposal:k=null,reviewControlsDisabled:I=!1}){const o=a.kind==="create",s=a.kind==="edit"?a.agent:null,c=!o&&t!=="platforms"&&t!=="skills"&&!!s,l=Pe(),m=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:G}=_e(s?.agentId,{enabled:c}),V=!o&&g==="active"?k:null,B=V?Ee(V.proposal):void 0,N=p,q=s?.agentId??"create",d=Re(q,{name:B?.name??s?.name??"",description:B?.description??s?.description??"",identityMd:B?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:N?.models??N?.settings?.models??[],showToolCalls:N?.showToolCalls??N?.settings?.showToolCalls??!1,sandboxId:N?.sandboxId??N?.settings?.sandboxId??"builtin",starters:te(p?.starters)}),[w,ne]=d.field("name"),[C,le]=d.field("description"),[T,re]=d.field("identityMd"),[F,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[_,oe]=d.field("models"),[E,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,H]=d.field("starters"),[ue,R]=$e(q,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=Q.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:Xe(w,r),name:w.trim(),description:C.trim()||void 0});x?await x(h.agentId):u?.();return}if(s){if(!p){$.error("Still loading agent settings — try again in a moment");return}if(y.some(({title:h,message:M})=>!!h.trim()!=!!M.trim())){$.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([m.mutateAsync({name:w.trim()||s.name,description:C.trim()||void 0}),P.mutateAsync({identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:E,sandboxId:S==="builtin"?void 0:S,starters:ae(y)})]),d.accept(d.values,{name:w.trim()||s.name,description:C.trim()||s.description||"",identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,showToolCalls:E,sandboxId:S,starters:te(ae(y))}),$.success("Agent saved"),u?.()}catch(h){$.error(h instanceof Error?h.message:"Failed to save agent")}}}},[p,l,C,d.accept,d.values,d.canSubmit,S,r,T,o,_,w,x,u,s,E,F,y,m,P,D]),xe=Q.useCallback(async()=>{s&&(await i.mutateAsync(),R(!1),u?.())},[i,u,s,R]),z=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&G)return e.jsx(J,{rows:6});const f=z||I,fe=g==="none"||g==="gone",ve=w.trim().length>0&&pe,be=o||t==="settings",je=!o&&(t==="identity"||t==="settings"),we=!o&&t==="settings",W=!o&&t==="settings",X=!o&&t==="models";return e.jsxs("form",{onSubmit:he,className:"flex min-h-0 flex-col",children:[e.jsx(Be,{visible:d.hasConflict,onReload:d.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[je?G?e.jsx(J,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx(L,{id:"identity-md",rows:6,value:T,onChange:n=>re(n.target.value),disabled:f,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx(L,{id:"soul-md",rows:6,value:F,onChange:n=>ie(n.target.value),disabled:f,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx(L,{id:"user-md",rows:6,value:D,onChange:n=>de(n.target.value),disabled:f,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,be?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(U,{id:"agent-name",placeholder:"Support Bot",value:w,onChange:n=>ne(n.target.value),disabled:f,required:!0}),o?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),o?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx(L,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:C,onChange:n=>le(n.target.value),disabled:f,rows:3})]})]}):null,W?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(ze,{id:"show-tool-calls",checked:E,onCheckedChange:n=>ce(n===!0),disabled:f,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Conversation starters"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to three prompts offered on a new chat, on the web and in Slack. The message is sent as the user when tapped."}),y.map((n,h)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[12rem_1fr]",children:[e.jsx(U,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Ze,value:n.title,onChange:M=>H(y.map((A,O)=>O===h?{...A,title:M.target.value}:A)),disabled:f}),e.jsx(U,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:M=>H(y.map((A,O)=>O===h?{...A,message:M.target.value}:A)),disabled:f})]},h))]}):null,X?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Qe,{value:_,onChange:oe,disabled:f}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,X?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Oe,{value:S,onValueChange:me,disabled:f,children:[e.jsx(Ue,{id:"agent-sandbox",className:"w-full",children:e.jsx(Ge,{placeholder:"Built-in"})}),e.jsxs(Ve,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{value:n.id,children:[n.name," (",n.providerKind,")",n.connected?"":" — no credential"]},n.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),fe?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[we?ue?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(j,{type:"button",variant:"destructive",onClick:()=>void xe(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>R(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>R(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v?e.jsx(j,{type:"button",variant:"outline",onClick:v,disabled:z,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||z,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
|
|
2
|
+
//# sourceMappingURL=agent-editor-form-DfMTSIvj.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as N,j as e,H as w,I as k,bz as K,bA as X,bB as Y,bC as ee,bD as ae,ep as te,B as S,v as B,gt as G,iP as T,iQ as U,hc as F,fg as se,bT as j,gA as I,bJ as ne,bW as re,b4 as $,gC as ie,V as oe,ie as le,bL as q,c_ as de,h as E,iN as ue}from"./index-4gCDI7m4.js";import{M as ce}from"./model-selector-88PJnyTq.js";import{a as me,A as J}from"./agent-subpage-shell-DWzljvFb.js";import{T as ge,a as he,b as M,c as D,d as xe,e as R}from"./table-DFcJRNk7.js";import{f as pe}from"./agent-loading-shells-Dnmb6W5Y.js";import{A as fe}from"./agent-card-controls-99mG6H5k.js";const je=[{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]=N.useState(a?.name??""),[h,b]=N.useState(a?.stage??"input"),[x,y]=N.useState(a?.policy??""),[p,C]=N.useState(a?.model??""),[f,u]=N.useState((a?.tools??[]).join(", ")),[l,m]=N.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",Q=c=>{c.preventDefault();const _=f.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:Q,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-name",value:i,onChange:c=>d(c.target.value),placeholder:"no-competitor-mentions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Shown in the list and on every trip. Must be unique."})]}),v?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-stage",children:"Stage"}),e.jsxs(K,{value:h,onValueChange:c=>b(c),disabled:s,children:[e.jsx(X,{id:"guardrail-stage",children:e.jsx(Y,{})}),e.jsx(ee,{children:je.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:f,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=>y(c.target.value),placeholder:"Deny any response that names a competitor (Acme, Globex) or quotes their pricing.",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"A judge model reads this and the text at the chosen stage, then allows or denies. Write it as an instruction to a reviewer."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-model",children:["Judge model",t?null:e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(ce,{value: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:f,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 Ne(a,t){return a.filter(n=>n.name!==t)}function ye(a,t,n){return a.map(s=>s.name===t?{...s,enabled:n}:s)}function Ce({owner:a,agentId:t}){const n=B(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=T(t),{data:d=null,isLoading:h}=U(t),b=o||i||h,x=F(t),y=s?.guardrailsInline??[],p=(r??[]).map(u=>u.name),C=async u=>{if(!s){j.error("Still loading agent settings — try again in a moment");return}const l=W(u,y,p,d);if(l){j.error(l);return}try{await x.mutateAsync({guardrailsInline:be(y,u)}),j.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){j.error(m instanceof Error?m.message:"Failed to create guardrail")}},f=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),b?e.jsx(se,{rows:4}):e.jsx(z,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:x.isPending,onSubmit:C,onCancel:f})]})}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:le(t,{addSuffix:!0})}function Ae({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=T(t),r=N.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=B(),{data:o}=G(t),{data:r}=T(t),{data:i=null}=U(t),d=F(t),[h,b]=N.useState(!1),x=o?.guardrailsInline??[],y=(r??[]).map(u=>u.name),p=async(u,l)=>{if(!o)return j.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),j.success(l),!0}catch(m){return j.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=W(u,x,y,i,n.name);if(l){j.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())}})},f=async()=>{await p(Ne(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 f(),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($,{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(ge,{children:[e.jsx(he,{children:e.jsxs(M,{children:[e.jsx(D,{className:"w-[180px]",children:"When"}),e.jsx(D,{className:"w-[120px]",children:"Stage"}),e.jsx(D,{children:"Reason"})]})}),e.jsx(xe,{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(oe,{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 De({owner:a,agentId:t,expandedName:n}){const s=B(),{data:o,isLoading:r}=G(t),{data:i,isLoading:d}=T(t),{data:h=[]}=I(t),b=F(t),x=async(l,m)=>{if(!o){j.error("Still loading agent settings — try again in a moment");return}try{if(l.kind==="custom")await b.mutateAsync({guardrailsInline:ye(o.guardrailsInline??[],l.name,m)});else{const g=P(o,i??[]);await b.mutateAsync({guardrails:Se(g,l.name,m)})}j.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){j.error(g instanceof Error?g.message:"Failed to save guardrail")}},y=i===null,p=N.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)}})},f=()=>{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:y?e.jsx($,{icon:q,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:f}):e.jsx($,{icon:q,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:f})}):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:f,children:[e.jsx(de,{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(Re,{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 Re({card:a,expanded:t,isLast:n,onToggle:s,onToggleEnabled:o,toggleDisabled:r,children:i}){return e.jsxs("div",{className:E("bg-background",!n||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:s,"aria-expanded":t,className:E("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!a.enabled&&!a.unknown&&!t&&"opacity-70"),children:[e.jsx(q,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:E("truncate text-sm text-foreground",a.unknown&&"font-mono text-xs"),children:a.name}),a.kind==="custom"&&a.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:a.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a.tripCount>0?`${a.tripCount} recent ${a.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(ue,{badges:a.badges})]})]}),e.jsx(fe,{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 $e({owner:a,agentId:t,expandedName:n}){return e.jsx(J,{children:e.jsx(De,{owner:a,agentId:t,expandedName:n})})}function Oe({owner:a,agentId:t}){return e.jsx(J,{children:e.jsx(Ce,{owner:a,agentId:t})})}function Ue({owner:a,agentId:t,name:n}){return e.jsx($e,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{$e as A,Oe as a,Ue as b};
|
|
2
|
+
//# sourceMappingURL=agent-guardrails-route-BvGgfd-h.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,S as s,
|
|
2
|
-
//# sourceMappingURL=agent-loading-shells-
|
|
1
|
+
import{j as e,S as s,h as n}from"./index-4gCDI7m4.js";const r="mx-auto w-full max-w-3xl px-4",d="gap-4",i="ml-8 self-end max-w-[80%]",o="mr-8 max-w-[90%]",c="mx-auto w-full max-w-3xl shrink-0 border-t border-border/50 bg-transparent px-4 pb-4 pt-3";function f({rows:l=3}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading list",children:Array.from({length:l}).map((a,x)=>e.jsx(s,{className:"h-16 w-full rounded-lg"},x))})}function t({readOnly:l=!1}){return e.jsxs("div",{role:"status","aria-label":l?"Loading run history":"Loading chat",className:l?"flex min-h-[24rem] min-w-0 flex-1 flex-col":"flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:l?"flex flex-1 flex-col overflow-hidden":"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsxs("div",{className:n(r,"flex flex-1 flex-col overflow-hidden",d),children:[e.jsx("div",{className:i,children:e.jsx(s,{className:"h-12 w-48 rounded-lg"})}),e.jsx("div",{className:o,children:e.jsx(s,{className:n(l?"h-20":"h-16","w-64 rounded-lg")})}),e.jsx("div",{className:i,children:e.jsx(s,{className:"h-10 w-36 rounded-lg"})}),l?e.jsx("div",{className:o,children:e.jsx(s,{className:"h-16 w-52 rounded-lg"})}):null]})}),l?null:e.jsx("div",{className:c,children:e.jsx(s,{className:"h-24 w-full rounded-lg"})})]})}function h(){return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsx(t,{})})}function u(){return e.jsx("div",{className:"flex h-48 w-full items-end gap-2 px-2 pb-2",role:"status","aria-label":"Loading timeline",children:[40,65,45,80,55,70,50,85,60,75].map((l,a)=>e.jsx(s,{className:"flex-1 rounded-sm",style:{height:`${l}%`}},a))})}export{t as A,h as C,u as E,c as a,d as b,r as c,o as d,i as e,f};
|
|
2
|
+
//# sourceMappingURL=agent-loading-shells-Dnmb6W5Y.js.map
|