@lobu/runtime-server 24.3.0 → 24.4.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/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/db/migrations/20261101010000_public_source_type_references.sql +157 -0
- package/dist/dependencies.bun.lock +59 -57
- package/dist/owletto/dist/assets/_-DIK0ae_S.js +2 -0
- package/dist/owletto/dist/assets/_-gTbcArpS.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DOmcJZfk.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DW6wRCVC.js +2 -0
- package/dist/owletto/dist/assets/{_automationId-CfFFAYK1.js → _automationId-B9IcDYBu.js} +2 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-C6PmMPTA.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-BrJ8Pzze.js +2 -0
- package/dist/owletto/dist/assets/{_conversationId-D3vuAQPe.js → _conversationId-BpJAeYYW.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-DarQJo0G.js +2 -0
- package/dist/owletto/dist/assets/_name-DtmNTcUm.js +2 -0
- package/dist/owletto/dist/assets/{_owner-oBX68rb9.js → _owner-Db8at3hk.js} +3 -3
- package/dist/owletto/dist/assets/_shape-6iFA8A86.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CXkHn3Nl.js +2 -0
- package/dist/owletto/dist/assets/{_slug-B2g5qzn3.js → _slug-DBOuBLoX.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-DC27aIN9.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DuYDieln.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-38lHBvjO.js → accept-invitation-BbDCVvur.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-V4ftmSN7.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-DiU7Un5w.js → agent-card-controls-99mG6H5k.js} +2 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-kMmqQSrf.js +4 -0
- package/dist/owletto/dist/assets/agent-connect-pages-B-NPTFs6.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-QrIDroFL.js → agent-editor-form-DfMTSIvj.js} +2 -2
- package/dist/owletto/dist/assets/{agent-guardrails-route-CyoGSxcZ.js → agent-guardrails-route-BvGgfd-h.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-CamDtzHY.js → agent-loading-shells-Dnmb6W5Y.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-CgsQ8BK_.js → agent-permissions-matrix-CbhXlbgY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-lWbXKEm1.js → agent-skill-context-V__2i6Vl.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-D-w3tY_2.js → agent-skills-route-DFXr_bHp.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-CLqpn5Tb.js → agent-subpage-shell-DWzljvFb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-CsRexwTv.js → agent-thread-DQIr20H-.js} +4 -4
- package/dist/owletto/dist/assets/agents-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/{agents-workbench-CmGrMvPC.js → agents-workbench-C8bTa2rv.js} +2 -2
- package/dist/owletto/dist/assets/{app._appId-BO7G38fL.js → app._appId-Bsq40nak.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DMYxs6F6.js → automation-detail-content-C9Cgr5Zj.js} +2 -2
- package/dist/owletto/dist/assets/automations-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/{calendar-DDCCSPW6.js → calendar-DMq3Dtqy.js} +2 -2
- package/dist/owletto/dist/assets/{callback-DFciMR8u.js → callback-B-CAz-bK.js} +2 -2
- package/dist/owletto/dist/assets/{card-BCsbrdGs.js → card-SFtxv9f2.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BRua2b_7.js → claim-DrxIRWKt.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-boZOHuPW.js +2 -0
- package/dist/owletto/dist/assets/{client-rows-DiJQ5D1z.js → client-rows-BJ2PxM4J.js} +2 -2
- package/dist/owletto/dist/assets/clients-C7Lnuc3S.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-BFZa4EIt.js → code-editor-rX0t1g5C.js} +2 -2
- package/dist/owletto/dist/assets/connect-BcwgytDV.js +2 -0
- package/dist/owletto/dist/assets/{connect-menu-D2K4tmvW.js → connect-menu-BF-AlunU.js} +2 -2
- package/dist/owletto/dist/assets/connect._clientId-sDypRDeN.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-C9OkW1tv.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dc6HYr55.js +2 -0
- package/dist/owletto/dist/assets/{connected._clientId.index-BTI5JXA3.js → connected._clientId.index-C6qbqgwF.js} +2 -2
- package/dist/owletto/dist/assets/connection-88YzIBK9.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-D7pnWaFB.js +2 -0
- package/dist/owletto/dist/assets/{connections-browser-BMV8bf54.js → connections-browser-DDJQh8Na.js} +2 -2
- package/dist/owletto/dist/assets/{connector-boxes-DqZA-FdG.js → connector-boxes-DDX7Ebc4.js} +2 -2
- package/dist/owletto/dist/assets/connector-provenance-Th8ymGec.js +2 -0
- package/dist/owletto/dist/assets/{connector-scope-lists-CJYz53YF.js → connector-scope-lists-BibdzKl1.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-BroKpwhB.js → connectors-BqwgLUUK.js} +2 -2
- package/dist/owletto/dist/assets/consent-BR5U7dwb.js +2 -0
- package/dist/owletto/dist/assets/copy-button-2swYh4jb.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-A1UnFbGs.js → core.esm-CHnfRiEM.js} +2 -2
- package/dist/owletto/dist/assets/{create-c94SPL21.js → create-BsPVnRpG.js} +2 -2
- package/dist/owletto/dist/assets/create-CVPYVOR5.js +2 -0
- package/dist/owletto/dist/assets/create-QFjmhOEU.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-DHW6OUoS.js → create-automation-form-DmCOFbRT.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-DLDDVtLS.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-xxpD1P2-.js → cronstrue-CKwjNYgj.js} +2 -2
- package/dist/owletto/dist/assets/device-CKup7kvB.js +2 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-B_te59GE.js → device-pin-tombstone-xGhCTU5_.js} +2 -2
- package/dist/owletto/dist/assets/{device._deviceId-ZU09qrot.js → device._deviceId-B1H_ivDT.js} +2 -2
- package/dist/owletto/dist/assets/{entity-avatar-CEV4ttUQ.js → entity-avatar-HloBoalJ.js} +2 -2
- package/dist/owletto/dist/assets/{entity-options-DJv2EhVV.js → entity-options-BSW_EG0W.js} +2 -2
- package/dist/owletto/dist/assets/entity-page-D-WDWrAe.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-BCBdFndu.js +2 -0
- package/dist/owletto/dist/assets/{event-card-CBlsG32u.js → event-card-Mcxv56DG.js} +2 -2
- package/dist/owletto/dist/assets/event-detail-DXifj49J.js +2 -0
- package/dist/owletto/dist/assets/{events-feed-VfU4csn2.js → events-feed-BysC9HgU.js} +2 -2
- package/dist/owletto/dist/assets/{filter-bar-COU0sBFQ.js → filter-bar-BQm-ubB1.js} +2 -2
- package/dist/owletto/dist/assets/{full-page-spinner-C1Q_jEzD.js → full-page-spinner-BMiXl54z.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-D7W80sJO.js +2 -0
- package/dist/owletto/dist/assets/identity-N0cAO9BR.js +2 -0
- package/dist/owletto/dist/assets/{index-008wj-Pz.js → index-4gCDI7m4.js} +1601 -1601
- package/dist/owletto/dist/assets/{index-DQxzeM37.js → index-B4wXJwQY.js} +2 -2
- package/dist/owletto/dist/assets/{index-BrDP4PCs.js → index-BNaI5GpS.js} +2 -2
- package/dist/owletto/dist/assets/index-BUUrHuJJ.js +2 -0
- package/dist/owletto/dist/assets/index-BqrvJmLh.js +2 -0
- package/dist/owletto/dist/assets/{index-DNtYqkiA.js → index-C-WaHj1Y.js} +2 -2
- package/dist/owletto/dist/assets/index-CnvQEA5V.js +2 -0
- package/dist/owletto/dist/assets/index-Cq7P2c_E.js +2 -0
- package/dist/owletto/dist/assets/{index-DFyBbp7b.js → index-CzoK57xp.js} +2 -2
- package/dist/owletto/dist/assets/index-D3omC3Us.js +2 -0
- package/dist/owletto/dist/assets/{index-yIub2xUM.js → index-D4-uel59.js} +2 -2
- package/dist/owletto/dist/assets/index-DDGdlQrt.css +1 -0
- package/dist/owletto/dist/assets/index-DFEW7hMg.js +2 -0
- package/dist/owletto/dist/assets/index-DVV-WWuT.js +2 -0
- package/dist/owletto/dist/assets/{index-CAVcR9za.js → index-DduQ_e9q.js} +2 -2
- package/dist/owletto/dist/assets/index-DutlI1d-.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-LE_vNZrM.js → json-diff-E5D-NGYT.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-Kzxi2OXB.js → list-skeleton-Bp4HNgJ9.js} +2 -2
- package/dist/owletto/dist/assets/login-7F48UJGx.js +2 -0
- package/dist/owletto/dist/assets/{logout-Dt_VDilG.js → logout-DxmfsVKD.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-De75CR7W.js → member-scope-gate-vp3FihBD.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-CfDmjhDl.js +74 -0
- package/dist/owletto/dist/assets/{model-udnQ_S43.js → model-Dn40BUzs.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-3l9lY50C.js → model-selector-88PJnyTq.js} +2 -2
- package/dist/owletto/dist/assets/models-BBK_n2RP.js +2 -0
- package/dist/owletto/dist/assets/{new-BOwIHkre.js → new-4ruWHLR5.js} +2 -2
- package/dist/owletto/dist/assets/{new-BbdwuJPm.js → new-CvX8_gIb.js} +2 -2
- package/dist/owletto/dist/assets/new-gMD1PHTL.js +2 -0
- package/dist/owletto/dist/assets/oauth-workspace-access-D9BNmyMY.js +2 -0
- package/dist/owletto/dist/assets/organization-BHcp5Pzg.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-0sa10jER.js +2 -0
- package/dist/owletto/dist/assets/{permissions-CfoY4WFY.js → permissions-hhxosugv.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-B4CSiyLB.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-CsenJeXa.js +2 -0
- package/dist/owletto/dist/assets/record-activity-D7bRaMk2.js +2 -0
- package/dist/owletto/dist/assets/{record-session-D07szzqN.js → record-session-CWXnCVln.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-AJxSmE3-.js → renderer-7EGgTVX0.js} +2 -2
- package/dist/owletto/dist/assets/reset-password-CFUzxH7m.js +2 -0
- package/dist/owletto/dist/assets/runs-BPtQBTRN.js +2 -0
- package/dist/owletto/dist/assets/{runs-panel-LnGpHCAQ.js → runs-panel-Bj63_hb9.js} +2 -2
- package/dist/owletto/dist/assets/{schema-type-editor-panel-C_Es0qDf.js → schema-type-editor-panel-CAhOB648.js} +2 -2
- package/dist/owletto/dist/assets/{settings-gGYXbFfd.js → settings-Dg6nxKyw.js} +2 -2
- package/dist/owletto/dist/assets/settings-KJJ6WihO.js +2 -0
- package/dist/owletto/dist/assets/skills-ayt06_o2.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CjFPgKKJ.js → source-record-panels-Bh5F4C5K.js} +2 -2
- package/dist/owletto/dist/assets/{status-dot-CSBtKT4g.js → status-dot-D3FoDRcc.js} +2 -2
- package/dist/owletto/dist/assets/{table-DHM-vCxP.js → table-DFcJRNk7.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-C4TSie1i.js → use-automations-BHoV0dLs.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-PfZrNbu_.js → use-mention-search-C3rWLuKm.js} +2 -2
- package/dist/owletto/dist/assets/{use-scroll-sentinel-D-fJx_Md.js → use-scroll-sentinel-Ct-jt7O0.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-mKoqDsaD.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-2ubIf_3N.js → views-access-required-DHrDO333.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +1978 -1199
- package/npm-shrinkwrap.json +286 -272
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +45 -20
- package/vendor/core/dist/contracts/tools/manage-entity.js +17 -5
- package/vendor/core/dist/index.d.ts +1 -0
- package/vendor/core/dist/index.js +4 -1
- package/vendor/core/dist/logger.js +8 -2
- package/vendor/core/dist/otel.d.ts +13 -2
- package/vendor/core/dist/otel.js +67 -41
- package/vendor/core/dist/trace-context.d.ts +12 -0
- package/vendor/core/dist/trace-context.js +50 -0
- package/vendor/core/package.json +1 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-XKF0m81R.js +0 -3
- package/dist/owletto/dist/assets/_-e8MbEBtw.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +0 -2
- package/dist/owletto/dist/assets/_agentId-emObu67X.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +0 -2
- package/dist/owletto/dist/assets/_name-DjtJMop4.js +0 -2
- package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-voRYSM3a.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-Bkyw22GW.js +0 -5
- package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +0 -2
- package/dist/owletto/dist/assets/agents-DzH_FFKU.js +0 -2
- package/dist/owletto/dist/assets/automations-DzH_FFKU.js +0 -2
- package/dist/owletto/dist/assets/client-activity-scopes-BLIy1Zc3.js +0 -2
- package/dist/owletto/dist/assets/clients-8-EpRjsm.js +0 -2
- package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +0 -2
- package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-BIg8P8WY.js +0 -2
- package/dist/owletto/dist/assets/consent-fzLN-Qy7.js +0 -2
- package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +0 -2
- package/dist/owletto/dist/assets/create-BjwsYarn.js +0 -2
- package/dist/owletto/dist/assets/create-Dzr4mlr0.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +0 -2
- package/dist/owletto/dist/assets/device-C3AEoL5c.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +0 -2
- package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +0 -2
- package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +0 -2
- package/dist/owletto/dist/assets/identity-BaFLmbSo.js +0 -2
- package/dist/owletto/dist/assets/index-BaetvYLa.js +0 -2
- package/dist/owletto/dist/assets/index-BiEf5xOE.css +0 -1
- package/dist/owletto/dist/assets/index-BuXIeK7D.js +0 -2
- package/dist/owletto/dist/assets/index-CMLfWGPU.js +0 -2
- package/dist/owletto/dist/assets/index-D0YEYP7N.js +0 -2
- package/dist/owletto/dist/assets/index-DkO0nPex.js +0 -2
- package/dist/owletto/dist/assets/index-KlRId0g6.js +0 -2
- package/dist/owletto/dist/assets/index-Ywnqi4A6.js +0 -2
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +0 -2
- package/dist/owletto/dist/assets/login-DWOT6jtS.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +0 -74
- package/dist/owletto/dist/assets/models-CQj7GIOp.js +0 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +0 -2
- package/dist/owletto/dist/assets/oauth-workspace-access-QPo4YwRX.js +0 -2
- package/dist/owletto/dist/assets/organization-BDzjnqPf.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CVkLnnKo.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +0 -2
- package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +0 -2
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +0 -2
- package/dist/owletto/dist/assets/runs-lG2ChtOt.js +0 -2
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +0 -2
- package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aw as vn,j as n,r as b,v as G,w as ie,cS as yn,co as It,cT as At,L as Ne,cU as gn,cV as xn,c5 as bn,cW as jn,cJ as kn,cX as Et,cY as A,bt as ft,cZ as Cn,c_ as Sn,ak as Nn,c$ as _n,aj as In,d0 as An,d1 as ae,cz as En,d2 as Tt,d3 as Tn,am as Fn,d4 as wn,b8 as Rn,bi as Mn,as as Ce,d5 as Pn,d6 as $n,ap as Ft,aE as wt,d7 as On,cP as Ln,d8 as Dn,d9 as Rt,da as Kn,db as Bn,bm as Vn,b5 as Un,bv as Gn,bw as Qn,dc as zn,bx as Wn,by as Hn,bz as Yn,S as qn,dd as Zn,I as Xn,h as _e,X as Jn,B as W,de as es,df as ts,dg as ns,bH as ss,dh as os,di as as,dj as is,dk as Mt,dl as pt,o as rs,dm as cs,dn as Oe,dp as ht,cn as ls,dq as ds,k as us,aD as ms,dr as fs,ds as ps,dt as hs,du as vs,dv as ys,dw as gs,dx as xs,bS as bs,dy as js,aV as ks,a$ as vt,dz as yt,dA as Pt,cB as Le,cR as $t,dB as Cs,dC as De}from"./index-008wj-Pz.js";import{S as K,F as Ss,d as Ns,o as ke,r as _s,f as Is,a as As}from"./filter-bar-COU0sBFQ.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as Es}from"./runs-lG2ChtOt.js";import{S as Ts}from"./source-record-panels-CjFPgKKJ.js";import{u as Fs}from"./clients-8-EpRjsm.js";import{u as ws}from"./client-activity-scopes-BLIy1Zc3.js";import{g as Rs}from"./client-rows-DiJQ5D1z.js";import{a as Ms,E as Ps}from"./events-feed-VfU4csn2.js";import{L as $s,u as Os}from"./renderer-AJxSmE3-.js";import{E as Ls}from"./agent-loading-shells-CamDtzHY.js";import{M as Ds}from"./member-scope-gate-De75CR7W.js";const Ue=b.createContext(null);function Ks({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:a}=vn(e);return n.jsx(Ue.Provider,{value:{groups:s,isLoading:!!t||a},children:o})}function Bs(){const e=b.useContext(Ue);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Vs(){return b.useContext(Ue)}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 Us(e){const{slug:t}=yn();return It({queryKey:["schedules",t,e],queryFn:async()=>((await At("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Gs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Qs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function 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 Ys({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 qs({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=>At("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(Et,{heading:Se(d),children:l.map(y=>n.jsxs(A,{"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(A,{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=Es({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(Et,{heading:Se(s),children:[i.map(l=>n.jsxs(A,{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(A,{value:`${s} ${g}`,onSelect:()=>d(g),children:[Se(s)," run #",g]}):null,m.isLoading?n.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,m.isError?n.jsx(A,{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(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,m.hasNextPage?n.jsx(A,{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}=An(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(A,{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(A,{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(En,{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=Tt(f,250),d={slug:e},{data:g,isLoading:l,isError:h,refetch:y}=Tn(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(A,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>n.jsxs(A,{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(A,{onSelect:()=>c(Math.max(0,u-30)),children:"Previous entities"}),g?.metadata.has_more&&n.jsx(A,{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(A,{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 E=k.connector_name??k.connector_key;return n.jsxs(A,{disabled:k.connections.length===0,onSelect:()=>{s(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[n.jsx(K,{selected:k.connector_key===d?.connector_key}),n.jsx(Un,{plain:!0,name:E,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:E}),k.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,n.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:k.connector_key},label:E})]},k.connector_key)}),n.jsx(A,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:n.jsxs(Ne,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},M=[{key:"connector",label:"Connector",group:$e,icon:n.jsx(Vn,{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(E=>{const O=gt({display_name:E.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return n.jsxs(A,{onSelect:()=>{s(a({connection_ids:String(E.id),feed_ids:void 0})),k()},className:"group gap-2",children:[n.jsx(K,{selected:u.has(String(E.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:O}),E.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:E.feed_count}):null,n.jsx(oe,{...Qs(e,{id:E.id,connector_key:_.connector_key}),label:O})]},E.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>n.jsxs(A,{"aria-label":xe(k),onSelect:()=>{s(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[n.jsx(K,{selected:c.has(String(k.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),n.jsx(oe,{...Gs(e,k),label:xe(k)})]},k.id))}}}function xe(e){return e.display_name?.trim()||e.feed_key}const 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(Yn,{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:As(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(qn,{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,E]=_.split("-");t({sortBy:k,sortOrder:E})}})]}),n.jsx(Ss,{label:"Event filters",fields:M,chips:I,meta:H,actions:C,trailing:n.jsxs(n.Fragment,{children:[y,!c&&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 Vt({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 Ve(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 ${Ve(f)}`:Ve(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"," ",Ve(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,E=Tt(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)!==E&&F({searchQuery:E})},[E,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:Ut=[]}=ls(i&&l?e:null),{data:Gt=[]}=ds(h?t:null),ze=l?Ut:Gt,{data:We=[]}=us(l&&e?{organizationId:e}:void 0),le=Vs(),de=j.connectionIds,Ae=(de?.length??0)>0,{data:He=[]}=ms(i&&l?e??"":"",{connectionIds:de??void 0,enabled:!le&&i&&l&&Ae}),Ye=j.feedIds,Ee=(Ye?.length??0)>0,{data:qe=[]}=wt(i&&l?e:null,{feedIds:Ye??void 0,enabled:i&&l&&Ee}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Te=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Fe=b.useMemo(()=>qe.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[qe]),Qt=b.useMemo(()=>Ae&&Te.length===0||Ee&&Fe.length===0?[]:qs({connectors:ze,entityTypes:We,selectedPlatforms:Te,selectedFeeds:Fe,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Ae,Ee,Te,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 Rs(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[R,Xe]),Je=b.useMemo(()=>{if(!ue||!R)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):R.length>1?`${R.length} client registrations`:"Client registration"},[me,R,ue]),fe=me.length===1?me[0]:null,zt=t&&fe?zs(t,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=ws({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]),Y=j.agentId,q=j.schedule,{data:nt=[]}=Us(Y??void 0),st=b.useMemo(()=>!q||!Y?null:nt.find(v=>v.id===q)?.description?.trim()||"Scheduled task",[Y,q,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 T=p.get(N),L=v.attribute_values||{},$=Object.keys(L);let ve=null;const Z={};for(const[X,U]of Object.entries(L))if(U.parent)for(const[Pe,J]of Object.entries(U.parent))ve=Pe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=T.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...$]);D.values=[...X];for(const[U,Pe]of Object.entries(Z)){D.valuesByParentValue[U]||(D.valuesByParentValue[U]=[]);const J=new Set([...D.valuesByParentValue[U],...Pe]);D.valuesByParentValue[U]=[...J]}ve&&(D.parentSlug=ve)}else T.classifiers.push({slug:v.slug,name:v.name,values:$,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,T)=>N.parentSlug===null&&T.parentSlug!==null?-1:N.parentSlug!==null&&T.parentSlug===null?1:0);return[...p.values()]},[ot]),Yt=hs(i&&l?e:null,o,j,t),qt=vs(h?t:null,o,j),Zt=h?qt:Yt,{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],V=ct?.content[ct.content.length-1];b.useEffect(()=>{!rt||!V||B?.pages.length===1||x.beforeOccurredAt===V.occurred_at&&x.beforeId===V.id||F({beforeOccurredAt:V.occurred_at,beforeId:V.id},{replace:!0})},[V?.id,rt,F,B?.pages.length,V,x.beforeOccurredAt,x.beforeId]);const cn=b.useCallback(()=>{w({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[w]),ln=(p,v)=>{w({dateRange:[p,v]})},lt=(p,v)=>{const N={...j.classificationFilters||{}};if(v.length>0)N[p]=v;else{delete N[p];for(const T of we)for(const L of T.classifiers)L.parentSlug===p&&delete N[L.slug]}w({classificationFilters:N})},dn=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(T=>T!==v):[...N,v])},un=p=>lt(p,[]);if(Jt)return n.jsx(bs,{label:"knowledge"});const Me=!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]??[],T=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,L=T?[...new Set(T.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(T=>T.classifiers).find(T=>T.slug===p);he.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:N?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>un(p)})}const mn=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>w({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>w({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:zt,details:R&&R.length>0?n.jsx(Ys,{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&&Y&&q?Hs(t,Y,q):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(Vt,{...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(Vt,{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(Ts,{record:e,orgContext:{slug:t},filters:a})]})}function wo({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,wo as R,lo as S};
|
|
2
|
-
//# sourceMappingURL=record-activity-BXhvJbd9.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Z as v,r as a,j as e,L as h,$ as j,Q as y,a0 as N}from"./index-008wj-Pz.js";import{C as k,a as C,b as S,c as L}from"./card-BCsbrdGs.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==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:o})});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:o,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-kRYyQuTY.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f1 as r,cT as s,cS as c,co as l,$ as g,f2 as f}from"./index-008wj-Pz.js";const I=30,_=new Set(["running","pending","claimed"]);function m(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function y(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?m(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return s("manage_operations",{action:"list_runs",...y(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:I},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function T(n,e){const{slug:i}=c(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return l({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(f(i,t),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{T as a,v as u};
|
|
2
|
-
//# sourceMappingURL=runs-lG2ChtOt.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iN as t,j as n}from"./index-008wj-Pz.js";import{a as s}from"./agents-workbench-CmGrMvPC.js";import"./agent-editor-form-QrIDroFL.js";import"./model-selector-3l9lY50C.js";import"./proposal-review-shell-CVkLnnKo.js";import"./runs-lG2ChtOt.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-CEAOg7fr.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iM as r,j as t,O as s}from"./index-008wj-Pz.js";import{A as e}from"./agent-skill-context-lWbXKEm1.js";import"./core.esm-A1UnFbGs.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-BOL5c_Tk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as f,L as oe,v as se,r as a,$ as D,Q as M,fZ as ie,f_ as ce,h as ae,f$ as le,g0 as ue}from"./index-008wj-Pz.js";import{D as de,E as fe}from"./app-bridge-C4nPtae3.js";import{o as me,v as pe,F as he}from"./filter-bar-COU0sBFQ.js";function Le({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 Te({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 U=new Map;function we(e){const t=U.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 U.set(e,n),n.catch(()=>U.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 q(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:j})=>{const T=se(),W=a.useRef(T);W.current=T;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:j,onRequestDisplayMode:g,title:h});w.current={scope:n,params:r,onParamsChange:o,onLoadError:j,onRequestDisplayMode:g,title:h};const[Y,K]=a.useState(void 0),C=a.useRef({displayMode:y,expandable:!1});C.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 S=s==null?void 0:ke(E,s);return S!==void 0?(O.current=s??null,$.current=E,A(S),()=>{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(q(C.current))},[y,i,Y,ee]),a.useEffect(()=>{const v=V.current;if(!v||typeof ResizeObserver>"u")return;const S=new ResizeObserver(([m])=>{const p=Math.round(m.contentRect.width);p>0&&K(p)});return S.observe(v),()=>S.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 S=e,m=t;let p=!1;const l=new de(null,{name:"Lobu",version:"1.0.0"},{openLinks:{},serverTools:{},updateModelContext:{structuredContent:{}}},{hostContext:q(C.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(S,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 P=await D(k.url,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(k.body),timeoutMs:3e4}),L=await P.json().catch(()=>null);return P.ok?{content:[{type:"text",text:JSON.stringify(L)}],structuredContent:L??{}}:{content:[{type:"text",text:L&&typeof L.error=="string"&&L.error||`API error: ${P.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=C.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 z=new fe(v.contentWindow,v.contentWindow);l.connect(z).catch(u=>{console.error("[view-frame] failed to initialize",u)}),_.current=l;const re=ce(()=>{p||z.send({jsonrpc:"2.0",method:"lobu/notifications/data-changed",params:{}}).catch(()=>{})}),Q=new MutationObserver(()=>{l.setHostContext(q(C.current))});return Q.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{p=!0,re(),Q.disconnect(),_.current=null,z.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]})},je=[{value:!0,label:"Yes"},{value:!1,label:"No"}];function Se(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"?je: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 j=y.find(T=>String(T.value)===b);j&&x(j.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,...j}=t;n(j)}})}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}=Se(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{Le as M,Te as V,_e as a,Ie as b,Se as v,$e as w};
|
|
2
|
-
//# sourceMappingURL=view-param-filters-DkX4YdDT.js.map
|