@lobu/runtime-server 24.1.1 → 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 +175 -39
- package/dist/catalogs/skills.json +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/google_gmail.ts +70 -41
- package/dist/connectors/google_gmail_references.ts +406 -0
- package/dist/connectors/linkedin-inbox-adapter.js +107 -36
- package/dist/connectors/linkedin-inbox.ts +13 -0
- package/dist/connectors/linkedin.ts +1 -1
- package/dist/connectors/postgres.ts +14 -8
- package/dist/connectors/reddit.ts +171 -5
- package/dist/connectors/whatsapp-web-adapter.js +147 -61
- package/dist/connectors/whatsapp-web-helpers.ts +6 -2
- package/dist/connectors/whatsapp_web.ts +48 -17
- package/dist/connectors/x-dm-adapter.js +252 -35
- package/dist/connectors/x.ts +189 -13
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +3 -1
- package/dist/db/migrations/20261024050000_events_source_reference_arrival.sql +27 -0
- package/dist/db/migrations/20261026000000_turn_write_receipts.sql +36 -0
- package/dist/db/migrations/20261026190000_federated_relationship_endpoints.sql +143 -0
- package/dist/dependencies.bun.lock +137 -202
- package/dist/embeddings-server.mjs +81 -11
- package/dist/guest.bundle.js +62 -25
- 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-B2g5qzn3.js +2 -0
- 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-38lHBvjO.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-voRYSM3a.js +2 -0
- package/dist/owletto/dist/assets/agent-card-controls-DiU7Un5w.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-BlXB4SE5.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-DsSoeQeF.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-B7v6Cffw.js → agent-loading-shells-CamDtzHY.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-CgsQ8BK_.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DFucg4c4.js → agent-skill-context-lWbXKEm1.js} +2 -2
- package/dist/owletto/dist/assets/agent-skills-route-D-w3tY_2.js +2 -0
- package/dist/owletto/dist/assets/agent-subpage-shell-CLqpn5Tb.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-D38STyeu.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-BO7G38fL.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-DMYxs6F6.js +2 -0
- 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-DFciMR8u.js +2 -0
- package/dist/owletto/dist/assets/{card-jzhQrMDP.js → card-BCsbrdGs.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B-wq745Q.js → claim-BRua2b_7.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-BLIy1Zc3.js +2 -0
- 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-CEqoCky-.js → code-editor-BFZa4EIt.js} +3 -3
- 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-D-ECOlMJ.js → connector-provenance-BIg8P8WY.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CJYz53YF.js +2 -0
- package/dist/owletto/dist/assets/{connectors-CH4KBZyT.js → connectors-BroKpwhB.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C9ZpHb7V.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-BupT3V0i.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-CWImw-kf.js → cronstrue-xxpD1P2-.js} +2 -2
- package/dist/owletto/dist/assets/{device-D-7WBe9E.js → device-C3AEoL5c.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-2U0UMu3_.js → device-pin-tombstone-B_te59GE.js} +2 -2
- package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
- package/dist/owletto/dist/assets/elk-worker.min-BENGc9gn.js +23 -0
- package/dist/owletto/dist/assets/{entity-avatar-mdh7Kq5D.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-BVbcpW3R.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-CxF2XXzl.js → index-BrDP4PCs.js} +2 -2
- 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-DFyBbp7b.js +2 -0
- package/dist/owletto/dist/assets/{index-D7gHOpfg.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-wHFQv1aT.js +12 -0
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
- package/dist/owletto/dist/assets/{index-BTlx9K_t.js → index-yIub2xUM.js} +2 -2
- package/dist/owletto/dist/assets/json-diff-LE_vNZrM.js +4 -0
- package/dist/owletto/dist/assets/{list-skeleton-CepswBka.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-DD4YBFn-.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-CDrAjH31.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-ktz9Cs_P.js → new-BbdwuJPm.js} +2 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-lZNZ9gul.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
- package/dist/owletto/dist/assets/organization-BDzjnqPf.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
- package/dist/owletto/dist/assets/permissions-CfoY4WFY.js +2 -0
- package/dist/owletto/dist/assets/proposal-review-shell-CVkLnnKo.js +2 -0
- 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-Pbr5czGw.js → record-session-D07szzqN.js} +2 -2
- package/dist/owletto/dist/assets/renderer-AJxSmE3-.js +97 -0
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
- package/dist/owletto/dist/assets/runs-lG2ChtOt.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
- package/dist/owletto/dist/assets/schema-type-editor-panel-C_Es0qDf.js +2 -0
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
- package/dist/owletto/dist/assets/settings-gGYXbFfd.js +2 -0
- 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-CSBtKT4g.js +2 -0
- 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-Dcunv4L0.js → use-mention-search-PfZrNbu_.js} +4 -4
- 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 +137007 -132255
- package/npm-shrinkwrap.json +723 -1095
- package/package.json +7 -10
- 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/browser-requirement.js +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +34 -1
- 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/agent-tooling.d.ts +8 -0
- package/vendor/core/dist/agent-tooling.js +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +5 -0
- 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/entity-reference.d.ts +3 -0
- package/vendor/core/dist/contracts/entity-reference.js +31 -0
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +4 -1
- package/vendor/core/dist/contracts/tools/manage-connections.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +117 -34
- package/vendor/core/dist/contracts/tools/manage-entity.js +47 -14
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
- package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
- package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
- package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
- package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
- package/vendor/core/dist/contracts/worker/protocol.js +20 -0
- 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/reserved.d.ts +6 -3
- package/vendor/core/dist/reserved.js +6 -3
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/dist/worker/auth.d.ts +3 -2
- package/vendor/core/package.json +31 -5
- package/vendor/postgres/.bun-tag-22d644c2873790db +0 -0
- package/vendor/postgres/cf/src/query.js +3 -1
- package/vendor/postgres/cjs/src/query.js +3 -1
- package/vendor/postgres/src/query.js +3 -1
- package/vendor/views/dist/api.js +31 -7
- package/vendor/views/dist/bridge.d.ts +2 -1
- package/vendor/views/dist/bridge.js +10 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-BorucF19.js +0 -3
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +0 -2
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +0 -2
- package/dist/owletto/dist/assets/_deploymentId-B1UWPY0i.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +0 -2
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +0 -2
- package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +0 -3
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +0 -2
- package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-UXU5Fx2G.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-CplnPhbv.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-TdvvIc_J.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-BkZu1LYE.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-B3vvvZZe.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +0 -2
- package/dist/owletto/dist/assets/agents-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +0 -2
- package/dist/owletto/dist/assets/automations-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/callback-CBexCo3F.js +0 -2
- package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +0 -2
- package/dist/owletto/dist/assets/clients-BhNl1tVq.js +0 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +0 -2
- package/dist/owletto/dist/assets/connection-CNm2ukrI.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-WcGCA6qY.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +0 -2
- package/dist/owletto/dist/assets/conversations-table-D_HOe1jN.js +0 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +0 -2
- package/dist/owletto/dist/assets/create-CCjZxIkK.js +0 -2
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-Bpy92SM5.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +0 -2
- package/dist/owletto/dist/assets/deployments-C5hvipQh.js +0 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +0 -2
- package/dist/owletto/dist/assets/deployments-body-DGII20dQ.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +0 -2
- package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +0 -2
- package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +0 -2
- package/dist/owletto/dist/assets/event-detail-DV_zfWnC.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +0 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +0 -2
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +0 -2
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +0 -2
- package/dist/owletto/dist/assets/index-9YuSRymd.js +0 -7950
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +0 -2
- package/dist/owletto/dist/assets/index-B64PGxQm.js +0 -2
- package/dist/owletto/dist/assets/index-BSH07yVD.css +0 -1
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +0 -2
- package/dist/owletto/dist/assets/index-CDz3-ieP.js +0 -12
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +0 -2
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +0 -2
- package/dist/owletto/dist/assets/index-D3WHeGql.js +0 -2
- package/dist/owletto/dist/assets/index-DB1iWI_a.js +0 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +0 -2
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +0 -2
- package/dist/owletto/dist/assets/index-Vcq4gwWv.js +0 -2
- package/dist/owletto/dist/assets/index-fgAJydgX.js +0 -2
- package/dist/owletto/dist/assets/json-diff-DIN5Jhfx.js +0 -4
- package/dist/owletto/dist/assets/login-DxGYyE4n.js +0 -2
- package/dist/owletto/dist/assets/logout-Bkzc7J44.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-BnuhLJ6X.css +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +0 -103
- package/dist/owletto/dist/assets/models-BAVeysNq.js +0 -2
- package/dist/owletto/dist/assets/new-C2av0diq.js +0 -2
- package/dist/owletto/dist/assets/new-snm1ctHn.js +0 -2
- package/dist/owletto/dist/assets/organization-Cb0W823y.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +0 -2
- package/dist/owletto/dist/assets/permissions-Dv39zWKt.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +0 -2
- package/dist/owletto/dist/assets/recent-QhnLDU1_.js +0 -2
- package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +0 -2
- package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +0 -2
- package/dist/owletto/dist/assets/reset-password-CzZw6RcC.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +0 -2
- package/dist/owletto/dist/assets/runs-table-B1APZv7d.js +0 -2
- package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +0 -97
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +0 -2
- package/dist/owletto/dist/assets/settings-VDNiffKU.js +0 -2
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BdfOVPWn.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +0 -2
- /package/vendor/{postgres/.bun-tag-2f292c6554a8475e → @better-auth-kysely-adapter/.bun-tag-abf95749a412716} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j8 as p,j as i,bt as m}from"./index-008wj-Pz.js";import{M as e}from"./memory-browse-page-p2vIbfkC.js";import"./public-shell-ready-DXUTTGGp.js";import"./connector-boxes-DqZA-FdG.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-BMV8bf54.js";import"./status-dot-CSBtKT4g.js";import"./connector-scope-lists-CJYz53YF.js";import"./use-automations-C4TSie1i.js";import"./model-udnQ_S43.js";import"./cronstrue-xxpD1P2-.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C_Es0qDf.js";import"./entity-type-page-Lf6ONdpf.js";import"./json-diff-LE_vNZrM.js";import"./index-wHFQv1aT.js";import"./code-editor-BFZa4EIt.js";import"./renderer-AJxSmE3-.js";import"./calendar-DDCCSPW6.js";import"./table-DHM-vCxP.js";import"./card-BCsbrdGs.js";import"./entity-avatar-CEV4ttUQ.js";import"./filter-bar-COU0sBFQ.js";import"./core.esm-A1UnFbGs.js";import"./view-param-filters-DkX4YdDT.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-De75CR7W.js";function z(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{z as component};
|
|
2
|
+
//# sourceMappingURL=_viewKey-Dx4kJo7o.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as l,ad as u,r as c,Q as m,j as e,ae as d,af as h,ag as f,a2 as v,ah as x,ab as g}from"./index-008wj-Pz.js";import{F as p}from"./full-page-spinner-C1Q_jEzD.js";function j({alt:t="",...n}){return e.jsx("img",{alt:t,...n,referrerPolicy:"no-referrer"})}function w({children:t}){const n=v(),a=async i=>{await n.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(x,{authClient:g,navigate:i=>{a(()=>{window.location.href=i})},replace:i=>{a(()=>window.location.replace(i))},Link:({href:i,children:s,className:r})=>e.jsx("a",{href:i,className:r,children:s}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:j},children:t})}function b(){const{session:t,sessionResult:n}=l(),{invitationId:a}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{n.isPending||t||!a||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(a)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(a)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,n.isPending,a]),t&&!a?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):t?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(w,{children:e.jsx(h,{children:e.jsx(f,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
|
|
2
|
+
//# sourceMappingURL=accept-invitation-38lHBvjO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cc as it,cd as ot,ce as ct,cf as L,cg as rt,ch as T,ci as O,cj as D,ck as lt,cl as F,cm as dt,cn as A,r as y,co as ut,aE as mt,cp as xt,j as e,cq as ft,cr as ht,cs as B,bm as W,ct as pt,B as N,a5 as gt,cu as jt,cv as yt,t as bt,ap as Nt,cw as R,bt as E,cx as vt,v as U,am as kt,cy as _t,bF as K,a$ as k,cz as It,cA as _,cB as $t,cC as V,L as b,cD as Ct,bp as Et,b8 as At,cE as Rt,cF as Mt,cG as M,aD as St,cH as wt,h as G,cI as Lt,cJ as Tt,cK as Y,cL as Ot,u as Dt,cM as Ft,cN as Pt,c as q,cO as zt,cP as Ht,be as Bt,cQ as Wt,cR as Ut,av as Kt}from"./index-008wj-Pz.js";import{R as Vt,E as Gt,S as Yt,N as P,M as qt}from"./record-activity-BXhvJbd9.js";import{M as Qt}from"./member-scope-gate-De75CR7W.js";import{u as Jt}from"./client-activity-scopes-BLIy1Zc3.js";import{a as Zt}from"./client-rows-DiJQ5D1z.js";import{P as Xt}from"./public-shell-ready-DXUTTGGp.js";function te(s,t,r){const c=lt(),a=r?.locale??c.locale??rt,i=it(s,t);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,f]=ot(r?.in,...i>0?[t,s]:[s,t]),n=ct(r?.roundingMethod??"round"),d=f.getTime()-l.getTime(),x=d/F,m=L(f)-L(l),u=(d-m)/F,j=r?.unit;let h;if(j?h=j:x<1?h="second":x<60?h="minute":x<T?h="hour":u<O?h="day":u<D?h="month":h="year",h==="second"){const p=n(d/1e3);return a.formatDistance("xSeconds",p,o)}else if(h==="minute"){const p=n(x);return a.formatDistance("xMinutes",p,o)}else if(h==="hour"){const p=n(x/60);return a.formatDistance("xHours",p,o)}else if(h==="day"){const p=n(u/T);return a.formatDistance("xDays",p,o)}else if(h==="month"){const p=n(u/O);return p===12&&j!=="month"?a.formatDistance("xYears",1,o):a.formatDistance("xMonths",p,o)}else{const p=n(u/D);return a.formatDistance("xYears",p,o)}}function ee(s,t){return te(s,dt(s),t)}const ne=4e3;function se(s){if(s?.kind!=="browser"||!s.url)return null;try{return new URL(s.url).origin}catch{return null}}function ae(s,t){const r=se(t),{data:c=[]}=A(r?s:null),a=y.useMemo(()=>new Set(c.filter(l=>r&&l.browser?.origins.includes(r)).map(l=>l.key)),[c,r]),i=!!s&&a.size>0,{data:o=[]}=ut({...mt.queryOptions(s,{status:"active",enabled:i}),enabled:i,refetchInterval:l=>l.state.data?.some(f=>a.has(f.connector_key)&&f.active_runs>0)?ne:!1});return y.useMemo(()=>o.filter(l=>a.has(l.connector_key)&&l.operations.includes("sync")),[o,a])}function ie(s){return s.active_runs>0?{text:"Syncing…",failed:!1}:s.last_sync_status==="failed"&&s.last_error?{text:s.last_error,failed:!0}:s.last_sync_at?{text:`Last synced ${ee(new Date(s.last_sync_at),{addSuffix:!0})}.`,failed:!1}:{text:"Not synced yet. Sync while you're signed in.",failed:!1}}function oe({organizationId:s,feeds:t}){const{data:r=[]}=A(s),c=xt();return t.length===0?null:e.jsx("section",{"aria-label":"This page",className:"space-y-1",children:e.jsx("ul",{className:"space-y-1",children:t.map(a=>{const i=ie(a),o=a.active_runs>0||c.isPending&&c.variables===a.id,l=[a.connection_name??a.connector_name??a.connector_key,a.display_name??a.feed_key].join(" · ");return e.jsx("li",{className:"rounded-lg bg-primary/5 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ft,{className:ht,children:e.jsx(B,{source:{platform:a.connector_key},connectorDefinitions:r,label:l,fallback:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"line-clamp-2 min-w-0 text-sm font-medium",children:l}),e.jsx("p",{className:i.failed?"mt-1 line-clamp-3 text-sm text-destructive":"mt-1 text-sm text-muted-foreground",children:i.text}),e.jsx(pt,{tag:"This page",children:a.device_label?`Connection · ${a.device_label}`:"Connection"}),e.jsx("div",{className:"mt-2",children:e.jsxs(N,{type:"button",size:"sm",variant:i.failed?"default":"outline",className:"h-7 text-xs",disabled:o,onClick:()=>c.mutate(a.id),children:[o?e.jsx(gt,{size:"sm",className:"mr-1"}):e.jsx(jt,{className:"mr-1 h-3 w-3"}),o?"Syncing":i.failed?"Try again":"Sync now"]})})]})]})},a.id)})})})}function ce({organizationId:s,ownerSlug:t,typeScope:r,entityScope:c,attentionOnly:a=!1}){const i=yt(),o=ae(s,i),{orgContext:l}=bt(),{isMember:f,isLoading:n}=Nt(),d=f&&!!s,{attentionItems:x,isError:m}=R(t),u=r?E(r):void 0,j=!c&&!u,h=y.useMemo(()=>x.map(g=>({item:g,onPage:i?vt(g,i):!1})).sort((g,w)=>Number(w.onPage)-Number(g.onPage)||w.item.at-g.item.at),[x,i]),p=y.useMemo(()=>h.filter(({onPage:g})=>g),[h]),J=y.useMemo(()=>new Set(p.flatMap(({item:g})=>g.approvalRunId!=null?[g.approvalRunId]:[])),[p]),Z=U(),X=()=>void Z({to:"/$owner",params:{owner:t},search:{attention:"1"}}),{data:I,isLoading:$,error:tt}=kt(c?`/${t}/${_t(c)}`:`/${t}`,l),C=c?I?.entity:void 0,et=(c?C?.entity_type??E(c.split("/").at(-2)??""):u)==="$member",nt=c!=null&&!$&&(tt!=null||I?.entity==null),v=c?void 0:I?.counts,st=v?v.connections>0||v.agents>0:!1,at=d&&!n&&!$&&v!=null&&!st,S=c&&$?e.jsx(K,{label:"Loading record…"}):nt?e.jsx(k,{icon:It,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):a&&j?e.jsx(re,{owner:t,items:h,isError:m}):C?e.jsx(Vt,{ownerSlug:t,entity:C,organizationId:s}):e.jsx(Gt,{organizationId:s,ownerSlug:t,hideSourceFilter:!0,scopedEntityTypes:u?[u]:void 0,pinned:j&&(p.length>0||o.length>0)?{rows:e.jsxs(e.Fragment,{children:[e.jsx(oe,{organizationId:s,feeds:o}),p.length>0?e.jsx("ul",{className:"space-y-1",children:p.map(({item:g})=>e.jsx("li",{children:e.jsx(_,{owner:t,item:g,tone:"relevant",tag:"This page"})},g.id))}):null]}),hiddenApprovalRunIds:J}:void 0,onShowNotifications:j?X:void 0,emptyState:at?e.jsx(de,{ownerSlug:t}):void 0});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:et?e.jsx(Qt,{children:S}):S})}function re({owner:s,items:t,isError:r}){const c=U();return e.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[e.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:t.length>0?`${t.length} ${t.length===1?"notification":"notifications"}`:null}),e.jsx(le,{owner:s}),e.jsx(Yt,{value:P.value,withNotifications:!0,onChange:a=>{if(a===P.value)return;const[i,o]=a.split("-");c({to:"/$owner",params:{owner:s},search:$t({sortBy:i,sortOrder:o})})}})]}),r?e.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):t.length===0?e.jsx(k,{icon:V,title:"All caught up",description:"Nothing needs you right now.",children:e.jsx(N,{asChild:!0,variant:"outline",className:"mt-4",children:e.jsx(b,{to:"/$owner",params:{owner:s},children:"See all activity"})})}):e.jsx("ul",{className:"space-y-1",children:t.map(({item:a,onPage:i})=>e.jsx("li",{children:e.jsx(_,{owner:s,item:a,tone:i?"relevant":"default",tag:i?"This page":void 0})},a.id))})]})}function le({owner:s}){const{visibleUnreadIds:t,markVisibleRead:r,bulkPending:c}=R(s);return t.length===0?null:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:c,onClick:()=>void r(),children:[e.jsx(V,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function de({ownerSlug:s}){return e.jsx("div",{className:"px-6",children:e.jsx(k,{icon:Ct,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(N,{asChild:!0,children:e.jsxs(b,{to:"/$owner/connectors/create",params:{owner:s},children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(N,{asChild:!0,variant:"outline",children:e.jsxs(b,{to:"/$owner/agents",params:{owner:s},children:[e.jsx(Et,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}const z=12,ue=5e3;function me(s,t){const r=!!s&&!!t.organizationId&&(t.enabled??!0),c=At({enabled:r}),{data:a}=c,i=a??[],o=y.useMemo(()=>i.map(u=>u.agentId),[i]),{threads:l,isLoading:f,isError:n}=Rt(s,o,{enabled:r&&o.length>0,limit:z}),d=Jt({enabled:r,limit:z,excludeCommandClients:!1,organizationId:t.organizationId,refetchInterval:u=>u?ue:!1}),x=t.organizationId?d.data:void 0;return{items:y.useMemo(()=>[...l.map(u=>({kind:"conversation",at:u.updatedAt,thread:u})),...(x??[]).map(u=>({kind:"mcp",at:u.lastCallAt,conversation:u}))].sort((u,j)=>j.at-u.at),[x,l]),agents:i,isLoading:r&&(c.isLoading||f||d.isLoading),isError:c.isError||n||d.isError}}function xe(s){return s==="attention"?{attention:"1"}:s==="all"?{}:{tab:s}}function fe(s,t,r,c=[]){const a=new Map(c.map(n=>[n.id,n])),i=new Map;for(const n of[...t.filter(d=>d.kind==="notification"),...r])i.set(n.notification_id!=null?`n:${n.notification_id}`:n.id,n);const o=new Set([...i.values()].flatMap(n=>n.run_id!=null?[n.run_id]:[])),l=new Map,f=new Set(t.flatMap(n=>n.kind==="automation_due"&&n.run_id!=null?[n.run_id]:[]));for(const n of[...t.filter(d=>d.kind!=="notification"&&(d.kind==="automation_due"||d.run_id==null||!f.has(d.run_id))&&(d.run_id==null||!o.has(d.run_id))),...i.values()])l.set(n.id,n);return[...l.values()].map(n=>{const d=n.connection_id!=null?a.get(n.connection_id):void 0,x={...n,platform:n.platform||d?.connector_key,connection_name:n.connection_name||d?.display_name},m=n.kind==="notification"?"notification":n.kind==="sync"?"feed":n.kind==="automation_run"||n.kind==="automation_due"?"automation":"run",u=m==="automation"&&n.automation_id!=null?`automation:${n.automation_id}`:(m==="feed"||m==="run")&&n.connection_id!=null?`connection:${n.connection_id}`:null;return{id:n.id,at:new Date(n.at).getTime(),title:n.title,detail:n.kind==="run"&&n.status&&!M(n.status)?n.status:n.body||n.status,kind:m,subject:u,subjectLabel:n.automation_name||x.connection_name||n.title,href:m!=="notification"&&n.run_id!=null?m==="automation"&&n.automation_id!=null?`/${s}/automations/${n.automation_id}?run_id=${n.run_id}`:`/${s}/events?run_ids=${n.run_id}`:n.href,card:n,source:x}})}function he(s,t,r){return t.map(c=>{if(c.kind==="mcp"){const n=c.conversation,d=s==="me"||n.organizationId==null?"/me/events":`/${s}/agents/connected/${encodeURIComponent(n.clientId)}/activity`,x=new URLSearchParams({mcp_activity_id:n.activityId});return(s==="me"||n.organizationId==null)&&x.set("client_ids",n.clientId),{id:`client:${n.clientId}:${n.activityId}`,at:c.at,title:Zt(n),detail:`${n.clientName||"Connected app"} · ${n.callCount} ${n.callCount===1?"call":"calls"}${n.isLive?" · Active":""}`,href:`${d}?${x}`,kind:"session",subject:`client:${n.clientId}`,subjectLabel:n.clientName||"Connected app",source:{client_id:n.clientId,client_name:n.clientName}}}const a=c.thread,i=r.get(a.agentId)||"Agent",o=a.platform||"web",l=Mt(s,a.agentId,a.id),f=o==="web"?Object.entries(l.params).reduce((n,[d,x])=>n.replace(`$${d}`,encodeURIComponent(x)),l.to):`/${s}/agents/${encodeURIComponent(a.agentId)}/conversations/${encodeURIComponent(a.conversationId??a.id)}`;return{id:`thread:${a.agentId}:${a.id}`,at:c.at,title:a.title||"Conversation",detail:`${i} · ${o==="web"?"Chat":o}${a.isRunning?" · Active":""}`,href:f,kind:"session",subject:`agent:${a.agentId}`,subjectLabel:i,source:{agent_id:a.agentId,agent_name:i,platform:o==="web"?null:o}}})}function pe(s){const t=new Map;for(const r of[...s].sort((c,a)=>a.at-c.at||c.id.localeCompare(a.id))){const c=new Date(r.at),a=`${c.getFullYear()}-${c.getMonth()}-${c.getDate()}`,i=r.subject?`${r.kind}:${r.subject}:${a}`:r.id,o=t.get(i)??{key:i,entries:[]};o.entries.push(r),t.set(i,o)}return[...t.values()]}const ge=[{view:"all",label:"All activity"},{view:"attention",label:"Needs attention"},{view:"sessions",label:"Sessions"},{view:"feeds",label:"Feeds"},{view:"automations",label:"Automations"}];function je({owner:s,view:t,organizationId:r}){const{data:c=[]}=A(r),{data:a=[]}=St(t==="all"||t==="feeds"||t==="automations"?r:null),i=R(s),o=me(s,{organizationId:r,enabled:t==="all"||t==="sessions"}),l=wt(t==="attention"||t==="sessions"?null:s,{limit:50,aggregate:!1,includeRuns:!0,includeNotifications:!1,kinds:t==="feeds"?["sync"]:t==="automations"?["automation","automation_due"]:void 0}),f=y.useMemo(()=>{const m=new Map(o.agents.map(h=>[h.agentId,h.name])),u=t==="all"||t==="sessions"?he(s,o.items,m):[],j=t==="attention"?[]:fe(s,[...l.data??[],...t==="all"?i.notificationCards:[]],t==="all"?i.attentionCards:[],a);return pe([...j,...u])},[s,t,o.agents,o.items,l.data,a,i.attentionCards,i.notificationCards]),n=r==null||(t==="attention"?i.isLoading:t!=="sessions"&&l.isLoading||(t==="all"||t==="sessions")&&o.isLoading||t==="all"&&i.isLoading),d=t==="attention"?i.isError:t!=="sessions"&&l.isError||(t==="all"||t==="sessions")&&o.isError||t==="all"&&i.isError,x=t==="attention"?i.attentionItems.length===0:f.length===0;return e.jsxs("section",{"aria-label":"Home activity",className:"flex min-w-0 flex-col gap-4",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Home"}),e.jsx("nav",{"aria-label":"Activity views",className:"flex flex-wrap gap-x-3 gap-y-2 border-b pb-2",children:ge.map(({view:m,label:u})=>e.jsxs(b,{to:"/$owner",params:{owner:s},search:xe(m),activeOptions:{exact:!0},"aria-current":t===m?"page":void 0,className:G("py-1 text-[13px] transition-colors",t===m?"font-medium text-foreground underline decoration-primary decoration-2 underline-offset-[13px]":"text-muted-foreground hover:text-foreground"),children:[u,m==="attention"&&i.attentionItems.length>0?e.jsx("span",{className:"ml-1.5 text-xs tabular-nums",children:i.attentionItems.length}):null]},m))}),t==="attention"?e.jsx(Lt,{owner:s}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent activity · newest first"}),d?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Some activity could not be loaded. Refresh to try again."}):null,n&&x?e.jsx(K,{label:"activity"}):x?d?null:e.jsx(k,{icon:Tt,title:t==="attention"?"All caught up":"No recent activity",description:t==="attention"?"Nothing needs you right now.":"New activity will appear here as your agents, apps, and feeds work."}):t==="attention"?e.jsx("ul",{className:"space-y-1",children:i.attentionItems.map(m=>e.jsx("li",{children:e.jsx(_,{owner:s,item:m})},m.id))}):e.jsx("ul",{className:"divide-y divide-border/60",children:f.map(m=>e.jsx("li",{children:e.jsx(ye,{owner:s,group:m,connectorDefinitions:c})},m.key))}),!x&&t!=="attention"?e.jsxs("div",{className:"flex flex-wrap gap-4 pt-2 text-xs text-muted-foreground",children:[t==="all"||t==="feeds"?e.jsx(b,{to:"/$owner/connectors",params:{owner:s},children:"Browse feeds"}):null,t==="all"||t==="automations"?e.jsx(b,{to:"/$owner/automations",params:{owner:s},children:"Automation history"}):null,t==="sessions"?e.jsx(b,{to:"/$owner/agents",params:{owner:s},children:"Browse agents and apps"}):null]}):null]})}function ye({owner:s,group:t,connectorDefinitions:r}){const[c,a]=y.useState(!1),i=y.useId(),o=t.entries[0];if(t.entries.length===1)return e.jsx(H,{owner:s,entry:o,connectorDefinitions:r});const l=t.entries.filter(n=>M(n.card?.status??"")).length,f=o.kind==="session"?"sessions":o.kind==="feed"?"syncs":o.kind==="run"?"operations":"runs";return e.jsxs("div",{children:[e.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":i,onClick:()=>a(!c),className:"flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60",children:[e.jsx(Q,{entry:o,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:o.subjectLabel}),e.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[t.entries.length," recent ",f,l>0?e.jsxs("span",{className:"text-destructive",children:[" · ",l," failed"]}):null,o.kind==="session"?null:` · ${o.detail??""}`]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(o.at)}),e.jsx(Ot,{"aria-hidden":!0,className:G("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",c&&"rotate-180")})]}),e.jsxs("ul",{id:i,hidden:!c,className:"ml-4 border-l pl-3",children:[c?t.entries.map(n=>e.jsx("li",{children:e.jsx(H,{owner:s,entry:n,connectorDefinitions:r})},n.id)):null,c&&o.card?.href?e.jsx("li",{children:e.jsx(be,{entry:o})}):null]})]})}function be({entry:s}){const t=q(s.card?.href??"");return e.jsx(b,{to:t.pathname,search:t.search,className:"inline-block px-2 py-2 text-xs text-muted-foreground hover:text-foreground",children:s.kind==="automation"?"View Automation history":"View connection history"})}function Q({entry:s,connectorDefinitions:t}){const r=s.kind==="session"?zt:s.kind==="feed"?Ht:s.kind==="automation"?Bt:Wt;return e.jsx("span",{"aria-hidden":!0,className:"flex h-5 w-5 shrink-0 items-center justify-center",children:e.jsx(B,{source:s.source,connectorDefinitions:t,label:s.subjectLabel,fallback:e.jsx(r,{className:"h-4 w-4 text-muted-foreground"})})})}function H({owner:s,entry:t,connectorDefinitions:r}){const c=Dt();if(t.kind==="notification"&&t.card)return e.jsx(_,{owner:s,item:Ft({...t.card,...t.source})});const a=e.jsxs(e.Fragment,{children:[e.jsx(Q,{entry:t,connectorDefinitions:r}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:t.title}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[M(t.card?.status??"")?e.jsx(Pt,{"aria-label":"Failed",className:"h-3 w-3 shrink-0 text-destructive"}):null,e.jsx("span",{className:"truncate",children:t.detail})]})]}),e.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Y(t.at)})]}),i="flex w-full items-center gap-3 rounded-md px-2 py-3 text-left hover:bg-accent/60";if(!t.href)return e.jsx("div",{className:i,children:a});const o=q(t.href);return e.jsx(b,{to:o.pathname,search:o.search,className:i,onClick:l=>{!c||!t.card||t.kind==="session"||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0||(l.preventDefault(),c.open({href:t.href??"",title:t.title,runId:t.card.run_id??void 0,body:t.card.body,createdAt:t.card.at,owner:s,sourceAttribution:t.source??t.card}))},children:a})}function Ee({owner:s,search:t,entityScope:r,home:c=!1}){const a=typeof t.type=="string"&&t.type.trim()?E(t.type.trim()):void 0,i=typeof t.tab=="string"?t.tab:"events",o=i==="sessions"||i==="feeds"||i==="automations"?i:"events",l=String(t.attention)==="1",f=Object.entries(t).some(([n,d])=>(Ut.includes(n)||n.startsWith("clf_"))&&d!=null&&d!=="");return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Xt,{}),e.jsx(Kt,{owner:s,children:n=>e.jsx(qt,{organizationId:n.organizationId,isWorkspaceLoading:n.isWorkspaceLoading,children:e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:(c||o!=="events")&&!f&&!a&&!r?e.jsx(je,{owner:n.ownerSlug,organizationId:n.organizationId,view:l?"attention":o==="events"?"all":o}):e.jsx(ce,{organizationId:n.organizationId,ownerSlug:n.ownerSlug,typeScope:a,entityScope:r,attentionOnly:l})})})})]})}export{Ee as A};
|
|
2
|
+
//# sourceMappingURL=activity-route-view-voRYSM3a.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,fe as i,C as l,h as c}from"./index-008wj-Pz.js";function x({enabled:t,name:s,expanded:r,onToggleEnabled:a,toggleDisabled:n,onToggle:o}){return e.jsxs("div",{className:"flex shrink-0 items-center gap-2 self-center",children:[e.jsx(i,{checked:t,onCheckedChange:a,disabled:n,"aria-label":t?`Disable ${s}`:`Enable ${s}`}),e.jsx("button",{type:"button",onClick:o,"aria-label":r?"Collapse":"Expand",className:"text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(l,{className:c("h-4 w-4 transition-transform",r&&"rotate-90")})})]})}export{x as A};
|
|
2
|
+
//# sourceMappingURL=agent-card-controls-DiU7Un5w.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as o,L as u,
|
|
1
|
+
import{j as o,L as u,bq as c}from"./index-008wj-Pz.js";const d="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function a(e){try{const t=new URL(e).hostname;return t==="lobu.ai"||t.endsWith(".lobu.ai")}catch{return!1}}function l(e,t){const n=`npx @lobu/cli@latest connect ${e}`;return a(t)?n:`${n} --url ${t}`}const i=[{id:"claude-code",label:"Claude Code",tagline:"Shared plugin with Lobu MCP and workspace skills",description:"Connect Claude Code to shared workspace context and governed actions through Lobu's native plugin setup.",installTitle:"Run in your terminal",installText:e=>l("claude-code",e),steps:e=>a(e)?["The CLI adds Lobu's marketplace and installs the shared plugin.","Start a fresh Claude Code session.","Use a Lobu tool, choose this workspace, and complete OAuth when prompted."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill.","Start a fresh Claude Code session and complete OAuth when prompted."],guideLinks:[{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"Add Lobu as a custom ChatGPT connector, or connect the Codex coding agent through the CLI — both reach this workspace with your existing Lobu access.",installTitle:"Pick a surface",installText:e=>["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${l("codex",e)}`].join(`
|
|
2
2
|
`),steps:e=>["ChatGPT web: turn on developer mode under Settings -> Security -> Developer mode (custom connectors need it).",`ChatGPT web: open Settings -> Connectors -> Create connector, name it Lobu, and use ${e} with OAuth.`,"ChatGPT web: scan tools, complete Lobu sign-in, and start a new chat with Lobu enabled.",...a(e)?["Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"claude-desktop",label:"Claude Desktop",tagline:"Custom MCP connector with Lobu OAuth",description:"Add Lobu as a custom Claude Desktop connector and authorize the workspace with your existing Lobu access.",installTitle:"Add from Claude settings",installText:e=>["Open Settings -> Connectors -> Add Custom Connector","Name: Lobu",`MCP URL: ${e}`].join(`
|
|
3
|
-
`),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],h={codex:"chatgpt"};function
|
|
4
|
-
`)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function
|
|
5
|
-
//# sourceMappingURL=agent-client-setup-list-
|
|
3
|
+
`),steps:e=>["Open Settings -> Connectors -> Add Custom Connector.",`Name it Lobu and use ${e}.`,"Enable Lobu and complete OAuth.","Start a new conversation with Lobu enabled."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect opencode --url ${e}`,steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect antigravity --url ${e}`,steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>`npx @lobu/cli@latest connect cursor --url ${e}`,steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]},{id:"openclaw",label:"OpenClaw",tagline:"Connect from your agent's workspace",description:"Let OpenClaw connect to Lobu through MCP or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into OpenClaw",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into OpenClaw and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let OpenClaw verify access with a harmless read in this workspace."],guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>["Paste the prompt into Hermes and review its proposed setup.","Approve Lobu sign-in in your browser or through the email approval link.","Let Hermes verify access with a harmless read in this workspace."],guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Other agent",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[{label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"}]}],b=["Remember in Lobu that I prefer short answers that lead with the key point.","What does Lobu know about me?","Connect my Gmail to Lobu."],h={codex:"chatgpt"};function g(e){const t=h[e]??e;return i.find(n=>n.id===t)}function C(e){const{workspaceName:t,owner:n,mcpUrl:s,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${t}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${s}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${d}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
4
|
+
`)}function p(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===t-1?"":"border-b"}`}function L({owner:e,dashed:t=!1}){return o.jsx("div",{className:`overflow-hidden rounded-lg border ${t?"border-dashed":""}`,children:i.map((n,s)=>o.jsxs(u,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:p(s,i.length),children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:o.jsx(c,{name:n.label})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),o.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),o.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}export{L as A,b as F,C as b,g as f};
|
|
5
|
+
//# sourceMappingURL=agent-client-setup-list-Bkyw22GW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Q as x,j as e,aG as b,gr as N,b0 as v,gs as A,L as p,gt as w,n as L,r as k,hy as P,g4 as o,B as R,A as S,bq as f}from"./index-008wj-Pz.js";import{A as I,f as M,b as $,F as j}from"./agent-client-setup-list-Bkyw22GW.js";import{C as m}from"./copy-button-Df7QXE0w.js";import{u as B}from"./clients-8-EpRjsm.js";import{g as _,c as T}from"./client-rows-DiJQ5D1z.js";function U(t){const n=t?`/mcp/${t}`:"/mcp";if(!x)return`http://localhost:8787${n}`;try{const a=new URL(x);return a.pathname=n,a.toString()}catch{return`${x}${n}`}}const h="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 y({owner:t}){return e.jsx(A,{crumbs:[e.jsx(p,{to:"/$owner/agents",params:{owner:t},className:w,children:"Agents"},"agents")]})}function W({owner:t}){return e.jsx("div",{className:h,children:e.jsxs(b,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(N,{breadcrumb:e.jsx(y,{owner:t}),icon:e.jsx(v.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(I,{owner: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 z({owner:t,clientId:n}){const a=M(n),{data:C}=L(t,{slug:t}),{data:u=[]}=B(null,{refetchInterval:2500}),r=k.useMemo(()=>_(u).filter(s=>s.connected),[u]);if(!a)return e.jsx("div",{className:h,children:e.jsxs(b,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(p,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const c=U(t),i=$({workspaceName:C?.workspace?.name??t,owner:t,mcpUrl:c,clientLabel:a.id==="other"?void 0:a.label,terminalLogin:a.terminalLogin}),d=a.setupMode==="agent-prompt",g=d?i:a.installText?.(c)??i;return e.jsx("div",{className:h,children:e.jsxs(P,{header:e.jsx(N,{breadcrumb:e.jsx(y,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:a.label})}),title:a.label,caption:a.description}),children:[e.jsx(o,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:g}),e.jsx(m,{text:g,label:d?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:a.steps(c).map((s,l)=>e.jsxs("li",{children:[l+1,". ",s]},s))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[d?null:e.jsx(m,{text:i,label:"Copy setup prompt"}),a.guideLinks.map(s=>e.jsx(R,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,e.jsx(S,{className:"ml-1.5 h-3.5 w-3.5"})]})},s.href))]})]})}),e.jsx(o,{title:"First prompts",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),e.jsx("div",{className:"overflow-hidden rounded-lg border",children:j.map((s,l)=>e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${l===j.length-1?"":"border-b"}`,children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm",children:s}),e.jsx(m,{text:s,label:"prompt",iconOnly:!0})]},s))})]})}),e.jsx(o,{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((s,l)=>e.jsxs(p,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:s.clientId},className:E(l,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:s.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:T(s)})]})]},s.key))})}),e.jsx(o,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:c})]})})]})})}export{W as A,z as a};
|
|
2
|
+
//# sourceMappingURL=agent-connect-pages-CpBxQCpx.js.map
|
package/dist/owletto/dist/assets/{agent-editor-form-DsSoeQeF.js → agent-editor-form-QrIDroFL.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ax as ye,ay as Ne,j as e,B as j,cX as Ce,et as Se,a$ as Me,Q as Ae,eE as ke,cF as H,dy as J,cT as Ie,h8 as Pe,h9 as Te,ha as Fe,hb as De,gj as Re,hc as Ee,bQ as _e,bR as $e,az as Le,r as K,bJ as $,f4 as Y,bU as Be,z as b,fN as L,I as O,T as ze,bp as Ue,bq as Oe,br as qe,bs as Ve,bt as Z}from"./index-9YuSRymd.js";import{b as Xe,s as Ge}from"./model-selector-CDrAjH31.js";function Qe(a){const t=a.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(t?/^[a-z]/.test(t)&&t.length>=3?t:`agent-${t}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function We(a,t){const r=new Set(t),x=Qe(a);let v=x,u=2;for(;r.has(v);){const g=`-${u}`;v=`${x.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return v}const He="__unresolved__";function ee(a){return a.endsWith(`/${He}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Je(a,t){const{slug:r,model:x}=se(a);return{provider:t.find(g=>g.value===a)?.provider??t.find(g=>se(g.value).slug===r)?.provider??r,model:x}}function Ke({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=Xe(x,v),g=(s,c)=>{const l=s+c;if(l<0||l>=a.length)return;const m=[...a];[m[s],m[l]]=[m[l],m[s]],t(m)},k=s=>{t(a.filter((c,l)=>l!==s))},I=s=>{a.includes(s)||t([...a,s])},o=u.filter(s=>!a.includes(s.value)&&!ee(s.value));return e.jsxs("div",{className:"grid gap-2",children:[a.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:a.map((s,c)=>{const l=ee(s),{provider:m,model:i}=Je(s,u);return e.jsxs("li",{className:Ae("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",l&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:m}),c===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:l?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:r||c===0,onClick:()=>g(c,-1),children:e.jsx(Ce,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:r||c===a.length-1,onClick:()=>g(c,1),children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:r,onClick:()=>k(c),children:e.jsx(Me,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ke,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(j,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:r,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(Ie,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,c)=>{const l=c.trim(),m=Ge(l,u)&&!a.includes(l);return e.jsxs(e.Fragment,{children:[o.map(i=>e.jsxs(H,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(J,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),m?e.jsxs(H,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(J,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:l})]})]}):null]})}})]})}const Ye=3,Ze=72,es=2e3;function te(a){return Array.from({length:Ye},(t,r)=>a?.[r]??{title:"",message:""})}function ae(a){return a.map(({title:t,message:r})=>({title:t.trim(),message:r.trim()})).filter(({title:t,message:r})=>t&&r)}function ns({mode:a,section:t="identity",existingAgentIds:r=[],onCreated:x,onCancel:v,onDone:u,reviewMode:g="none",reviewProposal:k=null,reviewControlsDisabled:I=!1}){const o=a.kind==="create",s=a.kind==="edit"?a.agent:null,c=!o&&t!=="platforms"&&t!=="skills"&&!!s,l=Pe(),m=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:q}=Re(s?.agentId,{enabled:c}),V=!o&&g==="active"?k:null,B=V?Ee(V.proposal):void 0,N=p,X=s?.agentId??"create",d=_e(X,{name:B?.name??s?.name??"",description:B?.description??s?.description??"",identityMd:B?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:N?.models??N?.settings?.models??[],showToolCalls:N?.showToolCalls??N?.settings?.showToolCalls??!1,sandboxId:N?.sandboxId??N?.settings?.sandboxId??"builtin",starters:te(p?.starters)}),[w,ne]=d.field("name"),[C,le]=d.field("description"),[T,re]=d.field("identityMd"),[F,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[R,oe]=d.field("models"),[E,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,G]=d.field("starters"),[ue,_]=$e(X,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=K.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:We(w,r),name:w.trim(),description:C.trim()||void 0});x?await x(h.agentId):u?.();return}if(s){if(!p){$.error("Still loading agent settings — try again in a moment");return}if(y.some(({title:h,message:M})=>!!h.trim()!=!!M.trim())){$.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([m.mutateAsync({name:w.trim()||s.name,description:C.trim()||void 0}),P.mutateAsync({identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:R,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:E,sandboxId:S==="builtin"?void 0:S,starters:ae(y)})]),d.accept(d.values,{name:w.trim()||s.name,description:C.trim()||s.description||"",identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:R,showToolCalls:E,sandboxId:S,starters:te(ae(y))}),$.success("Agent saved"),u?.()}catch(h){$.error(h instanceof Error?h.message:"Failed to save agent")}}}},[p,l,C,d.accept,d.values,d.canSubmit,S,r,T,o,R,w,x,u,s,E,F,y,m,P,D]),xe=K.useCallback(async()=>{s&&(await i.mutateAsync(),_(!1),u?.())},[i,u,s,_]),z=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&q)return e.jsx(Y,{rows:6});const f=z||I,fe=g==="none"||g==="gone",ve=w.trim().length>0&&pe,be=o||t==="settings",je=!o&&(t==="identity"||t==="settings"),we=!o&&t==="settings",Q=!o&&t==="settings",W=!o&&t==="models";return e.jsxs("form",{onSubmit:he,className:"flex min-h-0 flex-col",children:[e.jsx(Be,{visible:d.hasConflict,onReload:d.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[je?q?e.jsx(Y,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx(L,{id:"identity-md",rows:6,value:T,onChange:n=>re(n.target.value),disabled:f,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx(L,{id:"soul-md",rows:6,value:F,onChange:n=>ie(n.target.value),disabled:f,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx(L,{id:"user-md",rows:6,value:D,onChange:n=>de(n.target.value),disabled:f,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,be?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(O,{id:"agent-name",placeholder:"Support Bot",value:w,onChange:n=>ne(n.target.value),disabled:f,required:!0}),o?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),o?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx(L,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:C,onChange:n=>le(n.target.value),disabled:f,rows:3})]})]}):null,Q?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(ze,{id:"show-tool-calls",checked:E,onCheckedChange:n=>ce(n===!0),disabled:f,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,Q?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Conversation starters"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to three prompts offered on a new chat, on the web and in Slack. The message is sent as the user when tapped."}),y.map((n,h)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[12rem_1fr]",children:[e.jsx(O,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Ze,value:n.title,onChange:M=>G(y.map((A,U)=>U===h?{...A,title:M.target.value}:A)),disabled:f}),e.jsx(O,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:M=>G(y.map((A,U)=>U===h?{...A,message:M.target.value}:A)),disabled:f})]},h))]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Ke,{value:R,onChange:oe,disabled:f}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,W?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Ue,{value:S,onValueChange:me,disabled:f,children:[e.jsx(Oe,{id:"agent-sandbox",className:"w-full",children:e.jsx(qe,{placeholder:"Built-in"})}),e.jsxs(Ve,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{value:n.id,children:[n.name," (",n.providerKind,")",n.connected?"":" — no credential"]},n.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),fe?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[we?ue?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(j,{type:"button",variant:"destructive",onClick:()=>void xe(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>_(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v?e.jsx(j,{type:"button",variant:"outline",onClick:v,disabled:z,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||z,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
|
|
2
|
-
//# sourceMappingURL=agent-editor-form-
|
|
1
|
+
import{az as ye,aA as Ne,j as e,B as j,de as Ce,eX as Se,b9 as Ae,h as Me,eP as ke,cY as Y,dF as K,d9 as Ie,hh as Pe,hi as Te,hj as Fe,hk as De,gA as _e,hl as Re,bW as Ee,bX as $e,aB as Le,r as J,bP as $,fn as Q,b_ as Be,H as b,ew as L,I as U,W as ze,bv as Oe,bw as Ue,bx as We,by as Xe,bz as Z}from"./index-008wj-Pz.js";import{b as Ve,s as qe}from"./model-selector-3l9lY50C.js";function Ge(a){const t=a.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(t?/^[a-z]/.test(t)&&t.length>=3?t:`agent-${t}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function He(a,t){const r=new Set(t),x=Ge(a);let v=x,u=2;for(;r.has(v);){const g=`-${u}`;v=`${x.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return v}const Ye="__unresolved__";function ee(a){return a.endsWith(`/${Ye}`)}function se(a){const t=a.indexOf("/");return t===-1?{slug:a,model:""}:{slug:a.slice(0,t),model:a.slice(t+1)}}function Ke(a,t){const{slug:r,model:x}=se(a);return{provider:t.find(g=>g.value===a)?.provider??t.find(g=>se(g.value).slug===r)?.provider??r,model:x}}function Je({value:a,onChange:t,disabled:r}){const{data:x=[]}=ye(),{data:v=[]}=Ne(),u=Ve(x,v),g=(s,c)=>{const l=s+c;if(l<0||l>=a.length)return;const m=[...a];[m[s],m[l]]=[m[l],m[s]],t(m)},k=s=>{t(a.filter((c,l)=>l!==s))},I=s=>{a.includes(s)||t([...a,s])},o=u.filter(s=>!a.includes(s.value)&&!ee(s.value));return e.jsxs("div",{className:"grid gap-2",children:[a.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:a.map((s,c)=>{const l=ee(s),{provider:m,model:i}=Ke(s,u);return e.jsxs("li",{className:Me("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",l&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:m}),c===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:l?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:r||c===0,onClick:()=>g(c,-1),children:e.jsx(Ce,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:r||c===a.length-1,onClick:()=>g(c,1),children:e.jsx(Se,{className:"h-4 w-4"})}),e.jsx(j,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:r,onClick:()=>k(c),children:e.jsx(Ae,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(ke,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(j,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:r,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(Ie,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,c)=>{const l=c.trim(),m=qe(l,u)&&!a.includes(l);return e.jsxs(e.Fragment,{children:[o.map(i=>e.jsxs(Y,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{I(i.value),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),m?e.jsxs(Y,{value:`__custom__ ${l}`,onSelect:()=>{I(l),s()},className:"cursor-pointer",children:[e.jsx(K,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:l})]})]}):null]})}})]})}const Qe=3,Ze=72,es=2e3;function te(a){return Array.from({length:Qe},(t,r)=>a?.[r]??{title:"",message:""})}function ae(a){return a.map(({title:t,message:r})=>({title:t.trim(),message:r.trim()})).filter(({title:t,message:r})=>t&&r)}function ns({mode:a,section:t="identity",existingAgentIds:r=[],onCreated:x,onCancel:v,onDone:u,reviewMode:g="none",reviewProposal:k=null,reviewControlsDisabled:I=!1}){const o=a.kind==="create",s=a.kind==="edit"?a.agent:null,c=!o&&t!=="platforms"&&t!=="skills"&&!!s,l=Pe(),m=Te(s?.agentId??""),i=Fe(s?.agentId??""),P=De(s?.agentId??""),{data:p,isLoading:W}=_e(s?.agentId,{enabled:c}),X=!o&&g==="active"?k:null,B=X?Re(X.proposal):void 0,N=p,V=s?.agentId??"create",d=Ee(V,{name:B?.name??s?.name??"",description:B?.description??s?.description??"",identityMd:B?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:N?.models??N?.settings?.models??[],showToolCalls:N?.showToolCalls??N?.settings?.showToolCalls??!1,sandboxId:N?.sandboxId??N?.settings?.sandboxId??"builtin",starters:te(p?.starters)}),[w,ne]=d.field("name"),[C,le]=d.field("description"),[T,re]=d.field("identityMd"),[F,ie]=d.field("soulMd"),[D,de]=d.field("userMd"),[_,oe]=d.field("models"),[R,ce]=d.field("showToolCalls"),[S,me]=d.field("sandboxId"),[y,q]=d.field("starters"),[ue,E]=$e(V,!1),{data:ge}=Le({enabled:t==="models"&&!o}),he=J.useCallback(async n=>{if(n.preventDefault(),!!d.canSubmit){if(o){const h=await l.mutateAsync({agentId:He(w,r),name:w.trim(),description:C.trim()||void 0});x?await x(h.agentId):u?.();return}if(s){if(!p){$.error("Still loading agent settings — try again in a moment");return}if(y.some(({title:h,message:A})=>!!h.trim()!=!!A.trim())){$.error("Add both a title and a message for each conversation starter");return}try{await Promise.all([m.mutateAsync({name:w.trim()||s.name,description:C.trim()||void 0}),P.mutateAsync({identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:R,sandboxId:S==="builtin"?void 0:S,starters:ae(y)})]),d.accept(d.values,{name:w.trim()||s.name,description:C.trim()||s.description||"",identityMd:T.trim(),soulMd:F.trim(),userMd:D.trim(),models:_,showToolCalls:R,sandboxId:S,starters:te(ae(y))}),$.success("Agent saved"),u?.()}catch(h){$.error(h instanceof Error?h.message:"Failed to save agent")}}}},[p,l,C,d.accept,d.values,d.canSubmit,S,r,T,o,_,w,x,u,s,R,F,y,m,P,D]),xe=J.useCallback(async()=>{s&&(await i.mutateAsync(),E(!1),u?.())},[i,u,s,E]),z=l.isPending||m.isPending||i.isPending||P.isPending,pe=o||!!p;if(c&&W)return e.jsx(Q,{rows:6});const f=z||I,fe=g==="none"||g==="gone",ve=w.trim().length>0&&pe,be=o||t==="settings",je=!o&&(t==="identity"||t==="settings"),we=!o&&t==="settings",G=!o&&t==="settings",H=!o&&t==="models";return e.jsxs("form",{onSubmit:he,className:"flex min-h-0 flex-col",children:[e.jsx(Be,{visible:d.hasConflict,onReload:d.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[je?W?e.jsx(Q,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx(L,{id:"identity-md",rows:6,value:T,onChange:n=>re(n.target.value),disabled:f,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx(L,{id:"soul-md",rows:6,value:F,onChange:n=>ie(n.target.value),disabled:f,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx(L,{id:"user-md",rows:6,value:D,onChange:n=>de(n.target.value),disabled:f,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,be?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(U,{id:"agent-name",placeholder:"Support Bot",value:w,onChange:n=>ne(n.target.value),disabled:f,required:!0}),o?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),o?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx(L,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:C,onChange:n=>le(n.target.value),disabled:f,rows:3})]})]}):null,G?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(ze,{id:"show-tool-calls",checked:R,onCheckedChange:n=>ce(n===!0),disabled:f,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,G?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Conversation starters"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to three prompts offered on a new chat, on the web and in Slack. The message is sent as the user when tapped."}),y.map((n,h)=>e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[12rem_1fr]",children:[e.jsx(U,{"aria-label":`Starter ${h+1} title`,placeholder:"Plan this week",maxLength:Ze,value:n.title,onChange:A=>q(y.map((M,O)=>O===h?{...M,title:A.target.value}:M)),disabled:f}),e.jsx(U,{"aria-label":`Starter ${h+1} message`,placeholder:"Plan this week's posts from what's trending",maxLength:es,value:n.message,onChange:A=>q(y.map((M,O)=>O===h?{...M,message:A.target.value}:M)),disabled:f})]},h))]}):null,H?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(Je,{value:_,onChange:oe,disabled:f}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,H?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs(Oe,{value:S,onValueChange:me,disabled:f,children:[e.jsx(Ue,{id:"agent-sandbox",className:"w-full",children:e.jsx(We,{placeholder:"Built-in"})}),e.jsxs(Xe,{children:[e.jsx(Z,{value:"builtin",children:"Built-in (default)"}),(ge?.sandboxes??[]).map(n=>e.jsxs(Z,{value:n.id,children:[n.name," (",n.providerKind,")",n.connected?"":" — no credential"]},n.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),fe?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[we?ue?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(j,{type:"button",variant:"destructive",onClick:()=>void xe(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>E(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(j,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>E(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[v?e.jsx(j,{type:"button",variant:"outline",onClick:v,disabled:z,children:"Cancel"}):null,e.jsx(j,{type:"submit",disabled:!d.canSubmit||!ve||z,children:o?l.isPending?"Creating...":"Create agent":m.isPending||P.isPending?"Saving...":"Save changes"})]})]}):null]})}export{ns as A};
|
|
2
|
+
//# sourceMappingURL=agent-editor-form-QrIDroFL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as y,j as e,H as w,I as k,bv as K,bw as Q,bx as Y,by as ee,bz as ae,ew as te,B as S,v as P,gA as G,iW as T,iX as O,hk as B,fn as se,bP as j,gH as I,bF as ne,bS as re,a$ as D,gJ as ie,V as oe,io as le,bH as q,d9 as de,h as E,iU as ue}from"./index-008wj-Pz.js";import{M as ce}from"./model-selector-3l9lY50C.js";import{a as me,A as J}from"./agent-subpage-shell-CLqpn5Tb.js";import{T as ge,a as he,b as _,c as $,d as xe,e as R}from"./table-DHM-vCxP.js";import{f as pe}from"./agent-loading-shells-CamDtzHY.js";import{A as fe}from"./agent-card-controls-DiU7Un5w.js";const je=[{value:"input",label:"Input",hint:"the user message, before the agent runs"},{value:"output",label:"Output",hint:"the agent's reply, before the user sees it"},{value:"pre-tool",label:"Pre-tool",hint:"a tool call, before it executes"},{value:"egress",label:"Egress",hint:"an outbound request to a judged domain"}];function H({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??""),[f,u]=y.useState((a?.tools??[]).join(", ")),[l,m]=y.useState((a?.domains??[]).join(", ")),g=a?.kind,v=g==="require-tool",X=c=>{c.preventDefault();const U=f.split(",").map(L=>L.trim()).filter(Boolean);o({name:i,stage:h,...g?{kind:g}:{},policy:x,model:p.trim()||void 0,tools:(v||h==="pre-tool")&&U.length>0?U: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:X,className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-name",value:i,onChange:c=>d(c.target.value),placeholder:"no-competitor-mentions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Shown in the list and on every trip. Must be unique."})]}),v?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-stage",children:"Stage"}),e.jsxs(K,{value:h,onValueChange:c=>b(c),disabled:s,children:[e.jsx(Q,{id:"guardrail-stage",children:e.jsx(Y,{})}),e.jsx(ee,{children:je.map(c=>e.jsxs(ae,{value:c.value,children:[c.label," — ",c.hint]},c.value))})]})]}),v?e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-required-tools",children:["Required tools ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(k,{id:"guardrail-required-tools",value:f,onChange:c=>u(c.target.value),placeholder:"suggest_actions",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated. The turn trips if the agent finishes without calling every one of these. No judge model runs — this is a lookup against the tools the turn actually used."})]}):null,v?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-policy",children:["Policy ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(te,{id:"guardrail-policy",rows:5,value:x,onChange:c=>N(c.target.value),placeholder:"Deny any response that names a competitor (Acme, Globex) or quotes their pricing.",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"A judge model reads this and the text at the chosen stage, then allows or denies. Write it as an instruction to a reviewer."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(w,{htmlFor:"guardrail-model",children:["Judge model",t?null:e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(ce,{value:p,onChange:C,placeholder:t?`Default (${t})`:"Select a model",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?"Optional. Leave blank to use the gateway's default judge model.":"Required: the gateway has no default judge model (EGRESS_JUDGE_MODEL is unset)."})]})]}),!v&&h==="pre-tool"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-tools",children:"Tool scope"}),e.jsx(k,{id:"guardrail-tools",value:f,onChange:c=>u(c.target.value),placeholder:"github.delete_repo, fs.delete",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Optional, comma-separated. Leave blank to judge every tool call."})]}):null,h==="egress"?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"guardrail-domains",children:"Domains"}),e.jsx(k,{id:"guardrail-domains",value:l,onChange:c=>m(c.target.value),placeholder:"api.github.com, .slack.com",disabled:s}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Comma-separated hostnames this judge gates — exact (api.github.com) or wildcard (.slack.com). Leave blank to route nothing."})]}):null,e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[r?e.jsx(S,{type:"button",variant:"outline",onClick:r,disabled:s,children:"Cancel"}):null,e.jsx(S,{type:"submit",disabled:s,children:s?"Saving…":n})]})]})}function z(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.`:z(a)?a.stage!=="output"?"A required-tool guardrail only runs at the output stage.":a.tools?.some(d=>d.trim())?null:"List at least one tool that must be used.":a.policy.trim()?!s&&!a.model?.trim()?"Judge model is required — the gateway has no default (EGRESS_JUDGE_MODEL is unset).":null:"Policy is required.":"Name may use letters, numbers, spaces, hyphens, and underscores.":"Name is required."}function V(a){const t=z(a),s=(t||a.stage==="pre-tool")&&a.tools&&a.tools.length>0?a.tools.map(d=>d.trim()).filter(Boolean):void 0,o=a.stage==="egress"&&a.domains&&a.domains.length>0?a.domains.map(d=>d.trim()).filter(Boolean):void 0,r=a.model?.trim()||void 0,i=a.policy.trim();return{name:a.name.trim(),enabled:a.enabled,stage:a.stage,...t?{kind:"require-tool"}:{},...t?i?{policy:i}:{}:{policy:i},...r?{model:r}:{},...s&&s.length>0?{tools:s}:{},...o&&o.length>0?{domains:o}:{}}}function 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=P(),{data:s,isLoading:o}=G(t),{data:r,isLoading:i}=T(t),{data:d=null,isLoading:h}=O(t),b=o||i||h,x=B(t),N=s?.guardrailsInline??[],p=(r??[]).map(u=>u.name),C=async u=>{if(!s){j.error("Still loading agent settings — try again in a moment");return}const l=W(u,N,p,d);if(l){j.error(l);return}try{await x.mutateAsync({guardrailsInline:be(N,u)}),j.success("Guardrail created"),n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}})}catch(m){j.error(m instanceof Error?m.message:"Failed to create guardrail")}},f=()=>void n({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),b?e.jsx(se,{rows:4}):e.jsx(H,{judgeModelDefault:d,submitLabel:"Create guardrail",submitting:x.isPending,onSubmit:C,onCancel:f})]})}function F(a,t){const n=new Set(a?.guardrails??[]),s=new Set(t.map(i=>i.name)),o=t.map(i=>({name:i.name,stages:i.stages,description:i.description,enabled:n.has(i.name),unknown:!1})),r=(a?.guardrails??[]).filter(i=>!s.has(i)).map(i=>({name:i,stages:[],enabled:!0,unknown:!0}));return[...o,...r]}function we(a){return a.filter(t=>t.enabled||t.unknown).map(t=>t.name)}function Se(a,t,n){return we(a.map(s=>s.name===t&&!s.unknown?{...s,enabled:n}:s))}const A={input:"Input",output:"Output","pre-tool":"Pre-tool",egress:"Egress"};function ke(a){const t=new Date(a);return Number.isNaN(t.getTime())?a:le(t,{addSuffix:!0})}function Ae({owner:a,agentId:t,name:n}){const{data:s}=G(t),{data:o}=T(t),r=y.useMemo(()=>F(s,o??[]).find(d=>d.name===n)??null,[s,o,n]),i=(s?.guardrailsInline??[]).find(d=>d.name===n);return i?e.jsx(Te,{owner:a,agentId:t,guardrail:i}):r?e.jsx(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=P(),{data:o}=G(t),{data:r}=T(t),{data:i=null}=O(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 j.error("Still loading agent settings — try again in a moment"),!1;try{return await d.mutateAsync({guardrailsInline:u}),j.success(l),!0}catch(m){return j.error(m instanceof Error?m.message:"Failed to save guardrail"),!1}},C=async u=>{const l=W(u,x,N,i,n.name);if(l){j.error(l);return}await p(ve(x,n.name,u),"Guardrail saved")&&u.name.trim()!==n.name&&s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(u.name.trim())}})},f=async()=>{await p(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(H,{initial:n,judgeModelDefault:i,submitLabel:"Save changes",submitting:d.isPending,onSubmit:C})]}),e.jsx("div",{className:"flex justify-end",children:h?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{type:"button",variant:"destructive",onClick:()=>void f(),disabled:d.isPending,children:"Delete guardrail"}),e.jsx(S,{type:"button",variant:"outline",onClick:()=>b(!1),disabled:d.isPending,children:"Cancel"})]}):e.jsxs(S,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>b(!0),children:["Delete ",n.name]})}),e.jsx(Z,{agentId:t,guardrail:n.name})]})}function Z({agentId:a,guardrail:t}){const{data:n=[],isLoading:s,isError:o}=I(a,{guardrail:t});return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Recent catches"}),s?e.jsx(ne,{label:"catches",variant:"table",rows:4}):o?e.jsx(re,{label:"catches"}):n.length===0?e.jsx(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(ge,{children:[e.jsx(he,{children:e.jsxs(_,{children:[e.jsx($,{className:"w-[180px]",children:"When"}),e.jsx($,{className:"w-[120px]",children:"Stage"}),e.jsx($,{children:"Reason"})]})}),e.jsx(xe,{children:n.map(r=>e.jsxs(_,{children:[e.jsx(R,{className:"text-xs text-muted-foreground",title:r.occurredAt,children:ke(r.occurredAt)}),e.jsx(R,{children:e.jsx(oe,{variant:"outline",className:"text-[10px]",children:A[r.stage]})}),e.jsx(R,{className:"text-sm text-muted-foreground",children:r.reason??e.jsx("span",{className:"italic",children:"no reason recorded"})})]},r.id))})]})})]})}function Le({description:a,action:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-center text-sm text-muted-foreground",children:a}),t?e.jsx("div",{className:"shrink-0",children:t}):null]})}function M(a,t){return a.get(t)??0}function Ee(a,t,n){const s=a.map(r=>{const i=r.stages.map(d=>A[d]);return r.unknown&&i.push("Unknown"),{id:r.name,name:r.name,kind:"builtin",description:r.description,stages:r.stages,enabled:r.enabled,unknown:r.unknown,badges:i,tripCount:M(n,r.name)}}),o=t.map(r=>{const i=[A[r.stage],"Custom"];return{id:r.name,name:r.name,kind:"custom",description:r.policy,stages:[r.stage],enabled:r.enabled,unknown:!1,badges:i,tripCount:M(n,r.name)}});return[...s,...o]}function $e({owner:a,agentId:t,expandedName:n}){const s=P(),{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){j.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=F(o,i??[]);await b.mutateAsync({guardrails:Se(g,l.name,m)})}j.success(m?"Guardrail enabled":"Guardrail disabled")}catch(g){j.error(g instanceof Error?g.message:"Failed to save guardrail")}},N=i===null,p=y.useMemo(()=>{const l=F(o,i??[]),m=o?.guardrailsInline??[],g=new Map;for(const v of h)g.set(v.guardrailName,(g.get(v.guardrailName)??0)+1);return Ee(l,m,g)},[o,i,h]),C=l=>{if(l===n){s({to:"/$owner/agents/$agentId/guardrails",params:{owner:a,agentId:t}});return}s({to:"/$owner/agents/$agentId/guardrails/$name",params:{owner:a,agentId:t,name:encodeURIComponent(l)}})},f=()=>{s({to:"/$owner/agents/$agentId/guardrails/create",params:{owner:a,agentId:t}})},u=r||d;return!u&&p.length===0?e.jsx("div",{className:"space-y-6",children: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:f}):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:f})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(Le,{description:"Each guardrail short-circuits this agent's input, output, or tool-call stages. Built-ins are toggle-only; add a custom guardrail to judge messages against a policy you write.",action:u?void 0:e.jsxs(S,{type:"button",onClick:f,children:[e.jsx(de,{className:"mr-1.5 h-4 w-4"}),"New guardrail"]})}),u?e.jsx(pe,{rows:3}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:p.map((l,m)=>{const g=l.name===n;return e.jsx(Re,{card:l,expanded:g,isLast:m===p.length-1,onToggle:()=>C(l.name),onToggleEnabled:v=>void x(l,v),toggleDisabled:l.unknown||b.isPending,children:g?e.jsx(Ae,{owner:a,agentId:t,name:l.name}):null},l.id)})})]})}function Re({card:a,expanded:t,isLast:n,onToggle:s,onToggleEnabled:o,toggleDisabled:r,children:i}){return e.jsxs("div",{className:E("bg-background",!n||t?"border-b":""),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsxs("button",{type:"button",onClick:s,"aria-expanded":t,className:E("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!a.enabled&&!a.unknown&&!t&&"opacity-70"),children:[e.jsx(q,{className:"ml-2 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:E("truncate text-sm text-foreground",a.unknown&&"font-mono text-xs"),children:a.name}),a.kind==="custom"&&a.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:a.description}):e.jsx("p",{className:"text-xs text-muted-foreground",children:a.tripCount>0?`${a.tripCount} recent ${a.tripCount===1?"catch":"catches"}`:"No recent catches"}),e.jsx(ue,{badges:a.badges})]})]}),e.jsx(fe,{enabled:a.enabled,name:a.name,expanded:t,onToggleEnabled:o,toggleDisabled:r,onToggle:s})]}),t&&i?e.jsx("div",{className:"border-t border-border px-4 py-4",children:i}):null]})}function De({owner:a,agentId:t,expandedName:n}){return e.jsx(J,{children:e.jsx($e,{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-CyoGSxcZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,S as s,
|
|
2
|
-
//# sourceMappingURL=agent-loading-shells-
|
|
1
|
+
import{j as e,S as s,h as n}from"./index-008wj-Pz.js";const r="mx-auto w-full max-w-3xl px-4",d="gap-4",i="ml-8 self-end max-w-[80%]",o="mr-8 max-w-[90%]",c="mx-auto w-full max-w-3xl shrink-0 border-t border-border/50 bg-transparent px-4 pb-4 pt-3";function f({rows:l=3}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading list",children:Array.from({length:l}).map((a,x)=>e.jsx(s,{className:"h-16 w-full rounded-lg"},x))})}function t({readOnly:l=!1}){return e.jsxs("div",{role:"status","aria-label":l?"Loading run history":"Loading chat",className:l?"flex min-h-[24rem] min-w-0 flex-1 flex-col":"flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:l?"flex flex-1 flex-col overflow-hidden":"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsxs("div",{className:n(r,"flex flex-1 flex-col overflow-hidden",d),children:[e.jsx("div",{className:i,children:e.jsx(s,{className:"h-12 w-48 rounded-lg"})}),e.jsx("div",{className:o,children:e.jsx(s,{className:n(l?"h-20":"h-16","w-64 rounded-lg")})}),e.jsx("div",{className:i,children:e.jsx(s,{className:"h-10 w-36 rounded-lg"})}),l?e.jsx("div",{className:o,children:e.jsx(s,{className:"h-16 w-52 rounded-lg"})}):null]})}),l?null:e.jsx("div",{className:c,children:e.jsx(s,{className:"h-24 w-full rounded-lg"})})]})}function h(){return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:e.jsx(t,{})})}function u(){return e.jsx("div",{className:"flex h-48 w-full items-end gap-2 px-2 pb-2",role:"status","aria-label":"Loading timeline",children:[40,65,45,80,55,70,50,85,60,75].map((l,a)=>e.jsx(s,{className:"flex-1 rounded-sm",style:{height:`${l}%`}},a))})}export{t as A,h as C,u as E,c as a,d as b,r as c,o as d,i as e,f};
|
|
2
|
+
//# sourceMappingURL=agent-loading-shells-CamDtzHY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,bI as B,h as A,aY as R,aZ as D,a_ as K,ga as U,a2 as V,bB as X,bA as Z,bN as G,gb as ee,bO as $,bP as F,bQ as se,bJ as ne,bR as te,bK as re,r as k,gc as ae,gd as ie,bF as le,bS as oe,L as w,ge as de,gf as ce,d8 as q,gg as ue,gh as me,gi as ge,gj as S,cY as L,X as fe,gk as W,gl as z,eP as xe,d9 as he,gm as be,gn as ye,bV as pe,go as je}from"./index-008wj-Pz.js";const ve={auto:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",approval:"bg-amber-500/15 text-amber-600 dark:text-amber-400",deny:"bg-red-500/15 text-red-600 dark:text-red-400"};function Ne({options:n,value:t,floor:o,onChange:a,disabled:i,ariaLabel:m,compact:u}){return e.jsx("div",{role:"radiogroup","aria-label":m,className:A("inline-flex shrink-0 items-stretch gap-0.5 rounded-lg border border-border bg-muted/40 p-0.5"),children:n.map(l=>{const b=U({option:l,floor:o}),h=l===t,g=b.disabled&&!h,y=B[l],f=e.jsx("button",{type:"button",role:"radio","aria-checked":h,disabled:i||g,onClick:()=>{!h&&!g&&!i&&a(l)},className:A("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",u?"min-w-[3rem] rounded-md px-2.5 py-1.5 text-xs leading-none":"min-w-[3.25rem] rounded-md px-3 py-1.5 text-sm leading-none",h?A(ve[l],""):"text-muted-foreground hover:bg-background/60 hover:text-foreground",g&&"cursor-not-allowed opacity-40",i&&!g&&"cursor-not-allowed opacity-60"),children:y},l);return g&&b.reason?e.jsxs(R,{children:[e.jsx(D,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:f})}),e.jsx(K,{children:b.reason})]},l):f})})}function Q({children:n,controls:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 px-3 py-2",children:[e.jsx("div",{className:"min-w-40 flex-1 text-sm",children:n}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t})]})}const _e=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every entity type."},{resourceClass:"agent_config",title:"Agents",sub:"Defaults for reading and managing agents."}];function ke(n,t,o,a,i=null){const m=W(n.floor,t,o,a,i),u=z(n.floor,t,o,a,i)?m:"auto";return(a!==null||i!==null)&&be(n.agent,t,o)?ye(u,S(n,t,o,null)):u}function Ae({label:n,response:t,resourceClass:o,action:a,entityTypeSlug:i,targetAgentId:m=null,dimmed:u,pending:l,onSave:b}){const h=W(t.floor,o,a,i,m),g=z(t.floor,o,a,i,m),y=S(t,o,a,i,m),f=ke(t,o,a,i,m),j=pe(o,a),p=e.jsx("div",{className:A("inline-flex shrink-0",u&&"opacity-45"),children:e.jsx(Ne,{options:j,value:y,floor:f,disabled:l,compact:!0,ariaLabel:n,onChange:b})});return g?e.jsxs(R,{children:[e.jsx(D,{asChild:!0,children:e.jsx("span",{className:"inline-flex shrink-0",children:p})}),e.jsxs(K,{children:["Org floor ",B[h]," — can only go stricter"]})]}):p}function Se(n,t){const o=i=>i.resource_class===t.resource_class&&(i.entity_type_slug??null)===(t.entity_type_slug??null)&&(i.operation_key??null)===(t.operation_key??null)&&(i.target_agent_id??null)===(t.target_agent_id??null),a=n.map(i=>o(i)?t:i);return a.some(o)?a:[...a,t]}function Ce(n,t,o,a,i,m){const u=je(n,t,o,a);return u[i]=m,u}const O="font-medium text-foreground hover:text-primary hover:underline";function Ee({type:n}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(q,{icon:n.icon,className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:n.slug})]})}function M({label:n,disabled:t,hint:o,searchPlaceholder:a,emptyText:i,children:m}){return t?e.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[n,o?` ${o}`:""]}):e.jsx(xe,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:a,emptyText:i,trigger:u=>e.jsxs("button",{type:"button","aria-expanded":u,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[e.jsx(he,{className:"h-3 w-3"}),n]}),children:u=>m(u)})}function Te({pending:n,onClick:t,label:o}){return e.jsx("button",{type:"button",disabled:n,onClick:t,"aria-label":o,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:e.jsx(fe,{className:"h-3 w-3"})})}function Oe({owner:n,agentId:t,variant:o="agent"}){const a=o==="org-floor",i=V(),m=X(n,t??"",{enabled:!a&&!!t}),u=Z(n,{enabled:a}),{data:l,isLoading:b,isError:h,error:g}=a?u:m,y=a?G(n):ee(n,t??""),f=$({mutationFn:r=>a?se(n,r):ne(n,t??"",r),onSuccess:r=>{i.setQueryData(y,c=>c&&{...c,agent:Se(c.agent,r)}),i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to save permission")}}),j=$({mutationFn:r=>a?te(n,r):re(n,t??"",r),onSuccess:()=>{i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{F.error(r instanceof Error?r.message:"Failed to remove override")}}),p=f.isPending||j.isPending,C=k.useMemo(()=>l?ae(l):[],[l]),E=k.useMemo(()=>{if(!l)return[];const r=new Set(C.map(c=>c.slug));return l.entity_types.filter(c=>!r.has(c.slug))},[l,C]),v=k.useMemo(()=>l?ie(l):[],[l]),N=k.useMemo(()=>{if(!l)return[];const r=new Set(v.map(c=>c.id));return l.agents.filter(c=>(a||c.id!==t)&&!r.has(c.id))},[l,v,t,a]);if(b)return e.jsx(le,{label:"permissions",variant:"cards",cards:2});if(h||!l)return e.jsx(oe,{label:g instanceof Error?g.message:"permissions"});const x=l,I=(r,c,T,_,s=null)=>{const d=Ce(x,r,c,s,T,_);f.mutate({resource_class:r,effects:d,entity_type_slug:c,target_agent_id:s})},H=x.entity_types.length===0?"— none yet":E.length===0?"— all covered":null,Y=N.length===0&&v.length===0?"— no other agents":N.length===0?"— all covered":null;return e.jsxs("div",{className:"space-y-4",children:[a?null:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Manage connector rules and agent restrictions in"," ",e.jsx(w,{to:"/$owner/settings/organization",params:{owner:n},search:{agent:t},hash:"policies",className:O,children:"Organization policies"}),"."]}),_e.map(r=>{const c=r.resourceClass==="entity",T=r.resourceClass==="agent_config",_=[{key:"default",label:"Default",name:"Default",entityTypeSlug:null,targetAgentId:null,owned:!1,diffs:0},...c?C.map(s=>({key:`entity:${s.slug}`,name:s.name,label:e.jsx(w,{to:"/$owner/entity-types/$slug",params:{owner:n,slug:s.slug},className:O,title:`Open ${s.name}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(q,{icon:s.icon,className:"h-3.5 w-3.5 shrink-0"}),s.name]})}),entityTypeSlug:s.slug,targetAgentId:null,owned:ce(x,s.slug),diffs:de(x,s.slug)})):v.map(s=>({key:`agent:${s.id}`,name:s.name,label:e.jsx(w,{to:"/$owner/agents/$agentId/settings",params:{owner:n,agentId:s.id},search:{run_id:void 0},className:O,title:`Open ${s.name}`,children:s.name}),entityTypeSlug:null,targetAgentId:s.id,owned:me(x,s.id),diffs:ue(x,s.id)}))];return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-medium",children:r.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.sub})]}),e.jsxs("div",{className:"divide-y overflow-hidden rounded-lg border",children:[_.map(s=>e.jsxs("div",{className:"divide-y",children:[_.length>1&&e.jsx("div",{className:"bg-muted/30",children:e.jsx(Q,{controls:s.owned?e.jsx(Te,{pending:p,label:`Remove ${s.name} exception`,onClick:()=>j.mutate({resource_class:r.resourceClass,entity_type_slug:s.entityTypeSlug,target_agent_id:s.targetAgentId})}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s.label,s.key!=="default"&&!s.owned?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Organization minimum"}):s.diffs>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.diffs," ",s.diffs===1?"change":"changes"]}):null]})})}),e.jsx("div",{className:"divide-y",children:ge[r.resourceClass].filter(d=>!s.targetAgentId||d!=="create").map(d=>{const P=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c?"entities":"agents"}`;return e.jsx(Q,{controls:e.jsx(Ae,{label:`${s.name}: ${P}`,response:x,resourceClass:r.resourceClass,action:d,entityTypeSlug:s.entityTypeSlug,targetAgentId:s.targetAgentId,dimmed:s.key!=="default"&&S(x,r.resourceClass,d,s.entityTypeSlug,s.targetAgentId)===S(x,r.resourceClass,d,null),pending:p,onSave:J=>I(r.resourceClass,s.entityTypeSlug,d,J,s.targetAgentId)}),children:P},d)})})]},s.key)),e.jsxs("div",{className:"border-t",children:[c?e.jsx(M,{label:"Add type",disabled:p||E.length===0,hint:H,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:s=>E.map(d=>e.jsx(L,{value:`${d.name} ${d.slug}`,onSelect:()=>{f.mutate({resource_class:"entity",effects:{},entity_type_slug:d.slug}),s()},className:"cursor-pointer",children:e.jsx(Ee,{type:d})},d.slug))}):null,T?e.jsx(M,{label:"Add agent",disabled:p||N.length===0,hint:Y,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:s=>N.map(d=>e.jsxs(L,{value:`${d.name} ${d.id}`,onSelect:()=>{f.mutate({resource_class:"agent_config",effects:{},target_agent_id:d.id}),s()},className:"cursor-pointer",children:[e.jsx("span",{className:"font-medium",children:d.name}),e.jsx("span",{className:"ml-1.5 font-mono text-[10px] text-muted-foreground",children:d.id})]},d.id))}):null]})]})]},r.resourceClass)})]})}export{Oe as A,Ne as P,Q as a};
|
|
2
|
+
//# sourceMappingURL=agent-permissions-matrix-CgsQ8BK_.js.map
|
package/dist/owletto/dist/assets/{agent-skill-context-DFucg4c4.js → agent-skill-context-lWbXKEm1.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,
|
|
2
|
-
//# sourceMappingURL=agent-skill-context-
|
|
1
|
+
import{r as p,ef as G,gA as ge,h9 as pe,hk as be,bP as F,j as ve}from"./index-008wj-Pz.js";import{K as E,d as me,g as he,e as xe,s as Ce,f as Ie,h as Se,i as Y,b as ke,c as ye,j as we,k as Re,C as H,l as Ae}from"./core.esm-A1UnFbGs.js";import{s as De,b as Ee}from"./skill-editor-D_W3QlRz.js";function K(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function Le(e,n){return e.reduce((t,r,s)=>{const u=n.get(r);return u&&(t[s]=u),t},Array(e.length))}function P(e){return e!==null&&e>=0}function Te(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ne(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const V=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const u=K(n,r,t),o=n[s],i=u[s];return!i||!o?null:{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}},M={scaleX:1,scaleY:1},We=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:u,overIndex:o}=e;const i=(n=u[t])!=null?n:r;if(!i)return null;if(s===t){const f=u[o];return f?{x:0,y:t<o?f.top+f.height-(i.top+i.height):f.top-i.top,...M}:null}const m=Oe(u,s,t);return s>t&&s<=o?{x:0,y:-i.height-m,...M}:s<t&&s>=o?{x:0,y:i.height+m,...M}:{x:0,y:0,...M}};function Oe(e,n,t){const r=e[n],s=e[n-1],u=e[n+1];return r?t<n?s?r.top-(s.top+s.height):u?u.top-(r.top+r.height):0:u?u.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const W="Sortable",J=G.createContext({activeIndex:-1,containerId:W,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:V,disabled:{draggable:!1,droppable:!1}});function Je(e){let{children:n,id:t,items:r,strategy:s=V,disabled:u=!1}=e;const{active:o,dragOverlay:i,droppableRects:m,over:f,measureDroppableContainers:a}=Ie(),l=Se(W,t),b=i.rect!==null,h=p.useMemo(()=>r.map(d=>typeof d=="object"&&"id"in d?d.id:d),[r]),k=o!=null,w=o?h.indexOf(o.id):-1,C=f?h.indexOf(f.id):-1,R=p.useRef(h),I=!Te(h,R.current),S=C!==-1&&w===-1||I,c=Ne(u);Y(()=>{I&&k&&a(h)},[I,h,k,a]),p.useEffect(()=>{R.current=h},[h]);const g=p.useMemo(()=>({activeIndex:w,containerId:l,disabled:c,disableTransforms:S,items:h,overIndex:C,useDragOverlay:b,sortedRects:Le(h,m),strategy:s}),[w,l,c.draggable,c.droppable,S,h,C,m,b,s]);return G.createElement(J.Provider,{value:g},n)}const Pe=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return K(t,r,s).indexOf(n)},Me=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:u,newIndex:o,previousItems:i,previousContainerId:m,transition:f}=e;return!f||!r||i!==u&&s===o?!1:t?!0:o!==s&&n===m},je={duration:200,easing:"ease"},Q="transform",$e=H.Transition.toString({property:Q,duration:0,easing:"linear"}),ze={roleDescription:"sortable"};function Fe(e){let{disabled:n,index:t,node:r,rect:s}=e;const[u,o]=p.useState(null),i=p.useRef(t);return Y(()=>{if(!n&&t!==i.current&&r.current){const m=s.current;if(m){const f=Ae(r.current,{ignoreTransform:!0}),a={x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height};(a.x||a.y)&&o(a)}}t!==i.current&&(i.current=t)},[n,t,r,s]),p.useEffect(()=>{u&&o(null)},[u]),u}function Qe(e){let{animateLayoutChanges:n=Me,attributes:t,disabled:r,data:s,getNewIndex:u=Pe,id:o,strategy:i,resizeObserverConfig:m,transition:f=je}=e;const{items:a,containerId:l,activeIndex:b,disabled:h,disableTransforms:k,sortedRects:w,overIndex:C,useDragOverlay:R,strategy:I}=p.useContext(J),S=Ke(r,h),c=a.indexOf(o),g=p.useMemo(()=>({sortable:{containerId:l,index:c,items:a},...s}),[l,s,c,a]),d=p.useMemo(()=>a.slice(a.indexOf(o)),[a,o]),{rect:v,node:y,isOver:A,setNodeRef:L}=ke({id:o,data:g,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:d,...m}}),{active:D,activatorEvent:te,activeNodeRect:ne,attributes:re,setNodeRef:U,listeners:se,isDragging:$,over:oe,setActivatorNodeRef:ie,transform:ae}=ye({id:o,data:g,attributes:{...ze,...t},disabled:S.draggable}),le=we(L,U),T=!!D,X=T&&!k&&P(b)&&P(C),_=!R&&$,q=_&&X?ae:null,ce=X?q??(i??I)({rects:w,activeNodeRect:ne,activeIndex:b,overIndex:C,index:c}):null,O=P(b)&&P(C)?u({id:o,items:a,activeIndex:b,overIndex:C}):c,N=D?.id,x=p.useRef({activeId:N,items:a,newIndex:O,containerId:l}),ue=a!==x.current.items,B=n({active:D,containerId:l,isDragging:$,isSorting:T,id:o,index:c,items:a,newIndex:x.current.newIndex,previousItems:x.current.items,previousContainerId:x.current.containerId,transition:f,wasDragging:x.current.activeId!=null}),z=Fe({disabled:!B,index:c,node:y,rect:v});return p.useEffect(()=>{T&&x.current.newIndex!==O&&(x.current.newIndex=O),l!==x.current.containerId&&(x.current.containerId=l),a!==x.current.items&&(x.current.items=a)},[T,O,l,a]),p.useEffect(()=>{if(N===x.current.activeId)return;if(N!=null&&x.current.activeId==null){x.current.activeId=N;return}const fe=setTimeout(()=>{x.current.activeId=N},50);return()=>clearTimeout(fe)},[N]),{active:D,activeIndex:b,attributes:re,data:g,rect:v,index:c,newIndex:O,items:a,isOver:A,isSorting:T,isDragging:$,listeners:se,node:y,overIndex:C,over:oe,setNodeRef:le,setActivatorNodeRef:ie,setDroppableNodeRef:L,setDraggableNodeRef:U,transform:z??ce,transition:de()};function de(){if(z||ue&&x.current.newIndex===c)return $e;if(!(_&&!Re(te)||!f)&&(T||B))return H.Transition.toString({...f,property:Q})}}function Ke(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}function j(e){if(!e)return!1;const n=e.data.current;return!!(n&&"sortable"in n&&typeof n.sortable=="object"&&"containerId"in n.sortable&&"items"in n.sortable&&"index"in n.sortable)}const Ue=[E.Down,E.Right,E.Up,E.Left],Ze=(e,n)=>{let{context:{active:t,collisionRect:r,droppableRects:s,droppableContainers:u,over:o,scrollableAncestors:i}}=n;if(Ue.includes(e.code)){if(e.preventDefault(),!t||!r)return;const m=[];u.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const b=s.get(l.id);if(b)switch(e.code){case E.Down:r.top<b.top&&m.push(l);break;case E.Up:r.top>b.top&&m.push(l);break;case E.Left:r.left>b.left&&m.push(l);break;case E.Right:r.left<b.left&&m.push(l);break}});const f=me({collisionRect:r,droppableRects:s,droppableContainers:m});let a=he(f,"id");if(a===o?.id&&f.length>1&&(a=f[1].id),a!=null){const l=u.get(t.id),b=u.get(a),h=b?s.get(b.id):null,k=b?.node.current;if(k&&h&&l&&b){const C=xe(k).some((d,v)=>i[v]!==d),R=Z(l,b),I=Xe(l,b),S=C||!R?{x:0,y:0}:{x:I?r.width-h.width:0,y:I?r.height-h.height:0},c={x:h.left,y:h.top};return S.x&&S.y?c:Ce(c,S)}}}};function Z(e,n){return!j(e)||!j(n)?!1:e.data.current.sortable.containerId===n.data.current.sortable.containerId}function Xe(e,n){return!j(e)||!j(n)||!Z(e,n)?!1:e.data.current.sortable.index<n.data.current.sortable.index}function _e(e){return{skillsConfig:De(e)}}function qe(e){return e.repo.startsWith("system/")?["System"]:[]}function et(e,n){return e.filter(t=>!t.hidden&&!n.has(t.repo)).map(t=>({key:t.repo,name:t.name,description:t.description||t.instructions||"Add this skill to give the agent tools and capabilities.",badges:qe(t)}))}function tt(e,n){const t=n.trim().toLowerCase();return t?e.filter(r=>r.name.toLowerCase().includes(t)||r.description.toLowerCase().includes(t)||r.key.toLowerCase().includes(t)):e}function Be(e){const n=e.instructions?.trim();return{repo:e.repo,skillId:e.skillId,name:e.name,description:e.description,instructions:n,content:n||e.name,enabled:!0,system:e.repo.startsWith("system/")}}const ee=p.createContext(null);function nt({agentId:e,children:n}){const{data:t,isLoading:r}=ge(e),{data:s,isLoading:u}=pe(e),o=be(e),i=p.useMemo(()=>t?Ee(t,s?.catalog??[]):[],[t,s]),[m,f]=p.useState(null),a=m??i,l=p.useCallback(async(c,g)=>{if(!t)return F.error("Still loading agent settings — try again in a moment"),!1;try{const d=_e(c);return await o.mutateAsync(d),F.success(g),!0}catch(d){return F.error(d instanceof Error?d.message:"Failed to save skills"),!1}},[t,o]),b=p.useCallback(c=>{const g=s?.catalog.find(d=>d.repo===c);g&&f(d=>{const v=d??i;return v.some(y=>y.repo===c)?v:[...v,Be(g)]})},[i,s?.catalog]),h=p.useCallback(c=>{const g=c.name.trim();if(!g)return null;const d=`custom/${g.toLowerCase().replace(/[^a-z0-9-]/g,"-")}`,v=c.instructions.trim();return f(y=>{const A=y??i;return A.some(L=>L.repo===d)?A:[...A,{repo:d,skillId:g,name:g,instructions:v||void 0,content:v||g,enabled:!0}]}),d},[i]),k=p.useCallback((c,g)=>{f(d=>(d??i).map(v=>v.repo===c?{...v,...g}:v))},[i]),w=p.useCallback((c,g)=>{f(d=>{const v=d??i,y=v.findIndex(D=>D.repo===c),A=v.findIndex(D=>D.repo===g);if(y<0||A<0||y===A)return v;const L=K(v,y,A);return l(L,"Skill order updated"),L})},[l,i]),C=p.useCallback(async c=>{const g=a.filter(d=>d.repo!==c);return f(g),l(g,"Skill removed")},[l,a]),R=p.useCallback(async(c,g)=>{const d=a.map(v=>v.repo===c?{...v,enabled:g}:v);return f(d),l(d,g?"Skill enabled":"Skill disabled")},[l,a]),I=p.useCallback(async()=>{await l(a,"Skills saved")},[l,a]),S=p.useMemo(()=>({agentId:e,skillRows:a,catalog:s,isLoading:r||u,isSaving:o.isPending,addSkillFromCatalog:b,addCustomSkill:h,updateSkillRow:k,reorderSkills:w,removeSkillAndSave:C,setSkillEnabledAndSave:R,saveSkills:I}),[h,b,e,u,r,w,C,R,I,a,s,o.isPending,k]);return ve.jsx(ee.Provider,{value:S,children:n})}function rt(){const e=p.useContext(ee);if(!e)throw new Error("useAgentSkillEditor must be used within AgentSkillEditorProvider");return e}export{nt as A,Je as S,Ze as a,et as b,Qe as c,tt as f,qe as s,rt as u,We as v};
|
|
2
|
+
//# sourceMappingURL=agent-skill-context-lWbXKEm1.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as D,r as g,j as e,d9 as L,H as C,I as K,ew as P,bG as O,B as N,h as R,dk as _,hb as G,hc as H,a$ as z,hr as Q,fC as Y,iU as U}from"./index-008wj-Pz.js";import{u as A,b as V,f as X,s as q,a as J,S as W,v as Z,c as ee}from"./agent-skill-context-lWbXKEm1.js";import{a as se,A as E}from"./agent-subpage-shell-CLqpn5Tb.js";import{f as te}from"./agent-loading-shells-CamDtzHY.js";import{u as ae,a as F,m as ne,P as le,D as ie,n as oe,C as re}from"./core.esm-A1UnFbGs.js";import{A as ce}from"./agent-card-controls-DiU7Un5w.js";const T=":";function w(s){const t=s.indexOf("/");return t<0?s:`${s.slice(0,t)}${T}${s.slice(t+1)}`}function B(s){const t=s.indexOf(T);return t<0?s:`${s.slice(0,t)}/${s.slice(t+1)}`}function de({owner:s,agentId:t}){const a=D(),[n,i]=g.useState(""),[o,d]=g.useState(!1),[x,k]=g.useState(""),[r,v]=g.useState(""),{skillRows:m,catalog:p,isLoading:u,addSkillFromCatalog:h,addCustomSkill:S}=A(),b=g.useMemo(()=>new Set(m.map(c=>c.repo)),[m]),f=g.useMemo(()=>V(p?.catalog??[],b),[p?.catalog,b]),l=g.useMemo(()=>X(f,n),[f,n]),y=c=>{h(c),a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(c)}})},j=()=>{const c=S({name:x,instructions:r});c&&a({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(c)}})},$=e.jsx(se,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."});return e.jsxs("div",{className:"space-y-6",children:[$,e.jsx("div",{className:R(_,"w-full"),children:o?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(K,{id:"custom-skill-name",value:x,onChange:c=>k(c.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:r,onChange:c=>v(c.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(O,{onCancel:()=>d(!1),children:e.jsx(N,{type:"button",size:"sm",onClick:j,disabled:!x.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>d(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(L,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),u?e.jsx(G,{}):e.jsx(H,{items:l,searchQuery:n,onSearchChange:i,onSelect:c=>y(c.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:n.trim()?`No skills match "${n}"`:f.length===0?"All catalog skills are already configured":"No skills available"})]})}function me({row:s}){const{isSaving:t,updateSkillRow:a}=A(),n=s.system===!0;return e.jsx("div",{className:"space-y-6",children:n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"System skill metadata is managed by Lobu. You can enable or disable it and change its position in the skill list."}):e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-name",children:"Name"}),e.jsx(K,{id:"skill-name",value:s.name,onChange:i=>a(s.repo,{name:i.target.value}),disabled:t})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"skill-instructions",children:"Instructions"}),e.jsx(P,{id:"skill-instructions",value:s.instructions??"",onChange:i=>{const o=i.target.value;a(s.repo,{instructions:o,content:o.trim()||s.name})},rows:4,disabled:t})]})]})})}function ue({owner:s,agentId:t,skillKey:a}){const n=D(),[i,o]=g.useState(!1),d=B(a),{skillRows:x,catalog:k,isSaving:r,saveSkills:v,removeSkillAndSave:m,addSkillFromCatalog:p}=A(),u=x.find(f=>f.repo===d)??null,h=k?.catalog.find(f=>f.repo===d);g.useEffect(()=>{!u&&h&&p(d)},[p,h,d,u]);const S=async()=>{await m(d)&&(o(!1),n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}}))};if(!u)return h?null:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Skill not found."});const b=!u.system;return e.jsxs("div",{className:"space-y-6",children:[e.jsx(me,{row:u}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end",children:[b?i?e.jsxs(e.Fragment,{children:[e.jsx(N,{type:"button",variant:"destructive",onClick:()=>void S(),disabled:r,children:r?"Removing...":"Remove skill"}),e.jsx(N,{type:"button",variant:"outline",onClick:()=>o(!1),disabled:r,children:"Cancel"})]}):e.jsxs(N,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),disabled:r,children:["Remove ",u.name]}):null,e.jsx(N,{type:"button",onClick:()=>void v(),disabled:r||i,children:r?"Saving...":"Save changes"})]})]})}function ge(s){return s.map(t=>{const a=q(t).map(String);return{id:t.repo,repo:t.repo,name:t.name,description:t.description,badges:a,enabled:t.enabled}})}const I="Skills bundle instructions, tools, and knowledge an agent can reuse. Add one from the catalog or write your own; drag to set which the agent reaches for first.";function M({owner:s,agentId:t,expandedRepo:a}){const n=D(),{skillRows:i,catalog:o,isLoading:d,isSaving:x,reorderSkills:k,setSkillEnabledAndSave:r,addSkillFromCatalog:v}=A();g.useEffect(()=>{a&&(i.some(l=>l.repo===a)||o?.catalog.some(l=>l.repo===a)&&v(a))},[a,i,o,v]);const m=g.useMemo(()=>ge(i),[i]),p=g.useMemo(()=>m.map(l=>l.repo),[m]),u=ae(F(le,{activationConstraint:{distance:8}}),F(ne,{coordinateGetter:J})),h=()=>{n({to:"/$owner/agents/$agentId/skills/create",params:{owner:s,agentId:t}})},S=e.jsxs(N,{type:"button",onClick:h,children:[e.jsx(L,{className:"mr-1.5 h-4 w-4"}),"Add skill"]}),b=l=>{if(l===a){n({to:"/$owner/agents/$agentId/skills",params:{owner:s,agentId:t}});return}n({to:"/$owner/agents/$agentId/skills/$skillKey",params:{owner:s,agentId:t,skillKey:w(l)}})},f=l=>{const{active:y,over:j}=l;!j||y.id===j.id||k(String(y.id),String(j.id))};return d?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(te,{rows:2})]}):m.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e.jsx(z,{icon:Q,title:"No skills yet",description:"Add a system skill from the catalog or create a custom skill for this agent.",actionLabel:"Add skill",onAction:h})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:I}),S]}),e.jsx(ie,{sensors:u,collisionDetection:oe,onDragEnd:f,children:e.jsx(W,{items:p,strategy:Z,children:e.jsx("div",{className:"overflow-hidden rounded-lg border",children:m.map((l,y)=>{const j=l.repo===a;return e.jsx(xe,{card:l,rank:y+1,disabled:x,expanded:j,isLast:y===m.length-1,onToggle:()=>b(l.repo),onToggleEnabled:$=>void r(l.repo,$),toggleDisabled:x,children:j?e.jsx(ue,{owner:s,agentId:t,skillKey:w(l.repo)}):null},l.id)})})})})]})}function xe({card:s,rank:t,disabled:a,expanded:n,isLast:i,onToggle:o,onToggleEnabled:d,toggleDisabled:x,children:k}){const r=a||n,{attributes:v,listeners:m,setNodeRef:p,transform:u,transition:h,isDragging:S}=ee({id:s.repo,disabled:r}),b={transform:re.Transform.toString(u),transition:h};return e.jsxs("div",{ref:p,style:b,className:R("bg-background",!i||n?"border-b":"",S&&"z-10 bg-card opacity-80 "),children:[e.jsxs("div",{className:"flex items-stretch gap-1 pr-3",children:[e.jsx("button",{type:"button",className:"flex shrink-0 cursor-grab touch-none items-center px-2 text-muted-foreground hover:text-foreground active:cursor-grabbing disabled:cursor-not-allowed disabled:opacity-50","aria-label":`Reorder ${s.name}`,disabled:r,...v,...m,children:e.jsx(Y,{className:"h-4 w-4"})}),e.jsxs("button",{type:"button",className:R("flex min-w-0 flex-1 items-center gap-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",!s.enabled&&!n&&"opacity-70"),onClick:o,"aria-expanded":n,children:[e.jsx("span",{className:"w-4 shrink-0 text-center text-xs tabular-nums text-muted-foreground",children:t}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:s.name}),s.description?e.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:s.description}):null,e.jsx(U,{badges:s.badges})]})]}),e.jsx(ce,{enabled:s.enabled,name:s.name,expanded:n,onToggleEnabled:d,toggleDisabled:x,onToggle:o})]}),n&&k?e.jsx("div",{className:"border-t border-border px-4 py-4",children:k}):null]})}function je({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t})})}function Se({owner:s,agentId:t}){return e.jsx(E,{children:e.jsx(de,{owner:s,agentId:t})})}function ye({owner:s,agentId:t,skillKey:a}){return e.jsx(E,{children:e.jsx(M,{owner:s,agentId:t,expandedRepo:B(a)})})}export{je as A,Se as a,ye as b};
|
|
2
|
+
//# sourceMappingURL=agent-skills-route-D-w3tY_2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,h as a}from"./index-008wj-Pz.js";function r({children:t,className:s}){return e.jsx("div",{className:a("mx-auto w-full max-w-3xl pb-8",s),children:t})}function x({title:t,description:s}){return e.jsxs("div",{className:"mb-2 space-y-1",children:[e.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:s})]})}export{r as A,x as a};
|
|
2
|
+
//# sourceMappingURL=agent-subpage-shell-CLqpn5Tb.js.map
|