@lobu/runtime-server 24.8.0 → 24.10.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/automations.json +2 -2
- package/dist/catalogs/connectors.json +99 -10
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +6 -2
- package/dist/connectors/github.ts +16 -3
- package/dist/connectors/market_quotes.ts +388 -91
- package/dist/connectors/postgres.ts +60 -38
- package/dist/connectors/whatsapp-web-adapter.js +41 -10
- package/dist/connectors/whatsapp-web-helpers.ts +12 -2
- package/dist/connectors/whatsapp_web.ts +18 -2
- package/dist/connectors/x-dm-adapter.js +55 -21
- package/dist/connectors/x.ts +1 -1
- package/dist/db/migrations/20261109010000_workspace_navigation.sql +14 -0
- package/dist/db/migrations/20261110010000_view_resources.sql +11 -0
- package/dist/db/migrations/20261112210000_instance_identity.sql +18 -0
- package/dist/dependencies.bun.lock +88 -86
- package/dist/embeddings-server.mjs +38 -5
- package/dist/owletto/dist/assets/_-CYvj1y65.js +3 -0
- package/dist/owletto/dist/assets/_-CeLTSYYY.js +2 -0
- package/dist/owletto/dist/assets/_agentId-BB5E-L6T.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DN0EwMAC.js +2 -0
- package/dist/owletto/dist/assets/_automationId-DvUl9CSd.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CVKfL9AG.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-Cv6FzK1v.js +2 -0
- package/dist/owletto/dist/assets/{_conversationId-OJrZjd0o.js → _conversationId-CPpNySjO.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-DZKicuq6.js +2 -0
- package/dist/owletto/dist/assets/_owner-Dauk3YuD.js +3 -0
- package/dist/owletto/dist/assets/_shape-cKrEID3T.js +2 -0
- package/dist/owletto/dist/assets/_slug-DJx_8fsV.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CPVzVKEf.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CW8gexOQ.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-Dwq1GAnG.js +2 -0
- package/dist/owletto/dist/assets/activity-route-location-C1jcXC7v.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-D78Wj0RH.js +2 -0
- package/dist/owletto/dist/assets/agent-connect-pages-DoI9UR0a.js +4 -0
- package/dist/owletto/dist/assets/{agent-editor-form-CDAHRNWl.js → agent-editor-form-DlavYg2q.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-BupiSjR-.js → agent-loading-shells-DYqQphN7.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-C1L8IcYR.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-B0ZYVE3n.js → agent-skill-context-D1nMrVod.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-ByU0xhXn.js → agent-subpage-shell-2w7vTeXw.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-DiVKn1WX.js → agent-thread-BopD-2k1.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-BQWElSoP.js → app._appId-BXeFXW1w.js} +2 -2
- package/dist/owletto/dist/assets/{assist-composer-igTXq3DL.js → assist-composer-CL5x8pNt.js} +2 -2
- package/dist/owletto/dist/assets/automation-run-now-MtxUTfzd.js +2 -0
- package/dist/owletto/dist/assets/{callback-Dmaio9CX.js → callback-BgfwP1Eo.js} +2 -2
- package/dist/owletto/dist/assets/{card-rE4Ctuy6.js → card-DtLIFq7D.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BN17CPYh.js → claim-CT3hYVMF.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-B7xVaUA-.js → client-activity-scopes-BPbRX-Pe.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-B3LULJxW.js → client-rows-vrNA6FLs.js} +2 -2
- package/dist/owletto/dist/assets/clients-xnzZeEdZ.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-UppEMWpt.js → code-editor-mrKkAfcE.js} +2 -2
- package/dist/owletto/dist/assets/connect-NUCSay8X.js +2 -0
- package/dist/owletto/dist/assets/{connect-menu-B9u86bb2.js → connect-menu-C6iVtuSo.js} +2 -2
- package/dist/owletto/dist/assets/connect._clientId-Cp-d9Q5b.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId-CaF-ZWlZ.js → connected._clientId-ROfVgp9h.js} +2 -2
- package/dist/owletto/dist/assets/connection-BMz740Wi.js +2 -0
- package/dist/owletto/dist/assets/{connection-feed-detail-CJYqryAV.js → connection-feed-detail-0VAJiZTP.js} +2 -2
- package/dist/owletto/dist/assets/connector-page-shell-BFv21yuv.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-CW4CXtCz.js → connector-provenance-b59RfBtk.js} +2 -2
- package/dist/owletto/dist/assets/connectors-nYS31lO2.js +2 -0
- package/dist/owletto/dist/assets/consent-cPRF9JQv.js +2 -0
- package/dist/owletto/dist/assets/{copy-button-1ALlvZU1.js → copy-button-C3wMMv63.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-6koO33th.js → core.esm-C9QlSrgK.js} +3 -3
- package/dist/owletto/dist/assets/{create-kUevP9Xx.js → create-ASRN3Obq.js} +2 -2
- package/dist/owletto/dist/assets/create-CBcodaSO.js +2 -0
- package/dist/owletto/dist/assets/create-CGOWfMk4.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-BhujNbRr.js → create-automation-form-CLicoPH5.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-s4xkktTC.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-B_aCgvoZ.js → custom-guardrail-edits-BUL7nmuO.js} +2 -2
- package/dist/owletto/dist/assets/{definition-comparison-3zKUSTt8.js → definition-comparison-4UYMI6BK.js} +2 -2
- package/dist/owletto/dist/assets/{detail-page-skeleton-BmxqqIsH.js → detail-page-skeleton-C8v3rJXK.js} +2 -2
- package/dist/owletto/dist/assets/device-BBwsOi7q.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-Bcpe7nAA.js +2 -0
- package/dist/owletto/dist/assets/{device._deviceId-Dqtmb1Xp.js → device._deviceId-DLT4jh0Z.js} +2 -2
- package/dist/owletto/dist/assets/{dynamic-schema-form-D3KnzCsW.js → dynamic-schema-form-BDT8x0Vg.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-B9hm9V87.js +2 -0
- package/dist/owletto/dist/assets/entity-page-DZjzQ2V4.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-BWBpttz3.js +2 -0
- package/dist/owletto/dist/assets/entity-schema-graph-lMMx3HhR.js +2 -0
- package/dist/owletto/dist/assets/{entity-type-page-CouHZbc9.js → entity-type-page-CkQm0yEu.js} +2 -2
- package/dist/owletto/dist/assets/event-detail-CkzfakTK.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DmRzikZW.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-CQoSj-20.js +3 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B7A6Ycyi.js → full-page-spinner-CYyCnKve.js} +2 -2
- package/dist/owletto/dist/assets/index-BE7eb2kE.js +2 -0
- package/dist/owletto/dist/assets/index-BFR0uiKY.js +2 -0
- package/dist/owletto/dist/assets/{index-DXfYVs5m.js → index-BS5Ty3tf.js} +2 -2
- package/dist/owletto/dist/assets/index-C38OzBpB.js +2 -0
- package/dist/owletto/dist/assets/{index-BztXeLBN.js → index-C3hz9tzx.js} +2 -2
- package/dist/owletto/dist/assets/index-CDyFQ32o.js +2 -0
- package/dist/owletto/dist/assets/{index-B-dZruj6.js → index-CUndAH6o.js} +2 -2
- package/dist/owletto/dist/assets/index-CiKysEhV.js +2 -0
- package/dist/owletto/dist/assets/index-DByaMzsG.js +7906 -0
- package/dist/owletto/dist/assets/index-DfdinB7B.js +2 -0
- package/dist/owletto/dist/assets/index-DgMM4Zt5.css +1 -0
- package/dist/owletto/dist/assets/index-Xk711gVC.js +2 -0
- package/dist/owletto/dist/assets/index-ittfA0k8.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-CJK-gzCt.js → json-diff-mcDgyct_.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-bQAZ0hQp.js → list-skeleton-DsYGUHxi.js} +2 -2
- package/dist/owletto/dist/assets/login-EoLq136v.js +2 -0
- package/dist/owletto/dist/assets/{logout-H0F3IfiO.js → logout-gLgEQOiX.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-Doic_6qX.js → member-scope-gate-vvkgSAb2.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-DvDtwrEI.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BrfaDwIg.js → model-selector-D3vSMLO2.js} +2 -2
- package/dist/owletto/dist/assets/needs-you-list-B5Bgd05M.js +2 -0
- package/dist/owletto/dist/assets/new-BPW3V0Y1.js +2 -0
- package/dist/owletto/dist/assets/new-Bk_flKQO.js +2 -0
- package/dist/owletto/dist/assets/new-C5HtQdM_.js +2 -0
- package/dist/owletto/dist/assets/new-dLXsCHBd.js +2 -0
- package/dist/owletto/dist/assets/organization-DBfgBkzq.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-c2PG3TEX.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-DYYOoCvj.js → pending-seed-CBhx2Ql-.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-BVwOMoq9.js → proposal-review-shell-B-jYcKfB.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-D8TijlRY.js +2 -0
- package/dist/owletto/dist/assets/record-activity-DnRVOrG2.js +2 -0
- package/dist/owletto/dist/assets/{record-session-KuEDuF3S.js → record-session-CAmGHMyM.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-ucwCQmBk.js → renderer-olRv_HMI.js} +3 -3
- package/dist/owletto/dist/assets/reset-password-B9_xi8Pq.js +2 -0
- package/dist/owletto/dist/assets/{run-initiator-8vdkq-3o.js → run-initiator-DhE5v4z0.js} +2 -2
- package/dist/owletto/dist/assets/runs-C8sZQr4o.js +2 -0
- package/dist/owletto/dist/assets/runs-list-CwtH-wmk.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-CefbtPIY.js → schema-value-zTJGE4eh.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-BKyJSa3_.js +2 -0
- package/dist/owletto/dist/assets/{settings-DvzkRYQy.js → settings-z02cvVS3.js} +2 -2
- package/dist/owletto/dist/assets/source-record-panels-CGmKIJdN.js +2 -0
- package/dist/owletto/dist/assets/{status-variants-BxHtpMOj.js → status-variants-DyRCXBzM.js} +2 -2
- package/dist/owletto/dist/assets/subDays-D8nHthaS.js +2 -0
- package/dist/owletto/dist/assets/{table-1O-ik4_O.js → table-C637cQxG.js} +2 -2
- package/dist/owletto/dist/assets/use-automations-CgWNoYio.js +2 -0
- package/dist/owletto/dist/assets/use-login-redirect-tDdhXTpt.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CA-evCDf.js → use-mention-search-D-kIKchD.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-CUCj9Df-.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-C35Dyt91.js +2 -0
- package/dist/owletto/dist/index.html +19 -12
- package/dist/server-main.bundle.mjs +6964 -4213
- package/npm-shrinkwrap.json +423 -406
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -2
- package/vendor/connector-sdk/dist/index.d.ts +1 -0
- package/vendor/connector-sdk/dist/index.js +1 -0
- package/vendor/connector-sdk/dist/ip-reachability.d.ts +1 -1
- package/vendor/connector-sdk/dist/ip-reachability.js +1 -1
- package/vendor/connector-sdk/dist/logger.d.ts +1 -1
- package/vendor/connector-sdk/dist/logger.js +1 -1
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +3 -1
- package/vendor/connector-sdk/dist/retry.d.ts +1 -1
- package/vendor/connector-sdk/dist/retry.js +1 -1
- package/vendor/connector-sdk/dist/source-withheld-error.d.ts +16 -0
- package/vendor/connector-sdk/dist/source-withheld-error.js +19 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.d.ts +4 -5
- package/vendor/core/dist/classify-error.js +10 -10
- package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +17 -1
- package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +67 -3
- package/vendor/core/dist/contracts/tools/manage-automations.js +38 -9
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +8 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +11 -3
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +249 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
- package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
- package/vendor/core/dist/contracts/tools/navigation.js +284 -0
- package/vendor/core/dist/contracts/tools/save-memory.d.ts +11 -1
- package/vendor/core/dist/contracts/tools/save-memory.js +25 -3
- package/vendor/core/dist/contracts/tools/search-memory.js +1 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
- package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
- package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
- package/vendor/core/dist/contracts/tools/view-host.js +28 -1
- package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
- package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
- package/vendor/core/dist/credentials.d.ts +12 -0
- package/vendor/core/dist/credentials.js +1 -0
- package/vendor/core/dist/errors.d.ts +17 -24
- package/vendor/core/dist/errors.js +19 -26
- package/vendor/core/dist/types.d.ts +0 -6
- package/vendor/core/dist/worker/auth.d.ts +5 -0
- package/vendor/core/dist/worker/auth.js +15 -4
- package/vendor/core/package.json +11 -1
- package/vendor/postgres/cf/src/connection.js +7 -2
- package/vendor/postgres/cjs/src/connection.js +7 -2
- package/vendor/postgres/src/connection.js +7 -2
- package/vendor/views/dist/api.d.ts +30 -5
- package/vendor/views/dist/api.js +22 -8
- package/vendor/views/dist/bridge.d.ts +17 -0
- package/vendor/views/dist/bridge.js +49 -1
- package/vendor/views/dist/components.d.ts +27 -5
- package/vendor/views/dist/components.js +57 -7
- package/vendor/views/dist/embed.d.ts +98 -0
- package/vendor/views/dist/embed.js +418 -0
- package/vendor/views/dist/index.d.ts +3 -1
- package/vendor/views/dist/index.js +1 -0
- package/vendor/views/dist/native.d.ts +33 -1
- package/vendor/views/dist/native.js +3 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-B0tmXZ86.js +0 -2
- package/dist/owletto/dist/assets/_-DwXULq4r.js +0 -3
- package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +0 -2
- package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +0 -2
- package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-DM5MTO8c.js +0 -2
- package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +0 -2
- package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +0 -3
- package/dist/owletto/dist/assets/_shape-BZidoJMB.js +0 -2
- package/dist/owletto/dist/assets/_slug-R989vOiM.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-BC-ZIsrf.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-CdDjrHjn.js +0 -4
- package/dist/owletto/dist/assets/agent-permissions-matrix-ju7L2M0l.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +0 -2
- package/dist/owletto/dist/assets/clients-CydgUHrc.js +0 -2
- package/dist/owletto/dist/assets/connect-OdHpIVV9.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +0 -2
- package/dist/owletto/dist/assets/connection-D8ZAMHBT.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +0 -2
- package/dist/owletto/dist/assets/connector-page-shell-C23dWdKz.js +0 -2
- package/dist/owletto/dist/assets/connectors-Bp08_KPq.js +0 -2
- package/dist/owletto/dist/assets/consent-_PpYI1cT.js +0 -2
- package/dist/owletto/dist/assets/create-DULVO0HS.js +0 -2
- package/dist/owletto/dist/assets/create-Drx9tcnG.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +0 -2
- package/dist/owletto/dist/assets/device-D2eUt_nr.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-BFPbTM_o.js +0 -2
- package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +0 -2
- package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-DJNSQrfB.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +0 -2
- package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +0 -2
- package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +0 -2
- package/dist/owletto/dist/assets/index-9PGnv4-5.js +0 -2
- package/dist/owletto/dist/assets/index-C2TCKJDP.js +0 -7901
- package/dist/owletto/dist/assets/index-C7QM3aqU.js +0 -2
- package/dist/owletto/dist/assets/index-CWn46a4y.js +0 -2
- package/dist/owletto/dist/assets/index-CxJONizf.js +0 -2
- package/dist/owletto/dist/assets/index-DJhb3li3.js +0 -2
- package/dist/owletto/dist/assets/index-DY-YGnCe.js +0 -2
- package/dist/owletto/dist/assets/index-j3v7ITPb.js +0 -2
- package/dist/owletto/dist/assets/index-oiy6ygaI.js +0 -2
- package/dist/owletto/dist/assets/index-pEgtAY1t.js +0 -2
- package/dist/owletto/dist/assets/index-xAvK3IyQ.css +0 -1
- package/dist/owletto/dist/assets/login-DLqL54Rk.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +0 -74
- package/dist/owletto/dist/assets/new-5GkxlOuQ.js +0 -2
- package/dist/owletto/dist/assets/new-BiA4DGoN.js +0 -2
- package/dist/owletto/dist/assets/new-M-MX_T5C.js +0 -2
- package/dist/owletto/dist/assets/organization-CLrcmgNK.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +0 -2
- package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +0 -2
- package/dist/owletto/dist/assets/reset-password-BkiAmXZW.js +0 -2
- package/dist/owletto/dist/assets/runs-B_iywKWb.js +0 -2
- package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +0 -2
- package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-LJIWGtHb.js +0 -2
- package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +0 -2
- package/dist/owletto/dist/assets/use-automations-lV8PuE8L.js +0 -2
- package/dist/owletto/dist/assets/use-login-redirect-CfCbEeJR.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-Bp84PUMd.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-BerT4Z1d.js +0 -2
- /package/vendor/postgres/{.bun-tag-c81dacd34e959a7a → .bun-tag-652f2580b8090d71} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aJ as Pe,aK as Se,aL as $e,aS as re,aP as J,hZ as Qe,h_ as Ge,j as e,h$ as Ze,B as g,L as _,aR as le,bb as De,cu as ee,cw as se,cx as U,i0 as Je,ad as es,i1 as Z,r as u,i2 as ye,i3 as Ee,cQ as ss,i4 as Ne,bo as I,i5 as Ce,T as k,bg as ts,bh as ns,bi as as,bj as is,bk as rs,i6 as os,U as S,bI as q,ai as T,A as ke,i7 as ls,i8 as cs,d3 as ds,i9 as us,c1 as ce,ia as ms,ib as xs,ic as _e,id as Le,ie as Fe,dN as Be,a2 as E,a3 as te,ig as hs,gg as ps,ih as gs,eH as Re,ii as Ke,hV as R,c as H,ij as js,e3 as fs,e4 as vs,e7 as bs,ik as W,il as ys,aF as Ns,u as Oe,im as Ie,io as Cs,aV as ks,ip as ws,iq as As,ir as Ps,aI as we,aH as Ss,ct as $s,b2 as Ds,as as M,es as Ue,is as Me,b9 as de,b3 as Es,i as _s,it as Ls}from"./index-C2TCKJDP.js";import{C as Fs,A as Bs}from"./connect-menu-B9u86bb2.js";import{C as ne}from"./connector-page-shell-C23dWdKz.js";import{C as Rs}from"./connector-provenance-CW4CXtCz.js";import{R as Ks,D as ue}from"./detail-page-skeleton-BmxqqIsH.js";import{L as oe}from"./list-skeleton-bQAZ0hQp.js";import"./runs-B_iywKWb.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./runs-list-CJJFRhTl.js";import"./run-initiator-8vdkq-3o.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";function Os({ownerSlug:s,familyKind:t,familyId:a}){const n=t==="inference",o=Pe({enabled:n}),d=Se({enabled:n}),x=$e({enabled:!n}),c=n?o:x,l=n?d.data?.find(i=>i.slug===a)?.displayName??a:re(a),p=(n?(o.data??[]).filter(i=>i.kind===a).map(i=>({key:`${J}${i.slug}`,name:i.displayName||i.slug,status:[i.isDefault?"Default":null,i.status].filter(Boolean).join(" · ")})):(x.data?.sandboxes??[]).filter(i=>i.providerKind===a).map(i=>({key:`${Qe}${i.id}`,name:i.name,status:i.connected?"Connected":"Needs credentials"}))).map(i=>({id:i.key,name:i.name,description:i.status,tone:null,link:Ge({to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:i.key},search:{}})})),m=`${n?J:le}${a}`;return e.jsx(ne,{header:e.jsx(ee,{title:l,breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors")]})}),children:e.jsx(Ze,{entries:p,isLoading:c.isLoading,isError:c.isError,onRetry:()=>void c.refetch(),action:n?e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:m},search:{addAccount:!0},children:"Add connection"})}):e.jsx(De,{ownerSlug:s,connectorKey:m})})})}function Is({catalog:s,initialProvider:t,initialSlug:a,allowOAuth:n=!0,initialModel:o,onDone:d}){const x=Je(),c=es(),l=s.find(r=>r.slug===t)??s[0],p=n&&l&&Z(l)?"oauth":"api-key",[m,i]=u.useState(l?.slug??""),[f,N]=u.useState(a??l?.slug??""),[h,b]=u.useState(l?.displayName??""),[v,w]=u.useState(l?.baseUrl??""),[D,A]=u.useState(o??l?.defaultModel??""),[$,z]=u.useState(""),[X,B]=u.useState(l?.apiKeyPlaceholder??""),[V,K]=u.useState(p),[L,Y]=u.useState(""),[C,ae]=u.useState(null),[O,F]=u.useState(!1),[me,xe]=u.useState(!1),j=s.find(r=>r.slug===m),Q=ye(j?.modalities??[]),he=n&&!!j&&Z(j),pe=j?Ee(j):!1,ge=he&&V==="oauth",je=pe&&!ge,P=ss().slug,G=u.useCallback(()=>{xe(!0),c.invalidateQueries({queryKey:["inference-providers"]})},[c]),Te=u.useCallback(()=>{c.invalidateQueries({queryKey:["inference-providers"]}),d()},[c,d]),ze=u.useCallback(async()=>{if(!(!P||!j)){F(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="redirect")throw new Error("Unexpected sign-in mode");window.open(r.authorizeUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{F(!1)}}},[P,j]),Ve=u.useCallback(async()=>{if(!(!P||!j||!L.trim())){F(!0);try{const r=await Ce(P,j.slug,{code:L.trim()});if(r.status!=="success")throw new Error(r.error||"Sign-in not complete");G(),I.success(`Signed in with ${j.displayName}`)}catch(r){I.error(r instanceof Error?r.message:"Failed to complete sign-in")}finally{F(!1)}}},[P,j,L,G]),qe=u.useCallback(async()=>{if(!(!P||!j)){F(!0);try{const r=await Ne(P,j.slug);if(r.mode!=="device")throw new Error("Unexpected sign-in mode");ae({userCode:r.userCode,deviceAuthId:r.deviceAuthId,verificationUrl:r.verificationUrl}),window.open(r.verificationUrl,"_blank","noreferrer")}catch(r){I.error(r instanceof Error?r.message:"Failed to start sign-in")}finally{F(!1)}}},[P,j]),We=u.useCallback(async()=>{if(!(!P||!j||!C)){F(!0);try{const r=await Ce(P,j.slug,{deviceAuthId:C.deviceAuthId,userCode:C.userCode});if(r.status==="success"){G(),I.success(`Signed in with ${j.displayName}`);return}ae(y=>y&&{...y,message:r.error||"Waiting for approval..."})}catch(r){I.error(r instanceof Error?r.message:"Failed to check status")}finally{F(!1)}}},[P,j,C,G]),He=j?.supportedAuthTypes.includes("device-code")??!1,Xe=r=>{i(r);const y=s.find(ie=>ie.slug===r);y&&(N(y.slug),b(y.displayName),w(y.baseUrl),A(y.slug===t&&o?o:y.defaultModel??""),B(y.apiKeyPlaceholder),K(n&&Z(y)?"oauth":"api-key"),Y(""),ae(null),xe(!1))},fe=/^[a-z0-9][a-z0-9-]*$/.test(f),ve=fe&&je&&$.trim().length>0&&!x.isPending,Ye=r=>{if(r.preventDefault(),!ve)return;const y={};v.trim()&&(y.base_url=v.trim()),D.trim()&&(y.model=D.trim());const ie=Object.keys(y).length>0?{text:y}:void 0;x.mutate({slug:f.trim(),kind:m,displayName:h.trim()||void 0,apiKey:$.trim(),capabilities:ie},{onSuccess:()=>d()})},be=!!(t&&s.some(r=>r.slug===t));return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:be&&j?`Connect ${j.displayName}`:"Add an inference provider"}),e.jsxs("form",{onSubmit:Ye,className:"grid max-w-md gap-3",children:[be&&j?e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."}):e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-provider",children:"Provider"}),e.jsxs(ts,{value:m,onValueChange:Xe,children:[e.jsx(ns,{id:"ip-provider",className:"w-full",children:e.jsx(as,{})}),e.jsx(is,{children:s.map(r=>{const y=ye(r.modalities);return e.jsx(rs,{value:r.slug,children:e.jsxs("span",{className:"flex items-center gap-2",children:[r.iconUrl?e.jsx("img",{src:r.iconUrl,alt:"",className:"h-4 w-4 shrink-0 rounded-sm",loading:"lazy"}):e.jsx(os,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.displayName,y.length>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",y.join(", ")]}):null]})},r.slug)})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:Q.length>0?`Serves text, plus ${Q.join(", ").toLowerCase()}.`:"Serves text (chat)."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-display",children:"Name"}),e.jsx(S,{id:"ip-display",placeholder:"Friendly name",value:h,onChange:r=>b(r.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-slug",children:["Slug ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-slug",placeholder:"my-provider",value:f,onChange:r=>N(r.target.value),autoComplete:"off",required:!0}),f&&!fe?e.jsx("p",{className:"text-xs text-destructive",children:"Lowercase letters, numbers, and hyphens only."}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"A stable identifier agents reference this provider by."})]}),he&&pe?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{children:"Auth method"}),e.jsxs("div",{className:"inline-flex w-fit rounded-md border border-border p-1",children:[e.jsx(g,{type:"button",size:"sm",variant:V==="oauth"?"secondary":"ghost",onClick:()=>K("oauth"),children:"Sign in"}),e.jsx(g,{type:"button",size:"sm",variant:V==="api-key"?"secondary":"ghost",onClick:()=>K("api-key"),children:"API key"})]})]}):null,je?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-base-url",children:"Base URL"}),e.jsx(S,{id:"ip-base-url",placeholder:"https://api.example.com/v1",value:v,onChange:r=>w(r.target.value),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the upstream URL — e.g. a self-hosted vLLM, Azure, or LiteLLM endpoint."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-model",children:"Default model"}),e.jsx(S,{id:"ip-model",placeholder:"gpt-4o-mini",value:D,onChange:r=>A(r.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(k,{htmlFor:"ip-key",children:["API key ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"ip-key",type:"password",placeholder:X||void 0,value:$,onChange:r=>z(r.target.value),autoComplete:"off",required:!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored encrypted in the vault. It's never shown again — rotate it here if it changes."})]}),e.jsx(q,{onCancel:d,children:e.jsx(g,{type:"submit",disabled:!ve,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Creating..."]}):"Create provider"})})]}):ge?e.jsxs("div",{className:"grid gap-3",children:[me?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Signed in with ",j?.displayName??"provider",". This covers your agents in this org."]}):He?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void qe(),disabled:O||!P,children:C?"Get a new code":"Get device code"}),C?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-device-code",children:"Device code"}),e.jsx(S,{id:"ip-device-code",readOnly:!0,value:C.userCode}),e.jsx(g,{type:"button",variant:"default",className:"justify-self-start",asChild:!0,children:e.jsxs("a",{href:C.verificationUrl,target:"_blank",rel:"noreferrer",children:["Open ",j?.displayName??"provider"," to approve",e.jsx(ke,{className:"h-4 w-4"})]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:C.message||"We opened the approval page. Enter the code above if asked, approve, then check status."}),e.jsx(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void We(),disabled:O,children:O?"Checking...":"Check status"})]}):null]}):e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(g,{type:"button",variant:"outline",className:"justify-self-start",onClick:()=>void ze(),disabled:O||!P,children:["Sign in with ",j?.displayName??"provider",e.jsx(ke,{className:"h-4 w-4"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"ip-oauth-code",children:"Paste code#state"}),e.jsx(S,{id:"ip-oauth-code",placeholder:"code#state",value:L,onChange:r=>Y(r.target.value),autoComplete:"off"})]}),e.jsx(g,{type:"button",className:"justify-self-start",onClick:()=>void Ve(),disabled:O||!L.trim(),children:O?"Finishing...":"Finish sign-in"})]}),e.jsx(q,{onCancel:d,children:e.jsx(g,{type:"button",onClick:Te,disabled:!me,children:"Done"})})]}):e.jsxs("div",{className:"grid gap-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This provider cannot be added from the catalog yet."}),e.jsx(q,{onCancel:d})]})]})]})}const Us={text:"Text",image:"Image",stt:"Speech-to-text",tts:"Text-to-speech"};function Ms({provider:s,catalog:t,autoOpenEdit:a}){const n=ls(),[o,d]=u.useState(a?"edit":null),x=cs(s.kind,t);u.useEffect(()=>{a&&d("edit")},[a]);const l=(t.find(i=>i.slug===s.kind)?.modalities??["text"]).filter(i=>i!=="text"),p=x&&l.length>0,m=i=>d(f=>f===i?null:i);return e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:"Credential"}),e.jsxs("p",{className:"truncate text-[11px] text-muted-foreground",children:[s.slug,s.createdAt?` · created ${ds(s.createdAt)}`:""]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.isDefault?null:e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",disabled:n.isPending,onClick:()=>n.mutate({providerSlug:s.slug}),children:"Set as default"}),p?e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("capabilities"),children:"Configure"}):null,e.jsx(g,{variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>m("edit"),children:"Edit"})]})]}),o==="edit"?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsx(zs,{provider:s,supportsUpstreamConfig:x,onDone:()=>d(null)})}):null,o==="capabilities"&&p?e.jsx("div",{className:"border-t px-3 py-3",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Other modalities (optional)"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This provider's text base URL and model are set under Edit. Only set these if you want a modality routed to a different endpoint — otherwise it uses the provider's defaults."})]}),l.map(i=>e.jsx(Vs,{providerSlug:s.slug,modality:i,block:s.capabilities[i]??{}},i))]})}):null]})}function Ts({provider:s,onDeleted:t}){const a=us(),[n,o]=u.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:"Delete provider"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Removes ",s.displayName||s.slug," and its stored key from this workspace. Agents referencing it will need another connected provider before they can run."]}),e.jsx("div",{className:"mt-3",children:n?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({providerSlug:s.slug},{onSuccess:t,onSettled:()=>o(!1)}),children:[a.isPending?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(g,{variant:"ghost",size:"sm",disabled:a.isPending,onClick:()=>o(!1),children:"Cancel"})]}):e.jsxs(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",disabled:a.isPending,onClick:()=>o(!0),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete provider"]})})]})}function zs({provider:s,supportsUpstreamConfig:t,onDone:a}){const n=ms(),o=xs(),d=_e(),[x,c]=u.useState(s.displayName??""),[l,p]=u.useState(""),m=s.capabilities.text??{},[i,f]=u.useState(m.base_url??""),[N,h]=u.useState(m.model??""),[b,v]=u.useState(null),w=x.trim().length>0&&x.trim()!==(s.displayName??""),D=t&&l.trim().length>0,A=i.trim()!==(m.base_url??""),$=N.trim()!==(m.model??""),z=t&&(A||$),X={base_url:i.trim()||void 0,model:N.trim()||void 0,models_endpoint:m.models_endpoint},B=Le(X),V=t&&z&&Fe(B),K=n.isPending||o.isPending||d.isPending,L=(w||D||z)&&!V&&!K,Y=async C=>{if(C.preventDefault(),!!L){v(null);try{await Promise.all([w?n.mutateAsync({providerSlug:s.slug,displayName:x.trim()}):Promise.resolve(),z?d.mutateAsync({providerSlug:s.slug,modality:"text",block:X}):Promise.resolve(),D?o.mutateAsync({providerSlug:s.slug,value:l.trim()}):Promise.resolve()]),a()}catch{v("Some changes could not be saved. Review the fields and try again.")}}};return e.jsxs("form",{onSubmit:Y,className:"grid max-w-md gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-name-${s.slug}`,children:"Name"}),e.jsx(S,{id:`edit-name-${s.slug}`,value:x,onChange:C=>c(C.target.value),placeholder:s.slug}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["The slug (",e.jsx("code",{children:s.slug}),") is fixed — agents reference it."]})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-base-${s.slug}`,children:"Base URL"}),e.jsx(S,{id:`edit-base-${s.slug}`,placeholder:"https://api.example.com/v1",value:i,onChange:C=>f(C.target.value),autoComplete:"off"}),B.base_url?e.jsx("p",{className:"text-xs text-destructive",children:B.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-model-${s.slug}`,children:"Default model"}),e.jsx(S,{id:`edit-model-${s.slug}`,placeholder:"gpt-4o-mini",value:N,onChange:C=>h(C.target.value),autoComplete:"off"}),B.model?e.jsx("p",{className:"text-xs text-destructive",children:B.model}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`edit-key-${s.slug}`,children:"New API key"}),e.jsx(S,{id:`edit-key-${s.slug}`,type:"password",value:l,onChange:C=>p(C.target.value),autoComplete:"off",placeholder:"Leave blank to keep the current key"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a value only to replace the stored key. The old key is discarded."})]})]}):null,b?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:b}):null,e.jsx(q,{onCancel:a,children:e.jsx(g,{type:"submit",disabled:!L,children:K?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]})}function Vs({providerSlug:s,modality:t,block:a}){const n=_e(),[o,d]=u.useState(!1),[x,c]=u.useState(a.base_url??""),[l,p]=u.useState(a.model??""),[m,i]=u.useState(a.models_endpoint??""),[f,N]=u.useState(!!a.models_endpoint),h=!!(a.base_url||a.model||a.models_endpoint),b={base_url:x.trim()||void 0,model:l.trim()||void 0,models_endpoint:m.trim()||void 0},v=Le(b),w=Fe(v),D=()=>{w||n.mutate({providerSlug:s,modality:t,block:b})};return e.jsxs("div",{className:Be,children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-left",onClick:()=>d(A=>!A),children:[e.jsx("span",{className:"text-sm font-medium",children:Us[t]}),h?e.jsx(E,{variant:"outline",children:"Custom"}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Static"})]}),o?e.jsxs("div",{className:"grid gap-3 border-t px-3 py-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`base-${s}-${t}`,children:"Base URL"}),e.jsx(S,{id:`base-${s}-${t}`,placeholder:"https://api.example.com/v1",value:x,onChange:A=>c(A.target.value),autoComplete:"off"}),v.base_url?e.jsx("p",{className:"text-xs text-destructive",children:v.base_url}):null]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`model-${s}-${t}`,children:"Model"}),e.jsx(S,{id:`model-${s}-${t}`,placeholder:"gpt-4o-mini",value:l,onChange:A=>p(A.target.value),autoComplete:"off"}),v.model?e.jsx("p",{className:"text-xs text-destructive",children:v.model}):null]}),f?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:`endpoint-${s}-${t}`,children:"Models endpoint"}),e.jsx(S,{id:`endpoint-${s}-${t}`,placeholder:"/v1/models",value:m,onChange:A=>i(A.target.value),autoComplete:"off"}),v.models_endpoint?e.jsx("p",{className:"text-xs text-destructive",children:v.models_endpoint}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Path used to list this modality's models (e.g. /v1/models)."})]}):e.jsx("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground hover:text-foreground",onClick:()=>N(!0),children:"Advanced"}),e.jsx(q,{onCancel:()=>d(!1),children:e.jsx(g,{size:"sm",disabled:w||n.isPending,onClick:D,children:n.isPending?e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"lg",className:"mr-2"}),"Saving..."]}):"Save"})})]}):null]})}function qs({sandbox:s}){const t=Object.entries(s.details??{});return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Hs,{kind:s.providerKind}),e.jsx("span",{className:"text-sm font-medium",children:s.name}),e.jsx(E,{variant:"secondary",className:"h-4 px-1.5 py-0 text-[10px] uppercase tracking-wide",children:s.providerKind}),s.connected?e.jsx(E,{className:"h-4 border-transparent bg-emerald-500/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-emerald-500",children:"Connected"}):e.jsx(E,{variant:"destructive",className:"h-4 border-transparent bg-destructive/10 px-1.5 py-0 text-[10px] uppercase tracking-wide text-destructive",children:"No credential"})]}),t.length>0?e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:t.map(([a,n])=>`${a}: ${n}`).join(" | ")}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Remote sandbox agents execute in instead of the built-in local runtime."}),s.connected?null:e.jsxs("div",{className:"flex gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:[e.jsx(te,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"This sandbox has no vault credential. Delete it and re-add the provider with a valid key, or set the credential via the API."})]})]})})}function Ws({sandbox:s,onDeleted:t}){const a=hs(),[n,o]=u.useState(!1);return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-lg border border-destructive/30 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ce,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Remove sandbox"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Agents pinned to this runtime fall back to the built-in local sandbox."})]})]}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate({id:s.id},{onSuccess:t}),children:a.isPending?e.jsx(T,{}):"Delete permanently"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:"Cancel"})]}):e.jsx(g,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),children:"Delete sandbox"})]})})}function Hs({kind:s}){return s==="vercel"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 shrink-0 fill-foreground","aria-hidden":!0,children:[e.jsx("title",{children:"Vercel"}),e.jsx("path",{d:"M12 3 22 20H2L12 3Z"})]}):s==="builtin"?e.jsx(ps,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):e.jsx(gs,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}const Xs={data:!1,chat:!1,actions:!1,audience:!1,inference:!0,runtime:!1},Ys={data:!1,chat:!1,actions:!1,audience:!1,inference:!1,runtime:!0};function Nt(){const{owner:s,connectorKey:t}=W.useParams(),{instances:a}=W.useSearch(),{kind:n,id:o}=ys(t);return e.jsx(Ns,{owner:s,children:({ownerSlug:d,organizationId:x,isWorkspaceLoading:c})=>{if(a&&(n==="inference"||n==="sandbox-provider"))return e.jsx(Os,{ownerSlug:d,familyKind:n,familyId:o});switch(n){case"inference":return e.jsx(Zs,{ownerSlug:d,providerSlug:o});case"sandbox":return e.jsx(Gs,{ownerSlug:d,sandboxId:o});case"sandbox-provider":return e.jsx(Qs,{ownerSlug:d,providerKind:o});default:return e.jsx(tt,{ownerSlug:d,organizationId:x,isWorkspaceLoading:c,connectorKey:t})}}})}function Qs({ownerSlug:s,providerKind:t}){const a=H();return u.useEffect(()=>{a({to:"/$owner/connectors/create/$connectorKey",params:{owner:s,connectorKey:`${le}${t}`},replace:!0})},[a,s,t]),null}function Gs({ownerSlug:s,sandboxId:t}){const a=H(),{data:n,isLoading:o,isError:d,refetch:x}=$e(),c=n?.sandboxes.find(p=>p.id===t)??null;if(o)return e.jsx(ue,{label:"Loading sandbox",sections:1});if(d)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this instance."}),e.jsx(g,{variant:"outline",onClick:()=>void x(),children:"Retry"})]})});if(!c)return e.jsxs(M,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This sandbox isn't in this workspace, so its details aren't available."}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>void a({to:"/$owner/connectors",params:{owner:s}}),children:"Back to connectors"})]});const l=c.name||re(c.providerKind);return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${le}${c.providerKind}`},search:{instances:!0},className:U,children:re(c.providerKind)},"family")]}),icon:e.jsx(de,{name:l,faviconDomain:Es(c.providerKind)}),title:l,badge:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"secondary",children:c.providerKind}),c.connected?e.jsx(E,{className:"border-transparent bg-emerald-500/10 text-emerald-500",children:"Connected"}):e.jsx(E,{variant:"destructive",children:"No credential"})]}),status:e.jsx(Me,{facets:Ys})}),children:[e.jsx(qs,{sandbox:c}),e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ws,{sandbox:c,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})})]})})}function Zs({ownerSlug:s,providerSlug:t}){const a=H(),{model:n,reason:o,agentId:d,addAccount:x}=W.useSearch(),{data:c=[],isLoading:l,isError:p,refetch:m}=Pe(),i=Se(),{data:f=[],isLoading:N}=i,h=x?null:c.find($=>$.slug===t)??null,b=f.find($=>$.slug===(h?.kind??t))??null;if(l||N)return e.jsx(ue,{label:"Loading account"});if(p)return e.jsx(M,{children:e.jsxs("div",{role:"alert",children:[e.jsx("p",{children:"Could not load this account."}),e.jsx(g,{variant:"outline",onClick:()=>void m(),children:"Retry"})]})});if(!h&&!b&&!i.isError)return e.jsxs(M,{className:"space-y-3",children:[e.jsx(Ue,{connector:{key:t,name:t},showDescription:!1,className:"gap-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connector isn't installed in this workspace, so its details aren't available."})]});const v=h?h.displayName||h.slug:b?.displayName||t,w=h!==null,D=o?e.jsx(st,{agentId:d,model:n,providerName:v}):n?e.jsx(et,{providerName:v,model:n,isConnected:w}):null,A=e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:s},className:U,children:"Connectors"},"connectors"),...h?[e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${h.kind}`},search:{instances:!0},className:U,children:b?.displayName??h.kind},"family")]:[]]}),icon:e.jsx(de,{iconUrl:b?.iconUrl,name:v}),title:v,badge:h?e.jsxs(e.Fragment,{children:[h.isDefault?e.jsx(E,{variant:"secondary",children:"Default"}):null,h.status?e.jsx(E,{variant:"outline",children:h.status}):null,h.hasCustomUpstream?e.jsx(E,{variant:"outline",children:"Custom upstream"}):null]}):null,status:e.jsx(Me,{facets:Xs})});return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(ne,{header:A,children:[D,e.jsx("div",{className:"space-y-6",children:h?e.jsx(Ms,{provider:h,catalog:f,autoOpenEdit:!!n}):e.jsx(Js,{ownerSlug:s,providerSlug:t,existingSlugs:c.map($=>$.slug),catalog:f,catalogError:i.isError?i.error:null,model:n})}),h?e.jsx(R,{title:"Settings",muted:!0,children:e.jsx(Ts,{provider:h,onDeleted:()=>void a({to:"/$owner/connectors",params:{owner:s}})})}):null]})})}function Js({ownerSlug:s,providerSlug:t,existingSlugs:a,catalog:n,catalogError:o,model:d}){const x=H(),c=n.find(m=>m.slug===t),l=a.includes(t)&&!!c&&Z(c);let p=t;for(let m=2;a.includes(p);m++)p=`${t}-${m}`;return o?e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(te,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Failed to load provider catalog."}),e.jsx("p",{className:"mt-1 text-xs",children:o instanceof Error?o.message:"Check the workspace URL and try again."})]})]})}):e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[l&&e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Subscription sign-in is managed on the existing connection."}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors/$connectorKey",params:{owner:s,connectorKey:`${J}${t}`},search:{},children:"Open existing connection"})})]}),(!l||c&&Ee(c))&&e.jsx(Is,{catalog:n,initialProvider:t,initialSlug:p,allowOAuth:!l,initialModel:d?.includes("/")?d.split("/").slice(1).join("/"):d,onDone:()=>void x({to:"/$owner/connectors",params:{owner:s}})},`${n.length}:${t}`)]})}function et({providerName:s,model:t,isConnected:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(te,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review ",e.jsx("strong",{children:s})," for model"," ",e.jsx("strong",{children:t}),"."," ",a?"Its edit controls are open.":"It is not connected yet; add it to continue."]})]})})}function st({agentId:s,model:t,providerName:a}){return e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(te,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"This agent needs a model provider before it can reply."}),e.jsxs("p",{children:[s?e.jsxs("span",{children:["Agent ",e.jsx("strong",{children:s})," is"," "]}):null,"configured to use ",t?e.jsx("strong",{children:t}):"a model"," ","from ",e.jsx("strong",{children:a}),", but that provider is not ready in this workspace."]}),e.jsx("p",{children:"Connect the provider below, then retry the message."})]})]})})}function tt({ownerSlug:s,organizationId:t,isWorkspaceLoading:a,connectorKey:n}){const{data:o=[],isLoading:d,isError:x,refetch:c}=Ss(t??""),{data:l=[],isLoading:p,isError:m,refetch:i}=$s(t??"",{connectorKey:n}),{setup:f}=W.useSearch(),N=W.useNavigate(),h=u.useMemo(()=>o.find(w=>w.key===n),[o,n]),b=u.useMemo(()=>Ds(n,o,{name:l[0]?.connector_name??n}),[n,o,l]);if(a||d)return e.jsx(ue,{label:"Loading connector",sections:3});if(x||m)return e.jsx(M,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this connector."}),e.jsx(g,{variant:"outline",onClick:()=>{c(),i()},children:"Retry"})]})});const v=h?e.jsx(at,{connector:h,ownerSlug:s,organizationId:t??void 0,connectionCount:l.length}):e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ue,{connector:b,showDescription:!1,className:"gap-2"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This connector isn't installed in this workspace, so its details aren't available.",l.length>0?" Existing connections keep working.":""]})]});return e.jsx("div",{className:"flex flex-1 flex-col",children:h&&t?e.jsx(nt,{hero:v,connector:h,organizationId:t,ownerSlug:s,connectorKey:n,connections:l,isLoading:p,openNewApp:f==="oauth_app",onNewAppHandled:()=>void N({search:w=>({...w,setup:void 0}),replace:!0})}):e.jsxs(M,{className:"space-y-6",children:[v,l.length>0&&!p?e.jsx(Ke,{section:!0,connections:l,ownerSlug:s,connectorKey:n}):p?e.jsx(oe,{label:"Loading connections",rows:2}):e.jsx("div",{children:e.jsx(De,{ownerSlug:s,connectorKey:n})})]})})}function nt({hero:s,connector:t,organizationId:a,ownerSlug:n,connectorKey:o,connections:d,isLoading:x,openNewApp:c,onNewAppHandled:l}){const{isAdmin:p,isLoading:m}=Re(a),i=(t.operations_summary?.total??0)>0,f=e.jsx(Fs,{connector:t,organizationId:a,ownerSlug:n,connections:d,openNewApp:c,onNewAppHandled:l});return e.jsxs(ne,{header:s,children:[x?e.jsx(oe,{label:"Loading connections",rows:2}):d.length>0?e.jsx(Ke,{section:!0,connections:d,connector:t,ownerSlug:n,connectorKey:o,action:f}):f,e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:auto-cols-fr sm:grid-flow-col",children:[e.jsx(lt,{connector:t,organizationId:a,ownerSlug:n}),i&&m?e.jsx(oe,{label:"Loading actions",rows:2}):i&&p?e.jsx(ot,{connector:t,organizationId:a,ownerSlug:n}):i&&!p?e.jsx(R,{title:"Actions",muted:!0,children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Only workspace admins can view and configure connector actions."})}):null]}),d.length>0?e.jsx(R,{title:"Runs",children:e.jsx(Ks,{scope:{connectorKey:o},ownerSlug:n})}):null,e.jsx(it,{connector:t,organizationId:a,ownerSlug:n})]})}function at({connector:s,ownerSlug:t,organizationId:a,connectionCount:n}){return e.jsx(ee,{breadcrumb:e.jsx(se,{crumbs:[e.jsx(_,{to:"/$owner/connectors",params:{owner:t},className:U,children:"Connectors"},"connectors")]}),icon:e.jsx(de,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??Ls(s.auth_schema),className:"h-10 w-10"}),title:s.name,badge:e.jsxs(e.Fragment,{children:[e.jsx(Rs,{connectorDef:s,ownerSlug:t}),a?e.jsx(rt,{connector:s,organizationId:a,ownerSlug:t,connectionCount:n}):null]}),caption:s.description})}function it({connector:s,organizationId:t,ownerSlug:a}){const n=Cs(s.auth_schema),o=ks(s.auth_schema),d=ws(s.auth_schema),x=As(s.auth_schema),c=n.some(b=>b.type==="env_keys"),l=n.some(b=>b.type==="browser"),p=o.some(b=>b.type==="interactive"),m=!!(d||x||c||l),i=Ps(s),{data:f=[]}=we(t,{connectorKey:s.key,profileKind:"env"}),{data:N=[]}=we(t,{profileKind:"browser_session",connectorKey:s.key});return c&&f.length>0||l&&N.length>0||!m&&(i||p)?e.jsxs("div",{className:"space-y-6",children:[c&&f.length>0?e.jsx(Ae,{profiles:f,type:"env"}):null,l&&N.length>0?e.jsx(Ae,{profiles:N,type:"browser_session"}):null,m?null:i?e.jsx(R,{title:"Device runtime",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," runs on a linked device — there are no workspace credentials to configure here. Pair a device, then create a connection pinned to it."]}),e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(_,{to:"/$owner/connectors",params:{owner:a},search:{},children:"View devices"})})]})}):p?e.jsx(R,{title:"Authentication",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.name," pairs when you create a connection — there is no workspace-level credential to configure here."]})}):null]}):null}function rt({connector:s,organizationId:t,ownerSlug:a,connectionCount:n}){const o=H(),{isAdmin:d}=Re(t),x=js(),[c,l]=u.useState(null),p=s.installed!==!1;if(!d||!p)return null;const m=n>0,i=x.isPending,f=()=>{l(null),x.mutate({connector_key:s.key},{onSuccess:()=>{o({to:"/$owner/connectors",params:{owner:a}})},onError:N=>{l(N instanceof Error?N.message:"Failed to remove connector")}})};return e.jsxs(fs,{onOpenChange:()=>l(null),children:[e.jsx(vs,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive","aria-label":"Remove connector",title:"Remove connector",children:e.jsx(ce,{className:"h-3.5 w-3.5"})})}),e.jsxs(bs,{align:"start",className:"space-y-3",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Remove ",s.name,"?"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Archives it in this workspace. Existing synced data stays in memory."}),m?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Delete"," ",e.jsxs("span",{className:"font-medium text-foreground",children:[n," connection",n===1?"":"s"]})," ","first — uninstall is blocked while any connection still references this connector."]}):null,c?e.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}):null,e.jsxs(g,{variant:"destructive",size:"sm",disabled:i||m,onClick:f,children:[i?e.jsx(T,{size:"md",className:"mr-1.5"}):null,"Remove connector"]})]})]})}function ot({connector:s,organizationId:t,ownerSlug:a}){const n=Oe();return e.jsx(Ie,{title:"Actions",summary:`${s.operations_summary?.total??0} actions · organization policies`,onOpen:()=>n?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectorKey:s.key,organizationId:t,ownerSlug:a}})})}function Ae({profiles:s,type:t}){const a=t==="env"?"Credentials":"Browser sessions";return e.jsx(R,{title:a,children:e.jsx("div",{className:"space-y-2",children:s.map(n=>e.jsxs("div",{className:_s(Be,"p-3"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:n.display_name}),e.jsx(Bs,{status:n.status})]}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.slug})]},n.slug))})})}function lt({connector:s,organizationId:t,ownerSlug:a}){const n=Oe(),o=Object.keys(s.feeds_schema??{}).length;return o?e.jsx(Ie,{title:"Feeds",summary:`${o} ${o===1?"feed type":"feed types"}`,onOpen:()=>n?.open({href:"",title:"Feeds",connectorPanel:{section:"feeds",connectorKey:s.key,organizationId:t,ownerSlug:a}})}):null}export{nt as ConnectorDetailShell,rt as ConnectorRemoveButton,Nt as component};
|
|
2
|
-
//# sourceMappingURL=_connectorKey.index-DM5MTO8c.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{M as u,c as v,j as r,ar as d,aF as f,c8 as x,c9 as h,ca as w,bf as P,cb as j}from"./index-C2TCKJDP.js";import{E as g}from"./event-detail-CvaRN1qB.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./subDays-DwIOMzYC.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./filter-editors-DQ5V4Cvh.js";function E({owner:e,eventId:t,viewKey:s}){const o=u({strict:!1}),p=v(),m=(i,a)=>r.jsx(g,{owner:a,organizationId:i,eventId:t,viewKey:s,params:s?h(o):{},onParamsChange:(n,c,l)=>void p({to:x(a,t,n),search:c,replace:l?.replace??!0}),fullBleed:!0},`${a}/${t}`);return r.jsx(d,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):r.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):r.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function J(){const{owner:e,eventId:t}=w.useParams(),s=P({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(t);return o===null?null:r.jsx(E,{owner:e,eventId:o,viewKey:s?.viewKey})}export{J as component};
|
|
2
|
-
//# sourceMappingURL=_eventId-CfB0_2zK.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-B29OcHwm.js","assets/index-C2TCKJDP.js","assets/index-xAvK3IyQ.css","assets/automation-detail-content-BJwRU6qT.js","assets/event-detail-CvaRN1qB.js","assets/events-feed-DwOkLk6A.js","assets/definition-comparison-3zKUSTt8.js","assets/json-diff-CJK-gzCt.js","assets/code-editor-UppEMWpt.js","assets/index-Vcq4gwWv.js","assets/schema-value-CefbtPIY.js","assets/run-initiator-8vdkq-3o.js","assets/list-skeleton-bQAZ0hQp.js","assets/subDays-DwIOMzYC.js","assets/use-automations-lV8PuE8L.js","assets/clients-CydgUHrc.js","assets/renderer-ucwCQmBk.js","assets/card-rE4Ctuy6.js","assets/table-1O-ik4_O.js","assets/copy-button-1ALlvZU1.js","assets/device-automation-Dp3faMvp.js","assets/view-param-filters-Bp84PUMd.js","assets/app-bridge-C4nPtae3.js","assets/filter-editors-DQ5V4Cvh.js","assets/home-stream-Bg97PUBJ.js","assets/client-activity-scopes-B7xVaUA-.js","assets/client-rows-B3LULJxW.js","assets/home-toolbar-CpCcHA6z.js","assets/scoped-feed-bar-CapleZvS.js","assets/event-kind-options-fHAIXu24.js","assets/create-automation-form-BhujNbRr.js","assets/entity-options-IUdQ-64R.js","assets/model-selector-BrfaDwIg.js","assets/skill-editor-D_W3QlRz.js","assets/use-mention-search-CA-evCDf.js","assets/proposal-review-shell-BVwOMoq9.js","assets/runs-B_iywKWb.js","assets/runs-list-CJJFRhTl.js","assets/agent-loading-shells-BupiSjR-.js","assets/agent-thread-DiVKn1WX.js","assets/pending-seed-DYYOoCvj.js","assets/connection-feed-detail-CJYqryAV.js","assets/status-variants-BxHtpMOj.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-B9u86bb2.js","assets/source-record-panels-LJIWGtHb.js","assets/schema-type-editor-panel-C4e8pq1A.js","assets/entity-type-page-CouHZbc9.js","assets/views-access-required-BerT4Z1d.js","assets/dynamic-schema-form-D3KnzCsW.js","assets/record-session-KuEDuF3S.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{p as h,j as t,r as p,C as P,L as k,u as v,a as I,b as R,c as S,d as C,D as A,e as _,f as D,g as E,h as $,i as y,B as x,k as L,S as K,A as z,X as T,l as O,_ as B,m as g,n as N,o as W,q as U,s as H,t as F,v as V,w as q,x as G,R as M,y as Q,z as X,E as J,F as Y,N as Z,O as ee}from"./index-C2TCKJDP.js";import{R as ne}from"./record-session-KuEDuF3S.js";import{u as te}from"./use-automations-lV8PuE8L.js";import{u as ae}from"./clients-CydgUHrc.js";function j({item:e}){const n=e.href?h(e.href):null;if(!n||n.kind==="event"||n.kind==="automation"&&!("runId"in n&&n.runId!=null))return null;const a=n.owner,o=n.kind==="automation"?n.automationId:e.sourceAttribution?.automation_id??null,i=e.sourceAttribution,s=[{label:a,to:"/$owner",params:{owner:a}}];return i?.agent_id&&i.agent_name&&s.push({label:i.agent_name,to:"/$owner/agents/$agentId",params:{owner:a,agentId:i.agent_id}}),o!=null&&s.push({label:i?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:a,automationId:String(o)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?s.push({label:"Run details"}):n.kind==="memory"&&"contentIds"in n&&s.push({label:"Details"}),s.length<2?null:t.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:s.map((r,u)=>{const c=u===s.length-1,f=t.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:r.label});return t.jsxs(p.Fragment,{children:[u>0?t.jsx(P,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,r.to&&!c?t.jsx(k,{to:r.to,params:r.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:r.label}):f]},r.to??r.label)})})}const se=O(async()=>({default:(await B(async()=>{const{PeekPaneContent:e}=await import("./peek-pane-content-B29OcHwm.js");return{PeekPaneContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))).PeekPaneContent}));function oe(){return t.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[t.jsx(g,{className:"h-5 w-2/3"}),t.jsx(g,{className:"h-4 w-full"}),t.jsx(g,{className:"h-24 w-full rounded-lg"})]})}const re=460,ie=480;function le({children:e}){const n=p.useRef(null),a=v(),o=I(),i=R(n,re+ie),s=!o&&i&&a?.item!=null;return t.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[t.jsx("div",{inert:s,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e}),t.jsx(ue,{covers:s})]})}function ue({covers:e=!1}){const n=v(),a=I();return n?.item?t.jsx(xe,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:a,covers:e}):null}function w({item:e,children:n}){const a=e.href?h(e.href):null;return a?.kind==="automation"&&a.runId==null&&!e.runId?t.jsx(fe,{owner:a.owner,automationId:a.automationId,fallback:e.title,children:n}):a?.kind==="agent"?t.jsx(he,{agentId:a.agentId,clientIds:a.clientIds,fallback:e.title,children:n}):a?.kind==="event"?t.jsx(ce,{owner:a.owner,eventId:a.eventId,fallback:e.title,children:n}):t.jsx(de,{item:e,children:n})}function ce({owner:e,eventId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=F(i?.id??null,void 0,{contentIds:[n]},e),r=s?.pages[0]?.content.find(u=>Number(u.id)===n);return o({title:r?V(r):a,status:null})}function de({item:e,children:n}){const a=e.href?h(e.href):null,o=a?.kind==="record-view"?a.viewKey:null,i=a?.kind==="entity-type"?a:null,s=i?.typeSlug??null,r=q({slug:o?a?.owner:void 0}),{data:u}=G(s?a?.owner??null:null),c=s?u?.find(f=>f.slug===s)?.name:void 0;return n({title:o&&r.data?.find(f=>f.key===o)?.name||c&&(i?.view==="activity"?`${c} activity`:c)||e.title,status:null})}function fe({owner:e,automationId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=te(i?.id,void 0,{includeDetails:!1}),r=s?.find(u=>u.automation_id===n);return o({title:r?.name?.trim()||a,status:r?W(U(r),Date.now()):null})}function he({agentId:e,clientIds:n,fallback:a,children:o}){const i=H({enabled:!!e}),s=ae(null,{enabled:!e&&!!n?.length}),r=e?i.data?.find(u=>u.agentId===e)?.name:s.data?.find(u=>n?.includes(u.id))?.title;return o({title:r?.trim()||a,status:null})}function me(e){const n=e.connectorPanel;if(n?.connectionId!=null)return{label:"Settings",pathname:`/${n.ownerSlug}/connectors/${encodeURIComponent(n.connectorKey)}/${n.connectionId}`,search:{settings:!0}};const a=e.href?h(e.href):null;if(a?.kind==="automation"&&a.runId==null&&!e.runId)return{label:"Edit",pathname:`/${a.owner}/automations/${encodeURIComponent(a.automationId)}`,search:{view:"definition"}};if(a?.kind==="agent"&&a.owner!=="me"){if(a.agentId)return{label:"Agent settings",pathname:`/${a.owner}/agents/${encodeURIComponent(a.agentId)}`};const o=a.clientIds?.[0];if(o)return{label:"Agent settings",pathname:`/${a.owner}/agents/connected/${encodeURIComponent(o)}`}}return null}function xe({item:e,onClose:n,onBack:a,isNarrow:o,covers:i}){const s=S(),r=e.href?h(e.href):null,u=e.runId&&r?.kind==="automation"&&r.view==="activity"?{pathname:`/${r.owner}/events`,search:{run_ids:String(e.runId)}}:e.href?C(e.href):null,c=me(e);p.useEffect(()=>{if(o)return;const d=l=>{l.defaultPrevented||l.key!=="Escape"||(l.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,o]);const f=d=>t.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-1 border-b border-border px-3 py-1.5",children:[a||d?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:a??n,children:t.jsx(L,{className:"h-4 w-4"})}):null,t.jsx(w,{item:e,children:({title:l,status:m})=>t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:l}),m?t.jsx("p",{title:m.text,className:y("truncate text-xs",m.problem?"text-destructive":"text-muted-foreground"),children:m.text}):null]})}),c?t.jsx(x,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",children:t.jsxs(k,{to:c.pathname,search:c.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:c.pathname,search:c.search??{}})))())},children:[t.jsx(K,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),c.label]})}):null,u?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:t.jsx(k,{to:u.pathname,search:u.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:u.pathname,search:u.search??{}})))())},children:t.jsx(z,{className:"h-4 w-4"})})}):null,t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:t.jsx(T,{className:"h-4 w-4"})})]}),b=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(p.Suspense,{fallback:t.jsx(oe,{}),children:t.jsx(w,{item:e,children:({title:d})=>t.jsx(se,{item:d===e.title?e:{...e,title:d}})})})});return o?t.jsx(A,{open:!0,onOpenChange:d=>{d||n()},children:t.jsxs(_,{children:[t.jsx(D,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),t.jsxs(E,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[t.jsx($,{className:"sr-only",children:t.jsx(w,{item:e,children:({title:d})=>d})}),f(!0),t.jsx(j,{item:e}),b]})]})}):t.jsxs("aside",{className:y("flex flex-col border-l border-border bg-background",i?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),t.jsx(j,{item:e}),b]})}function be(){const{owner:e}=M.useParams(),{data:n,isLoading:a,error:o}=Q(e==="me"?null:e,{slug:e}),{session:i,isReady:s}=X();return J({active:Y({settled:!a,authReady:s,session:i,resolved:!!n?.workspace,error:o}),owner:e})?null:t.jsx(Z,{children:t.jsx(ne,{children:t.jsx(le,{children:t.jsx(ee,{})})})})}export{be as component};
|
|
3
|
-
//# sourceMappingURL=_owner-BDvTUY0a.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jt as p,j as m,be as i}from"./index-C2TCKJDP.js";import{M as e}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function q(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{q as component};
|
|
2
|
-
//# sourceMappingURL=_shape-BZidoJMB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cq as l,G as y,c,cr as d,cs as g,j as t,ar as u,as as x,bH as E}from"./index-C2TCKJDP.js";import{E as f}from"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";function b(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=y(),o=c(),{data:i=[],isLoading:r}=d(s),e=i.find(m=>m.slug===n)??null,p=e?g(e):!1;return t.jsx(u,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(x,{children:r?t.jsx(E,{label:"entity type",variant:"panel"}):e?t.jsx(f,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
|
|
2
|
-
//# sourceMappingURL=_slug-R989vOiM.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ju as t,j as m}from"./index-C2TCKJDP.js";import{M as i}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function V(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{V as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-BDUSrpe5.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jD as p,j as i,be as m}from"./index-C2TCKJDP.js";import{M as e}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function K(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{K as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-BnFqh5-t.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{z as l,ap as u,r as c,$ as m,j as e,aq as d,ad as h,an as f}from"./index-C2TCKJDP.js";import{S as v,A as x,a as g}from"./index-DXfYVs5m.js";import{F as p}from"./full-page-spinner-B7A6Ycyi.js";function j({alt:t="",...a}){return e.jsx("img",{alt:t,...a,referrerPolicy:"no-referrer"})}function w({children:t}){const a=h(),n=async i=>{await a.invalidateQueries({queryKey:["organizations"]}),i()};return e.jsx(g,{authClient:f,navigate:i=>{n(()=>{window.location.href=i})},replace:i=>{n(()=>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:a}=l(),{invitationId:n}=u.useSearch(),i=c.useRef(!1);return c.useEffect(()=>{a.isPending||t||!n||i.current||(i.current=!0,(async()=>{let s=null;try{const o=await fetch(`${m}/api/invitation-preview?id=${encodeURIComponent(n)}`,{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(n)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[t,a.isPending,n]),t&&!n?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(v,{children:e.jsx(x,{})})})]}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{b as component};
|
|
2
|
-
//# sourceMappingURL=accept-invitation-BC-ZIsrf.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as B,n as H,ce as I,be as y,cf as _,r as z,c as N,ax as G,cg as V,j as t,bH as Y,b0 as b,ch as K,ci as U,cj as q,ck as P,B as m,L as w,cl as D,cm as J,cn as Q,co as X,cp as Z,H as tt,ar as et,aF as nt,as as st}from"./index-C2TCKJDP.js";import{R as ot,E as at,S as it,N as R,M as rt}from"./record-activity-BCpNKaUo.js";import{M as ct}from"./member-scope-gate-Doic_6qX.js";import{H as lt}from"./home-toolbar-CpCcHA6z.js";import{H as dt}from"./home-stream-Bg97PUBJ.js";import{P as ut}from"./public-shell-ready-BbjPgh3k.js";function mt({organizationId:n,ownerSlug:e,typeScope:a,entityScope:s,attentionOnly:r=!1}){const{orgContext:c}=B(),{isMember:l,isLoading:x}=H(),h=l&&!!n,{attentionItems:p,isError:g}=I(e),o=a?y(a):void 0,i=!s&&!o,{feeds:k,rows:A,pageRows:d}=_(n,p),L=z.useMemo(()=>new Set(d.flatMap(({item:C})=>C.approvalRunId!=null?[C.approvalRunId]:[])),[d]),O=N(),M=()=>void O({to:"/$owner",params:{owner:e},search:{attention:"1"}}),{data:f,isLoading:v,error:T}=G(s?`/${e}/${V(s)}`:`/${e}`,c),j=s?f?.entity:void 0,$=(s?j?.entity_type??y(s.split("/").at(-2)??""):o)==="$member",W=s!=null&&!v&&(T!=null||f?.entity==null),u=s?void 0:f?.counts,F=u?u.connections>0||u.agents>0:!1,S=h&&!x&&!v&&u!=null&&!F,E=s&&v?t.jsx(Y,{label:"Loading record…"}):W?t.jsx(b,{icon:K,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):r&&i?t.jsx(xt,{owner:e,items:A,isError:g}):j?t.jsx(ot,{ownerSlug:e,entity:j,organizationId:n}):t.jsx(at,{organizationId:n,ownerSlug:e,hideSourceFilter:!0,scopedEntityTypes:o?[o]:void 0,pinned:i&&(d.length>0||k.length>0)?{rows:t.jsx(U,{owner:e,organizationId:n,feeds:k,rows:d}),hiddenApprovalRunIds:L}:void 0,onShowNotifications:i?M:void 0,toolbar:{leading:null,trailing:t.jsx(lt,{owner:e,mode:"activity"})},emptyState:S?t.jsx(pt,{ownerSlug:e}):void 0});return t.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:$?t.jsx(ct,{children:E}):E})}function xt({owner:n,items:e,isError:a}){const s=N();return t.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[t.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:e.length>0?`${e.length} ${e.length===1?"notification":"notifications"}`:null}),t.jsx(ht,{owner:n}),t.jsx(it,{value:R.value,withNotifications:!0,onChange:r=>{if(r===R.value)return;const[c,l]=r.split("-");s({to:"/$owner",params:{owner:n},search:q({sortBy:c,sortOrder:l})})}})]}),a?t.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):e.length===0?t.jsx(b,{icon:P,title:"All caught up",description:"Nothing needs you right now.",children:t.jsx(m,{asChild:!0,variant:"outline",className:"mt-4",children:t.jsx(w,{to:"/$owner",params:{owner:n},children:"See all activity"})})}):t.jsx(D,{owner:n,rows:e})]})}function ht({owner:n}){const{visibleUnreadIds:e,markVisibleRead:a,bulkPending:s}=I(n);return e.length===0?null:t.jsxs(m,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:s,onClick:()=>void a(),children:[t.jsx(P,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function pt({ownerSlug:n}){return t.jsx("div",{className:"px-6",children:t.jsx(b,{icon:J,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:t.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[t.jsx(m,{asChild:!0,children:t.jsxs(w,{to:"/$owner/connectors/create",params:{owner:n},children:[t.jsx(Q,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),t.jsx(m,{asChild:!0,variant:"outline",children:t.jsxs(w,{to:"/$owner/agents/connect",params:{owner:n},children:[t.jsx(X,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}function bt({owner:n,search:e,entityScope:a,home:s=!1}){const r=typeof e.type=="string"&&e.type.trim()?y(e.type.trim()):void 0,c=String(e.attention)==="1",l=e.section==="automation"||e.section==="connection"||e.section==="agent"?e.section:void 0,x=Object.entries(e).some(([o,i])=>(Z.includes(o)||o.startsWith("clf_"))&&i!=null&&i!==""),h=N(),{pathname:p}=tt(),g=o=>{h({to:p,search:(i=>({...i,attention:o?"1":void 0})),replace:!0})};return t.jsxs(et,{className:"gap-6 pt-2.5 pb-8",children:[t.jsx(ut,{}),t.jsx(nt,{owner:n,children:o=>t.jsx(rt,{organizationId:o.organizationId,isWorkspaceLoading:o.isWorkspaceLoading,children:t.jsx(st,{wide:s,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:s&&!x&&!r&&!a?t.jsx(dt,{owner:o.ownerSlug,organizationId:o.organizationId,needsYou:c,onNeedsYouChange:g,section:l}):t.jsx(mt,{organizationId:o.organizationId,ownerSlug:o.ownerSlug,typeScope:r,entityScope:a,attentionOnly:c})})})})]})}export{bt as A};
|
|
2
|
-
//# sourceMappingURL=activity-route-view-CN2dOiCD.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{j as t,L as h,em as f,$,ar as C,as as A,cu as M,cv as R,b1 as O,cw as S,cx as _,y as U,r as E,hV as u,B as v,A as y}from"./index-C2TCKJDP.js";import{C as B}from"./connector-page-shell-C23dWdKz.js";import{C as g}from"./copy-button-1ALlvZU1.js";import{u as G}from"./clients-CydgUHrc.js";import{g as H,c as D}from"./client-rows-B3LULJxW.js";const F="https://raw.githubusercontent.com/lobu-ai/lobu/main/claude-plugin/skills/lobu/SKILL.md";function d(e){try{const a=new URL(e).hostname;return a==="lobu.ai"||a.endsWith(".lobu.ai")}catch{return!1}}function x(e,a){const n=`npx @lobu/cli@latest connect ${e}`;return d(a)?n:`${n} --url ${a}`}function b(e,a){return`npx @lobu/cli@latest connect ${e} --url ${a}`}const N={label:"Lobu MCP reference",href:"https://lobu.ai/reference/mcp/"};function P(e){return[`Paste the prompt into ${e} and review its proposed setup.`,"Approve Lobu sign-in in your browser or through the email approval link.",`Let ${e} verify access with a harmless read in this workspace.`]}const L=[{id:"claude",label:"Claude",tagline:"Web, desktop, and coding agent for one workspace",description:"Claude web, desktop, and Code apps for this workspace.",installTitle:"Add in one click, or run in your terminal",installLink:e=>({label:"Add Lobu to Claude",href:`https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Lobu&connectorUrl=${encodeURIComponent(e)}`}),installText:e=>x("claude-code",e),promptUrl:e=>`https://claude.ai/new?q=${encodeURIComponent(e)}`,steps:e=>["Claude: open the Add to Claude link above and complete sign-in.",...d(e)?["The CLI adds Lobu's marketplace and installs the shared plugin."]:["The CLI registers this MCP endpoint and installs the Lobu workspace skill."],"Start a fresh Claude Code session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"Claude setup guide",href:"https://lobu.ai/connect-from/claude/"},{label:"Claude Code setup guide",href:"https://lobu.ai/connect-from/claude-code/"}]},{id:"chatgpt",label:"ChatGPT & Codex",tagline:"Web connector and coding agent for one workspace",description:"ChatGPT web connector and Codex coding agent for this workspace.",installTitle:"Pick a surface",installLink:e=>d(e)?{label:"Use Lobu in ChatGPT",href:"https://chatgpt.com/plugins/plugin_asdk_app_6a73b856e4348191a97dc8e3a1e58a94"}:null,promptUrl:e=>`https://chatgpt.com/?q=${encodeURIComponent(e)}`,installText:e=>d(e)?x("codex",e):["ChatGPT web — open Settings -> Connectors -> Create connector","Name: Lobu",`MCP URL: ${e}`,"Authentication: OAuth","",`Codex — ${x("codex",e)}`].join(`
|
|
2
|
-
`),steps:e=>d(e)?["ChatGPT web: open the Lobu listing above and complete sign-in.","Codex: run the command above — the CLI adds Lobu's marketplace and installs the shared plugin.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."]:["Codex: run the command above — the CLI registers this MCP endpoint and installs the Lobu workspace skill.","Codex: start a fresh session, choose this workspace, and complete OAuth when prompted."],guideLinks:[{label:"ChatGPT setup guide",href:"https://lobu.ai/connect-from/chatgpt/"},{label:"Codex setup guide",href:"https://lobu.ai/connect-from/codex/"}]},{id:"opencode",label:"OpenCode",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect OpenCode through its native MCP setup and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>b("opencode",e),steps:e=>[`The CLI launches OpenCode's native MCP setup for ${e}.`,"Choose remote and name the server lobu.","Run opencode mcp auth lobu and complete OAuth.","The CLI installs the Lobu skill into OpenCode's global skill directory.","Start a fresh OpenCode session."],guideLinks:[{label:"OpenCode MCP guide",href:"https://opencode.ai/docs/mcp-servers/"}]},{id:"antigravity",label:"Antigravity CLI",tagline:"Native remote MCP plus a global Lobu skill",description:"Connect Antigravity CLI through its native MCP profile and install the Lobu workspace skill globally.",installTitle:"Run in your terminal",installText:e=>b("antigravity",e),steps:()=>["The CLI adds Lobu to Antigravity's global MCP profile using serverUrl.","The CLI installs lobu.md into Antigravity CLI's global skills directory.","Start a fresh session with agy, confirm Lobu in /mcp, and complete OAuth when prompted."],guideLinks:[{label:"Antigravity MCP guide",href:"https://antigravity.google/docs/mcp"}]},{id:"cursor",label:"Cursor",tagline:"Native remote MCP setup",description:"Connect Cursor to shared workspace context and governed actions through its native MCP configuration.",installTitle:"Run in your terminal",installText:e=>b("cursor",e),steps:()=>["The CLI adds or updates the Lobu entry in Cursor's MCP configuration.","Restart Cursor and enable the Lobu MCP server.","Use a Lobu tool and complete OAuth when prompted."],guideLinks:[N]},{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:()=>P("OpenClaw"),guideLinks:[{label:"OpenClaw terminal guide",href:"https://docs.openclaw.ai/tools/exec"}]},{id:"hermes",label:"Hermes",tagline:"Remote MCP or Lobu CLI sign-in",description:"Let Hermes configure Lobu with its MCP tools or sign in with the Lobu CLI in its terminal.",installTitle:"Paste this into Hermes",setupMode:"agent-prompt",terminalLogin:!0,steps:()=>P("Hermes"),guideLinks:[{label:"Hermes MCP guide",href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp/"}]},{id:"other",label:"Not listed here",tagline:"Let your agent configure Lobu",description:"Paste a setup prompt into another MCP-compatible agent and let it propose the exact skill and MCP configuration.",installTitle:"Paste this into your agent",setupMode:"agent-prompt",steps:()=>["Paste the prompt into the agent you want to connect.","Review the exact configuration and skill files it proposes before approving changes.","Complete Lobu OAuth and let the agent perform its read-only verification."],guideLinks:[N]}],I=["Connect my Gmail to Lobu.","Create a Lobu automation that sends me a morning briefing.","In Lobu, design a data model with entities and relationships for tracking deals.","Remember in Lobu that I prefer short answers that lead with the key point."],K={codex:"chatgpt","claude-code":"claude","claude-desktop":"claude"};function W(e){const a=K[e]??e;return L.find(n=>n.id===a)}function q(e){const{workspaceName:a,owner:n,mcpUrl:o,clientLabel:r}=e;return[`Connect this${r?` ${r}`:""} agent to the "${a}" Lobu workspace (${n}).`,"",`Use the remote HTTP MCP server ${o}. Detect this agent's native MCP and skill mechanisms. If it supports installable skills, install the Lobu workspace skill from ${F}.`,"Inspect the current client and show the exact proposed installation or configuration changes before applying them. The Lobu CLI may be used as the setup helper, but do not initialize a Lobu project. Do not install the separate project-building starter skill. Do not enable local Automation delivery.",...e.terminalLogin?[`If native remote MCP with OAuth is unavailable, use the Lobu CLI in this agent's persistent terminal environment. Before logging in, inspect CLI help and existing contexts to select the same Lobu server and workspace as the MCP URL above; never silently use the hosted server for a custom endpoint. If no context matches that server, create one with npx @lobu/cli@latest context add <name> --url <server-base-url>. Ask for the user's Lobu email address, then run npx @lobu/cli@latest login --email <address> --context <name> and wait for the user to approve the email link. Keep credentials in the CLI's own persistent storage; never print tokens or paste them into chat. Run npx @lobu/cli@latest memory health --context <name> --org ${n}, then make a harmless read using the CLI with the same --context and --org options.`]:[],"","For native MCP, complete Lobu OAuth in the user's browser, then start a fresh session and confirm Lobu tools are discoverable. After either setup path, make one harmless read-only call in the selected workspace. Use search_sdk before choosing SDK methods. Never fabricate a returned URL or identifier."].join(`
|
|
3
|
-
`)}function z(e,a){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===a-1?"":"border-b"}`}function V({owner:e,dashed:a=!1}){return t.jsx("div",{className:`overflow-hidden rounded-lg border ${a?"border-dashed":""}`,children:L.map((n,o)=>t.jsxs(h,{to:"/$owner/agents/connect/$clientId",params:{owner:e,clientId:n.id},className:z(o,L.length),children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground",children:t.jsx(f,{name:n.label})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:n.label}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:n.tagline})]}),t.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},n.id))})}const J="app.lobu.ai";function Q(e,a){const n=a?`/mcp/${a}`:"/mcp";if(!e)return`http://localhost:8787${n}`;try{const o=new URL(e);return o.hostname===J&&(o.hostname="lobu.ai"),o.pathname=n,o.toString()}catch{return`${e}${n}`}}function X(e){return Q($,e)}const w="gap-3 pt-2.5 pb-8";function Y(e,a){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${e===a-1?"":"border-b"}`}function T({owner:e}){return t.jsx(S,{crumbs:[t.jsx(h,{to:"/$owner",params:{owner:e},search:{section:"agent"},className:_,children:"Agents"},"agents")]})}function ae({owner:e}){return t.jsx(C,{className:w,children:t.jsxs(A,{className:"flex flex-1 flex-col gap-6",children:[t.jsx(M,{breadcrumb:t.jsx(T,{owner:e}),icon:t.jsx(O.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.",meta:t.jsx(R,{owner:e})}),t.jsx(V,{owner:e})]})})}function oe({owner:e,clientId:a}){const n=W(a),{data:o}=U(e,{slug:e}),{data:r=[]}=G(null,{refetchInterval:2500}),i=E.useMemo(()=>H(r).filter(s=>s.connected),[r]);if(!n)return t.jsx(C,{className:w,children:t.jsxs(A,{className:"space-y-3",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),t.jsx(h,{to:"/$owner/agents/connect",params:{owner:e},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const l=X(e),p=q({workspaceName:o?.workspace?.name??e,owner:e,mcpUrl:l,clientLabel:n.id==="other"?void 0:n.label,terminalLogin:n.terminalLogin}),m=n.setupMode==="agent-prompt",k=m?p:n.installText?.(l)??p;return t.jsx(C,{className:w,children:t.jsxs(B,{header:t.jsx(M,{breadcrumb:t.jsx(T,{owner:e}),icon:t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:t.jsx(f,{name:n.label})}),title:n.label,caption:n.description}),children:[t.jsx(u,{title:"Set up",children:t.jsxs("div",{className:"space-y-4",children:[(()=>{const s=n.installLink?.(l);return s?t.jsx("div",{children:t.jsx(v,{asChild:!0,children:t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,t.jsx(y,{className:"ml-1.5 h-3.5 w-3.5"})]})})}):null})(),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:n.installTitle}),t.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[t.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:k}),t.jsx(g,{text:k,label:m?"Copy setup prompt":"Copy"})]})]}),t.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:n.steps(l).map((s,c)=>t.jsxs("li",{children:[c+1,". ",s]},s))}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[m?null:t.jsx(g,{text:p,label:"Copy setup prompt"}),n.guideLinks.map(s=>t.jsx(v,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[s.label,t.jsx(y,{className:"ml-1.5 h-3.5 w-3.5"})]})},s.href))]})]})}),t.jsx(u,{title:"First prompts",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"After setup, start a new chat with Lobu enabled and try one of these."}),t.jsx("div",{className:"overflow-hidden rounded-lg border",children:I.map((s,c)=>{const j=n.promptUrl?.(s);return t.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 ${c===I.length-1?"":"border-b"}`,children:[j?t.jsx("a",{href:j,target:"_blank",rel:"noreferrer",className:"min-w-0 flex-1 text-sm hover:underline",children:s}):t.jsx("p",{className:"min-w-0 flex-1 text-sm",children:s}),t.jsx(g,{text:s,label:"prompt",iconOnly:!0})]},s)})})]})}),t.jsx(u,{title:"Connected agents",count:i.length>0?String(i.length):void 0,children:i.length===0?t.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."}):t.jsx("div",{className:"overflow-hidden rounded-lg border",children:i.map((s,c)=>t.jsxs(h,{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:s.clientId},className:Y(c,i.length),children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:t.jsx(f,{name:s.title})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:D(s)})]})]},s.key))})}),t.jsx(u,{title:"Manual MCP details",children:t.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:[t.jsx("dt",{className:"text-muted-foreground",children:"Name"}),t.jsx("dd",{className:"font-mono",children:"lobu"}),t.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),t.jsx("dd",{className:"break-all font-mono",children:l})]})})]})})}export{ae as A,oe as a};
|
|
4
|
-
//# sourceMappingURL=agent-connect-pages-CdDjrHjn.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,bK as K,i as k,cH as R,cI as D,cK as B,gJ as J,ad as V,bD as G,bC as Y,bP as Z,gK as ee,bQ as $,bo as L,bR as se,bL as ne,bS as te,bM as re,r as S,gL as ae,gM as ie,bH as le,bT as oe,L as w,gN as de,gO as ce,dE as W,gP as ue,gQ as me,gR as ge,gS as A,dq as F,X as fe,gT as q,gU as H,gF as xe,dh as he,gV as be,gW as ye,bW as pe,gX as je}from"./index-C2TCKJDP.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:k("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=J({option:l,floor:o}),h=l===t,g=b.disabled&&!h,y=K[l],f=e.jsx("button",{type:"button",role:"radio","aria-checked":h,disabled:i||g,onClick:()=>{!h&&!g&&!i&&a(l)},className:k("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?k(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(B,{children:b.reason})]},l):f})})}function M({children:n,controls:t}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2 px-3 py-2",children:[e.jsx("div",{className:"min-w-40 flex-1 text-sm",children:n}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t})]})}const _e=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every entity type."},{resourceClass:"agent_config",title:"Agents",sub:"Defaults for reading and managing agents."}];function Se(n,t,o,a,i=null){const m=q(n.floor,t,o,a,i),u=H(n.floor,t,o,a,i)?m:"auto";return(a!==null||i!==null)&&be(n.agent,t,o)?ye(u,A(n,t,o,null)):u}function ke({label:n,response:t,resourceClass:o,action:a,entityTypeSlug:i,targetAgentId:m=null,dimmed:u,pending:l,onSave:b}){const h=q(t.floor,o,a,i,m),g=H(t.floor,o,a,i,m),y=A(t,o,a,i,m),f=Se(t,o,a,i,m),j=pe(o,a),p=e.jsx("div",{className:k("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(B,{children:["Org floor ",K[h]," — can only go stricter"]})]}):p}function Ae(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(W,{icon:n.icon,className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"font-medium",children:n.name}),e.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:n.slug})]})}function Q({label:n,disabled:t,hint:o,searchPlaceholder:a,emptyText:i,children:m}){return t?e.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[n,o?` ${o}`:""]}):e.jsx(xe,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:a,emptyText:i,trigger:u=>e.jsxs("button",{type:"button","aria-expanded":u,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[e.jsx(he,{className:"h-3 w-3"}),n]}),children:u=>m(u)})}function Te({pending:n,onClick:t,label:o}){return e.jsx("button",{type:"button",disabled:n,onClick:t,"aria-label":o,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:e.jsx(fe,{className:"h-3 w-3"})})}function Oe({owner:n,agentId:t,variant:o="agent"}){const a=o==="org-floor",i=V(),m=G(n,t??"",{enabled:!a&&!!t}),u=Y(n,{enabled:a}),{data:l,isLoading:b,isError:h,error:g}=a?u:m,y=a?Z(n):ee(n,t??""),f=$({mutationFn:r=>a?se(n,r):ne(n,t??"",r),onSuccess:r=>{i.setQueryData(y,c=>c&&{...c,agent:Ae(c.agent,r)}),i.invalidateQueries({queryKey:y}),a&&i.invalidateQueries({queryKey:["agent-permissions"]})},onError:r=>{L.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=>{L.error(r instanceof Error?r.message:"Failed to remove override")}}),p=f.isPending||j.isPending,C=S.useMemo(()=>l?ae(l):[],[l]),E=S.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=S.useMemo(()=>l?ie(l):[],[l]),N=S.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,z=(r,c,T,_,s=null)=>{const d=Ce(x,r,c,s,T,_);f.mutate({resource_class:r,effects:d,entity_type_slug:c,target_agent_id:s})},I=x.entity_types.length===0?"— none yet":E.length===0?"— all covered":null,U=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:{section:"policies",agent:t},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(W,{icon:s.icon,className:"h-3.5 w-3.5 shrink-0"}),s.name]})}),entityTypeSlug:s.slug,targetAgentId:null,owned:ce(x,s.slug),diffs:de(x,s.slug)})):v.map(s=>({key:`agent:${s.id}`,name:s.name,label:e.jsx(w,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:s.id},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(M,{controls:s.owned?e.jsx(Te,{pending:p,label:`Remove ${s.name} exception`,onClick:()=>j.mutate({resource_class:r.resourceClass,entity_type_slug:s.entityTypeSlug,target_agent_id:s.targetAgentId})}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s.label,s.key!=="default"&&!s.owned?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Organization minimum"}):s.diffs>0?e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.diffs," ",s.diffs===1?"change":"changes"]}):null]})})}),e.jsx("div",{className:"divide-y",children:ge[r.resourceClass].filter(d=>!s.targetAgentId||d!=="create").map(d=>{const P=`${d.charAt(0).toUpperCase()+d.slice(1)} ${c?"entities":"agents"}`;return e.jsx(M,{controls:e.jsx(ke,{label:`${s.name}: ${P}`,response:x,resourceClass:r.resourceClass,action:d,entityTypeSlug:s.entityTypeSlug,targetAgentId:s.targetAgentId,dimmed:s.key!=="default"&&A(x,r.resourceClass,d,s.entityTypeSlug,s.targetAgentId)===A(x,r.resourceClass,d,null),pending:p,onSave:X=>z(r.resourceClass,s.entityTypeSlug,d,X,s.targetAgentId)}),children:P},d)})})]},s.key)),e.jsxs("div",{className:"border-t",children:[c?e.jsx(Q,{label:"Add type",disabled:p||E.length===0,hint:I,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:s=>E.map(d=>e.jsx(F,{value:`${d.name} ${d.slug}`,onSelect:()=>{f.mutate({resource_class:"entity",effects:{},entity_type_slug:d.slug}),s()},className:"cursor-pointer",children:e.jsx(Ee,{type:d})},d.slug))}):null,T?e.jsx(Q,{label:"Add agent",disabled:p||N.length===0,hint:U,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:s=>N.map(d=>e.jsxs(F,{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,M as a};
|
|
2
|
-
//# sourceMappingURL=agent-permissions-matrix-ju7L2M0l.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as k,j as e,L as D,cj as L,r as h,ai as F,B as M,fa as C,d3 as I,eA as $,ax as K,z as B,n as H,cC as J,m as q,ce as G,d9 as S,hH as W,d7 as z,eI as V,cP as Y,bG as Q}from"./index-C2TCKJDP.js";import{E as U}from"./event-detail-CvaRN1qB.js";import{N as X,M as Z}from"./home-stream-Bg97PUBJ.js";import{S as ee}from"./scoped-feed-bar-CapleZvS.js";import{C as te,A as se}from"./create-automation-form-BhujNbRr.js";import{P as ne}from"./proposal-review-shell-BVwOMoq9.js";import{u as b}from"./runs-B_iywKWb.js";import{E as ie}from"./events-feed-DwOkLk6A.js";import{D as re,a as ae}from"./definition-comparison-3zKUSTt8.js";import{R as oe}from"./runs-list-CJJFRhTl.js";import{a as P}from"./use-automations-lV8PuE8L.js";function R({automationId:t}){const{currentOwner:s}=k();return s?e.jsx(D,{to:"/$owner/events",params:{owner:s},search:L({semanticTypes:["change"],eventCategory:"config",resourceKind:"automation",resourceId:t}),className:"text-sm text-primary underline underline-offset-4",children:"View definition history in Events"}):null}const ce={workspace:!0},de=6,le=["name","title"],E=10;function j(t){return t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.some(j):typeof t=="object"?Object.values(t).some(j):!0}function ue(t){const s=t.split("_").join(" ").trim();return s.charAt(0).toUpperCase()+s.slice(1)}function _({value:t,depth:s=0}){if(!j(t))return null;if(typeof t!="object"||t==null)return e.jsx("span",{className:"break-words",children:String(t)});if(s>=de)return e.jsx("span",{className:"break-words text-muted-foreground",children:JSON.stringify(t).slice(0,200)});if(Array.isArray(t))return e.jsx("ul",{className:"space-y-1.5",children:t.filter(j).map((o,d)=>e.jsx("li",{className:"border-l-2 border-border pl-2",children:e.jsx(_,{value:o,depth:s+1})},d))});const r=t,a=le.find(o=>typeof r[o]=="string"&&j(r[o])),i=Object.entries(r).filter(([o,d])=>o!==a&&j(d));return e.jsxs("div",{className:"space-y-1",children:[a?e.jsx("p",{className:"font-medium text-foreground",children:String(r[a])}):null,i.length>0?e.jsx("dl",{className:"space-y-1",children:i.map(([o,d])=>e.jsxs("div",{children:[e.jsxs("dt",{className:"inline text-muted-foreground",children:[ue(o),":"," "]}),e.jsx("dd",{className:"inline",children:typeof d=="object"?e.jsx("div",{className:"mt-1",children:e.jsx(_,{value:d,depth:s+1})}):e.jsx(_,{value:d,depth:s+1})})]},o))}):null]})}function w({run:t}){const s=t.completed_at??t.created_at;return e.jsx("time",{dateTime:new Date(s).toISOString(),title:$(s),className:"text-xs text-muted-foreground",children:I(s)})}function v({rows:t}){return t.length===0?null:e.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:t.map(s=>e.jsx("li",{children:s.content},s.key))})}function me({owner:t,automationId:s,failedRows:r}){const a=h.useId(),i=b(ce,{runTypes:["automation"],automationIds:[s],status:"completed"},t),o=i.data?.pages.flatMap(m=>m.runs)??[],d=o.filter(m=>j(m.output)),u=o.length-d.length,[n,...l]=d,f=i.data?.pages.length??0,{hasNextPage:g,isFetching:c,fetchNextPage:p}=i;h.useEffect(()=>{!n&&g&&!c&&f<E&&p()},[n,g,c,f,p]);const y=i.hasNextPage?e.jsx("div",{className:"flex justify-center",children:i.isFetchingNextPage?e.jsx(F,{role:"status","aria-label":"Loading earlier runs",className:"text-muted-foreground"}):e.jsx(M,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:i.isFetching,onClick:()=>void i.fetchNextPage(),children:"Show earlier runs"})}):null,N=n?[...l.map(m=>({key:String(m.id),occurredAt:m.completed_at??m.created_at,content:e.jsxs("div",{className:"space-y-1 px-3 py-2 text-xs",children:[e.jsx(w,{run:m}),e.jsx(_,{value:m.output})]})})),...r].sort((m,x)=>(C(x.occurredAt)??0)-(C(m.occurredAt)??0)):[];return i.isError?e.jsxs("div",{className:"space-y-6 py-6",children:[e.jsx("p",{role:"alert",className:"text-sm text-muted-foreground",children:"Couldn't load this Automation's runs."}),e.jsx(v,{rows:r})]}):i.isLoading||!n&&g&&f<E?null:n?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{"aria-label":"Latest result",className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Latest result"}),e.jsx(w,{run:n})]}),e.jsx("div",{className:"text-sm",children:e.jsx(_,{value:n.output})})]}),N.length>0?e.jsxs("section",{"aria-labelledby":a,className:"space-y-2",children:[e.jsx("h2",{id:a,className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Earlier results"}),e.jsx(v,{rows:N})]}):null,u>0?e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u," other ",u===1?"run":"runs"," found nothing new."]}):null,y]}):e.jsxs("div",{className:"space-y-6 py-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:o.length===0?"This Automation hasn't run yet. Its results appear here, newest first.":`It ran ${o.length}${i.hasNextPage?"+":""} times without returning a result.`}),e.jsx(v,{rows:r}),y]})}function T(t){const{orgContext:s,hasOrgContext:r}=k(),{data:a,isLoading:i}=K(`/${t}`,s),{isAuthenticated:o}=B(),{isMember:d,isLoading:u}=H(),n=o&&d,l=a?.workspace,f=n?!r||i||u:i||u;return{organizationId:l?.id??"",isLoading:f}}function Re(t){return T(t)}const O={workspace:!0};function fe(t,s){const r=b(O,{runTypes:["automation"],automationIds:[s],status:"failed"},t),a=b(O,{runTypes:["automation"],automationIds:[s],status:"timeout"},t);return h.useMemo(()=>[...r.data?.pages[0]?.runs??[],...a.data?.pages[0]?.runs??[]].sort((i,o)=>Date.parse(o.created_at)-Date.parse(i.created_at)||o.id-i.id),[r.data,a.data])}function ge(t,s){const r=G(t),{decisions:a,notices:i}=h.useMemo(()=>{const u=r.attentionCards.filter(n=>n.automation_id===s);return{decisions:W(u.filter(S).map(n=>{const l=z(n);return{card:n,item:l,repeats:1,unreadIds:l.unread&&l.notificationId!=null?[l.notificationId]:[]}}).sort((n,l)=>l.item.at-n.item.at)),notices:u.filter(n=>!S(n)&&n.unread&&n.notification_id!=null)}},[r.attentionCards,s]);return{attention:r,decisions:a,notices:i,markRead:u=>{u.length>0&&r.markManyRead.mutateAsync(u)},unreadFor:u=>i.flatMap(n=>n.run_id!=null&&n.run_id===u.run_id||V(n.href?.split(/[?#]/)[0]??"")?.eventId===Number(u.id)?[n.notification_id]:[])}}function xe({owner:t,automationId:s,organizationId:r}){const a=Number(s),i=h.useMemo(()=>({producedByAutomationId:a}),[a]),{attention:o,decisions:d,notices:u,markRead:n,unreadFor:l}=ge(t,a),f=fe(t,a);if(!Number.isFinite(a))return null;const g=f.map(c=>({key:`run:${c.id}`,occurredAt:c.completed_at??c.created_at,content:e.jsx(oe,{run:c,ownerSlug:t})}));return e.jsxs(e.Fragment,{children:[o.isError?e.jsx("p",{role:"alert",className:"mb-6 text-sm text-destructive",children:"Could not load notifications. Refresh to try again."}):d.length>0?e.jsxs("section",{"aria-label":"Needs you",className:"mb-6 space-y-2",children:[e.jsx("h2",{className:"px-1 text-sm font-semibold",children:"Needs you"}),e.jsx(X,{owner:t,entries:d})]}):null,e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(ee,{owner:t,organizationId:r||null,activitySearch:{produced_by:String(a)}}),e.jsx(Z,{entries:u.map(c=>({unreadIds:[c.notification_id]})),disabled:o.markManyRead.isPending,onMarkRead:n})]}),e.jsx(ie,{organizationId:r,ownerSlug:t,filters:i,foldRunSatellites:!1,unreadNotices:l,onMarkRead:n,extraRows:g,renderLead:(c,{hasEarlier:p})=>e.jsxs("div",{className:"mb-4 space-y-6",children:[e.jsxs("section",{"aria-label":"Latest result",className:"space-y-2",children:[e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Latest result"}),e.jsx(U,{owner:t,organizationId:r,eventId:c.id})]}),p?e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Earlier results"}):null]}),emptyState:e.jsx(me,{owner:t,automationId:a,failedRows:g})})]})}function pe({agentId:t,automationId:s,runId:r,organizationId:a,onDone:i}){const[o,d]=h.useState({ready:!1,triggers:[]}),u=h.useCallback(m=>{d(x=>JSON.stringify(x)===JSON.stringify(m)?x:m)},[]),n=P(s,void 0,a,{includeVersions:!0}),l=n.data?.automation,{currentOwner:f}=k(),g=J({queryKey:["automations-list",f,"editor",s,l?.status],enabled:!!f&&!!a&&!!l,queryFn:async()=>{const x=(await Y("manage_automations",{action:"list",automation_id:s,status:l?.status,include_details:!0,limit:1},{slug:f})).automations.find(A=>A.automation_id===s);if(!x)throw new Q("Automation not found",404);return x},staleTime:3e4}),c=g.data,p=h.useMemo(()=>l&&c?{automation_id:l.automation_id,name:c.name,slug:c.slug,description:c.description,prompt:c.prompt,sources:c.sources,reaction_script:l.reaction_script,managed_agent_id:c.managed_agent_id,device_worker_id:c.device_worker_id,agent_kind:c.agent_kind,delivery_target:c.delivery_target??void 0,execution_config:c.execution_config??void 0,model_config:c.model_config,tags:c.tags,keying_config:l.keying_config,reactions_guidance:c.reactions_guidance,triggers:c.triggers}:void 0,[l,c]),y=e.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(m=>e.jsx(q,{className:"h-16 w-full rounded-lg"},m))}),N=g.isError?e.jsxs("div",{role:"alert",className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Could not load the saved Automation definition."}),e.jsx("button",{type:"button",className:"text-primary underline underline-offset-4",onClick:()=>void g.refetch(),children:"Retry"})]}):n.isLoading||l&&g.isPending?y:p?e.jsx(te,{organizationId:a,prefillAgentId:t??void 0,editingAutomation:p,createFields:{triggers:o.triggers},triggerFields:e.jsx(se,{organizationId:a,initialTriggers:p.triggers??[],onChange:u},JSON.stringify(p.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!o.ready,onClose:i}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return t?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ne,{resource:{kind:"automation",agentId:t,automationId:s},runId:r,onDone:i,children:({reviewMode:m,proposal:x})=>m==="active"?e.jsx(re,{current:x?.current??null,proposed:{...x?.current??{},...x?.proposedAfter??{}},render:A=>e.jsx(ae,{value:A})}):m==="loading"?y:m==="error"?null:N}),e.jsx(R,{automationId:s})]}):e.jsxs("div",{className:"space-y-6",children:[N,e.jsx(R,{automationId:s})]})}function Ee({owner:t,agentId:s,automationId:r,view:a,runId:i,onDone:o}){const{organizationId:d}=T(t),u=P(r,void 0,d),n=s??u.data?.automation?.managed_agent_id??null;return i||a==="definition"?e.jsx(pe,{agentId:n,automationId:r,runId:i,organizationId:d,onDone:o},`${t}/${r}`):e.jsx(xe,{owner:t,automationId:r,organizationId:d})}export{Ee as A,Re as u};
|
|
2
|
-
//# sourceMappingURL=automation-detail-content-BJwRU6qT.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cQ as c,cC as u,ad as d,bQ as p,bo as r,aa as o,cR as i,$ as w}from"./index-C2TCKJDP.js";function l(t,s="",e){const a=`${w}/api/${t}/clients${s}`,n=e?.toString();return n?`${a}?${n}`:a}function h(t,s){const e=s?.ownerSlug??c().slug;return u({queryKey:["connected-clients",e,t??null],queryFn:async()=>{if(!e)throw new Error("Workspace required");const a=new URLSearchParams;t&&a.set("agentId",t);const n=await o(l(e,"",a),{credentials:"include"});return await i(n,"Failed to load connected clients"),(await n.json()).clients??[]},enabled:!!e&&(s?.enabled??!0),staleTime:15e3,refetchInterval:s?.refetchInterval})}function y(){const{slug:t}=c(),s=d();return p({mutationFn:async e=>{if(!t)throw new Error("Workspace required");const a=new URLSearchParams;e.scope==="all"&&a.set("scope","all");const n=await o(l(t,`/mcp/${encodeURIComponent(e.clientId)}`,a),{method:"DELETE",credentials:"include"});return await i(n,"Failed to revoke client"),await n.json()},onSuccess:()=>{s.invalidateQueries({queryKey:["connected-clients",t]}),r.success("App access revoked")},onError:e=>{r.error(e.message||"Failed to revoke app access")}})}export{y as a,h as u};
|
|
2
|
-
//# sourceMappingURL=clients-CydgUHrc.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{js as r,j as t,aF as a}from"./index-C2TCKJDP.js";import{a as s}from"./agent-connect-pages-CdDjrHjn.js";import"./connector-page-shell-C23dWdKz.js";import"./copy-button-1ALlvZU1.js";import"./clients-CydgUHrc.js";import"./client-rows-B3LULJxW.js";function x(){const{owner:e,clientId:o}=r.useParams();return t.jsx(a,{owner:e,children:({ownerSlug:n})=>t.jsx(s,{owner:n,clientId:o})})}export{x as component};
|
|
2
|
-
//# sourceMappingURL=connect._clientId-EI1tcdSE.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{bf as W,M as V,r as l,aa as z,$ as R,j as e,ai as N,B as f,bg as F,bh as M,bi as q,bj as Y,bk as E,U as B,I as D,an as G,ac as K,ak as H,V as J}from"./index-C2TCKJDP.js";import{s as Q}from"./index-DXfYVs5m.js";import{C as X,a as Z,b as ee,c as ne}from"./card-rE4Ctuy6.js";const C="__new_org__";function te(r){return r.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function w(r){return Q.find(i=>i.provider===r)?.name??r}function re(r,i){return`${window.location.origin}/connector/${encodeURIComponent(r)}/connection?${new URLSearchParams({ref:i})}`}function ie(r,i){return r==="account_already_linked_to_different_user"?`This ${i} account belongs to a different Lobu account than the one you are signed in to. Sign out, then continue with ${i} to finish setup as that account.`:`We couldn’t verify your ${i} account for this setup. Sign out, then continue with ${i} to try again.`}function oe(r,i){const[s,n]=l.useState({}),o=i?`${i}:${r}`:null;return l.useEffect(()=>{if(!o||!i||o in s)return;let c=!1;return D(i).then(h=>h.find(g=>g.key===r)?.name??null).catch(()=>null).then(h=>{c||n(g=>({...g,[o]:h}))}),()=>{c=!0}},[o,r,s,i]),o?s[o]??null:null}function I(r,i,s){if(!r)return"/";const n=`/${encodeURIComponent(r)}/`;if(s?.startsWith(n)){const o=new URL(s,window.location.origin);if(o.origin===window.location.origin&&o.pathname.startsWith(n))return o.pathname+o.search}return`${n}connectors/${encodeURIComponent(i)}?connected=1`}function se(r,i){return r==="not_admin"?`You must be an admin or owner to connect ${i} to Lobu.`:`You don't have permission to connect ${i} to Lobu.`}function T(r,i,s){switch(r){case"not_authorized":return se(i,s);case"no_pending":return`No Lobu install was found for ${s}. Add Lobu from the marketplace to get started.`;case"no_org":return`Your account has no Lobu organization to connect ${s} to.`;default:return`Something went wrong while connecting ${s}. Please try again.`}}function de(){const{name:r}=W({from:"/connector/$name/connection"}),{ref:i,error:s}=V({from:"/connector/$name/connection"}),[n,o]=l.useState({kind:"loading"}),[c,h]=l.useState(""),[g,O]=l.useState(""),[x,$]=l.useState(!1),[_,p]=l.useState(null),[j,k]=l.useState(null),u=oe(r,n.kind==="confirm"?n.orgs[0]?.slug??null:n.kind==="already_connected"?n.orgSlug:null),m=n.kind==="confirm"&&n.subjectKind||"connection",S=n.kind==="confirm"&&n.subjectName?n.subjectName:u?`this ${u} ${m}`:`this ${m}`,P=l.useCallback(async()=>{if(!i){o({kind:"error",message:"This connection link is missing its reference."});return}o({kind:"loading"});try{const t=await(await z(`${R}/api/connector/${encodeURIComponent(r)}/connection/claim-context?ref=${encodeURIComponent(i)}`,{credentials:"include"})).json();if("error"in t){if(t.error==="unauthenticated"){o({kind:"signin",signinProvider:t.signinProvider??r,linkAccount:!1});return}if(t.error==="signin_required"){o(s?{kind:"link_failed",signinProvider:t.signinProvider??r,error:s}:{kind:"signin",signinProvider:t.signinProvider??r,linkAccount:!0});return}o({kind:"error",message:T(t.error,t.code,"this connection")});return}if("alreadyConnected"in t){o({kind:"already_connected",orgSlug:t.orgSlug,nextUrl:t.nextUrl});return}h(t.orgs[0]?.slug??""),o({kind:"confirm",subjectKind:t.subjectKind,subjectName:t.subjectName,orgs:t.orgs})}catch{o({kind:"error",message:"We couldn’t load this connection link. Please try again."})}},[r,i,s]);l.useEffect(()=>{P()},[P]);const L=async d=>{if(!i)return;const t=re(r,i);if(n.kind==="signin"&&n.linkAccount){const y=await G.linkSocial({provider:d,callbackURL:t,errorCallbackURL:t});y.error&&o({kind:"error",message:y.error.message??"Couldn’t verify this account."});return}n.kind==="link_failed"&&await K(),await H.social({provider:d,callbackURL:t,errorCallbackURL:t})},U=async(d=!1)=>{if(!(!i||!c)){$(!0),p(null),k(null);try{let t=c;if(c===C){const b=g.trim();if(!b){p("Enter a name for the new organization.");return}const v=await J.create({name:b,slug:te(b)});if(v.error||!v.data){p(v.error?.message??"Couldn’t create the organization.");return}t=v.data.slug}const a=await(await z(`${R}/api/connector/${encodeURIComponent(r)}/connection/claim`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ref:i,org:t,confirmMove:d})})).json();if("error"in a){if(a.error==="signin_required"||a.error==="unauthenticated"){o({kind:"signin",signinProvider:a.signinProvider??r,linkAccount:a.error==="signin_required"});return}if((a.error==="already_connected_elsewhere"||a.error==="enterprise_scope_overlap")&&a.existing){k({kind:a.error,existing:a.existing});return}p(T(a.error,a.code,S));return}window.location.href=I(a.orgSlug,r,a.nextUrl)}catch{p(`Something went wrong while connecting this ${m}. Please try again.`)}finally{$(!1)}}},A=n.kind==="signin"?"Sign in to continue":n.kind==="link_failed"?"Use a different account":n.kind==="error"?`Can’t connect this ${m}`:n.kind==="already_connected"?"Already connected":u?`Connect ${u} to Lobu`:"Connect to Lobu";return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("div",{className:"w-full max-w-md p-8",children:e.jsxs(X,{children:[e.jsx(Z,{children:e.jsx(ee,{asChild:!0,children:e.jsx("h1",{children:A})})}),e.jsxs(ne,{children:[n.kind==="loading"&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(N,{size:"lg"}),e.jsx("span",{children:"Checking this connection link…"})]}),n.kind==="error"&&e.jsx("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:n.message}),n.kind==="already_connected"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This ",u?`${u} `:"",m," is already connected to Lobu."]}),e.jsx(f,{className:"w-full",asChild:!0,children:e.jsx("a",{href:I(n.orgSlug,r,n.nextUrl),children:n.nextUrl?"Choose an agent":"Open Lobu"})})]}),n.kind==="signin"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sign in with ",w(n.signinProvider)," to verify you can connect this ",m,"."]}),e.jsxs(f,{className:"w-full",onClick:()=>L(n.signinProvider),children:["Sign in with ",w(n.signinProvider)]})]}),n.kind==="link_failed"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{role:"alert",className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:ie(n.error,w(n.signinProvider))}),e.jsxs(f,{className:"w-full",onClick:()=>L(n.signinProvider),children:["Sign out and continue with"," ",w(n.signinProvider)]})]}),n.kind==="confirm"&&(()=>{const d=n.subjectName||S;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Connecting"," ",e.jsx("strong",{className:"font-medium text-foreground",children:d}),". Choose the organization to connect it to:"]}),e.jsxs(F,{value:c,onValueChange:t=>{k(null),h(t)},children:[e.jsx(M,{children:e.jsx(q,{placeholder:"Select an organization"})}),e.jsxs(Y,{children:[n.orgs.map(t=>e.jsxs(E,{value:t.slug,children:[t.name,t.isPersonal&&e.jsx("span",{className:"ml-1 text-muted-foreground",children:"(personal)"})]},t.id)),e.jsx(E,{value:C,children:"+ New organization"})]})]}),c===C&&e.jsx(B,{autoFocus:!0,value:g,onChange:t=>O(t.target.value),placeholder:"New organization name","aria-label":"New organization name"}),_&&e.jsx("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:_}),j&&(()=>{const t=j.existing.orgName??j.existing.orgSlug??"another organization";return j.kind==="already_connected_elsewhere"?e.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/40 px-3 py-3",children:[e.jsxs("p",{className:"text-sm text-foreground",children:[d," is already connected in"," ",e.jsx("strong",{className:"font-medium",children:t}),". Move it here?"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{className:"flex-1",onClick:()=>U(!0),disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Moving…"})]}):"Move it here"}),e.jsx(f,{className:"flex-1",variant:"outline",onClick:()=>k(null),disabled:x,children:"Cancel"})]})]}):e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive",children:["This ",u?`${u} `:"","Enterprise Grid is already connected in"," ",e.jsx("strong",{className:"font-medium",children:t}),"; ","connecting this ",m," here may change how its messages route. Contact support to move it."]})})(),e.jsx(f,{className:"w-full",onClick:()=>U(),disabled:x||j!==null||!c||c===C&&!g.trim(),children:x?e.jsxs(e.Fragment,{children:[e.jsx(N,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Connecting…"})]}):`Connect ${d}`})]})})()]})]})})})}export{de as component};
|
|
2
|
-
//# sourceMappingURL=connection-D8ZAMHBT.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as u,r,aU as j,j as e,e3 as C,e4 as v,B as N,gx as y,e7 as w,e8 as g,e9 as k,ea as S,eb as b,dp as l,b2 as f,dq as m,b9 as I,g7 as O,i as A,gy as E}from"./index-C2TCKJDP.js";const $="overflow-hidden rounded-lg border divide-y";function B({header:o,action:n}){return e.jsxs("div",{className:A("flex items-center",E),children:[e.jsx("div",{className:"min-w-0 flex-1",children:o}),n?e.jsx("div",{className:"shrink-0 pr-3",children:n}):null]})}function D({ownerSlug:o,catalog:n,trigger:d}){const c=u(),[x,t]=r.useState(!1),p=r.useMemo(()=>new Map(n.map(s=>[s.key,s])),[n]),h=r.useMemo(()=>n.filter(s=>!j(s)).sort((s,a)=>s.name.localeCompare(a.name)),[n]),i=s=>{t(!1),c(s?{to:"/$owner/connectors/create/$connectorKey",params:{owner:o,connectorKey:s}}:{to:"/$owner/connectors/create",params:{owner:o}})};return e.jsxs(C,{open:x,onOpenChange:t,children:[e.jsx(v,{asChild:!0,children:d??e.jsxs(N,{size:"sm",className:"h-8 shrink-0 justify-start text-xs",children:[e.jsx(y,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})}),e.jsx(w,{align:"end",className:"w-72 p-0",children:e.jsxs(g,{children:[e.jsx(k,{placeholder:"Search connectors…"}),e.jsxs(S,{children:[e.jsx(b,{children:"No connector matches."}),e.jsx(l,{children:h.map(s=>{const a=f(s.key,p,{name:s.name});return e.jsxs(m,{value:`${s.name} ${s.key}`,onSelect:()=>i(s.key),className:"gap-2",children:[e.jsx(I,{icon:a.icon,iconUrl:a.iconUrl,name:a.name,faviconDomain:a.faviconDomain,className:"h-5 w-5 shrink-0 rounded text-[9px]"}),e.jsx("span",{className:"truncate",children:s.name}),s.installed?e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"Added"}):null]},s.key)})}),e.jsx(O,{}),e.jsx(l,{children:e.jsx(m,{value:"browse all connectors",onSelect:()=>i(),children:"Browse all connectors…"})})]})]})})]})}export{D as A,$ as C,B as a};
|
|
2
|
-
//# sourceMappingURL=connector-boxes-BWPXijAk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as s,as as l}from"./index-C2TCKJDP.js";function c({header:e,children:a}){return s.jsxs(l,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[s.jsx("div",{className:"sticky top-0 z-10 space-y-4 bg-background pb-1",children:e}),s.jsx("div",{className:"mt-4 min-w-0 flex-1 space-y-7",children:a})]})}export{c as C};
|
|
2
|
-
//# sourceMappingURL=connector-page-shell-C23dWdKz.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,ar as s,O as a}from"./index-C2TCKJDP.js";function t(){return e.jsx(s,{className:"gap-3 pt-2.5 pb-8",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(a,{})})})}export{t as component};
|
|
2
|
-
//# sourceMappingURL=connectors-Bp08_KPq.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a0 as U,z as W,r as i,j as t,$ as D,a1 as F}from"./index-C2TCKJDP.js";import{a as I,u as T,C as G,b as B,c as J,R as Q,W as H,A as K,r as V,o as X}from"./use-login-redirect-CfCbEeJR.js";import{F as Y}from"./full-page-spinner-B7A6Ycyi.js";import"./card-rE4Ctuy6.js";const Z=["client_id","redirect_uri","scope","code_challenge","code_challenge_method"];function re(){const e=U.useSearch(),d=e.workspace_grants==="1",{session:g,isReady:k}=W(),m=!k,[r,_]=i.useState(null),[v,l]=i.useState(null);I(!!g,m);const p=i.useMemo(()=>Z.filter(s=>!e[s]||e[s]?.length===0),[e]),c=p.length===0,C=e.client_name?.trim()||null,f=i.useMemo(()=>Array.from(new Set((e.scope||"").split(" ").map(s=>s.trim()).filter(Boolean))),[e.scope]),{accessLevel:w,setAccessLevel:O,selectedScopes:A,resourceOrg:S,hasMcpScopes:E,requiresWorkspaceAccess:n,orgList:h,workspaceAccess:L,setWorkspaceAccess:M,selectedOrgIds:o,toggleSelectedOrgId:P,orgsLoading:q,orgsError:b,retryOrgs:N,workspaceSelectionReady:y}=T({requestedScopes:f,resource:e.resource,allowMultiple:d}),u=i.useMemo(()=>h.filter(s=>o.includes(s.id)).map(s=>s.name),[h,o]),$=n?u.length===0?"Nothing will be granted access.":`${u.length<=2?u.join(", "):`${u.length} workspaces`} will be granted access.`:null,z=n&&d&&o.length>0?`Approve ${o.length} ${o.length===1?"workspace":"workspaces"}`:"Approve",R=async s=>{if(!c){l(`Missing required query params: ${p.join(", ")}`);return}if(s&&n&&!y){l(b?"Workspaces could not be loaded. Retry before approving.":"Choose at least one workspace before approving.");return}_(s?"approve":"deny"),l(null);try{const a=await fetch(`${D}/oauth/authorize/consent`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({client_id:e.client_id,redirect_uri:e.redirect_uri,scope:s?A.join(" "):e.scope,state:e.state??"",code_challenge:e.code_challenge,code_challenge_method:e.code_challenge_method,client_name:e.client_name,resource:e.resource,authorization_intent:e.authorization_intent,approved:s,...s&&n?{workspace_access:L,organization_ids:o}:{}})}),x=await a.json().catch(()=>null);if(a.status===401){V();return}if(!a.ok)throw new Error(X(x,`Failed to ${s?"approve":"deny"} OAuth consent`));const j=F(x?.redirect_url);if(!j)throw new Error("Consent response did not include a valid redirect URL");window.location.href=j}catch(a){_(null),l(a instanceof Error?a.message:"Unexpected error while submitting consent")}};return m||!g?t.jsx(Y,{className:"min-h-[calc(100vh-3.5rem)]"}):t.jsx(G,{title:"Authorize application",busy:r!==null,error:v,review:t.jsx(K,{idPrefix:"oauth-consent",clientName:C,requestedScopes:f,accessLevel:w,onAccessLevelChange:O,disabled:r!==null,resource:e.resource,logoUri:e.logo_uri,clientUri:e.client_uri}),aside:n?t.jsx(H,{idPrefix:"oauth-consent",allowMultiple:d,orgList:h,selectedOrgIds:o,onWorkspaceAccessChange:M,onSelectedOrgChange:P,orgsLoading:q,orgsError:b,onRetry:N,disabled:r!==null||!c}):void 0,below:E&&S?t.jsx(Q,{resourceOrg:S,accessLevel:w}):null,notice:c?null:t.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Missing required query params: ",p.join(", ")]}),footer:t.jsx(B,{summary:$,children:t.jsx(J,{busy:r,approveLabel:z,approveDisabled:r!==null||!c||A.length===0||n&&!y,denyDisabled:r!==null||!c,onApprove:()=>R(!0),onDeny:()=>R(!1)})})})}export{re as component};
|
|
2
|
-
//# sourceMappingURL=consent-_PpYI1cT.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as x,h0 as G,iO as b,iP as L,hT as v,j as t,cz as w,bo as r,jw as y}from"./index-C2TCKJDP.js";import{A as S,v as P,a as N}from"./custom-guardrail-edits-B_aCgvoZ.js";import{A as $,a as F}from"./agent-subpage-shell-ByU0xhXn.js";import"./model-selector-BrfaDwIg.js";function R({owner:e,agentId:a}){const i=x(),{data:n,isLoading:c}=G(a),{data:m,isLoading:p}=b(a),{data:o=null,isLoading:f}=L(a),C=c||p||f,u=v(a),g=n?.guardrailsInline??[],A=(m??[]).map(s=>s.name),h=async s=>{if(!n){r.error("Still loading agent settings — try again in a moment");return}const d=P(s,g,A,o);if(d){r.error(d);return}try{await u.mutateAsync({guardrailsInline:N(g,s)}),r.success("Guardrail created"),i({to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},hash:"guardrails"})}catch(l){r.error(l instanceof Error?l.message:"Failed to create guardrail")}},j=()=>void i({to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},hash:"guardrails"});return t.jsxs("div",{className:"space-y-6",children:[t.jsx($,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),C?t.jsx(w,{rows:4}):t.jsx(S,{judgeModelDefault:o,submitLabel:"Create guardrail",submitting:u.isPending,onSubmit:h,onCancel:j})]})}function D({owner:e,agentId:a}){return t.jsx(F,{children:t.jsx(R,{owner:e,agentId:a})})}function z(){const{owner:e,agentId:a}=y.useParams();return t.jsx(D,{owner:e,agentId:a})}export{z as component};
|
|
2
|
-
//# sourceMappingURL=create-DULVO0HS.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as n,aF as t,O as c,ct as r,as as i,cu as l,cv as m,b1 as x,cw as d,L as u,cx as j,cy as C,cz as h}from"./index-C2TCKJDP.js";function b({owner:e,initialConnectorKey:a}){return n.jsx(t,{owner:e,children:o=>n.jsx(p,{ownerSlug:o.ownerSlug,organizationId:o.organizationId,initialConnectorKey:a})})}function p({ownerSlug:e,organizationId:a,initialConnectorKey:o}){const{data:s=[]}=r(a??"");return n.jsxs(i,{className:"flex flex-1 flex-col gap-6",children:[n.jsx(l,{breadcrumb:n.jsx(d,{crumbs:[n.jsx(u,{to:"/$owner/connectors",params:{owner:e},search:{},className:j,children:"Connectors"},"connectors")]}),icon:n.jsx(x.connectors.icon,{className:"h-6 w-6"}),title:"Add a connection",caption:"Pick a connector from the catalog or drop in an MCP URL — Lobu handles auth and brings the data into memory.",meta:n.jsx(m,{owner:e})}),a?n.jsx(C,{ownerSlug:e,organizationId:a,connections:s,initialConnectorKey:o},o??"catalog"):n.jsx("div",{className:"max-w-3xl",children:n.jsx(h,{rows:4})})]})}const f=()=>n.jsx(c,{});export{b as ConnectionsCreateRouteContent,f as component};
|
|
2
|
-
//# sourceMappingURL=create-Drx9tcnG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Y as Ce,z as je,r as h,Z as Ne,j as e,U as Se,B as ce,$ as ie}from"./index-C2TCKJDP.js";import{u as Ae,r as te,o as F,g as _e,a as De,C as ne,A as Ee,W as Re,b as re,c as Te,R as Pe}from"./use-login-redirect-CfCbEeJR.js";import{F as Le}from"./full-page-spinner-B7A6Ycyi.js";import{w as A}from"./workspace-label-o_QfBuCM.js";import"./card-rE4Ctuy6.js";const Ie=[];function M(t){return t.trim().toUpperCase()}const Oe=15e3;async function ze(t){const i=new AbortController,p=window.setTimeout(()=>i.abort(),Oe);try{const n=await fetch(`${ie}/oauth/device/info?user_code=${encodeURIComponent(t)}`,{credentials:"include",signal:i.signal}),u=await n.json().catch(()=>null);return{response:n,data:u}}catch(n){throw i.signal.aborted?new Error("Verification timed out. Check your connection and try again."):n}finally{window.clearTimeout(p)}}function Ue({isVerified:t,requiresDeviceHome:i,requiresWorkspaceAccess:p,homeLabel:n,workspaceCount:u}){if(!t||p&&u===0)return null;const b=`${u} workspace${u===1?"":"s"}`;return i?n?p?`Pairs this device in ${n} and grants MCP access to ${b}.`:`Pairs this device in ${n} with no workspace data access.`:null:p?`Grants MCP access to ${b}.`:null}function qe(){const t=Ce.useSearch(),{session:i,isReady:p}=je(),n=!p,[u,b]=h.useState(t.user_code||""),[r,g]=h.useState(null),[w,s]=h.useState(null),[a,ae]=h.useState(null),[$,P]=h.useState(null),[le,V]=h.useState(null),k=h.useRef(0),j=Ne(t.return_to),q=j?"app":"terminal",de=!!t.user_code,_=M(u),m=$?.code===_?$:null,v=m!==null,D=m?.scopes??Ie,E=D.includes("device_worker:run"),ue=D.includes("connections:token"),L=m?.multiWorkspaceGrantsEnabled===!0,{accessLevel:G,setAccessLevel:I,selectedScopes:me,resourceOrg:O,hasMcpScopes:he,requiresWorkspaceAccess:N,orgList:C,workspaceAccess:pe,setWorkspaceAccess:ve,selectedOrgIds:z,toggleSelectedOrgId:fe,resetWorkspaceSelection:ge,deviceHomeOrgId:R,orgsLoading:U,orgsError:T,retryOrgs:B,workspaceSelectionReady:xe}=Ae({requestedScopes:D,resource:m?.resource??null,allowMultiple:L,requireDeviceHome:E,deviceHomeOrgId:le}),l=v&&E&&!O,d=C.find(o=>o.id===R)??null,Y=U||T!==null||C.length>1,J=C.length===1?C[0]:void 0,we=J!==void 0&&!J.isPersonal,Z=l&&(Y||R===null||we),K=N&&Y&&(L||!l),Q=!N&&!l||xe,W=h.useCallback(async o=>{const x=++k.current;g("verify"),s(null);try{const{response:y,data:c}=await ze(o);if(x!==k.current)return;if(y.status===401){te();return}if(!y.ok||!c)throw new Error(F(c,"Failed to verify device authorization code"));const f=Array.isArray(c.scopes)?c.scopes:[];P({code:o,clientName:c.client_name??null,logoUri:typeof c.logo_uri=="string"?c.logo_uri:null,clientUri:typeof c.client_uri=="string"?c.client_uri:null,scopes:f,resource:typeof c.resource=="string"?c.resource:null,multiWorkspaceGrantsEnabled:c.multi_workspace_grants_enabled===!0}),I(_e(f))}catch(y){if(x!==k.current)return;P(null),s(y instanceof Error?y.message:"Unexpected error")}finally{x===k.current&&g(null)}},[I]);De(!!i,n),h.useEffect(()=>{if(!(n||!i||!t.user_code))return W(M(t.user_code)),()=>{k.current+=1}},[i,n,t.user_code,W]);const X=async o=>{const x=_;if(!x){s(`Please enter the code shown in your ${q}.`);return}if(!v){s("Verify the device code before approving or denying access.");return}if(o&&!Q){s(T?"Workspaces could not be loaded. Retry before approving.":l&&!d?"Choose a workspace for this device before approving.":"Choose at least one workspace before approving.");return}const y=m?.clientName??null,c=l&&d?A(d):null;g(o?"approve":"deny"),s(null);try{const f=await fetch(`${ie}/oauth/device/approve`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({user_code:x,approved:o,...o?{scope:me.join(" ")}:{},...o&&N?{workspace_access:pe,organization_ids:z}:{},...o&&l&&d?{organization_id:d.id}:{}})}),S=await f.json().catch(()=>null);if(f.status===401){te();return}if(!f.ok)throw new Error(F(S,"Failed to process device authorization"));const oe=o?"approved":"denied";if(S?.status!==oe)throw new Error(F(S,o?"The server did not confirm this approval. The device is still waiting — try again.":"The server did not confirm this denial. Try again."));const se=typeof S.user_code=="string"?M(S.user_code):null;if(se!==null&&se!==x)throw new Error("The server confirmed a different device code. Re-check the code shown on your device.");g(null),ae({outcome:oe,code:x,clientName:y,deviceHomeLabel:c})}catch(f){g(null),s(f instanceof Error?f.message:"Unexpected error")}};if(h.useEffect(()=>{if(a?.outcome!=="approved"||!j)return;const o=window.setTimeout(()=>{window.location.href=j},600);return()=>window.clearTimeout(o)},[a,j]),n||!i)return e.jsx(Le,{className:"min-h-[calc(100vh-3.5rem)]"});if(a)return e.jsx(ne,{live:!0,title:a.outcome==="approved"?de?"Access Authorized":"Device Authorized":"Authorization Denied",description:a.outcome==="approved"?j?"You can close this tab and return to the Lobu app.":"You can close this tab and return to your terminal.":"The device was not authorized. You can close this tab.",review:e.jsxs("div",{className:"space-y-4 text-sm",children:[a.outcome==="approved"&&a.deviceHomeLabel?e.jsxs("p",{className:"text-muted-foreground",children:["This device now lives in ",a.deviceHomeLabel,". Change its workspace or share its connections from the device page under Connectors."]}):null,e.jsxs("dl",{className:"space-y-1",children:[e.jsx("dt",{className:"text-muted-foreground",children:a.outcome==="approved"?"Approved code":"Denied code"}),e.jsx("dd",{className:"font-mono text-base tracking-widest text-foreground",children:a.code}),a.clientName?e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Requested by"}),e.jsx("dd",{className:"text-foreground",children:a.clientName})]}):null]})]})});const ye=Ue({isVerified:v,requiresDeviceHome:l,requiresWorkspaceAccess:N,homeLabel:d?A(d):null,workspaceCount:z.length}),ee=e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"user-code",className:"text-sm font-medium",children:"Device code"}),e.jsx(Se,{id:"user-code",value:u,disabled:r==="approve"||r==="deny",onChange:o=>{k.current+=1,b(o.target.value.toUpperCase()),P(null),ge(),V(null),g(null),s(null)},placeholder:"ABCD-1234",className:"font-mono text-center text-lg tracking-widest",maxLength:9,autoFocus:!t.user_code})]}),H=Z?e.jsx(We,{deviceName:m?.clientName??null,orgList:C,deviceHomeOrgId:R,onChange:V,orgsLoading:U,orgsError:T,onRetry:B,disabled:r!==null}):null,be=v?e.jsxs("div",{className:"space-y-5",children:[ee,e.jsx(Ee,{idPrefix:"oauth-device",clientName:m?.clientName??null,clientNote:E?"This device can run commands and control apps.":void 0,requestedScopes:D,accessLevel:G,onAccessLevelChange:I,allowNoAccess:E,disabled:r!==null,resource:m?.resource??null,logoUri:m?.logoUri??null,clientUri:m?.clientUri??null}),ue?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Can fetch tokens for your connected services."}):null,v&&l&&!Z&&d?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This device will live in ",A(d),".",N?" MCP access follows the device home.":""]}):null,H&&!K?H:null]}):ee,ke=K?e.jsxs("div",{className:"space-y-4",children:[H,l&&d?e.jsxs("p",{className:"text-xs text-muted-foreground",children:[A(d)," is always included as the device home. Additional workspaces grant MCP access only."]}):null,e.jsx(Re,{idPrefix:"oauth-device",heading:l?"Additional workspaces":void 0,allowMultiple:L,includedOrgId:l?R:null,orgList:C,selectedOrgIds:z,onWorkspaceAccessChange:ve,onSelectedOrgChange:fe,orgsLoading:U,orgsError:T,onRetry:B,disabled:r!==null})]}):void 0;return e.jsx(ne,{title:v?"Authorize application":"Connect a device",description:v?void 0:`Enter the code shown in your ${q}.`,busy:r!==null,error:w,review:be,aside:ke,below:v&&he&&O?e.jsx(Pe,{resourceOrg:O,accessLevel:G}):null,footer:v?e.jsx(re,{summary:ye,children:e.jsx(Te,{busy:r==="approve"||r==="deny"?r:null,approveDisabled:r!==null||!Q,denyDisabled:r!==null,onApprove:()=>X(!0),onDeny:()=>X(!1)})}):e.jsx(re,{children:e.jsx(ce,{type:"button",onClick:()=>W(_),disabled:r!==null||!_,children:r==="verify"?"Verifying...":"Continue"})})})}function We({deviceName:t,orgList:i,deviceHomeOrgId:p,onChange:n,orgsLoading:u,orgsError:b,onRetry:r,disabled:g}){const w=i.find(s=>s.id===p)??null;return e.jsxs("section",{className:"space-y-2 rounded-md border bg-card p-3 text-sm",children:[e.jsx("label",{htmlFor:"oauth-device-home",className:"block font-medium text-foreground",children:"Device home"}),u?e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground",children:"Loading your workspaces..."}):b?e.jsxs("div",{role:"alert",className:"space-y-2 text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:r,children:"Retry"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("select",{id:"oauth-device-home",value:w?.id??"",disabled:g,onChange:s=>n(s.target.value),className:"flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[w?null:e.jsx("option",{value:"",disabled:!0,children:"Choose a workspace"}),i.map(s=>e.jsx("option",{value:s.id,children:A(s)},s.id))]}),w&&!w.isPersonal?e.jsxs("p",{role:"note",className:"rounded-md bg-amber-500/10 px-3 py-2 text-amber-700 dark:text-amber-400",children:[t??"This device"," will be added to ",w.name,". Its Shell and Browser connections will be private to you — teammates can't use them unless you share them from the device page."]}):null,e.jsx("p",{className:"text-xs text-muted-foreground",children:"Where this device is registered. Its connectors and Automations run here. A device that is already paired keeps its workspace; change it from the Devices page."})]})]})}export{qe as component};
|
|
2
|
-
//# sourceMappingURL=device-D2eUt_nr.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as v,j5 as y,j as e,j6 as f,j7 as g,hV as C,j8 as k,B as A,L as E,dh as I,j9 as P,ja as N,jb as O,jc as w,u as F,jd as $,im as b}from"./index-C2TCKJDP.js";import{R as L}from"./detail-page-skeleton-BmxqqIsH.js";function z({connection:s,connectorDef:t,ownerSlug:a,openSettings:i=!1,authResult:o,showActivity:r=!0,embedded:n=!1,showShare:c=!0}){const[l,d]=v.useState(i);v.useEffect(()=>{i&&d(!0)},[i]);const u=s.id,m=s.connector_key,p=s.facets?.chat??!1,h=p?"Channels":"Feeds",j=s.has_operations===!0,_=s.feed_count>0||y(t),x=e.jsx(w,{connection:s,connectorDef:t,ownerSlug:a,showShare:c});return e.jsxs("div",{className:"space-y-6",children:[o&&e.jsx(f,{result:o}),s.auth_profile_kind==="oauth_account"&&e.jsx(g,{connection:s,connectorDef:t,onReview:()=>{d(!0),requestAnimationFrame(()=>document.getElementById("connection-auth")?.scrollIntoView({block:"nearest"}))}}),(_||j)&&e.jsxs("div",{className:n?"space-y-6":"grid grid-cols-1 items-start gap-3 sm:grid-cols-2",children:[_&&(n?e.jsx(C,{title:h,count:s.feed_count===1?"1 source":`${s.feed_count} sources`,action:y(t)?e.jsx(A,{asChild:!0,size:"sm",variant:"outline",children:e.jsxs(E,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:a,connectorKey:m,connectionId:String(u)},search:{addFeed:!0},children:[e.jsx(I,{className:"h-3.5 w-3.5"}),p?"Add channel":"Add source"]})}):null,children:e.jsx(k,{connection:s,ownerSlug:a,connectorKey:m,connectorDef:t})}):e.jsx(P,{connection:s,ownerSlug:a,title:h})),j&&(n?e.jsx(N,{connection:s,ownerSlug:a}):e.jsx(B,{connection:s,ownerSlug:a}))]}),n?e.jsx(O,{title:"Connection settings",summary:"name, visibility, credentials, remove",open:l,onOpenChange:d,children:x}):x,r&&e.jsx(C,{title:"Runs",children:e.jsx(L,{scope:{connectionId:u},ownerSlug:a})})]})}function B({connection:s,ownerSlug:t}){const a=F(),{data:i=[],isLoading:o,isError:r}=$(s.id),n=i.filter(l=>l.readiness==="scope_upgrade_required").length,c=o?"Loading actions…":r?"Could not load actions — open to retry":`${i.length} actions${n?` · ${n} need additional provider access`:" · permissions and approval policy"}`;return e.jsx(b,{title:"Actions",summary:c,onOpen:()=>a?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectionId:s.id,connectorKey:s.connector_key,organizationId:s.organization_id,ownerSlug:t}})})}const R=new Set(["Device was removed","Device was moved to another workspace"]);function K(s){const t=s.error_message??null;return!t||!R.has(t)?t:!!s.device_worker_id&&(s.device_last_seen_at!=null||s.device_worker_handle!=null||s.device_label!=null)?null:t}export{z as C,K as c};
|
|
2
|
-
//# sourceMappingURL=device-pin-tombstone-BFPbTM_o.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as x,n as C,j as e,bg as _,bh as m,bi as S,bj as b,bk as c,fM as u,dC as w}from"./index-C2TCKJDP.js";const h="__connection_picker_create_new__";function E({connections:s,value:r,onValueChange:n,connectorKey:a,disabled:d,placeholder:g="Choose a connection",includeWorkspaceEvents:o=!1,ariaLabel:p="Connection"}){const f=x(),l=C().org?.slug,i=a?s.filter(t=>t.connector_key===a):s,j=t=>{if(t===h){if(!l)return;f({to:"/$owner/connectors/create",params:{owner:l},search:a?{connector:a}:{}});return}n(t)};return e.jsxs(_,{value:r,onValueChange:j,disabled:d,children:[e.jsx(m,{"aria-label":p,children:e.jsx(S,{placeholder:g})}),e.jsxs(b,{children:[o?e.jsxs(e.Fragment,{children:[e.jsx(c,{value:"workspace",children:"Current workspace"}),i.length>0?e.jsx(u,{}):null]}):null,i.map(t=>e.jsx(c,{value:String(t.id),children:w(t)},t.id)),l?e.jsxs(e.Fragment,{children:[i.length>0||o?e.jsx(u,{}):null,e.jsx(c,{value:h,children:"Connect an app…"})]}):null]})]})}function k(s){const r=[];for(const n of s)typeof n.id=="number"&&r.push({id:n.id,name:n.name,entityType:n.entity_type}),n.children&&n.children.length>0&&r.push(...k(n.children));return r}export{E as C,k as f};
|
|
2
|
-
//# sourceMappingURL=entity-options-IUdQ-64R.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dP as we,r as E,bX as Se,j_ as S,ga as Re,ej as te,j as e,B as N,u as Q,jS as Ee,m as se,gk as me,j$ as Fe,M as De,c as he,b as Ce,bY as B,n as Le,w as Be,el as X,eH as Pe,jT as Te,k0 as Ve,cL as $e,c9 as ae,fB as Me,gf as Oe,cz as Ie,hy as Ae,hz as ze,hA as Ue,hB as He,hC as Ke,k1 as We,c0 as qe,T as K,U as ne,eK as Ge,a3 as Xe,g8 as ie,eV as W,cw as Ye,L as q,cx as G}from"./index-C2TCKJDP.js";import{N as Qe,d as Je,f as Ze,g as et,S as tt,h as st}from"./entity-pages-DJNSQrfB.js";import{R as at}from"./record-activity-BCpNKaUo.js";import{D as nt}from"./dynamic-schema-form-D3KnzCsW.js";import{r as it,V as ot}from"./views-access-required-BerT4Z1d.js";import{a as pe,V as oe,M as rt,b as lt}from"./view-param-filters-Bp84PUMd.js";import{m as ct,j as Y,d as dt,o as re,c as fe,R as xe,q as ut,r as mt}from"./renderer-ucwCQmBk.js";import"./table-1O-ik4_O.js";import{a as ht}from"./source-record-panels-LJIWGtHb.js";import{r as pt,R as le,b as ft}from"./events-feed-DwOkLk6A.js";import{a as xt}from"./record-session-KuEDuF3S.js";import"./schema-value-CefbtPIY.js";import"./home-toolbar-CpCcHA6z.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./runs-B_iywKWb.js";import"./event-kind-options-fHAIXu24.js";import"./clients-CydgUHrc.js";import"./client-activity-scopes-B7xVaUA-.js";import"./client-rows-B3LULJxW.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./use-automations-lV8PuE8L.js";import"./agent-loading-shells-BupiSjR-.js";import"./member-scope-gate-Doic_6qX.js";import"./app-bridge-C4nPtae3.js";import"./card-rE4Ctuy6.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";function gt(t,s){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function")return{shouldBlockFn:async()=>await t(),enableBeforeUnload:!0,withResolver:!1};const i=!!(t.condition??!0),n=t.blockerFn;return{shouldBlockFn:async()=>i&&n!==void 0?await n():i,enableBeforeUnload:i,withResolver:n===void 0}}function vt(t,s){const{shouldBlockFn:i,enableBeforeUnload:n=!0,disabled:a=!1,withResolver:c=!1}=gt(t),o=we(),{history:r}=o,[u,x]=E.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return E.useEffect(()=>{const p=async f=>{function l(j){const b=o.parseLocation(j),v=o.getMatchedRoutes(b.pathname);return v.foundRoute===void 0?{routeId:"__notFound__",fullPath:b.pathname,pathname:b.pathname,params:v.routeParams,search:o.options.parseSearch(j.search)}:{routeId:v.foundRoute.id,fullPath:v.foundRoute.fullPath,pathname:b.pathname,params:v.routeParams,search:o.options.parseSearch(j.search)}}const m=l(f.currentLocation),d=l(f.nextLocation);if(m.routeId==="__notFound__"&&d.routeId!=="__notFound__")return!1;const h=await i({action:f.action,current:m,next:d});if(!c)return h;if(!h)return!1;const k=await new Promise(j=>{x({status:"blocked",current:m,next:d,action:f.action,proceed:()=>j(!1),reset:()=>j(!0)})});return x({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),k};return a?void 0:r.block({blockerFn:p,enableBeforeUnload:n})},[i,n,a,c,r,o]),u}function U(t,s){return te(Y(t))===te(Y(s))}function jt(t,s){const i={};for(const n of new Set([...Object.keys(t),...Object.keys(s)]))U(t[n],s[n])||(i[n]=Y(t[n])??null);return Object.keys(i).length>0?i:void 0}function yt(t,s){return[...new Set([...Object.keys(t),...Object.keys(s)])].filter(i=>{try{return!U(t[i],s[i])}catch{return!0}})}function ce(t,s){return{name:t.name,slug:t.slug,metadata:ct(t.metadata??{},s)}}function bt(t,s,i){const n=new Set(i),a={},c={},o=new Set([...Object.keys(t.values.metadata),...Object.keys(t.baseline.metadata),...Object.keys(s.metadata)]);for(const r of o){const u=n.has(r),x=u?t.values.metadata[r]:t.baseline.metadata[r],p=U(x,s.metadata[r])?x:s.metadata[r];p!==void 0&&(a[r]=p);let f=!1;if(!u)try{f=!U(t.values.metadata[r],t.baseline.metadata[r])}catch{f=!0}const l=f?t.values.metadata[r]:p;l!==void 0&&(c[r]=l)}return{baseline:{name:s.name,slug:s.slug,metadata:a},values:{name:s.name,slug:s.slug,metadata:c}}}function kt({entity:t,schema:s,orgContext:i}){const n=E.useMemo(()=>ce(t,s),[t,s]),a=Se(S(t),n,s),c=Re(i),{values:o,baseline:r,commit:u}=a,x=E.useMemo(()=>yt(o.metadata,r.metadata),[o.metadata,r.metadata]),p=o.name!==r.name||o.slug!==r.slug,f=E.useCallback((m,d)=>a.setValues(h=>({...h,metadata:{...h.metadata,[m]:d}})),[a.setValues]),l=async({note:m}={})=>{if(typeof t.id!="number")throw new Error("Source records are read-only");if(!a.canSubmit)return null;const d=jt(o.metadata,r.metadata),h=o.name.trim()!==r.name.trim();if(!d&&!p)return null;const k=await c.mutateAsync({entityId:t.id,name:h?o.name.trim():void 0,slug:o.slug,metadata:d,field_note:d&&m?.trim()||void 0}),j=ce(k.entity,s);return u(b=>bt(b,j,Object.keys(d??{})),j),{held:k.blocked_fields??[],approvalUrl:k.approval_url}};return{values:o,baseline:r,revision:a.revision,setValues:a.setValues,setMetadataField:f,reset:a.reset,save:l,saving:c.isPending,dirtyKeys:x,identityDirty:p,isDirty:p||x.length>0,canSubmit:a.canSubmit,hasConflict:a.hasConflict,hasInvalidInput:a.hasInvalidInput}}const _t=3,Nt=50;function ge(t){const s=E.useRef(null);return E.useEffect(()=>{t&&(s.current?.scrollIntoView?.({block:"start"}),s.current?.focus())},[t]),s}function T({headingRef:t,children:s}){return e.jsx("h3",{ref:t,tabIndex:-1,className:"text-xs font-medium uppercase tracking-wide text-muted-foreground outline-none",children:s})}function wt({entityId:t,entityName:s,ownerSlug:i,orgContext:n,focus:a,collapsed:c=!1}){const o=Q(),r=ge(a),{data:u,isLoading:x,isError:p,refetch:f}=Ee(t,n,{limit:Nt});if(t===void 0)return null;if(x)return e.jsxs("section",{className:"space-y-2","aria-busy":"true",children:[e.jsx(T,{headingRef:r,children:"Linked"}),e.jsx(se,{className:"h-4 w-24"}),e.jsx(se,{className:"h-6 w-full rounded-md"})]});if(p||!u)return e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:r,children:"Linked"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Could not load this record's links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void f(),children:"Retry"})]})]});if(u.countsByType.length===0&&!u.hasMore&&!u.failures?.length)return a?e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:r,children:"Linked"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No links to other records yet."})]}):null;if(c){const l=u.countsByType.flatMap(m=>{const d=m.count===1?u.rows.find(h=>h.relationship_type_slug===m.relationship_type_slug):void 0;return d?[pt(d,m.relationship_type_name)]:[m.relationship_type_name,String(m.count)]});return e.jsxs("section",{className:"space-y-1","aria-label":"Linked records",children:[e.jsx(T,{headingRef:r,children:"Linked"}),e.jsx(le,{count:u.failures?.length??0,onRetry:()=>void f()}),e.jsx("p",{"data-testid":"linked-summary",className:"truncate text-sm text-muted-foreground",children:l.join(" · ")})]})}return e.jsxs("section",{className:"space-y-3","aria-label":"Linked records",children:[e.jsx(T,{headingRef:r,children:"Linked"}),e.jsx(le,{count:u.failures?.length??0,onRetry:()=>void f()}),u.hasMore&&o?e.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:()=>o.open({href:"",key:`record-links:${t}`,title:"Linked records",recordLinks:{entityId:t,entityName:s,ownerSlug:i,orgContext:n,label:"Linked records"}}),children:"Browse linked records"}):null,u.countsByType.map(l=>{const m=u.rows.filter(h=>h.relationship_type_slug===l.relationship_type_slug).slice(0,_t),d=l.count>m.length;return e.jsxs("div",{className:"space-y-1 text-sm",children:[d||m.length===0?e.jsxs("p",{className:"text-muted-foreground",children:[l.relationship_type_name,d?e.jsxs("span",{className:"tabular-nums text-muted-foreground/70",children:[" ","· ",l.count,u.countsScope==="page"?" shown":""]}):null]}):null,e.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[m.map(h=>e.jsx(ft,{row:h,label:l.relationship_type_name,entityId:t,ownerSlug:i,orgContext:n},h.id)),d&&o?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-primary hover:text-primary",onClick:()=>o.open({href:"",key:`record-links:${t}:${l.relationship_type_slug}`,title:`${l.relationship_type_name} · ${l.count}`,recordLinks:{entityId:t,entityName:s,ownerSlug:i,orgContext:n,relationshipType:l.relationship_type_slug,label:l.relationship_type_name}}),children:["Show all ",l.count]}):null]})]},l.relationship_type_slug)})]})}function St({record:t,ownerSlug:s,orgContext:i,focus:n}){const[a,c]=E.useState(n),o=ge(n);return e.jsxs("section",{className:"space-y-2",children:[e.jsx(T,{headingRef:o,children:"Linked"}),a?e.jsx(ht,{record:t,ownerSlug:s,orgContext:i}):e.jsx(N,{type:"button",variant:"outline",size:"sm",className:"h-7",onClick:()=>c(!0),children:"Find linked records"})]})}const Rt="$name";function ve({outcome:t,schema:s}){if(!t||t.held.length===0)return null;const i=s?.properties??{},n=t.held.map(a=>a===Rt?"Name":dt(a,i[a]??{}));return e.jsxs("div",{role:"status",className:"rounded-md bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300",children:[n.join(", ")," ",n.length===1?"needs":"need"," approval before ",n.length===1?"it changes":"they change",".",t.approvalUrl?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:t.approvalUrl,className:"underline",children:"Review"})]}):null]})}const Et=320,Ft={},Dt=()=>{};function Ct({view:t,orgSlug:s,recordUrl:i,scope:n}){const a=Q(),c=`${i}${me(t.key)}`,o=a?()=>a.open({href:c,title:t.name}):void 0;return e.jsxs("section",{className:"min-w-0 rounded-lg border","data-testid":"view-card","data-view":t.key,children:[e.jsxs("header",{className:"flex items-start justify-between gap-3 px-4 pt-3 pb-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"truncate text-sm font-medium",children:t.name}),t.description?e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}):null]}),o?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-muted-foreground hover:text-foreground",onClick:o,"aria-label":`Open ${t.name}`,children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),"Open"]}):null]}),e.jsx("div",{className:"px-4 pb-3",children:e.jsx(pe,{orgSlug:s,viewKey:t.key,scope:n,params:Ft,onParamsChange:Dt,contentHash:t.content_hash,title:t.name,minHeight:64,displayMode:"inline",maxHeight:Et,onRequestDisplayMode:o?r=>{r==="fullscreen"&&o()}:void 0})})]})}function Lt({recordUrl:t,dirty:s,onDiscard:i}){const n=vt({disabled:!s,enableBeforeUnload:s,withResolver:!0,shouldBlockFn:({next:c})=>c.pathname!==t&&!c.pathname.startsWith(`${t}${me("")}`)}),a=n.status==="blocked";return e.jsx(Ae,{open:a,onOpenChange:c=>{!c&&a&&n.reset()},children:e.jsxs(ze,{className:"max-w-sm",children:[e.jsxs(Ue,{children:[e.jsx(He,{children:"Discard unsaved changes?"}),e.jsx(Ke,{children:"This record has edits that are not saved. Leaving discards them."})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{type:"button",variant:"ghost",onClick:()=>a&&n.reset(),children:"Keep editing"}),e.jsx(N,{type:"button",variant:"destructive",onClick:()=>{a&&(i(),n.proceed())},children:"Discard"})]})]})})}const de=6;function Bt({entity:t,ownerSlug:s,orgContext:i,recordUrl:n,schema:a,entityTypeName:c,isTypeLoading:o,record:r,canEdit:u,editing:x,onEditingChange:p,outcome:f,onSaved:l,formId:m,fieldLimit:d,onDeleted:h}){const k=x&&u,j=Q(),b={entity:{id:S(t),name:t.name,entity_type:t.entity_type},ownerSlug:s,orgContext:i,schema:a,record:r,editing:k};xt(b);const v=j?.item?.recordField,D={ownerSlug:s,orgContext:i,controls:t.field_controls,dirtyKeys:r.dirtyKeys,openField:j?L=>j.open(it(b,L.key)):void 0,openFieldKey:v?.entityId===S(t)?v.field:void 0},C=e.jsx(Lt,{recordUrl:n,dirty:k&&r.isDirty,onDiscard:()=>{r.reset(),p(!1)}});if(o)return e.jsx(Ie,{rows:6});if(k)return e.jsxs(e.Fragment,{children:[C,e.jsx(Pt,{formId:m,entity:t,entityTypeName:c,schema:a,record:r,orgContext:i,renderControl:(L,P,F)=>ut(P)?e.jsx(mt,{field:{key:L,prop:P},value:F,context:D}):void 0,onSaved:l,onDeleted:h,onDone:()=>p(!1)})]});const R=fe(r.revision);return e.jsxs("div",{className:"space-y-3",children:[e.jsx(ve,{outcome:f,schema:a}),e.jsx(xe,{fields:R,fieldLimit:d,values:r.values.metadata,context:D})]})}function Pt({formId:t,entity:s,entityTypeName:i,schema:n,record:a,orgContext:c,renderControl:o,onSaved:r,onDeleted:u,onDone:x}){const p=We(),f=s.field_controls,{name:l,slug:m,metadata:d}=a.values,h=g=>a.setValues(y=>({...y,name:g})),k=g=>a.setValues(y=>({...y,slug:g})),j=g=>a.setValues(y=>({...y,metadata:g})),[b,v]=B(S(s),""),[D,C]=B(S(s),null),[R,L]=B(S(s),null),[P,F]=B(S(s),!1),[w,V]=B(S(s),null),$=a.dirtyKeys.length>0,I=async g=>{if(g.preventDefault(),!!a.canSubmit){if(C(null),!l.trim()){C("Name is required");return}try{const y=await a.save({note:b});L(y),r(y),v(""),y?.held.length||x()}catch(y){C(y instanceof Error?y.message:"Failed to update entity")}}},H=async()=>{V(null);try{if(typeof s.id!="number")throw new Error("Source records are read-only");await p.mutateAsync({entityId:s.id}),F(!1),u?.()}catch(g){V(g instanceof Error?g.message:"Failed to delete entity")}},A=[s.total_content>0&&`${s.total_content} content item${s.total_content===1?"":"s"}`,s.automations_count>0&&`${s.automations_count} Automation${s.automations_count===1?"":"s"}`,s.active_connections>0&&`${s.active_connections} connector${s.active_connections===1?"":"s"}`].filter(Boolean).join(", ");return e.jsxs("form",{id:t,onSubmit:I,className:"space-y-4",children:[e.jsx(qe,{visible:a.hasConflict,onReload:a.reset}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(K,{htmlFor:"sidebar-name",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ne,{id:"sidebar-name",value:l,onChange:g=>h(g.target.value)})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"sidebar-slug",children:"URL Slug"}),e.jsx(ne,{id:"sidebar-slug",value:m,onChange:g=>k(g.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))})]}),a.revision&&Object.keys(a.revision).length>0&&e.jsxs(e.Fragment,{children:[e.jsx(tt,{}),e.jsx(nt,{schema:a.revision,values:d,onValuesChange:j,fieldControls:f,orgContext:c,renderControl:o})]}),$&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(K,{htmlFor:"sidebar-correction-note",children:"Correction note (optional)"}),e.jsx(Ge,{id:"sidebar-correction-note",value:b,onChange:g=>v(g.target.value),placeholder:"Why are you changing these fields? Helps Automations respect the correction.",rows:2})]}),D&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:D}),e.jsx(ve,{outcome:R,schema:n}),P?e.jsxs("div",{className:"space-y-3 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5 text-sm",children:[e.jsx(Xe,{className:"h-4 w-4 shrink-0 text-destructive mt-0.5"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-medium text-foreground",children:['Delete "',s.name,'"?']}),A&&e.jsxs("p",{className:"text-muted-foreground",children:["Removes ",A,". This cannot be easily undone."]})]})]}),w&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-2.5 py-1.5 text-sm text-destructive",children:w}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:()=>{F(!1),V(null)},children:"Cancel"}),e.jsx(N,{type:"button",variant:"destructive",size:"sm",onClick:H,disabled:p.isPending,children:p.isPending?"Deleting...":`Delete ${i||"entity"}`})]})]}):e.jsx("div",{className:"pt-2",children:e.jsx(N,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>F(!0),children:"Delete"})})]})}function je(t,s){const i=new Set(t.measure_columns??[]),n=s?.properties??{};return Object.keys(t.metadata??{}).filter(a=>a!=="id"&&a!=="slug"&&a!=="name"&&!Me(n[a])&&n[a]?.const===void 0).map(a=>({key:a,prop:n[a]??{},label:n[a]?.["x-table-label"]??(i.has(a)?a:Oe(a.replace(/_/g," "))),numeric:i.has(a)}))}function Tt({entity:t,schema:s,ownerSlug:i,fieldLimit:n}){const a=je(t,s);return e.jsxs("div",{children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Managed by the source"}),e.jsx(xe,{fields:a,fieldLimit:n,values:t.metadata??{},context:{ownerSlug:i}})]})}const ue="owletto:record-details-expanded";function Vt(){const[t,s]=E.useState(()=>{try{return window.localStorage.getItem(ue)==="1"}catch{return!1}});return[t,n=>{s(n);try{window.localStorage.setItem(ue,n?"1":"0")}catch{}}]}function $t({namespace:t,entity:s,recordUrl:i,viewKey:n,title:a,onDeleted:c}){const o=De({strict:!1}),r=he(),u=E.useRef(null),x=Ce(u,Qe),[p,f]=Vt(),[l,m]=B(S(s),!1),d={slug:t.slug,organizationId:t.id},{isMember:h,isPublic:k,isLoading:j}=Le(t.slug),b=h||k,v=Be({...d,organizationId:h?t.id:null}),{data:D,isLoading:C}=X(s.entity_type,d),R=D?.metadata_schema,{isAdmin:L,isLoading:P}=Pe(h?d.organizationId:void 0),F=h&&L&&!P&&!s.is_derived,w=kt({entity:s,schema:R,orgContext:d}),[V,$]=B(S(s),null),I=`record-form-${s.id}`,H=l&&F,A=b?v.data??[]:[],g=Te(A,{type:s.entity_type,id:S(s)}),y=Ve(g,n),z=!n&&o.tab==="relationships",ye=_=>void r({to:".",search:_,replace:!0}),J={type:s.entity_type,entity:s.is_derived?s.slug:s.id??s.slug},M=x&&!p&&!l&&!z,Z=s.is_derived?re(je(s,R),s.metadata??{}).length:re(fe(w.revision),w.values.metadata).length,ee=M?de:void 0,be=e.jsxs("div",{className:"space-y-6",children:[s.is_derived?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{entity:s,schema:R,ownerSlug:t.slug,fieldLimit:ee}),e.jsx(St,{record:{type:s.entity_type,key:s.slug},ownerSlug:t.slug,orgContext:d,focus:z})]}):e.jsxs(e.Fragment,{children:[e.jsx(Bt,{entity:s,ownerSlug:t.slug,orgContext:d,recordUrl:i,schema:R,entityTypeName:D?.name,isTypeLoading:C,record:w,canEdit:F,editing:l,onEditingChange:m,outcome:V,onSaved:$,formId:I,fieldLimit:ee,onDeleted:c}),e.jsx(wt,{entityId:typeof s.id=="number"?s.id:void 0,entityName:s.name,ownerSlug:t.slug,orgContext:d,focus:z,collapsed:M})]}),x&&!l&&!z?e.jsx(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-primary hover:text-primary","aria-expanded":!M,onClick:()=>f(M),children:M?Z>de?`Show all ${Z} fields`:"Show all details":"Show fewer"}):null]}),ke=_=>e.jsx(Ze,{rootRef:u,narrow:x,details:be,summary:e.jsx(et,{entity:s,schema:R}),children:_}),_e=H?e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:()=>{w.reset(),$(null),m(!1)},children:"Cancel"}),e.jsx(N,{type:"submit",form:I,size:"sm",disabled:!w.canSubmit||!w.isDirty||w.saving||!w.values.name.trim(),children:w.saving?"Saving...":"Save"})]}):F&&!C?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5 px-2 text-muted-foreground hover:text-foreground",onClick:()=>{$(null),m(!0)},children:[e.jsx($e,{className:"h-3.5 w-3.5"}),"Edit"]}):null,O=_=>e.jsx(Je,{entity:s,owner:t.slug,schema:R,title:a??null,actions:_e,layout:"content",children:_});if(n&&!b)return O(j?null:e.jsx(ot,{}));if(n&&v.data===void 0)return O(v.isError?e.jsx(oe,{onRetry:()=>void v.refetch()}):null);if(y.kind==="missing")return O(e.jsx(rt,{viewKey:y.key,backTo:i,backLabel:`Back to ${s.name}`}));if(y.kind==="view"){const{view:_}=y;return O(e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsx(lt,{decls:_.params,params:ae(o),onParamsChange:Ne=>void r({to:".",search:Ne})}),e.jsx(pe,{orgSlug:t.slug,viewKey:_.key,scope:J,params:ae(o),onParamsChange:ye,contentHash:_.content_hash,title:_.name,minHeight:320})]}))}return O(ke(e.jsxs("div",{className:"min-w-0 space-y-4",children:[b&&v.isError&&e.jsx(oe,{onRetry:()=>void v.refetch()}),g.map(_=>e.jsx(Ct,{view:_,orgSlug:t.slug,recordUrl:i,scope:J},_.key)),e.jsxs("section",{"aria-labelledby":"record-activity-heading",className:"min-w-0",children:[e.jsx("h2",{id:"record-activity-heading",className:"mb-2 text-sm font-medium text-muted-foreground",children:"Activity"}),e.jsx(at,{entity:s,organizationId:t.id,ownerSlug:t.slug})]})]})))}function Mt(t){return t?.trim()?t:void 0}function vs({namespace:t,path:s,entity:i,viewKey:n}){const a=he(),{data:c}=X(i.entity_type,{slug:t.slug}),o=s[0]?.entity_type??i.entity_type,{data:r}=X(o,{slug:t.slug}),u=Mt(c?.icon),x=s.map(l=>({entity_type:l.entity_type,slug:l.slug})),p=`/${t.slug}/${ie(i.entity_type)}`,f=W(t.slug,x);return e.jsxs("div",{className:"mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsx(Ye,{crumbs:[...o==="$member"?[]:[e.jsx(q,{to:"/$owner/data",params:{owner:t.slug},className:G,children:"Memory"},"memory")],e.jsx(q,{to:`/${t.slug}/${ie(o)}`,className:G,children:o==="$member"?"Team":r?.name??o},"type"),...s.slice(0,-1).map((l,m)=>e.jsx(q,{to:W(t.slug,x.slice(0,m+1)),className:G,children:l.name},l.id))],current:i.name}),e.jsx($t,{namespace:t,entity:i,recordUrl:f,viewKey:n,title:e.jsx(st,{entity:i,schema:c?.metadata_schema,icon:u}),onDeleted:()=>{const l=s.slice(0,-1);l.length>0?a({to:W(t.slug,l)}):a({to:p})}})]})}export{vs as EntityPage};
|
|
2
|
-
//# sourceMappingURL=entity-page-B3Im65EI.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as x,j as e,bp as ue,i as H,e3 as me,e4 as xe,B as T,gh as he,e7 as pe,dE as ge,fi as ne,gf as F,fB as fe,dm as P,a2 as q,L as A,eV as je,b as ve,m as E}from"./index-C2TCKJDP.js";import{p as S,n as be,e as re,b as ye,g as Ne,f as J,R as we,c as _e}from"./renderer-ucwCQmBk.js";import{S as U}from"./schema-value-CefbtPIY.js";import{T as Se,a as ke,b as $,c as Y,d as Ce,e as K}from"./table-1O-ik4_O.js";var Ee="Separator",ee="horizontal",Re=["horizontal","vertical"],ae=x.forwardRef((t,s)=>{const{decorative:n,orientation:a=ee,...i}=t,o=Le(a)?a:ee,h=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return e.jsx(ue.div,{"data-orientation":o,...h,...i,ref:s})});ae.displayName=Ee;function Le(t){return Re.includes(t)}var oe=ae;const Me=x.forwardRef(({className:t,orientation:s="horizontal",decorative:n=!0,...a},i)=>e.jsx(oe,{ref:i,decorative:n,orientation:s,className:H("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...a}));Me.displayName=oe.displayName;function Ae({choices:t,visible:s,onChange:n}){return e.jsxs(me,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground hover:text-foreground","aria-label":"Choose columns",title:"Choose columns",children:e.jsx(he,{className:"h-4 w-4"})})}),e.jsxs(pe,{align:"end",className:"max-h-80 overflow-y-auto p-3",children:[e.jsx("p",{className:"mb-2 text-sm font-medium",children:"Visible columns"}),t.map(a=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 py-1.5 text-sm",children:[e.jsx("input",{type:"checkbox",checked:!s||s.includes(a.field),onChange:i=>{const o=s??t.map(c=>c.field);n(i.target.checked?[...o,a.field]:o.filter(c=>c!==a.field))}}),a.label]},a.field))]})]})}function Pe({direction:t}){return t?e.jsxs("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:t==="asc"?"Sort ascending":"Sort descending"}),t==="asc"?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]}):e.jsxs("svg",{className:"h-4 w-4 text-muted-foreground/50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("title",{children:"Sort"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})]})}function te(t,s){const n=t?.properties;if(n)return Object.entries(n).find(([,a])=>a[s])?.[0]}function Te(t){const s=t.trim(),n=s.split(/[\s._@/-]+/).filter(Boolean),a=n.length>=2?`${n[0][0]}${n[1][0]}`:(n[0]??s).slice(0,2);let i=0;for(let o=0;o<s.length;o++)i=i*31+s.charCodeAt(o)>>>0;return{initials:a.toUpperCase()||"?",hue:i%360}}function Fe(t){const[s,n]=x.useState();return x.useEffect(()=>{if(!t||!globalThis.crypto?.subtle){n(void 0);return}let a=!1;const i=t.trim().toLowerCase();return crypto.subtle.digest("SHA-256",new TextEncoder().encode(i)).then(o=>{a||n(Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join(""))}),()=>{a=!0}},[t]),s?`https://www.gravatar.com/avatar/${s}?d=identicon&s=80`:void 0}function ie({metadata:t,metadataSchema:s,name:n,typeIcon:a,className:i="h-6 w-6",iconClassName:o="h-5 w-5",initialsFallback:c=!1}){const h=te(s,"x-image"),j=te(s,"x-email"),y=h&&t?.[h]||void 0,v=j&&t?.[j]||void 0,N=Fe(y?void 0:v),w=y||N,[k,R]=x.useState(!1);if(x.useEffect(()=>{R(!1)},[w]),w&&!k)return e.jsx("img",{src:w,alt:n,referrerPolicy:"no-referrer",onError:()=>R(!0),className:H("rounded-full object-cover border border-border",i)});if(c){const L=n.trim()||v||Oe(t,s)||n,{initials:O,hue:z}=Te(L);return e.jsx("span",{role:"img","aria-label":n,className:H("inline-grid place-items-center rounded-full border border-border font-semibold text-white select-none",i),style:{background:`oklch(0.55 0.13 ${z})`,fontSize:"0.85em"},children:O})}return e.jsx(ge,{icon:a,className:o})}function Oe(t,s){if(!t)return;const n=s?.properties,a=["email","handle","username","login","github","x_handle","slug"],i=Object.keys(n||t);for(const o of i)if(a.includes(o.toLowerCase())){const c=t[o];if(typeof c=="string"&&c.trim())return c}}function _({column:t,children:s,alignRight:n=!1}){return e.jsxs("button",{type:"button",className:`flex items-center gap-1.5 whitespace-nowrap text-left transition-colors hover:text-foreground [&>svg]:shrink-0${n?" ml-auto":""}`,onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[s,e.jsx(Pe,{direction:t.getIsSorted()})]})}function se(t,s,n){const a=ne(t?.properties).filter(([o,c])=>(!s||o!=="name")&&!c["x-image"]&&c["x-table-column"]===!0);if(a.length)return a.map(([o,c])=>({field:o,label:c["x-table-label"]??F(o.replaceAll("_"," "))}));if(!s)return[];const i=n.find(o=>Object.keys(S(o.metadata)).length>0);return Object.keys(S(i?.metadata)).filter(o=>o!=="id"&&o!=="slug"&&o!=="name"&&!fe(t?.properties?.[o])).map(o=>({field:o,label:F(o.replaceAll("_"," "))}))}function ze(t){return t.some(s=>Object.hasOwn(S(s.metadata),"name"))}function Ie(t,s){return P(t,re(s))}function Be(t){return`${t.entityType}:${t.lookupField}`}const $e=new Set(["stage","category","round_type","investor_type"]);function Ke(t,s){const n=t.toLowerCase();return n==="mrr"||n==="arr"||n==="revenue"||n==="valuation"||n==="funding_raised"||n==="fund_size"||n.endsWith("_usd")||s.description?.toLowerCase().includes("usd")===!0}function He(t,s){if(Ke(t,s))return"currency";if($e.has(t)||t.endsWith("_slug"))return"enum"}function Ue({entities:t,owner:s,schema:n,entityTypeIcon:a,isDerived:i,measureColumns:o,linkedEntityLookups:c,hasAnyParents:h,sorting:j,onSortingChange:y,visibleColumns:v,columnChoices:N,onVisibleColumnsChange:w,page:k,pageSize:R,totalCount:L,hasMore:O,pageTitle:z,onPrevPage:le,onNextPage:ce}){const M=N?.length&&w?e.jsx(Ae,{choices:N,visible:v,onChange:w}):null,f=n?.properties,V=!i||ze(t),W=x.useMemo(()=>f?Object.fromEntries(Object.entries(f).flatMap(([l,r])=>r["x-link-entity-type"]?[[l,{entityType:r["x-link-entity-type"],lookupField:r["x-link-lookup-field"]||"slug"}]]:[])):{},[f]),C=x.useMemo(()=>f?se({properties:f},i,[]).map(({field:r})=>[r,f[r]]).map(([r,u])=>{const m=W[r],d=m?c[Be(m)]:void 0;return{id:i?r:`meta_${r}`,accessorFn:p=>{const g=S(p.metadata);return be(g[r],u.enum)},header:({column:p})=>{const g=u["x-table-label"]||u.title||u.description||F(r.replace(/_/g," "));return i?e.jsx(_,{column:p,children:g}):g},cell:({getValue:p})=>e.jsx(U,{value:p(),prop:u,format:He(r,u),className:"text-muted-foreground",resolveLink:d?g=>{const b=d[g];return b?{label:b.name,to:P(s,[{entity_type:b.entity_type,slug:b.slug}])}:void 0}:void 0})}}):[],[i,W,c,s,f]),D=x.useMemo(()=>new Set(o),[o]),I=x.useMemo(()=>!i||C.length>0?[]:se({properties:f},!0,t).map(({field:r})=>r).map(r=>{const u=D.has(r);return{id:r,accessorFn:m=>S(m.metadata)[r],header:({column:m})=>e.jsxs(_,{column:m,children:[u?r:F(r.replace(/_/g," ")),u&&e.jsx(q,{variant:"secondary",className:"font-normal lowercase",children:"measure"})]}),cell:({getValue:m})=>e.jsx(U,{value:m(),prop:f?.[r],className:u?"tabular-nums":"text-muted-foreground"}),meta:u?{align:"right"}:void 0}}),[i,C,t,D,f]),G=x.useMemo(()=>{const l=n?.["x-table-relationships"];return!l||l.length===0?[]:l.map(r=>({id:`rel_${r.relationship_type}`,accessorFn:u=>u.relationships?.[r.relationship_type]??[],header:r.label,cell:({getValue:u})=>{const m=u();return!m||m.length===0?e.jsx("span",{className:"text-muted-foreground",children:"-"}):e.jsx("div",{className:"flex flex-wrap gap-1",children:m.map((d,p)=>{const g=P(s,[{entity_type:d.entity_type,slug:d.slug}]);return e.jsxs("span",{children:[e.jsx(A,{to:g,className:"text-primary hover:underline",onClick:b=>b.stopPropagation(),children:d.name}),p<m.length-1&&","]},d.id)})})}}))},[s,n]),Q=x.useMemo(()=>h||t.some(r=>r.parent_name&&r.parent_slug&&r.parent_entity_type)?[{id:"parent",accessorFn:r=>r.parent_name,header:"Parent",cell:({row:r})=>{if(!r.original.parent_name||!r.original.parent_slug||!r.original.parent_entity_type)return e.jsx("span",{className:"text-muted-foreground",children:"-"});const u=P(s,[{entity_type:r.original.parent_entity_type,slug:r.original.parent_slug}]);return e.jsx(A,{to:u,className:"text-primary hover:underline",children:r.original.parent_name})}}]:[],[t,h,s]),X=x.useMemo(()=>{const l=[],r=t.some(d=>(d.total_content??0)>0),u=t.some(d=>(d.active_connections??0)>0),m=t.some(d=>(d.automations_count??0)>0);return r&&l.push({accessorKey:"total_content",header:({column:d})=>e.jsx(_,{column:d,alignRight:!0,children:"Activity"}),cell:({row:d,getValue:p})=>{const g=p()??0;if(g===0)return e.jsx("span",{className:"tabular-nums",children:"0"});const b=re(d.original);return e.jsx(A,{to:je(s,b),className:"tabular-nums hover:underline",children:g})},meta:{align:"right"}}),u&&l.push({accessorKey:"active_connections",header:"Connectors",cell:({getValue:d})=>{const p=d();return p&&p>0?e.jsxs(q,{variant:"outline",className:"text-green-600 dark:text-green-400",children:[p," active"]}):e.jsx("span",{className:"text-muted-foreground",children:"-"})},meta:{align:"right"}}),m&&l.push({accessorKey:"automations_count",header:({column:d})=>e.jsx(_,{column:d,alignRight:!0,children:"Automations"}),cell:({getValue:d})=>e.jsx("span",{className:"tabular-nums",children:d()??0}),meta:{align:"right"}}),l},[t,s]),Z=x.useMemo(()=>[{accessorKey:"name",header:({column:l})=>V?e.jsx(_,{column:l,children:"Name"}):"Name",cell:({row:l})=>{const r=S(l.original.metadata);return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{metadata:r,metadataSchema:n,name:l.original.name,typeIcon:a,className:"h-6 w-6 shrink-0"}),e.jsx("div",{className:"min-w-0",children:(()=>{const u=Ie(s,l.original);return e.jsx(A,{to:u,className:"block max-w-56 truncate font-medium hover:underline",title:l.original.name,children:l.original.name})})()})]})}},...Q,...C,...I,...G,...X,...i?[]:[{accessorKey:"created_at",header:({column:l})=>e.jsx(_,{column:l,children:"Created"}),cell:({getValue:l})=>e.jsx("span",{className:"whitespace-nowrap text-muted-foreground",children:new Date(l()).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})}]],[s,Q,C,I,G,X,n,a,i,V]),B=ye({data:t,columns:Z,state:{sorting:j,columnVisibility:Object.fromEntries([...C,...I].flatMap(l=>l.id?[[l.id,!v||v.includes(i?l.id:l.id.replace(/^meta_/,""))]]:[]))},onSortingChange:y,getCoreRowModel:Ne(),manualSorting:!0,enableSortingRemoval:!1}),de=t.length>0||k>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border",children:e.jsxs(Se,{className:"min-w-[48rem]",children:[e.jsx(ke,{children:B.getHeaderGroups().map(l=>e.jsxs($,{children:[l.headers.map(r=>e.jsx(Y,{"aria-sort":r.column.getIsSorted()==="asc"?"ascending":r.column.getIsSorted()==="desc"?"descending":void 0,className:r.column.columnDef.meta?.align==="right"?"text-right":"",children:r.isPlaceholder?null:J(r.column.columnDef.header,r.getContext())},r.id)),M?e.jsx(Y,{className:"w-10 pr-2 text-right",children:M}):null]},l.id))}),e.jsx(Ce,{children:B.getRowModel().rows.length?B.getRowModel().rows.map(l=>e.jsxs($,{children:[l.getVisibleCells().map(r=>e.jsx(K,{className:r.column.columnDef.meta?.align==="right"?"whitespace-nowrap text-right":"",children:J(r.column.columnDef.cell,r.getContext())},r.id)),M?e.jsx(K,{}):null]},l.id)):e.jsx($,{children:e.jsx(K,{colSpan:Z.length+(M?1:0),className:"h-24 text-center",children:"No results found."})})})]})}),de&&e.jsxs("div",{className:"mt-4 flex flex-col gap-2 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:["Showing ",t.length," of ",L," ",z.toLowerCase()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{children:["Page ",k+1," of ",Math.max(1,Math.ceil(L/R))]}),e.jsx(T,{variant:"outline",size:"sm",onClick:le,disabled:k===0,children:"Previous"}),e.jsx(T,{variant:"outline",size:"sm",onClick:ce,disabled:!O,children:"Next"})]})]})]})}const Ve=720;function We(){return e.jsxs("div",{className:"space-y-4","aria-label":"Loading entities",role:"status",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(E,{className:"h-9 max-w-sm flex-1"}),e.jsx(E,{className:"h-9 w-28"})]}),e.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[e.jsx("div",{className:"border-b px-4 py-3",children:e.jsx(E,{className:"h-3 w-1/3"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:5},(t,s)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsx(E,{className:"h-3 flex-1"}),e.jsx(E,{className:"h-3 w-16 shrink-0"})]},s))})]})]})}function et({title:t,actions:s,controls:n,table:a,children:i,loading:o=!1,error:c=null,onRetry:h,empty:j=e.jsx("p",{className:"py-12 text-center text-sm text-muted-foreground",children:"No records."})}){return e.jsxs("div",{className:"@container space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[typeof t=="string"?e.jsx("h2",{className:"text-lg font-semibold",children:t}):t,s]}),e.jsxs("div",{children:[n,o?e.jsx(We,{}):c!==null?e.jsxs("div",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-6 text-sm text-destructive",children:[c,h?e.jsx(T,{className:"ml-3",variant:"outline",size:"sm",onClick:h,children:"Retry"}):null]}):i!==void 0?i:a?e.jsx(Ue,{...a}):j]})]})}function De(t,s){return s?.properties?ne(s.properties).map(([n,a])=>({key:n,prop:a})):Object.keys(t.metadata??{}).map(n=>({key:n,prop:{}}))}function Ge({entity:t,schema:s,icon:n}){return e.jsxs(e.Fragment,{children:[e.jsx(ie,{metadata:t.metadata,metadataSchema:s?{...s}:void 0,name:t.name,typeIcon:n,className:"h-6 w-6 shrink-0"}),e.jsx("h2",{className:"truncate text-lg font-semibold leading-tight",children:t.name})]})}function Qe({entity:t,schema:s}){const n=_e(s?{...s}:void 0).filter(({key:a,prop:i})=>i["x-table-column"]===!0&&!i["x-image"]&&t.metadata?.[a]!==void 0&&t.metadata[a]!==null&&t.metadata[a]!=="");return n.length?e.jsx("p",{"data-testid":"record-summary",className:"-mt-2 truncate text-sm text-muted-foreground tabular-nums",children:n.map(({key:a,prop:i},o)=>e.jsxs("span",{children:[o>0?" · ":null,e.jsx(U,{value:t.metadata?.[a],prop:i})]},a))}):null}function Xe({details:t,summary:s,children:n,rootRef:a,narrow:i}){return e.jsx("div",{ref:a,className:"min-w-0 space-y-4",children:i?e.jsxs(e.Fragment,{children:[s,e.jsx("section",{"aria-label":"Details","data-testid":"record-details",children:t}),n]}):e.jsxs("div",{className:"grid grid-cols-[18rem_minmax(0,1fr)] gap-6",children:[e.jsx("aside",{className:"sticky top-12 max-h-[calc(100dvh-7rem)] min-w-0 self-start overflow-y-auto overscroll-contain pr-2 pb-16",children:t}),n]})})}function tt({entity:t,owner:s,schema:n,title:a,actions:i,details:o,summary:c,children:h,layout:j="record"}){const y=x.useRef(null),v=ve(y,Ve),N=e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"record-header",className:"sticky top-0 z-30 -mx-4 flex h-12 items-center justify-between gap-3 bg-background px-4 lg:-mx-6 lg:px-6",children:[e.jsx("div",{className:"flex min-w-0 items-center gap-2",children:a===void 0?e.jsx(Ge,{entity:t,schema:n}):a}),i]}),j==="content"?h:e.jsx(Xe,{rootRef:y,narrow:v,details:o===void 0?e.jsx(we,{fields:De(t,n),values:t.metadata??{},context:{ownerSlug:s}}):o,summary:c===void 0?e.jsx(Qe,{entity:t,schema:n}):c,children:h})]});return j==="content"?N:e.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col gap-4 px-4 pt-2.5 pb-8 lg:px-6",children:N})}export{ie as E,Ve as N,Me as S,Ue as a,et as b,We as c,tt as d,se as e,Xe as f,Qe as g,Ge as h};
|
|
2
|
-
//# sourceMappingURL=entity-pages-DJNSQrfB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{w as R,r as E,gY as $,gZ as G,cP as z,bG as Y,z as Z,a8 as J,g_ as K,gv as W,j as a,c8 as T,L as X}from"./index-C2TCKJDP.js";import{E as ee}from"./events-feed-DwOkLk6A.js";import{b as se,a as te,V as ne,M as ae}from"./view-param-filters-Bp84PUMd.js";function ie(e,l,n){return{queryKey:["event-view-match",e,l.key,l.content_hash,n],queryFn:async()=>{try{const o=(await z("open_view",{key:l.key,scope:{event:n}},{slug:e})).scope?.event;if(!Number.isSafeInteger(o)||(o??0)<1)throw new Error("The view did not resolve its event subject");return o}catch(s){if(s instanceof Y&&(s.status===400||s.status===404))return null;throw s}},staleTime:6e4}}function re(e,l){const n=R(e??{slug:null,organizationId:null}),s=e?.slug??null,o=E.useMemo(()=>s?$(n.data??[]):[],[s,n.data]),c=G({queries:o.map(i=>ie(s,i,l))});return s?{views:o.flatMap((i,v)=>{const h=c[v]?.data;return h?[{...i,eventId:h}]:[]}),isLoading:n.data===void 0?!n.isError:c.some(i=>i.isPending),isError:n.isError||c.some(i=>i.isError),refetch:()=>{n.refetch();for(const i of c)i.isError&&i.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}const le={},oe="calc(100dvh - 120px)";function me({owner:e,organizationId:l,eventId:n,viewKey:s,params:o,onParamsChange:c,onSelectView:i,dense:v=!1,fullBleed:h=!1}){const{isAuthenticated:x,isReady:k}=Z(),{data:B,isLoading:b}=J(),D=B?.some(r=>r.id===l&&r.is_member),m=e!=="me"&&l!==null&&k&&x&&!b&&D,d=re(m?{slug:e,organizationId:l}:null,n),[j,L]=E.useState(le),[O,V]=E.useState(null),f=K(d.views,s),t=m&&!d.isLoading&&!d.isError&&f.kind==="view"?f.view:null,p=t?`${W(e,t.key)}/${t.content_hash}/${t.eventId}`:null,y=t!==null&&O===p,F=T(e,n),_=e!=="me"&&(!k||x&&(b||d.isLoading)),A=t!==null&&!y&&!_,g=h&&A,U=(h||v)&&A,M=_?a.jsx("div",{role:"status",className:"py-8 text-sm text-muted-foreground",children:"Loading event view…"}):t&&!y?a.jsxs(a.Fragment,{children:[a.jsx(se,{decls:t.params,params:o??j,onParamsChange:r=>c?c(t.key,r,{replace:!1}):L(r)}),a.jsx(te,{orgSlug:e,viewKey:t.key,scope:{event:t.eventId},params:o??j,onParamsChange:r=>c?c(t.key,r):L(r),onLoadError:()=>V(p),contentHash:t.content_hash,title:t.name,minHeight:v?240:320,fixedHeight:U?oe:void 0},p)]}):void 0;return a.jsxs("div",{className:g?"w-full space-y-3":"mx-auto w-full max-w-3xl space-y-3",...g?{"data-testid":"event-view-fullbleed"}:{},children:[m&&d.isError&&a.jsx(ne,{onRetry:d.refetch}),(m||e==="me"&&s)&&!d.isLoading&&!d.isError&&f.kind==="missing"&&a.jsx(ae,{viewKey:f.key,backTo:F,backLabel:"Back to the event"}),y&&a.jsxs("div",{role:"alert",className:"rounded-md border p-3 text-sm",children:[a.jsx("p",{children:"The custom view couldn’t load. The event content is shown below."}),a.jsx("button",{type:"button",className:"mt-2 underline",onClick:()=>V(null),children:"Retry custom view"})]}),a.jsx(ee,{presentation:"detail",organizationId:l,ownerSlug:e,filters:{contentIds:[n],...e==="me"?{sortBy:"date",sortOrder:"desc"}:{}},hideDetails:v,renderDetail:r=>{const w=M!=null&&(r==null||!!s),N=(m?d.views:[]).filter(u=>!w||u.key!==t?.key).map(u=>({key:u.key,name:u.name,href:T(e,n,u.key)})),H=u=>u.length?a.jsx("nav",{"aria-label":"Event views",className:"flex flex-wrap gap-3 text-sm",children:u.map(({key:C,name:I,href:S})=>a.jsx(X,{to:S,className:"underline",onClick:i?Q=>{Q.preventDefault(),i(S)}:void 0,children:I},C))}):null,q=[...N],P=[...N];return m&&s&&r!=null&&P.unshift({key:":event",name:"Event details",href:F}),{content:w?M:r,nativeHeading:!w&&r!=null,headingAside:g?H(q):void 0,links:g?null:H(P)}}})]})}export{me as E};
|
|
2
|
-
//# sourceMappingURL=event-detail-CvaRN1qB.js.map
|