@lobu/runtime-server 24.2.0 → 24.3.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/dependencies.bun.lock +104 -167
- package/dist/owletto/dist/assets/_-XKF0m81R.js +3 -0
- package/dist/owletto/dist/assets/_-e8MbEBtw.js +2 -0
- package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-emObu67X.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +2 -0
- package/dist/owletto/dist/assets/_name-DjtJMop4.js +2 -0
- package/dist/owletto/dist/assets/_owner-oBX68rb9.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +2 -0
- package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-B2g5qzn3.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-38lHBvjO.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-_G_lDz5K.js → activity-route-view-voRYSM3a.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-DiU7Un5w.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-BgyLhJCo.js → agent-client-setup-list-Bkyw22GW.js} +4 -4
- package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-QrIDroFL.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-CamDtzHY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CgsQ8BK_.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-lWbXKEm1.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-D-w3tY_2.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-CLqpn5Tb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-CsRexwTv.js} +4 -4
- package/dist/owletto/dist/assets/agents-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.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-BO7G38fL.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-DMYxs6F6.js} +2 -2
- package/dist/owletto/dist/assets/automations-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/calendar-DDCCSPW6.js +2 -0
- package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-DFciMR8u.js} +2 -2
- package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-BCsbrdGs.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-BRua2b_7.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-CmK3DkSP.js → client-activity-scopes-BLIy1Zc3.js} +2 -2
- package/dist/owletto/dist/assets/client-rows-DiJQ5D1z.js +2 -0
- package/dist/owletto/dist/assets/clients-8-EpRjsm.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-BFZa4EIt.js} +2 -2
- package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +2 -0
- package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-BMV8bf54.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DqZA-FdG.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-bmBJJ9B4.js → connector-provenance-BIg8P8WY.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-CJYz53YF.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BroKpwhB.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C_WBfmQ8.js → consent-fzLN-Qy7.js} +2 -2
- package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-A1UnFbGs.js} +2 -2
- package/dist/owletto/dist/assets/create-BjwsYarn.js +2 -0
- package/dist/owletto/dist/assets/create-Dzr4mlr0.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +3 -0
- package/dist/owletto/dist/assets/create-c94SPL21.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-xxpD1P2-.js} +2 -2
- package/dist/owletto/dist/assets/{device-Br9JHadR.js → device-C3AEoL5c.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B_te59GE.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-CEV4ttUQ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +2 -0
- package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +2 -0
- package/dist/owletto/dist/assets/event-card-CBlsG32u.js +2 -0
- package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +2 -0
- package/dist/owletto/dist/assets/events-feed-VfU4csn2.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-C1Q_jEzD.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +2 -0
- package/dist/owletto/dist/assets/identity-BaFLmbSo.js +2 -0
- package/dist/owletto/dist/assets/index-008wj-Pz.js +7950 -0
- package/dist/owletto/dist/assets/index-BaetvYLa.js +2 -0
- package/dist/owletto/dist/assets/index-BiEf5xOE.css +1 -0
- package/dist/owletto/dist/assets/index-BrDP4PCs.js +2 -0
- package/dist/owletto/dist/assets/index-BuXIeK7D.js +2 -0
- package/dist/owletto/dist/assets/index-CAVcR9za.js +2 -0
- package/dist/owletto/dist/assets/index-CMLfWGPU.js +2 -0
- package/dist/owletto/dist/assets/index-D0YEYP7N.js +2 -0
- package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-DFyBbp7b.js} +2 -2
- package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-DNtYqkiA.js} +2 -2
- package/dist/owletto/dist/assets/index-DQxzeM37.js +2 -0
- package/dist/owletto/dist/assets/index-DkO0nPex.js +2 -0
- package/dist/owletto/dist/assets/index-KlRId0g6.js +2 -0
- package/dist/owletto/dist/assets/index-Ywnqi4A6.js +2 -0
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
- package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-yIub2xUM.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-LE_vNZrM.js} +4 -4
- package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Kzxi2OXB.js} +2 -2
- package/dist/owletto/dist/assets/login-DWOT6jtS.js +2 -0
- package/dist/owletto/dist/assets/logout-Dt_VDilG.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-De75CR7W.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-3l9lY50C.js} +2 -2
- package/dist/owletto/dist/assets/model-udnQ_S43.js +2 -0
- package/dist/owletto/dist/assets/models-CQj7GIOp.js +2 -0
- package/dist/owletto/dist/assets/new-BOwIHkre.js +2 -0
- package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-BbdwuJPm.js} +2 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-D15LYKSe.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
- package/dist/owletto/dist/assets/{organization-CoUJYXx7.js → organization-BDzjnqPf.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
- package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-CfoY4WFY.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-CmLy1MZf.js → proposal-review-shell-CVkLnnKo.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-D07szzqN.js} +2 -2
- package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-AJxSmE3-.js} +30 -30
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
- package/dist/owletto/dist/assets/{runs-B0zVYb-w.js → runs-lG2ChtOt.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-C_Es0qDf.js} +2 -2
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
- package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-gGYXbFfd.js} +2 -2
- package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CjFPgKKJ.js +2 -0
- package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-CSBtKT4g.js} +2 -2
- package/dist/owletto/dist/assets/table-DHM-vCxP.js +2 -0
- package/dist/owletto/dist/assets/use-automations-C4TSie1i.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-PfZrNbu_.js} +2 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-2ubIf_3N.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +99167 -97912
- package/npm-shrinkwrap.json +537 -896
- 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 +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +6 -0
- 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/otel.js +38 -10
- 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/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-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/copy-button-kcjg8Giw.js +0 -2
- package/dist/owletto/dist/assets/create-CQE5rD0i.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-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/peek-pane-content-BvkYk72J.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-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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* headless args, flag mapping, MCP wiring). Adding a CLI is now one entry,
|
|
10
10
|
* not a ~140-line executor copy.
|
|
11
11
|
* - the Automation prompt builder — the completion contract the spawned CLI
|
|
12
|
-
* must satisfy
|
|
12
|
+
* must satisfy.
|
|
13
13
|
*
|
|
14
14
|
* The connector-worker daemon consumes these from core. This module is pure
|
|
15
15
|
* data + string building: it imports nothing above core.
|
|
@@ -39,26 +39,6 @@ export declare class OrchestratorError extends BaseError {
|
|
|
39
39
|
static fromDatabaseError(error: any): OrchestratorError;
|
|
40
40
|
toJSON(): Record<string, any>;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Thrown when a worker spawn is declined because another replica already holds
|
|
44
|
-
* the per-conversation lock for this turn — i.e. another pod legitimately OWNS
|
|
45
|
-
* this conversation turn and is running it to completion.
|
|
46
|
-
*
|
|
47
|
-
* This is NOT a failure. It is the cross-pod "handled elsewhere" signal. Under
|
|
48
|
-
* N>1 app replicas both pods drain the shared `thread_message` queue and race to
|
|
49
|
-
* spawn the same per-conversation worker; exactly one wins the advisory lock.
|
|
50
|
-
* The loser MUST drop silently — no user-facing error, no Critical log, no
|
|
51
|
-
* retry (the winner holds the lock for the entire worker subprocess lifetime, so
|
|
52
|
-
* retrying can never win). The winning pod discharges the shared turn-liveness
|
|
53
|
-
* marker on its successful reply, so the user still receives the answer.
|
|
54
|
-
*
|
|
55
|
-
* Distinguished by type (not a magic message string) so the orchestrator can
|
|
56
|
-
* tell "owned by another pod" apart from a genuine worker-startup failure (OOM,
|
|
57
|
-
* spawn failure, bad config) which MUST still surface an error to the user.
|
|
58
|
-
*/
|
|
59
|
-
export declare class ConversationOwnedElsewhereError extends BaseError {
|
|
60
|
-
readonly name = "ConversationOwnedElsewhereError";
|
|
61
|
-
}
|
|
62
42
|
export declare class ConfigError extends BaseError {
|
|
63
43
|
readonly name = "ConfigError";
|
|
64
44
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROVIDER_WINDOWED_QUOTA = exports.PROVIDER_BALANCE_EXHAUSTED = exports.AGENT_ERRORS = exports.AgentErrorCode = exports.ConfigError = exports.
|
|
3
|
+
exports.PROVIDER_WINDOWED_QUOTA = exports.PROVIDER_BALANCE_EXHAUSTED = exports.AGENT_ERRORS = exports.AgentErrorCode = exports.ConfigError = exports.OrchestratorError = exports.ErrorCode = exports.WorkspaceError = exports.WorkerError = exports.BaseError = void 0;
|
|
4
4
|
exports.getErrorMessage = getErrorMessage;
|
|
5
5
|
exports.toAgentErrorCode = toAgentErrorCode;
|
|
6
6
|
/**
|
|
@@ -93,30 +93,6 @@ class OrchestratorError extends BaseError {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
exports.OrchestratorError = OrchestratorError;
|
|
96
|
-
/**
|
|
97
|
-
* Thrown when a worker spawn is declined because another replica already holds
|
|
98
|
-
* the per-conversation lock for this turn — i.e. another pod legitimately OWNS
|
|
99
|
-
* this conversation turn and is running it to completion.
|
|
100
|
-
*
|
|
101
|
-
* This is NOT a failure. It is the cross-pod "handled elsewhere" signal. Under
|
|
102
|
-
* N>1 app replicas both pods drain the shared `thread_message` queue and race to
|
|
103
|
-
* spawn the same per-conversation worker; exactly one wins the advisory lock.
|
|
104
|
-
* The loser MUST drop silently — no user-facing error, no Critical log, no
|
|
105
|
-
* retry (the winner holds the lock for the entire worker subprocess lifetime, so
|
|
106
|
-
* retrying can never win). The winning pod discharges the shared turn-liveness
|
|
107
|
-
* marker on its successful reply, so the user still receives the answer.
|
|
108
|
-
*
|
|
109
|
-
* Distinguished by type (not a magic message string) so the orchestrator can
|
|
110
|
-
* tell "owned by another pod" apart from a genuine worker-startup failure (OOM,
|
|
111
|
-
* spawn failure, bad config) which MUST still surface an error to the user.
|
|
112
|
-
*/
|
|
113
|
-
class ConversationOwnedElsewhereError extends BaseError {
|
|
114
|
-
constructor() {
|
|
115
|
-
super(...arguments);
|
|
116
|
-
this.name = "ConversationOwnedElsewhereError";
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.ConversationOwnedElsewhereError = ConversationOwnedElsewhereError;
|
|
120
96
|
class ConfigError extends BaseError {
|
|
121
97
|
constructor() {
|
|
122
98
|
super(...arguments);
|
package/vendor/core/dist/otel.js
CHANGED
|
@@ -16,10 +16,6 @@ exports.getTraceparent = getTraceparent;
|
|
|
16
16
|
const api_1 = require("@opentelemetry/api");
|
|
17
17
|
Object.defineProperty(exports, "SpanKind", { enumerable: true, get: function () { return api_1.SpanKind; } });
|
|
18
18
|
Object.defineProperty(exports, "SpanStatusCode", { enumerable: true, get: function () { return api_1.SpanStatusCode; } });
|
|
19
|
-
const exporter_trace_otlp_grpc_1 = require("@opentelemetry/exporter-trace-otlp-grpc");
|
|
20
|
-
const resources_1 = require("@opentelemetry/resources");
|
|
21
|
-
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
22
|
-
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
23
19
|
const logger_1 = require("./logger");
|
|
24
20
|
const logger = (0, logger_1.createLogger)("otel");
|
|
25
21
|
let provider = null;
|
|
@@ -33,18 +29,50 @@ function initTracing(config) {
|
|
|
33
29
|
logger.debug("Tracing disabled (no OTEL_EXPORTER_OTLP_ENDPOINT configured)");
|
|
34
30
|
return;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
// Bare require (not createRequire(__filename)): tsc emits CJS with a native
|
|
33
|
+
// require, bun provides one for src TS, and the server ESM bundle banner
|
|
34
|
+
// defines `const require = __createRequire(import.meta.url)` for exactly
|
|
35
|
+
// these calls — while __filename has no shim there and would throw.
|
|
36
|
+
let exporterCtor;
|
|
37
|
+
let resourceFromAttributes;
|
|
38
|
+
let NodeTracerProvider;
|
|
39
|
+
let SimpleSpanProcessor;
|
|
40
|
+
let ATTR_SERVICE_NAME;
|
|
41
|
+
let ATTR_SERVICE_VERSION;
|
|
42
|
+
try {
|
|
43
|
+
exporterCtor =
|
|
44
|
+
require("@opentelemetry/exporter-trace-otlp-grpc").OTLPTraceExporter;
|
|
45
|
+
resourceFromAttributes =
|
|
46
|
+
require("@opentelemetry/resources").resourceFromAttributes;
|
|
47
|
+
({
|
|
48
|
+
NodeTracerProvider,
|
|
49
|
+
SimpleSpanProcessor,
|
|
50
|
+
} = require("@opentelemetry/sdk-trace-node"));
|
|
51
|
+
({
|
|
52
|
+
ATTR_SERVICE_NAME,
|
|
53
|
+
ATTR_SERVICE_VERSION,
|
|
54
|
+
} = require("@opentelemetry/semantic-conventions"));
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
// Only a missing module means the optional peers aren't installed. A
|
|
58
|
+
// genuine load failure inside an installed OTel module (e.g. grpc native
|
|
59
|
+
// init) must surface as-is, not misreport as "not installed".
|
|
60
|
+
if (err?.code !== "MODULE_NOT_FOUND")
|
|
61
|
+
throw err;
|
|
62
|
+
throw new Error("Tracing is enabled (OTEL_EXPORTER_OTLP_ENDPOINT or enabled: true) but the optional OpenTelemetry peer dependencies are not installed (@opentelemetry/exporter-trace-otlp-grpc, @opentelemetry/resources, @opentelemetry/sdk-trace-node, @opentelemetry/semantic-conventions). Install them explicitly to enable tracing, or leave the endpoint unset to run without tracing.");
|
|
63
|
+
}
|
|
64
|
+
const resource = resourceFromAttributes({
|
|
65
|
+
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
66
|
+
[ATTR_SERVICE_VERSION]: config.serviceVersion || "1.0.0",
|
|
39
67
|
});
|
|
40
|
-
const exporter = new
|
|
68
|
+
const exporter = new exporterCtor({
|
|
41
69
|
url: config.otlpEndpoint,
|
|
42
70
|
timeoutMillis: 30000,
|
|
43
71
|
});
|
|
44
72
|
// SimpleSpanProcessor exports immediately — workers are short-lived
|
|
45
|
-
provider = new
|
|
73
|
+
provider = new NodeTracerProvider({
|
|
46
74
|
resource,
|
|
47
|
-
spanProcessors: [new
|
|
75
|
+
spanProcessors: [new SimpleSpanProcessor(exporter)],
|
|
48
76
|
});
|
|
49
77
|
provider.register();
|
|
50
78
|
tracer = api_1.trace.getTracer(config.serviceName, config.serviceVersion);
|
|
@@ -50,7 +50,9 @@ function formatAjvError(error) {
|
|
|
50
50
|
case "type":
|
|
51
51
|
return `${field}: must be ${error.params.type}`;
|
|
52
52
|
case "required":
|
|
53
|
-
|
|
53
|
+
// A nested object reports `required` at the object's own path; name the
|
|
54
|
+
// field from the root so `ref/backend_node_id` is not read as `backend_node_id`.
|
|
55
|
+
return `missing required field: ${error.instancePath ? `${field}/` : ""}${error.params.missingProperty}`;
|
|
54
56
|
case "format":
|
|
55
57
|
return `${field}: must be a valid ${error.params.format}`;
|
|
56
58
|
case "minimum":
|
package/vendor/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/core",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Core types and utilities for Lobu agent platform",
|
|
6
6
|
"repository": {
|
|
@@ -66,6 +66,11 @@
|
|
|
66
66
|
"import": "./dist/utils/ajv.js",
|
|
67
67
|
"require": "./dist/utils/ajv.js"
|
|
68
68
|
},
|
|
69
|
+
"./diagnostic-scrubber": {
|
|
70
|
+
"types": "./dist/utils/diagnostic-scrubber.d.ts",
|
|
71
|
+
"import": "./dist/utils/diagnostic-scrubber.js",
|
|
72
|
+
"require": "./dist/utils/diagnostic-scrubber.js"
|
|
73
|
+
},
|
|
69
74
|
"./contracts/tools/manage-connections": {
|
|
70
75
|
"types": "./dist/contracts/tools/manage-connections.d.ts",
|
|
71
76
|
"import": "./dist/contracts/tools/manage-connections.js",
|
|
@@ -249,14 +254,30 @@
|
|
|
249
254
|
},
|
|
250
255
|
"dependencies": {
|
|
251
256
|
"@opentelemetry/api": "^1.9.0",
|
|
252
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
|
|
253
|
-
"@opentelemetry/resources": "^2.11.0",
|
|
254
|
-
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
255
|
-
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
256
257
|
"@sinclair/typebox": "^0.34.41",
|
|
257
258
|
"acorn": "^8.16.0",
|
|
258
259
|
"ajv": "^8.17.1",
|
|
259
260
|
"ajv-formats": "^3.0.1",
|
|
260
261
|
"winston": "^3.17.0"
|
|
262
|
+
},
|
|
263
|
+
"peerDependencies": {
|
|
264
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.221.0",
|
|
265
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
266
|
+
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
267
|
+
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
268
|
+
},
|
|
269
|
+
"peerDependenciesMeta": {
|
|
270
|
+
"@opentelemetry/exporter-trace-otlp-grpc": {
|
|
271
|
+
"optional": true
|
|
272
|
+
},
|
|
273
|
+
"@opentelemetry/resources": {
|
|
274
|
+
"optional": true
|
|
275
|
+
},
|
|
276
|
+
"@opentelemetry/sdk-trace-node": {
|
|
277
|
+
"optional": true
|
|
278
|
+
},
|
|
279
|
+
"@opentelemetry/semantic-conventions": {
|
|
280
|
+
"optional": true
|
|
281
|
+
}
|
|
261
282
|
}
|
|
262
283
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c2 as t,s as p,j as a,c3 as e,ai as s}from"./index-JmEl29py.js";import{A as n}from"./activity-route-view-_G_lDz5K.js";import"./record-activity-Doeu5kPO.js";import"./filter-editors-oNjBX9a2.js";import"./connection-label-BobuYiAG.js";import"./runs-B0zVYb-w.js";import"./source-record-panels-BeAZeMLy.js";import"./events-feed-C4VrjIc1.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./use-automations-DS3uz3pb.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./copy-button-kcjg8Giw.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./use-scroll-sentinel-BpQ70c28.js";import"./agent-loading-shells-jkf9DjdO.js";import"./member-scope-gate-Dit3MXBQ.js";import"./public-shell-ready-_awBxu2Y.js";function b(){const{owner:o}=t.useParams(),r=p({select:m=>m.pathname}),i=t.useSearch();return a.jsx(n,{owner:o,search:i,entityScope:e(s(r,1)).path})}export{b as component};
|
|
2
|
-
//# sourceMappingURL=_-Cjvw31gU.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-CY7PF3X9.js","assets/index-JmEl29py.js","assets/index-Dr7bouPX.css","assets/record-activity-Doeu5kPO.js","assets/filter-editors-oNjBX9a2.js","assets/connection-label-BobuYiAG.js","assets/runs-B0zVYb-w.js","assets/source-record-panels-BeAZeMLy.js","assets/events-feed-C4VrjIc1.js","assets/client-activity-scopes-CmK3DkSP.js","assets/client-rows-fFuxzFtE.js","assets/use-automations-DS3uz3pb.js","assets/json-diff-4sMmayDd.js","assets/index-wHFQv1aT.js","assets/copy-button-kcjg8Giw.js","assets/linked-record-peek-B0_B4PnF.js","assets/card-Cspo-4M6.js","assets/use-scroll-sentinel-BpQ70c28.js","assets/agent-loading-shells-jkf9DjdO.js","assets/member-scope-gate-Dit3MXBQ.js","assets/views-access-required-CWwlobOd.js","assets/record-session-CJzFoVKc.js","assets/entity-avatar-BZIa-7i5.js","assets/view-param-filters-FuOZyjMg.js","assets/app-bridge-BCm4muqj.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ag as x,s as p,ah as y,ai as j,aj as P,ak as g,k as R,n as f,j as e,r as v,al as E,l as w,_ as S}from"./index-JmEl29py.js";import{P as r}from"./public-shell-ready-_awBxu2Y.js";const _=w(async()=>({default:(await S(async()=>{const{EntityPage:a}=await import("./entity-page-CY7PF3X9.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]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(E,{})})}function F(){const{owner:a}=x.useParams(),l=p({select:m=>m.pathname}),s=y(j(l)),d=s?.viewKey,{path:u}=P(a,s?.entityPath),{data:t,isLoading:n,error:i}=g(u,{slug:a},{includeBootstrap:!0}),{session:h,isReady:o}=R();return f({active:!n&&o&&!h&&(!!i||!t),owner:a}),n||!o&&!t?e.jsx(c,{}):i||!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{F as component};
|
|
3
|
-
//# sourceMappingURL=_-iToIRRFt.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h8 as r,j as e}from"./index-JmEl29py.js";import{A as n}from"./agents-workbench-D1YL3VAB.js";import"./agent-editor-form-C24p9LLg.js";import"./model-selector-BeFuFH7p.js";import"./proposal-review-shell-CmLy1MZf.js";import"./runs-B0zVYb-w.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-CLdj0X7j.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{q as L,gh as w,r as u,gi as b,j as n,T as D,cy as k,k as P,an as R,a$ as E,aR as M,ba as N,cg as O,gj as $,gk as B,bm as Q,x as q}from"./index-JmEl29py.js";import{L as z,A as F}from"./agent-thread-BGHYHWDO.js";import{A as H,C as U}from"./agent-loading-shells-jkf9DjdO.js";import"./app-bridge-BCm4muqj.js";import"./use-mention-search-CAFbh-Dk.js";import"./index-wHFQv1aT.js";import"./use-automations-DS3uz3pb.js";import"./events-feed-C4VrjIc1.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./json-diff-4sMmayDd.js";import"./copy-button-kcjg8Giw.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./use-scroll-sentinel-BpQ70c28.js";function W({owner:t,agent:s,threadId:e,afterMessagesContent:d,className:r,initialDraft:p,newChatRequested:m=!1,preventAutoNavigate:g}){const o=L(),i=s.agentId,{data:a=[]}=w(i,{orgSlug:t}),[l,x]=u.useState(()=>b()),[h,A]=u.useState(null);u.useEffect(()=>{!m||e||(x(b()),A(null),o({to:".",search:(f=>{const{new:C,...y}=f;return y}),replace:!0}))},[m,e,o]);const v=u.useMemo(()=>!h||a.some(f=>f.id===h.id)?a:[h,...a],[a,h]),c=e??l,T=!e||!v.some(f=>f.id===e),j=u.useCallback(()=>{if(v.some(C=>C.id===c))return;A({id:c,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const f=k(t,i,c);o({...f,replace:!0})},[v,c,o,t,i]),S=u.useCallback(()=>{T&&!g&&j()},[T,j,g]);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:t,thread:c,loadHistory:!!e,onFirstUserMessage:S,initialDraft:p,children:n.jsx(F,{afterMessagesContent:d})},`${i}:${c}`)})})}function _({owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:r,afterMessagesContent:p,preventAutoNavigate:m}){const{isAuthenticated:g}=P(),{isMember:o,isLoading:i}=R(),a=g&&o,{data:l=[],isLoading:x}=E({enabled:a}),h=s??null,A=l.find(c=>c.agentId===h)??null;return a&&x||i?n.jsx(H,{}):A?n.jsx(W,{owner:t,agent:A,threadId:e,initialDraft:d,newChatRequested:r,afterMessagesContent:p,preventAutoNavigate:m,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(M,{icon:N,title:"Agent not found",description:"This agent may have been removed."})}function G(t){return[...t].sort((s,e)=>e.updatedAt-s.updatedAt)[0]}function J({owner:t,agentId:s,threadId:e,initialDraft:d,forceComposer:r=!1,newChatRequested:p=!1,afterMessagesContent:m,preventAutoNavigate:g}){const o=L(),{data:i=[],isLoading:a}=O($(t,s,{strict:!1})),l=u.useMemo(()=>G(i),[i]);return u.useEffect(()=>{if(e||r||a||!l)return;const x=k(t,s,l.id);o({...x,replace:!0})},[s,a,l,o,t,e,r]),!e&&!r&&(a||l)?n.jsx(U,{}):n.jsx(_,{owner:t,agentId:s,threadId:e,initialDraft:d,newChatRequested:p,afterMessagesContent:m,preventAutoNavigate:g})}function ce(){const{owner:t,agentId:s}=B.useParams(),{threadId:e}=Q({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:t,agentId:s,threadId:e,initialDraft:r,forceComposer:!e,newChatRequested:!!d})})})}export{ce as component};
|
|
2
|
-
//# sourceMappingURL=_agentId-D5cAWjrP.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{q as A,o as k,ak as b,k as L,an as C,j as t,ge as R,L as d,gf as _,ba as $,S as B,B as u,b8 as D,g$ as p,at as S}from"./index-JmEl29py.js";import{A as y}from"./automation-detail-content-DCAZBKle.js";import{b as O}from"./use-automations-DS3uz3pb.js";import"./create-automation-form-y3tq2QIJ.js";import"./cronstrue-CeUS_78Q.js";import"./entity-options-BcTafZ2e.js";import"./connection-label-BobuYiAG.js";import"./model-selector-BeFuFH7p.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-C8FJbT2P.js";import"./index-wHFQv1aT.js";import"./use-mention-search-CAFbh-Dk.js";import"./proposal-review-shell-CmLy1MZf.js";import"./runs-B0zVYb-w.js";import"./events-feed-C4VrjIc1.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./json-diff-4sMmayDd.js";import"./copy-button-kcjg8Giw.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./use-scroll-sentinel-BpQ70c28.js";function P({owner:a,automationId:o,view:s,runId:e}){const n=A(),{orgContext:x,hasOrgContext:g}=k(),{data:h,isLoading:r}=b(`/${a}`,x),{isAuthenticated:f}=L(),{isLoading:m}=C(),v=h?.workspace?.id??"",j=f?!g||r||m:r||m,i=O(o,void 0,v).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(u,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:l,children:"Done"}):t.jsx(u,{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 it(){const{owner:a,automationId:o}=p.useParams(),s=p.useSearch();return t.jsx(S,{owner:a,children:()=>t.jsx(P,{owner:a,automationId:o,view:s.view,runId:s.run_id})})}export{it as component};
|
|
2
|
-
//# sourceMappingURL=_automationId-BhEZmkJU.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iL as A,j as e,at as G,q as J,aA as U,cA as X,cf as z,d0 as Q,S as I,B as Y,L as p,aB as Z,iw as K,ix as ee,aP as ne,gf as x,ir as se,gd as ae,aX as oe,ie as te,ge as ie,hD as R,aJ as ce,y as re}from"./index-JmEl29py.js";import{R as de,c as le,C as me}from"./device-pin-tombstone-7UpeD4Sq.js";import{a as pe}from"./connector-provenance-bmBJJ9B4.js";import{f as ue,C as xe,F as he,a as fe,b as ve,A as je,c as Ce}from"./connection-feed-detail-IO6G5QjL.js";import{S as De,g as Ne}from"./runs-table-9OVdfPXZ.js";import{c as ge}from"./connection-label-BobuYiAG.js";import"./runs-panel-Dkyybqos.js";import"./use-scroll-sentinel-BpQ70c28.js";import"./runs-B0zVYb-w.js";import"./filter-editors-oNjBX9a2.js";import"./connector-scope-lists-B44Q9W-j.js";import"./status-dot-_LQZmEIX.js";import"./entity-options-BcTafZ2e.js";function Me(){const{owner:l,connectorKey:n,connectionId:v}=A.useParams(),{addFeed:o,feedId:c,settings:h,auth_result:t}=A.useSearch();return e.jsx(G,{owner:l,children:m=>e.jsx($e,{organizationId:m.organizationId,ownerSlug:m.ownerSlug,isWorkspaceLoading:m.isWorkspaceLoading,connectorKey:n,connectionId:Number(v),showAddFeed:o===!0,feedId:c,openSettings:h===!0,authResult:t})})}function $e({organizationId:l,ownerSlug:n,isWorkspaceLoading:v,connectorKey:o,connectionId:c,showAddFeed:h,feedId:t,openSettings:m,authResult:y}){const B=J(),{data:E=[]}=U(),{data:P=[],isLoading:M,isError:j,refetch:T}=X(l??"",{connectorKey:o,connectionIds:[c]}),{data:g=[]}=z(l??""),{data:W=[],isLoading:O,isError:S,refetch:H}=Q(t?c:null),s=P.find(i=>i.id===c),a=g.find(i=>i.key===o),r=t?W.find(i=>i.id===t):null;if(v||M||t&&O||!l)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(I,{className:"h-7 w-56"}),e.jsx(I,{className:"h-4 w-24"})]}),e.jsx(de,{})]});if(j||t&&S)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",j?"connection":"feed","."]}),e.jsx(Y,{variant:"outline",size:"sm",onClick:()=>void(j?T():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&&!h,V=()=>void B({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},replace:!0});let u,f=$,w,k,D;t?r?(f=ue(r,a),r.store==="channel_messages"?(u=e.jsx(xe,{feed:r,hideHeader:!0}),D="chat channel"):(w=e.jsx(he,{feed:r,ownerSlug:n}),k=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"):h&&(u=e.jsx(je,{onClose:V,organizationId:l,connections:[s],connectorDefinitions:g}),f="Add feed",D=Ce);const d=E.find(i=>i.id===s.device_worker_id&&Z(i,n)),F=d?K(d):void 0,N=F?ee(n,F,ne()):void 0,_=[e.jsx(p,{to:"/$owner/connectors",params:{owner:n},className:x,children:"Connectors"},"connectors"),...d&&N?[e.jsx(p,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:N.id},className:x,children:N.name},"app"),e.jsx(p,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:d.id},className:x,children:se(d)},"device")]:[e.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:x,children:a?.name??o},"connector")]];C||_.push(e.jsx(p,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(c)},search:{},className:x,children:$},"connection"));const b=C?le(s):null,q=D??b??void 0,L=e.jsx(ae,{breadcrumb:e.jsx(ie,{crumbs:_}),icon:a?e.jsx(oe,{icon:a.icon,name:a.name,faviconDomain:a.favicon_domain??te(a.auth_schema)}):null,title:f,status:w??e.jsx(De,{status:Ne(s.status),showDot:!0,children:s.status}),meta:k,caption:q,captionTone:b?"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:m||void 0},hash:`connection-${s.id}`,replace:!0}):e.jsxs(R,{header:L,children:[e.jsx(pe,{connectorDef:a,connectorKey:o,ownerSlug:n,deviceWorkerId:s.device_worker_id,deviceLabel:s.device_label}),e.jsx(me,{embedded:!0,connection:s,connectorDef:a,ownerSlug:n,openSettings:m,authResult:y},s.id)]}):e.jsx(R,{header:L,children:e.jsx("div",{className:"mt-0",children:u})})}export{Me as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey._connectionId-DZtLc3WW.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ax as $e,ay as Ee,az as De,aH as me,aE as ae,hB as ls,hC as os,j as e,hD as le,B as g,L as K,aG as he,gd as oe,ge as ce,gf as W,hE as cs,a0 as ds,hF as te,r as p,hG as we,hH as Fe,cM as us,hI as Ae,bH as X,hJ as Se,E as P,bn as Le,bo as Re,bp as Oe,bq as Be,br as Ke,hx as ms,I as F,by as H,a3 as V,A as _e,hK as hs,hL as xs,bc as ps,hM as fs,b0 as xe,hN as gs,hO as js,hP as Ue,hQ as Ie,hR as ze,de as ne,Q as U,b7 as de,hS as vs,fG as ys,hT as Ns,fb as Z,hU as bs,S as E,hV as B,k as Cs,hW as ks,hX as ws,hY as As,hZ as Ss,h_ as _s,h$ as Ps,i0 as $s,i1 as Es,bP as se,i2 as Ds,i3 as Fs,bO as Ls,ef as Rs,eX as Os,T as re,eg as Bs,bS as Ks,d3 as Me,i4 as Q,i5 as Us,at as Is,i6 as Te,aw as ie,u as qe,i7 as Ve,aK as zs,i8 as Ye,i9 as Ms,ia as Xe,ib as Ts,eh as qs,av as Vs,cA as Ys,aT as Xs,aC as M,ic as We,q as G,aY as Ge,aX as pe,aU as Ws,id as Gs,ie as Hs}from"./index-JmEl29py.js";import{C as Qs,a as He}from"./connections-browser-CzdcZeiU.js";import{C as Zs}from"./connector-provenance-bmBJJ9B4.js";import{R as Js}from"./runs-panel-Dkyybqos.js";import"./connection-label-BobuYiAG.js";import"./status-dot-_LQZmEIX.js";import"./use-scroll-sentinel-BpQ70c28.js";import"./runs-B0zVYb-w.js";import"./filter-editors-oNjBX9a2.js";import"./runs-table-9OVdfPXZ.js";function et({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",r=$e({enabled:n}),i=Ee({enabled:n}),h=De({enabled:!n}),o=n?r:h,l=n?i.data?.find(c=>c.slug===a)?.displayName??a:me(a),x=(n?(r.data??[]).filter(c=>c.kind===a).map(c=>({key:`${ae}${c.slug}`,name:c.displayName||c.slug,status:[c.isDefault?"Default":null,c.status].filter(Boolean).join(" · ")})):(h.data?.sandboxes??[]).filter(c=>c.providerKind===a).map(c=>({key:`${ls}${c.id}`,name:c.name,status:c.connected?"Connected":"Needs credentials"}))).map(c=>({id:c.key,name:c.name,description:c.status,tone:null,link:os({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:c.key},search:{}})})),u=`${n?ae:he}${a}`;return e.jsx(le,{header:e.jsx(oe,{title:l,breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:W,children:"Connectors"},"connectors")]})}),children:e.jsx(Qs,{entries:x,isLoading:o.isLoading,isError:o.isError,onRetry:()=>void o.refetch(),action:e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:n?e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:u},search:{addAccount:!0},children:"Add connection"}):e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:u},children:"Add connection"})})})})}function st({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:r,onDone:i}){const h=cs(),o=ds(),l=s.find(d=>d.slug===t)??s[0],x=n&&l&&te(l)?"oauth":"api-key",[u,c]=p.useState(l?.slug??""),[j,N]=p.useState(a??l?.slug??""),[m,y]=p.useState(l?.displayName??""),[b,$]=p.useState(l?.baseUrl??""),[w,k]=p.useState(r??l?.defaultModel??""),[D,S]=p.useState(""),[z,R]=p.useState(l?.apiKeyPlaceholder??""),[I,O]=p.useState(x),[v,f]=p.useState(""),[A,Y]=p.useState(null),[T,q]=p.useState(!1),[fe,ge]=p.useState(!1),C=s.find(d=>d.slug===u),J=we(C?.modalities??[]),je=n&&!!C&&te(C),ve=C?Fe(C):!1,ye=je&&I==="oauth",Ne=ve&&!ye,L=us().slug,ee=p.useCallback(()=>{ge(!0),o.invalidateQueries({queryKey:["inference-providers"]})},[o]),Je=p.useCallback(()=>{o.invalidateQueries({queryKey:["inference-providers"]}),i()},[o,i]),es=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(d.authorizeUrl,"_blank","noreferrer")}catch(d){X.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),ss=p.useCallback(async()=>{if(!(!L||!C||!v.trim())){q(!0);try{const d=await Se(L,C.slug,{code:v.trim()});if(d.status!=="success")throw new Error(d.error||"Sign-in not complete");ee(),X.success(`Signed in with ${C.displayName}`)}catch(d){X.error(d instanceof Error?d.message:"Failed to complete sign-in")}finally{q(!1)}}},[L,C,v,ee]),ts=p.useCallback(async()=>{if(!(!L||!C)){q(!0);try{const d=await Ae(L,C.slug);if(d.mode!=="device")throw new Error("Unexpected sign-in mode");Y({userCode:d.userCode,deviceAuthId:d.deviceAuthId,verificationUrl:d.verificationUrl}),window.open(d.verificationUrl,"_blank","noreferrer")}catch(d){X.error(d instanceof Error?d.message:"Failed to start sign-in")}finally{q(!1)}}},[L,C]),as=p.useCallback(async()=>{if(!(!L||!C||!A)){q(!0);try{const d=await Se(L,C.slug,{deviceAuthId:A.deviceAuthId,userCode:A.userCode});if(d.status==="success"){ee(),X.success(`Signed in with ${C.displayName}`);return}Y(_=>_&&{..._,message:d.error||"Waiting for approval..."})}catch(d){X.error(d instanceof Error?d.message:"Failed to check status")}finally{q(!1)}}},[L,C,A,ee]),ns=C?.supportedAuthTypes.includes("device-code")??!1,rs=d=>{c(d);const _=s.find(ue=>ue.slug===d);_&&(N(_.slug),y(_.displayName),$(_.baseUrl),k(_.slug===t&&r?r:_.defaultModel??""),R(_.apiKeyPlaceholder),O(n&&te(_)?"oauth":"api-key"),f(""),Y(null),ge(!1))},be=/^[a-z0-9][a-z0-9-]*$/.test(j),Ce=be&&Ne&&D.trim().length>0&&!h.isPending,is=d=>{if(d.preventDefault(),!Ce)return;const _={};b.trim()&&(_.base_url=b.trim()),w.trim()&&(_.model=w.trim());const ue=Object.keys(_).length>0?{text:_}:void 0;h.mutate({slug:j.trim(),kind:u,displayName:m.trim()||void 0,apiKey:D.trim(),capabilities:ue},{onSuccess:()=>i()})},ke=!!(t&&s.some(d=>d.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:ke&&C?`Connect ${C.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:is,className:"grid max-w-md gap-3",children:[ke&&C?e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(Le,{value:u,onValueChange:rs,children:[e.jsx(Re,{id:"ip-provider",className:"w-full",children:e.jsx(Oe,{})}),e.jsx(Be,{children:s.map(d=>{const _=we(d.modalities);return e.jsx(Ke,{value:d.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[d.iconUrl?e.jsx("img",{src:d.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(ms,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),d.displayName,_.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",_.join(", ")]}):null]})},d.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:J.length>0?`Serves text, plus ${J.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-display",children:"Name"}),e.jsx(F,{id:"ip-display",placeholder:"Friendly name",value:m,onChange:d=>y(d.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(P,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-slug",placeholder:"my-provider",value:j,onChange:d=>N(d.target.value),autoComplete:"off",required:!0}),j&&!be?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."})]}),je&&ve?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:I==="oauth"?"secondary":"ghost",onClick:()=>O("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:I==="api-key"?"secondary":"ghost",onClick:()=>O("api-key"),children:"API key"})]})]}):null,Ne?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(F,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:b,onChange:d=>$(d.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(P,{htmlFor:"ip-model",children:"Default model"}),e.jsx(F,{id:"ip-model",placeholder:"gpt-4o-mini",value:w,onChange:d=>k(d.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(P,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(F,{id:"ip-key",type:"password",placeholder:z||void 0,value:D,onChange:d=>S(d.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(H,{onCancel:i,children:e.jsx(g,{type:"submit",disabled:!Ce,children:h.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ye?e.jsxs("div",{className:"grid gap-3",children:[fe?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",C?.displayName??"provider",". This covers your agents in this org."]}):ns?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ts(),disabled:T||!L,children:A?"Get a new code":"Get device code"}),A?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(F,{id:"ip-device-code",readOnly:!0,value:A.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:A.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",C?.displayName??"provider"," to approve",e.jsx(_e,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void as(),disabled:T,children:T?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void es(),disabled:T||!L,children:["Sign in with ",C?.displayName??"provider",e.jsx(_e,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(F,{id:"ip-oauth-code",placeholder:"code#state",value:v,onChange:d=>f(d.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void ss(),disabled:T||!v.trim(),children:T?"Finishing...":"Finish sign-in"})]}),e.jsx(H,{onCancel:i,children:e.jsx(g,{type:"button",onClick:Je,disabled:!fe,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(H,{onCancel:i})]})]})]})}const tt={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function at({provider:s,catalog:t,autoOpenEdit:a}){const n=hs(),[r,i]=p.useState(a?"edit":null),h=xs(s.kind,t);p.useEffect(()=>{a&&i("edit")},[a]);const l=(t.find(c=>c.slug===s.kind)?.modalities??["text"]).filter(c=>c!=="text"),x=h&&l.length>0,u=c=>i(j=>j===c?null:c);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 ${ps(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),x?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>u("edit"),children:"Edit"})]})]}),r==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(rt,{provider:s,supportsUpstreamConfig:h,onDone:()=>i(null)})}):null,r==="capabilities"&&x?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),l.map(c=>e.jsx(it,{providerSlug:s.slug,modality:c,block:s.capabilities[c]??{}},c))]})}):null]})}function nt({provider:s,onDeleted:t}){const a=fs(),[n,r]=p.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>r(!1)}),children:[a.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>r(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>r(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function rt({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=gs(),r=js(),i=Ue(),[h,o]=p.useState(s.displayName??""),[l,x]=p.useState(""),u=s.capabilities.text??{},[c,j]=p.useState(u.base_url??""),[N,m]=p.useState(u.model??""),[y,b]=p.useState(null),$=h.trim().length>0&&h.trim()!==(s.displayName??""),w=t&&l.trim().length>0,k=c.trim()!==(u.base_url??""),D=N.trim()!==(u.model??""),S=t&&(k||D),z={base_url:c.trim()||void 0,model:N.trim()||void 0,models_endpoint:u.models_endpoint},R=Ie(z),I=t&&S&&ze(R),O=n.isPending||r.isPending||i.isPending,v=($||w||S)&&!I&&!O,f=async A=>{if(A.preventDefault(),!!v){b(null);try{await Promise.all([$?n.mutateAsync({providerSlug:s.slug,displayName:h.trim()}):Promise.resolve(),S?i.mutateAsync({providerSlug:s.slug,modality:"text",block:z}):Promise.resolve(),w?r.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{b("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:f,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(F,{id:`edit-name-${s.slug}`,value:h,onChange:A=>o(A.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(P,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(F,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:c,onChange:A=>j(A.target.value),autoComplete:"off"}),R.base_url?e.jsx("p",{className:"text-xs text-destructive",children:R.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(F,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:A=>m(A.target.value),autoComplete:"off"}),R.model?e.jsx("p",{className:"text-xs text-destructive",children:R.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(F,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:A=>x(A.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,y?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:y}):null,e.jsx(H,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!v,children:O?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function it({providerSlug:s,modality:t,block:a}){const n=Ue(),[r,i]=p.useState(!1),[h,o]=p.useState(a.base_url??""),[l,x]=p.useState(a.model??""),[u,c]=p.useState(a.models_endpoint??""),[j,N]=p.useState(!!a.models_endpoint),m=!!(a.base_url||a.model||a.models_endpoint),y={base_url:h.trim()||void 0,model:l.trim()||void 0,models_endpoint:u.trim()||void 0},b=Ie(y),$=ze(b),w=()=>{$||n.mutate({providerSlug:s,modality:t,block:y})};return e.jsxs("div",{className:ne,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>i(k=>!k),children:[e.jsx("span",{className:"text-sm font-medium",children:tt[t]}),m?e.jsx(U,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),r?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(F,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:h,onChange:k=>o(k.target.value),autoComplete:"off"}),b.base_url?e.jsx("p",{className:"text-xs text-destructive",children:b.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(F,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:k=>x(k.target.value),autoComplete:"off"}),b.model?e.jsx("p",{className:"text-xs text-destructive",children:b.model}):null]}),j?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(F,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:u,onChange:k=>c(k.target.value),autoComplete:"off"}),b.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:b.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!0),children:"Advanced"}),e.jsx(H,{onCancel:()=>i(!1),children:e.jsx(g,{size:"sm",disabled:$||n.isPending,onClick:w,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(V,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function lt({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(ct,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(U,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(U,{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(U,{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(de,{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 ot({sandbox:s,onDeleted:t}){const a=vs(),[n,r]=p.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(xe,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(V,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>r(!0),children:"Delete sandbox"})]})})}function ct({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(ys,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(Ns,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const dt={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},ut={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function zt(){const{owner:s,connectorKey:t}=Q.useParams(),{instances:a}=Q.useSearch(),{kind:n,id:r}=Us(t);return e.jsx(Is,{owner:s,children:({ownerSlug:i,organizationId:h,isWorkspaceLoading:o})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(et,{ownerSlug:i,familyKind:n,familyId:r});switch(n){case"inference":return e.jsx(xt,{ownerSlug:i,providerSlug:r});case"sandbox":return e.jsx(ht,{ownerSlug:i,sandboxId:r});case"sandbox-provider":return e.jsx(mt,{ownerSlug:i,providerKind:r});default:return e.jsx(jt,{ownerSlug:i,organizationId:h,isWorkspaceLoading:o,connectorKey:t})}}})}function mt({ownerSlug:s,providerKind:t}){const a=G();return p.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${he}${t}`},replace:!0})},[a,s,t]),null}function ht({ownerSlug:s,sandboxId:t}){const a=G(),{data:n,isLoading:r,isError:i,refetch:h}=De(),o=n?.sandboxes.find(x=>x.id===t)??null;if(r)return e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"h-6 w-6 rounded"}),e.jsx(E,{className:"h-5 w-40"})]}),e.jsx(E,{className:"h-24 w-full rounded-lg"})]});if(i)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(g,{variant:"outline",onClick:()=>void h(),children:"Retry"})]})});if(!o)return e.jsxs(M,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const l=o.name||me(o.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:W,children:"Connectors"},"connectors"),e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${he}${o.providerKind}`},search:{instances:!0},className:W,children:me(o.providerKind)},"family")]}),icon:e.jsx(pe,{name:l,faviconDomain:Ws(o.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"secondary",children:o.providerKind}),o.connected?e.jsx(U,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(U,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Ge,{facets:ut})}),children:[e.jsx(lt,{sandbox:o}),e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(ot,{sandbox:o,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function xt({ownerSlug:s,providerSlug:t}){const a=G(),{model:n,reason:r,agentId:i,addAccount:h}=Q.useSearch(),{data:o=[],isLoading:l,isError:x,refetch:u}=$e(),c=Ee(),{data:j=[],isLoading:N}=c,m=h?null:o.find(D=>D.slug===t)??null,y=j.find(D=>D.slug===(m?.kind??t))??null;if(l||N)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"h-6 w-6 rounded"}),e.jsx(E,{className:"h-5 w-40"})]}),e.jsx(E,{className:"h-16 w-full rounded-lg"}),e.jsx(E,{className:"h-24 w-full rounded-lg"}),e.jsx(E,{className:"h-32 w-full rounded-lg"})]})});if(x)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(g,{variant:"outline",onClick:()=>void u(),children:"Retry"})]})});if(!m&&!y&&!c.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(We,{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 b=m?m.displayName||m.slug:y?.displayName||t,$=m!==null,w=r?e.jsx(gt,{agentId:i,model:n,providerName:b}):n?e.jsx(ft,{providerName:b,model:n,isConnected:$}):null,k=e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:s},className:W,children:"Connectors"},"connectors"),...m?[e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${m.kind}`},search:{instances:!0},className:W,children:y?.displayName??m.kind},"family")]:[]]}),icon:e.jsx(pe,{iconUrl:y?.iconUrl,name:b}),title:b,badge:m?e.jsxs(e.Fragment,{children:[m.isDefault?e.jsx(U,{variant:"secondary",children:"Default"}):null,m.status?e.jsx(U,{variant:"outline",children:m.status}):null,m.hasCustomUpstream?e.jsx(U,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Ge,{facets:dt})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(le,{header:k,children:[w,e.jsx("div",{className:"space-y-6",children:m?e.jsx(at,{provider:m,catalog:j,autoOpenEdit:!!n}):e.jsx(pt,{ownerSlug:s,providerSlug:t,existingSlugs:o.map(D=>D.slug),catalog:j,catalogError:c.isError?c.error:null,model:n})}),m?e.jsx(B,{title:"Settings",muted:!0,children:e.jsx(nt,{provider:m,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function pt({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:r,model:i}){const h=G(),o=n.find(u=>u.slug===t),l=a.includes(t)&&!!o&&te(o);let x=t;for(let u=2;a.includes(x);u++)x=`${t}-${u}`;return r?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(de,{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:r instanceof Error?r.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${ae}${t}`},search:{},children:"Open existing connection"})})]}),(!l||o&&Fe(o))&&e.jsx(st,{catalog:n,initialProvider:t,initialSlug:x,allowOAuth:!l,initialModel:i?.includes("/")?i.split("/").slice(1).join("/"):i,onDone:()=>void h({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function ft({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(de,{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 gt({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(de,{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 jt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:r=[],isLoading:i,isError:h,refetch:o}=Vs(t??""),{data:l=[],isLoading:x,isError:u,refetch:c}=Ys(t??"",{connectorKey:n}),j=p.useMemo(()=>r.find(y=>y.key===n),[r,n]),N=p.useMemo(()=>Xs(n,r,{name:l[0]?.connector_name??n}),[n,r,l]);if(a||i)return e.jsx("div",{children:e.jsxs(M,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"h-6 w-6 rounded"}),e.jsx(E,{className:"h-5 w-40"})]}),e.jsx(E,{className:"h-16 w-full rounded-lg"}),e.jsx(E,{className:"h-24 w-full rounded-lg"}),e.jsx(E,{className:"h-32 w-full rounded-lg"})]})});if(h||u)return e.jsx(M,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(g,{variant:"outline",onClick:()=>{o(),c()},children:"Retry"})]})});const m=j?e.jsx(yt,{connector:j,ownerSlug:s}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(We,{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.",l.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:j&&t?e.jsx(vt,{hero:m,connector:j,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:x,refetchConnections:c}):e.jsxs(M,{className:"space-y-6",children:[m,l.length>0&&!x?e.jsx(He,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):e.jsx(Qe,{organizationId:t??"",ownerSlug:s,connectorKey:n,connections:l,isLoading:x})]})})}function vt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}){const{isAdmin:l,isLoading:x}=Z(a),u=(t.operations_summary?.total??0)>0;return e.jsxs(le,{header:s,children:[e.jsx(bs,{organizationId:a,connectorKey:r}),e.jsx(At,{connector:t,organizationId:a,ownerSlug:n,connectorKey:r,connections:i,isLoading:h,refetchConnections:o}),i.length>0?e.jsx(He,{section:!0,connections:i,connector:t,ownerSlug:n,connectorKey:r}):null,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(_t,{connector:t,organizationId:a,ownerSlug:n}),u&&x?e.jsx(E,{className:"h-20 w-full rounded-lg"}):u&&l?e.jsx(Ct,{connector:t,organizationId:a,ownerSlug:n}):u&&!l?e.jsx(B,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),e.jsx(Nt,{connector:t,organizationId:a,ownerSlug:n,connectionCount:i.length}),!h&&i.length>0?e.jsx(B,{title:"Recent activity",children:e.jsx(Js,{scope:{connectorKey:r},ownerSlug:n})}):null]})}function yt({connector:s,ownerSlug:t}){return e.jsx(oe,{breadcrumb:e.jsx(ce,{crumbs:[e.jsx(K,{to:"/$owner/connectors",params:{owner:t},className:W,children:"Connectors"},"connectors")]}),icon:e.jsx(pe,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Hs(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsx(Zs,{connectorDef:s,ownerSlug:t}),caption:s.description})}function Nt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=Te(s.auth_schema),i=zs(s.auth_schema),h=r.find(w=>w.type==="oauth"),o=Ye(s.auth_schema),l=r.some(w=>w.type==="env_keys"),x=r.some(w=>w.type==="browser"),u=i.some(w=>w.type==="interactive"),c=!!(h||o||l||x),j=Ms(s),{isAdmin:N}=Z(t),{data:m=[]}=ie(t,{connectorKey:s.key,profileKind:"env"}),{data:y=[]}=ie(t,{profileKind:"browser_session",connectorKey:s.key}),b=N&&s.installed!==!1;return!!(h||o)||l&&m.length>0||x&&y.length>0||!c||b?e.jsxs("div",{className:"space-y-6",children:[h?e.jsx(kt,{connector:s,organizationId:t,oauthMethod:h}):null,o?e.jsx(B,{title:"App installation",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Install the ",s.name," app to create or repair the workspace connection."]}),e.jsx(Xe,{organizationId:t,connectorKey:s.key,provider:o.provider,providerLabel:s.name,installShape:o.installShape,variant:"outline"})]})}):null,l&&m.length>0?e.jsx(Pe,{profiles:m,type:"env"}):null,x&&y.length>0?e.jsx(Pe,{profiles:y,type:"browser_session"}):null,c?null:j?e.jsx(B,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(K,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):u?e.jsx(B,{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."]})}):e.jsx(B,{title:"Authentication",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector doesn't need workspace credentials. Create a connection above to get started."})}),e.jsx(bt,{connector:s,organizationId:t,ownerSlug:a,connectionCount:n})]}):null}function bt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const r=G(),{isAdmin:i}=Z(t),h=Gs(),[o,l]=p.useState(!1),[x,u]=p.useState(null),c=s.installed!==!1;if(!i||!c)return null;const j=n>0,N=h.isPending,m=()=>{u(null),h.mutate({connector_key:s.key},{onSuccess:()=>{r({to:"/$owner/connectors",params:{owner:a}})},onError:y=>{u(y instanceof Error?y.message:"Failed to remove connector"),l(!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:"Remove connector"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Archives ",s.name," in this workspace. Existing synced data stays in memory."]}),j?e.jsxs("p",{className:"mt-2 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,x?e.jsx("p",{className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}):null,e.jsx("div",{className:"mt-3",children:o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:N,onClick:m,children:[N?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Confirm remove"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:N,onClick:()=>l(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:N||j,onClick:()=>l(!0),children:[e.jsx(xe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove connector"]})})]})}function Ct({connector:s,organizationId:t,ownerSlug:a}){const n=qe();return e.jsx(Ve,{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 kt({connector:s,organizationId:t,oauthMethod:a}){const{isAdmin:n,isLoading:r}=Z(t),{setup:i}=Q.useSearch(),h=Q.useNavigate(),{data:o=[],refetch:l,isLoading:x,isError:u}=ie(t,{connectorKey:s.key,provider:a.provider}),c=o.filter(j=>j.profile_kind==="oauth_app");return r||x?e.jsx(E,{className:"h-28 w-full"}):u?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load OAuth apps. Reload the page to try again."}):e.jsx(wt,{connector:s,oauthMethod:a,appProfiles:c,isAdmin:n,initialOpen:i==="oauth_app",onClose:()=>{i==="oauth_app"&&h({search:j=>({...j,setup:void 0}),hash:"",replace:!0})},refetchProfiles:l})}function wt({initialOpen:s=!1,onClose:t,connector:a,oauthMethod:n,appProfiles:r,isAdmin:i,refetchProfiles:h}){const o=$s(),l=Es(),[x,u]=se(a.key,s&&i),[c,j]=p.useState(!1);p.useEffect(()=>{s&&i&&u(!0)},[s,i,u]);const N=`${Ds()}/connect/oauth/callback`,[m,y]=se(a.key,`${a.name} OAuth App`),[b,$]=se(a.key,""),[w,k]=se(a.key,null),D=Fs(n),S=Ls(`${a.key}:${x}`,Rs(D),D),{values:z,setValues:R}=S,I=r.find(v=>v.is_default_for_connector&&v.connector_key===a.key),O=()=>{S.canSubmit&&(k(null),o.mutate({connector_key:a.key,profile_kind:"oauth_app",display_name:m.trim()||`${a.name} OAuth App`,slug:b.trim()||void 0,credentials:$t(qs(z))},{onSuccess:v=>{const f=v.auth_profile?.slug;f&&!I&&l.mutate({connector_key:a.key,auth_profile_slug:f}),u(!1),t?.(),y(`${a.name} OAuth App`),$(""),h()},onError:v=>{k(v instanceof Error?v.message:"Failed to add OAuth app")}}))};return e.jsxs(B,{id:"connector-oauth-apps",title:`${Pt(n.provider)} app configuration`,action:i&&!x?e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>u(!0),children:[e.jsx(Me,{className:"size-3.5"}),"Add OAuth app"]}):null,children:[i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{children:"OAuth callback URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all text-xs",children:N}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(N).then(()=>j(!0)).catch(()=>k("Could not copy the callback URL. Select and copy it above."))},children:[e.jsx(Os,{className:"mr-1.5 h-3.5 w-3.5"}),c?"Copied":"Copy callback URL"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Register this exact URL in your provider’s app settings before saving the client configuration."})]}),r.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No app configured on this server. Choose a managed option if available, or add your own app here."}):e.jsx("div",{className:"space-y-2",children:r.map(v=>e.jsxs("div",{className:re(ne,"flex flex-wrap items-center gap-3 p-3"),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:v.display_name}),v.is_default_for_connector&&v.connector_key===a.key?e.jsx(U,{variant:"secondary",className:"text-[10px]",children:"Default"}):null,e.jsx(Ze,{status:v.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:v.slug})]}),i&&!v.is_default_for_connector&&v.connector_key===a.key&&v.status==="active"?e.jsx(g,{variant:"outline",size:"sm",disabled:l.isPending,onClick:()=>l.mutate({connector_key:a.key,auth_profile_slug:v.slug}),children:"Set default"}):null]},v.slug))}),i&&x?e.jsxs("div",{className:re(ne,"space-y-3 p-3"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(P,{htmlFor:"oauth-app-name",children:"Display name"}),e.jsx(F,{id:"oauth-app-name",value:m,onChange:v=>y(v.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(P,{htmlFor:"oauth-app-slug",children:"Slug"}),e.jsx(F,{id:"oauth-app-slug",placeholder:"optional",value:b,onChange:v=>$(v.target.value)})]}),e.jsx(Bs,{schema:S.revision??void 0,values:z,onValuesChange:R,fieldIdPrefix:"oauth-app-"}),e.jsx(Ks,{visible:S.hasConflict,onReload:S.reset}),w?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>{u(!1),t?.()},children:"Cancel"}),e.jsxs(g,{size:"sm",disabled:o.isPending||!S.canSubmit,onClick:O,children:[o.isPending?e.jsx(V,{size:"md",className:"mr-1.5"}):null,"Save OAuth app"]})]})]}):null]})}function At({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i,refetchConnections:h}){const l=Te(s.auth_schema).find(N=>N.type==="oauth"),{data:x=[],refetch:u,isLoading:c,isError:j}=ie(t,{connectorKey:s.key,provider:l?.provider});if(l){if(j)return e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not load accounts. Reload the page to try again."});const N=x.filter(y=>y.profile_kind==="oauth_app"),m=x.filter(y=>y.profile_kind==="oauth_account");return e.jsx(St,{connector:s,organizationId:t,oauthMethod:l,appProfiles:N,accounts:m,connections:r,isLoading:i||c,refetchProfiles:u,refetchConnections:h})}return e.jsx(Qe,{connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i})}function St({connector:s,organizationId:t,oauthMethod:a,appProfiles:n,accounts:r,connections:i,isLoading:h,refetchProfiles:o,refetchConnections:l}){const{session:x}=Cs(),{isAdmin:u,isLoading:c}=Z(t),j=ks(),N=ws(),m=As(),[y,b]=p.useState(""),[$,w]=p.useState([]),k=n.filter(f=>f.status==="active"),D=k.find(f=>f.is_default_for_connector&&f.connector_key===s.key),S=(u?k.find(f=>f.slug===y):void 0)??D??(u&&k.length===1?k[0]:void 0),z=new Set(i.map(f=>f.auth_profile_slug)),R=r.filter(f=>f.created_by===x?.user?.id),I=R.filter(f=>!z.has(f.slug)),O=!i.some(f=>f.created_by===x?.user?.id)&&R.length===0;if(h||c||!x?.user?.id||!O&&I.length===0&&!m.error&&!m.continueUrl)return null;const v=f=>m.begin(async()=>{const A=await j.mutateAsync({connector_key:s.key,app_auth_profile_slug:f,requested_scopes:Ts(a,$)});return o(),l(),A});return e.jsxs(B,{title:O?"Connect your account":"Your accounts",children:[O&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your own account to grant access. Your connection is private to you."}),u&&k.length>1?e.jsxs("div",{className:"space-y-1",children:[e.jsx(P,{children:"App used for this account"}),e.jsxs(Le,{value:S?.slug??"",onValueChange:b,children:[e.jsx(Re,{"aria-label":"App used for this account",children:e.jsx(Oe,{placeholder:"Choose an OAuth app"})}),e.jsx(Be,{children:k.map(f=>e.jsxs(Ke,{value:f.slug,children:[f.display_name,f.is_default_for_connector&&f.connector_key===s.key?" (workspace default)":""]},f.slug))})]})]}):S?e.jsxs("p",{className:"text-sm",children:["App: ",S.display_name,S.is_default_for_connector&&S.connector_key===s.key?" (workspace default)":""]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Configure an OAuth app below, then connect your account.":"Ask an administrator to configure and set the workspace-default OAuth app."}),S&&e.jsx(Ss,{requiredScopes:Ps(a),optionalScopes:_s(a),selectedOptionalScopes:$,onToggleOptionalScope:(f,A)=>w(Y=>A?[...new Set([...Y,f])]:Y.filter(T=>T!==f))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{size:"sm",disabled:!S||m.pending,onClick:()=>{S&&v(S.slug)},children:"Connect account"}),u&&e.jsx(g,{asChild:!0,size:"sm",variant:"outline",children:e.jsx("a",{href:"#connector-oauth-apps",children:"Manage app"})})]})]}),I.map(f=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 py-2",children:[e.jsx("span",{className:"text-sm",children:f.display_name}),e.jsx(g,{variant:"outline",size:"sm",disabled:m.pending,onClick:()=>void m.begin(()=>f.status==="active"?j.mutateAsync({connector_key:s.key,auth_profile_slug:f.slug}):N.mutateAsync({auth_profile_slug:f.slug})),children:f.status==="active"?"Use this account":"Reconnect"})]},f.slug)),m.error&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m.error}),m.continueUrl&&e.jsx("a",{href:m.continueUrl,target:"_blank",rel:"noreferrer",className:"text-sm underline",children:"Continue authorization in your browser"})]})}function Pe({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(B,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:re(ne,"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(Ze,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function _t({connector:s,organizationId:t,ownerSlug:a}){const n=qe(),r=Object.keys(s.feeds_schema??{}).length;return r?e.jsx(Ve,{title:"Feeds",summary:`${r} ${r===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}function Qe({connector:s,organizationId:t,ownerSlug:a,connectorKey:n,connections:r,isLoading:i}){const h=G(),o=Ye(s?.auth_schema);if(i)return e.jsxs("div",{className:"space-y-2",children:[e.jsx(E,{className:"h-4 w-24"}),e.jsx(E,{className:"h-16 w-full rounded-lg"})]});if(r.length===0){const l=s&&o?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Xe,{organizationId:t,connectorKey:n,provider:o.provider,providerLabel:s.name,installShape:o.installShape,size:"default",label:`Install ${s.name}`}),e.jsx(g,{asChild:!0,variant:"outline",children:e.jsx(K,{to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n},children:"Use your own app"})})]}):e.jsxs(g,{size:"default",onClick:()=>h({to:"/$owner/connectors/create/$connectorKey",params:{owner:a,connectorKey:n}}),children:[e.jsx(Me,{className:"mr-1.5 h-4 w-4"}),"Create connection"]});return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:l})}return null}function Ze({status:s}){const t=s==="active"?"text-green-500":s==="error"||s==="revoked"?"text-destructive":"text-amber-500";return e.jsxs("span",{className:re("text-xs",t),children:["· ",s]})}function Pt(s){return s.charAt(0).toUpperCase()+s.slice(1)}function $t(s){const t={};for(const[a,n]of Object.entries(s))typeof n=="string"&&n.trim()?t[a]=n.trim():(typeof n=="number"||typeof n=="boolean")&&(t[a]=String(n));return t}export{vt as ConnectorDetailShell,St as OAuthAccountsSection,wt as OAuthAppProfilesSection,zt as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey.index-BoYpah_l.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,cI as A,T as m,j9 as h,ja as p,jb as d,jc as u,jd as w,r as M,an as C,cA as b,je as k}from"./index-JmEl29py.js";import{A as z}from"./agent-loading-shells-jkf9DjdO.js";import{s as N,R as y,A as T}from"./agent-thread-BGHYHWDO.js";import"./app-bridge-BCm4muqj.js";import"./use-mention-search-CAFbh-Dk.js";import"./index-wHFQv1aT.js";import"./use-automations-DS3uz3pb.js";import"./events-feed-C4VrjIc1.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./json-diff-4sMmayDd.js";import"./copy-button-kcjg8Giw.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./use-scroll-sentinel-BpQ70c28.js";const I={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 O({platform:s,className:t}){const a=s?I[s]:null;return a?"imgSrc"in a?e.jsx("img",{src:a.imgSrc,alt:"","aria-hidden":"true",className:m("rounded-sm",t),loading:"lazy"}):e.jsx("svg",{viewBox:a.viewBox??"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:t,style:{color:a.hex},children:e.jsx("path",{d:a.path})}):e.jsx(A,{className:m("text-muted-foreground",t),"aria-hidden":"true"})}const L={slack:"Slack",telegram:"Telegram",whatsapp:"WhatsApp",discord:"Discord",web:"Web"};function R(s,t,a){return s==="slack"&&a?.teamId&&t?`https://app.slack.com/client/${a.teamId}/${t}`:null}function S({owner:s,agentId:t,conversationId:a}){const{data:n=[],isLoading:x}=w(t,a,{orgSlug:s}),i=M.useMemo(()=>n.map(o=>N(o,{showToolCalls:!0})).filter(o=>o!==null),[n]),[r,g]=a.split(":"),l=L[r]??"the source app",{org:f}=C(),{data:j=[]}=b(f?.id??"",{connectorKey:r}),v=j[0]?.config?.chatMetadata,c=R(r,g,v);return e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col pb-6",children:x?e.jsx(z,{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(T,{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(O,{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 U(){const{owner:s,agentId:t,conversationId:a}=k.useParams();return e.jsx(S,{owner:s,agentId:t,conversationId:a})}export{U as component};
|
|
2
|
-
//# sourceMappingURL=_conversationId-ML2TjCwN.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{x as u,q as v,j as s,at as x,b_ as d,b$ as f,c0 as h,bm as w,c1 as j}from"./index-JmEl29py.js";import{E as P}from"./event-detail-C25TvOb_.js";import"./events-feed-C4VrjIc1.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./use-automations-DS3uz3pb.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./copy-button-kcjg8Giw.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./use-scroll-sentinel-BpQ70c28.js";import"./view-param-filters-FuOZyjMg.js";import"./app-bridge-BCm4muqj.js";import"./filter-editors-oNjBX9a2.js";function g({owner:e,eventId:t,viewKey:r}){const o=u({strict:!1}),n=v(),m=(i,a)=>s.jsx(P,{owner:a,organizationId:i,eventId:t,viewKey:r,params:r?f(o):{},onParamsChange:(p,l,c)=>void n({to:d(a,t,p),search:l,replace:c?.replace??!0}),fullBleed:!0},`${a}/${t}`);return s.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):s.jsx(x,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):s.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function O(){const{owner:e,eventId:t}=h.useParams(),r=w({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(t);return o===null?null:s.jsx(g,{owner:e,eventId:o,viewKey:r?.viewKey})}export{O as component};
|
|
2
|
-
//# sourceMappingURL=_eventId-BYc3I2EL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j8 as a,j as e}from"./index-JmEl29py.js";import{b as i}from"./agent-guardrails-route-D9PpDgR-.js";import"./model-selector-BeFuFH7p.js";import"./agent-subpage-shell-D49f-bzP.js";import"./agent-loading-shells-jkf9DjdO.js";import"./agent-card-controls-ColL5rdd.js";function j(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{j as component};
|
|
2
|
-
//# sourceMappingURL=_name-BsOZmvlH.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-BvkYk72J.js","assets/index-JmEl29py.js","assets/index-Dr7bouPX.css","assets/automation-detail-content-DCAZBKle.js","assets/create-automation-form-y3tq2QIJ.js","assets/cronstrue-CeUS_78Q.js","assets/entity-options-BcTafZ2e.js","assets/connection-label-BobuYiAG.js","assets/use-automations-DS3uz3pb.js","assets/model-selector-BeFuFH7p.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-C8FJbT2P.js","assets/index-wHFQv1aT.js","assets/use-mention-search-CAFbh-Dk.js","assets/proposal-review-shell-CmLy1MZf.js","assets/runs-B0zVYb-w.js","assets/events-feed-C4VrjIc1.js","assets/client-activity-scopes-CmK3DkSP.js","assets/client-rows-fFuxzFtE.js","assets/json-diff-4sMmayDd.js","assets/copy-button-kcjg8Giw.js","assets/linked-record-peek-B0_B4PnF.js","assets/card-Cspo-4M6.js","assets/use-scroll-sentinel-BpQ70c28.js","assets/agent-loading-shells-jkf9DjdO.js","assets/agent-thread-BGHYHWDO.js","assets/app-bridge-BCm4muqj.js","assets/connection-feed-detail-IO6G5QjL.js","assets/runs-table-9OVdfPXZ.js","assets/connector-scope-lists-B44Q9W-j.js","assets/status-dot-_LQZmEIX.js","assets/connections-browser-CzdcZeiU.js","assets/source-record-panels-BeAZeMLy.js","assets/schema-type-editor-panel-DcJqbCrU.js","assets/entity-type-page-BzMZttzh.js","assets/event-detail-C25TvOb_.js","assets/view-param-filters-FuOZyjMg.js","assets/filter-editors-oNjBX9a2.js","assets/views-access-required-CWwlobOd.js","assets/record-session-CJzFoVKc.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{p as m,j as e,r as h,C as g,L as p,u as k,a as w,b,D as j,c as v,d as y,e as N,f as P,g as R,B as u,h as I,A as _,X as E,l as S,_ as A,S as f,R as L,i as z,k as C,m as D,n as O,N as B,O as T}from"./index-JmEl29py.js";import{R as $}from"./record-session-CJzFoVKc.js";function x({item:a}){const n=a.href?m(a.href):null;if(!n)return null;const s=n.owner,i=n.kind==="automation"?n.automationId:a.sourceAttribution?.automation_id??null,t=a.sourceAttribution,r=[{label:s,to:"/$owner",params:{owner:s}}];return t?.agent_id&&t.agent_name&&r.push({label:t.agent_name,to:"/$owner/agents/$agentId/settings",params:{owner:s,agentId:t.agent_id}}),i!=null&&r.push({label:t?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:s,automationId:String(i)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?r.push({label:"Run details"}):n.kind==="event"?r.push({label:"Event details"}):n.kind==="memory"&&"contentIds"in n&&r.push({label:"Details"}),r.length<2?null:e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:r.map((o,d)=>{const l=d===r.length-1,c=e.jsx("span",{className:l?"truncate font-medium text-foreground":"whitespace-nowrap",children:o.label});return e.jsxs(h.Fragment,{children:[d>0?e.jsx(g,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,o.to&&!l?e.jsx(p,{to:o.to,params:o.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:o.label}):c]},o.to??o.label)})})}const W=S(async()=>({default:(await A(async()=>{const{PeekPaneContent:a}=await import("./peek-pane-content-BvkYk72J.js");return{PeekPaneContent: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,29,30,31,32,33,34,35,36,37,38,39]))).PeekPaneContent}));function H(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(f,{className:"h-5 w-2/3"}),e.jsx(f,{className:"h-4 w-full"}),e.jsx(f,{className:"h-24 w-full rounded-lg"})]})}function K(){const a=k(),n=w();return a?.item?e.jsx(V,{item:a.item,onClose:a.close,onBack:a.back,isNarrow:n}):null}function U(a){const n=a.href?m(a.href):null,s=n?.kind==="record-view"?n.viewKey:null,i=R({slug:s?n?.owner:void 0});return s&&i.data?.find(t=>t.key===s)?.name||a.title}function V({item:a,onClose:n,onBack:s,isNarrow:i}){const t=a.href?b(a.href):null,r=U(a);h.useEffect(()=>{if(i)return;const l=c=>{c.key==="Escape"&&(c.preventDefault(),n())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n,i]);const o=l=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[s||l?e.jsx(u,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:s??n,children:e.jsx(I,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:r}),t?e.jsx(u,{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(p,{to:t.pathname,search:t.search??{},onClick:n,children:e.jsx(_,{className:"h-4 w-4"})})}):null,e.jsx(u,{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(E,{className:"h-4 w-4"})})]}),d=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(h.Suspense,{fallback:e.jsx(H,{}),children:e.jsx(W,{item:a})})});return i?e.jsx(j,{open:!0,onOpenChange:l=>{l||n()},children:e.jsxs(v,{children:[e.jsx(y,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(N,{"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(P,{className:"sr-only",children:r}),o(!0),e.jsx(x,{item:a}),d]})]})}):e.jsxs("aside",{className:"flex w-[460px] max-w-[45vw] shrink-0 flex-col border-l border-border bg-background",children:[o(!1),e.jsx(x,{item:a}),d]})}function q(){const{owner:a}=L.useParams(),{data:n,isLoading:s,error:i}=z(a==="me"?null:a,{slug:a}),{session:t,isReady:r}=C(),o=D(i)&&!n?.workspace;return O({active:!s&&!o&&r&&!t&&!n?.workspace,owner:a})?null:e.jsx(B,{children:e.jsx($,{children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e.jsx(T,{})}),e.jsx(K,{})]})})})}export{q as component};
|
|
3
|
-
//# sourceMappingURL=_owner-UuyQLJ-0.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iY as p,j as e,bl as m}from"./index-JmEl29py.js";import{M as i}from"./memory-browse-page-DTlM_9MY.js";import"./public-shell-ready-_awBxu2Y.js";import"./schema-type-editor-panel-DcJqbCrU.js";import"./entity-type-page-BzMZttzh.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./code-editor-C8FJbT2P.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./entity-avatar-BZIa-7i5.js";import"./filter-editors-oNjBX9a2.js";import"./core.esm-CoJ5Splc.js";import"./view-param-filters-FuOZyjMg.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-Dit3MXBQ.js";function d(){const{owner:t,entityType:o,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:t,typeScope:m(o),create:!1,shape:r})}export{d as component};
|
|
2
|
-
//# sourceMappingURL=_shape-BpnVAYWH.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j6 as e,j as i}from"./index-JmEl29py.js";import{b as m}from"./agent-skills-route-BMZ3r1bP.js";import"./agent-skill-context-B9giw2u2.js";import"./core.esm-CoJ5Splc.js";import"./skill-editor-D_W3QlRz.js";import"./agent-subpage-shell-D49f-bzP.js";import"./agent-loading-shells-jkf9DjdO.js";import"./agent-card-controls-ColL5rdd.js";function x(){const{owner:t,agentId:o,skillKey:r}=e.useParams();return i.jsx(m,{owner:t,agentId:o,skillKey:r})}export{x as component};
|
|
2
|
-
//# sourceMappingURL=_skillKey-CYrGvNn-.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jf as e,j as p,bl as i}from"./index-JmEl29py.js";import{M as m}from"./memory-browse-page-DTlM_9MY.js";import"./public-shell-ready-_awBxu2Y.js";import"./schema-type-editor-panel-DcJqbCrU.js";import"./entity-type-page-BzMZttzh.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./code-editor-C8FJbT2P.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./entity-avatar-BZIa-7i5.js";import"./filter-editors-oNjBX9a2.js";import"./core.esm-CoJ5Splc.js";import"./view-param-filters-FuOZyjMg.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-Dit3MXBQ.js";function M(){const{owner:t,entityType:o,viewKey:r}=e.useParams();return p.jsx(m,{ownerSlug:t,typeScope:i(o),create:!1,viewKey:r})}export{M as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-CGAJ1ucr.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j3 as t,j as m}from"./index-JmEl29py.js";import{M as i}from"./memory-browse-page-DTlM_9MY.js";import"./public-shell-ready-_awBxu2Y.js";import"./schema-type-editor-panel-DcJqbCrU.js";import"./entity-type-page-BzMZttzh.js";import"./json-diff-4sMmayDd.js";import"./index-wHFQv1aT.js";import"./code-editor-C8FJbT2P.js";import"./linked-record-peek-B0_B4PnF.js";import"./card-Cspo-4M6.js";import"./entity-avatar-BZIa-7i5.js";import"./filter-editors-oNjBX9a2.js";import"./core.esm-CoJ5Splc.js";import"./view-param-filters-FuOZyjMg.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-Dit3MXBQ.js";function R(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{R as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-CMkhfs1k.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{K as d,j as e,aC as j,gd as b,aS as y,ge as v,L as m,gf as A,i as L,r as w,hD as k,hV as x,B as S,A as P,bi as g}from"./index-JmEl29py.js";import{A as R,f as I,b as M}from"./agent-client-setup-list-BgyLhJCo.js";import{C as f}from"./copy-button-kcjg8Giw.js";import{u as $,g as B,c as U}from"./client-rows-fFuxzFtE.js";function _(t){const n=t?`/mcp/${t}`:"/mcp";if(!d)return`http://localhost:8787${n}`;try{const s=new URL(d);return s.pathname=n,s.toString()}catch{return`${d}${n}`}}const p="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-2.5 pb-8 lg:px-6";function E(t,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${t===n-1?"":"border-b"}`}function N({owner:t}){return e.jsx(v,{crumbs:[e.jsx(m,{to:"/$owner/agents",params:{owner:t},className:A,children:"Agents"},"agents")]})}function K({owner:t}){return e.jsx("div",{className:p,children:e.jsxs(j,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(b,{breadcrumb:e.jsx(N,{owner:t}),icon:e.jsx(y.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(R,{owner:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Local Automation delivery is separate and is not enabled by connecting an agent."})]})})}function W({owner:t,clientId:n}){const s=I(n),{data:C}=L(t,{slug:t}),{data:h=[]}=$(null,{refetchInterval:2500}),r=w.useMemo(()=>B(h).filter(a=>a.connected),[h]);if(!s)return e.jsx("div",{className:p,children:e.jsxs(j,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(m,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const l=_(t),c=M({workspaceName:C?.workspace?.name??t,owner:t,mcpUrl:l,clientLabel:s.id==="other"?void 0:s.label,terminalLogin:s.terminalLogin}),o=s.setupMode==="agent-prompt",u=o?c:s.installText?.(l)??c;return e.jsx("div",{className:p,children:e.jsxs(k,{header:e.jsx(b,{breadcrumb:e.jsx(N,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(g,{name:s.label})}),title:s.label,caption:s.description}),children:[e.jsx(x,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:u}),e.jsx(f,{text:u,label:o?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:s.steps(l).map((a,i)=>e.jsxs("li",{children:[i+1,". ",a]},a))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[o?null:e.jsx(f,{text:c,label:"Copy setup prompt"}),s.guideLinks.map(a=>e.jsx(S,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:a.href,target:"_blank",rel:"noreferrer",children:[a.label,e.jsx(P,{className:"ml-1.5 h-3.5 w-3.5"})]})},a.href))]})]})}),e.jsx(x,{title:"Connected agents",count:r.length>0?String(r.length):void 0,children:r.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:r.map((a,i)=>e.jsxs(m,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:a.clientId},className:E(i,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(g,{name:a.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:a.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:U(a)})]})]},a.key))})}),e.jsx(x,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:l})]})})]})})}export{K as A,W as a};
|
|
2
|
-
//# sourceMappingURL=agent-connect-pages-BryZas7Z.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as y,j as e,E as w,I as k,bn as Q,bo as X,bp as Y,bq as ee,br as ae,fP as te,B as S,q as F,gm as G,j1 as T,j2 as U,h6 as B,fh as se,bH as f,gt as I,bx as ne,bK as re,aR as D,gv as ie,er as oe,es as le,et as M,eu as E,ex as de,ey as R,Q as ue,iA as ce,bz as q,d3 as me,T as $,i$ as ge}from"./index-JmEl29py.js";import{M as he}from"./model-selector-BeFuFH7p.js";import{a as xe,A as J}from"./agent-subpage-shell-D49f-bzP.js";import{f as pe}from"./agent-loading-shells-jkf9DjdO.js";import{A as je}from"./agent-card-controls-ColL5rdd.js";const fe=[{value:"input",label:"Input",hint:"the user message, before the agent runs"},{value:"output",label:"Output",hint:"the agent's reply, before the user sees it"},{value:"pre-tool",label:"Pre-tool",hint:"a tool call, before it executes"},{value:"egress",label:"Egress",hint:"an outbound request to a judged domain"}];function z({initial:a,judgeModelDefault:t,submitLabel:n,submitting:s,onSubmit:o,onCancel:r}){const[i,d]=y.useState(a?.name??""),[h,b]=y.useState(a?.stage??"input"),[x,N]=y.useState(a?.policy??""),[p,C]=y.useState(a?.model??""),[j,u]=y.useState((a?.tools??[]).join(", ")),[l,m]=y.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",K=c=>{c.preventDefault();const _=j.split(",").map(L=>L.trim()).filter(Boolean);o({name:i,stage:h,...g?{kind:g}:{},policy:x,model:p.trim()||void 0,tools:(v||h==="pre-tool")&&_.length>0?_:void 0,domains:h==="egress"&&l.trim()?l.split(",").map(L=>L.trim()).filter(Boolean):void 0,enabled:a?.enabled??!0})};return e.jsxs("form",{onSubmit:K,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-name",value:i,onChange:c=>d(c.target.value),placeholder:"no-competitor-mentions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Shown in the list and on every trip. Must be unique."})]}),v?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-stage",children:"Stage"}),e.jsxs(Q,{value:h,onValueChange:c=>b(c),disabled:s,children:[e.jsx(X,{id:"guardrail-stage",children:e.jsx(Y,{})}),e.jsx(ee,{children:fe.map(c=>e.jsxs(ae,{value:c.value,children:[c.label," — ",c.hint]},c.value))})]})]}),v?e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-required-tools",children:["Required tools ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-required-tools",value:j,onChange:c=>u(c.target.value),placeholder:"suggest_actions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated. The turn trips if the agent finishes without calling every one of these. No judge model runs — this is a lookup against the tools the turn actually used."})]}):null,v?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-policy",children:["Policy ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(te,{id:"guardrail-policy",rows:5,value:x,onChange:c=>N(c.target.value),placeholder:"Deny any response that names a competitor (Acme, Globex) or quotes their pricing.",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"A judge model reads this and the text at the chosen stage, then allows or denies. Write it as an instruction to a reviewer."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-model",children:["Judge model",t?null:e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(he,{value:p,onChange:C,placeholder:t?`Default (${t})`:"Select a model",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?"Optional. Leave blank to use the gateway's default judge model.":"Required: the gateway has no default judge model (EGRESS_JUDGE_MODEL is unset)."})]})]}),!v&&h==="pre-tool"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-tools",children:"Tool scope"}),e.jsx(k,{id:"guardrail-tools",value:j,onChange:c=>u(c.target.value),placeholder:"github.delete_repo, fs.delete",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Optional, comma-separated. Leave blank to judge every tool call."})]}):null,h==="egress"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-domains",children:"Domains"}),e.jsx(k,{id:"guardrail-domains",value:l,onChange:c=>m(c.target.value),placeholder:"api.github.com, .slack.com",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated hostnames this judge gates — exact (api.github.com) or wildcard (.slack.com). Leave blank to route nothing."})]}):null,e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[r?e.jsx(S,{type:"button",variant:"outline",onClick:r,disabled:s,children:"Cancel"}):null,e.jsx(S,{type:"submit",disabled:s,children:s?"Saving…":n})]})]})}function H(a){return a.kind==="require-tool"}function W(a,t,n,s,o){const r=a.name.trim();return r?/^[a-zA-Z0-9][a-zA-Z0-9 _-]*$/.test(r)?n.includes(r)?`"${r}" is a built-in guardrail name — pick another.`:t.some(d=>d.name===r&&d.name!==o)?`A custom guardrail named "${r}" already exists.`:H(a)?a.stage!=="output"?"A required-tool guardrail only runs at the output stage.":a.tools?.some(d=>d.trim())?null:"List at least one tool that must be used.":a.policy.trim()?!s&&!a.model?.trim()?"Judge model is required — the gateway has no default (EGRESS_JUDGE_MODEL is unset).":null:"Policy is required.":"Name may use letters, numbers, spaces, hyphens, and underscores.":"Name is required."}function V(a){const t=H(a),s=(t||a.stage==="pre-tool")&&a.tools&&a.tools.length>0?a.tools.map(d=>d.trim()).filter(Boolean):void 0,o=a.stage==="egress"&&a.domains&&a.domains.length>0?a.domains.map(d=>d.trim()).filter(Boolean):void 0,r=a.model?.trim()||void 0,i=a.policy.trim();return{name:a.name.trim(),enabled:a.enabled,stage:a.stage,...t?{kind:"require-tool"}:{},...t?i?{policy:i}:{}:{policy:i},...r?{model:r}:{},...s&&s.length>0?{tools:s}:{},...o&&o.length>0?{domains:o}:{}}}function be(a,t){return[...a,V(t)]}function ve(a,t,n){return a.map(s=>s.name===t?V(n):s)}function ye(a,t){return a.filter(n=>n.name!==t)}function Ne(a,t,n){return a.map(s=>s.name===t?{...s,enabled:n}:s)}function Ce({owner:a,agentId:t}){const n=F(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=T(t),{data:d=null,isLoading:h}=U(t),b=o||i||h,x=B(t),N=s?.guardrailsInline??[],p=(r??[]).map(u=>u.name),C=async u=>{if(!s){f.error("Still loading agent settings — try again in a moment");return}const l=W(u,N,p,d);if(l){f.error(l);return}try{await x.mutateAsync({guardrailsInline:be(N,u)}),f.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){f.error(m instanceof Error?m.message:"Failed to create guardrail")}},j=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(xe,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),b?e.jsx(se,{rows:4}):e.jsx(z,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:x.isPending,onSubmit:C,onCancel:j})]})}function P(a,t){const n=new Set(a?.guardrails??[]),s=new Set(t.map(i=>i.name)),o=t.map(i=>({name:i.name,stages:i.stages,description:i.description,enabled:n.has(i.name),unknown:!1})),r=(a?.guardrails??[]).filter(i=>!s.has(i)).map(i=>({name:i,stages:[],enabled:!0,unknown:!0}));return[...o,...r]}function we(a){return a.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function Se(a,t,n){return we(a.map(s=>s.name===t&&!s.unknown?{...s,enabled:n}:s))}const A={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function ke(a){const t=new Date(a);return Number.isNaN(t.getTime())?a:ce(t,{addSuffix:!0})}function Ae({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=T(t),r=y.useMemo(()=>P(s,o??[]).find(d=>d.name===n)??null,[s,o,n]),i=(s?.guardrailsInline??[]).find(d=>d.name===n);return i?e.jsx(Te,{owner:a,agentId:t,guardrail:i}):r?e.jsx(Ge,{agentId:t,name:n,row:r}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guardrail not found."})}function Ge({agentId:a,name:t,row:n}){return e.jsxs("div",{className:"space-y-8",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:n.description??(n.stages.length>0?`Built-in. Short-circuits this agent's ${n.stages.map(s=>A[s].toLowerCase()).join(", ")} stage${n.stages.length>1?"s":""} when it matches.`:"Configured out of band — toggling is managed via lobu apply.")}),e.jsx(Z,{agentId:a,guardrail:t})]})}function Te({owner:a,agentId:t,guardrail:n}){const s=F(),{data:o}=G(t),{data:r}=T(t),{data:i=null}=U(t),d=B(t),[h,b]=y.useState(!1),x=o?.guardrailsInline??[],N=(r??[]).map(u=>u.name),p=async(u,l)=>{if(!o)return f.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),f.success(l),!0}catch(m){return f.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=W(u,x,N,i,n.name);if(l){f.error(l);return}await p(ve(x,n.name,u),"Guardrail saved")&&u.name.trim()!==n.name&&s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(u.name.trim())}})},j=async()=>{await p(ye(x,n.name),"Guardrail deleted")&&s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:n.kind==="require-tool"?"Required tools":"Policy"}),e.jsx(z,{initial:n,judgeModelDefault:i,submitLabel:"Save changes",submitting:d.isPending,onSubmit:C})]}),e.jsx("div",{className:"flex justify-end",children:h?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{type:"button",variant:"destructive",onClick:()=>void j(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>b(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(S,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>b(!0),children:["Delete ",n.name]})}),e.jsx(Z,{agentId:t,guardrail:n.name})]})}function Z({agentId:a,guardrail:t}){const{data:n=[],isLoading:s,isError:o}=I(a,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),s?e.jsx(ne,{label:"catches",variant:"table",rows:4}):o?e.jsx(re,{label:"catches"}):n.length===0?e.jsx(D,{icon:ie,title:"No catches yet",description:"This guardrail hasn't short-circuited anything on this agent."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:e.jsxs(oe,{children:[e.jsx(le,{children:e.jsxs(M,{children:[e.jsx(E,{className:"w-[180px]",children:"When"}),e.jsx(E,{className:"w-[120px]",children:"Stage"}),e.jsx(E,{children:"Reason"})]})}),e.jsx(de,{children:n.map(r=>e.jsxs(M,{children:[e.jsx(R,{className:"text-xs text-muted-foreground",title:r.occurredAt,children:ke(r.occurredAt)}),e.jsx(R,{children:e.jsx(ue,{variant:"outline",className:"text-[10px]",children:A[r.stage]})}),e.jsx(R,{className:"text-sm text-muted-foreground",children:r.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},r.id))})]})})]})}function Le({description:a,action:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-center text-sm text-muted-foreground",children:a}),t?e.jsx("div",{className:"shrink-0",children:t}):null]})}function O(a,t){return a.get(t)??0}function Ee(a,t,n){const s=a.map(r=>{const i=r.stages.map(d=>A[d]);return r.unknown&&i.push("Unknown"),{id:r.name,name:r.name,kind:"builtin",description:r.description,stages:r.stages,enabled:r.enabled,unknown:r.unknown,badges:i,tripCount:O(n,r.name)}}),o=t.map(r=>{const i=[A[r.stage],"Custom"];return{id:r.name,name:r.name,kind:"custom",description:r.policy,stages:[r.stage],enabled:r.enabled,unknown:!1,badges:i,tripCount:O(n,r.name)}});return[...s,...o]}function Re({owner:a,agentId:t,expandedName:n}){const s=F(),{data:o,isLoading:r}=G(t),{data:i,isLoading:d}=T(t),{data:h=[]}=I(t),b=B(t),x=async(l,m)=>{if(!o){f.error("Still loading agent settings — try again in a moment");return}try{if(l.kind==="custom")await b.mutateAsync({guardrailsInline:Ne(o.guardrailsInline??[],l.name,m)});else{const g=P(o,i??[]);await b.mutateAsync({guardrails:Se(g,l.name,m)})}f.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){f.error(g instanceof Error?g.message:"Failed to save guardrail")}},N=i===null,p=y.useMemo(()=>{const l=P(o,i??[]),m=o?.guardrailsInline??[],g=new Map;for(const v of h)g.set(v.guardrailName,(g.get(v.guardrailName)??0)+1);return Ee(l,m,g)},[o,i,h]),C=l=>{if(l===n){s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return}s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(l)}})},j=()=>{s({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:a,agentId:t}})},u=r||d;return!u&&p.length===0?e.jsx("div",{className:"space-y-6",children:N?e.jsx(D,{icon:q,title:"Guardrails catalog unavailable",description:"Guardrails will appear here once the gateway publishes its catalog.",actionLabel:"New guardrail",onAction:j}):e.jsx(D,{icon:q,title:"No guardrails yet",description:"Enable a built-in in lobu.toml or write a custom policy guardrail.",actionLabel:"New guardrail",onAction:j})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(Le,{description:"Each guardrail short-circuits this agent's input, output, or tool-call stages. Built-ins are toggle-only; add a custom guardrail to judge messages against a policy you write.",action:u?void 0:e.jsxs(S,{type:"button",onClick:j,children:[e.jsx(me,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(pe,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:p.map((l,m)=>{const g=l.name===n;return e.jsx($e,{card:l,expanded:g,isLast:m===p.length-1,onToggle:()=>C(l.name),onToggleEnabled:v=>void x(l,v),toggleDisabled:l.unknown||b.isPending,children:g?e.jsx(Ae,{owner:a,agentId:t,name:l.name}):null},l.id)})})]})}function $e({card:a,expanded:t,isLast:n,onToggle:s,onToggleEnabled:o,toggleDisabled:r,children:i}){return e.jsxs("div",{className:$("bg-background",!n||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:s,"aria-expanded":t,className:$("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!a.enabled&&!a.unknown&&!t&&"opacity-70"),children:[e.jsx(q,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:$("truncate text-sm text-foreground",a.unknown&&"font-mono text-xs"),children:a.name}),a.kind==="custom"&&a.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:a.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a.tripCount>0?`${a.tripCount} recent ${a.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(ge,{badges:a.badges})]})]}),e.jsx(je,{enabled:a.enabled,name:a.name,expanded:t,onToggleEnabled:o,toggleDisabled:r,onToggle:s})]}),t&&i?e.jsx("div",{className:"border-t border-border px-4 py-4",children:i}):null]})}function De({owner:a,agentId:t,expandedName:n}){return e.jsx(J,{children:e.jsx(Re,{owner:a,agentId:t,expandedName:n})})}function Me({owner:a,agentId:t}){return e.jsx(J,{children:e.jsx(Ce,{owner:a,agentId:t})})}function Oe({owner:a,agentId:t,name:n}){return e.jsx(De,{owner:a,agentId:t,expandedName:decodeURIComponent(n)})}export{De as A,Me as a,Oe as b};
|
|
2
|
-
//# sourceMappingURL=agent-guardrails-route-D9PpDgR-.js.map
|