@lobu/runtime-server 24.6.0 → 24.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +199 -316
- package/dist/component.json +1 -1
- package/dist/connectors/imessage.ts +953 -0
- package/dist/connectors/linkedin.ts +20 -377
- package/dist/dependencies.bun.lock +124 -92
- package/dist/embeddings-server.mjs +14 -2
- package/dist/owletto/dist/assets/_-B0tmXZ86.js +2 -0
- package/dist/owletto/dist/assets/_-DwXULq4r.js +3 -0
- package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +2 -0
- package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +2 -0
- package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DM5MTO8c.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-OJrZjd0o.js +2 -0
- package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +2 -0
- package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +3 -0
- package/dist/owletto/dist/assets/_shape-BZidoJMB.js +2 -0
- package/dist/owletto/dist/assets/_slug-R989vOiM.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CQZQ0wwC.js → accept-invitation-BC-ZIsrf.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +2 -0
- package/dist/owletto/dist/assets/agent-connect-pages-CdDjrHjn.js +4 -0
- package/dist/owletto/dist/assets/agent-editor-form-CDAHRNWl.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-_18OREnx.js → agent-loading-shells-BupiSjR-.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-ju7L2M0l.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-1DBn7Xc_.js → agent-skill-context-B0ZYVE3n.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-ByU0xhXn.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-FyEO-y44.js → agent-thread-DiVKn1WX.js} +4 -4
- package/dist/owletto/dist/assets/agent-thread-storage-Bx2-WBHQ.js +2 -0
- package/dist/owletto/dist/assets/app._appId-BQWElSoP.js +2 -0
- package/dist/owletto/dist/assets/assist-composer-igTXq3DL.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +2 -0
- package/dist/owletto/dist/assets/{callback-9xSHyA12.js → callback-Dmaio9CX.js} +2 -2
- package/dist/owletto/dist/assets/{card-g4yxo4Hr.js → card-rE4Ctuy6.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B98IhDra.js → claim-BN17CPYh.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-BD2HBo-_.js → client-activity-scopes-B7xVaUA-.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-x_CxeWkP.js → client-rows-B3LULJxW.js} +2 -2
- package/dist/owletto/dist/assets/clients-CydgUHrc.js +2 -0
- package/dist/owletto/dist/assets/code-editor-UppEMWpt.js +26 -0
- package/dist/owletto/dist/assets/connect-OdHpIVV9.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-B9u86bb2.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-CaF-ZWlZ.js +2 -0
- package/dist/owletto/dist/assets/{connection-B6fM2KHN.js → connection-D8ZAMHBT.js} +2 -2
- package/dist/owletto/dist/assets/connection-feed-detail-CJYqryAV.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +2 -0
- package/dist/owletto/dist/assets/connector-page-shell-C23dWdKz.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-CW4CXtCz.js +2 -0
- package/dist/owletto/dist/assets/{connectors-DnOUxX_U.js → connectors-Bp08_KPq.js} +2 -2
- package/dist/owletto/dist/assets/consent-_PpYI1cT.js +2 -0
- package/dist/owletto/dist/assets/copy-button-1ALlvZU1.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-BsXtvNoI.js → core.esm-6koO33th.js} +3 -3
- package/dist/owletto/dist/assets/create-DULVO0HS.js +2 -0
- package/dist/owletto/dist/assets/create-Drx9tcnG.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-BhujNbRr.js +3 -0
- package/dist/owletto/dist/assets/create-kUevP9Xx.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +2 -0
- package/dist/owletto/dist/assets/custom-guardrail-edits-B_aCgvoZ.js +2 -0
- package/dist/owletto/dist/assets/definition-comparison-3zKUSTt8.js +2 -0
- package/dist/owletto/dist/assets/detail-page-skeleton-BmxqqIsH.js +2 -0
- package/dist/owletto/dist/assets/{device-DdCoCj-Q.js → device-D2eUt_nr.js} +2 -2
- package/dist/owletto/dist/assets/device-automation-Dp3faMvp.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-BFPbTM_o.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-Dqtmb1Xp.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-D3KnzCsW.js +2 -0
- package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +2 -0
- package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-DJNSQrfB.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-CouHZbc9.js +2 -0
- package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +2 -0
- package/dist/owletto/dist/assets/event-kind-options-fHAIXu24.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-B5xXnKtV.js → full-page-spinner-B7A6Ycyi.js} +2 -2
- package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +2 -0
- package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +2 -0
- package/dist/owletto/dist/assets/index-9PGnv4-5.js +2 -0
- package/dist/owletto/dist/assets/{index-TkPy_P_u.js → index-B-dZruj6.js} +2 -2
- package/dist/owletto/dist/assets/index-BztXeLBN.js +2 -0
- package/dist/owletto/dist/assets/index-C2TCKJDP.js +7901 -0
- package/dist/owletto/dist/assets/index-C7QM3aqU.js +2 -0
- package/dist/owletto/dist/assets/index-CWn46a4y.js +2 -0
- package/dist/owletto/dist/assets/index-CxJONizf.js +2 -0
- package/dist/owletto/dist/assets/index-DJhb3li3.js +2 -0
- package/dist/owletto/dist/assets/{index-BDl1_w6U.js → index-DXfYVs5m.js} +2 -2
- package/dist/owletto/dist/assets/{index-BdNR51Ua.js → index-DY-YGnCe.js} +2 -2
- package/dist/owletto/dist/assets/index-j3v7ITPb.js +2 -0
- package/dist/owletto/dist/assets/index-oiy6ygaI.js +2 -0
- package/dist/owletto/dist/assets/index-pEgtAY1t.js +2 -0
- package/dist/owletto/dist/assets/index-xAvK3IyQ.css +1 -0
- package/dist/owletto/dist/assets/json-diff-CJK-gzCt.js +4 -0
- package/dist/owletto/dist/assets/list-skeleton-bQAZ0hQp.js +2 -0
- package/dist/owletto/dist/assets/{login-TWR0vF4_.js → login-DLqL54Rk.js} +2 -2
- package/dist/owletto/dist/assets/{logout-BA5kojS0.js → logout-H0F3IfiO.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-Doic_6qX.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +74 -0
- package/dist/owletto/dist/assets/model-selector-BrfaDwIg.js +2 -0
- package/dist/owletto/dist/assets/new-5GkxlOuQ.js +2 -0
- package/dist/owletto/dist/assets/{new-Dc5Bbotb.js → new-BiA4DGoN.js} +2 -2
- package/dist/owletto/dist/assets/new-M-MX_T5C.js +2 -0
- package/dist/owletto/dist/assets/organization-CLrcmgNK.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-BP3xHM2d.js → pending-seed-DYYOoCvj.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-BVwOMoq9.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +2 -0
- package/dist/owletto/dist/assets/{record-session-DOFgdd43.js → record-session-KuEDuF3S.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-CHPS-1vD.js → renderer-ucwCQmBk.js} +26 -26
- package/dist/owletto/dist/assets/{reset-password-BmNM-apc.js → reset-password-BkiAmXZW.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-8vdkq-3o.js +2 -0
- package/dist/owletto/dist/assets/{runs-BntGAKQG.js → runs-B_iywKWb.js} +2 -2
- package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +2 -0
- package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-BFb7jCBo.js → schema-value-CefbtPIY.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +2 -0
- package/dist/owletto/dist/assets/{settings-DubSpJfg.js → settings-DvzkRYQy.js} +2 -2
- package/dist/owletto/dist/assets/skill-route-key-sF006xiz.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-LJIWGtHb.js +2 -0
- package/dist/owletto/dist/assets/status-variants-BxHtpMOj.js +2 -0
- package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +2 -0
- package/dist/owletto/dist/assets/{table-DALHuXPE.js → table-1O-ik4_O.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-D9hKpufo.js → use-automations-lV8PuE8L.js} +2 -2
- package/dist/owletto/dist/assets/use-login-redirect-CfCbEeJR.js +2 -0
- package/dist/owletto/dist/assets/use-mention-search-CA-evCDf.js +91 -0
- package/dist/owletto/dist/assets/view-param-filters-Bp84PUMd.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-CZ1fvAks.js → views-access-required-BerT4Z1d.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +358 -141
- package/npm-shrinkwrap.json +540 -447
- package/package.json +4 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +7 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +3 -0
- package/vendor/core/dist/contracts/tools/view-host.js +2 -0
- package/vendor/core/dist/error-report.js +1 -0
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
- package/dist/connectors/linkedin-takeout.ts +0 -577
- package/dist/connectors/takeout-utils.ts +0 -240
- package/dist/owletto/dist/assets/_-DT3E3BmS.js +0 -3
- package/dist/owletto/dist/assets/_-DtqBFgK5.js +0 -2
- package/dist/owletto/dist/assets/_-c1xy7bLu.js +0 -2
- package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DV8utajn.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +0 -2
- package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +0 -2
- package/dist/owletto/dist/assets/_name-CM1AMywz.js +0 -2
- package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +0 -3
- package/dist/owletto/dist/assets/_shape-DGAkETDp.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +0 -2
- package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +0 -2
- package/dist/owletto/dist/assets/_view-B5I7mmkl.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CZykJXQp.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-DuQJhtqp.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-CpUTAjXf.js +0 -4
- package/dist/owletto/dist/assets/agent-connect-pages-Br_ycC0z.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CN7vpC0X.js +0 -2
- package/dist/owletto/dist/assets/agent-list-row-BnP6r4pm.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-DSjidWHL.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-d5jh3oBR.js +0 -2
- package/dist/owletto/dist/assets/agent-tab-intro-DKrC3SQt.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -2
- package/dist/owletto/dist/assets/agents-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-CDpJmUVN.js +0 -2
- package/dist/owletto/dist/assets/app._appId-DwNeXRJp.js +0 -2
- package/dist/owletto/dist/assets/assist-composer-Mn9EfX4X.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +0 -2
- package/dist/owletto/dist/assets/automation-row-B5Q1B10y.js +0 -2
- package/dist/owletto/dist/assets/automation-source-list-Dhucq1sI.js +0 -2
- package/dist/owletto/dist/assets/automations-kXojozTU.js +0 -2
- package/dist/owletto/dist/assets/change-summary-DeuXQEpb.js +0 -2
- package/dist/owletto/dist/assets/clients-Cmp0LmOp.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-CezOH3s7.js +0 -2
- package/dist/owletto/dist/assets/connect-zUot_0kG.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DBNP2mZo.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-Ckq-qEbD.js +0 -2
- package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-BXsJqieG.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-CbqSFeVm.js +0 -2
- package/dist/owletto/dist/assets/connector-page-shell-Di6XzkVo.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-BrnasBW4.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-dQnZARCD.js +0 -2
- package/dist/owletto/dist/assets/consent-Byli4yMs.js +0 -2
- package/dist/owletto/dist/assets/copy-button-Ddf7lBjZ.js +0 -2
- package/dist/owletto/dist/assets/create-B34eskZ_.js +0 -2
- package/dist/owletto/dist/assets/create-DLB9sXgU.js +0 -2
- package/dist/owletto/dist/assets/create-YdAnh3ml.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +0 -2
- package/dist/owletto/dist/assets/definition-comparison-B5WgZILB.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BkU_En_f.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-D0ghgRgq.js +0 -2
- package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +0 -2
- package/dist/owletto/dist/assets/event-detail-CmC-DVrK.js +0 -2
- package/dist/owletto/dist/assets/events-feed-CGzA1w3R.js +0 -2
- package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +0 -2
- package/dist/owletto/dist/assets/guardrails-DkXatmea.js +0 -2
- package/dist/owletto/dist/assets/identity-BwJy3ixB.js +0 -2
- package/dist/owletto/dist/assets/index-35ehGReZ.js +0 -2
- package/dist/owletto/dist/assets/index-B9hYiwBw.js +0 -2
- package/dist/owletto/dist/assets/index-BjcZVe7n.js +0 -7899
- package/dist/owletto/dist/assets/index-BqAVebvY.js +0 -2
- package/dist/owletto/dist/assets/index-BvK1fS1J.js +0 -2
- package/dist/owletto/dist/assets/index-CNEpTkgw.css +0 -1
- package/dist/owletto/dist/assets/index-CRc73k1t.js +0 -2
- package/dist/owletto/dist/assets/index-CYGaSD3y.js +0 -2
- package/dist/owletto/dist/assets/index-CfZGe-zn.js +0 -2
- package/dist/owletto/dist/assets/index-CkiyxW4w.js +0 -2
- package/dist/owletto/dist/assets/index-CzLDNB2E.js +0 -2
- package/dist/owletto/dist/assets/index-D-o5iOVd.js +0 -2
- package/dist/owletto/dist/assets/index-DjYVV1Ml.js +0 -2
- package/dist/owletto/dist/assets/index-VyAX-asP.js +0 -2
- package/dist/owletto/dist/assets/json-diff-DtZtra_g.js +0 -28
- package/dist/owletto/dist/assets/list-skeleton-CIHWCi2a.js +0 -2
- package/dist/owletto/dist/assets/manage-gear-C-0BAMbC.js +0 -2
- package/dist/owletto/dist/assets/member-scope-gate-BQiRAqtx.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +0 -74
- package/dist/owletto/dist/assets/model-C2q7WDcS.js +0 -2
- package/dist/owletto/dist/assets/model-selector-B2cjCn0V.js +0 -2
- package/dist/owletto/dist/assets/models-CZkH5gtj.js +0 -2
- package/dist/owletto/dist/assets/nav-pill-Bam6s3jj.js +0 -2
- package/dist/owletto/dist/assets/new-BJst6K0b.js +0 -2
- package/dist/owletto/dist/assets/new-DgbivfDe.js +0 -2
- package/dist/owletto/dist/assets/organization-B9U1L-56.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +0 -2
- package/dist/owletto/dist/assets/permissions-BVlbeY4u.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-BED-DO9C.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CTLwq8s1.js +0 -2
- package/dist/owletto/dist/assets/run-activity-link-Dh1YyCfk.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-CCxNv0rK.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-BwTVaRsE.js +0 -2
- package/dist/owletto/dist/assets/runs-table-CYS1jDdL.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-v3nR2Oa2.js +0 -2
- package/dist/owletto/dist/assets/settings-DBgT60nY.js +0 -2
- package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-m8gECt82.js +0 -2
- package/dist/owletto/dist/assets/status-dot-BnQPFrcU.js +0 -2
- package/dist/owletto/dist/assets/use-login-redirect-ciwfc-7A.js +0 -2
- package/dist/owletto/dist/assets/use-mention-search-CJGCatFS.js +0 -96
- package/dist/owletto/dist/assets/use-scroll-sentinel-BWCrmNIB.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,dw as H,js as A,jt as V,ju as z,jv as q,jw as U,r as f,hA as G,u as C,aB as W,aH as Q,S as b,iM as Y,B as N,jx as Z,jy as R,jz as J,d3 as X,o as S,aq as D,cm as F,ab as I,eI as ee,v as te,l as se,fS as ne,w as re,L as $,jA as ie,fA as oe,fV as ae,fO as ce,jB as le,g1 as E,cz as de,az as ue,jC as me,at as pe,k as xe,jD as he,cP as fe,ec as ye,cQ as ge,p as je,gy as ve,eC as Ne,jE as we,ek as be,jF as ke,eH as Ae,a0 as Ce,jG as Se}from"./index-BjcZVe7n.js";import{u as Ie,A as Pe}from"./automation-detail-content-Bs3vwAPd.js";import{A as Le}from"./agent-loading-shells-_18OREnx.js";import{s as _e,h as Re,R as Te,A as $e}from"./agent-thread-FyEO-y44.js";import{C as Ee,b as Oe,A as ze}from"./connection-feed-detail-Ckq-qEbD.js";import{O as De}from"./connect-menu-CezOH3s7.js";import{a as Fe}from"./connections-browser-BXsJqieG.js";import{f as Be}from"./connector-scope-lists-dQnZARCD.js";import{S as Me}from"./source-record-panels-m8gECt82.js";import{E as T}from"./events-feed-CGzA1w3R.js";import{S as Ke}from"./schema-type-editor-panel-v3nR2Oa2.js";import{c as He,s as Ve,k as qe}from"./renderer-CHPS-1vD.js";import{E as Ue}from"./event-detail-CmC-DVrK.js";import{V as Ge,R as We}from"./views-access-required-CZ1fvAks.js";import{R as Qe,b as Ye}from"./event-card-CjA_dLzq.js";import{V as Ze,a as Je}from"./view-param-filters-CDvwie_f.js";import{S as Xe,g as et}from"./runs-table-CYS1jDdL.js";import{R as tt}from"./runs-panel-BwTVaRsE.js";import{b as st}from"./use-automations-D9hKpufo.js";import{b as nt}from"./model-C2q7WDcS.js";import"./create-automation-form-C9PMX7N8.js";import"./entity-options-BkU_En_f.js";import"./connection-label-BobuYiAG.js";import"./model-selector-B2cjCn0V.js";import"./skill-editor-D_W3QlRz.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-CJGCatFS.js";import"./automation-source-list-Dhucq1sI.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./definition-comparison-B5WgZILB.js";import"./schema-value-BFb7jCBo.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-BP3xHM2d.js";import"./feed-event-kinds-BYuZCoU4.js";import"./status-dot-BnQPFrcU.js";import"./client-activity-scopes-BD2HBo-_.js";import"./client-rows-x_CxeWkP.js";import"./use-scroll-sentinel-BWCrmNIB.js";import"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./dynamic-schema-form-qWSRtOAv.js";import"./filter-bar-CQ_oE7a9.js";import"./record-session-DOFgdd43.js";import"./run-initiator-CCxNv0rK.js";import"./clients-Cmp0LmOp.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./automation-row-B5Q1B10y.js";import"./manage-gear-C-0BAMbC.js";function rt(t){if(!t||typeof t!="object")return[];const n=t.properties;if(!n)return[];const s=Array.isArray(t.required)?new Set(t.required.map(String)):new Set;return Object.entries(n).map(([r,i])=>({name:r,type:String(i.type??"any"),required:s.has(r),description:typeof i.description=="string"?i.description:void 0}))}function it({fields:t}){return t.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):e.jsx("ul",{className:"space-y-2",children:t.map(n=>e.jsxs("li",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("code",{className:"text-xs font-medium text-foreground",children:n.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:n.type}),n.required?e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),n.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}):null]},n.name))})}function P({item:t,hideHeading:n=!1}){const s=t.schemaSections;return s?e.jsxs("article",{className:n?"space-y-4":"space-y-4 px-5 py-5",children:[!n&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("h2",{className:"text-base font-medium text-foreground",children:t.title}),s.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}):null]})]}),s.sections.map(r=>{const i=rt(r.schema);return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r.title}),r.description?e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.description}):null]}),e.jsx(it,{fields:i})]},r.title)})]}):null}function ot({actions:t}){const n=Object.entries(t).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,action:i}});return e.jsx(A,{entries:n,label:"actions",renderDetail:({name:s,action:r})=>e.jsx(P,{hideHeading:!0,item:{href:"",title:s,schemaSections:z(r)}})})}function at({feeds:t}){const n=Object.entries(t).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,feed:i}});return e.jsx(A,{entries:n,label:"feed types",renderDetail:({name:s,feed:r})=>e.jsx(P,{hideHeading:!0,item:{href:"",title:s,schemaSections:V(r)}})})}function ct(t){const n=[];return t.forEach((s,r)=>{n.push({id:`sep:${s.runId}`,role:"system",parts:[{type:"text",text:lt(s,r)}],createdAt:s.completedAt?new Date(s.completedAt).getTime():void 0});for(const i of s.messages)n.push({...i,id:`r${s.runId}:${i.id}`})}),n}function lt(t,n){const s=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",r=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",i=t.completedAt?new Date(t.completedAt).toLocaleString():null;return i?`Run ${n+1} · ${s}${r} · ${i}`:`Run ${n+1} · ${s}${r}`}const B=Symbol("trusted-automation-interaction");function dt(t){return Object.defineProperty(t,B,{value:!0}),t}function ut(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const mt=new Set(["automation-approval-batch"]);function pt(t){return new Promise(n=>{t({onSettled:(s,r)=>n(!!r)})})}function xt(){const t=q(),n=U();return f.useMemo(()=>({toolNames:mt,resolve:(s,r)=>{if(!r||typeof r!="object"||r[B]!==!0)return null;const i=r;if(s==="automation-approval-batch"){const o=typeof i.runId=="number"&&Number.isSafeInteger(i.runId)&&i.runId>0?i.runId:null,c=typeof i.count=="number"&&Number.isSafeInteger(i.count)&&i.count>1?i.count:null,a=Array.isArray(i.runIds)?i.runIds.filter(l=>typeof l=="number"&&Number.isSafeInteger(l)&&l>0):[];return o===null||c===null||a.length!==c||new Set(a).size!==c?null:{view:ut(c),handlers:{manage_operations:l=>l.action!=="approve"&&l.action!=="reject"?Promise.resolve(!0):pt(p=>l.action==="approve"?t.mutate({run_id:o,run_ids:a},p):n.mutate({run_id:o,run_ids:a},p))}}}return null}}),[t,n])}const ht=/(?:^|\n)Run this Automation now/;function ft(t){return t.role==="user"&&t.parts.some(n=>n.type==="text"&&ht.test(n.text))}function yt(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function gt({agentId:t,automationId:n,ownerSlug:s,runId:r}){const{data:i,isLoading:o}=G(t,n,{orgSlug:s,...r!=null?{runId:r}:{}}),c=xt(),a=C(),l=f.useCallback(d=>{a?.open({href:`/${s}/automations/${n}?view=activity&run_id=${d}`,title:`Automation run #${d}`,runId:d})},[a,s,n]),p=f.useMemo(()=>{const d=i?.runs??[],j=(r!=null?d.filter(m=>m.runId===r):d).slice().reverse();return ct(j.map(m=>{const g=m.messages.map(u=>_e(u,{showToolCalls:!0})).filter(u=>u!==null&&!ft(u));m.task?.trim()&&g.unshift({id:"task",role:"user",parts:[{type:"text",text:m.task.trim()}]});const v=m.actions??[],h=v.filter(u=>u.status==="pending");if(h.length>1){const u=h.map(x=>x.runId).sort((x,k)=>x-k);g.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${m.runId}`,toolName:"automation-approval-batch",args:dt({runId:m.runId,count:h.length,runIds:u})}]})}for(const u of v){const x=Re([u],{workspaceSlug:s,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});x&&g.push({...x,id:yt(u)})}return{runId:m.runId,completedAt:m.completedAt,status:m.status,pendingActionCount:m.pendingActionCount,autoAppliedCount:m.autoAppliedCount,messages:g}}))},[t,i,s,r]);return o?e.jsx(Le,{readOnly:!0}):p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(Te,{messages:p,workspaceSlug:s,children:e.jsx($e,{readOnly:!0,readerPositionMode:"runs",interactionExtension:c,onRunSelect:r==null&&a?l:void 0})})})}function jt({panel:t}){const n=W(t.organizationId),s=t.section==="connections"||!!t.connectionId,r=Q(t.organizationId,{connectorKey:t.connectorKey,connectionIds:t.connectionId?[t.connectionId]:void 0,enabled:s}),i=n.data?.find(c=>c.key===t.connectorKey),o=r.data?.find(c=>c.id===t.connectionId&&c.connector_key===t.connectorKey);return n.isLoading||s&&r.isLoading?e.jsx("div",{className:"p-5",children:e.jsx(b,{className:"h-28 w-full"})}):n.isError||s&&r.isError?e.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):t.connectionId&&!o||!i&&!o&&t.section!=="connections"?e.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):e.jsx("div",{className:"p-5",children:t.section==="connections"?e.jsx(Fe,{connections:r.data??[],connector:i,connectorKey:t.connectorKey,ownerSlug:t.ownerSlug}):o?e.jsx(wt,{connection:o,connector:i,panel:t}):i?t.section==="oauth-apps"?e.jsx(De,{connector:i,organizationId:t.organizationId,newApp:!!t.newApp}):t.section==="feeds"?e.jsx(vt,{connector:i}):i.installed===!1?e.jsx(Nt,{connector:i,ownerSlug:t.ownerSlug}):e.jsx(kt,{connector:i,ownerSlug:t.ownerSlug}):null},`${t.connectorKey}:${t.connectionId??"connector"}:${t.section}`)}function vt({connector:t}){return e.jsx(at,{feeds:t.feeds_schema??{}})}function Nt({connector:t,ownerSlug:n}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(ot,{actions:t.actions_schema??{}})]})}function wt({connection:t,connector:n,panel:s}){const[r,i]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:r,children:s.section==="feeds"?e.jsx(bt,{connection:t,connector:n,ownerSlug:s.ownerSlug}):e.jsx(Y,{connection:t,ownerSlug:s.ownerSlug,inPeek:!0,onReviewPermissions:n?()=>i(!0):void 0})}),r&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Back to actions"}),e.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),e.jsx(Z,{connection:t,connectorDef:n})]})]})}function bt({connection:t,connector:n,ownerSlug:s}){const{data:r=[],isLoading:i,isError:o}=X(t.id),[c,a]=f.useState(!1),l=t.facets?.chat??!1;if(i)return e.jsx(b,{className:"h-28 w-full"});if(o)return e.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const p=r.map(d=>({id:String(d.id),name:d.display_name||d.feed_key,status:Be(d)??(d.operations.includes("sync")?"Sync enabled":"Live access"),feed:d}));return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:c,children:e.jsx(A,{entries:p,label:l?"channels":"feeds",action:Object.keys(n?.feeds_schema??{}).length>0?e.jsx(N,{size:"sm",variant:"outline",onClick:()=>a(!0),children:l?"Add channel":"Add feed"}):void 0,renderDetail:({feed:d})=>d.store==="channel_messages"?e.jsx(Ee,{feed:d,hideHeader:!0}):e.jsx(Oe,{feed:d,connectorDef:n,ownerSlug:s})})}),c&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:l?"Add channel":"Add feed"}),e.jsx(ze,{organizationId:t.organization_id,connections:[t],connectorDefinitions:[n],onClose:()=>a(!1)})]})]})}function kt({connector:t,ownerSlug:n}){const{data:s=[],isLoading:r,isError:i}=J(t.key);if(r)return e.jsx(b,{className:"h-28 w-full"});if(i)return e.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const o=t.actions_schema??{},c=s.map(a=>({id:a.operation_key,name:a.name??a.operation_key,description:a.description,operation:a}));return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(A,{entries:c,label:"actions",renderControl:()=>e.jsx(R,{ownerSlug:n,connectorKey:t.key}),renderDetail:({operation:a,name:l})=>o[a.operation_key]?e.jsx(P,{hideHeading:!0,item:{href:"",title:l,schemaSections:z(o[a.operation_key])}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function At({owner:t,path:n}){const{data:s,isLoading:r}=S(t,{slug:t}),i=s?.workspace,o=i?.type==="organization"?i.id:null,c=o?{slug:t}:void 0,{data:a,isLoading:l}=D(`/${t}/${F(n)}`,c),p=a?.entity,d=p?.id;return r||l?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):o?d==null?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):p?.is_derived?e.jsx(Me,{record:{type:p.entity_type,key:p.slug},orgContext:c}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:o,ownerSlug:t,entityId:typeof d=="number"?d:void 0,filters:{sortBy:"date",sortOrder:"desc"},emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function Ct(t){if(Array.isArray(t.enum))return`One of ${t.enum.length}`;if(t.format==="date"||t.format==="date-time")return"Date";if(t.format==="uri")return"Link";if(t.format==="email")return"Email";const n=Array.isArray(t.type)?t.type[0]:t.type;return n==="array"?"List":n==="object"?"Group":n==="integer"||n==="number"?"Number":n==="boolean"?"Yes / no":"Text"}function St({owner:t,typeSlug:n,view:s}){const{data:r,isLoading:i}=S(t,{slug:t}),o=r?.workspace,c=o?.type==="organization"?o.id:null,{isAdmin:a}=ee(c??void 0),{orgContext:l}=te(),{data:p,isSuccess:d}=se(l),y=(p??[]).find(w=>w.slug===n),j=d&&!y,m=`/${t}/${ne(n)}`,{pathname:g}=re(),v=g===m||g===`${m}/`||g.startsWith(`${m}/-/`),h=f.useMemo(()=>He(y?.metadata_schema),[y?.metadata_schema]),u=C(),x=u?.close;f.useEffect(()=>{j&&x?.()},[j,x]);const k=f.useMemo(()=>({entityTypes:[n],sortBy:"date",sortOrder:"desc"}),[n]);if(i)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(j)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This entity type no longer exists."});if(!c)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."});const K=y?.name??n;return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[v?null:e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{...oe(t,n),children:[e.jsx(ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Browse records"]})}),y&&!v&&!ae(y)&&y.entity_count!==0?e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{to:"/$owner/$entityType/-/$shape",params:{owner:t,entityType:n,shape:"graph"},search:le(E(t,n)),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Graph"]})}):null,s!=="activity"&&u?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>u.open({href:E(t,n,"activity"),title:`${K} activity`}),children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Activity"]}):null]}),s==="activity"?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:c,ownerSlug:t,filters:k,showEntityLinks:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to these records yet."})})}):a?e.jsx("div",{className:"p-4",children:e.jsx(Ke,{slug:n,onClose:()=>x?.()})}):h.length>0?e.jsxs("section",{"aria-labelledby":"entity-type-peek-fields",className:"px-4 py-4",children:[e.jsx("h3",{id:"entity-type-peek-fields",className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Fields"}),e.jsx("dl",{className:"divide-y divide-border/60 text-sm",children:h.map(w=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",title:w.prop.description,children:[e.jsx("dt",{className:"min-w-0 truncate",children:Ve(w)}),e.jsx("dd",{className:"shrink-0 text-xs text-muted-foreground",children:Ct(w.prop)})]},w.key))})]}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This type has no fields yet."})]})}function It({owner:t,eventId:n,viewKey:s}){const r=C(),i=(o,c)=>e.jsx(Ue,{owner:c,organizationId:o,eventId:n,viewKey:s,dense:!0,onSelectView:r?a=>r.retarget(a):void 0},`${c}/${n}/${s??""}`);return e.jsx("div",{className:"px-4 py-4",children:t==="me"?i(null,t):e.jsx(ue,{owner:t,children:({organizationId:o,ownerSlug:c})=>o?i(o,c):e.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function L({owner:t,runId:n,runIds:s,contentIds:r}){const{data:i,isLoading:o}=S(t==="me"?null:t,{slug:t}),c=i?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,l=f.useMemo(()=>{if(t==="me")return r?.length?{contentIds:r,sortBy:"date",sortOrder:"desc"}:void 0;const d=s??(n!=null?[n]:void 0);if(!(!d?.length&&!r?.length))return{...d?.length?{runIds:d}:{},...r?.length?{contentIds:r}:{}}},[t,r,n,s]),p=l!=null;return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):t!=="me"&&a==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):p?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{presentation:"detail",organizationId:a,ownerSlug:t,filters:l,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:n!=null||s?.length?"No matching events from this run yet.":"No matching events yet."})})}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}const _=25;function Pt({target:t}){const[n,s]=f.useState(0),{data:r,isLoading:i,isError:o,refetch:c}=me(t.entityId,t.orgContext,{relationshipType:t.relationshipType,limit:_,offset:n}),a=r?.total;return e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.label," · ",t.entityName,a!==void 0?` · ${a} current ${a===1?"link":"links"}`:r?` · ${r.rows.length} shown`:""]}),e.jsx(Qe,{count:r?.failures?.length??0,onRetry:()=>void c()}),i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"h-6 w-full"}),e.jsx(b,{className:"h-6 w-full"})]}):o||!r?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load these links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void c(),children:"Retry"})]}):r.rows.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No links on this page."}):e.jsx("ul",{className:"divide-y divide-border",children:r.rows.map(l=>e.jsx("li",{className:"flex items-center justify-between gap-3 py-1.5",children:e.jsx(Ye,{row:l,entityId:t.entityId,ownerSlug:t.ownerSlug,orgContext:t.orgContext})},l.id))}),r&&(n>0||r.hasMore)?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:n===0,onClick:()=>s(Math.max(0,n-_)),children:"Previous"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[r.rows.length," shown",a===void 0?"":` of ${a}`]}),e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:!r.hasMore,onClick:()=>s(n+_),children:"Next"})]}):null]})}function Lt({owner:t,path:n,viewKey:s}){const[r,i]=f.useState({}),{data:o,isLoading:c}=S(t,{slug:t}),a=o?.workspace,l=a?.type==="organization"?a.id:null,p=l?{slug:t,organizationId:l}:void 0,{data:d,isLoading:y}=D(`/${t}/${F(n)}`,p),{isMember:j,isPublic:m,isLoading:g}=pe(t),v=j||m,h=xe({slug:t,organizationId:j?l:null}),u=d?.entity;if(c||y||g||v&&h.isLoading)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(!v)return e.jsx(Ge,{});if(h.isError)return e.jsx(Ze,{onRetry:()=>void h.refetch()});const x=u?he(h.data??[],{type:u.entity_type,id:u.id??u.slug}).find(k=>k.key===s):void 0;return!l||!u||!x?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This view isn't attached to this record any more."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(Je,{orgSlug:t,viewKey:x.key,scope:{type:u.entity_type,entity:u.is_derived?u.slug:u.id??u.slug},params:r,onParamsChange:i,contentHash:x.content_hash,title:x.name,minHeight:320})})}function M({owner:t,runId:n}){const s=fe({queryKey:["run-outcome",t,n],queryFn:async()=>{const i=await ge("manage_operations",{action:"get_run",run_id:n},{slug:t});if(!i.run)throw new Error(i.error||"Run not found");return i.run},enabled:t!=="me",staleTime:15e3,refetchInterval:i=>["pending","claimed","running"].includes(i.state.data?.status??"")?5e3:!1});if(t==="me")return null;if(s.isLoading)return e.jsx("p",{role:"status",className:"px-4 pt-4 text-xs text-muted-foreground",children:"Loading run…"});if(!s.data)return e.jsx("p",{role:"alert",className:"px-4 pt-4 text-sm text-destructive",children:"Could not load this run."});const r=s.data;return e.jsxs("section",{"aria-label":"Run outcome",className:"space-y-2 border-b px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Xe,{status:et(r.status),children:r.status}),e.jsx("time",{dateTime:r.created_at,className:"text-xs text-muted-foreground",children:ye(r.created_at)})]}),r.connection_display_name?e.jsx("p",{className:"text-sm",children:r.connection_display_name}):null,r.error_message?e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-destructive",children:r.error_message}):null,s.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not refresh this run. Showing its last known outcome."}):null]})}function Rs({item:t}){const n=C();if(t.connectorPanel)return e.jsx(jt,{panel:t.connectorPanel});if(t.schemaSections)return e.jsx(P,{item:t});if(t.recordField)return e.jsx(We,{target:t.recordField});if(t.recordPeer)return e.jsx(qe,{target:t.recordPeer});if(t.recordLinks)return e.jsx(Pt,{target:t.recordLinks});if(typeof t.browserUrl=="string"&&t.browserUrl.length>0)return e.jsx(O,{item:t});const s=t.href?je(t.href):null;return s?s.kind==="runs"?e.jsx("section",{"aria-label":"Runs history",className:"p-4",children:e.jsx(tt,{scope:{workspace:!0},ownerSlug:s.owner,filterState:s.filters,onFilterChange:r=>n?.retarget(ve(s.owner,r))})}):s.kind==="memory"?"runId"in s?e.jsxs(e.Fragment,{children:[e.jsx(M,{owner:s.owner,runId:s.runId}),e.jsx(L,{owner:s.owner,runId:s.runId})]}):"runIds"in s?e.jsx(L,{owner:s.owner,runIds:s.runIds}):e.jsx(L,{owner:s.owner,contentIds:s.contentIds}):s.kind==="entity"?e.jsx(At,{owner:s.owner,path:s.path}):s.kind==="entity-type"?e.jsx(St,{owner:s.owner,typeSlug:s.typeSlug,view:s.view}):s.kind==="record-view"?e.jsx(Lt,{owner:s.owner,path:s.path,viewKey:s.viewKey}):s.kind==="event"?e.jsx(It,{owner:s.owner,eventId:s.eventId,viewKey:s.viewKey}):t.runId?e.jsx(_t,{owner:s.owner,automationId:s.automationId,runId:t.runId}):e.jsx(Rt,{owner:s.owner,automationId:s.automationId}):e.jsx(O,{item:t})}function O({item:t}){const n=t.body,s=t.notificationType??"generic",r=t.createdAt,i=t.browserUrl??null,o=t.browserHandoff??null;return e.jsxs("article",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ne,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:we(s)}),r?e.jsx("span",{children:be(r)}):null]})]}),n?e.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:e.jsx(ke,{text:n,linkPolicy:s==="action_approval_needed"?"app-links":"strip"})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),t.owner&&t.sourceAttribution?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),e.jsx(Ae,{owner:t.owner,source:t.sourceAttribution,className:"text-xs"})]}):null,i?e.jsx("div",{className:"space-y-2",children:o?.state==="expired"?e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:o.error_message??"This draft expired before the page was opened."}):o?.state==="completed"||o?.state==="preparing"?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):e.jsxs(N,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{Se(i)},children:[e.jsx(Ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function _t({owner:t,automationId:n,runId:s}){const{organizationId:r}=Ie(t),i=st(n,void 0,r),o=nt(i.data?.automation);return o?e.jsx(gt,{agentId:o,automationId:n,ownerSlug:t,runId:s}):i.isLoading?e.jsx(b,{className:"h-24 w-full rounded-lg"}):e.jsx(M,{owner:t,runId:s})}function Rt({owner:t,automationId:n}){return e.jsx(Pe,{owner:t,agentId:null,automationId:n,view:"activity",onDone:()=>{}})}export{Rs as PeekPaneContent};
|
|
2
|
-
//# sourceMappingURL=peek-pane-content-Cq8P38s3.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as i,eI as r,j as e,j3 as c}from"./index-BjcZVe7n.js";import{A as m}from"./agent-permissions-matrix-DSjidWHL.js";import{A as g,a as l}from"./agent-tab-intro-DKrC3SQt.js";function x({owner:n,agentId:s}){const{orgContext:t}=i(),{isAdmin:a,isLoading:o}=r(t.organizationId);return e.jsx(g,{children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(l,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(m,{owner:n,agentId:s})})]}):o?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function h(){const{owner:n,agentId:s}=c.useParams();return e.jsx(x,{owner:n,agentId:s})}export{h as component};
|
|
2
|
-
//# sourceMappingURL=permissions-BVlbeY4u.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{hB as f,h9 as w,ha as y,r as C,j as e,W as N,B as d,H as P,eL as k}from"./index-BjcZVe7n.js";import{a as A}from"./runs-BntGAKQG.js";function L({resource:g,runId:r,children:h,onDone:l}){const c=!!r,{data:a,isLoading:E,isError:u,refetch:v}=A(g,c?r:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[p,x]=C.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{r&&n.mutate({run_id:r},{onSuccess:()=>l?.()})},R=()=>{if(!r)return;const t=p.trim();i.mutate({run_id:r,...t?{reason:t}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?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(N,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. Compare Current and Proposed, then ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(k,{id:"review-reject-reason",rows:2,value:p,onChange:t=>x(t.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{L as P};
|
|
2
|
-
//# sourceMappingURL=proposal-review-shell-BED-DO9C.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aA as fs,j as e,r as b,c as V,w as ie,cO as ps,cP as hs,cQ as vs,L as Ge,a0 as ys,cR as gs,cS as xs,cG as bs,cT as It,cU as A,bj as ft,cV as js,cW as ks,ao as Cs,cX as Ss,an as Ns,cY as _s,cZ as ae,cn as Is,c_ as At,c$ as As,aq as Es,d0 as Ts,bb as Fs,d1 as Rs,aw as Ce,d2 as ws,d3 as Os,at as Et,aI as Tt,d4 as Ms,cB as Ps,d5 as Ls,d6 as Ft,d7 as $s,d8 as Ds,ct as Bs,b8 as Ks,bl as Gs,bm as Us,d9 as Vs,bn as Qs,bo as zs,bp as Ws,S as Hs,da as Ys,I as qs,i as Ne,X as Zs,B as W,db as Xs,dc as Js,dd as en,bQ as tn,de as sn,df as nn,dg as on,dh as Rt,di as pt,q as an,dj as cn,dk as Pe,dl as ht,cD as rn,dm as ln,l as dn,aH as un,dn as mn,dp as fn,dq as pn,dr as hn,ds as vn,dt as yn,du as gn,b_ as xn,dv as bn,aY as jn,b2 as vt,dw as yt,dx as wt,cp as Le,cN as Ot,dy as kn,dz as $e}from"./index-BjcZVe7n.js";import{S as B,F as Cn,d as Sn,o as ke,r as Nn,f as _n,a as In}from"./filter-bar-CQ_oE7a9.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as An,M as oe,a as En,c as Tn,f as Fn,b as Rn,s as wn}from"./manage-gear-C-0BAMbC.js";import{u as On}from"./runs-BntGAKQG.js";import{S as Mn}from"./source-record-panels-m8gECt82.js";import{u as Pn}from"./clients-Cmp0LmOp.js";import{u as Ln}from"./client-activity-scopes-BD2HBo-_.js";import{g as $n}from"./client-rows-x_CxeWkP.js";import{a as Dn,E as Bn}from"./events-feed-CGzA1w3R.js";import{L as Kn,u as Gn}from"./renderer-CHPS-1vD.js";import{E as Un}from"./agent-loading-shells-_18OREnx.js";import{M as Vn}from"./member-scope-gate-BQiRAqtx.js";const Ue=b.createContext(null);function Qn({organizationId:t,isWorkspaceLoading:s,children:o}){const{data:n=[],isLoading:a}=fs(t);return e.jsx(Ue.Provider,{value:{groups:n,isLoading:!!s||a},children:o})}function zn(){const t=b.useContext(Ue);if(!t)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return t}function Wn(){return b.useContext(Ue)}function Mt(t){const{parse:s,serialize:o,filterKeys:n,clearClassifications:a=!0,replace:i=!0,merge:m}=t,u=V(),d=ie(),r=b.useMemo(()=>{const g=new URLSearchParams;for(const[l,h]of Object.entries(d.search||{}))h!=null&&g.set(l,typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h):String(h));return s(g)},[d.search,s]),c=b.useCallback((g,l)=>{const h=m?m(r,g):{...r,...g},y=o(h),C={};for(const[S,x]of Object.entries(d.search||{}))x!=null&&(C[S]=x);for(const S of n)delete C[S];if(a)for(const S of Object.keys(C))S.startsWith("clf_")&&delete C[S];for(const[S,x]of Object.entries(y))x!==void 0&&(C[S]=x);u({to:d.pathname,search:C,replace:l?.replace??i})},[r,o,n,a,m,u,d,i]),f=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(d.search||{}))h!=null&&(n.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));u({to:d.pathname,search:g,replace:i})},[u,d.pathname,d.search,n,a,i]);return{filters:r,updateFilters:c,clearFilters:f}}function Hn(t){const{slug:s}=ps();return hs({queryKey:["schedules",s,t],queryFn:async()=>((await vs("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(n=>n.action_args?.agent_id===t),enabled:!!s&&!!t,staleTime:3e4})}function ye({id:t,label:s,value:o,sourceLink:n,details:a,onRemove:i}){return{id:t,label:s,op:"is",value:o,onRemove:i,editor:n||a?{kind:"custom",className:"w-80",render:()=>e.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[n?e.jsxs(Ge,{to:n.to,params:n.params,search:n.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[e.jsx("span",{className:"truncate",children:o}),e.jsx(ys,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):e.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function Yn({ownerSlug:t,clientIds:s,linkedUser:o,linkedUserEntitySlug:n}){const a=t&&n?gs(t,[{entity_type:"$member",slug:n}]):null;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:s.length===1?"Client ID":"Client IDs"}),s.map(i=>e.jsx("code",{className:"break-all text-foreground",children:i},i))]}),o?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?e.jsx(Ge,{to:a,className:"font-medium text-foreground hover:underline",children:o}):e.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ge(t,s,o){const n=new Set;for(const[a,i]of Object.entries(t.feeds_schema??{})){if(o&&!o.has(a))continue;const m=ee(ee(i)?.eventKinds);if(m)for(const[u,d]of Object.entries(m)){if(!s){n.add(u);continue}const r=ee(d)?.attributions;Array.isArray(r)&&r.some(c=>{const f=ee(ee(c)?.target);return typeof f?.entityType=="string"&&s.has(f.entityType)})&&n.add(u)}}return n}function qn({connectors:t,entityTypes:s,selectedPlatforms:o=[],selectedFeeds:n=[],selectedEntityTypes:a=[]}){const i=new Set,m=new Set(o),u=new Set(a),d=new Map;for(const r of n){const c=d.get(r.connectorKey)??new Set;c.add(r.feedKey),d.set(r.connectorKey,c)}if(d.size>0)for(const r of t){const c=d.get(r.key);if(c)for(const f of ge(r,void 0,c))i.add(f)}else if(m.size>0){for(const r of t)if(m.has(r.key))for(const c of ge(r))i.add(c)}else if(u.size>0){for(const r of s)if(u.has(r.slug))for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r,u))i.add(c)}else{for(const r of s)for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r))i.add(c)}return[...i].sort((r,c)=>r.localeCompare(c))}const De=["produced","analyzed"],Se=t=>t==="produced"?"Produced by":"Analyzed by";function Zn({enabled:t,...s}){const o=Xn(s,t);if(!t)return{fields:[],chips:[]};const n=Jn(s);return{fields:[o.field,n.field],chips:[...o.chips,...n.chips]}}function Xn({ownerSlug:t,filters:s,onFiltersChange:o},n){const a=An(t,n),i=a.data??[],m=c=>c==="produced"?s.producedByAutomationId:s.automationId,u=c=>i.find(f=>Number(f.automation_id)===c)?.name??`#${c}`,d=De.flatMap(c=>{const f=m(c);return f==null?[]:[{id:`automation-${c}`,field:"automation",label:Se(c),value:u(f),onRemove:()=>o(c==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),r={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:c=>e.jsxs(e.Fragment,{children:[De.map(f=>{const g=m(f),l=i.map(y=>({id:Number(y.automation_id),label:`${y.name}${y.status==="archived"?" (archived)":""}`}));g!=null&&!l.some(y=>y.id===g)&&l.unshift({id:g,label:`Automation #${g} (selected)`});const h=y=>{o(f==="produced"?{producedByAutomationId:y}:{automationId:y}),c()};return e.jsx(It,{heading:Se(f),children:l.map(y=>e.jsxs(A,{"aria-label":y.label,value:`${f} ${y.label} ${y.id}`,onSelect:()=>h(y.id),className:"group",children:[e.jsx(B,{selected:g===y.id}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),e.jsx(oe,{...En(t,String(y.id)),label:y.label})]},y.id))},f)}),a.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void a.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:d,field:{key:"automation",label:"Automation",group:"Scope",icon:e.jsx(xs,{className:"h-4 w-4"}),editor:r}}}function Jn(t){const{filters:s,onFiltersChange:o}=t,n=[];s.runIds?.length&&n.push({id:"run-produced",field:"run",label:"Produced by run",value:s.runIds.map(i=>`#${i}`).join(", "),onRemove:()=>o({runIds:null})}),s.runId!=null&&n.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${s.runId}`,onRemove:()=>o({runId:null})});const a={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(i,m)=>De.map(u=>e.jsx(eo,{...t,mode:u,query:m,close:i},u))};return{chips:n,field:{key:"run",label:"Run",group:"Scope",icon:e.jsx(bs,{className:"h-4 w-4"}),editor:a}}}function eo({ownerSlug:t,filters:s,onFiltersChange:o,mode:n,query:a,close:i}){const m=n==="produced"?s.producedByAutomationId:s.automationId,u=On({workspace:!0},{automationIds:m==null?void 0:[m],runTypes:n==="analyzed"?["automation"]:void 0,connectionIds:n==="produced"?s.connectionIds??void 0:void 0,feedIds:n==="produced"?s.feedIds??void 0:void 0},t),d=n==="produced"?s.runIds??[]:s.runId==null?[]:[s.runId],r=u.data?.pages.flatMap(l=>l.runs)??[],c=[...new Map(r.map(l=>[l.id,{id:l.id,label:`Run #${l.id} · ${l.feed_display_name??l.operation_key??l.run_type} · ${l.status}`}])).values()];for(const l of d)c.some(h=>h.id===l)||c.unshift({id:l,label:`Run #${l} (selected)`});const f=l=>{if(n==="produced"){const h=d.includes(l)?d.filter(y=>y!==l):[...d,l];o({runIds:h.length?h:null})}else o({runId:l}),i()},g=/^\d+$/.test(a.trim())?Number(a.trim()):0;return e.jsxs(It,{heading:Se(n),children:[c.map(l=>e.jsxs(A,{value:`${n} ${l.label}`,onSelect:()=>f(l.id),children:[e.jsx(B,{selected:d.includes(l.id)}),e.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!c.some(l=>l.id===g)?e.jsxs(A,{value:`${n} ${g}`,onSelect:()=>f(g),children:[Se(n)," run #",g]}):null,u.isLoading?e.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!c.length?e.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?e.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ve="Scope",Me="Source",z="h-4 w-4";function ce(){return ie().search??{}}function Pt(t){const{pathname:s}=ie(),o=s.startsWith(`/${t}/events/`),n=Cs(s,o?1:0),a=!!(n&&!o&&!Ss(n.split("/")[0]));return{pathname:s,embedded:a,recordPath:a?Ns(n)?.entityPath:o?n:void 0}}function Lt(t){const s=ce(),{recordPath:o,pathname:n,embedded:a}=Pt(t);return i=>{const m=ae(t,s,i,o);return a?{to:n,search:m.search}:m}}const xt=t=>new Set((t??"").split(",").map(s=>s.trim()).filter(Boolean));function to({ownerSlug:t,sourceRead:s=!1,filters:o,onFiltersChange:n}){const a=ce(),{recordPath:i,embedded:m}=Pt(t),u=i?i.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,r=(u?ft(u):void 0)??(d?ft(d):void 0),c=js(a),f=ks(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=so(t,r,!m),h=no(t,r,i,m),y=oo(t,c,!s),C=Zn({ownerSlug:t,filters:o,onFiltersChange:n,enabled:!s}),S=ao(t,f,g);return[l,h,y,C,S].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function so(t,s,o){const n=V(),a=ce(),{visible:i}=_s(t);if(!o)return{fields:[],chips:[]};const m=i.find(d=>d.slug===s),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>e.jsxs(e.Fragment,{children:[i.map(r=>e.jsxs(A,{onSelect:()=>{n(ae(t,a,{entity:void 0,create:void 0,type:r.slug})),d()},className:"group gap-2",children:[e.jsx(B,{selected:r.slug===s}),e.jsx(Ls,{icon:r.icon,className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),typeof r.entity_count=="number"?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.entity_count}):null,e.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:r.slug},label:r.name})]},r.id)),e.jsxs(A,{onSelect:()=>{n($s(t)),d()},className:"text-muted-foreground",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ve,icon:e.jsx(Is,{className:z}),editor:u}],chips:s?[{id:"type",label:"Entity type",op:"is",value:m?.name??s,onRemove:()=>void n(ae(t,a,{type:void 0}))}]:[]}}function no(t,s,o,n){const a=V(),i=ce(),[m,u]=b.useState(""),[d,r]=b.useState(0),c=At(m,250),f={slug:t},{data:g,isLoading:l,isError:h,refetch:y}=As(s??"",f,{search:c,offset:d,limit:30,enabled:!n&&!!s}),{data:C}=Es(o?`/${t}/${o}`:"",f),S=o?C?.entity:void 0,x=S?.name??(o?o.split("/").at(-1):void 0);if(n)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!s)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:l?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:O=>{u(O),r(0)},items:O=>e.jsxs(e.Fragment,{children:[h?e.jsx(A,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>e.jsxs(A,{value:I.slug,onSelect:()=>{const M=Ds([...I.parent_slug&&I.parent_entity_type?[{entity_type:I.parent_entity_type,slug:I.parent_slug}]:[],{entity_type:I.entity_type,slug:I.slug}]);a(ae(t,i,{type:s},M)),O()},children:[e.jsx(B,{selected:S?.slug===I.slug}),I.name]},I.slug)),d>0&&e.jsx(A,{onSelect:()=>r(Math.max(0,d-30)),children:"Previous entities"}),g?.metadata.has_more&&e.jsx(A,{disabled:l,onSelect:()=>r(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ve,icon:e.jsx(Ts,{className:z}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(t,i,{type:s}))}]:[]}}function oo(t,s,o){const n=V(),a=Lt(t),{data:i=[]}=Fs(),m=b.useMemo(()=>[...i].sort((r,c)=>r.name.localeCompare(c.name)),[i]);if(!o)return{fields:[],chips:[]};const u=m.find(r=>r.agentId===s),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:r=>m.map(c=>e.jsxs(A,{onSelect:()=>{n(a({agent:c.agentId,schedule:void 0})),r()},className:"gap-2",children:[e.jsx(B,{selected:c.agentId===s}),e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:c.name.trim().charAt(0).toUpperCase()||"?"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.name})]},c.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ve,icon:e.jsx(Rs,{className:z}),editor:d}],chips:s?[{id:"agent",label:"Agent",op:"is",value:u?.name??s,onRemove:()=>void n(a({agent:void 0,schedule:void 0}))}]:[]}}function ao(t,s,o){const n=V(),a=Lt(t),{groups:i}=zn(),m=ce(),u=Ce({platforms:String(m.platforms??m.platform??"")}).platforms??[],d=b.useMemo(()=>xt(s),[s]),r=b.useMemo(()=>xt(o),[o]),c=u.length===1?u[0]:ws(i,d),f=i.find(_=>_.connector_key===c),g=d.size===1?Number([...d][0]):void 0,l=Os(g),{org:h}=Et(),y=Tt(h?.id,{feedIds:[...r].map(Number),enabled:g==null&&r.size>0}),C=g==null?y:l,S=C.data??[],x={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},F={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:_=>e.jsxs(e.Fragment,{children:[i.map(k=>{const E=k.connector_name??k.connector_key;return e.jsxs(A,{disabled:k.connections.length===0,onSelect:()=>{n(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[e.jsx(B,{selected:k.connector_key===f?.connector_key}),e.jsx(Ks,{plain:!0,name:E,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:E}),k.connection_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,e.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:k.connector_key},label:E})]},k.connector_key)}),e.jsx(A,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:e.jsxs(Ge,{to:"/$owner/connectors/create",params:{owner:t},className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},O=[{key:"connector",label:"Connector",group:Me,icon:e.jsx(Bs,{className:z}),editor:F}],I=[],M=f?.connector_name??f?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(M&&I.push({id:"connector",label:"Connector",op:"is",value:M,onRemove:()=>void n(a(x))}),f){O.push({key:"connection",label:"Connection",group:Me,icon:e.jsx(Ms,{className:z}),editor:Q(f)});const _=d.size===1?f.connections.find(k=>d.has(String(k.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:gt({display_name:_.display_name,connector_name:f.connector_name,connector_key:f.connector_key}),onRemove:()=>void n(a({...x,platforms:f.connector_key}))})}if((g||o)&&O.push({key:"feed",label:"Feed",group:Me,icon:e.jsx(Ps,{className:z}),editor:H()}),r.size>0){const _=r.size===1?S.find(k=>r.has(String(k.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?xe(_):`#${o}`,onRemove:()=>void n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:O,chips:I};function Q(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:k=>_.connections.map(E=>{const L=gt({display_name:E.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return e.jsxs(A,{onSelect:()=>{n(a({connection_ids:String(E.id),feed_ids:void 0})),k()},className:"group gap-2",children:[e.jsx(B,{selected:d.has(String(E.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:L}),E.feed_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:E.feed_count}):null,e.jsx(oe,{...Tn(t,{id:E.id,connector_key:_.connector_key}),label:L})]},E.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>e.jsxs(A,{"aria-label":xe(k),onSelect:()=>{n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[e.jsx(B,{selected:r.has(String(k.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),e.jsx(oe,{...Fn(t,k),label:xe(k)})]},k.id))}}}function xe(t){return t.display_name?.trim()||t.feed_key}const io=["notification"],co=["note","summary","decision","observation","fact","change","preference","identity"],ro=[...io,...co],bt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],$t={value:"notifications",label:"Notifications"};function lo({value:t,onChange:s,withNotifications:o=!1}){const n=o?[$t,...bt]:bt,a=n.find(i=>i.value===t)?.label??"Newest first";return e.jsxs(Gs,{value:t,onValueChange:s,children:[e.jsxs(Us,{"aria-label":"Sort",className:"h-9 w-auto shrink-0 gap-2 bg-background px-2.5",children:[e.jsx(Vs,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Qs,{children:a})]}),e.jsx(zs,{align:"end",className:"min-w-40",children:n.map(i=>e.jsx(Ws,{value:i.value,children:i.label},i.value))})]})}const jt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],kt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],be=0,je=100,te="Event",se="h-4 w-4";function ne(t){const s=t.replace(/[_-]+/g," ").trim();return s.length>0?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:t}function uo(t,s,o){const n=t.semanticTypes??[],a=o.length>0?o:ro,i=[...new Set([...a,...n])].sort((f,g)=>ne(f).localeCompare(ne(g))).map(f=>({value:f,label:ne(f)})),m=t.engagementRange??[be,je],u=t.reviewStatus,d=t.interactionStatus,r=[{key:"date",label:"Date",group:te,icon:e.jsx(Js,{className:se}),editor:Sn({value:t.dateRange??void 0,onApply:f=>s({dateRange:f})})},{key:"kind",label:"Event kind",group:te,icon:e.jsx(en,{className:se}),editor:ke({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:i,selected:n,multiple:!0,onSelect:f=>{const g=n.includes(f)?n.filter(l=>l!==f):[...n,f];s({semanticTypes:g.length>0?g:void 0})}})},{key:"approval",label:"Approval",group:te,icon:e.jsx(tn,{className:se}),editor:ke({searchPlaceholder:"Search statuses...",options:[...kt],selected:d?[d]:[],onSelect:f=>s({interactionStatus:f})})},{key:"review",label:"Reviewed by",group:te,icon:e.jsx(sn,{className:se}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:u&&u!=="all"?[u]:[],onSelect:f=>s({reviewStatus:f})})},{key:"score",label:"Engagement score",group:te,icon:e.jsx(nn,{className:se}),editor:Nn({value:m,min:be,max:je,onApply:f=>s({engagementRange:f})})}],c=[];return t.dateRange&&c.push({id:"date",label:"Date",op:"is",value:_n(t.dateRange),onRemove:()=>s({dateRange:null})}),n.length&&c.push({id:"kind",label:"Event kind",op:n.length>1?"is any of":"is",value:n.length<=2?n.map(ne).join(", "):`${n.length} kinds`,title:n.map(ne).join(", "),onRemove:()=>s({semanticTypes:void 0})}),d&&c.push({id:"approval",label:"Approval",op:"is",value:kt.find(f=>f.value===d)?.label??d,onRemove:()=>s({interactionStatus:null})}),u&&u!=="all"&&c.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(f=>f.value===u)?.label??u,onRemove:()=>s({reviewStatus:void 0})}),(m[0]!==be||m[1]!==je)&&c.push({id:"score",label:"Engagement score",value:In(m,be,je),onRemove:()=>s({engagementRange:void 0})}),{fields:r,chips:c}}function Dt({filters:t,onFiltersChange:s,eventKinds:o=[],searchQuery:n,onSearchChange:a,scope:i,extraFields:m=[],drillChips:u=[],total:d,isListLoading:r=!1,isTotalLoading:c=!1,hasCursorInUrl:f=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=n.trim().length>0,F=h?{fields:[],chips:[]}:uo(t,s,o),O=[...i?.fields??[],...F.fields,...m],I=[...i?.chips??[],...u,...F.chips],M=I.length>0||x,Q=`${t.sortBy??"date"}-${t.sortOrder??"desc"}`,H=r||c?e.jsx(Hs,{className:"h-4 w-20"}):d==null?null:M?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return e.jsxs("div",{className:"w-full space-y-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!h&&e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx(Ys,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(qs,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:n,onChange:_=>a(_.target.value),className:Ne("bg-background pl-9",x&&"pr-9")}),x&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-0.5 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:e.jsx(Zs,{className:"h-3.5 w-3.5"})})]}),!h&&e.jsx(lo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===$t.value){l?.();return}const[k,E]=_.split("-");s({sortBy:k,sortOrder:E})}})]}),e.jsx(Cn,{label:"Event filters",fields:O,chips:I,meta:H,actions:C,trailing:e.jsxs(e.Fragment,{children:[y,!r&&f&&g&&e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",onClick:g,children:[e.jsx(Xs,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),onClearAll:S,hasClearableState:x})]})}function Bt({ownerSlug:t,...s}){const o=to({ownerSlug:t,sourceRead:s.sourceRead,filters:s.filters,onFiltersChange:s.onFiltersChange});return e.jsx(Dt,{...s,scope:o})}const Be=3600*1e3,Ct=24*Be;function St(t){const s=t instanceof Date?t:new Date(String(t));return Number.isNaN(s.getTime())?null:s}function Nt(t){return t.toISOString().split("T")[0]}function Ke(t){return t.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(t){const o=t[t.length-1].date.getTime()-t[0].date.getTime()>180*Ct,n=new Map;for(const a of t){const i=new Date(a.date);o&&i.setUTCDate(i.getUTCDate()-i.getUTCDay()),n.set(i.getTime(),(n.get(i.getTime())??0)+a.count)}return[...n.entries()].sort(([a],[i])=>a-i).map(([a,i])=>{const m=new Date(a);return{start:m,end:new Date(a+(o?7:1)*Ct),count:i,label:`${m.getUTCMonth()+1}/${m.getUTCDate()}`,tooltip:o?`Week of ${Ke(m)}`:Ke(m)}})}function fo(t){const s=m=>{const u=new Date(m);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const m of t)o.set(s(m),(o.get(s(m))??0)+1);const n=Math.min(...o.keys()),a=Math.max(...o.keys()),i=[];for(let m=n;m<=a;m+=Be){const u=new Date(m);i.push({start:u,end:new Date(m+Be),count:o.get(m)??0,label:pt(u,"HH:mm"),tooltip:pt(u,"MMM d, HH:mm")})}return i}function po({entityId:t,organizationId:s,ownerSlug:o,eventTimes:n,selectedRange:a,onSelectRange:i}){const{data:m,isLoading:u,error:d}=on(s,{entityId:t},{slug:o}),r=b.useMemo(()=>(m??[]).map(h=>{const y=St(h.date);return y?{date:y,count:h.count}:null}).filter(h=>h!==null).sort((h,y)=>h.date.getTime()-y.date.getTime()),[m]),c=b.useMemo(()=>{if(r.length===0)return[];if(r.length>1)return mo(r);const[h]=r,y=Nt(h.date),C=(n??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?fo(C):[]},[r,n]),f=b.useCallback(h=>{const y=c[h.dataIndex];y&&i&&i(y.start,y.end)},[c,i]),g=b.useCallback(h=>{if(i&&h.startValue!==void 0&&h.endValue!==void 0){const y=new Date(h.startValue),C=new Date(h.endValue);i(y,C)}},[i]),l=b.useMemo(()=>{if(c.length<2)return null;let h;if(a){const[y,C]=a,S=c.filter(x=>x.start<C&&x.end>y);S.length>0&&(h=[[{xAxis:S[0].label},{xAxis:S[S.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:y=>{const C=y[0];return`${c[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:c.map(y=>y.label)},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new Kn(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:c.map(y=>y.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:h?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:h}:void 0}]}},[c,a]);if(u||d)return e.jsx("div",{className:Ne(Rt,"p-4"),children:e.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?e.jsx(Un,{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(r.length===0)return null;if(!l){const[h]=r;return e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.count===1?"1 event":`All ${h.count} events`," on"," ",Ke(h.date),"."]})}return e.jsx(ho,{option:l,onClick:f,onDataZoom:g})}function ho({option:t,onClick:s,onDataZoom:o}){const{chartRef:n,setOption:a}=Gn({onClick:s,onDataZoom:o});return b.useEffect(()=>{a(t,!0)},[t,a]),e.jsx("div",{"data-testid":"events-timeline",className:Ne(Rt,"p-4 relative"),children:e.jsx("div",{ref:n,className:"h-48 w-full"})})}const _t="change";function vo({kinds:t,onFiltersChange:s}){const o=!t?.length,n=t?.length===1&&t[0]===_t,a=i=>Ne("h-7 px-2.5 text-xs",i?"bg-muted text-foreground":"text-muted-foreground");return e.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>s({semanticTypes:void 0}),children:"All"}),e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(n),"aria-pressed":n,onClick:()=>s({semanticTypes:[_t]}),children:"Changes"})]})}function yo({organizationId:t,ownerSlug:s,entityId:o,hideSourceFilter:n=!1,scopedEntityTypes:a,pinned:i,onShowNotifications:m,emptyState:u,changesShortcut:d=!1}){const{isAuthenticated:r,isReady:c}=an(),{isMember:f,isLoading:g}=Et(),l=c&&r&&f,h=c&&(!r||!g&&!f),y=V(),C=ie(),S=cn(),{filters:x,updateFilters:F,clearFilters:O}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),[I,M]=b.useState(x.searchQuery||""),[Q,H]=b.useState(Pe(x)||n&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,E=At(k,1e3),L=b.useRef(!1);b.useEffect(()=>S.history.subscribe(({location:p,action:v})=>{const N=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&L.current&&(N===(x.searchQuery??"")||N===(k??""))||(L.current=!1,M(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>ht({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),R=F;b.useEffect(()=>{L.current&&(x.searchQuery||void 0)!==E&&F({searchQuery:E})},[E,F,x.searchQuery]);const Qe=()=>{L.current=!1,M(""),n&&s?y({...$e(s,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${s}/events/`)?{to:C.pathname}:{}}):O()},re=Pe(ht(x)),_e=o===void 0,{data:Kt=[]}=rn(c&&l?t:null),{data:Gt=[]}=ln(h?s:null),ze=l?Kt:Gt,{data:We=[]}=dn(l&&t?{organizationId:t}:void 0),le=Wn(),de=j.connectionIds,Ie=(de?.length??0)>0,{data:He=[]}=un(c&&l?t??"":"",{connectionIds:de??void 0,enabled:!le&&c&&l&&Ie}),Ye=j.feedIds,Ae=(Ye?.length??0)>0,{data:qe=[]}=Tt(c&&l?t:null,{feedIds:Ye??void 0,enabled:c&&l&&Ae}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Ee=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Te=b.useMemo(()=>qe.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[qe]),Ut=b.useMemo(()=>Ie&&Ee.length===0||Ae&&Te.length===0?[]:qn({connectors:ze,entityTypes:We,selectedPlatforms:Ee,selectedFeeds:Te,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Ie,Ae,Ee,Te,We]),w=j.clientIds,ue=(w?.length??0)>0,{data:Xe=[]}=Pn(null,{enabled:c&&l&&ue}),me=b.useMemo(()=>{if(!w)return[];const p=new Set(w);return $n(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[w,Xe]),Je=b.useMemo(()=>{if(!ue||!w)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):w.length>1?`${w.length} client registrations`:"Client registration"},[me,w,ue]),fe=me.length===1?me[0]:null,Vt=s&&fe?Rn(s,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=Ln({enabled:c&&l&&ue&&!!pe,clientIds:w??[],limit:100}),tt=b.useMemo(()=>{if(!pe)return null;const p=et.find(N=>N.activityId===pe);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[pe,et]),Y=j.agentId,q=j.schedule,{data:st=[]}=Hn(Y??void 0),nt=b.useMemo(()=>!q||!Y?null:st.find(v=>v.id===q)?.description?.trim()||"Scheduled task",[Y,q,st]),{data:Qt}=mn(c&&l?t:null,o),{data:zt}=fn(h&&!_e?s:null,o),ot=l?Qt:zt,Fe=b.useMemo(()=>{const p=new Map;for(const v of ot||[]){const N=v.automation_name??"__global__";p.has(N)||p.set(N,{automationName:v.automation_name??null,classifiers:[]});const T=p.get(N),$=v.attribute_values||{},P=Object.keys($);let ve=null;const Z={};for(const[X,U]of Object.entries($))if(U.parent)for(const[Oe,J]of Object.entries(U.parent))ve=Oe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=T.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...P]);D.values=[...X];for(const[U,Oe]of Object.entries(Z)){D.valuesByParentValue[U]||(D.valuesByParentValue[U]=[]);const J=new Set([...D.valuesByParentValue[U],...Oe]);D.valuesByParentValue[U]=[...J]}ve&&(D.parentSlug=ve)}else T.classifiers.push({slug:v.slug,name:v.name,values:P,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,T)=>N.parentSlug===null&&T.parentSlug!==null?-1:N.parentSlug!==null&&T.parentSlug===null?1:0);return[...p.values()]},[ot]),Wt=pn(c&&l?t:null,o,j,s),Ht=hn(h?s:null,o,j),Yt=h?Ht:Wt,{data:K,isLoading:qt,error:Zt}=Yt,Xt=b.useMemo(()=>K?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[K]),at=K?.pages[0],it=(at?.content.length??0)>0,Jt=vn(c&&l?t:null,o,j,s),es=yn(h?s:null,o,j),Re=h?es:Jt,ts=Re.data?.total??void 0,ss=Re.data?.classification_stats,ns=Re.isLoading,os=!!(j.beforeOccurredAt||j.afterOccurredAt),ct=gn(j),rt=K?.pages[K.pages.length-1],G=rt?.content[rt.content.length-1];b.useEffect(()=>{!ct||!G||K?.pages.length===1||x.beforeOccurredAt===G.occurred_at&&x.beforeId===G.id||F({beforeOccurredAt:G.occurred_at,beforeId:G.id},{replace:!0})},[G?.id,ct,F,K?.pages.length,G,x.beforeOccurredAt,x.beforeId]);const as=b.useCallback(()=>{R({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[R]),is=(p,v)=>{R({dateRange:[p,v]})},lt=(p,v)=>{const N={...j.classificationFilters||{}};if(v.length>0)N[p]=v;else{delete N[p];for(const T of Fe)for(const $ of T.classifiers)$.parentSlug===p&&delete N[$.slug]}R({classificationFilters:N})},cs=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(T=>T!==v):[...N,v])},rs=p=>lt(p,[]);if(Zt)return e.jsx(xn,{label:"knowledge"});const we=!c||r&&g||l&&!t||qt,he={fields:[],chips:[]};for(const p of Fe)for(const v of p.classifiers){const N=j.classificationFilters?.[v.slug]??[],T=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,$=T?[...new Set(T.flatMap(P=>v.valuesByParentValue[P]??[]))]:v.values;$.length>0&&he.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:e.jsx(bn,{className:"h-4 w-4"}),editor:ke({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:$.map(P=>({value:P,label:P,count:ss?.[v.slug]?.[P]})),selected:N,multiple:!0,onSelect:P=>cs(v.slug,P)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=Fe.flatMap(T=>T.classifiers).find(T=>T.slug===p);he.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:N?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>rs(p)})}const ls=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>R({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>R({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:Vt,details:w&&w.length>0?e.jsx(Yn,{ownerSlug:s,clientIds:w,linkedUser:fe?.linkedUser,linkedUserEntitySlug:fe?.linkedUserEntitySlug}):void 0,onRemove:()=>R({clientIds:void 0})}):null,nt?ye({id:"schedule",label:"Schedule",value:nt,sourceLink:s&&Y&&q?wn(s,Y,q):void 0,onRemove:()=>R({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>R({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>R({resourceKind:void 0,resourceId:void 0})}]:[],...he.chips].filter(p=>p!=null),ds=!!(l&&o&&t),dt=i&&!re?i:void 0,ut={filterActions:d?e.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:R}):_e&&l?e.jsx("div",{className:"flex items-center gap-1",children:[["config","Configuration"],["deployment","Applies"]].map(([p,v])=>e.jsx(W,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>R({eventCategory:x.eventCategory===p?void 0:p,semanticTypes:x.eventCategory===p?void 0:["change"],resourceKind:void 0,resourceId:void 0}),children:v},p))}):void 0,filterTrailing:ds?e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":Q,onClick:()=>H(p=>!p),children:[e.jsx(kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Qe,onShowNotifications:m,filters:j,onFiltersChange:R,eventKinds:Ut,searchQuery:I,onSearchChange:p=>{L.current=!0,M(p)},extraFields:he.fields,drillChips:ls,total:ts,isListLoading:we,isTotalLoading:ns,hasCursorInUrl:os&&it,onGoToLatest:as},us=!we&&!!at&&!it&&!re,ms=r?l?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",mt=!!(l&&s);return e.jsx(jn,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:n?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:n&&s?e.jsx(Bt,{...ut,ownerSlug:s}):e.jsx(Dt,{...ut})}),Q&&l&&o&&t&&e.jsx(po,{entityId:o,organizationId:t,ownerSlug:s||"",eventTimes:Xt,selectedRange:j.dateRange||void 0,onSelectRange:is}),dt?.rows,we?e.jsx(Dn,{}):us?u??e.jsx(vt,{icon:yt,title:"No activity yet",description:ms,actionLabel:mt?"Add a connector":void 0,onAction:mt&&s?()=>void y({to:"/$owner/connectors/create",params:{owner:s}}):void 0}):e.jsx(Bn,{onFiltersChange:R,organizationId:t,ownerSlug:s,entityId:o,filters:j,showEntityLinks:_e,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:e.jsx(vt,{icon:yt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:re?"Clear filters":void 0,onAction:re?Qe:void 0})})]})})}function go({record:t,ownerSlug:s}){const o=ie(),n=V(),{filters:a,updateFilters:i}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),m=Pe({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{n({...$e(s,o.search??{}),...o.pathname.startsWith(`/${s}/events/`)?{}:{to:o.pathname}})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Bt,{ownerSlug:s,sourceRead:!0,filters:a,onFiltersChange:i,searchQuery:a.searchQuery??"",onSearchChange:d=>i({searchQuery:d}),onClearFilters:u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),m?e.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[e.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),e.jsx(W,{variant:"outline",size:"sm",onClick:()=>{const d=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),r={...$e(s,o.search??{}).search,...d};n({to:o.pathname,search:r})},children:"Clear unsupported filters"})]}):e.jsx(Mn,{record:t,orgContext:{slug:s},filters:a})]})}function wo({entity:t,organizationId:s,ownerSlug:o}){const n=t.is_derived?e.jsx(go,{ownerSlug:o,record:{type:t.entity_type,key:t.slug}}):e.jsx(yo,{organizationId:s,ownerSlug:o,entityId:typeof t.id=="number"?t.id:void 0,hideSourceFilter:!0,changesShortcut:!0});return e.jsx(Qn,{organizationId:s,children:t.entity_type==="$member"?e.jsx(Vn,{children:n}):n})}export{yo as E,Qn as M,$t as N,wo as R,lo as S};
|
|
2
|
-
//# sourceMappingURL=record-activity-CTLwq8s1.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as o,j as t,B as n,L as c,cG as u,gy as h,e2 as y}from"./index-BjcZVe7n.js";function f({owner:i,filters:a,name:e}){const r=o();return t.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5",children:t.jsxs(c,{title:`View activity for ${e}`,to:"/$owner",params:{owner:i},search:y(a),onClick:s=>{!r||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),r.open({href:h(i,a),title:"Runs history"}))},children:[t.jsx(u,{className:"h-3.5 w-3.5"}),"View activity"]})})}export{f as R};
|
|
2
|
-
//# sourceMappingURL=run-activity-link-Dh1YyCfk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as k,eI as I,j as d,L as u,ed as h}from"./index-BjcZVe7n.js";import{u as j}from"./use-automations-D9hKpufo.js";import{u as b}from"./clients-Cmp0LmOp.js";function C(n,e,o){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":e==="agent"?"an agent":o?`Automation ${o}`:"an Automation"}function B({ownerSlug:n,initiator:e,clientName:o,fallback:_}){const t=e?.client_id??o,{allOrgs:m,isAuthenticated:p}=k(),r=p&&m?.some(s=>s.slug===n),c=b(void 0,{ownerSlug:n,enabled:!!(t&&r)}).data?.find(s=>s.id===t)?.title,l=r?m.find(s=>s.slug===n)?.id:void 0,f=e?.kind==="automation"&&e.automation_id?String(e.automation_id):void 0,v=j(f?l:void 0,void 0,{includeDetails:!1}).data?.find(s=>s.automation_id===f)?.name,{members:x}=I(e?.kind==="user"&&e.user_id?l:void 0),$=x.find(s=>s.userId===e?.user_id)?.user.name,a=e&&e.kind!=="user"?v??C(e,void 0,e.automation_id===void 0?void 0:String(e.automation_id)):$??_,g="font-medium text-foreground",i=`${g} underline-offset-4 hover:underline`;return e?.kind==="automation"&&e.automation_id?d.jsx(u,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(e.automation_id)},search:{view:"definition",run_id:void 0},className:i,children:a}):e?.kind==="agent_session"&&e.agent_id?d.jsx(u,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:String(e.agent_id)},className:i,children:a}):t?d.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:n,clientId:t},className:`${i} inline-flex items-center gap-1 align-middle`,children:[d.jsx(h,{name:c??o??t}),c??a]}):d.jsx("span",{className:g,children:a})}export{B as R,C as p};
|
|
2
|
-
//# sourceMappingURL=run-initiator-CCxNv0rK.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{at as P,aH as w,cD as B,j as o,ct as k,cU as g,d$ as E,i as M,e0 as C,cT as _,cS as U,cz as z,c as H,w as O,e1 as W,e2 as D,r as x,B as R,ab as G}from"./index-BjcZVe7n.js";import{u as q}from"./use-scroll-sentinel-BWCrmNIB.js";import{u as J}from"./runs-BntGAKQG.js";import{o as K,F as Q,S as V}from"./filter-bar-CQ_oE7a9.js";import{M as p,c as X,u as Y,a as Z}from"./manage-gear-C-0BAMbC.js";import{R as ee,a as ne}from"./runs-table-CYS1jDdL.js";function te(t){const{org:l}=P(t?.ownerSlug),h=w(t?l?.id:null),u=B(t?l?.id:null);if(!t)return{fields:[],chips:[]};const s=(h.data??[]).map(n=>({id:n.id,label:n.display_name||`Connection #${n.id}`,connectorKey:n.connector_key}));for(const n of t.connectionIds)s.some(a=>a.id===n)||s.unshift({id:n,label:`Connection #${n}`,connectorKey:t.connectorKey});const r=(u.data??[]).map(n=>({key:n.key,label:n.name}));t.connectorKey&&!r.some(n=>n.key===t.connectorKey)&&r.unshift({key:t.connectorKey,label:t.connectorKey});const i=n=>{const a=n==="connection"?h:u,d=K({searchPlaceholder:`Search ${n}s...`,emptyText:a.isLoading?"Loading...":`No ${n}s`,multiple:n==="connection",selected:n==="connection"?t.connectionIds.map(String):[t.connectorKey],options:n==="connection"?s.map(e=>({value:String(e.id),label:e.label,action:e.connectorKey?o.jsx(p,{...X(t.ownerSlug,{id:e.id,connector_key:e.connectorKey}),label:e.label}):null})):r.map(e=>({value:e.key,label:e.label,action:o.jsx(p,{to:"/$owner/connectors/$connectorKey",params:{owner:t.ownerSlug,connectorKey:e.key},label:e.label})})),onSelect:e=>n==="connection"?t.onChange({connectionIds:t.connectionIds.includes(Number(e))?t.connectionIds.filter(c=>c!==Number(e)):[...t.connectionIds,Number(e)]}):t.onChange({connectorKey:e})});return{...d,items:e=>o.jsxs(o.Fragment,{children:[d.items(e,""),a.isError?o.jsxs(g,{forceMount:!0,onSelect:()=>void a.refetch(),children:["Could not load ",n,"s. Retry"]}):null]})}};return{fields:[{key:"connection",label:"Connection",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connection")},{key:"connector",label:"Connector",icon:o.jsx(k,{className:"h-4 w-4"}),editor:i("connector")}],chips:[...t.connectionIds.length?[{id:"connection",field:"connection",label:"Connection",op:"is",value:t.connectionIds.map(n=>s.find(a=>a.id===n)?.label??`#${n}`).join(", "),onRemove:()=>t.onChange({connectionIds:[]})}]:[],...t.connectorKey?[{id:"connector",field:"connector",label:"Connector",op:"is",value:r.find(n=>n.key===t.connectorKey)?.label??t.connectorKey,onRemove:()=>t.onChange({connectorKey:""})}]:[]]}}function oe({bucket:t,status:l,onBucketChange:h,onStatusChange:u,automation:s,source:r}){const i=te(r),n=Y(s?.ownerSlug??"",!!s),a=(n.data??[]).map(e=>({value:e.automation_id,label:`${e.name}${e.status==="archived"?" (archived)":""}`}));for(const e of s?.ids??[])a.some(c=>c.value===String(e))||a.unshift({value:String(e),label:`Automation #${e}`});const d=e=>a.find(c=>c.value===String(e))?.label??`#${e}`;return o.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[o.jsx("div",{className:"inline-flex max-w-full flex-wrap rounded-md border bg-muted/30 p-0.5 text-sm",children:E.map(e=>o.jsx("button",{type:"button",onClick:()=>h(e.value),className:M("rounded px-3 py-1 transition-colors",t===e.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))}),o.jsx(Q,{label:"Run filters",className:"w-full min-w-0",fields:[...i.fields,...s?[{key:"automation",label:"Automation",icon:o.jsx(U,{className:"h-4 w-4"}),editor:{kind:"list",searchPlaceholder:"Search Automations...",emptyText:n.isLoading?"Loading Automations...":"No Automations",items:()=>o.jsxs(o.Fragment,{children:[o.jsx(_,{children:a.map(e=>{const c=Number(e.value);return o.jsxs(g,{value:`${e.label} ${c}`,"aria-label":e.label,className:"group",onSelect:()=>s.onChange(s.ids.includes(c)?s.ids.filter(f=>f!==c):[...s.ids,c]),children:[o.jsx(V,{selected:s.ids.includes(c)}),o.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.label}),o.jsx(p,{...Z(s.ownerSlug,e.value),label:e.label})]},e.value)})}),n.isError?o.jsx(g,{forceMount:!0,onSelect:()=>void n.refetch(),children:"Could not load Automations. Retry"}):null]})}}]:[],{key:"status",label:"Status",icon:o.jsx(z,{className:"h-4 w-4"}),editor:K({searchPlaceholder:"Search statuses...",options:C,selected:l==="all"?[]:[l],onSelect:u})}],chips:[...i.chips,...l==="all"?[]:[{id:"status",label:"Status",op:"is",value:C.find(e=>e.value===l)?.label??l,onRemove:()=>u("all")}],...s?.ids.length?[{id:"automation",field:"automation",label:"Automation",op:"is",value:s.ids.map(d).join(", "),onRemove:()=>s.onChange([])}]:[]]})]})}function ue({ownerSlug:t}){const l=H(),{search:h}=O(),u=W(h);return o.jsx(se,{scope:{workspace:!0},ownerSlug:t,filterState:u,onFilterChange:s=>{l({search:(r=>({...r,...D(s)}))})}})}function se({scope:t,ownerSlug:l,filterState:h,onFilterChange:u}){const[s,r]=x.useState({bucket:"all",status:"all",automationIds:[],connectionIds:[],connectorKey:""}),i=h??s,{bucket:n,status:a,automationIds:d,connectionIds:e,connectorKey:c}=i,f=u??r,I=x.useMemo(()=>({runTypes:n==="all"?void 0:[n],status:a==="all"?void 0:a,...d.length?{automationIds:d}:{},...e.length?{connectionIds:e}:{}}),[n,a,d,e]),{data:y,isLoading:F,isError:b,hasNextPage:v,isFetching:j,isFetchingNextPage:$,fetchNextPage:S,refetch:A}=J(c?{connectorKey:c}:t,I,l),N=x.useMemo(()=>y?.pages.flatMap(m=>m.runs)??[],[y]),L={runType:n==="all",feed:!("workspace"in t)||n==="sync",connection:"deviceId"in t||"connectorKey"in t||"workspace"in t&&n!=="automation",startedBy:!0},T=q({onIntersect:()=>void S(),enabled:!!v&&!j&&!b,rootMargin:"200px"});return o.jsxs("div",{className:"space-y-3",children:[o.jsx(oe,{bucket:n,status:a,onBucketChange:m=>f({...i,bucket:m}),onStatusChange:m=>f({...i,status:m}),automation:"workspace"in t?{ownerSlug:l,ids:d,onChange:m=>f({...i,automationIds:m})}:void 0,source:"workspace"in t?{ownerSlug:l,connectionIds:e,connectorKey:c,onChange:m=>f({...i,...m})}:void 0}),F?o.jsx(ee,{}):b?o.jsxs("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:["Failed to load runs."," ",o.jsx(R,{variant:"ghost",size:"sm",onClick:()=>void A(),children:"Retry"})]}):N.length===0?o.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&a==="all"&&!d.length&&!e.length&&!c?"No runs yet.":"No runs match these filters."}):o.jsxs(o.Fragment,{children:[o.jsx(ne,{runs:N,ownerSlug:l,columns:L}),o.jsx("div",{ref:T,className:"h-1"}),v&&o.jsx(R,{variant:"ghost",size:"sm",disabled:j,onClick:()=>void S(),children:"Load more runs"}),$&&o.jsx("div",{className:"flex justify-center py-3",children:o.jsx(G,{size:"lg",className:"text-muted-foreground"})})]})]})}export{se as R,ue as W};
|
|
2
|
-
//# sourceMappingURL=runs-panel-BwTVaRsE.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,i as p,S as c,bG as h,B as k,L as f,da as w,a$ as v,b0 as _,b1 as T,en as C,eo as S,u as R,ek as V,ec as L,V as B,ep as D,e9 as $,aj as A,ab as E,eq as I,r as j,dT as g,dV as y,dU as N}from"./index-BjcZVe7n.js";import{R as K}from"./run-initiator-CCxNv0rK.js";import{T as P,a as M,b as m,c as i,d as O,e as d}from"./table-DALHuXPE.js";function q({labels:t,className:r}){return e.jsx("div",{className:p("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",r),children:t.map((a,n)=>e.jsx("span",{className:n===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function F({rows:t=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(c,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:t}).map((r,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(c,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(c,{className:"h-3 w-20"}),e.jsx(c,{className:"h-3 w-16"}),e.jsx(c,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(c,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function ie({rows:t=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(q,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(F,{rows:t})]})}const H=h("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),U=h("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function z({className:t,status:r,showDot:a=!0,children:n,...o}){return e.jsxs("span",{className:p(H({status:r}),t),...o,children:[a&&e.jsx("span",{className:U({status:r})}),n]})}function G(t,r){switch(r.kind){case"connection":return S(t,r.id);case"feed":return C(t,r.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(r.id)}}}}function J({ownerSlug:t,scope:r,variant:a="outline",iconOnly:n=!1,label:o,className:s,title:x}){const l=G(t,r),b=x??o??"View in memory",u=e.jsx(k,{asChild:!0,variant:a,size:n?"icon":"sm",className:p(n&&"h-7 w-7",s),children:e.jsxs(f,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:p("h-3.5 w-3.5",!n&&"mr-1.5")}),!n&&(o??"View in memory")]})});return n?e.jsxs(v,{children:[e.jsx(_,{asChild:!0,children:u}),e.jsx(T,{children:b})]}):u}const W=new Set(["error","failed","revoked"]);function X(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":W.has(t)?"error":"default"}function Q({status:t}){return t==="completed"?e.jsx($,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(A,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(E,{className:"text-blue-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-muted-foreground"})}function Y({error:t}){const[r,a]=j.useState(!1);return t.length>80?e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(N,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function Z({checkpoint:t}){const[r,a]=j.useState(!1);return e.jsxs(g,{open:r,onOpenChange:a,children:[e.jsx(y,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(N,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function ee(t){if(t.initiator_kind)return{kind:t.initiator_kind,...t.initiator_ref};if(t.automation_id)return{kind:"automation",automation_id:t.automation_id};if(t.created_by_user_id)return{kind:"user",user_id:t.created_by_user_id}}function te({run:t,ownerSlug:r}){const a=ee(t);return a?a.kind==="system"?e.jsx("span",{className:"text-muted-foreground",children:"System"}):e.jsx(K,{ownerSlug:r,initiator:a,clientName:void 0,fallback:"A person"}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}function se(t){return t.feed_display_name??t.feed_key??"—"}function de({runs:t,ownerSlug:r,columns:a={}}){const n=R(),o=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(P,{children:[e.jsx(M,{children:e.jsxs(m,{children:[e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"When"}),a.runType&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Type"}),a.connection&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Connection"}),a.feed&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Feed"}),a.startedBy&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Started by"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Version"}),o&&e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(i,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(i,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(O,{children:t.map(s=>{const x=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(m,{children:[e.jsx(d,{className:"py-1.5 px-3",children:e.jsx(Q,{status:s.status})}),e.jsxs(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:L(s.created_at),children:[e.jsxs(f,{to:"/$owner/events",params:{owner:r},search:{run_ids:String(s.id)},className:"block text-foreground hover:underline",onClick:l=>{!n||l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),n.open({href:s.run_type==="automation"&&s.automation_id!=null?`/${r}/automations/${s.automation_id}?view=activity&run_id=${s.id}`:`/${r}/events?run_ids=${s.id}`,title:`Run #${s.id}`,runId:s.id}))},children:["Run #",s.id]}),V(s.created_at)]}),a.runType&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(B,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),a.connection&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),a.feed&&e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:se(s)}),a.startedBy&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(te,{run:s,ownerSlug:r})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:e.jsx(z,{status:X(s.status),children:s.status})}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:x!=null?D(x):"—"}),e.jsx(d,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),o&&e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(Z,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(d,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(Y,{error:s.error_message}):""}),e.jsx(d,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:r,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{F as R,z as S,J as V,de as a,ie as b,X as g};
|
|
2
|
-
//# sourceMappingURL=runs-table-CYS1jDdL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as u,g6 as l,j as t,bO as m,b_ as x,fo as c}from"./index-BjcZVe7n.js";import{E as i}from"./entity-type-page-D0ghgRgq.js";function E({slug:r,onClose:a}){const{orgContext:e}=u(),{data:s=[],isLoading:o,isError:y}=l(e);if(r===null)return t.jsx(i,{entityType:null,orgContext:e,onClose:a,compact:!0});if(o)return t.jsx(m,{label:"entity type",variant:"panel"});if(y)return t.jsx(x,{label:"entity type"});const n=s.find(p=>p.slug===r)??null;return n?t.jsx(i,{entityType:n,orgContext:e,hideDelete:c(n),onClose:a,compact:!0}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}export{E as S};
|
|
2
|
-
//# sourceMappingURL=schema-type-editor-panel-v3nR2Oa2.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j2 as t,j as e}from"./index-BjcZVe7n.js";import{a as m}from"./agents-workbench-CDpJmUVN.js";import"./agent-editor-form-BXQBFHSv.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./model-selector-B2cjCn0V.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./nav-pill-Bam6s3jj.js";function h(){const{owner:o,agentId:r}=t.useParams(),i=t.useSearch();return e.jsx(m,{owner:o,agentId:r,tab:"settings",runId:i.run_id})}export{h as component};
|
|
2
|
-
//# sourceMappingURL=settings-DBgT60nY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j1 as r,j as t,O as s}from"./index-BjcZVe7n.js";import{A as e}from"./agent-skill-context-1DBn7Xc_.js";import"./core.esm-BsXtvNoI.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
2
|
-
//# sourceMappingURL=skills-DDoeRGhJ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as y,cP as b,f1 as v,j as e,B as j,f2 as R,S as _,bN as C,L,e4 as F,x as E}from"./index-BjcZVe7n.js";import{a as P,R as S,b as $}from"./event-card-CjA_dLzq.js";import{b as A}from"./events-feed-CGzA1w3R.js";function f({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function I({record:o,orgContext:c,filters:l}){const{orgContext:d}=y(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:g,fetchNextPage:a,hasNextPage:h,isFetching:x,isFetchingNextPage:s}=v(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(f,{failures:m,isError:n,isFetching:x,onRetry:()=>void g()}),e.jsx(A,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:x,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx(P,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function B({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=y(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:g,isFetching:a,isFetchNextPageError:h,error:x}=R(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(f,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=x instanceof C&&x.status===400;h&&!s||!i&&n?g():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx($,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void g(),children:a?"Loading…":"Load more"})]}):e.jsx(f,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{I as S,B as a};
|
|
2
|
-
//# sourceMappingURL=source-record-panels-m8gECt82.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,i as t}from"./index-BjcZVe7n.js";const s={live:"bg-green-500",amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function a({tone:r}){return e.jsx("span",{"aria-hidden":r===null,className:t("h-1.5 w-1.5 shrink-0 rounded-full",r===null?"bg-transparent":s[r])})}export{a as S};
|
|
2
|
-
//# sourceMappingURL=status-dot-BnQPFrcU.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,V as U,i as R,W as D,B as W,Y as B,Z as I,$ as T,a0 as V,K,a1 as q}from"./index-BjcZVe7n.js";import{C as G,a as Y,b as Z,d as J,c as Q}from"./card-g4yxo4Hr.js";function z(s){if(!s)return null;try{const t=new URL(s);return t.protocol==="https:"&&t.hostname?t.toString():null}catch{return null}}function _(s){const t=z(s);if(!t)return null;const a=new URL(t).hostname.toLowerCase();return a.length>0&&a.length<=253&&/^[a-z0-9.-]+$/.test(a)?a:null}function X({clientName:s,logoUri:t=null,clientUri:a=null}){const[r,i]=d.useState(!1),[o,p]=d.useState(!1),g=r?null:z(t),j=o?null:_(a)??_(t);return g?e.jsx("img",{src:g,alt:"",referrerPolicy:"no-referrer",onError:()=>i(!0),className:"h-10 w-10 shrink-0 rounded-md object-contain"}):j?e.jsx("img",{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(j)}&sz=64`,alt:"",referrerPolicy:"no-referrer",onError:()=>p(!0),className:"h-10 w-10 shrink-0 rounded-md bg-secondary object-contain"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-secondary text-base font-bold text-secondary-foreground",children:(s??"?").charAt(0).toUpperCase()||"?"})}const H=["mcp:read","mcp:write","mcp:admin"],ee=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],L={read:0,write:1,admin:2};function F(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function se(s,t){const a=s.filter(i=>!H.includes(i));if(!t)return a;const r=F(s);return!r||L[t]>L[r]?a:["mcp:read",...t==="write"||t==="admin"?["mcp:write"]:[],...t==="admin"?["mcp:admin"]:[],...a]}function ie({idPrefix:s,clientName:t,clientNote:a,requestedScopes:r,accessLevel:i,onAccessLevelChange:o,allowNoAccess:p=!1,disabled:g=!1,resource:j=null,logoUri:w=null,clientUri:h=null}){const y=F(r),x=r.includes("profile:read"),m=r.filter(c=>!H.includes(c)&&c!=="profile:read"&&c!=="device_worker:run"&&c!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsx("section",{"aria-label":"Application",className:"space-y-2",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(X,{clientName:t,logoUri:w,clientUri:h}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t||"Unnamed application"}),a?e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a}):null,j&&e.jsxs("div",{className:"mt-2 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1.5",children:[e.jsx("p",{children:"Requesting access to"}),r.length>0&&e.jsx("p",{className:"flex flex-wrap gap-1.5",children:r.map(c=>e.jsx("span",{className:"px-1 py-0.5 font-mono text-[11px] text-foreground",children:c},c))})]}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:e.jsxs("p",{children:["on"," ",e.jsx("code",{className:"break-all rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground",children:j})]})})]})]})]})}),x&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(U,{variant:"secondary",children:"Always included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to. This is separate from the workspace data access below."})]})]}),y&&e.jsxs("fieldset",{className:"space-y-2",disabled:g,children:[e.jsx("legend",{className:"text-sm font-medium",children:"What should this client have access to?"}),e.jsxs("div",{className:"space-y-2",children:[p?e.jsxs("label",{htmlFor:`${s}-access-none`,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",i===null&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:`${s}-access-none`,type:"radio",name:`${s}-access-level`,value:"none",checked:i===null,onChange:()=>o(null),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:"No workspace data access"}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:"Pair the device only. It won't read or write workspace data."})]})]}):null,ee.filter(c=>L[c.value]<=L[y]).map(c=>{const f=`${s}-access-${c.value}`,b=i===c.value;return e.jsxs("label",{htmlFor:f,className:R("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:f,type:"radio",name:`${s}-access-level`,value:c.value,checked:b,onChange:()=>o(c.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.title,c.risk==="high"&&e.jsx(D,{"aria-label":"High risk",className:"h-3.5 w-3.5 shrink-0 text-destructive",children:e.jsx("title",{children:"High risk"})})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:c.description})]})]},c.value)})]})]}),m.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:m.map(c=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:c},c))})]})]})}function oe({summary:s,children:t,className:a}){return e.jsxs("div",{className:R("flex flex-wrap items-center gap-3 border-t pt-4",s?"justify-between":"justify-end",a),children:[s?e.jsx("p",{className:"text-sm text-muted-foreground",children:s}):null,e.jsx("div",{className:"ml-auto flex items-center gap-3",children:t})]})}function de({busy:s,approveLabel:t="Approve",approveDisabled:a=!1,denyDisabled:r=!1,onApprove:i,onDeny:o}){return e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"outline",onClick:o,disabled:r,children:s==="deny"?"Denying...":"Deny"}),e.jsx(W,{type:"button",onClick:i,disabled:a,children:s==="approve"?"Approving...":t})]})}function me({title:s,description:t,busy:a=!1,error:r=null,review:i,aside:o,below:p,notice:g,footer:j,live:w=!1}){return e.jsx("main",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs(G,{className:R("w-full",o?"max-w-4xl":"max-w-lg"),role:w?"status":void 0,"aria-live":w?"polite":void 0,children:[e.jsxs(Y,{children:[e.jsx(Z,{asChild:!0,children:e.jsx("h1",{children:s})}),t?e.jsx(J,{children:t}):null]}),e.jsxs(Q,{className:"space-y-5","aria-busy":a,children:[o?e.jsxs("div",{className:"grid gap-6 md:grid-cols-[minmax(0,1fr)_300px]",children:[e.jsx("div",{className:"min-w-0",children:i}),e.jsx("div",{className:"min-w-0",children:o})]}):i,p,g,r?e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:r}):null,j]})]})})}function ue({resourceOrg:s,accessLevel:t}){return e.jsxs("section",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm space-y-2",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Workspace access: only ",s]}),e.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[e.jsx("li",{children:"If this workspace is public, the app can read public data immediately after approval."}),t==="write"?e.jsx("li",{children:"If you are not already a member, this connection will stay read-only. Ask an organization admin to grant write access, then reconnect the MCP client."}):null,t==="admin"?e.jsx("li",{children:"If you are not already an admin or owner, elevated actions will stay blocked. Ask an organization owner to grant the required role, then reconnect the MCP client."}):null,t==="read"?e.jsx("li",{children:"Public read access does not require membership."}):null]})]})}function te(s){const t=K(s);return t.kind==="cross-host"?t.href:t.to}function pe({idPrefix:s,heading:t,orgList:a,selectedOrgIds:r,onWorkspaceAccessChange:i,onSelectedOrgChange:o,orgsLoading:p,orgsError:g,onRetry:j,disabled:w=!1,includedOrgId:h=null,allowMultiple:y}){const x=`${s}-workspace-access-legend`,m=`${s}-workspace-search`,[c,f]=d.useState(""),b=t??"Workspace access",N=h?a.find(n=>n.id===h)??null:null,k=a.filter(n=>n.id!==h),$=r.filter(n=>n!==h).length,A=h?$:r.length,E=k.length>0&&k.every(n=>r.includes(n.id));if(p)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]});if(g)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(W,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:j,children:"Retry"})]})]});if(a.length===0)return e.jsxs("section",{"aria-labelledby":x,className:"space-y-2",children:[e.jsx("p",{id:x,className:"text-sm font-medium",children:b}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]});const M=()=>{if(E)for(const n of k)o(n.id,!1);else i("all_current")},S=c.trim().toLowerCase(),l=S?k.filter(n=>n.name.toLowerCase().includes(S)||n.slug.toLowerCase().includes(S)):k;return e.jsxs("fieldset",{className:"min-w-0 space-y-3",disabled:w,children:[e.jsx("legend",{id:x,className:"sr-only",children:b}),e.jsxs("p",{className:"text-sm font-medium",children:[b," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",A," selected"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col overflow-hidden rounded-md border bg-card",children:[e.jsxs("div",{className:"border-b bg-card p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),y&&k.length>0&&e.jsx("button",{type:"button",onClick:M,className:"shrink-0 cursor-pointer bg-none p-0 text-xs font-semibold text-foreground underline underline-offset-4",children:E?"Clear all":`Select all ${k.length}`})]}),!h&&e.jsx("p",{className:"mt-0.5 whitespace-nowrap text-sm text-muted-foreground",children:y?"Choose workspaces for this app.":"Choose one workspace this application can access."}),e.jsx("input",{id:m,type:"search",value:c,onChange:n=>f(n.target.value),placeholder:"Filter workspaces…","aria-label":"Filter workspaces",className:"mt-2 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"})]}),e.jsxs("div",{className:"max-h-80 space-y-1.5 overflow-auto p-2",children:[N?e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md bg-muted px-2.5 py-2",children:[e.jsx(B,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:N.name}),N.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})}),e.jsx(U,{variant:"secondary",className:"shrink-0",children:"Device home"})]})}),e.jsx("span",{className:"sr-only",children:"Included"})]}):null,l.map(n=>{const u=`${s}-workspace-${n.id}`,v=r.includes(n.id);return e.jsxs("div",{className:R("flex items-center gap-2.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted/60",v&&"bg-primary/5 hover:bg-primary/5"),children:[e.jsx(T,{id:u,checked:v,disabled:w,onCheckedChange:C=>o(n.id,C===!0)}),e.jsx("label",{htmlFor:u,className:"min-w-0 flex-1 cursor-pointer truncate text-sm font-medium text-foreground",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 truncate",children:n.name}),n.isPersonal&&e.jsx(I,{"aria-label":"Personal workspace",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",children:e.jsx("title",{children:"Personal workspace"})})]})}),e.jsx("a",{href:te(n.slug),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),"aria-label":`Open ${n.name} workspace`,title:`Open ${n.name} workspace`,className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(V,{className:"h-3.5 w-3.5"})})]},n.id)}),l.length===0&&!N&&e.jsx("p",{className:"px-2 py-3 text-[13px] text-muted-foreground",children:"No workspaces match."})]}),e.jsx("div",{className:"border-t bg-card px-3 py-2 text-xs text-muted-foreground",children:e.jsx("p",{"aria-live":"polite",children:h?`${$} additional workspace${$===1?"":"s"} selected.`:`${r.length} of ${a.length} workspaces selected.`})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function ne(s,t){return s.length===t.length&&s.every((a,r)=>a===t[r])}function re(s={}){const{requireDeviceHome:t=!1,deviceHomeOrgId:a=null,allowMultiple:r=!0}=s,{data:i,error:o,isPending:p,refetch:g}=q(),[j,w]=d.useState("selected"),[h,y]=d.useState([]),x=d.useRef(!1),m=d.useMemo(()=>i?i.filter(l=>l.is_member).map(l=>({id:l.id,name:l.name,slug:l.slug,isPersonal:l.is_personal===!0})):[],[i]),c=m.find(l=>l.isPersonal)?.id??null,f=t?a&&m.some(l=>l.id===a)?a:c:null,b=d.useRef(m);b.current=m;const N=o instanceof Error?o.message:o?"Unable to load workspaces":null;d.useEffect(()=>{if(p||N)return;const l=m.map(u=>u.id),n=new Set(l);y(u=>{const v=x.current?u.filter(C=>n.has(C)):[c??l[0]].filter(C=>!!C);return x.current=!0,ne(u,v)?u:v})},[m,N,p,c]);const k=d.useCallback(l=>{if(l==="all_current"){if(!r)return;y(b.current.map(n=>n.id))}w(l)},[r]),$=d.useCallback((l,n)=>{b.current.some(u=>u.id===l)&&(t&&(l===f||!r)||(w("selected"),y(u=>n?r?u.includes(l)?u:[...u,l]:[l]:u.filter(v=>v!==l))))},[r,f,t]),A=d.useMemo(()=>{if(t&&f&&!r)return[f];const l=new Set(h);return t&&f&&l.add(f),m.filter(n=>l.has(n.id)).map(n=>n.id)},[r,h,f,m,t]),E=d.useCallback(()=>{const l=b.current,n=l.find(u=>u.isPersonal)?.id??l[0]?.id;x.current=l.length>0,w("selected"),y(n?[n]:[])},[]),M=!p&&!N&&m.length>0&&A.length>0&&(r||A.length===1)&&(!t||f!==null&&A.includes(f)),S=d.useCallback(()=>{g()},[g]);return{orgList:m,workspaceAccess:j,setWorkspaceAccess:k,selectedOrgIds:A,toggleSelectedOrgId:$,resetWorkspaceSelection:E,personalOrgId:c,deviceHomeOrgId:f,orgsLoading:p,orgsError:N,retryOrgs:S,workspaceSelectionReady:M}}function ae(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}function he({requestedScopes:s,resource:t=null,allowMultiple:a,requireDeviceHome:r=!1,deviceHomeOrgId:i=null}){const o=F(s),[p,g]=d.useState(o);d.useEffect(()=>{g(F(s))},[s]);const j=d.useMemo(()=>se(s,p),[s,p]),w=d.useMemo(()=>ae(t),[t]),h=j.some(m=>m.startsWith("mcp:")),y=h&&!w,x=re({allowMultiple:a,requireDeviceHome:r,deviceHomeOrgId:i});return{accessLevel:p,setAccessLevel:g,selectedScopes:j,resourceOrg:w,hasMcpScopes:h,requiresWorkspaceAccess:y,...x}}function P(s){return typeof s=="string"&&s.length>0?s:null}function xe(s,t){return P(s?.error_description)??P(s?.message)??P(s?.error)??t}function O(s=window.location.href){const t=new URL("/auth/login",window.location.origin);return t.searchParams.set("callbackUrl",s),t.toString()}function fe(){window.location.href=O()}function ge(s,t){d.useEffect(()=>{t||s||(window.location.href=O())},[s,t])}export{ie as A,me as C,ue as R,pe as W,ge as a,oe as b,de as c,F as g,xe as o,fe as r,he as u};
|
|
2
|
-
//# sourceMappingURL=use-login-redirect-ciwfc-7A.js.map
|