@lobu/runtime-server 24.7.0 → 24.9.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 +282 -322
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +6 -2
- package/dist/connectors/github.ts +16 -3
- package/dist/connectors/imessage.ts +953 -0
- package/dist/connectors/linkedin.ts +20 -377
- package/dist/connectors/market_quotes.ts +388 -91
- package/dist/connectors/postgres.ts +21 -14
- package/dist/connectors/x-dm-adapter.js +55 -21
- package/dist/connectors/x.ts +1 -1
- package/dist/db/migrations/20261109010000_workspace_navigation.sql +14 -0
- package/dist/db/migrations/20261110010000_view_resources.sql +11 -0
- package/dist/dependencies.bun.lock +135 -103
- package/dist/embeddings-server.mjs +14 -2
- package/dist/owletto/dist/assets/_-B2C9B2RM.js +2 -0
- package/dist/owletto/dist/assets/_-CjyiGzwB.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +2 -0
- package/dist/owletto/dist/assets/_agentId-bna2tPsW.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DqwSv8Zs.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-zcs-S3dY.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +2 -0
- package/dist/owletto/dist/assets/_owner-DsvIC94q.js +3 -0
- package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +2 -0
- package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-CX7Egv-p.js → accept-invitation-k1u3zBcn.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +2 -0
- package/dist/owletto/dist/assets/agent-connect-pages-D3mVM_q4.js +4 -0
- package/dist/owletto/dist/assets/agent-editor-form-Bnc_q5WD.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-DHvKiEUB.js → agent-loading-shells-xteN-pyK.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-C_ayr0pd.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DF5q0Dfr.js → agent-skill-context-r0O0BVOu.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-Pi5cECga.js → agent-subpage-shell-C2KpYdu3.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-B1ZepGZc.js → agent-thread-Bv_chdPy.js} +4 -4
- package/dist/owletto/dist/assets/agent-thread-storage-Bx2-WBHQ.js +2 -0
- package/dist/owletto/dist/assets/app._appId-BUcNaSMS.js +2 -0
- package/dist/owletto/dist/assets/assist-composer-B1LykXpD.js +2 -0
- package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +2 -0
- package/dist/owletto/dist/assets/{callback-Ckrxv0eo.js → callback-kSLa4n5s.js} +2 -2
- package/dist/owletto/dist/assets/{card-DT9mSjSp.js → card-C01y1O-W.js} +2 -2
- package/dist/owletto/dist/assets/{claim-Bzby28tT.js → claim-Dnux9Lqf.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-DoIErdUy.js → client-activity-scopes-BBIq16tG.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-BbVQy5Ti.js → client-rows-DGh1O-Fu.js} +2 -2
- package/dist/owletto/dist/assets/clients-BCvjAJDT.js +2 -0
- package/dist/owletto/dist/assets/code-editor-BdRMYojw.js +26 -0
- package/dist/owletto/dist/assets/connect-DZeFSGIH.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D4w-JhJW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-BsDzltNz.js +2 -0
- package/dist/owletto/dist/assets/{connection-BOaMa324.js → connection-C7glVpPE.js} +2 -2
- package/dist/owletto/dist/assets/connection-feed-detail-CJju0qiw.js +2 -0
- package/dist/owletto/dist/assets/connector-page-shell-BeuyjiB2.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-B2C2cjBg.js +2 -0
- package/dist/owletto/dist/assets/{connectors-D5F5rHxX.js → connectors-DSQ5AWPf.js} +2 -2
- package/dist/owletto/dist/assets/consent-B6Aw_89N.js +2 -0
- package/dist/owletto/dist/assets/copy-button-BhXeXLIm.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-BIE97rfo.js → core.esm-CJUp2aNZ.js} +3 -3
- package/dist/owletto/dist/assets/create-CWcza8NT.js +2 -0
- package/dist/owletto/dist/assets/{create-BPxsKwk7.js → create-DUlRsFNn.js} +2 -2
- package/dist/owletto/dist/assets/{create-automation-form-B12yTrmj.js → create-automation-form-D141prEG.js} +3 -3
- package/dist/owletto/dist/assets/create-bGOYifof.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +2 -0
- package/dist/owletto/dist/assets/{custom-guardrail-edits-B9plaLBN.js → custom-guardrail-edits-DuQ28xv3.js} +2 -2
- package/dist/owletto/dist/assets/definition-comparison-BUDNuAN_.js +2 -0
- package/dist/owletto/dist/assets/{detail-page-skeleton-I5_7FkKx.js → detail-page-skeleton-BRHaq5Sj.js} +2 -2
- package/dist/owletto/dist/assets/{device-CadaiNF4.js → device-D3fzoIrM.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-BIM-ziCH.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-BnPqTgK1.js +2 -0
- package/dist/owletto/dist/assets/dynamic-schema-form-OkIZImgp.js +2 -0
- package/dist/owletto/dist/assets/entity-options-CpeX7iiX.js +2 -0
- package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-18xSANrS.js +2 -0
- package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-MgZ7_0oh.js +2 -0
- package/dist/owletto/dist/assets/event-detail-D6AH6a2C.js +2 -0
- package/dist/owletto/dist/assets/event-kind-options-fHAIXu24.js +2 -0
- package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-DDTwyYt0.js +3 -0
- package/dist/owletto/dist/assets/{full-page-spinner-CCU4PkRv.js → full-page-spinner-DWo519BU.js} +2 -2
- package/dist/owletto/dist/assets/index-9tTjJo_J.css +1 -0
- package/dist/owletto/dist/assets/{index-pmr1WUoG.js → index-BW7IFKXC.js} +2 -2
- package/dist/owletto/dist/assets/index-BYcFrinP.js +2 -0
- package/dist/owletto/dist/assets/index-BhJsTy-C.js +2 -0
- package/dist/owletto/dist/assets/index-CEcsgXDj.js +2 -0
- package/dist/owletto/dist/assets/index-CPscKk2u.js +2 -0
- package/dist/owletto/dist/assets/{index-B72KYdN1.js → index-Cd8jMsz8.js} +2 -2
- package/dist/owletto/dist/assets/index-CdDNNAx2.js +7906 -0
- package/dist/owletto/dist/assets/index-CfJ2-EpK.js +2 -0
- package/dist/owletto/dist/assets/index-D1UCJQl1.js +2 -0
- package/dist/owletto/dist/assets/index-D5DM4g2w.js +2 -0
- package/dist/owletto/dist/assets/index-DmqnKGqW.js +2 -0
- package/dist/owletto/dist/assets/index-DznAbTOF.js +2 -0
- package/dist/owletto/dist/assets/json-diff-C-WQqyIf.js +4 -0
- package/dist/owletto/dist/assets/{list-skeleton-BAqT0vxo.js → list-skeleton-0B1bTrAK.js} +2 -2
- package/dist/owletto/dist/assets/{login-D5bIjMtf.js → login-CH7P2AyR.js} +2 -2
- package/dist/owletto/dist/assets/{logout-JYZvxz8v.js → logout-D474YsYQ.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-CH_0jHiM.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +74 -0
- package/dist/owletto/dist/assets/model-selector-XYmk7Iru.js +2 -0
- package/dist/owletto/dist/assets/needs-you-list-Bd4iiiqm.js +2 -0
- package/dist/owletto/dist/assets/new-BOsrRqp8.js +2 -0
- package/dist/owletto/dist/assets/new-CJ6TF3Vc.js +2 -0
- package/dist/owletto/dist/assets/{new-B-Jd-vBl.js → new-DGPOjak2.js} +2 -2
- package/dist/owletto/dist/assets/new-Q0XqiZq2.js +2 -0
- package/dist/owletto/dist/assets/organization-hD_Z6TSd.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-Cc8YX1oy.js +2 -0
- package/dist/owletto/dist/assets/{pending-seed-CoFPQ835.js → pending-seed-D7-ld7as.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-BWRJidwb.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +2 -0
- package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +2 -0
- package/dist/owletto/dist/assets/{record-session-Bpx4_LGk.js → record-session-ClKBr1_C.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-CgaQKMoG.js → renderer-DZ0w2k2r.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-C-4Jnuqk.js → reset-password-D2RfrEVZ.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-B8IRlRd-.js +2 -0
- package/dist/owletto/dist/assets/runs-CuC7WMtd.js +2 -0
- package/dist/owletto/dist/assets/runs-list-8gUPWjP4.js +2 -0
- package/dist/owletto/dist/assets/{schema-value-BUgC0Ro8.js → schema-value-k19Ata7u.js} +3 -3
- package/dist/owletto/dist/assets/scoped-feed-bar-L7h-Ca4u.js +2 -0
- package/dist/owletto/dist/assets/{settings-DYYvrrZ4.js → settings-BZqntV3E.js} +2 -2
- package/dist/owletto/dist/assets/source-record-panels-C4UItfdk.js +2 -0
- package/dist/owletto/dist/assets/{status-variants-DT61YfsU.js → status-variants-BR_iGWN5.js} +2 -2
- package/dist/owletto/dist/assets/subDays-hOwerOLo.js +2 -0
- package/dist/owletto/dist/assets/{table-B6yimlsZ.js → table-C3DMoL4K.js} +2 -2
- package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +2 -0
- package/dist/owletto/dist/assets/use-login-redirect-CYlVkAhE.js +2 -0
- package/dist/owletto/dist/assets/use-mention-search-CtbixPEE.js +91 -0
- package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-BVtMfgLh.js → views-access-required-CvIIxdS_.js} +2 -2
- package/dist/owletto/dist/index.html +19 -12
- package/dist/server-main.bundle.mjs +4518 -2567
- package/npm-shrinkwrap.json +644 -551
- package/package.json +4 -2
- package/vendor/connector-sdk/dist/connector-types.d.ts +23 -2
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.d.ts +3 -4
- package/vendor/core/dist/classify-error.js +8 -8
- 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/collection-presentation.d.ts +17 -1
- package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +39 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +11 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- 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/manage-views.d.ts +249 -7
- package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
- package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
- package/vendor/core/dist/contracts/tools/navigation.js +284 -0
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
- package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
- package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
- package/vendor/core/dist/contracts/tools/view-host.js +30 -1
- package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
- package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
- package/vendor/core/dist/error-report.js +1 -0
- package/vendor/core/dist/errors.d.ts +17 -24
- package/vendor/core/dist/errors.js +17 -24
- package/vendor/core/dist/types.d.ts +0 -6
- package/vendor/core/package.json +11 -1
- package/vendor/views/dist/api.d.ts +30 -5
- package/vendor/views/dist/api.js +22 -8
- package/vendor/views/dist/bridge.d.ts +17 -0
- package/vendor/views/dist/bridge.js +49 -1
- package/vendor/views/dist/components.d.ts +27 -5
- package/vendor/views/dist/components.js +57 -7
- package/vendor/views/dist/embed.d.ts +98 -0
- package/vendor/views/dist/embed.js +418 -0
- package/vendor/views/dist/index.d.ts +3 -1
- package/vendor/views/dist/index.js +1 -0
- package/vendor/views/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/_-CZgmjLR9.js +0 -2
- package/dist/owletto/dist/assets/_-Cm5OgtYD.js +0 -3
- package/dist/owletto/dist/assets/_-DtqBFgK5.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cci6NFc1.js +0 -2
- package/dist/owletto/dist/assets/_agentId-GhWTlPO2.js +0 -2
- package/dist/owletto/dist/assets/_automationId-KUlxSTK2.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-Zpy7Hvml.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-CYDRp9UX.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-NNqDdije.js +0 -2
- package/dist/owletto/dist/assets/_eventId-0BSX6VHj.js +0 -2
- package/dist/owletto/dist/assets/_owner-C-CD22NB.js +0 -3
- package/dist/owletto/dist/assets/_shape-CvXp4omb.js +0 -2
- package/dist/owletto/dist/assets/_slug-DgK7zpKA.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-cH54P0zY.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-m0B5j7L9.js +0 -2
- package/dist/owletto/dist/assets/activity-link-rXNpmppV.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-B0m7_g9q.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-BmD3-_Ox.js +0 -4
- package/dist/owletto/dist/assets/agent-connect-pages-BtOTCsTU.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-CirqCpcM.js +0 -2
- package/dist/owletto/dist/assets/agent-list-row-SyACVYX7.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-Dsc26dyW.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -2
- package/dist/owletto/dist/assets/agents-D1FHZ0jR.js +0 -2
- package/dist/owletto/dist/assets/app._appId-01I0CJal.js +0 -2
- package/dist/owletto/dist/assets/assist-composer-BD9msDk3.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-BFv1TglZ.js +0 -2
- package/dist/owletto/dist/assets/automation-row-CmTpAD4r.js +0 -2
- package/dist/owletto/dist/assets/automation-source-list-D8ZSavQU.js +0 -2
- package/dist/owletto/dist/assets/automations-D1FHZ0jR.js +0 -2
- package/dist/owletto/dist/assets/change-summary-CGrKEJ04.js +0 -2
- package/dist/owletto/dist/assets/clients-6aJvabvS.js +0 -2
- package/dist/owletto/dist/assets/connect-BmDziBzI.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-Bs8mxsga.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-t5aKu3aa.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DswMAw8l.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BLCjhP-H.js +0 -2
- package/dist/owletto/dist/assets/connector-boxes-BAP_f77M.js +0 -2
- package/dist/owletto/dist/assets/connector-page-shell-ClOmVPJr.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-wmYu5jwO.js +0 -2
- package/dist/owletto/dist/assets/consent-RqHNkmm8.js +0 -2
- package/dist/owletto/dist/assets/copy-button-D6zpsZLi.js +0 -2
- package/dist/owletto/dist/assets/create-GT8_yF0R.js +0 -2
- package/dist/owletto/dist/assets/create-Yx2qBMBy.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CzXqSkuI.js +0 -2
- package/dist/owletto/dist/assets/definition-comparison-C3k6Wa9B.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-U7Bx05P6.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DTZqj1HS.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-DyT_9iVE.js +0 -2
- package/dist/owletto/dist/assets/entity-options-CGTjLlcS.js +0 -2
- package/dist/owletto/dist/assets/entity-page-DHHMmA8V.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-eYbG2FDT.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CjFqxSdL.js +0 -2
- package/dist/owletto/dist/assets/event-card-BtTUuf2q.js +0 -2
- package/dist/owletto/dist/assets/event-detail-8xHiplt_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-zFnTSE27.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Dd5R2Etd.js +0 -2
- package/dist/owletto/dist/assets/home-stream-IVsNEkwp.js +0 -2
- package/dist/owletto/dist/assets/index-2oaMOFKe.js +0 -2
- package/dist/owletto/dist/assets/index-B-Ab8srM.js +0 -7899
- package/dist/owletto/dist/assets/index-B4RZgvvI.js +0 -2
- package/dist/owletto/dist/assets/index-BBZM53p8.js +0 -2
- package/dist/owletto/dist/assets/index-BOb0a5f9.js +0 -2
- package/dist/owletto/dist/assets/index-BYFDMIQC.js +0 -2
- package/dist/owletto/dist/assets/index-BwnFQcMe.js +0 -2
- package/dist/owletto/dist/assets/index-CvYsWYlF.js +0 -2
- package/dist/owletto/dist/assets/index-DIXIvtnM.js +0 -2
- package/dist/owletto/dist/assets/index-DLwokXHW.js +0 -2
- package/dist/owletto/dist/assets/index-_nlPHus1.js +0 -2
- package/dist/owletto/dist/assets/index-cwOgj4-i.js +0 -2
- package/dist/owletto/dist/assets/index-pp4qmhkA.js +0 -2
- package/dist/owletto/dist/assets/index-tTbno-PX.css +0 -1
- package/dist/owletto/dist/assets/json-diff-B-1Swv_y.js +0 -28
- package/dist/owletto/dist/assets/member-scope-gate-Lj9m4RL2.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-rAKfVdQ_.js +0 -74
- package/dist/owletto/dist/assets/model-selector-onvGA9Ww.js +0 -2
- package/dist/owletto/dist/assets/new-BmehH1uR.js +0 -2
- package/dist/owletto/dist/assets/new-KDi15LWZ.js +0 -2
- package/dist/owletto/dist/assets/organization-B9bh20Xo.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-Bqus80Mq.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CnACXCUg.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-Dlh-eWz0.js +0 -2
- package/dist/owletto/dist/assets/record-activity-6CfR95Ul.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-BvruBM5H.js +0 -2
- package/dist/owletto/dist/assets/runs-BMzp7j7j.js +0 -2
- package/dist/owletto/dist/assets/runs-list-DVhrTr3v.js +0 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-Bdeumkux.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-CBV9tsR3.js +0 -2
- package/dist/owletto/dist/assets/use-automations-II_YJWtN.js +0 -2
- package/dist/owletto/dist/assets/use-login-redirect-BqtEilid.js +0 -2
- package/dist/owletto/dist/assets/use-mention-search-Bxlpd6Dp.js +0 -96
- package/dist/owletto/dist/assets/view-param-filters-DYlqBocg.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aA as vn,j as n,r as b,c as G,w as ie,cS as yn,cT as It,cU as At,L as Ne,a0 as gn,cV as xn,ck as bn,cW as jn,cM as kn,cX as Et,cY as A,br as ft,cZ as Cn,c_ as Sn,ao as Nn,c$ as _n,an as In,d0 as An,d1 as ae,cv as En,d2 as Tt,d3 as Tn,aq as Fn,d4 as wn,bf as Rn,d5 as Mn,aw as Ce,d6 as On,d7 as Pn,at as Ft,aI as wt,d8 as $n,d9 as pt,da as Ln,db as Dn,dc as Rt,dd as Kn,de as Bn,cB as Un,bb as Vn,bt as Gn,bu as Qn,df as Wn,bv as zn,bw as Hn,bx as qn,S as Yn,cK as Zn,I as Xn,i as _e,X as Jn,B as z,dg as es,dh as ts,di as ns,bW as ss,dj as os,dk as as,dl as is,dm as Mt,dn as ht,q as rs,dp as cs,dq as $e,dr as vt,cF as ls,ds,l as us,aH as ms,dt as fs,du as ps,dv as hs,dw as vs,dx as ys,dy as gs,dz as xs,c4 as bs,dA as js,aY as ks,b2 as yt,dB as gt,dC as Ot,cx as Le,cD as Pt,dD as Cs,dE as De}from"./index-B-Ab8srM.js";import{S as K,F as Ss,d as Ns,o as ke,r as _s,f as Is,a as As}from"./filter-editors-Dd5R2Etd.js";import{u as Es}from"./runs-BMzp7j7j.js";import{S as Ts}from"./source-record-panels-CBV9tsR3.js";import{u as Fs}from"./clients-6aJvabvS.js";import{u as ws}from"./client-activity-scopes-DoIErdUy.js";import{g as Rs}from"./client-rows-BbVQy5Ti.js";import{E as Ms}from"./events-feed-zFnTSE27.js";import{E as Os}from"./run-initiator-BvruBM5H.js";import{L as Ps,u as $s}from"./renderer-CgaQKMoG.js";import{E as Ls}from"./agent-loading-shells-DHvKiEUB.js";import{M as Ds}from"./member-scope-gate-Lj9m4RL2.js";const Ve=b.createContext(null);function Ks({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:a}=vn(e);return n.jsx(Ve.Provider,{value:{groups:s,isLoading:!!t||a},children:o})}function Bs(){const e=b.useContext(Ve);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Us(){return b.useContext(Ve)}function $t(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:a=!0,replace:i=!0,merge:m}=e,u=G(),d=ie(),c=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 t(g)},[d.search,t]),r=b.useCallback((g,l)=>{const h=m?m(c,g):{...c,...g},y=o(h),C={};for(const[S,x]of Object.entries(d.search||{}))x!=null&&(C[S]=x);for(const S of s)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})},[c,o,s,a,m,u,d,i]),f=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(d.search||{}))h!=null&&(s.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));u({to:d.pathname,search:g,replace:i})},[u,d.pathname,d.search,s,a,i]);return{filters:c,updateFilters:r,clearFilters:f}}function Vs(e){const{slug:t}=yn();return It({queryKey:["schedules",t,e],queryFn:async()=>((await At("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Gs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Qs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function Ws(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function zs(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Hs(e,t,o){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:o}}}function ye({id:e,label:t,value:o,sourceLink:s,details:a,onRemove:i}){return{id:e,label:t,op:"is",value:o,onRemove:i,editor:s||a?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(Ne,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:o}),n.jsx(gn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function qs({ownerSlug:e,clientIds:t,linkedUser:o,linkedUserEntitySlug:s}){const a=e&&s?xn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(i=>n.jsx("code",{className:"break-all text-foreground",children:i},i))]}),o?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?n.jsx(Ne,{to:a,className:"font-medium text-foreground hover:underline",children:o}):n.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ge(e,t,o){const s=new Set;for(const[a,i]of Object.entries(e.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(!t){s.add(u);continue}const c=ee(d)?.attributions;Array.isArray(c)&&c.some(r=>{const f=ee(ee(r)?.target);return typeof f?.entityType=="string"&&t.has(f.entityType)})&&s.add(u)}}return s}function Ys({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const i=new Set,m=new Set(o),u=new Set(a),d=new Map;for(const c of s){const r=d.get(c.connectorKey)??new Set;r.add(c.feedKey),d.set(c.connectorKey,r)}if(d.size>0)for(const c of e){const r=d.get(c.key);if(r)for(const f of ge(c,void 0,r))i.add(f)}else if(m.size>0){for(const c of e)if(m.has(c.key))for(const r of ge(c))i.add(r)}else if(u.size>0){for(const c of t)if(u.has(c.slug))for(const r of Object.keys(c.event_kinds??{}))i.add(r);for(const c of e)for(const r of ge(c,u))i.add(r)}else{for(const c of t)for(const r of Object.keys(c.event_kinds??{}))i.add(r);for(const c of e)for(const r of ge(c))i.add(r)}return[...i].sort((c,r)=>c.localeCompare(r))}function Zs(e,t=!0){return It({queryKey:["automations-list","activity",e],queryFn:async()=>{const o=await Promise.all(["active","archived"].map(s=>At("manage_automations",{action:"list",status:s,include_details:!1},{slug:e})));return[...new Map(o.flatMap(s=>s.automations).map(s=>[Number(s.automation_id),s])).values()].sort((s,a)=>s.name.localeCompare(a.name))},enabled:t&&!!e,staleTime:3e4})}function oe({to:e,params:t,search:o,label:s}){return n.jsx(Ne,{to:e,params:t,search:o,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(bn,{className:"h-3.5 w-3.5"})})}const Ke=["produced","analyzed"],Se=e=>e==="produced"?"Produced by":"Analyzed by";function Xs({enabled:e,...t}){const o=Js(t,e);if(!e)return{fields:[],chips:[]};const s=eo(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Js({ownerSlug:e,filters:t,onFiltersChange:o},s){const a=Zs(e,s),i=a.data??[],m=r=>r==="produced"?t.producedByAutomationId:t.automationId,u=r=>i.find(f=>Number(f.automation_id)===r)?.name??`#${r}`,d=Ke.flatMap(r=>{const f=m(r);return f==null?[]:[{id:`automation-${r}`,field:"automation",label:Se(r),value:u(f),onRemove:()=>o(r==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),c={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:r=>n.jsxs(n.Fragment,{children:[Ke.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}),r()};return n.jsx(Et,{heading:Se(f),children:l.map(y=>n.jsxs(A,{"aria-label":y.label,value:`${f} ${y.label} ${y.id}`,onSelect:()=>h(y.id),className:"group",children:[n.jsx(K,{selected:g===y.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),n.jsx(oe,{...zs(e,String(y.id)),label:y.label})]},y.id))},f)}),a.isError?n.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:n.jsx(jn,{className:"h-4 w-4"}),editor:c}}}function eo(e){const{filters:t,onFiltersChange:o}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(i=>`#${i}`).join(", "),onRemove:()=>o({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.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)=>Ke.map(u=>n.jsx(to,{...e,mode:u,query:m,close:i},u))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(kn,{className:"h-4 w-4"}),editor:a}}}function to({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:a,close:i}){const m=s==="produced"?t.producedByAutomationId:t.automationId,u=Es({workspace:!0},{automationIds:m==null?void 0:[m],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),d=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],c=u.data?.pages.flatMap(l=>l.runs)??[],r=[...new Map(c.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)r.some(h=>h.id===l)||r.unshift({id:l,label:`Run #${l} (selected)`});const f=l=>{if(s==="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 n.jsxs(Et,{heading:Se(s),children:[r.map(l=>n.jsxs(A,{value:`${s} ${l.label}`,onSelect:()=>f(l.id),children:[n.jsx(K,{selected:d.includes(l.id)}),n.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!r.some(l=>l.id===g)?n.jsxs(A,{value:`${s} ${g}`,onSelect:()=>f(g),children:[Se(s)," run #",g]}):null,u.isLoading?n.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?n.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!r.length?n.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?n.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ge="Scope",Pe="Source",W="h-4 w-4";function re(){return ie().search??{}}function Lt(e){const{pathname:t}=ie(),o=t.startsWith(`/${e}/events/`),s=Nn(t,o?1:0),a=!!(s&&!o&&!_n(s.split("/")[0]));return{pathname:t,embedded:a,recordPath:a?In(s)?.entityPath:o?s:void 0}}function Dt(e){const t=re(),{recordPath:o,pathname:s,embedded:a}=Lt(e);return i=>{const m=ae(e,t,i,o);return a?{to:s,search:m.search}:m}}const xt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function no({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const a=re(),{recordPath:i,embedded:m}=Lt(e),u=i?i.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,c=(u?ft(u):void 0)??(d?ft(d):void 0),r=Cn(a),f=Sn(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=so(e,c,!m),h=oo(e,c,i,m),y=ao(e,r,!t),C=Xs({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),S=io(e,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(e,t,o){const s=G(),a=re(),{visible:i}=An(e);if(!o)return{fields:[],chips:[]};const m=i.find(d=>d.slug===t),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>n.jsxs(n.Fragment,{children:[i.map(c=>n.jsxs(A,{onSelect:()=>{s(ae(e,a,{entity:void 0,create:void 0,type:c.slug})),d()},className:"group gap-2",children:[n.jsx(K,{selected:c.slug===t}),n.jsx(Dn,{icon:c.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.name}),typeof c.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:c.entity_count}):null,n.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:c.slug},label:c.name})]},c.id)),n.jsxs(A,{onSelect:()=>{s(Kn(e)),d()},className:"text-muted-foreground",children:[n.jsx(Rt,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ge,icon:n.jsx(En,{className:W}),editor:u}],chips:t?[{id:"type",label:"Entity type",op:"is",value:m?.name??t,onRemove:()=>void s(ae(e,a,{type:void 0}))}]:[]}}function oo(e,t,o,s){const a=G(),i=re(),[m,u]=b.useState(""),[d,c]=b.useState(0),r=Tt(m,250),f={slug:e},{data:g,isLoading:l,isError:h,refetch:y}=Tn(t??"",f,{search:r,offset:d,limit:30,enabled:!s&&!!t}),{data:C}=Fn(o?`/${e}/${o}`:"",f),S=o?C?.entity:void 0,x=S?.name??(o?o.split("/").at(-1):void 0);if(s)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!t)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:l?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:M=>{u(M),c(0)},items:M=>n.jsxs(n.Fragment,{children:[h?n.jsx(A,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>n.jsxs(A,{value:I.slug,onSelect:()=>{const O=Bn([...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(e,i,{type:t},O)),M()},children:[n.jsx(K,{selected:S?.slug===I.slug}),I.name]},I.slug)),d>0&&n.jsx(A,{onSelect:()=>c(Math.max(0,d-30)),children:"Previous entities"}),g?.metadata.has_more&&n.jsx(A,{disabled:l,onSelect:()=>c(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ge,icon:n.jsx(wn,{className:W}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(e,i,{type:t}))}]:[]}}function ao(e,t,o){const s=G(),a=Dt(e),{data:i=[]}=Rn(),m=b.useMemo(()=>[...i].sort((c,r)=>c.name.localeCompare(r.name)),[i]);if(!o)return{fields:[],chips:[]};const u=m.find(c=>c.agentId===t),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:c=>m.map(r=>n.jsxs(A,{onSelect:()=>{s(a({agent:r.agentId,schedule:void 0})),c()},className:"gap-2",children:[n.jsx(K,{selected:r.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:r.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name})]},r.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ge,icon:n.jsx(Mn,{className:W}),editor:d}],chips:t?[{id:"agent",label:"Agent",op:"is",value:u?.name??t,onRemove:()=>void s(a({agent:void 0,schedule:void 0}))}]:[]}}function io(e,t,o){const s=G(),a=Dt(e),{groups:i}=Bs(),m=re(),u=Ce({platforms:String(m.platforms??m.platform??"")}).platforms??[],d=b.useMemo(()=>xt(t),[t]),c=b.useMemo(()=>xt(o),[o]),r=u.length===1?u[0]:On(i,d),f=i.find(_=>_.connector_key===r),g=d.size===1?Number([...d][0]):void 0,l=Pn(g),{org:h}=Ft(),y=wt(h?.id,{feedIds:[...c].map(Number),enabled:g==null&&c.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:_=>n.jsxs(n.Fragment,{children:[i.map(k=>{const E=k.connector_name??k.connector_key;return n.jsxs(A,{disabled:k.connections.length===0,onSelect:()=>{s(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[n.jsx(K,{selected:k.connector_key===f?.connector_key}),n.jsx(Vn,{plain:!0,name:E,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:E}),k.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,n.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:k.connector_key},label:E})]},k.connector_key)}),n.jsx(A,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:n.jsxs(Ne,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},M=[{key:"connector",label:"Connector",group:Pe,icon:n.jsx(Un,{className:W}),editor:F}],I=[],O=f?.connector_name??f?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(O&&I.push({id:"connector",label:"Connector",op:"is",value:O,onRemove:()=>void s(a(x))}),f){M.push({key:"connection",label:"Connection",group:Pe,icon:n.jsx($n,{className:W}),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:pt({display_name:_.display_name,connector_name:f.connector_name,connector_key:f.connector_key}),onRemove:()=>void s(a({...x,platforms:f.connector_key}))})}if((g||o)&&M.push({key:"feed",label:"Feed",group:Pe,icon:n.jsx(Ln,{className:W}),editor:H()}),c.size>0){const _=c.size===1?S.find(k=>c.has(String(k.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?xe(_):`#${o}`,onRemove:()=>void s(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:M,chips:I};function Q(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:k=>_.connections.map(E=>{const $=pt({display_name:E.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return n.jsxs(A,{onSelect:()=>{s(a({connection_ids:String(E.id),feed_ids:void 0})),k()},className:"group gap-2",children:[n.jsx(K,{selected:d.has(String(E.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:$}),E.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:E.feed_count}):null,n.jsx(oe,{...Qs(e,{id:E.id,connector_key:_.connector_key}),label:$})]},E.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>n.jsxs(A,{"aria-label":xe(k),onSelect:()=>{s(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[n.jsx(K,{selected:c.has(String(k.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),n.jsx(oe,{...Gs(e,k),label:xe(k)})]},k.id))}}}function xe(e){return e.display_name?.trim()||e.feed_key}const ro=["notification"],co=["note","summary","decision","observation","fact","change","preference","identity"],lo=[...ro,...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"}],Kt={value:"notifications",label:"Notifications"};function uo({value:e,onChange:t,withNotifications:o=!1}){const s=o?[Kt,...bt]:bt,a=s.find(i=>i.value===e)?.label??"Newest first";return n.jsxs(Gn,{value:e,onValueChange:t,children:[n.jsxs(Qn,{"aria-label":"Sort",className:"h-9 w-auto shrink-0 gap-2 bg-background px-2.5",children:[n.jsx(Wn,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx(zn,{children:a})]}),n.jsx(Hn,{align:"end",className:"min-w-40",children:s.map(i=>n.jsx(qn,{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",ne="h-4 w-4";function se(e){const t=e.replace(/[_-]+/g," ").trim();return t.length>0?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e}function mo(e,t,o){const s=e.semanticTypes??[],a=o.length>0?o:lo,i=[...new Set([...a,...s])].sort((f,g)=>se(f).localeCompare(se(g))).map(f=>({value:f,label:se(f)})),m=e.engagementRange??[be,je],u=e.reviewStatus,d=e.interactionStatus,c=[{key:"date",label:"Date",group:te,icon:n.jsx(ts,{className:ne}),editor:Ns({value:e.dateRange??void 0,onApply:f=>t({dateRange:f})})},{key:"kind",label:"Event kind",group:te,icon:n.jsx(ns,{className:ne}),editor:ke({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:i,selected:s,multiple:!0,onSelect:f=>{const g=s.includes(f)?s.filter(l=>l!==f):[...s,f];t({semanticTypes:g.length>0?g:void 0})}})},{key:"approval",label:"Approval",group:te,icon:n.jsx(ss,{className:ne}),editor:ke({searchPlaceholder:"Search statuses...",options:[...kt],selected:d?[d]:[],onSelect:f=>t({interactionStatus:f})})},{key:"review",label:"Reviewed by",group:te,icon:n.jsx(os,{className:ne}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:u&&u!=="all"?[u]:[],onSelect:f=>t({reviewStatus:f})})},{key:"score",label:"Engagement score",group:te,icon:n.jsx(as,{className:ne}),editor:_s({value:m,min:be,max:je,onApply:f=>t({engagementRange:f})})}],r=[];return e.dateRange&&r.push({id:"date",label:"Date",op:"is",value:Is(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&r.push({id:"kind",label:"Event kind",op:s.length>1?"is any of":"is",value:s.length<=2?s.map(se).join(", "):`${s.length} kinds`,title:s.map(se).join(", "),onRemove:()=>t({semanticTypes:void 0})}),d&&r.push({id:"approval",label:"Approval",op:"is",value:kt.find(f=>f.value===d)?.label??d,onRemove:()=>t({interactionStatus:null})}),u&&u!=="all"&&r.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(f=>f.value===u)?.label??u,onRemove:()=>t({reviewStatus:void 0})}),(m[0]!==be||m[1]!==je)&&r.push({id:"score",label:"Engagement score",value:As(m,be,je),onRemove:()=>t({engagementRange:void 0})}),{fields:c,chips:r}}function Bt({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:a,scope:i,extraFields:m=[],drillChips:u=[],total:d,isListLoading:c=!1,isTotalLoading:r=!1,hasCursorInUrl:f=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=s.trim().length>0,F=h?{fields:[],chips:[]}:mo(e,t,o),M=[...i?.fields??[],...F.fields,...m],I=[...i?.chips??[],...u,...F.chips],O=I.length>0||x,Q=`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,H=c||r?n.jsx(Yn,{className:"h-4 w-20"}):d==null?null:O?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!h&&n.jsxs("div",{className:"relative min-w-0 flex-1",children:[n.jsx(Zn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Xn,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:s,onChange:_=>a(_.target.value),className:_e("bg-background pl-9",x&&"pr-9")}),x&&n.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:n.jsx(Jn,{className:"h-3.5 w-3.5"})})]}),!h&&n.jsx(uo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===Kt.value){l?.();return}const[k,E]=_.split("-");t({sortBy:k,sortOrder:E})}})]}),n.jsx(Ss,{label:"Event filters",fields:M,chips:I,meta:H,actions:C,trailing:n.jsxs(n.Fragment,{children:[y,!c&&f&&g&&n.jsxs(z,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",onClick:g,children:[n.jsx(es,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),onClearAll:S,hasClearableState:x})]})}function Ut({ownerSlug:e,...t}){const o=no({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Bt,{...t,scope:o})}const Be=3600*1e3,Ct=24*Be;function St(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function Nt(e){return e.toISOString().split("T")[0]}function Ue(e){return e.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function fo(e){const o=e[e.length-1].date.getTime()-e[0].date.getTime()>180*Ct,s=new Map;for(const a of e){const i=new Date(a.date);o&&i.setUTCDate(i.getUTCDate()-i.getUTCDay()),s.set(i.getTime(),(s.get(i.getTime())??0)+a.count)}return[...s.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 ${Ue(m)}`:Ue(m)}})}function po(e){const t=m=>{const u=new Date(m);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const m of e)o.set(t(m),(o.get(t(m))??0)+1);const s=Math.min(...o.keys()),a=Math.max(...o.keys()),i=[];for(let m=s;m<=a;m+=Be){const u=new Date(m);i.push({start:u,end:new Date(m+Be),count:o.get(m)??0,label:ht(u,"HH:mm"),tooltip:ht(u,"MMM d, HH:mm")})}return i}function ho({entityId:e,organizationId:t,ownerSlug:o,eventTimes:s,selectedRange:a,onSelectRange:i}){const{data:m,isLoading:u,error:d}=is(t,{entityId:e},{slug:o}),c=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]),r=b.useMemo(()=>{if(c.length===0)return[];if(c.length>1)return fo(c);const[h]=c,y=Nt(h.date),C=(s??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?po(C):[]},[c,s]),f=b.useCallback(h=>{const y=r[h.dataIndex];y&&i&&i(y.start,y.end)},[r,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(r.length<2)return null;let h;if(a){const[y,C]=a,S=r.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`${r[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:r.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 Ps(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:r.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}]}},[r,a]);if(u||d)return n.jsx("div",{className:_e(Mt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?n.jsx(Ls,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(c.length===0)return null;if(!l){const[h]=c;return n.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.count===1?"1 event":`All ${h.count} events`," on"," ",Ue(h.date),"."]})}return n.jsx(vo,{option:l,onClick:f,onDataZoom:g})}function vo({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:a}=$s({onClick:t,onDataZoom:o});return b.useEffect(()=>{a(e,!0)},[e,a]),n.jsx("div",{"data-testid":"events-timeline",className:_e(Mt,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}const _t="change";function yo({kinds:e,onFiltersChange:t}){const o=!e?.length,s=e?.length===1&&e[0]===_t,a=i=>_e("h-7 px-2.5 text-xs",i?"bg-muted text-foreground":"text-muted-foreground");return n.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[n.jsx(z,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>t({semanticTypes:void 0}),children:"All"}),n.jsx(z,{type:"button",variant:"ghost",size:"sm",className:a(s),"aria-pressed":s,onClick:()=>t({semanticTypes:[_t]}),children:"Changes"})]})}function go({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,pinned:i,onShowNotifications:m,emptyState:u,changesShortcut:d=!1}){const{isAuthenticated:c,isReady:r}=rs(),{isMember:f,isLoading:g}=Ft(),l=r&&c&&f,h=r&&(!c||!g&&!f),y=G(),C=ie(),S=cs(),{filters:x,updateFilters:F,clearFilters:M}=$t({parse:Ce,serialize:Le,filterKeys:Pt,replace:!1,merge:Ot}),[I,O]=b.useState(x.searchQuery||""),[Q,H]=b.useState($e(x)||s&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,E=Tt(k,1e3),$=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")&&$.current&&(N===(x.searchQuery??"")||N===(k??""))||($.current=!1,O(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>vt({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),w=F;b.useEffect(()=>{$.current&&(x.searchQuery||void 0)!==E&&F({searchQuery:E})},[E,F,x.searchQuery]);const Qe=()=>{$.current=!1,O(""),s&&t?y({...De(t,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${t}/events/`)?{to:C.pathname}:{}}):M()},ce=$e(vt(x)),Ie=o===void 0,{data:Vt=[]}=ls(r&&l?e:null),{data:Gt=[]}=ds(h?t:null),We=l?Vt:Gt,{data:ze=[]}=us(l&&e?{organizationId:e}:void 0),le=Us(),de=j.connectionIds,Ae=(de?.length??0)>0,{data:He=[]}=ms(r&&l?e??"":"",{connectionIds:de??void 0,enabled:!le&&r&&l&&Ae}),qe=j.feedIds,Ee=(qe?.length??0)>0,{data:Ye=[]}=wt(r&&l?e:null,{feedIds:qe??void 0,enabled:r&&l&&Ee}),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]),Te=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]),Fe=b.useMemo(()=>Ye.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[Ye]),Qt=b.useMemo(()=>Ae&&Te.length===0||Ee&&Fe.length===0?[]:Ys({connectors:We,entityTypes:ze,selectedPlatforms:Te,selectedFeeds:Fe,selectedEntityTypes:j.entityTypes}),[We,j.entityTypes,Ae,Ee,Te,Fe,ze]),R=j.clientIds,ue=(R?.length??0)>0,{data:Xe=[]}=Fs(null,{enabled:r&&l&&ue}),me=b.useMemo(()=>{if(!R)return[];const p=new Set(R);return Rs(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[R,Xe]),Je=b.useMemo(()=>{if(!ue||!R)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):R.length>1?`${R.length} client registrations`:"Client registration"},[me,R,ue]),fe=me.length===1?me[0]:null,Wt=t&&fe?Ws(t,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=ws({enabled:r&&l&&ue&&!!pe,clientIds:R??[],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]),q=j.agentId,Y=j.schedule,{data:nt=[]}=Vs(q??void 0),st=b.useMemo(()=>!Y||!q?null:nt.find(v=>v.id===Y)?.description?.trim()||"Scheduled task",[q,Y,nt]),{data:zt}=fs(r&&l?e:null,o),{data:Ht}=ps(h&&!Ie?t:null,o),ot=l?zt:Ht,we=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),L=v.attribute_values||{},P=Object.keys(L);let ve=null;const Z={};for(const[X,V]of Object.entries(L))if(V.parent)for(const[Oe,J]of Object.entries(V.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[V,Oe]of Object.entries(Z)){D.valuesByParentValue[V]||(D.valuesByParentValue[V]=[]);const J=new Set([...D.valuesByParentValue[V],...Oe]);D.valuesByParentValue[V]=[...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]),qt=hs(r&&l?e:null,o,j,t),Yt=vs(h?t:null,o,j),Zt=h?Yt:qt,{data:B,isLoading:Xt,error:Jt}=Zt,en=b.useMemo(()=>B?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[B]),at=B?.pages[0],it=(at?.content.length??0)>0,tn=ys(r&&l?e:null,o,j,t),nn=gs(h?t:null,o,j),Re=h?nn:tn,sn=Re.data?.total??void 0,on=Re.data?.classification_stats,an=Re.isLoading,rn=!!(j.beforeOccurredAt||j.afterOccurredAt),rt=xs(j),ct=B?.pages[B.pages.length-1],U=ct?.content[ct.content.length-1];b.useEffect(()=>{!rt||!U||B?.pages.length===1||x.beforeOccurredAt===U.occurred_at&&x.beforeId===U.id||F({beforeOccurredAt:U.occurred_at,beforeId:U.id},{replace:!0})},[U?.id,rt,F,B?.pages.length,U,x.beforeOccurredAt,x.beforeId]);const cn=b.useCallback(()=>{w({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[w]),ln=(p,v)=>{w({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 we)for(const L of T.classifiers)L.parentSlug===p&&delete N[L.slug]}w({classificationFilters:N})},dn=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(T=>T!==v):[...N,v])},un=p=>lt(p,[]);if(Jt)return n.jsx(bs,{label:"knowledge"});const Me=!r||c&&g||l&&!e||Xt,he={fields:[],chips:[]};for(const p of we)for(const v of p.classifiers){const N=j.classificationFilters?.[v.slug]??[],T=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,L=T?[...new Set(T.flatMap(P=>v.valuesByParentValue[P]??[]))]:v.values;L.length>0&&he.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:n.jsx(js,{className:"h-4 w-4"}),editor:ke({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:L.map(P=>({value:P,label:P,count:on?.[v.slug]?.[P]})),selected:N,multiple:!0,onSelect:P=>dn(v.slug,P)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=we.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:()=>un(p)})}const mn=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>w({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>w({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:Wt,details:R&&R.length>0?n.jsx(qs,{ownerSlug:t,clientIds:R,linkedUser:fe?.linkedUser,linkedUserEntitySlug:fe?.linkedUserEntitySlug}):void 0,onRemove:()=>w({clientIds:void 0})}):null,st?ye({id:"schedule",label:"Schedule",value:st,sourceLink:t&&q&&Y?Hs(t,q,Y):void 0,onRemove:()=>w({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>w({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>w({resourceKind:void 0,resourceId:void 0})}]:[],...he.chips].filter(p=>p!=null),fn=!!(l&&o&&e),dt=i&&!ce?i:void 0,ut={filterActions:d?n.jsx(yo,{kinds:x.semanticTypes,onFiltersChange:w}):Ie&&l?n.jsx("div",{className:"flex items-center gap-1",children:[["config","Configuration"],["deployment","Applies"]].map(([p,v])=>n.jsx(z,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>w({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:fn?n.jsxs(z,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":Q,onClick:()=>H(p=>!p),children:[n.jsx(Cs,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Qe,onShowNotifications:m,filters:j,onFiltersChange:w,eventKinds:Qt,searchQuery:I,onSearchChange:p=>{$.current=!0,O(p)},extraFields:he.fields,drillChips:mn,total:sn,isListLoading:Me,isTotalLoading:an,hasCursorInUrl:rn&&it,onGoToLatest:cn},pn=!Me&&!!at&&!it&&!ce,hn=c?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&&t);return n.jsx(ks,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(Ut,{...ut,ownerSlug:t}):n.jsx(Bt,{...ut})}),Q&&l&&o&&e&&n.jsx(ho,{entityId:o,organizationId:e,ownerSlug:t||"",eventTimes:en,selectedRange:j.dateRange||void 0,onSelectRange:ln}),dt?.rows,Me?n.jsx(Os,{}):pn?u??n.jsx(yt,{icon:gt,title:"No activity yet",description:hn,actionLabel:mt?"Add a connector":void 0,onAction:mt&&t?()=>void y({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(Ms,{onFiltersChange:w,organizationId:e,ownerSlug:t,entityId:o,filters:j,showEntityLinks:Ie,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:n.jsx(yt,{icon:gt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:ce?"Clear filters":void 0,onAction:ce?Qe:void 0})})]})})}function xo({record:e,ownerSlug:t}){const o=ie(),s=G(),{filters:a,updateFilters:i}=$t({parse:Ce,serialize:Le,filterKeys:Pt,replace:!1,merge:Ot}),m=$e({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{s({...De(t,o.search??{}),...o.pathname.startsWith(`/${t}/events/`)?{}:{to:o.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ut,{ownerSlug:t,sourceRead:!0,filters:a,onFiltersChange:i,searchQuery:a.searchQuery??"",onSearchChange:d=>i({searchQuery:d}),onClearFilters:u}),n.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?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx(z,{variant:"outline",size:"sm",onClick:()=>{const d=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),c={...De(t,o.search??{}).search,...d};s({to:o.pathname,search:c})},children:"Clear unsupported filters"})]}):n.jsx(Ts,{record:e,orgContext:{slug:t},filters:a})]})}function Ro({entity:e,organizationId:t,ownerSlug:o}){const s=e.is_derived?n.jsx(xo,{ownerSlug:o,record:{type:e.entity_type,key:e.slug}}):n.jsx(go,{organizationId:t,ownerSlug:o,entityId:typeof e.id=="number"?e.id:void 0,hideSourceFilter:!0,changesShortcut:!0});return n.jsx(Ks,{organizationId:t,children:e.entity_type==="$member"?n.jsx(Ds,{children:s}):s})}export{go as E,Ks as M,Kt as N,Ro as R,uo as S};
|
|
2
|
-
//# sourceMappingURL=record-activity-6CfR95Ul.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as h,j as s,S as m,b2 as w,dB as I,ab as $,B as R,dn as A,v as C,ed as E,L as N,e6 as L}from"./index-B-Ab8srM.js";import{u as S}from"./use-automations-II_YJWtN.js";import{u as B}from"./clients-6aJvabvS.js";function M({onIntersect:n,enabled:e,rootMargin:t="400px"}){const o=h.useRef(null),a=h.useRef(n);return a.current=n,h.useEffect(()=>{const r=o.current;if(!r||!e)return;const i=new IntersectionObserver(c=>{c[0]?.isIntersecting&&a.current()},{rootMargin:t});return i.observe(r),()=>i.disconnect()},[e,t]),o}function z({groupByDate:n=!0}){return s.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:s.jsxs("div",{"aria-hidden":"true",children:[n?s.jsx("div",{className:"px-3 pb-2",children:s.jsx(m,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(e=>s.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[s.jsx(m,{className:"h-8 w-8 shrink-0 rounded-none"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx(m,{className:"h-4 w-3/5 max-w-sm rounded-none"}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(m,{className:"h-3 w-20 rounded-none"}),s.jsx(m,{className:"h-3 w-12 rounded-none"})]})]})]},e))]})})}function _(n){if(n==null||n==="")return null;const e=new Date(n);return Number.isNaN(e.getTime())?null:A(e,"d MMMM yyyy")}function q({items:n,isLoading:e,emptyState:t,hasNextPage:o,isFetching:a,isFetchingNextPage:r,onLoadMore:i,autoLoadMore:c=!0,groupByDate:v=!0}){const f=M({onIntersect:i,enabled:c&&o&&!a});return e&&n.length===0?s.jsx(z,{groupByDate:v}):s.jsxs("div",{children:[n.length===0?t!==void 0?t:s.jsx(w,{icon:I,title:"Nothing here yet",description:"No events match this view."}):n.map((u,l)=>{const x=_(u.occurredAt),g=l>0?_(n[l-1].occurredAt):null;return s.jsxs(h.Fragment,{children:[v&&x&&x!==g&&s.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:x}),s.jsx("div",{className:"mb-1",children:u.content})]},u.key)}),s.jsx("div",{ref:f,className:"h-1"}),r?s.jsx("div",{className:"flex justify-center py-4",children:s.jsx($,{size:"xl",className:"text-muted-foreground"})}):o&&s.jsx(R,{size:"sm",variant:"outline",disabled:a,onClick:i,children:"Load more"})]})}function F(n,e,t){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":t?`Automation ${t}`:"an Automation"}function G({ownerSlug:n,initiator:e,clientName:t,fallback:o}){const a=e?.client_id??t,{allOrgs:r,isAuthenticated:i}=C(),c=i&&r?.some(d=>d.slug===n),f=B(void 0,{ownerSlug:n,enabled:!!(a&&c)}).data?.find(d=>d.id===a)?.title,u=c?r.find(d=>d.slug===n)?.id:void 0,l=e?.kind==="automation"&&e.automation_id?String(e.automation_id):void 0,g=S(l?u:void 0,void 0,{includeDetails:!1}).data?.find(d=>d.automation_id===l)?.name,{members:k}=E(e?.kind==="user"&&e.user_id?u:void 0),y=k.find(d=>d.userId===e?.user_id)?.user.name,p=e&&e.kind!=="user"?g??F(e,void 0,e.automation_id===void 0?void 0:String(e.automation_id)):y??o,b="font-medium text-foreground",j=`${b} underline-offset-4 hover:underline`;return e?.kind==="automation"&&e.automation_id?s.jsx(N,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(e.automation_id)},search:{view:"definition",run_id:void 0},className:j,children:p}):e?.kind==="agent_session"&&e.agent_id?s.jsx(N,{to:"/$owner/agents/$agentId",params:{owner:n,agentId:String(e.agent_id)},className:j,children:p}):a?s.jsxs(N,{to:"/$owner/agents/connected/$clientId",params:{owner:n,clientId:a},className:`${j} inline-flex items-center gap-1 align-middle`,children:[s.jsx(L,{name:f??t??a}),f??p]}):s.jsx("span",{className:b,children:p})}export{z as E,G as R,q as a,F as p};
|
|
2
|
-
//# sourceMappingURL=run-initiator-BvruBM5H.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{eU as r,cU as s,cS as c,cT as l,a3 as g,eV as I}from"./index-B-Ab8srM.js";const f=30,_=new Set(["running","pending","claimed"]);function m(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function y(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?m(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return s("manage_operations",{action:"list_runs",...y(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:f},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function T(n,e){const{slug:i}=c(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return l({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(I(i,t),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{T as a,v as u};
|
|
2
|
-
//# sourceMappingURL=runs-BMzp7j7j.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t,B as k,L as v,cK as B,i as h,a$ as D,b0 as F,b1 as M,ir as A,is as I,u as K,g8 as p,it as E,b6 as y,bc as w,e5 as O,r as x,iu as _,b7 as P,C as V,dn as z,dM as b,dO as N,dN as $,e2 as U,aj as J,ab as q,iv as G,iw as Q}from"./index-B-Ab8srM.js";import{a as W,R as X}from"./run-initiator-BvruBM5H.js";function Y(e,s){switch(s.kind){case"connection":return I(e,s.id);case"feed":return A(e,s.id);case"run":return{to:"/$owner/events",params:{owner:e},search:{run_ids:String(s.id)}}}}function H({ownerSlug:e,scope:s,variant:i="outline",iconOnly:a=!1,label:o,className:c,title:n}){const l=Y(e,s),r=n??o??"View in memory",u=t.jsx(k,{asChild:!0,variant:i,size:a?"icon":"sm",className:h(a&&"h-7 w-7",c),children:t.jsxs(v,{to:l.to,params:l.params,search:l.search,children:[t.jsx(B,{className:h("h-3.5 w-3.5",!a&&"mr-1.5")}),!a&&(o??"View in memory")]})});return a?t.jsxs(D,{children:[t.jsx(F,{asChild:!0,children:u}),t.jsx(M,{children:r})]}):u}function Z({status:e}){return e==="completed"?t.jsx(U,{className:"h-4 w-4 text-green-500"}):e==="failed"?t.jsx(J,{className:"h-4 w-4 text-destructive"}):e==="running"?t.jsx(q,{className:"text-blue-500"}):t.jsx(G,{className:"h-4 w-4 text-muted-foreground"})}const ee={completed:"Completed",failed:"Failed",running:"Running",pending:"Queued",claimed:"Starting",timeout:"Timed out",cancelled:"Cancelled"};function C(e){const s=e.split("_").join(" ");return s.charAt(0).toUpperCase()+s.slice(1)}function te({error:e}){const[s,i]=x.useState(!1);return e.length<=80?t.jsx("span",{className:"text-destructive",children:e}):t.jsxs(b,{open:s,onOpenChange:i,children:[t.jsx(N,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-left text-destructive hover:underline",children:e})}),t.jsx($,{className:"max-h-64 w-96 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs text-destructive",children:e})})]})}function se({checkpoint:e}){return t.jsxs(b,{children:[t.jsx(N,{asChild:!0,children:t.jsx(k,{variant:"ghost",size:"icon",title:"Checkpoint","aria-label":"Checkpoint",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsx(Q,{className:"h-4 w-4","aria-hidden":"true"})})}),t.jsx($,{className:"max-h-64 w-80 overflow-auto",children:t.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs",children:JSON.stringify(e,null,2)})})]})}function R(e){if(e.initiator_kind)return{kind:e.initiator_kind,...e.initiator_ref};if(e.automation_id)return{kind:"automation",automation_id:e.automation_id};if(e.created_by_user_id)return{kind:"user",user_id:e.created_by_user_id}}function ie({run:e,ownerSlug:s}){const i=R(e);return i?i.kind==="system"?t.jsx(t.Fragment,{children:"by the system"}):t.jsxs(t.Fragment,{children:["by"," ",t.jsx(X,{ownerSlug:s,initiator:i,clientName:void 0,fallback:"a person"})]}):null}function ne({parts:e}){return t.jsx(t.Fragment,{children:e.map(([s,i],a)=>t.jsxs(x.Fragment,{children:[a>0?" · ":"",i]},s))})}function j(e,s){return[e.run_type?C(e.run_type):"Run",s.connection?e.connection_display_name:null,s.feed?e.feed_display_name??e.feed_key:null].filter(Boolean).join(" · ")}const ae=3;function g(e,s){const i=p(e.created_at);return e.status==="completed"&&i!=null?`${j(e,s)}|${z(i,"yyyy-MM-dd")}`:null}function re(e,s){const i=new Map;for(const c of e){const n=g(c,s);n&&i.set(n,[...i.get(n)??[],c])}const a=[],o=new Set;for(const c of e){const n=g(c,s),l=n?i.get(n):void 0;!n||!l||l.length<ae?a.push({kind:"run",run:c}):o.has(n)||(o.add(n),a.push({kind:"group",name:j(c,s),runs:l}))}return a}function oe({name:e,runs:s,ownerSlug:i,columns:a}){const[o,c]=x.useState(!1),n=p(s[0].created_at),l=p(s[s.length-1].created_at),r=Date.now(),u=s.reduce((m,T)=>m+(T.items_collected??0),0),d=l!=null?_(l,r):null,f=n!=null?_(n,r):null,S=d&&f&&d!==f?`${d}–${f}`:f;return t.jsxs("div",{children:[t.jsx("button",{type:"button","aria-expanded":o,onClick:()=>c(m=>!m),className:h(w,"rounded-lg transition-colors hover:bg-accent/40"),children:t.jsx(y,{mark:t.jsx(V,{"aria-hidden":"true",className:h("h-4 w-4 text-muted-foreground transition-transform",o&&"rotate-90")}),name:e,details:t.jsx(P,{parts:[`${s.length} runs`,S,"all completed",u>0?`${u} ${u===1?"item":"items"}`:null]}),at:n})}),o?t.jsx("div",{className:"ml-6 border-l pl-2",children:s.map(m=>t.jsx("div",{className:"mb-1",children:t.jsx(L,{run:m,ownerSlug:i,columns:a})},m.id))}):null]})}function L({run:e,ownerSlug:s,columns:i}){const a=K(),o=p(e.created_at),c=p(e.completed_at),n=o!=null&&c!=null?Math.round((c-o)/1e3):null,l=j(e,i),r=i.startedBy&&R(e)?t.jsx(ie,{run:e,ownerSlug:s}):null,u=[["status",ee[e.status]??C(e.status)],e.error_message?["error",t.jsx(te,{error:e.error_message},"error")]:null,e.items_collected!=null&&(e.run_type==="sync"||e.items_collected>0)?["items",`${e.items_collected} ${e.items_collected===1?"item":"items"}`]:null,n!=null?["duration",E(n)]:null,r?["by",r]:null,e.connector_version?["version",`v${e.connector_version}`]:null,["id",`#${e.id}`]].filter(d=>d!==null);return t.jsxs("article",{"aria-label":`Run #${e.id}`,title:O(e.created_at),className:"group relative flex items-center rounded-lg transition-colors hover:bg-accent/40",children:[t.jsx("div",{className:h(w,"min-w-0 flex-1"),children:t.jsx(y,{mark:t.jsx(Z,{status:e.status}),name:t.jsx(v,{to:"/$owner/events",params:{owner:s},search:{run_ids:String(e.id)},"aria-label":`${l} · Run #${e.id}`,className:"hover:underline",onClick:d=>{!a||d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||(d.preventDefault(),a.open({href:e.run_type==="automation"&&e.automation_id!=null?`/${s}/automations/${e.automation_id}?view=activity&run_id=${e.id}`:`/${s}/events?run_ids=${e.id}`,title:`Run #${e.id}`,runId:e.id}))},children:l}),tone:e.status==="failed"||e.status==="timeout"?"destructive":null,details:t.jsx(ne,{parts:u}),at:o,atClassName:"group-hover:invisible group-focus-within:invisible"})}),t.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",children:[e.checkpoint?t.jsx(se,{checkpoint:e.checkpoint}):null,t.jsx(H,{ownerSlug:s,scope:{kind:"run",id:e.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})]})]})}function de({runs:e,ownerSlug:s,columns:i={},emptyState:a,hasNextPage:o=!1,isFetching:c=!1,isFetchingNextPage:n=!1,onLoadMore:l=()=>{}}){return t.jsx(W,{items:re(e,i).map(r=>r.kind==="run"?{key:String(r.run.id),occurredAt:r.run.created_at,content:t.jsx(L,{run:r.run,ownerSlug:s,columns:i})}:{key:`group:${r.runs[0].id}`,occurredAt:r.runs[0].created_at,content:t.jsx(oe,{name:r.name,runs:r.runs,ownerSlug:s,columns:i})}),isLoading:!1,emptyState:a,hasNextPage:o,isFetching:c,isFetchingNextPage:n,onLoadMore:l})}export{de as R,H as V};
|
|
2
|
-
//# sourceMappingURL=runs-list-DVhrTr3v.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as u,fX as l,j as t,bU as c,c4 as m,fc as f}from"./index-B-Ab8srM.js";import{E as i}from"./entity-type-page-CjFqxSdL.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(c,{label:"entity type",variant:"panel"});if(y)return t.jsx(m,{label:"entity type"});const n=s.find(p=>p.slug===r)??null;return n?t.jsx(i,{entityType:n,orgContext:e,hideDelete:f(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-Bdeumkux.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{v as f,cT as b,eS as v,j as e,B as j,eT as R,S as _,bT as C,L,dY as F,x as E}from"./index-B-Ab8srM.js";import{a as S,R as $,b as P}from"./event-card-BtTUuf2q.js";import{a as A}from"./run-initiator-BvruBM5H.js";function y({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 z({record:o,orgContext:c,filters:l}){const{orgContext:d}=f(),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(y,{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(S,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function I({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=f(),{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($,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(y,{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(P,{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(y,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{z as S,I as a};
|
|
2
|
-
//# sourceMappingURL=source-record-panels-CBV9tsR3.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{cT as o,dH as c,dI as u,a6 as r,c1 as l,cU as s}from"./index-B-Ab8srM.js";function y(){return o({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,i){return o({queryKey:["automations-list",e,a,i?.includeDetails??!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:i?.includeDetails??!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,i,t={}){const n=c(t.ownerSlug);return o({queryKey:["automation-detail",n,e,a,t.since,t.until,t.templateVersion,t.includeVersions??!1],queryFn:async()=>await s("get_automation",{automation_id:e,entity_id:a,content_since:t.since,content_until:t.until,template_version:t.templateVersion,page_size:100,include_classification:"summary",include_versions:t.includeVersions??!1},{slug:n},{timeoutMs:3e4}),enabled:!!n&&!!e&&!!(t.ownerSlug||i),staleTime:3e4})}const q=u({tool:"manage_automations",body:e=>({action:"update",...e}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),v=u({tool:"manage_automations",body:e=>({action:"delete",automation_ids:[e]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),A=u({tool:"manage_automations",body:e=>({action:"create",...e}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function f(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"create_version",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}function K(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"set_reaction_script",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}export{v as a,_ as b,A as c,f as d,K as e,q as f,y as g,g as u};
|
|
2
|
-
//# sourceMappingURL=use-automations-II_YJWtN.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-B-Ab8srM.js";import{C as G,a as Y,b as Z,d as J,c as Q}from"./card-DT9mSjSp.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-BqtEilid.js.map
|