@lobu/runtime-server 24.2.0 → 24.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +24 -2
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/postgres.ts +9 -5
- package/dist/dependencies.bun.lock +104 -167
- package/dist/owletto/dist/assets/_-XKF0m81R.js +3 -0
- package/dist/owletto/dist/assets/_-e8MbEBtw.js +2 -0
- package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-emObu67X.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +2 -0
- package/dist/owletto/dist/assets/_name-DjtJMop4.js +2 -0
- package/dist/owletto/dist/assets/_owner-oBX68rb9.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +2 -0
- package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-B2g5qzn3.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-38lHBvjO.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-view-_G_lDz5K.js → activity-route-view-voRYSM3a.js} +2 -2
- package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-DiU7Un5w.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-BgyLhJCo.js → agent-client-setup-list-Bkyw22GW.js} +4 -4
- package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-QrIDroFL.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-CamDtzHY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CgsQ8BK_.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-lWbXKEm1.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-D-w3tY_2.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-CLqpn5Tb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-CsRexwTv.js} +4 -4
- package/dist/owletto/dist/assets/agents-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
- package/dist/owletto/dist/assets/{app._appId-A51tx2jU.js → app._appId-BO7G38fL.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-DMYxs6F6.js} +2 -2
- package/dist/owletto/dist/assets/automations-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/calendar-DDCCSPW6.js +2 -0
- package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-DFciMR8u.js} +2 -2
- package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-BCsbrdGs.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-BRua2b_7.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-CmK3DkSP.js → client-activity-scopes-BLIy1Zc3.js} +2 -2
- package/dist/owletto/dist/assets/client-rows-DiJQ5D1z.js +2 -0
- package/dist/owletto/dist/assets/clients-8-EpRjsm.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-BFZa4EIt.js} +2 -2
- package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +2 -0
- package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-BMV8bf54.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DqZA-FdG.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-bmBJJ9B4.js → connector-provenance-BIg8P8WY.js} +2 -2
- package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-CJYz53YF.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BroKpwhB.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C_WBfmQ8.js → consent-fzLN-Qy7.js} +2 -2
- package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-A1UnFbGs.js} +2 -2
- package/dist/owletto/dist/assets/create-BjwsYarn.js +2 -0
- package/dist/owletto/dist/assets/create-Dzr4mlr0.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +3 -0
- package/dist/owletto/dist/assets/create-c94SPL21.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-xxpD1P2-.js} +2 -2
- package/dist/owletto/dist/assets/{device-Br9JHadR.js → device-C3AEoL5c.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-B_te59GE.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-CEV4ttUQ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +2 -0
- package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +2 -0
- package/dist/owletto/dist/assets/event-card-CBlsG32u.js +2 -0
- package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +2 -0
- package/dist/owletto/dist/assets/events-feed-VfU4csn2.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-C1Q_jEzD.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +2 -0
- package/dist/owletto/dist/assets/identity-BaFLmbSo.js +2 -0
- package/dist/owletto/dist/assets/index-008wj-Pz.js +7950 -0
- package/dist/owletto/dist/assets/index-BaetvYLa.js +2 -0
- package/dist/owletto/dist/assets/index-BiEf5xOE.css +1 -0
- package/dist/owletto/dist/assets/index-BrDP4PCs.js +2 -0
- package/dist/owletto/dist/assets/index-BuXIeK7D.js +2 -0
- package/dist/owletto/dist/assets/index-CAVcR9za.js +2 -0
- package/dist/owletto/dist/assets/index-CMLfWGPU.js +2 -0
- package/dist/owletto/dist/assets/index-D0YEYP7N.js +2 -0
- package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-DFyBbp7b.js} +2 -2
- package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-DNtYqkiA.js} +2 -2
- package/dist/owletto/dist/assets/index-DQxzeM37.js +2 -0
- package/dist/owletto/dist/assets/index-DkO0nPex.js +2 -0
- package/dist/owletto/dist/assets/index-KlRId0g6.js +2 -0
- package/dist/owletto/dist/assets/index-Ywnqi4A6.js +2 -0
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
- package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-yIub2xUM.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-LE_vNZrM.js} +4 -4
- package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Kzxi2OXB.js} +2 -2
- package/dist/owletto/dist/assets/login-DWOT6jtS.js +2 -0
- package/dist/owletto/dist/assets/logout-Dt_VDilG.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-De75CR7W.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-3l9lY50C.js} +2 -2
- package/dist/owletto/dist/assets/model-udnQ_S43.js +2 -0
- package/dist/owletto/dist/assets/models-CQj7GIOp.js +2 -0
- package/dist/owletto/dist/assets/new-BOwIHkre.js +2 -0
- package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-BbdwuJPm.js} +2 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-D15LYKSe.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
- package/dist/owletto/dist/assets/{organization-CoUJYXx7.js → organization-BDzjnqPf.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
- package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-CfoY4WFY.js} +2 -2
- package/dist/owletto/dist/assets/{proposal-review-shell-CmLy1MZf.js → proposal-review-shell-CVkLnnKo.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-D07szzqN.js} +2 -2
- package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-AJxSmE3-.js} +30 -30
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
- package/dist/owletto/dist/assets/{runs-B0zVYb-w.js → runs-lG2ChtOt.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-C_Es0qDf.js} +2 -2
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
- package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-gGYXbFfd.js} +2 -2
- package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CjFPgKKJ.js +2 -0
- package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-CSBtKT4g.js} +2 -2
- package/dist/owletto/dist/assets/table-DHM-vCxP.js +2 -0
- package/dist/owletto/dist/assets/use-automations-C4TSie1i.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-PfZrNbu_.js} +2 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-2ubIf_3N.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +99167 -97912
- package/npm-shrinkwrap.json +537 -896
- package/package.json +7 -10
- package/vendor/@better-auth-kysely-adapter/.bun-tag-abf95749a412716 +0 -0
- package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
- package/vendor/@better-auth-kysely-adapter/README.md +17 -0
- package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
- package/vendor/@better-auth-kysely-adapter/package.json +52 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/connector-sdk/dist/redact.js +130 -0
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +6 -0
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
- package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/otel.js +38 -10
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/package.json +26 -5
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-Cjvw31gU.js +0 -2
- package/dist/owletto/dist/assets/_-iToIRRFt.js +0 -3
- package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +0 -2
- package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +0 -2
- package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +0 -2
- package/dist/owletto/dist/assets/_name-BsOZmvlH.js +0 -2
- package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +0 -3
- package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +0 -2
- package/dist/owletto/dist/assets/agents-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/automations-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +0 -2
- package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +0 -2
- package/dist/owletto/dist/assets/connection-DJd9bnEc.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-IO6G5QjL.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +0 -2
- package/dist/owletto/dist/assets/copy-button-kcjg8Giw.js +0 -2
- package/dist/owletto/dist/assets/create-CQE5rD0i.js +0 -2
- package/dist/owletto/dist/assets/create-DQNlRTUX.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +0 -3
- package/dist/owletto/dist/assets/create-lOFSQV_5.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +0 -2
- package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +0 -2
- package/dist/owletto/dist/assets/event-detail-C25TvOb_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +0 -2
- package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +0 -2
- package/dist/owletto/dist/assets/identity-BkK8ggdp.js +0 -2
- package/dist/owletto/dist/assets/index-Bw5iV_J7.js +0 -2
- package/dist/owletto/dist/assets/index-C3dpyynY.js +0 -2
- package/dist/owletto/dist/assets/index-C3zAbslo.js +0 -2
- package/dist/owletto/dist/assets/index-CGKN_WN_.js +0 -2
- package/dist/owletto/dist/assets/index-CgRaCOzW.js +0 -2
- package/dist/owletto/dist/assets/index-DfIoxD5Q.js +0 -2
- package/dist/owletto/dist/assets/index-DijuudSs.js +0 -2
- package/dist/owletto/dist/assets/index-Dr7bouPX.css +0 -1
- package/dist/owletto/dist/assets/index-JmEl29py.js +0 -7950
- package/dist/owletto/dist/assets/index-NK2VKPoL.js +0 -2
- package/dist/owletto/dist/assets/index-_5qsmBkt.js +0 -2
- package/dist/owletto/dist/assets/index-qkOKpRYs.js +0 -2
- package/dist/owletto/dist/assets/index-wzYkECAe.js +0 -2
- package/dist/owletto/dist/assets/login-XL5XxN6y.js +0 -2
- package/dist/owletto/dist/assets/logout-CMxdhLbM.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +0 -74
- package/dist/owletto/dist/assets/models-BAVaDnKN.js +0 -2
- package/dist/owletto/dist/assets/new-1QLuS1o-.js +0 -2
- package/dist/owletto/dist/assets/new-D21LGMl6.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +0 -2
- package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +0 -2
- package/dist/owletto/dist/assets/reset-password-Y-WO77iR.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +0 -2
- package/dist/owletto/dist/assets/runs-table-9OVdfPXZ.js +0 -2
- package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +0 -2
- package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +0 -2
- package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{au as vn,j as n,r as b,q as G,s as ie,cM as yn,cg as It,cN as Tt,L as Ne,cO as gn,cP as xn,bZ as bn,cQ as jn,cD as kn,cR as At,cS as T,bl as ft,cT as Cn,cU as Sn,ai as Nn,cV as _n,ah as In,cW as Tn,cX as ae,cs as An,cY as Et,cZ as En,ak as Fn,c_ as wn,a$ as Rn,ba as Mn,aq as Ce,c$ as Pn,d0 as $n,an as Ft,ch as wt,d1 as On,cJ as Ln,d2 as Dn,d3 as Rt,d4 as Kn,d5 as Bn,be as Un,aX as Vn,bn as Gn,bo as Qn,d6 as zn,bp as Wn,bq as Hn,br as qn,S as Yn,d7 as Zn,I as Xn,T as _e,X as Jn,B as W,d8 as es,d9 as ts,da as ns,bz as ss,db as os,dc as as,dd as is,de as Mt,df as pt,k as rs,dg as cs,dh as Oe,di as ht,cf as ls,dj as ds,dk as us,cA as ms,dl as fs,dm as ps,dn as hs,dp as vs,dq as ys,dr as gs,ds as xs,bK as bs,dt as js,du as ks,aR as vt,dv as yt,dw as Pt,cu as Le,cL as $t,dx as Cs,dy as De}from"./index-JmEl29py.js";import{S as K,F as Ss,d as Ns,o as ke,r as _s,f as Is,a as Ts}from"./filter-editors-oNjBX9a2.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as As}from"./runs-B0zVYb-w.js";import{S as Es}from"./source-record-panels-BeAZeMLy.js";import{u as Fs,g as ws}from"./client-rows-fFuxzFtE.js";import{u as Rs}from"./client-activity-scopes-CmK3DkSP.js";import{a as Ms,E as Ps}from"./events-feed-C4VrjIc1.js";import{L as $s,u as Os}from"./linked-record-peek-B0_B4PnF.js";import{E as Ls}from"./agent-loading-shells-jkf9DjdO.js";import{M as Ds}from"./member-scope-gate-Dit3MXBQ.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 Ot(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:a=!0,replace:r=!0,merge:f}=e,m=G(),u=ie(),c=b.useMemo(()=>{const g=new URLSearchParams;for(const[l,h]of Object.entries(u.search||{}))h!=null&&g.set(l,typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h):String(h));return t(g)},[u.search,t]),i=b.useCallback((g,l)=>{const h=f?f(c,g):{...c,...g},y=o(h),C={};for(const[S,x]of Object.entries(u.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);m({to:u.pathname,search:C,replace:l?.replace??r})},[c,o,s,a,f,m,u,r]),d=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(u.search||{}))h!=null&&(s.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));m({to:u.pathname,search:g,replace:r})},[m,u.pathname,u.search,s,a,r]);return{filters:c,updateFilters:i,clearFilters:d}}function Vs(e){const{slug:t}=yn();return It({queryKey:["schedules",t,e],queryFn:async()=>((await Tt("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 zs(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function Ws(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:r}){return{id:e,label:t,op:"is",value:o,onRemove:r,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(r=>n.jsx("code",{className:"break-all text-foreground",children:r},r))]}),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,r]of Object.entries(e.feeds_schema??{})){if(o&&!o.has(a))continue;const f=ee(ee(r)?.eventKinds);if(f)for(const[m,u]of Object.entries(f)){if(!t){s.add(m);continue}const c=ee(u)?.attributions;Array.isArray(c)&&c.some(i=>{const d=ee(ee(i)?.target);return typeof d?.entityType=="string"&&t.has(d.entityType)})&&s.add(m)}}return s}function Ys({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const r=new Set,f=new Set(o),m=new Set(a),u=new Map;for(const c of s){const i=u.get(c.connectorKey)??new Set;i.add(c.feedKey),u.set(c.connectorKey,i)}if(u.size>0)for(const c of e){const i=u.get(c.key);if(i)for(const d of ge(c,void 0,i))r.add(d)}else if(f.size>0){for(const c of e)if(f.has(c.key))for(const i of ge(c))r.add(i)}else if(m.size>0){for(const c of t)if(m.has(c.slug))for(const i of Object.keys(c.event_kinds??{}))r.add(i);for(const c of e)for(const i of ge(c,m))r.add(i)}else{for(const c of t)for(const i of Object.keys(c.event_kinds??{}))r.add(i);for(const c of e)for(const i of ge(c))r.add(i)}return[...r].sort((c,i)=>c.localeCompare(i))}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 Zs({enabled:e,...t}){const o=Xs(t,e);if(!e)return{fields:[],chips:[]};const s=Js(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Xs({ownerSlug:e,filters:t,onFiltersChange:o},s){const a=It({queryKey:["automations-list","activity",e],queryFn:async()=>{const i=await Promise.all(["active","archived"].map(d=>Tt("manage_automations",{action:"list",status:d,include_details:!1},{slug:e})));return[...new Map(i.flatMap(d=>d.automations).map(d=>[Number(d.automation_id),d])).values()].sort((d,g)=>d.name.localeCompare(g.name))},enabled:s&&!!e,staleTime:3e4}),r=a.data??[],f=i=>i==="produced"?t.producedByAutomationId:t.automationId,m=i=>r.find(d=>Number(d.automation_id)===i)?.name??`#${i}`,u=Ke.flatMap(i=>{const d=f(i);return d==null?[]:[{id:`automation-${i}`,field:"automation",label:Se(i),value:m(d),onRemove:()=>o(i==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),c={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:i=>n.jsxs(n.Fragment,{children:[Ke.map(d=>{const g=f(d),l=r.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(d==="produced"?{producedByAutomationId:y}:{automationId:y}),i()};return n.jsx(At,{heading:Se(d),children:l.map(y=>n.jsxs(T,{"aria-label":y.label,value:`${d} ${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,{...Ws(e,String(y.id)),label:y.label})]},y.id))},d)}),a.isError?n.jsx(T,{forceMount:!0,onSelect:()=>void a.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:u,field:{key:"automation",label:"Automation",group:"Scope",icon:n.jsx(jn,{className:"h-4 w-4"}),editor:c}}}function Js(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(r=>`#${r}`).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:(r,f)=>Ke.map(m=>n.jsx(eo,{...e,mode:m,query:f,close:r},m))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(kn,{className:"h-4 w-4"}),editor:a}}}function eo({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:a,close:r}){const f=s==="produced"?t.producedByAutomationId:t.automationId,m=As({workspace:!0},{automationIds:f==null?void 0:[f],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),u=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],c=m.data?.pages.flatMap(l=>l.runs)??[],i=[...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 u)i.some(h=>h.id===l)||i.unshift({id:l,label:`Run #${l} (selected)`});const d=l=>{if(s==="produced"){const h=u.includes(l)?u.filter(y=>y!==l):[...u,l];o({runIds:h.length?h:null})}else o({runId:l}),r()},g=/^\d+$/.test(a.trim())?Number(a.trim()):0;return n.jsxs(At,{heading:Se(s),children:[i.map(l=>n.jsxs(T,{value:`${s} ${l.label}`,onSelect:()=>d(l.id),children:[n.jsx(K,{selected:u.includes(l.id)}),n.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!i.some(l=>l.id===g)?n.jsxs(T,{value:`${s} ${g}`,onSelect:()=>d(g),children:[Se(s)," run #",g]}):null,m.isLoading?n.jsx(T,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,m.isError?n.jsx(T,{forceMount:!0,onSelect:()=>void(m.isFetchNextPageError?m.fetchNextPage():m.refetch()),children:"Could not load runs. Retry"}):null,!m.isLoading&&!m.isError&&!i.length?n.jsx(T,{disabled:!0,forceMount:!0,children:"No runs found"}):null,m.hasNextPage?n.jsx(T,{forceMount:!0,disabled:m.isFetching,onSelect:()=>void m.fetchNextPage(),children:m.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ge="Scope",$e="Source",z="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 r=>{const f=ae(e,t,r,o);return a?{to:s,search:f.search}:f}}const xt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function to({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const a=re(),{recordPath:r,embedded:f}=Lt(e),m=r?r.split("/").at(-2):void 0,u=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,c=(m?ft(m):void 0)??(u?ft(u):void 0),i=Cn(a),d=Sn(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=no(e,c,!f),h=so(e,c,r,f),y=oo(e,i,!t),C=Zs({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),S=ao(e,d,g);return[l,h,y,C,S].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function no(e,t,o){const s=G(),a=re(),{visible:r}=Tn(e);if(!o)return{fields:[],chips:[]};const f=r.find(u=>u.slug===t),m={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:u=>n.jsxs(n.Fragment,{children:[r.map(c=>n.jsxs(T,{onSelect:()=>{s(ae(e,a,{entity:void 0,create:void 0,type:c.slug})),u()},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(T,{onSelect:()=>{s(Kn(e)),u()},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(An,{className:z}),editor:m}],chips:t?[{id:"type",label:"Entity type",op:"is",value:f?.name??t,onRemove:()=>void s(ae(e,a,{type:void 0}))}]:[]}}function so(e,t,o,s){const a=G(),r=re(),[f,m]=b.useState(""),[u,c]=b.useState(0),i=Et(f,250),d={slug:e},{data:g,isLoading:l,isError:h,refetch:y}=En(t??"",d,{search:i,offset:u,limit:30,enabled:!s&&!!t}),{data:C}=Fn(o?`/${e}/${o}`:"",d),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=>{m(M),c(0)},items:M=>n.jsxs(n.Fragment,{children:[h?n.jsx(T,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>n.jsxs(T,{value:I.slug,onSelect:()=>{const P=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,r,{type:t},P)),M()},children:[n.jsx(K,{selected:S?.slug===I.slug}),I.name]},I.slug)),u>0&&n.jsx(T,{onSelect:()=>c(Math.max(0,u-30)),children:"Previous entities"}),g?.metadata.has_more&&n.jsx(T,{disabled:l,onSelect:()=>c(u+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ge,icon:n.jsx(wn,{className:z}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(e,r,{type:t}))}]:[]}}function oo(e,t,o){const s=G(),a=Dt(e),{data:r=[]}=Rn(),f=b.useMemo(()=>[...r].sort((c,i)=>c.name.localeCompare(i.name)),[r]);if(!o)return{fields:[],chips:[]};const m=f.find(c=>c.agentId===t),u={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:c=>f.map(i=>n.jsxs(T,{onSelect:()=>{s(a({agent:i.agentId,schedule:void 0})),c()},className:"gap-2",children:[n.jsx(K,{selected:i.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:i.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]},i.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ge,icon:n.jsx(Mn,{className:z}),editor:u}],chips:t?[{id:"agent",label:"Agent",op:"is",value:m?.name??t,onRemove:()=>void s(a({agent:void 0,schedule:void 0}))}]:[]}}function ao(e,t,o){const s=G(),a=Dt(e),{groups:r}=Bs(),f=re(),m=Ce({platforms:String(f.platforms??f.platform??"")}).platforms??[],u=b.useMemo(()=>xt(t),[t]),c=b.useMemo(()=>xt(o),[o]),i=m.length===1?m[0]:Pn(r,u),d=r.find(_=>_.connector_key===i),g=u.size===1?Number([...u][0]):void 0,l=$n(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:[r.map(k=>{const A=k.connector_name??k.connector_key;return n.jsxs(T,{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===d?.connector_key}),n.jsx(Vn,{plain:!0,name:A,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:A}),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:A})]},k.connector_key)}),n.jsx(T,{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:$e,icon:n.jsx(Un,{className:z}),editor:F}],I=[],P=d?.connector_name??d?.connector_key??(m.join(", ")||(u.size?`Connections ${[...u].join(", ")}`:void 0));if(P&&I.push({id:"connector",label:"Connector",op:"is",value:P,onRemove:()=>void s(a(x))}),d){M.push({key:"connection",label:"Connection",group:$e,icon:n.jsx(On,{className:z}),editor:Q(d)});const _=u.size===1?d.connections.find(k=>u.has(String(k.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:gt({display_name:_.display_name,connector_name:d.connector_name,connector_key:d.connector_key}),onRemove:()=>void s(a({...x,platforms:d.connector_key}))})}if((g||o)&&M.push({key:"feed",label:"Feed",group:$e,icon:n.jsx(Ln,{className:z}),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(A=>{const O=gt({display_name:A.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return n.jsxs(T,{onSelect:()=>{s(a({connection_ids:String(A.id),feed_ids:void 0})),k()},className:"group gap-2",children:[n.jsx(K,{selected:u.has(String(A.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:O}),A.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:A.feed_count}):null,n.jsx(oe,{...Qs(e,{id:A.id,connector_key:_.connector_key}),label:O})]},A.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>n.jsxs(T,{"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 io=["notification"],ro=["note","summary","decision","observation","fact","change","preference","identity"],co=[...io,...ro],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 lo({value:e,onChange:t,withNotifications:o=!1}){const s=o?[Kt,...bt]:bt,a=s.find(r=>r.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(zn,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx(Wn,{children:a})]}),n.jsx(Hn,{align:"end",className:"min-w-40",children:s.map(r=>n.jsx(qn,{value:r.value,children:r.label},r.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 uo(e,t,o){const s=e.semanticTypes??[],a=o.length>0?o:co,r=[...new Set([...a,...s])].sort((d,g)=>se(d).localeCompare(se(g))).map(d=>({value:d,label:se(d)})),f=e.engagementRange??[be,je],m=e.reviewStatus,u=e.interactionStatus,c=[{key:"date",label:"Date",group:te,icon:n.jsx(ts,{className:ne}),editor:Ns({value:e.dateRange??void 0,onApply:d=>t({dateRange:d})})},{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:r,selected:s,multiple:!0,onSelect:d=>{const g=s.includes(d)?s.filter(l=>l!==d):[...s,d];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:u?[u]:[],onSelect:d=>t({interactionStatus:d})})},{key:"review",label:"Reviewed by",group:te,icon:n.jsx(os,{className:ne}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:m&&m!=="all"?[m]:[],onSelect:d=>t({reviewStatus:d})})},{key:"score",label:"Engagement score",group:te,icon:n.jsx(as,{className:ne}),editor:_s({value:f,min:be,max:je,onApply:d=>t({engagementRange:d})})}],i=[];return e.dateRange&&i.push({id:"date",label:"Date",op:"is",value:Is(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&i.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})}),u&&i.push({id:"approval",label:"Approval",op:"is",value:kt.find(d=>d.value===u)?.label??u,onRemove:()=>t({interactionStatus:null})}),m&&m!=="all"&&i.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(d=>d.value===m)?.label??m,onRemove:()=>t({reviewStatus:void 0})}),(f[0]!==be||f[1]!==je)&&i.push({id:"score",label:"Engagement score",value:Ts(f,be,je),onRemove:()=>t({engagementRange:void 0})}),{fields:c,chips:i}}function Bt({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:a,scope:r,extraFields:f=[],drillChips:m=[],total:u,isListLoading:c=!1,isTotalLoading:i=!1,hasCursorInUrl:d=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=s.trim().length>0,F=h?{fields:[],chips:[]}:uo(e,t,o),M=[...r?.fields??[],...F.fields,...f],I=[...r?.chips??[],...m,...F.chips],P=I.length>0||x,Q=`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,H=c||i?n.jsx(Yn,{className:"h-4 w-20"}):u==null?null:P?`${u.toLocaleString()} ${u===1?"match":"matches"}`:`${u.toLocaleString()} ${u===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(lo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===Kt.value){l?.();return}const[k,A]=_.split("-");t({sortBy:k,sortOrder:A})}})]}),n.jsx(Ss,{label:"Event filters",fields:M,chips:I,meta:H,actions:C,trailing:n.jsxs(n.Fragment,{children:[y,!c&&d&&g&&n.jsxs(W,{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=to({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 mo(e){const o=e[e.length-1].date.getTime()-e[0].date.getTime()>180*Ct,s=new Map;for(const a of e){const r=new Date(a.date);o&&r.setUTCDate(r.getUTCDate()-r.getUTCDay()),s.set(r.getTime(),(s.get(r.getTime())??0)+a.count)}return[...s.entries()].sort(([a],[r])=>a-r).map(([a,r])=>{const f=new Date(a);return{start:f,end:new Date(a+(o?7:1)*Ct),count:r,label:`${f.getUTCMonth()+1}/${f.getUTCDate()}`,tooltip:o?`Week of ${Ue(f)}`:Ue(f)}})}function fo(e){const t=f=>{const m=new Date(f);return m.setMinutes(0,0,0),m.getTime()},o=new Map;for(const f of e)o.set(t(f),(o.get(t(f))??0)+1);const s=Math.min(...o.keys()),a=Math.max(...o.keys()),r=[];for(let f=s;f<=a;f+=Be){const m=new Date(f);r.push({start:m,end:new Date(f+Be),count:o.get(f)??0,label:pt(m,"HH:mm"),tooltip:pt(m,"MMM d, HH:mm")})}return r}function po({entityId:e,organizationId:t,ownerSlug:o,eventTimes:s,selectedRange:a,onSelectRange:r}){const{data:f,isLoading:m,error:u}=is(t,{entityId:e},{slug:o}),c=b.useMemo(()=>(f??[]).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()),[f]),i=b.useMemo(()=>{if(c.length===0)return[];if(c.length>1)return mo(c);const[h]=c,y=Nt(h.date),C=(s??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?fo(C):[]},[c,s]),d=b.useCallback(h=>{const y=i[h.dataIndex];y&&r&&r(y.start,y.end)},[i,r]),g=b.useCallback(h=>{if(r&&h.startValue!==void 0&&h.endValue!==void 0){const y=new Date(h.startValue),C=new Date(h.endValue);r(y,C)}},[r]),l=b.useMemo(()=>{if(i.length<2)return null;let h;if(a){const[y,C]=a,S=i.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`${i[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:i.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 $s(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:i.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}]}},[i,a]);if(m||u)return n.jsx("div",{className:_e(Mt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:m?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(ho,{option:l,onClick:d,onDataZoom:g})}function ho({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:a}=Os({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 vo({kinds:e,onFiltersChange:t}){const o=!e?.length,s=e?.length===1&&e[0]===_t,a=r=>_e("h-7 px-2.5 text-xs",r?"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(W,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>t({semanticTypes:void 0}),children:"All"}),n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(s),"aria-pressed":s,onClick:()=>t({semanticTypes:[_t]}),children:"Changes"})]})}function yo({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,pinned:r,onShowNotifications:f,emptyState:m,changesShortcut:u=!1}){const{isAuthenticated:c,isReady:i}=rs(),{isMember:d,isLoading:g}=Ft(),l=i&&c&&d,h=i&&(!c||!g&&!d),y=G(),C=ie(),S=cs(),{filters:x,updateFilters:F,clearFilters:M}=Ot({parse:Ce,serialize:Le,filterKeys:$t,replace:!1,merge:Pt}),[I,P]=b.useState(x.searchQuery||""),[Q,H]=b.useState(Oe(x)||s&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,A=Et(k,1e3),O=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")&&O.current&&(N===(x.searchQuery??"")||N===(k??""))||(O.current=!1,P(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>ht({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),w=F;b.useEffect(()=>{O.current&&(x.searchQuery||void 0)!==A&&F({searchQuery:A})},[A,F,x.searchQuery]);const Qe=()=>{O.current=!1,P(""),s&&t?y({...De(t,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${t}/events/`)?{to:C.pathname}:{}}):M()},ce=Oe(ht(x)),Ie=o===void 0,{data:Vt=[]}=ls(i&&l?e:null),{data:Gt=[]}=ds(h?t:null),ze=l?Vt:Gt,{data:We=[]}=us(l&&e?{organizationId:e}:void 0),le=Us(),de=j.connectionIds,Te=(de?.length??0)>0,{data:He=[]}=ms(i&&l?e??"":"",{connectionIds:de??void 0,enabled:!le&&i&&l&&Te}),qe=j.feedIds,Ae=(qe?.length??0)>0,{data:Ye=[]}=wt(i&&l?e:null,{feedIds:qe??void 0,enabled:i&&l&&Ae}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Ee=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Fe=b.useMemo(()=>Ye.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[Ye]),Qt=b.useMemo(()=>Te&&Ee.length===0||Ae&&Fe.length===0?[]:Ys({connectors:ze,entityTypes:We,selectedPlatforms:Ee,selectedFeeds:Fe,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Te,Ae,Ee,Fe,We]),R=j.clientIds,ue=(R?.length??0)>0,{data:Xe=[]}=Fs(null,{enabled:i&&l&&ue}),me=b.useMemo(()=>{if(!R)return[];const p=new Set(R);return ws(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,zt=t&&fe?zs(t,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=Rs({enabled:i&&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:Wt}=fs(i&&l?e:null,o),{data:Ht}=ps(h&&!Ie?t:null,o),ot=l?Wt: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 E=p.get(N),L=v.attribute_values||{},$=Object.keys(L);let ve=null;const Z={};for(const[X,V]of Object.entries(L))if(V.parent)for(const[Pe,J]of Object.entries(V.parent))ve=Pe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=E.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...$]);D.values=[...X];for(const[V,Pe]of Object.entries(Z)){D.valuesByParentValue[V]||(D.valuesByParentValue[V]=[]);const J=new Set([...D.valuesByParentValue[V],...Pe]);D.valuesByParentValue[V]=[...J]}ve&&(D.parentSlug=ve)}else E.classifiers.push({slug:v.slug,name:v.name,values:$,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,E)=>N.parentSlug===null&&E.parentSlug!==null?-1:N.parentSlug!==null&&E.parentSlug===null?1:0);return[...p.values()]},[ot]),qt=hs(i&&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(i&&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 E of we)for(const L of E.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(E=>E!==v):[...N,v])},un=p=>lt(p,[]);if(Jt)return n.jsx(bs,{label:"knowledge"});const Me=!i||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]??[],E=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,L=E?[...new Set(E.flatMap($=>v.valuesByParentValue[$]??[]))]: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($=>({value:$,label:$,count:on?.[v.slug]?.[$]})),selected:N,multiple:!0,onSelect:$=>dn(v.slug,$)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=we.flatMap(E=>E.classifiers).find(E=>E.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:zt,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=r&&!ce?r:void 0,ut={filterActions:u?n.jsx(vo,{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(W,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>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(W,{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:f,filters:j,onFiltersChange:w,eventKinds:Qt,searchQuery:I,onSearchChange:p=>{O.current=!0,P(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(po,{entityId:o,organizationId:e,ownerSlug:t||"",eventTimes:en,selectedRange:j.dateRange||void 0,onSelectRange:ln}),dt?.rows,Me?n.jsx(Ms,{}):pn?m??n.jsx(vt,{icon:yt,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(Ps,{onFiltersChange:w,organizationId:e,ownerSlug:t,entityId:o,filters:j,showEntityLinks:Ie,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:n.jsx(vt,{icon:yt,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 go({record:e,ownerSlug:t}){const o=ie(),s=G(),{filters:a,updateFilters:r}=Ot({parse:Ce,serialize:Le,filterKeys:$t,replace:!1,merge:Pt}),f=Oe({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",m=()=>{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:r,searchQuery:a.searchQuery??"",onSearchChange:u=>r({searchQuery:u}),onClearFilters:m}),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."}),f?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(W,{variant:"outline",size:"sm",onClick:()=>{const u=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),c={...De(t,o.search??{}).search,...u};s({to:o.pathname,search:c})},children:"Clear unsupported filters"})]}):n.jsx(Es,{record:e,orgContext:{slug:t},filters:a})]})}function Fo({entity:e,organizationId:t,ownerSlug:o}){const s=e.is_derived?n.jsx(go,{ownerSlug:o,record:{type:e.entity_type,key:e.slug}}):n.jsx(yo,{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{yo as E,Ks as M,Kt as N,Fo as R,lo as S};
|
|
2
|
-
//# sourceMappingURL=record-activity-Doeu5kPO.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{W as v,r as o,j as e,L as h,Y as j,K as y,Z as N}from"./index-JmEl29py.js";import{C as k,a as C,b as S,c as L}from"./card-Cspo-4M6.js";function R(){const{token:n,error:x}=v.useSearch(),[a,p]=o.useState(""),[i,f]=o.useState(""),[d,s]=o.useState(null),[l,c]=o.useState(!1),[u,g]=o.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(a.length<8){s("Password must be at least 8 characters.");return}if(a!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:a})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:a,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
2
|
-
//# sourceMappingURL=reset-password-Y-WO77iR.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,T as x,ih as k,S as r,r as o,a3 as T}from"./index-JmEl29py.js";import{u as w}from"./use-scroll-sentinel-BpQ70c28.js";import{u as A}from"./runs-B0zVYb-w.js";import{F,o as P}from"./filter-editors-oNjBX9a2.js";import{R as B}from"./runs-table-9OVdfPXZ.js";const m=[{value:"all",label:"All"},{value:"sync",label:"Sync",runTypes:["sync"]},{value:"action",label:"Action",runTypes:["action"]},{value:"auth",label:"Auth",runTypes:["auth"]}];function E(s){return m.find(a=>a.value===s)?.runTypes}const c=[{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}];function C({bucket:s,status:a,onBucketChange:n,onStatusChange:t}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:m.map(l=>e.jsx("button",{type:"button",onClick:()=>n(l.value),className:x("rounded px-3 py-1 transition-colors",s===l.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:l.label},l.value))}),e.jsx(F,{label:"Run filters",className:"flex-1",fields:[{key:"status",label:"Status",icon:e.jsx(k,{className:"h-4 w-4"}),editor:P({searchPlaceholder:"Search statuses...",options:c,selected:a==="all"?[]:[a],onSelect:t})}],chips:a==="all"?[]:[{id:"status",label:"Status",op:"is",value:c.find(l=>l.value===a)?.label??a,onRemove:()=>t("all")}]})]})}function I({labels:s,className:a}){return e.jsx("div",{className:x("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",a),children:s.map((n,t)=>e.jsx("span",{className:t===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:n},n))})}function p({rows:s=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(r,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:s}).map((a,n)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(r,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(r,{className:"h-3 w-20"}),e.jsx(r,{className:"h-3 w-16"}),e.jsx(r,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(r,{className:"h-7 w-7 rounded-md shrink-0"})]},n))})]})}function O({rows:s=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(I,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(p,{rows:s})]})}function z({scope:s,ownerSlug:a}){const[n,t]=o.useState("all"),[l,h]=o.useState("all"),f=o.useMemo(()=>({runTypes:E(n),status:l==="all"?void 0:l}),[n,l]),{data:i,isLoading:g,isError:d,hasNextPage:v,isFetching:b,isFetchingNextPage:j,fetchNextPage:N}=A(s,f,a),u=o.useMemo(()=>i?.pages.flatMap(R=>R.runs)??[],[i]),y={runType:n==="all",feed:!0,connection:"deviceId"in s||"connectorKey"in s},S=w({onIntersect:()=>void N(),enabled:!!v&&!b&&!d,rootMargin:"200px"});return e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{bucket:n,status:l,onBucketChange:t,onStatusChange:h}),g?e.jsx(p,{}):d?e.jsx("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:"Failed to load runs."}):u.length===0?e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&l==="all"?"No runs yet.":"No runs match these filters."}):e.jsxs(e.Fragment,{children:[e.jsx(B,{runs:u,ownerSlug:a,columns:y}),e.jsx("div",{ref:S,className:"h-1"}),j&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(T,{size:"lg",className:"text-muted-foreground"})})]})]})}export{z as R,O as a};
|
|
2
|
-
//# sourceMappingURL=runs-panel-Dkyybqos.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,T as d,ii as u,B as N,L as b,d7 as w,e5 as k,e6 as v,e7 as T,ij as C,ik as _,er as S,es as V,et as p,eu as n,ex as R,ey as i,bc as D,e0 as L,Q as E,il as B,e3 as I,ac as M,a3 as O,bd as P,r as h,dC as m,dE as g,dD as j}from"./index-JmEl29py.js";const A=u("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),F=u("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function H({className:t,status:a,showDot:r=!0,children:x,...s}){return e.jsxs("span",{className:d(A({status:a}),t),...s,children:[r&&e.jsx("span",{className:F({status:a})}),x]})}function z(t,a){switch(a.kind){case"connection":return _(t,a.id);case"feed":return C(t,a.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(a.id)}}}}function J({ownerSlug:t,scope:a,variant:r="outline",iconOnly:x=!1,label:s,className:c,title:f}){const l=z(t,a),y=f??s??"View in memory",o=e.jsx(N,{asChild:!0,variant:r,size:x?"icon":"sm",className:d(x&&"h-7 w-7",c),children:e.jsxs(b,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:d("h-3.5 w-3.5",!x&&"mr-1.5")}),!x&&(s??"View in memory")]})});return x?e.jsxs(k,{children:[e.jsx(v,{asChild:!0,children:o}),e.jsx(T,{children:y})]}):o}const Q=new Set(["error","failed","revoked"]);function U(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":Q.has(t)?"error":"default"}function W({status:t}){return t==="completed"?e.jsx(I,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(M,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(O,{className:"text-blue-500"}):e.jsx(P,{className:"h-3.5 w-3.5 text-muted-foreground"})}function X({error:t}){const[a,r]=h.useState(!1);return t.length>80?e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(j,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function $({checkpoint:t}){const[a,r]=h.useState(!1);return e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(j,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function q(t){return t.feed_display_name??t.feed_key??"—"}function K({runs:t,ownerSlug:a,columns:r={}}){const x=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(S,{children:[e.jsx(V,{children:e.jsxs(p,{children:[e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Version"}),x&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(R,{children:t.map(s=>{const c=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(p,{children:[e.jsx(i,{className:"py-1.5 px-3",children:e.jsx(W,{status:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:L(s.created_at),children:D(s.created_at)}),r.runType&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(E,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:q(s)}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(H,{status:U(s.status),children:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:c!=null?B(c):"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),x&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx($,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(X,{error:s.error_message}):""}),e.jsx(i,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:a,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{K as R,H as S,J as V,U as g};
|
|
2
|
-
//# sourceMappingURL=runs-table-9OVdfPXZ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iU as t,j as n}from"./index-JmEl29py.js";import{a as s}from"./agents-workbench-D1YL3VAB.js";import"./agent-editor-form-C24p9LLg.js";import"./model-selector-BeFuFH7p.js";import"./proposal-review-shell-CmLy1MZf.js";import"./runs-B0zVYb-w.js";function c(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(s,{owner:o,agentId:r,tab:"settings",runId:e.run_id})}export{c as component};
|
|
2
|
-
//# sourceMappingURL=settings-Cfy9tCOF.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iT as r,j as t,O as s}from"./index-JmEl29py.js";import{A as e}from"./agent-skill-context-B9giw2u2.js";import"./core.esm-CoJ5Splc.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
2
|
-
//# sourceMappingURL=skills-oxA7P5Fe.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as f,cg as b,eR as R,j as e,B as j,eS as v,S as _,bw as C,L,dQ as F,t as E}from"./index-JmEl29py.js";import{b as S,c as $,R as P,d as A}from"./events-feed-C4VrjIc1.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:x,fetchNextPage:a,hasNextPage:h,isFetching:g,isFetchingNextPage:s}=R(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:g,onRetry:()=>void x()}),e.jsx(S,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:g,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($,{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:x,isFetching:a,isFetchNextPageError:h,error:g}=v(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(P,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(y,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=g instanceof C&&g.status===400;h&&!s||!i&&n?x():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(A,{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 x(),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-BeAZeMLy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{eT as c,cg as n,eU as o,a0 as r,bG as l,cN as s}from"./index-JmEl29py.js";function y(){return n({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,u){return n({queryKey:["automations-list",e,a,!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,u,t={}){const i=c(t.ownerSlug);return n({queryKey:["automation-detail",i,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:i},{timeoutMs:3e4}),enabled:!!i&&!!e&&!!(t.ownerSlug||u),staleTime:3e4})}const q=o({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=o({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=o({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-DS3uz3pb.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./index-JmEl29py.js";function l({onIntersect:r,enabled:n,rootMargin:t="400px"}){const s=e.useRef(null),c=e.useRef(r);return c.current=r,e.useEffect(()=>{const u=s.current;if(!u||!n)return;const o=new IntersectionObserver(f=>{f[0]?.isIntersecting&&c.current()},{rootMargin:t});return o.observe(u),()=>o.disconnect()},[n,t]),s}export{l as u};
|
|
2
|
-
//# sourceMappingURL=use-scroll-sentinel-BpQ70c28.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as f,L as oe,q as se,r as a,Y as D,K as M,fS as ie,fT as ce,T as ae,fU as le,fV as ue}from"./index-JmEl29py.js";import{D as de,E as fe}from"./app-bridge-BCm4muqj.js";import{o as me,v as pe,F as he}from"./filter-editors-oNjBX9a2.js";function Ce({viewKey:e,backTo:t,backLabel:n}){return f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"missing-view",children:[f.jsxs("h2",{className:"text-lg font-semibold",children:["No view named “",e,"” here"]}),f.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"It may have been renamed or detached from this page."}),f.jsx(oe,{to:t,className:"mt-4 text-sm font-medium underline underline-offset-4",children:n})]})}function Le({onRetry:e}){return f.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center","data-testid":"views-unavailable",children:[f.jsx("h2",{className:"text-lg font-semibold",children:"Views couldn’t be loaded"}),f.jsx("button",{type:"button",onClick:e,className:"mt-4 text-sm font-medium underline underline-offset-4",children:"Try again"})]})}const ve=new Set(["query_sql","query_sdk"]),be=200;function ye(e,t){const n=e?.title;return typeof n=="string"&&n.trim()?e??{}:{...e,title:t.slice(0,be)}}const z=new Map;function we(e){const t=z.get(e);if(t)return t;const n=D(`${M}/api/${e}/tools`,{method:"GET",credentials:"include",timeoutMs:15e3}).then(async r=>{if(!r.ok)throw new Error(`tool list failed: ${r.status}`);const o=await r.json();return new Set((o.tools??[]).flatMap(s=>typeof s.name=="string"&&s.annotations?.readOnlyHint===!0?[s.name]:[]))});return z.set(e,n),n.catch(()=>z.delete(e)),n}const xe=[["--color-background-primary","--background"],["--color-background-secondary","--card"],["--color-background-tertiary","--muted"],["--color-background-inverse","--foreground"],["--color-text-primary","--foreground"],["--color-text-secondary","--muted-foreground"],["--color-text-inverse","--background"],["--color-text-info","--primary"],["--color-text-danger","--destructive"],["--color-border-primary","--border"],["--color-border-secondary","--input"],["--color-border-danger","--destructive"],["--color-ring-primary","--ring"],["--font-mono","--font-mono"],["--border-radius-sm","--radius-sm"],["--border-radius-md","--radius-md"],["--border-radius-lg","--radius-lg"],["--border-radius-xl","--radius-xl"]];function P(e){const t=document.documentElement,n=getComputedStyle(t),r={};for(const[s,h]of xe){const c=n.getPropertyValue(h).trim();c&&(r[s]=c)}const o=document.body?getComputedStyle(document.body).fontFamily:"";return o&&(r["--font-sans"]=o),{theme:t.classList.contains("dark")?"dark":"light",displayMode:e.displayMode,availableDisplayModes:e.expandable?["inline","fullscreen"]:[e.displayMode],containerDimensions:{...e.width?{width:e.width}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},platform:"web",styles:{variables:r}}}async function ge(e,t,n,r,o,s){if(o!=="invoke_view_action"){const g=ve.has(o);return!g&&!(await we(e)).has(o)?{error:`Views can only call read tools and their declared actions; "${o}" is neither`}:{url:`${M}/api/${e}/${encodeURIComponent(o)}`,body:g?ye(s,n):s??{}}}const{view:h,action:c,value:x,interaction_id:y,scope:i}=s??{};return i!==void 0&&(typeof i!="object"||i===null||i.event!==r.event)?{error:"The event context changed. Reopen the event before submitting."}:h!==t?{error:`This frame hosts "${t}", not "${String(h)}"`}:typeof c!="string"||!c?{error:"action is required"}:{url:`${M}/api/${e}/views/${encodeURIComponent(t)}/actions/${encodeURIComponent(c)}`,body:{value:x??null,interaction_id:y,...r.event===void 0?{}:{scope:{event:r.event}}}}}const Ee=24,R=new Map;function ke(e,t){const n=`${e}\0${t}`,r=R.get(n);return r!==void 0&&(R.delete(n),R.set(n,r)),r}function Re(e,t,n){const r=`${e}\0${t}`;R.delete(r),R.set(r,n);for(const o of R.keys()){if(R.size<=Ee)break;R.delete(o)}}const _e=({orgSlug:e,viewKey:t,scope:n,params:r,onParamsChange:o,contentHash:s,title:h,minHeight:c=96,fixedHeight:x,displayMode:y="fullscreen",maxHeight:i,onRequestDisplayMode:g,className:b,onLoadError:S})=>{const L=se(),W=a.useRef(L);W.current=L;const V=a.useRef(null),_=a.useRef(null),[N,A]=a.useState(null),[I,F]=a.useState(null),[B,H]=a.useState(c),O=a.useRef(null),$=a.useRef(null),J=a.useRef(c);J.current=c;const X=a.useRef(x);X.current=x;const w=a.useRef({scope:n,params:r,onParamsChange:o,onLoadError:S,onRequestDisplayMode:g,title:h});w.current={scope:n,params:r,onParamsChange:o,onLoadError:S,onRequestDisplayMode:g,title:h};const[Y,K]=a.useState(void 0),T=a.useRef({displayMode:y,expandable:!1});T.current={displayMode:y,maxHeight:i,width:Y,expandable:g!==void 0};const E=le(e,t);a.useEffect(()=>{let v=!1;if(E!==$.current&&(A(null),$.current=null,O.current=null),F(null),s!=null&&s===O.current&&E===$.current)return()=>{v=!0};const j=s==null?void 0:ke(E,s);return j!==void 0?(O.current=s??null,$.current=E,A(j),()=>{v=!0}):(D(`${M}/api/${e}/views/${encodeURIComponent(t)}/shell`,{credentials:"include"}).then(async m=>{if(!m.ok)throw new Error(`shell ${m.status}`);const p=await m.text();if(v)return;const l=m.headers.get("X-Lobu-View-Hash");l!==null&&Re(E,l,p),!(l!==null&&l===O.current&&E===$.current)&&(O.current=l,$.current=E,F(null),A(p))}).catch(m=>{v||(F(m instanceof Error?m.message:String(m)),w.current.onLoadError?.())}),()=>{v=!0})},[E,e,t,s]);const ee=g!==void 0;a.useEffect(()=>{_.current?.setHostContext(P(T.current))},[y,i,Y,ee]),a.useEffect(()=>{const v=V.current;if(!v||typeof ResizeObserver>"u")return;const j=new ResizeObserver(([m])=>{const p=Math.round(m.contentRect.width);p>0&&K(p)});return j.observe(v),()=>j.disconnect()},[N]);const te=JSON.stringify(r),ne=JSON.stringify(n);if(a.useEffect(()=>{_.current?.sendToolInput({arguments:{scope:w.current.scope,params:w.current.params}})},[ne,te]),a.useEffect(()=>{if(!N||I)return;const v=V.current;if(!v?.contentWindow)return;const j=e,m=t;let p=!1;const l=new de(null,{name:"Lobu",version:"1.0.0"},{openLinks:{},serverTools:{},updateModelContext:{structuredContent:{}}},{hostContext:P(T.current)});l.addEventListener("sizechange",({height:u})=>{X.current||typeof u=="number"&&H(Math.max(J.current,Math.ceil(u)))}),l.oncalltool=async({name:u,arguments:d})=>{if(p)return{content:[{type:"text",text:"view unmounted"}],isError:!0};let k;try{k=await ge(j,m,w.current.title??m,w.current.scope,u,d)}catch(Z){return{content:[{type:"text",text:String(Z)}],isError:!0}}if(p)return{content:[{type:"text",text:"view unmounted"}],isError:!0};if("error"in k)return{content:[{type:"text",text:k.error}],isError:!0};const q=await D(k.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(k.body),timeoutMs:3e4}),C=await q.json().catch(()=>null);return q.ok?{content:[{type:"text",text:JSON.stringify(C)}],structuredContent:C??{}}:{content:[{type:"text",text:C&&typeof C.error=="string"&&C.error||`API error: ${q.status}`}],isError:!0}},l.onupdatemodelcontext=async({structuredContent:u})=>{if(p)return{};const d=u?.params;return d&&typeof d=="object"&&!Array.isArray(d)&&w.current.onParamsChange(d),{}},l.onopenlink=async({url:u})=>{if(p)return{};const d=new URL(u,window.location.href);return d.origin===window.location.origin?(d.pathname=ie(d.pathname),await W.current({href:d.href})):window.open(d.href,"_blank","noopener,noreferrer"),{}},l.onrequestdisplaymode=async({mode:u})=>{const d=T.current.displayMode,k=w.current.onRequestDisplayMode;return!p&&k&&u!==d&&(u==="inline"||u==="fullscreen")&&k(u),{mode:d}},l.addEventListener("initialized",()=>{l.sendToolInput({arguments:{scope:w.current.scope,params:w.current.params}})});const U=new fe(v.contentWindow,v.contentWindow);l.connect(U).catch(u=>{console.error("[view-frame] failed to initialize",u)}),_.current=l;const re=ce(()=>{p||U.send({jsonrpc:"2.0",method:"lobu/notifications/data-changed",params:{}}).catch(()=>{})}),Q=new MutationObserver(()=>{l.setHostContext(P(T.current))});return Q.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{p=!0,re(),Q.disconnect(),_.current=null,U.close()}},[N,I,e,t]),I)return f.jsxs("div",{"data-testid":"view-frame-error",className:"text-sm text-destructive",children:["View failed to load: ",I]});const G=!x&&i!==void 0&&B>i;return f.jsxs("div",{className:ae(i!==void 0&&"relative overflow-hidden",b),style:i!==void 0?{maxHeight:i}:void 0,"data-testid":"view-frame","data-view":t,"data-clipped":G||void 0,children:[N?f.jsx("iframe",{ref:V,title:h??t,srcDoc:N,sandbox:"allow-scripts",style:{width:"100%",height:x??B,border:"none",display:"block"}}):f.jsx("div",{className:"animate-pulse rounded-md bg-muted/40",style:{height:c}}),G?f.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-gradient-to-t from-background to-transparent"}):null]})},Se=[{value:!0,label:"Yes"},{value:!1,label:"No"}];function je(e,t,n){const r=[],o=[];for(const[s,h]of Object.entries(e??{})){const c=h.filter;if(!c)continue;const x=b=>n({...t,[s]:b}),y=c.options??(h.type==="boolean"?Se:void 0),i=t[s],g=y?me({searchPlaceholder:`Search ${c.label.toLowerCase()}...`,options:y.map(b=>({value:String(b.value),label:b.label})),selected:i===void 0?[]:[String(i)],onSelect:b=>{const S=y.find(L=>String(L.value)===b);S&&x(S.value)}}):pe({type:h.type==="number"?"number":"text",label:c.label,value:typeof i=="boolean"?void 0:i,onApply:x});r.push({key:`param:${s}`,label:c.label,group:"View",icon:f.jsx(ue,{className:"h-4 w-4"}),editor:g}),i!==void 0&&o.push({id:`param:${s}`,label:c.label,op:"is",value:y?.find(b=>b.value===i)?.label??(i===""?"(empty)":String(i)),onRemove:()=>{const{[s]:b,...S}=t;n(S)}})}return{fields:r,chips:o}}function $e(e,t){const n={...t};for(const[r,o]of Object.entries(e??{}))o.filter&&delete n[r];return n}function Ie({decls:e,params:t,onParamsChange:n}){const{fields:r,chips:o}=je(e,t,n);return r.length?f.jsx(he,{label:"View filters",className:"mb-3",fields:r,chips:o,onClearAll:()=>n($e(e,t))}):null}export{Ce as M,Le as V,_e as a,Ie as b,je as v,$e as w};
|
|
2
|
-
//# sourceMappingURL=view-param-filters-FuOZyjMg.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,eN as A,u as w,eA as $,eD as C,er as T,es as I,et as y,eu as N,ex as P,ey as k,B as f,C as L,d3 as M,b0 as O,k as z,L as U,v as V,jv as q}from"./index-JmEl29py.js";import{j as b,k as B,S,R as D,h as H,D as E}from"./linked-record-peek-B0_B4PnF.js";import{u as _}from"./record-session-CJzFoVKc.js";const J=3;function K(t,s,a,l){const d=F(t.schema,s),i=b(s,d??{});return{href:"",key:`record-field:${t.entity.id}:${s}${a===void 0?"":`:${a}`}`,title:a===void 0?i:l?`${i} ${a+1} of ${l}`:`${i} ${a+1}`,recordField:{entityId:t.entity.id,field:s,row:a}}}function F(t,s){return t?.properties?.[s]}function Z({target:t}){const s=_(t.entityId),a=F(s?.schema,t.field);return s?!a||A(a)?e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This field is no longer available in this view."}):e.jsx("div",{className:"space-y-3 px-5 py-4",children:t.row===void 0?e.jsx(G,{session:s,field:t.field,prop:a}):e.jsx(Q,{session:s,field:t.field,prop:a,row:t.row})}):e.jsx("p",{className:"px-5 py-5 text-sm text-muted-foreground",children:"This record is no longer open. Open it again to see this field."})}function G({session:t,field:s,prop:a}){const l=w(),{record:d,editing:i}=t,r=d.values.metadata[s],n=Array.isArray(r)?r:[],m=$(a.items?.properties),h=(r==null||Array.isArray(r))&&Object.keys(a.items?.properties??{}).length>0&&n.every(C),x=b(s,a),j=a.maxItems===void 0||n.length<a.maxItems,u=e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Field of ",t.entity.name," · ",n.length," ",n.length===1?"item":"items",h&&n.length>0?" · open an item for every field":""]});if(!h)return e.jsxs(e.Fragment,{children:[u,i?e.jsx(B,{fieldPath:`peek.${s}`,fieldKey:s,prop:a,value:r,onChange:o=>d.setMetadataField(s,o),isRequired:!1,readonly:!1,orgContext:t.orgContext,ariaLabel:x}):e.jsx("div",{className:"text-sm",children:e.jsx(S,{value:r,prop:a})})]});const p=m.slice(0,J),v=(o,c=n.length)=>l?.open(K(t,s,o,c));return e.jsxs(e.Fragment,{children:[u,n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No items yet."}):e.jsx("div",{className:"rounded-md border",children:e.jsxs(T,{children:[e.jsx(I,{children:e.jsxs(y,{children:[p.map(([o,c])=>e.jsx(N,{children:b(o,c)},o)),e.jsx(N,{className:"w-10",children:e.jsx("span",{className:"sr-only",children:"Open"})})]})}),e.jsx(P,{children:n.map((o,c)=>e.jsxs(y,{className:"cursor-pointer",onClick:()=>v(c),children:[p.map(([g,R])=>e.jsx(k,{className:"max-w-[10rem] truncate",children:e.jsx(S,{value:o[g],prop:R})},g)),e.jsx(k,{children:e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":`Open ${x} ${c+1}`,onClick:g=>{g.stopPropagation(),v(c)},children:e.jsx(L,{className:"h-4 w-4"})})})]},c))})]})}),i?e.jsxs(f,{type:"button",variant:"outline",size:"sm",disabled:!j,onClick:()=>{d.setMetadataField(s,[...n,{}]),v(n.length,n.length+1)},children:[e.jsx(M,{className:"mr-1.5 h-4 w-4"}),"Add item"]}):null]})}function Q({session:t,field:s,prop:a,row:l}){const d=w(),{record:i,editing:r}=t,n=i.values.metadata[s],m=Array.isArray(n)?n:[],h=m[l],x=a.minItems===void 0||m.length>a.minItems;return C(h)?r?e.jsxs(e.Fragment,{children:[e.jsx(E,{schema:a.items,values:h,onValuesChange:j=>i.setMetadataField(s,m.map((u,p)=>p===l?j:u)),orgContext:t.orgContext}),e.jsxs(f,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",disabled:!x,onClick:()=>{i.setMetadataField(s,m.filter((j,u)=>u!==l)),d?.back?.()},children:[e.jsx(O,{className:"mr-1.5 h-4 w-4"}),"Remove item"]})]}):e.jsx(D,{fields:H(a.items),values:h,context:{ownerSlug:t.ownerSlug,orgContext:t.orgContext}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"This item is no longer in the list."})}function ee(){const{isAuthenticated:t,isReady:s}=z();return s?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center","data-testid":"views-access-required",children:[e.jsx("h2",{className:"text-lg font-semibold",children:t?"Join this workspace to open this view":"Sign in to open this view"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:t?"Attached views are available to workspace members. Use the workspace banner to join.":"Attached views are available to workspace members. Public record details remain available."}),t?null:e.jsx(U,{to:"/auth/login",search:V({callbackUrl:q(),intent:"sign-in"}),className:"mt-4 text-sm font-medium underline underline-offset-4",children:"Sign in"})]}):null}export{Z as R,ee as V,K as r};
|
|
2
|
-
//# sourceMappingURL=views-access-required-CWwlobOd.js.map
|