@lobu/runtime-server 24.4.0 → 24.5.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 +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/postgres.ts +77 -48
- package/dist/dependencies.bun.lock +86 -117
- package/dist/owletto/dist/assets/_-CCWuGXtQ.js +2 -0
- package/dist/owletto/dist/assets/_-DOJW1D-I.js +3 -0
- package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +2 -0
- package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +2 -0
- package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +2 -0
- package/dist/owletto/dist/assets/_name-D30_V03t.js +2 -0
- package/dist/owletto/dist/assets/_owner-Be8O41u8.js +3 -0
- package/dist/owletto/dist/assets/_shape-C6YbloRh.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +2 -0
- package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +2 -0
- package/dist/owletto/dist/assets/_view-aoFDwEld.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-pUl-c1KQ.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-DN0ZEAzr.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-99mG6H5k.js → agent-card-controls-C5jNWgfq.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-kMmqQSrf.js → agent-client-setup-list-DbXtJTsO.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-DcTuiSt9.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +2 -0
- package/dist/owletto/dist/assets/agent-guardrails-route-BJyfalBY.js +2 -0
- package/dist/owletto/dist/assets/agent-list-row-rF5LH-3k.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-Dnmb6W5Y.js → agent-loading-shells-ClY_O6lb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-CbhXlbgY.js → agent-permissions-matrix-bP1Qihv7.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-V__2i6Vl.js → agent-skill-context-BAaGpvfS.js} +2 -2
- package/dist/owletto/dist/assets/agent-skills-route-Bv5luNdw.js +2 -0
- package/dist/owletto/dist/assets/agent-tab-intro-ednTs4WF.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-WNk2HapT.js +6 -0
- package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +2 -0
- package/dist/owletto/dist/assets/agents-DY2S2SGE.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-bPTjdVS1.js +2 -0
- package/dist/owletto/dist/assets/app._appId-DrL5H5lB.js +2 -0
- package/dist/owletto/dist/assets/assist-composer-ClfFEVx7.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +2 -0
- package/dist/owletto/dist/assets/automation-row-DCHM--aD.js +2 -0
- package/dist/owletto/dist/assets/automations-DY2S2SGE.js +2 -0
- package/dist/owletto/dist/assets/{calendar-DMq3Dtqy.js → calendar-Ck0yOLYu.js} +2 -2
- package/dist/owletto/dist/assets/{callback-B-CAz-bK.js → callback-DRABUOha.js} +2 -2
- package/dist/owletto/dist/assets/{card-SFtxv9f2.js → card-Bdi7VEwo.js} +2 -2
- package/dist/owletto/dist/assets/change-summary-PBoM6Asb.js +2 -0
- package/dist/owletto/dist/assets/{claim-DrxIRWKt.js → claim-CUIG1Oc-.js} +2 -2
- package/dist/owletto/dist/assets/{client-activity-scopes-boZOHuPW.js → client-activity-scopes-CXOWB5co.js} +2 -2
- package/dist/owletto/dist/assets/{client-rows-BJ2PxM4J.js → client-rows-36VnmgMK.js} +2 -2
- package/dist/owletto/dist/assets/{clients-C7Lnuc3S.js → clients-BJRcMk1A.js} +2 -2
- package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +16 -0
- package/dist/owletto/dist/assets/connect-CMcEQWls.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-jSnGvzYs.js +2 -0
- package/dist/owletto/dist/assets/{connection-feed-detail-D7pnWaFB.js → connection-feed-detail-BIlkK0Pd.js} +2 -2
- package/dist/owletto/dist/assets/connection-q1bdnxCN.js +2 -0
- package/dist/owletto/dist/assets/{connections-browser-DDJQh8Na.js → connections-browser-V-3td9DB.js} +2 -2
- package/dist/owletto/dist/assets/{connector-boxes-DDX7Ebc4.js → connector-boxes-lFc-WP83.js} +2 -2
- package/dist/owletto/dist/assets/connector-page-shell-Cs1SjrYB.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-aJFeeRIC.js +2 -0
- package/dist/owletto/dist/assets/{connector-scope-lists-BibdzKl1.js → connector-scope-lists--vNdbOn0.js} +2 -2
- package/dist/owletto/dist/assets/connectors-BsvDMdsQ.js +2 -0
- package/dist/owletto/dist/assets/consent-DJV78pnz.js +2 -0
- package/dist/owletto/dist/assets/copy-button-DjMWgrBf.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-CHnfRiEM.js → core.esm-CQzL3ObT.js} +3 -3
- package/dist/owletto/dist/assets/create-BmKx5vq3.js +2 -0
- package/dist/owletto/dist/assets/create-Rt0RbiD4.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +3 -0
- package/dist/owletto/dist/assets/create-jBEuveV1.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +2 -0
- package/dist/owletto/dist/assets/device-Ba3RsIgb.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-HloBoalJ.js → entity-avatar-TVKjZxWQ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-daOOQo7O.js +2 -0
- package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +2 -0
- package/dist/owletto/dist/assets/event-card-DVUB8my6.js +2 -0
- package/dist/owletto/dist/assets/event-detail-DkY95e5b.js +2 -0
- package/dist/owletto/dist/assets/{events-feed-BysC9HgU.js → events-feed-B9CZHI_P.js} +2 -2
- package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-BMiXl54z.js → full-page-spinner-BqmckkOf.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-Csusrok2.js +2 -0
- package/dist/owletto/dist/assets/identity-Dmg3STO8.js +2 -0
- package/dist/owletto/dist/assets/index--ZWegctR.js +2 -0
- package/dist/owletto/dist/assets/{index-CzoK57xp.js → index-B0kw2lFL.js} +2 -2
- package/dist/owletto/dist/assets/index-BKrdVwW9.js +2 -0
- package/dist/owletto/dist/assets/index-BUBcNNUY.js +2 -0
- package/dist/owletto/dist/assets/index-BUDr4-Yv.js +2 -0
- package/dist/owletto/dist/assets/index-BYPQWVwD.js +2 -0
- package/dist/owletto/dist/assets/index-BfpaPJPj.js +2 -0
- package/dist/owletto/dist/assets/index-BicNFLBW.js +2 -0
- package/dist/owletto/dist/assets/index-Bsdv5aks.js +2 -0
- package/dist/owletto/dist/assets/index-C186T2Rw.js +53 -0
- package/dist/owletto/dist/assets/index-CX0pJ9j9.js +2 -0
- package/dist/owletto/dist/assets/{index-B4wXJwQY.js → index-CsrT07TJ.js} +2 -2
- package/dist/owletto/dist/assets/index-DdBTTN3y.js +7899 -0
- package/dist/owletto/dist/assets/index-DdYWarql.css +1 -0
- package/dist/owletto/dist/assets/index-JYEIN8nM.js +2 -0
- package/dist/owletto/dist/assets/index-Vcq4gwWv.js +2 -0
- package/dist/owletto/dist/assets/{index-C-WaHj1Y.js → index-ijqrJaRB.js} +2 -2
- package/dist/owletto/dist/assets/{index-D4-uel59.js → index-ikp_mTsf.js} +2 -2
- package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +14 -0
- package/dist/owletto/dist/assets/{list-skeleton-Bp4HNgJ9.js → list-skeleton-CXDLkYTg.js} +2 -2
- package/dist/owletto/dist/assets/login-u6LCgDYG.js +2 -0
- package/dist/owletto/dist/assets/{logout-DxmfsVKD.js → logout-JhmuWJEH.js} +2 -2
- package/dist/owletto/dist/assets/manage-gear-D8LMhehh.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-vp3FihBD.js → member-scope-gate-4FQ0aanZ.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +74 -0
- package/dist/owletto/dist/assets/model-jL871x2J.js +2 -0
- package/dist/owletto/dist/assets/model-selector-CgU8SJMF.js +2 -0
- package/dist/owletto/dist/assets/models-jdemgIZk.js +2 -0
- package/dist/owletto/dist/assets/nav-pill-DrFkuyUQ.js +2 -0
- package/dist/owletto/dist/assets/new-CcJOd5aH.js +2 -0
- package/dist/owletto/dist/assets/{new-CvX8_gIb.js → new-DgE1pVV0.js} +2 -2
- package/dist/owletto/dist/assets/new-OWwrYckd.js +2 -0
- package/dist/owletto/dist/assets/organization-CKM_oFX3.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +2 -0
- package/dist/owletto/dist/assets/pending-seed-sml8Uf6e.js +2 -0
- package/dist/owletto/dist/assets/permissions-BvA9SATv.js +2 -0
- package/dist/owletto/dist/assets/{proposal-review-shell-B4CSiyLB.js → proposal-review-shell-D6KABxah.js} +2 -2
- package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +2 -0
- package/dist/owletto/dist/assets/record-activity-C9gVBbF0.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CWXnCVln.js → record-session-R-uHNuby.js} +2 -2
- package/dist/owletto/dist/assets/{renderer-7EGgTVX0.js → renderer-DXfJaCCa.js} +23 -23
- package/dist/owletto/dist/assets/{reset-password-CFUzxH7m.js → reset-password-Mx3baeNc.js} +2 -2
- package/dist/owletto/dist/assets/run-activity-link-CaIBSRQj.js +2 -0
- package/dist/owletto/dist/assets/run-initiator-BvzQJYW9.js +2 -0
- package/dist/owletto/dist/assets/{runs-BPtQBTRN.js → runs-fFJ1lPnw.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-DEnZHTa5.js +2 -0
- package/dist/owletto/dist/assets/runs-table-XGnxJl7S.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-CAhOB648.js → schema-type-editor-panel-C0_9VcSs.js} +2 -2
- package/dist/owletto/dist/assets/settings-CP4PjMQA.js +2 -0
- package/dist/owletto/dist/assets/settings-CgaUJMHH.js +2 -0
- package/dist/owletto/dist/assets/skills-D-e_h3a9.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-Bh5F4C5K.js → source-record-panels-Bh0n4gGw.js} +2 -2
- package/dist/owletto/dist/assets/{status-dot-D3FoDRcc.js → status-dot-Cpq63I7p.js} +2 -2
- package/dist/owletto/dist/assets/{table-DFcJRNk7.js → table-BUqshjxa.js} +2 -2
- package/dist/owletto/dist/assets/{use-automations-BHoV0dLs.js → use-automations-BLNjxq2K.js} +2 -2
- package/dist/owletto/dist/assets/use-login-redirect-CmyQW7GT.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-C3rWLuKm.js → use-mention-search-dn3ws1WB.js} +3 -3
- package/dist/owletto/dist/assets/use-scroll-sentinel-DRyBMueA.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +2 -0
- package/dist/owletto/dist/assets/{views-access-required-DHrDO333.js → views-access-required-C_b9itZ2.js} +2 -2
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +53989 -51632
- package/dist/server.bundle.mjs +5 -5
- package/dist/verify.mjs +1 -1
- package/npm-shrinkwrap.json +183 -217
- package/package.json +3 -4
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +8 -2
- package/vendor/connector-sdk/dist/reaction-sdk.d.ts +5 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +61 -6
- package/vendor/core/dist/contracts/agent-settings.js +10 -7
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +473 -98
- package/vendor/core/dist/contracts/tools/manage-agents.js +111 -2
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +21 -18
- package/vendor/core/dist/contracts/tools/manage-automations.js +15 -15
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-inference-providers.d.ts +445 -0
- package/vendor/core/dist/contracts/tools/manage-inference-providers.js +133 -0
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +4 -4
- package/vendor/core/dist/contracts/tools/manage-views.js +5 -3
- package/vendor/core/dist/contracts/worker/device-automation.js +4 -2
- package/vendor/core/dist/error-report.d.ts +73 -0
- package/vendor/core/dist/error-report.js +346 -0
- package/vendor/core/dist/index.d.ts +3 -1
- package/vendor/core/dist/index.js +4 -1
- package/vendor/core/dist/logger.js +7 -4
- package/vendor/core/dist/otel-fetch.d.ts +19 -0
- package/vendor/core/dist/otel-fetch.js +96 -0
- package/vendor/core/dist/otel.d.ts +9 -0
- package/vendor/core/dist/otel.js +28 -7
- package/vendor/core/dist/reserved.d.ts +1 -1
- package/vendor/core/dist/reserved.js +6 -4
- package/vendor/core/dist/tool-result.d.ts +8 -0
- package/vendor/core/dist/tool-result.js +61 -0
- package/vendor/core/dist/utils/diagnostic-scrubber.js +1 -1
- package/vendor/core/dist/worker/auth.js +4 -0
- package/vendor/core/package.json +6 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-DIK0ae_S.js +0 -2
- package/dist/owletto/dist/assets/_-gTbcArpS.js +0 -3
- package/dist/owletto/dist/assets/_agentId-DOmcJZfk.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DW6wRCVC.js +0 -2
- package/dist/owletto/dist/assets/_automationId-B9IcDYBu.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-C6PmMPTA.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BrJ8Pzze.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-BpJAeYYW.js +0 -2
- package/dist/owletto/dist/assets/_eventId-DarQJo0G.js +0 -2
- package/dist/owletto/dist/assets/_name-DtmNTcUm.js +0 -2
- package/dist/owletto/dist/assets/_owner-Db8at3hk.js +0 -3
- package/dist/owletto/dist/assets/_shape-6iFA8A86.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CXkHn3Nl.js +0 -2
- package/dist/owletto/dist/assets/_slug-DBOuBLoX.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DC27aIN9.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DuYDieln.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-BbDCVvur.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-V4ftmSN7.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-B-NPTFs6.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-DfMTSIvj.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-BvGgfd-h.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-DFXr_bHp.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-DWzljvFb.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-DQIr20H-.js +0 -6
- package/dist/owletto/dist/assets/agents-CLbeiqTR.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-C8bTa2rv.js +0 -2
- package/dist/owletto/dist/assets/app._appId-Bsq40nak.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-C9Cgr5Zj.js +0 -2
- package/dist/owletto/dist/assets/automations-CLbeiqTR.js +0 -2
- package/dist/owletto/dist/assets/code-editor-rX0t1g5C.js +0 -16
- package/dist/owletto/dist/assets/connect-BcwgytDV.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-BF-AlunU.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-sDypRDeN.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-C9OkW1tv.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-Dc6HYr55.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-C6qbqgwF.js +0 -2
- package/dist/owletto/dist/assets/connection-88YzIBK9.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-Th8ymGec.js +0 -2
- package/dist/owletto/dist/assets/connectors-BqwgLUUK.js +0 -2
- package/dist/owletto/dist/assets/consent-BR5U7dwb.js +0 -2
- package/dist/owletto/dist/assets/copy-button-2swYh4jb.js +0 -2
- package/dist/owletto/dist/assets/create-BsPVnRpG.js +0 -2
- package/dist/owletto/dist/assets/create-CVPYVOR5.js +0 -2
- package/dist/owletto/dist/assets/create-QFjmhOEU.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-DmCOFbRT.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-DLDDVtLS.js +0 -2
- package/dist/owletto/dist/assets/cronstrue-CKwjNYgj.js +0 -2
- package/dist/owletto/dist/assets/device-CKup7kvB.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-xGhCTU5_.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-B1H_ivDT.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BSW_EG0W.js +0 -2
- package/dist/owletto/dist/assets/entity-page-D-WDWrAe.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BCBdFndu.js +0 -2
- package/dist/owletto/dist/assets/event-card-Mcxv56DG.js +0 -2
- package/dist/owletto/dist/assets/event-detail-DXifj49J.js +0 -2
- package/dist/owletto/dist/assets/filter-bar-BQm-ubB1.js +0 -2
- package/dist/owletto/dist/assets/guardrails-D7W80sJO.js +0 -2
- package/dist/owletto/dist/assets/identity-N0cAO9BR.js +0 -2
- package/dist/owletto/dist/assets/index-4gCDI7m4.js +0 -7950
- package/dist/owletto/dist/assets/index-BNaI5GpS.js +0 -2
- package/dist/owletto/dist/assets/index-BUUrHuJJ.js +0 -2
- package/dist/owletto/dist/assets/index-BqrvJmLh.js +0 -2
- package/dist/owletto/dist/assets/index-CnvQEA5V.js +0 -2
- package/dist/owletto/dist/assets/index-Cq7P2c_E.js +0 -2
- package/dist/owletto/dist/assets/index-D3omC3Us.js +0 -2
- package/dist/owletto/dist/assets/index-DDGdlQrt.css +0 -1
- package/dist/owletto/dist/assets/index-DFEW7hMg.js +0 -2
- package/dist/owletto/dist/assets/index-DVV-WWuT.js +0 -2
- package/dist/owletto/dist/assets/index-DduQ_e9q.js +0 -2
- package/dist/owletto/dist/assets/index-DutlI1d-.js +0 -2
- package/dist/owletto/dist/assets/index-wHFQv1aT.js +0 -12
- package/dist/owletto/dist/assets/json-diff-E5D-NGYT.js +0 -4
- package/dist/owletto/dist/assets/login-7F48UJGx.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-CfDmjhDl.js +0 -74
- package/dist/owletto/dist/assets/model-Dn40BUzs.js +0 -2
- package/dist/owletto/dist/assets/model-selector-88PJnyTq.js +0 -2
- package/dist/owletto/dist/assets/models-BBK_n2RP.js +0 -2
- package/dist/owletto/dist/assets/new-4ruWHLR5.js +0 -2
- package/dist/owletto/dist/assets/new-gMD1PHTL.js +0 -2
- package/dist/owletto/dist/assets/oauth-workspace-access-D9BNmyMY.js +0 -2
- package/dist/owletto/dist/assets/organization-BHcp5Pzg.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-0sa10jER.js +0 -2
- package/dist/owletto/dist/assets/permissions-hhxosugv.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-CsenJeXa.js +0 -2
- package/dist/owletto/dist/assets/record-activity-D7bRaMk2.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Bj63_hb9.js +0 -2
- package/dist/owletto/dist/assets/settings-Dg6nxKyw.js +0 -2
- package/dist/owletto/dist/assets/settings-KJJ6WihO.js +0 -2
- package/dist/owletto/dist/assets/skills-ayt06_o2.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-Ct-jt7O0.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-mKoqDsaD.js +0 -2
- /package/vendor/@better-auth-kysely-adapter/{.bun-tag-abf95749a412716 → .bun-tag-654b3a002b271269} +0 -0
- /package/vendor/postgres/{.bun-tag-22d644c2873790db → .bun-tag-c81dacd34e959a7a} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cQ as de,bN as ue,k as Ct,r as y,er as Rt,es as xn,a3 as hn,Q as yn,dQ as gn,u as At,et as vn,j as t,i as Z,eu as jt,ev as Ze,ew as St,ex as jn,ey as _n,bu as qe,ez as bn,eA as Je,eB as Nn,eC as wn,eD as kn,eE as Cn,eF as It,bx as Rn,B as T,q as ot,eG as lt,cP as ze,L as ee,eH as An,x as Sn,dT as In,cL as Tt,eI as Tn,eJ as En,d0 as $n,eK as Et,cg as et,eL as Pn,eM as On,dZ as Fn,eN as Mn,dV as tt,cI as nt,V as le,cy as $t,dW as Pt,dX as Dn,dE as Ln,dG as Bn,dF as zn,a$ as Vn,b0 as Un,a0 as Ot,b1 as qn,eO as Kn,c as Qn,w as Hn,v as Jn,bt as Pe,eP as Gn,a6 as Wn,eQ as _t,eR as Yn,I as Xn,eS as Zn,bP as es,ab as ce,cM as ts,cC as ns,eT as ss,eU as rs,eV as as,eW as is,c2 as os,eX as ls,c7 as ds,eY as cs,Y as us,eZ as ms,X as ps,e_ as fs,bc as xs,e$ as hs,f0 as ys,dR as gs}from"./index-DdBTTN3y.js";import{R as vs,p as js}from"./run-initiator-BvzQJYW9.js";import{b as Ft}from"./use-automations-BLNjxq2K.js";import{l as _s,s as bs,S as Ns,J as ws}from"./renderer-DXfJaCCa.js";import{C as ks}from"./change-summary-PBoM6Asb.js";import{J as Le}from"./json-diff-BaLL4Fsu.js";import{C as bt}from"./copy-button-DjMWgrBf.js";import{A as Cs}from"./agent-list-row-rF5LH-3k.js";import{A as Rs}from"./automation-row-DCHM--aD.js";import{d as As}from"./model-jL871x2J.js";import{c as Ss}from"./connection-label-BobuYiAG.js";function Is(e,n){if(!e||typeof e!="object"||Array.isArray(e))return null;const s=e.title;if(typeof s!="string")return null;const a=s.trim();return a&&a!==n?a:null}function Mt(e){const n=Array.isArray(e?.records)?e.records:Array.isArray(e?.current)?e.current:[];return[e?.from_entity_id??e?.entity_id,e?.to_entity_id].map(s=>{const r=n.find(o=>o&&typeof o=="object"&&"id"in o&&o.id===s);return{id:String(s??"unknown"),name:typeof r?.name=="string"?r.name:`Record ${String(s??"unknown")}`}})}function Dt(e,n){return n==="rejected"?"The proposed relationship change was rejected. Both records remain available.":n==="failed"?"The relationship change failed. Both records remain available.":n==="completed"?e==="link"?"The records were linked. Both records remain available.":"The relationship was removed. Both records remain available.":n==="approved"||n==="confirmed"?"The relationship change was approved. Both records remain available.":e==="link"?"If approved, these records will be linked. Both records remain available.":"If approved, this relationship will be removed. Both records remain available."}function na(e){const n=Mt(e.proposal);return{title:e.action==="link"?"Link records":"Unlink records",icon:"entity",impact:{level:"normal"},tone:"default",blocks:[...n.map((s,a)=>({type:"text",label:a===0?"From":"To",value:s.name})),{type:"text",label:"Relationship",value:String(e.proposal?.relationship_type??e.proposal?.relationship_type_slug??"Relationship")},{type:"text",value:Dt(e.action,typeof e.status=="string"?e.status:void 0),muted:!0},...typeof e.reason=="string"&&e.reason?[{type:"text",label:"Why this needs approval",value:e.reason}]:[]],actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",confirm:e.action==="unlink",confirmPrompt:"Remove this relationship? Both records will remain available.",tool:"manage_operations",args:{action:"approve"},resolvedLabel:"Approval submitted."},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this relationship change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:"Relationship change rejected."}]}}function Lt(e,n,s){return{queryKey:["event-view-match",e,n.key,n.content_hash,s],queryFn:async()=>{try{const r=(await de("open_view",{key:n.key,scope:{event:s}},{slug:e})).scope?.event;if(!Number.isSafeInteger(r)||(r??0)<1)throw new Error("The view did not resolve its event subject");return r}catch(a){if(a instanceof ue&&(a.status===400||a.status===404))return null;throw a}},staleTime:6e4}}function sa(e,n){const s=Ct(e??{slug:null,organizationId:null}),a=e?.slug??null,r=y.useMemo(()=>a?Rt(s.data??[]):[],[a,s.data]),o=xn({queries:r.map(l=>Lt(a,l,n))});return a?{views:r.flatMap((l,c)=>{const i=o[c]?.data;return i?[{...l,eventId:i}]:[]}),isLoading:s.data===void 0?!s.isError:o.some(l=>l.isPending),isError:s.isError||o.some(l=>l.isError),refetch:()=>{s.refetch();for(const l of o)l.isError&&l.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function Ts(e,n,s,a){const r=await Promise.all(s.map(o=>e.fetchQuery(Lt(n,o,a))));return s.find((o,l)=>r[l])??null}async function Es(e,n,s,a){const r=await hn(`${yn}/api/${encodeURIComponent(e)}/events/${n}/actions/${encodeURIComponent(s.action)}`,{method:"POST",timeoutMs:9e4,credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:a})});return await gn(r,"Could not record interaction"),r.json()}function O(e){if(typeof e!="string")return;const n=e.trim();return n.length>0?n:void 0}function Ge(e){return typeof e=="boolean"?e:void 0}function $s(e,n,s){const a=(s??"").toLowerCase();return!!(a==="prepare_comment"||a==="verify_staged_comment"||a.includes("prepare_")||a.includes("verify_staged")||n?.prepared===!0||typeof n?.verified=="boolean"||O(n?.reason_preview)&&O(n?.message)||O(e?.body)&&(O(e?.post_url)||O(e?.activity_id)))}function Ps(e,n,s){if(!$s(e,n,s))return null;const a=(s??"").toLowerCase(),r=O(n?.body)??O(e?.body),o=O(n?.reason_preview)??O(e?.reason),l=O(n?.post_url)??O(e?.post_url)??(O(e?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${O(e?.activity_id)}`:void 0),c=Ge(n?.prepared),i=Ge(n?.verified),d=Ge(n?.banner_shown),p=O(n?.message),u=n?.match&&typeof n.match=="object"?n.match:null,x=O(u?.text_preview),h=O(u?.author);let S="generic";a==="verify_staged_comment"||a.includes("verify")||typeof i=="boolean"?S="verify":(a==="prepare_comment"||a.includes("prepare")||c===!0||r&&l)&&(S="prepare");const _=[];return c===!0&&_.push("Staged — not posted"),c===!1&&_.push("Not staged"),i===!0&&_.push("Verified posted"),i===!1&&_.push("Not verified as posted"),d===!0&&_.push("In-page banner"),d===!1&&_.push("No banner"),{kind:S,message:p,reason:o,body:r,postUrl:l,prepared:c,bannerShown:d,verified:i,matchPreview:x,matchAuthor:h,chips:_}}const Oe="inline-flex max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs";function st({peer:e,ownerSlug:n,orgContext:s}){const a=At();if(e.url&&!e.self&&e.type){const o=vn(e.url);return o?t.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:Z(Oe,"hover:bg-muted"),title:e.type,onClick:l=>l.stopPropagation(),children:t.jsx("span",{className:"truncate",children:e.name})}):t.jsx("span",{className:Z(Oe,"text-muted-foreground"),children:e.name})}if(e.self||!e.type||!a)return t.jsx("span",{className:Z(Oe,"text-muted-foreground"),children:e.name});const r=a.item?.recordPeer?.entityId===e.id;return t.jsx("button",{type:"button","aria-pressed":r,title:e.type,className:Z(Oe,"hover:bg-muted",r&&"ring-1 ring-primary"),onClick:o=>{o.stopPropagation(),a.open(_s({...typeof e.id=="number"?{entityId:e.id}:{record:{type:e.type,key:e.id}},ownerSlug:n,orgContext:s,name:e.name}))},children:t.jsx("span",{className:"truncate",children:e.name})})}function ra(e,n=e.relationship_type_name){const s=e.from_entity_name??`Record #${e.from_entity_id}`,a=e.to_entity_name??`Record #${e.to_entity_id}`;return e.is_symmetric?`${s} ${n} ${a}`:`${s} → ${n} → ${a}`}function aa({row:e,entityId:n,entityType:s,ownerSlug:a,orgContext:r,label:o=e.relationship_type_name}){const l=(c,i,d,p)=>t.jsx(st,{peer:{id:c,name:i??`Record #${c}`,type:d,url:p,self:!p&&c===n&&(typeof c=="number"||d===s)},ownerSlug:a,orgContext:r});return t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-xs",children:[l(e.from_entity_id,e.from_entity_name,e.from_entity_type,e.from_entity_url),!e.is_symmetric&&t.jsx(jt,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground",children:o}),!e.is_symmetric&&t.jsx(jt,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),l(e.to_entity_id,e.to_entity_name,e.to_entity_type,e.to_entity_url)]})}function ia({count:e,onRetry:n}){return e?t.jsxs("p",{role:"status",className:"text-xs text-muted-foreground",children:["Some linked records could not be read."," ",t.jsx("button",{type:"button",className:"underline",onClick:n,children:"Retry"})]}):null}const Bt={name:"Name",slug:"URL slug",parent_id:"Parent",content:"Content changed"};function ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fe(e){return e==null||e===""}function Os(e,n){return Ze(e??null)===Ze(n??null)}function Fs(e){return!!(e?.type==="array"&&(e.items?.type==="object"||e.items?.properties))}function Ms(e){return!!(e&&(e.type==="object"||e.properties)&&e.type!=="array")}function dt(e,n){return bs({key:e,prop:n??{}})}function Ds(e,n){return e?.properties?.[n]}function rt(e,n,s,a,r){if(Os(n,s))return;const o=i=>Array.isArray(i)?i:[];if((Array.isArray(n)||Fe(n))&&(Array.isArray(s)||Fe(s))&&(Array.isArray(n)||Array.isArray(s)||a?.type==="array")){const i=o(n),d=o(s);if(Fs(a)||[...i,...d].some(g=>ie(g))){const g=Math.min(i.length,d.length);for(let C=0;C<g;C++)rt([...e,`item ${C+1}`],i[C],d[C],a?.items,r);const R=Math.max(0,d.length-i.length),q=Math.max(0,i.length-d.length);(R||q)&&r.push({kind:"items",path:e,added:R,removed:q});return}const u=g=>Ze(g),x=new Set(i.map(u)),h=new Set(d.map(u)),S=d.filter(g=>!x.has(u(g))),_=i.filter(g=>!h.has(u(g)));r.push(S.length||_.length?{kind:"values",path:e,added:S,removed:_,prop:a?.items}:{kind:"reordered",path:e});return}if((ie(n)||Fe(n))&&(ie(s)||Fe(s))&&(ie(n)||ie(s)||Ms(a))){const i=ie(n)?n:{},d=ie(s)?s:{},p=[...new Set([...Object.keys(a?.properties??{}),...Object.keys(i),...Object.keys(d)])];for(const u of p){const x=Ds(a,u);rt([...e,dt(u,x)],i[u],d[u],x,r)}return}r.push({kind:"set",path:e,old:n,new:s,prop:a})}function Ls(e,n){const s=Bt[e.field];if(s)return e.field==="content"?[{kind:"note",path:[s]}]:e.field==="parent_id"?[{kind:"parent",path:[s],old:e.old,new:e.new}]:[{kind:"set",path:[s],old:e.old,new:e.new}];const a=n?.properties?.[e.field],r=[];return rt([dt(e.field,a)],e.old,e.new,a,r),r}function Bs(e,n){const s=n?.properties;return e.map(a=>a.field==="content"?"Content":Bt[a.field]??dt(a.field,s?.[a.field]))}const zs="entity.updated",Vs=new Set(["link","unlink","update_link"]);function Nt(e){const n=typeof e=="string"||typeof e=="number"?Number(e):Number.NaN;return Number.isSafeInteger(n)&&n>0?n:null}function Us(e){const n=e.split("_").join(" ").trim();return n?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:e}function qs(e){const n=e.metadata;if(e.semantic_type!=="change"||!n||n._lobu_relationship_change!==!0||typeof n.op!="string"||!Vs.has(n.op))return null;const s=Nt(n.fromEntityId),a=Nt(n.toEntityId);if(s==null||a==null)return null;const r=typeof n.relationshipTypeSlug=="string"?n.relationshipTypeSlug:null,o=Array.isArray(n.changes)?n.changes:[];return{op:n.op,fromId:s,toId:a,typeLabel:r?Us(r):"relationship",changedFields:o.flatMap(l=>l&&typeof l=="object"&&typeof l.field=="string"?[l.field]:[])}}function Be({id:e,recordId:n,ownerSlug:s}){const a=e===n,r={slug:s},{data:o,isLoading:l,isError:c}=St(a?void 0:e,r);return a?t.jsx(st,{peer:{id:e,name:"this record",type:null,self:!0},ownerSlug:s,orgContext:r}):l?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Record #",e]}):c||!o?t.jsx("span",{className:"text-xs text-muted-foreground",title:"Deleted, or you do not have access to it",children:"Unavailable record"}):t.jsx(st,{peer:{id:e,name:o.name,type:o.entity_type},ownerSlug:s,orgContext:r})}function Ks({change:e,recordId:n,ownerSlug:s}){const a=e.op==="link"?`Linked as ${e.typeLabel}`:e.op==="unlink"?`Unlinked ${e.typeLabel}`:`Updated ${e.typeLabel} link`,r=n===e.toId&&n!==e.fromId,o=n===e.fromId;return t.jsxs("span",{"data-testid":"relationship-change",className:"inline-flex flex-wrap items-center gap-1.5",children:[!o&&!r?t.jsx(Be,{id:e.fromId,ownerSlug:s}):null,t.jsx("span",{children:r?`${a} from`:a}),r?t.jsx(Be,{id:e.fromId,recordId:n,ownerSlug:s}):t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:"→"}),t.jsx(Be,{id:e.toId,recordId:n,ownerSlug:s})]}),e.op==="update_link"&&e.changedFields.length>0?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",e.changedFields.join(", ")]}):null]})}function Qs(e){if(!Array.isArray(e)||e.length===0)return null;const n=[];for(const s of e){if(!s||typeof s!="object"||typeof s.field!="string")return null;const{field:a,old:r,new:o}=s;n.push({field:a,old:r??null,new:o??null})}return n}function Hs(e){const n=qs(e);if(n)return{kind:"relationship",change:n};const s=e.metadata;if(e.semantic_type!=="change"||!s)return null;const a=s._lobu_event_type;if(a!==zs&&(a!==void 0||s.category))return null;const r=Qs(s.changes);if(!r)return null;const o=e.entity_ids?.[0];return{kind:"fields",entityId:typeof o=="number"?o:null,changes:r}}function zt(e,n){const s={slug:n},{data:a}=St(e.entityType?void 0:e.entityId??void 0,s),{data:r}=jn(e.entityType??a?.entity_type??"",s);return r?.metadata_schema}const Js=4;function Me({value:e,prop:n}){return t.jsx("span",{className:"inline-block max-w-[18rem] truncate align-bottom",title:typeof e=="string"?e:void 0,children:t.jsx(Ns,{value:e,prop:n,empty:t.jsx("span",{className:"italic",children:"empty"})})})}function wt({id:e,ownerSlug:n}){const s=typeof e=="number"||typeof e=="string"?Number(e):Number.NaN;return Number.isSafeInteger(s)&&s>0?t.jsx(Be,{id:s,ownerSlug:n}):t.jsx("span",{className:"italic text-muted-foreground",children:"empty"})}function at(e,n){return`${e} ${n}${e===1?"":"s"}`}function Gs({line:e,ownerSlug:n}){const s=t.jsx("span",{className:"text-muted-foreground",children:e.path.join(" · ")});switch(e.kind){case"note":return s;case"set":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(Me,{value:e.old,prop:e.prop})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(Me,{value:e.new,prop:e.prop})]});case"parent":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(wt,{id:e.old,ownerSlug:n})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(wt,{id:e.new,ownerSlug:n})]});case"items":return t.jsxs(t.Fragment,{children:[s,":"," ",[e.added?`${at(e.added,"item")} added`:null,e.removed?`${at(e.removed,"item")} removed`:null].filter(Boolean).join(", ")]});case"values":return t.jsxs(t.Fragment,{children:[s,":",e.added.map((a,r)=>t.jsxs("span",{className:"ml-1.5",children:["+",t.jsx(Me,{value:a,prop:e.prop})]},`+${r}`)),e.removed.map((a,r)=>t.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["−",t.jsx(Me,{value:a,prop:e.prop})]},`-${r}`))]});case"reordered":return t.jsxs(t.Fragment,{children:[s,": reordered"]})}}function Ws({change:e,ownerSlug:n}){const s=zt(e,n);return t.jsxs(t.Fragment,{children:["Updated ",Bs(e.changes,s).join(", ")]})}function ct({changes:e,entityId:n,entityType:s,ownerSlug:a,showAll:r=!1}){const o=zt({entityId:n,entityType:s},a),[l,c]=y.useState(r),i=e.flatMap(u=>Ls(u,o)),d=l?i:i.slice(0,Js),p=i.length-d.length;return t.jsxs("ul",{"data-testid":"field-changes",className:"space-y-0.5 text-sm",children:[d.map((u,x)=>t.jsx("li",{className:"min-w-0 truncate",children:t.jsx(Gs,{line:u,ownerSlug:a})},x)),p>0?t.jsx("li",{children:t.jsxs("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:u=>{u.stopPropagation(),c(!0)},children:["+",at(p,"more change")]})}):null]})}function Ys({event:e,recordId:n,ownerSlug:s}){return e.kind==="relationship"?t.jsx(Ks,{change:e.change,recordId:n,ownerSlug:s}):t.jsx(Ws,{change:e,ownerSlug:s})}function Xs({event:e,ownerSlug:n}){return e.kind==="fields"?t.jsx(ct,{changes:e.changes,entityId:e.entityId,ownerSlug:n}):null}function Zs(e){return e.semantic_type==="change"&&(e.metadata?.category==="config"||e.metadata?.category==="deployment")}function oe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function er({content:e,detail:n=!1}){const s=e.metadata??{},a=e.payload_data??{},r=s.category==="deployment",o=typeof s.apply_id=="string"?s.apply_id:null,l=oe(a.manifest),c=o&&/^apl_[A-Za-z0-9-]{1,48}$/.test(o)&&e.origin_type==="deployment"&&e.origin_id===`deployment_${o}`&&(s.status==="succeeded"||s.status==="partial_failure")&&oe(l?.state);return t.jsxs("div",{className:"space-y-3","data-testid":"config-change-event",children:[t.jsx(ks,{showAttribution:n,operation:r?String(s.status??"Apply"):typeof s.op=="string"?s.op:null,actor:e.author_name??(typeof s.actor_source=="string"?s.actor_source:null),createdAt:e.occurred_at??e.created_at,resource:r?"Configuration apply":`${s.resource_kind??"Configuration"} · ${s.resource_id??""}`,changedFields:Array.isArray(s.changed_fields)?s.changed_fields.filter(i=>typeof i=="string"):void 0}),o?t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{className:"break-all",children:["Apply ",o]}),t.jsx(bt,{text:o,label:"Copy apply ID"})]}):null,n?r?t.jsxs(t.Fragment,{children:[typeof s.rollback_of=="string"?t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["Restores apply ",s.rollback_of]}):null,oe(s.counts)?t.jsx("dl",{className:"flex flex-wrap gap-4 text-xs",children:Object.entries(oe(s.counts)??{}).map(([i,d])=>t.jsxs("div",{children:[t.jsx("dt",{className:"text-muted-foreground",children:i}),t.jsx("dd",{children:String(d)})]},i))}):null,typeof a.error=="string"?t.jsx("p",{className:"text-sm text-destructive",children:a.error}):null,c?t.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Restore this deployment"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview restoring this saved configuration with the CLI. Secret values stay unchanged."}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"break-all text-xs",children:["lobu rollback ",o]}),t.jsx(bt,{text:`lobu rollback ${o}`,label:"restore command",iconOnly:!0})]})]}):null,t.jsx(Le,{before:null,after:l})]}):Object.hasOwn(a,"before")?t.jsx(Le,{before:oe(a.before),after:oe(a.state)}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"The earlier state was not recorded for this change."}),t.jsx(Le,{before:null,after:oe(a.state)})]}):null]})}var Ke="Tabs",[tr]=Rn(Ke,[It]),Vt=It(),[nr,ut]=tr(Ke),Ut=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,onValueChange:r,defaultValue:o,orientation:l="horizontal",dir:c,activationMode:i="automatic",...d}=e,p=wn(c),[u,x]=kn({prop:a,onChange:r,defaultProp:o??"",caller:Ke});return t.jsx(nr,{scope:s,baseId:Cn(),value:u,onValueChange:x,orientation:l,dir:p,activationMode:i,children:t.jsx(qe.div,{dir:p,"data-orientation":l,...d,ref:n})})});Ut.displayName=Ke;var qt="TabsList",Kt=y.forwardRef((e,n)=>{const{__scopeTabs:s,loop:a=!0,...r}=e,o=ut(qt,s),l=Vt(s);return t.jsx(Nn,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:a,children:t.jsx(qe.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:n})})});Kt.displayName=qt;var Qt="TabsTrigger",Ht=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,disabled:r=!1,...o}=e,l=ut(Qt,s),c=Vt(s),i=Wt(l.baseId,a),d=Yt(l.baseId,a),p=a===l.value;return t.jsx(bn,{asChild:!0,...c,focusable:!r,active:p,children:t.jsx(qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:i,...o,ref:n,onMouseDown:Je(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?l.onValueChange(a):u.preventDefault()}),onKeyDown:Je(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(a)}),onFocus:Je(e.onFocus,()=>{const u=l.activationMode!=="manual";!p&&!r&&u&&l.onValueChange(a)})})})});Ht.displayName=Qt;var Jt="TabsContent",Gt=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,forceMount:r,children:o,...l}=e,c=ut(Jt,s),i=Wt(c.baseId,a),d=Yt(c.baseId,a),p=a===c.value,u=y.useRef(p);return y.useEffect(()=>{const x=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(x)},[]),t.jsx(_n,{present:r||p,children:({present:x})=>t.jsx(qe.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":i,hidden:!x,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:u.current?"0s":void 0},children:x&&o})})});Gt.displayName=Jt;function Wt(e,n){return`${e}-trigger-${n}`}function Yt(e,n){return`${e}-content-${n}`}var sr=Ut,rr=Kt,ar=Ht,ir=Gt;function or({defaultValue:e,children:n}){return t.jsx(sr,{defaultValue:e,className:"space-y-4",children:n})}function lr({label:e="Views",children:n}){return t.jsx(rr,{"aria-label":e,className:"flex flex-wrap gap-1 border-b pb-2",children:n})}function dr({value:e,children:n}){return t.jsx(ar,{value:e,asChild:!0,children:t.jsx(T,{type:"button",variant:"ghost",size:"sm",className:"data-[state=active]:bg-secondary data-[state=active]:text-secondary-foreground",children:n})})}function cr({value:e,children:n}){return t.jsx(ir,{value:e,children:n})}function De(e,n){return typeof e=="string"&&e.trim().length>0&&e.length<=n}function mt(e,n){if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n;if(s.mode!=="live"||!De(s.workspace,128)||!/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/.test(s.workspace)||s.appearance!==void 0&&s.appearance!=="inline"&&s.appearance!=="row")return null;const a={mode:"live",workspace:s.workspace,appearance:s.appearance??"row"};return e==="automation-ref"?!De(s.automationId,128)||!/^[1-9][0-9]*$/.test(s.automationId)||!Number.isSafeInteger(Number(s.automationId))?null:{...a,automationId:s.automationId}:e==="connector-ref"?!De(s.connectorKey,128)||s.connectionId!==void 0&&(typeof s.connectionId!="number"||!Number.isSafeInteger(s.connectionId)||s.connectionId<=0)?null:{...a,connectorKey:s.connectorKey,...s.connectionId!==void 0?{connectionId:s.connectionId}:{}}:De(s.agentId,128)?{...a,agentId:s.agentId}:null}const ur=4,mr=128;let We=0;const we=[];async function pr(e,n){if(e.aborted)throw e.reason;await new Promise((s,a)=>{const r=()=>{const l=we.indexOf(o);l>=0&&we.splice(l,1),a(e.reason)},o=()=>{e.removeEventListener("abort",r),We++,s()};We<ur?o():we.length>=mr?a(new Error("Reference read capacity exceeded")):(we.push(o),e.addEventListener("abort",r,{once:!0}))});try{if(e.aborted)throw e.reason;return await n()}finally{We--,we.shift()?.()}}const Ve={retry:!1,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchOnReconnect:"always"};function me({error:e}){const n=e instanceof ue&&(e.status===401||e.status===403)?"Access required to view this reference.":e instanceof ue&&e.status===404?"Reference not found.":"Reference unavailable.";return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:n})}function pt(){return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:"Loading reference…"})}function fr({workspace:e,automationId:n,appearance:s}){const{session:a,isReady:r}=ot(),o=lt(),l=ze({...Ve,enabled:r&&!o,queryKey:["automations-list",e,"native-reference",a?.user.id??null,n],queryFn:({signal:i})=>pr(i,async()=>{let d;for(const u of["active","archived"])if(d=(await de("manage_automations",{action:"list",automation_id:n,status:u,include_details:!1,limit:1},{slug:e},{signal:i})).automations?.find(h=>h.automation_id===n),d)break;if(!d)throw new ue("Reference not found",404);const p=d.execution_config?.executor;return d={automation_id:d.automation_id,name:d.name,status:d.status,triggers:d.triggers,next_run_at:d.next_run_at,last_fired_at:d.last_fired_at,last_run_completed_at:d.last_run_completed_at,managed_agent_id:d.managed_agent_id,device_worker_id:d.device_worker_id,health:d.health,health_reasons:d.health_reasons,processing_client_count:d.processing_client_count,execution_config:p&&typeof p=="object"?{executor:{kind:p.kind}}:void 0},d})});if(o)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(l.isPending||l.isFetching)return t.jsx(pt,{});if(l.error||!l.data)return t.jsx(me,{error:l.error});const c=l.data;return t.jsx(Rs,{automation:As(c),owner:e,agentName:c.managed_agent_id??null,deviceLabel:c.device_worker_id?"Device-pinned":null,connectorDisplay:null,appearance:s,rowClass:"flex items-center gap-3 rounded-lg border px-3 py-2.5"})}function xr({workspace:e,connectorKey:n,connectionId:s,appearance:a}){const{session:r,isReady:o}=ot(),l=lt(),c=ze({...Ve,enabled:o&&!l,queryKey:["connector-definitions",e,"native-reference",r?.user.id??null],queryFn:async({signal:x})=>(await Sn({slug:e},{signal:x})).map(h=>({key:h.key,name:h.name,description:h.description,icon:h.icon}))}),i=ze({...Ve,enabled:o&&!l&&s!==void 0,queryKey:["connections",e,"native-reference",r?.user.id??null,n,s??null],queryFn:async({signal:x})=>{const h=s===void 0?void 0:(await de("manage_connections",{action:"list",connection_ids:[s],connector_key:n,limit:1},{slug:e},{signal:x})).connections?.find(S=>S.id===s);if(s!==void 0&&(!h||h.id!==s||h.connector_key!==n))throw new ue("Reference not found",404);return{connection:h?{id:h.id,connector_key:h.connector_key,display_name:h.display_name,connector_name:h.connector_name,auth_profile_name:h.auth_profile_name,auth_profile_slug:h.auth_profile_slug}:void 0}}});if(l)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(c.isPending||c.isFetching||s!==void 0&&(i.isPending||i.isFetching))return t.jsx(pt,{});if(c.error||s!==void 0&&(i.error||!i.data))return t.jsx(me,{error:c.error||i.error});const d=c.data?.find(x=>x.key===n);if(!d)return t.jsx(me,{error:new ue("Reference not found",404)});const p=i.data?.connection,u=t.jsx(An,{connector:d,showDescription:a!=="inline"});return t.jsx("div",{className:a==="inline"?"inline-flex items-center gap-2":"rounded-lg border p-3",children:p?t.jsxs(ee,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:n,connectionId:String(p.id)},search:{},children:[u,t.jsx("span",{className:"text-xs text-muted-foreground",children:Ss(p)})]}):t.jsx(ee,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:n},children:u})})}function hr({workspace:e,agentId:n,appearance:s}){const{session:a,isReady:r}=ot(),o=lt(),l=ze({...Ve,enabled:r&&!o,queryKey:["agents",e,"native-reference",a?.user.id??null,n],queryFn:async({signal:i})=>{const d=await de("manage_agents",{action:"get",agent_id:n},{slug:e},{signal:i});if(d.agent?.id!==n)throw new ue("Reference not found",404);return{id:d.agent.id,name:d.agent.name,description:d.agent.description}}});if(o)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(l.isPending||l.isFetching)return t.jsx(pt,{});if(l.error||!l.data)return t.jsx(me,{error:l.error});const c=l.data;return t.jsx(Cs,{owner:e,appearance:s,last:!0,item:{kind:"managed",key:c.id,agent:{agentId:c.id,name:c.name,description:c.description??void 0}}})}function yr(e){const n=mt("automation-ref",e);return n?t.jsx(fr,{...n}):t.jsx(me,{})}function gr(e){const n=mt("connector-ref",e);return n?t.jsx(xr,{...n}):t.jsx(me,{})}function vr(e){const n=mt("agent-ref",e);return n?t.jsx(hr,{...n}):t.jsx(me,{})}const Ye=e=>typeof e=="string"&&e.trim().length>0&&e.length<=128,jr={tabs:({defaultValue:e,children:n})=>Ye(e)?t.jsx(or,{defaultValue:e,children:n}):null,"tabs-list":({label:e,children:n})=>t.jsx(lr,{label:typeof e=="string"&&e.length<=200?e:void 0,children:n}),"tabs-trigger":({value:e,children:n})=>Ye(e)?t.jsx(dr,{value:e,children:n}):null,"tabs-content":({value:e,children:n})=>Ye(e)?t.jsx(cr,{value:e,children:n}):null,"automation-ref":yr,"connector-ref":gr,"agent-ref":vr,"json-diff":(({before:e,after:n})=>{const s=a=>a!==null&&typeof a=="object"&&!Array.isArray(a)?a:null;return t.jsx(Le,{before:s(e),after:s(n)})})};function ke(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _r({template:e,data:n,onAction:s}){const[a,r]=y.useState(null),[o,l]=y.useState(!1),[c,i]=y.useState(null),[d,p]=y.useState(!1),u=y.useRef(!1),x=y.useRef(!0);y.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const h=async S=>{if(!(!s||u.current)){u.current=!0,l(!0),i(null),p(!1);try{const _=await s(S);if(!x.current)return;if(ke(_)&&_.kind==="sdk"){const g=_.result;if(!ke(g)||g.success!==!0){const R=ke(g)&&ke(g.error)?g.error.message:null;throw new Error(typeof R=="string"?R:"Could not update this event.")}if(g.return_truncated||!ke(g.return_value))throw new Error("The update did not return a complete data object.");r(g.return_value),p(!0)}}catch(_){x.current&&i(_ instanceof Error?_.message:"Could not update this event.")}finally{u.current=!1,x.current&&l(!1)}}};return t.jsxs("div",{className:"space-y-2",children:[o?t.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Updating…"}):null,d?t.jsx("p",{role:"status",className:"sr-only",children:"Updated"}):null,c?t.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:[c," Previous data is still shown."]}):null,t.jsx("div",{"aria-busy":o,className:"min-w-0",children:t.jsx(ws,{template:{root:e.root},data:a??n,onAction:s?h:void 0,interactions:e.interactions,components:jr,actionsDisabled:!s||o})})]})}function Xt(e){return{audit:e.semantic_type==="audit"&&e.origin_type==="tool_invocation",operation:e.interaction_type==="approval"||e.semantic_type==="operation",changeSet:e.semantic_type==="change_set"}}const br={};function ve(e){return e.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}const Nr={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function wr(e){return e.author_name?e.author_name:e.platform?ve(e.platform):e.origin_type?Nr[e.origin_type]??ve(e.origin_type):null}function kr(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):Array.isArray(e)?e.length===0?"":e.every(n=>typeof n!="object")?e.map(n=>String(n)).join(", "):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)})}const Xe=1e5;function kt({value:e}){const n=JSON.stringify(e,null,2)??"null",s=n.length>Xe;return t.jsxs(t.Fragment,{children:[t.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?n.slice(0,Xe):n}),s&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",Xe.toLocaleString()," of"," ",n.length.toLocaleString()," characters."]})]})}function Cr(e){return Object.entries(e).filter(([,n])=>n==null?!1:typeof n=="string"?n.trim().length>0:Array.isArray(n)?n.length>0:typeof n=="object"?Object.keys(n).length>0:!0).sort(([n],[s])=>n.localeCompare(s))}function Rr({breakdown:e}){if(!e)return null;const n=[{label:"Engagement",value:e.engagement,max:100},{label:"Criticality",value:e.criticality,max:100},{label:"Depth",value:e.depth,max:100},{label:"Authority",value:e.authority,max:100},{label:"Recency",value:e.recency,max:100},{label:"Quality",value:e.quality,max:100}];return t.jsx("div",{className:"space-y-2 text-sm",children:n.map(s=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),t.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),t.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function Ar({slug:e,value:n,isManual:s}){return t.jsxs(le,{variant:"secondary",className:"text-xs",children:[e,": ",n,s&&t.jsx(Et,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Sr(e){if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.values))return{values:n.values.map(s=>String(s)).filter(s=>s.length>0),isManual:n.is_manual===!0};if(n.value!==void 0&&n.value!==null)return{values:[String(n.value)],isManual:n.is_manual===!0};if(typeof n.values=="string"&&n.values.length>0)return{values:[n.values],isManual:n.is_manual===!0}}return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?{values:[String(e)],isManual:!1}:{values:[],isManual:!1}}function Zt(e,n){if(e)switch(e){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return e}return n||"pending_approval"}function it(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Ir(e){return e.replace(/\s+[—-]\s+pending approval$/i,"")}function Ue(e){return e.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}function Tr(e){const n=Object.keys(e.fields),s=n.map(Ue).join(", ")||"field",a=n.length===1?"field":"fields";return`Update ${e.entityType?Ue(e.entityType).toLowerCase():"entity"} ${a}: ${s}`}function Er(e,n){const s=it(n.fields);if(!s||Object.keys(s).length===0||n.action_key!=="entity_field_change"&&n.tool!=="entity_field_change")return null;const a=it(n.current)??{},r=e;return{fields:s,current:a,reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function $r(e){const n=e.entityType?Ue(e.entityType).toLowerCase():"entity";return`${Ue(e.operation)} ${n}`}function Pr(e,n){if(n.action_key!=="entity_change"&&n.tool!=="entity_change")return null;const s=n.action;if(s!=="create"&&s!=="delete"&&s!=="link"&&s!=="unlink")return null;const a=e;return{operation:s,proposal:it(n.proposal),reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??a.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,proposerRationale:typeof n.proposer_rationale=="string"?n.proposer_rationale:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function Or(e,n){return!n.entityType||!n.entitySlug?null:gs(e,n.parentEntityType&&n.parentSlug?[{entity_type:n.parentEntityType,slug:n.parentSlug},{entity_type:n.entityType,slug:n.entitySlug}]:[{entity_type:n.entityType,slug:n.entitySlug}])}function en({ownerSlug:e,runId:n,details:s}){const r=Ft(s.automationId,void 0,void 0,{ownerSlug:e,includeVersions:!1}).data?.automation,o=js(s.initiator,s.attribution,s.automationId),l=r?.automation_name??s.automationName??o;return t.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",s.automationId?t.jsx(ee,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:s.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:l}):t.jsx("span",{className:"font-medium text-foreground",children:l}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:" · "}),t.jsxs(ee,{to:"/$owner/events",params:{owner:e},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",n]})]})]})}function tn({ownerSlug:e,details:n}){const s=Or(e,n);return n.entityName?t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),t.jsx("div",{className:"mt-1 text-sm font-medium",children:s?t.jsx(ee,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function Fr({ownerSlug:e,runId:n,details:s}){return t.jsxs("div",{className:"space-y-3",children:[t.jsx(en,{ownerSlug:e,runId:n,details:s}),t.jsx(tn,{ownerSlug:e,details:s}),t.jsx("div",{className:"rounded-md border border-border/70 px-3 py-2",children:t.jsx(ct,{changes:Object.entries(s.fields).map(([a,r])=>({field:a,old:s.current[a]??null,new:r??null})),entityType:s.entityType,ownerSlug:e,showAll:!0})}),s.reason&&t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function Mr({ownerSlug:e,runId:n,details:s,status:a}){const{operation:r}=s,o=r==="link"||r==="unlink";return t.jsxs("div",{className:"space-y-3",children:[t.jsx(en,{ownerSlug:e,runId:n,details:s}),!o&&t.jsx(tn,{ownerSlug:e,details:s}),t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Change"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:o?Dt(r,a):r==="create"?"Create a new entity after approval.":"Delete this entity after approval."}),o&&t.jsxs("div",{className:"mt-2 space-y-1 text-sm",children:[Mt(s.proposal).map((l,c)=>t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:c===0?"From: ":"To: "}),l.name]},l.id)),t.jsxs("div",{className:"text-muted-foreground",children:["Relationship:"," ",String(s.proposal?.relationship_type??s.proposal?.relationship_type_slug??"Relationship")]})]})]}),!o&&s.proposal&&t.jsxs("div",{className:"rounded-lg border border-border/70 p-3",children:[t.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Proposal"}),t.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(s.proposal,null,2)})]}),s.proposerRationale&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.proposerRationale})]}),s.reason&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Why this needs approval"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function Dr({summary:e}){return t.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[e.chips.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.chips.map(n=>t.jsx(le,{variant:"outline",className:"text-[10px] font-normal",children:n},n))}),e.message&&t.jsx("p",{className:"leading-relaxed text-foreground",children:e.message}),e.reason&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),t.jsx("div",{className:"mt-0.5 leading-relaxed",children:e.reason})]}),e.body&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e.kind==="verify"?"Expected comment":"Draft"}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:e.body})]}),e.matchPreview&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",e.matchAuthor?` · ${e.matchAuthor}`:""]}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:e.matchPreview})]}),e.postUrl&&t.jsxs("a",{href:e.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",t.jsx(Ot,{className:"h-3 w-3"})]})]})}function Lr({ownerSlug:e,content:n,batchReview:s}){const a=n.metadata||{},r=n.run_id??void 0,o=Er(n,a),l=Pr(n,a),c=(o?Tr(o):l?$r(l):void 0)||a.operation_name||a.action_name||(n.title?Ir(n.title):void 0)||"Action",i=a.connection_name,d=a.operation_key||a.action_key||null,p=n.interaction_input_schema||a.input_schema||null,u=y.useMemo(()=>n.interaction_input||a.action_input||a.operation_input||br,[n.interaction_input,a.action_input,a.operation_input]),x=n.interaction_output||a.action_output||void 0,h=Ps(u,x??null,d),S=n.interaction_error||a.error_message||void 0,_=Zt(n.interaction_status,a.status),g=a.reviewed_by_name||a.reviewed_by_id||void 0,R=a.reject_reason||void 0,q=a.initiator,C=as({slug:e}),M=is({slug:e}),D=os(n.id,ls(p,u),p),{values:F,setValues:$}=D,[N,B]=y.useState(null),[f,z]=y.useState(!1),[E,H]=y.useState(""),w=_==="pending_approval"&&N?N:_,A=w==="pending_approval",te=typeof a.source_run_id=="number";return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"h-4 w-4 text-yellow-500"}),t.jsx("span",{className:"font-medium",children:c}),i&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",i]}),w==="confirmed"&&t.jsx(le,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:"Approved"}),w==="completed"&&t.jsx(le,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),w==="failed"&&t.jsx(le,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),w==="rejected"&&t.jsx(le,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!o&&!l&&(n.author_name||g)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&t.jsxs("span",{children:["Requested by"," ",t.jsx(vs,{ownerSlug:e,initiator:q,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&g&&t.jsx("span",{children:"·"}),g&&t.jsxs("span",{children:[w==="rejected"?"Rejected":"Approved"," by"," ",t.jsx("span",{className:"font-medium text-foreground",children:g})]})]}),o&&t.jsx(Fr,{ownerSlug:e,runId:r,details:o}),!o&&l&&t.jsx(Mr,{ownerSlug:e,runId:r,details:l,status:w}),w==="rejected"&&R&&t.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",R]}),h&&t.jsx(Dr,{summary:h}),(A?D.revision:p)&&(A||Object.keys(u).length>0)&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:h?"Full input":"Input"}),A?t.jsxs(t.Fragment,{children:[t.jsx(ds,{visible:D.hasConflict,onReload:D.reset}),t.jsx(cs,{schema:D.revision,values:F,onValuesChange:$,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):h?t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),t.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(u,null,2)})]}):t.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(u,null,2)})]}),w==="completed"&&x&&Object.keys(x).length>0&&!h&&t.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[t.jsx(Pt,{className:"h-3.5 w-3.5"}),"Output"]}),t.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(x,null,2)})]}),w==="completed"&&x&&Object.keys(x).length>0&&h&&t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),t.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(x,null,2)})]}),w==="failed"&&S&&t.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[t.jsx($t,{className:"h-3.5 w-3.5"}),"Error"]}),t.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:S})]}),A&&!N&&te&&t.jsxs("div",{className:"pt-1 text-xs text-muted-foreground",children:["Review this proposal with the other changes in its Automation run.",s]}),A&&r&&!N&&!te&&t.jsx("div",{className:"flex items-center gap-2 pt-1",children:f?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"Reason (optional)",value:E,onChange:I=>H(I.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(T,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>M.mutate({run_id:r,reason:E||void 0},{onSuccess:()=>{B("rejected")}}),disabled:M.isPending,children:[M.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),t.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{z(!1),H("")},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[t.jsxs(T,{size:"sm",className:"h-7 text-xs",onClick:()=>C.mutate({run_id:r,input:ms(F)},{onSuccess:()=>{B("confirmed")}}),disabled:!D.canSubmit||C.isPending||M.isPending,children:[C.isPending?t.jsx(ce,{size:"sm",className:"mr-1"}):t.jsx(us,{className:"h-3 w-3 mr-1"}),"Confirm"]}),t.jsxs(T,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>z(!0),disabled:C.isPending||M.isPending,children:[t.jsx(ps,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function Br({content:e,ownerSlug:n}){const s=e.metadata||{},a=s.kind,r=e.run_id??null,o=typeof s.automation_id=="number"?s.automation_id:null,i=Ft(o!=null?String(o):void 0,void 0,void 0,{includeVersions:!1,ownerSlug:n}).data?.automation?.automation_name??(o!=null?`Automation ${o}`:"An Automation"),d=ss({slug:n}),p=rs({slug:n}),[u,x]=y.useState(!1),[h,S]=y.useState(""),[_,g]=y.useState(null);if(a==="automation_batch_reject"){const f=s.reason||void 0;return t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),f&&t.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:f}),t.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const R=Array.isArray(s.changes)?s.changes:[],q=typeof s.created_count=="number"?s.created_count:R.filter(f=>f.kind==="created").length,C=typeof s.updated_count=="number"?s.updated_count:R.filter(f=>f.kind==="updated").length,M=typeof s.denied_count=="number"?s.denied_count:R.filter(f=>f.kind==="denied").length,D=R.filter(f=>f.kind==="denied"),F=R.filter(f=>f.kind==="updated"&&Object.keys(f.applied||{}).length>0),$=typeof s.pending_proposal_count=="number"?s.pending_proposal_count:null,N=$==null||$>0,B=N?"proposed":"applied";return t.jsxs("div",{className:"rounded-md border p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[t.jsxs("div",{className:"text-sm font-medium",children:[B==="proposed"?"Proposed":"Applied"," ",q," ","new + ",C," updated",M>0&&t.jsxs(t.Fragment,{children:[" + ",M," denied"]})]}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[o!=null?t.jsx(ee,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(o)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:i}):t.jsx("span",{className:"font-medium text-foreground",children:i}),r!=null&&t.jsxs("span",{children:[" · run #",r]}),$!=null&&$>0&&t.jsxs("span",{children:[" · ",$," pending"]})]})]}),F.length>0&&t.jsx("div",{className:"mt-3 space-y-2",children:F.map(f=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:f.name}),t.jsx(ct,{changes:Object.entries(f.applied).map(([z,E])=>({field:z,old:E.old??null,new:E.new??null})),entityId:f.entityId,ownerSlug:n,showAll:!0})]},f.entityId))}),D.length>0&&t.jsx("div",{className:"mt-3 space-y-1.5",children:D.map(f=>t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[t.jsxs("div",{className:"text-xs font-medium",children:[f.name," — not written"]}),f.denied&&t.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[f.denied.reason,t.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",f.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${f.entityId}-${f.name}`))}),r!=null&&_==null&&N&&t.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:u?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"What should the agent change?",value:h,onChange:f=>S(f.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(T,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>p.mutate({run_id:r,reason:h||void 0},{onSuccess:()=>g("rejected")}),disabled:p.isPending,children:[p.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Reject all"]}),t.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{x(!1),S("")},children:"Cancel"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(T,{size:"sm",className:"h-7 text-xs",onClick:()=>d.mutate({run_id:r},{onSuccess:()=>g("approved")}),disabled:d.isPending||p.isPending,children:[d.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),t.jsx(T,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>x(!0),disabled:d.isPending||p.isPending,children:"Reject with feedback"})]})}),_==="approved"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),_==="rejected"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&_==null&&!N&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function zr(e){if(!e)return;const n={};for(const[s,a]of Object.entries(e))s==="_lobu_idempotency_key"||s==="agent_id"||(n[s]=a);return Object.keys(n).length>0?n:void 0}function oa({presentation:e="summary",renderDetail:n,onFiltersChange:s,ownerSlug:a,content:r,isReply:o,showParentContext:l,connectorDefinitions:c,hideOriginator:i=!1,hideRunAction:d=!1,hideAttribution:p=!1,hideDetails:u=!1,recordId:x}){const[h,S]=y.useState(null),[_,g]=y.useState(!1),[R,q]=y.useState(!1),[C,M]=y.useState(!1),[D,F]=y.useState(!1),[$,N]=y.useState(!1),[B,f]=y.useState(null),[z,E]=y.useState(r.title??""),[H,w]=y.useState(r.text_content??""),A=Qn(),te=Hn(),I=e==="detail",V=At(),{currentOwner:Ce,allOrgs:pe,isAuthenticated:Re}=Jn(),G=a??Ce,v=G==="me"?null:G,Ae=y.useCallback(async m=>{if(!v){Pe.error("Open this event inside a workspace to interact with it.");return}const b=await Es(v,Number(r.id),m,crypto.randomUUID());return"event_id"in b&&Pe.success("Recorded"),b},[r.id,v]),U=r.payload_data??{},{audit:L,operation:ne,changeSet:W}=Xt(r),se=L&&(U.request!==void 0||U.request_status==="too_large"),fe=L&&Array.isArray(U.sdk_call_trace)&&U.sdk_call_trace.length>0,Y=G?et(G,Number(r.id)):null,K=Re&&v?(pe??[]).find(m=>m.slug===v):void 0,xe=I?void 0:K,je=r.semantic_type==="guidance",{isAdmin:Se,isLoading:_e}=Gn(je?K?.id:void 0),Q=xe?{slug:xe.slug,organizationId:xe.id}:null,Ie=Ct(Q??{slug:null,organizationId:null}),J=Q?.slug??null,Te=y.useMemo(()=>J&&!L?Rt(Ie.data??[],r.semantic_type):[],[J,L,Ie.data,r.semantic_type]),re=Wn(),X=Zs(r),ae=!!(!(ne||W||X)&&Q&&Te.length>0),ye=!I&&!_&&!!Y,j=_t(V?.item?.href.split(/[?#]/)[0]??""),k=j?.owner===G&&j?.eventId===Number(r.id),ge=(m,b,P)=>{V?V.open({href:m,title:b,...P==null?{}:{runId:P}}):A({to:m})},Ee=(m,b)=>{if(!v)return null;const P=`/${v}/events?run_ids=${m}`;return V?.item?.href===P?null:t.jsxs(T,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>s?s({runIds:[m]}):ge(P,"Run activity",m),title:s?"Filter by this run":"Open run activity",children:[t.jsx(ns,{className:"h-3.5 w-3.5"}),b]})},nn=r.run_id!=null&&(s||!(V&&v&&r.automation_id!=null))?Ee(r.run_id,s?"Run":"Open run"):null,be=Yn(r),Qe=r.automation_id,sn=V&&v&&be!=null&&Qe!=null?()=>V.open({href:`/${v}/automations/${Qe}?view=activity&run_id=${be}`,title:`${r.automation_name??`Automation ${Qe}`} · Run #${be}`,runId:be}):void 0,ft=()=>{if(ae&&Q&&v){const m=Number(r.id);Ts(re,Q.slug,Te,m).catch(()=>null).then(b=>ge(et(v,m,b?.key),r.title??"Event"));return}Y&&ge(Y,r.title??"Event")},xt=m=>{const b=m.target;if(!(b instanceof Element))return!1;const P=b.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return P!==null&&P!==m.currentTarget},rn=m=>{xt(m)||ft()},an=m=>{m.key!=="Enter"&&m.key!==" "||xt(m)||(m.preventDefault(),ft())},ht=r.metadata?.source_run_id,Ne=Hs(r),on=(!r.platform||r.platform==="lobu")&&r.connection_id==null&&r.feed_id==null&&r.origin_type==null&&r.automation_id==null&&!L&&!ne&&!W&&!X&&Ne==null&&r.semantic_type!=="tombstone"&&r.semantic_type!=="notification"&&r.metadata?.tombstone!==!0&&r.interaction_type!=="approval"&&r.interaction_status==null&&!r.is_superseded&&r.superseded_by==null,yt=!!(v&&K&&on&&(!je||!_e&&Se)),gt=yt&&r.payload_type!=="json_template"&&r.payload_type!=="media",vt=()=>{re.invalidateQueries({queryKey:[hs]}),re.invalidateQueries({queryKey:[ys]}),re.invalidateQueries({queryKey:["search-memory"]})},ln=async()=>{if(!(!v||!gt)){if(F(!1),f(null),r.payload_truncated){q(!0);try{const b=(await de("read_knowledge",{content_ids:[Number(r.id)]},{slug:v})).content?.find(P=>Number(P.id)===Number(r.id));E(b?.title??r.title??""),w(b?.text_content??b?.payload_text??r.text_content??""),g(!0)}catch(m){f(m instanceof Error?m.message:"Failed to load full memory.")}finally{q(!1)}return}E(r.title??""),w(r.text_content??""),g(!0)}},dn=async()=>{if(!v||C)return;if(!H.trim()){f("Memory content cannot be empty.");return}M(!0),f(null);try{const b=r.payload_type==="markdown"||r.payload_type==="text"?r.payload_type:"text",P=zr(r.metadata);await de("save_memory",{supersedes_event_id:Number(r.id),semantic_type:r.semantic_type||"note",payload_type:b,title:z.trim()||void 0,content:H,...Array.isArray(r.entity_ids)&&r.entity_ids.length>0?{entity_ids:r.entity_ids}:{},...r.source_url?{source_url:r.source_url}:{},...r.author_name?{author:r.author_name}:{},...r.occurred_at?{occurred_at:r.occurred_at}:{},...r.payload_data&&Object.keys(r.payload_data).length>0?{payload_data:r.payload_data}:{},...P?{metadata:P}:{}},{slug:v}),g(!1),vt(),Pe.success("Memory updated")}catch(b){f(b instanceof Error?b.message:"Failed to update memory.")}finally{M(!1)}},cn=async()=>{if(!(!v||$)){N(!0),f(null);try{const m=Number(r.id),b=await de("run_sdk",{title:"Delete memory",script:`export default async (_ctx, client) => client.knowledge.delete(${JSON.stringify({content_id:m,reason:"Deleted from web UI"})});`},{slug:v});if(b?.success===!1){const fn=typeof b.error=="string"?b.error:b.error?.message||"Failed to delete memory.";throw new Error(fn)}F(!1),k&&V?.close();const P=_t(te.pathname);P?.owner===v&&P.eventId===m&&A({to:"/$owner/events",params:{owner:v}}),vt(),Pe.success("Memory deleted")}catch(m){f(m instanceof Error?m.message:"Failed to delete memory.")}finally{N(!1)}}},un=yt&&!_?D?t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsxs(T,{type:"button",variant:"destructive",size:"sm",className:"h-7 px-2.5 text-xs",disabled:$,onClick:()=>void cn(),children:[$&&t.jsx(ce,{size:"xs",className:"mr-1.5"}),$?"Deleting...":"Delete"]}),t.jsx(T,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:$,onClick:()=>{F(!1),f(null)},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[gt&&t.jsxs(T,{type:"button",variant:"ghost",size:"sm","aria-label":"Edit memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",disabled:R||$,onClick:()=>void ln(),children:[R?t.jsx(ce,{size:"xs"}):t.jsx(fs,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:R?"Loading...":"Edit"})]}),t.jsxs(T,{type:"button",variant:"ghost",size:"sm","aria-label":"Delete memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-destructive",disabled:R,onClick:()=>{f(null),F(!0)},children:[t.jsx(xs,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"Delete"})]})]}):null,mn=_?t.jsxs("form",{className:"mt-2 space-y-3 rounded-lg border bg-background p-3 text-foreground",onSubmit:m=>{m.preventDefault(),dn()},children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{htmlFor:`memory-title-${r.id}`,className:"block text-xs font-medium text-muted-foreground",children:"Title"}),t.jsx(Xn,{id:`memory-title-${r.id}`,"aria-label":"Memory title",value:z,onChange:m=>E(m.target.value),placeholder:"Optional short summary",disabled:C})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("label",{htmlFor:`memory-content-${r.id}`,className:"block text-xs font-medium text-muted-foreground",children:["Content",t.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),t.jsx(Zn,{id:`memory-content-${r.id}`,"aria-label":"Memory content",value:H,onChange:m=>w(m.target.value),rows:5,disabled:C})]}),B&&t.jsx("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:B}),t.jsx(es,{onCancel:()=>{g(!1),f(null)},cancelDisabled:C,children:t.jsxs(T,{type:"submit",disabled:C||H.trim().length===0,children:[C&&t.jsx(ce,{size:"xs",className:"mr-1.5"}),C?"Saving...":"Save"]})})]}):null,pn=!_&&B?t.jsx("div",{role:"alert",className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:B}):null,He=X?t.jsx(er,{content:r,detail:I}):I&&v?W?t.jsx(Br,{content:r,ownerSlug:v}):ne?t.jsx(Lr,{ownerSlug:v,content:r,batchReview:typeof ht=="number"?Ee(ht,"Review run"):null}):void 0:void 0,$e=I&&n?n(He):{content:He,nativeHeading:He!=null};return t.jsx("div",{className:Z(o?"border-l-2 border-l-muted pl-4":"",ye&&"cursor-pointer rounded-lg p-3 transition-colors hover:bg-accent/40",ye&&k&&"bg-accent ring-1 ring-inset ring-primary/20"),...ye?{role:"button","aria-current":k?"true":void 0,tabIndex:0,onClick:rn,onKeyDown:an}:{},children:t.jsx(qr,{primaryContent:$e.content,nativeHeading:$e.nativeHeading,heading:Ne&&v?t.jsx(Ys,{event:Ne,recordId:x,ownerSlug:v}):void 0,body:mn??(Ne&&v?t.jsx(Xs,{event:Ne,ownerSlug:v}):void 0),detailLinks:$e.links,headingAside:$e.headingAside,hideDetails:u,onFiltersChange:s,presentation:e,content:r,ownerSlug:G??void 0,showParentContext:l,connectorDefinitions:c,onRenderedAction:v?Ae:void 0,runAction:d?null:nn,memoryActions:un,memoryFeedback:pn,hideOriginator:i,hideAttribution:p,runId:be??r.run_id??null,onRunSelect:sn,auditDetails:I&&(se||fe)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"request",label:"Request",available:se},{key:"calls",label:"SDK calls",available:fe}].map(m=>m.available?t.jsxs(T,{variant:"outline",size:"sm","aria-expanded":h===m.key,onClick:()=>S(b=>b===m.key?null:m.key),children:[h===m.key?t.jsx(tt,{className:"h-3.5 w-3.5"}):t.jsx(nt,{className:"h-3.5 w-3.5"}),m.label]},m.key):null)}),h==="request"&&(U.request_status==="too_large"?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof U.request_bytes=="number"?` (${U.request_bytes.toLocaleString()} bytes).`:"."]}):t.jsx(kt,{value:U.request})),h==="calls"&&t.jsx(kt,{value:U.sdk_call_trace})]})})})}function Vr(e,n){const s=e.payload_data??{},a=e.metadata??{};if(n.audit&&typeof s.success=="boolean")return s.success?"completed":"failed";if(n.changeSet)return a.kind==="automation_batch_reject"?"rejected":typeof a.pending_proposal_count!="number"?void 0:a.pending_proposal_count>0?"pending_approval":"completed";if(n.operation)return Zt(e.interaction_status,typeof a.status=="string"?a.status:void 0)}function Ur(e){return e==="pending_approval"?"Needs approval":e==="confirmed"?"Approved":e?ve(e):null}function qr({presentation:e,primaryContent:n,nativeHeading:s=!1,heading:a,body:r,detailLinks:o,headingAside:l,onFiltersChange:c,content:i,ownerSlug:d,showParentContext:p,connectorDefinitions:u,onRenderedAction:x,runAction:h,memoryActions:S,memoryFeedback:_,auditDetails:g,hideOriginator:R=!1,hideAttribution:q=!1,runId:C,onRunSelect:M,hideDetails:D=!1}){const[F,$]=y.useState(!1),N=i.metadata??{},B=typeof i.score=="number"&&Number.isFinite(i.score)?Math.round(i.score):"-",f=i.payload_type||"text",z=i.text_content||"",E=e==="summary",H=e==null&&(f==="text"||f==="markdown")&&z.length>500,w=H&&!F?`${z.slice(0,500)}...`:z,A=i.payload_data??{},te=Xt(i),{audit:I,operation:V,changeSet:Ce}=te,pe=Vr(i,te),Re=Ur(pe),G=(I?Is(A,A.tool_name):null)??(E&&I&&typeof A.tool_name=="string"?ve(A.tool_name):i.title),v=I&&A.error&&typeof A.error=="object"?A.error.message:void 0,Ae=(typeof v=="string"?v:void 0)??i.interaction_error??(typeof N.error_message=="string"?N.error_message:void 0),U=Ae||(I?"":z),[L,ne]=y.useState(e!=="summary"&&I&&n==null&&o==null),W=I?A.duration_ms:N.duration_ms,se=typeof W=="number"&&Number.isFinite(W)&&W>=0?W:null,fe=I&&typeof A.sdk_call_count=="number"&&Number.isSafeInteger(A.sdk_call_count)&&A.sdk_call_count>=0?A.sdk_call_count:null,Y=N.thumbnail_url||N.thumbnail,K=N.media_url,xe=E?[]:Cr(N),je=Object.entries(i.classifications||{}).flatMap(([j,k])=>{const ge=Sr(k);return ge.values.map(Ee=>({slug:j,value:Ee,isManual:ge.isManual}))}),Se=(()=>{const j=i.platform||(typeof N.platform=="string"?N.platform:null),k=i.connection_id!=null?i.connection_id:N.source_connection_id!=null?Number(N.source_connection_id):null;return{...i,platform:j,connection_id:k!=null&&Number.isFinite(k)?k:null}})(),_e=(()=>{const j=i.source_url??N.browser_url;if(typeof j!="string"||!URL.canParse(j))return null;const k=new URL(j);return k.protocol==="https:"||k.protocol==="http:"?k:null})(),Q=i.occurred_at?new Date(i.occurred_at):null,Ie=I?In:V?Tt:Ce?Tn:i.semantic_type==="notification"?En:$n,J=I?"SDK call":ve(i.semantic_type||i.origin_type||"Event"),Te=t.jsx(ts,{source:Se,connectorDefinitions:u,sourceUrl:_e,label:J,fallback:t.jsx(Ie,{className:"h-4 w-4"})}),re=xe.length>0?t.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:xe.map(([j,k])=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:ve(j)}),t.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:kr(k)})]},j))}):null,X=r?t.jsx("div",{className:"mt-1",children:r}):E?U?t.jsx("p",{className:Z("line-clamp-2 text-sm whitespace-pre-wrap",Ae&&"text-destructive"),children:U.slice(0,320)}):null:t.jsxs(t.Fragment,{children:[i.rating&&t.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(j=>t.jsx(Et,{className:`h-4 w-4 ${j<=Number(i.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},j))}),Y&&t.jsx("a",{href:K||i.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:t.jsx("img",{src:Y,alt:"",className:`rounded-md object-cover ${f==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(f){case"markdown":if(w)return t.jsx("div",{className:"max-w-none text-sm space-y-2",children:t.jsx(Pn,{text:w})});break;case"json_template":{const j=i.payload_data;if(j?._truncated===!0&&typeof j.bytes=="number")return t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsx("p",{role:"status",children:"This report is too large for the feed preview. Open the full event to view its complete data."}),d?t.jsx(ee,{to:et(d,Number(i.id)),className:"underline underline-offset-4",children:"Open full report"}):null]});const k=i.payload_template;if(k?.root)return t.jsx(_r,{template:k,data:i.payload_data||{},onAction:n?void 0:x},`${d}:${i.id}`);if(w)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:w});break}case"media":return t.jsxs("div",{className:"space-y-3",children:[!Y&&K&&t.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:K}),w&&t.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:w})]});case"empty":return t.jsxs("div",{className:"space-y-3",children:[g,re??(g?null:t.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"}))]});default:if(w)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:w});break}return t.jsxs("div",{className:"space-y-3",children:[K&&!Y&&t.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:K}),re]})})()]}),he=n!=null||e==="detail"&&I,ae=l!==void 0,ye=he||o!=null;return y.useEffect(()=>{if(!ae||!L)return;const j=k=>{k.key==="Escape"&&(k.preventDefault(),ne(!1))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[ae,L]),t.jsxs(t.Fragment,{children:[p&&i.parent_context&&t.jsxs("div",{className:"mb-3 p-2 bg-muted/50 rounded-md text-sm",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Replying to:"}),t.jsx("div",{className:"font-medium",children:i.parent_context.author_name}),t.jsx("div",{className:"text-muted-foreground line-clamp-2",children:i.parent_context.text_content})]}),t.jsxs("div",{className:Z("flex gap-3",e==="detail"&&"mb-5",ae&&"relative"),children:[t.jsx(On,{children:Te}),t.jsxs("div",{className:"min-w-0 flex-1",children:[e==="detail"&&(()=>{const j={semanticTypes:[i.semantic_type],...typeof i.automation_id=="number"?{producedByAutomationId:i.automation_id}:{},...typeof i.run_id=="number"?{runIds:[i.run_id]}:{}},k={semantic_types:i.semantic_type,...typeof i.automation_id=="number"?{produced_by:String(i.automation_id)}:{},...typeof i.run_id=="number"?{run_ids:String(i.run_id)}:{}};return t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.semantic_type?c?t.jsx("button",{type:"button",className:"hover:underline",title:`Show all ${J} events`,onClick:()=>c(j),children:J}):d?t.jsx(ee,{to:"/$owner/events",params:{owner:d},search:k,className:"hover:underline",title:`Show all ${J} events`,children:J}):t.jsx("span",{children:J}):t.jsx("span",{children:J}),Q&&t.jsx("time",{dateTime:Q.toISOString(),children:Fn(Q)})]})})(),t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[(a??G)&&!s&&t.jsx("h4",{className:Z("min-w-0 font-medium",e==="detail"?"text-xl leading-snug":"line-clamp-2 text-sm"),children:a??G}),e!=="detail"&&Q&&t.jsx(Mn,{at:Q}),ae&&t.jsxs("div",{className:"flex shrink-0 items-center gap-1 pt-0.5",children:[l,ye&&t.jsxs(T,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-muted-foreground hover:text-foreground","aria-expanded":L,onClick:()=>ne(j=>!j),children:["Details",L?t.jsx(tt,{className:"h-3.5 w-3.5"}):t.jsx(nt,{className:"h-3.5 w-3.5"})]})]})]}),E&&t.jsx("div",{className:"mt-1 text-muted-foreground",children:X}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[Re&&!s&&t.jsxs(le,{variant:pe==="failed"?"destructive":"secondary",className:"gap-1 text-xs",children:[pe==="failed"?t.jsx($t,{className:"h-3 w-3"}):pe==="completed"?t.jsx(Pt,{className:"h-3 w-3"}):null,Re]}),fe!=null&&t.jsxs("span",{children:[fe," SDK ",fe===1?"call":"calls"]}),se!=null&&t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(Dn,{className:"h-3 w-3"}),se<1e3?`${Math.round(se)}ms`:`${Number((se/1e3).toFixed(2))}s`]}),h,B==="-"||E&&(I||V||Ce)?null:i.score_breakdown?t.jsxs(Ln,{children:[t.jsx(Bn,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"sm",className:"h-7 px-2",children:t.jsx("span",{className:"font-medium",children:B})})}),t.jsx(zn,{className:"w-64",align:"end",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),t.jsx(Rr,{breakdown:i.score_breakdown})]})})]}):null,_e&&t.jsxs(Vn,{children:[t.jsx(Un,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1",asChild:!0,children:t.jsxs("a",{href:_e.href,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(Ot,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:E?"sr-only":void 0,children:"View original"})]})})}),t.jsx(qn,{children:"View original"})]}),S]}),_,d&&!q&&t.jsx(Kn,{owner:d,source:Se,connectorDefinitions:u,onFiltersChange:c,variant:"chips",className:"mt-2 text-xs",hideOriginator:R,runId:C,onRunSelect:M}),(i.author_name||!d)&&!(e==="detail"&&V)&&t.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:i.author_name||wr(i)})]}),ae&&L&&ye&&t.jsxs("div",{className:"absolute inset-x-0 top-full z-20 mt-2 max-h-[65vh] space-y-3 overflow-y-auto rounded-lg border bg-background p-3 shadow-lg",children:[o,he&&X]})]}),!E&&typeof v=="string"&&t.jsx("p",{className:"mb-2 text-sm whitespace-pre-wrap text-destructive",children:v}),n,!E&&!he&&X,(he||o!=null)&&l===void 0&&!(D&&n!=null)&&t.jsxs("details",{className:"mt-5 border-t pt-3",open:L,onToggle:j=>ne(j.currentTarget.open),children:[t.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground",children:"Details"}),L&&t.jsxs("div",{className:"mt-3 space-y-3",children:[o,he&&X]})]}),H&&t.jsx(T,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>$(!F),children:F?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"h-3 w-3 mr-1"})," Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(nt,{className:"h-3 w-3 mr-1"})," Show more"]})}),je.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:je.map(j=>t.jsx(Ar,{slug:j.slug,value:j.value||"",isManual:j.isManual},j.slug))})]})}export{oa as E,ia as R,qr as a,aa as b,na as c,ra as r,ve as s,Is as t,sa as u};
|
|
2
|
+
//# sourceMappingURL=event-card-DVUB8my6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{q as G,a1 as I,r as D,gN as J,gp as Q,j as s,cg as M,L as W}from"./index-DdBTTN3y.js";import{E as X}from"./events-feed-B9CZHI_P.js";import{b as Y,a as Z,V as z,M as K}from"./view-param-filters-CER47Tlz.js";import{u as ee}from"./event-card-DVUB8my6.js";const se={},te="calc(100dvh - 120px)";function oe({owner:n,organizationId:o,eventId:c,viewKey:r,params:g,onParamsChange:d,onSelectView:p,dense:h=!1,fullBleed:k=!1}){const{isAuthenticated:y,isReady:E}=G(),{data:O,isLoading:w}=I(),P=O?.some(t=>t.id===o&&t.is_member),i=n!=="me"&&o!==null&&E&&y&&!w&&P,a=ee(i?{slug:n,organizationId:o}:null,c),[j,L]=D.useState(se),[T,b]=D.useState(null),m=J(a.views,r),e=i&&!a.isLoading&&!a.isError&&m.kind==="view"?m.view:null,v=e?`${Q(n,e.key)}/${e.content_hash}/${e.eventId}`:null,x=e!==null&&T===v,V=M(n,c),F=n!=="me"&&(!E||y&&(w||a.isLoading)),N=e!==null&&!x&&!F,u=k&&N,U=(k||h)&&N,H=F?s.jsx("div",{role:"status",className:"py-8 text-sm text-muted-foreground",children:"Loading event view…"}):e&&!x?s.jsxs(s.Fragment,{children:[s.jsx(Y,{decls:e.params,params:g??j,onParamsChange:t=>d?d(e.key,t,{replace:!1}):L(t)}),s.jsx(Z,{orgSlug:n,viewKey:e.key,scope:{event:e.eventId},params:g??j,onParamsChange:t=>d?d(e.key,t):L(t),onLoadError:()=>b(v),contentHash:e.content_hash,title:e.name,minHeight:h?240:320,fixedHeight:U?te:void 0},v)]}):void 0;return s.jsxs("div",{className:u?"w-full space-y-3":"mx-auto w-full max-w-3xl space-y-3",...u?{"data-testid":"event-view-fullbleed"}:{},children:[i&&a.isError&&s.jsx(z,{onRetry:a.refetch}),(i||n==="me"&&r)&&!a.isLoading&&!a.isError&&m.kind==="missing"&&s.jsx(K,{viewKey:m.key,backTo:V,backLabel:"Back to the event"}),x&&s.jsxs("div",{role:"alert",className:"rounded-md border p-3 text-sm",children:[s.jsx("p",{children:"The custom view couldn’t load. The event content is shown below."}),s.jsx("button",{type:"button",className:"mt-2 underline",onClick:()=>b(null),children:"Retry custom view"})]}),s.jsx(X,{presentation:"detail",organizationId:o,ownerSlug:n,filters:{contentIds:[c],...n==="me"?{sortBy:"date",sortOrder:"desc"}:{}},hideDetails:h,renderDetail:t=>{const f=H!=null&&(t==null||!!r),A=(i?a.views:[]).filter(l=>!f||l.key!==e?.key).map(l=>({key:l.key,name:l.name,href:M(n,c,l.key)})),S=l=>l.length?s.jsx("nav",{"aria-label":"Event views",className:"flex flex-wrap gap-3 text-sm",children:l.map(({key:$,name:C,href:B})=>s.jsx(W,{to:B,className:"underline",onClick:p?q=>{q.preventDefault(),p(B)}:void 0,children:C},$))}):null,R=[...A],_=[...A];return i&&r&&t!=null&&_.unshift({key:":event",name:"Event details",href:V}),{content:f?H:t,nativeHeading:!f&&t!=null,headingAside:u?S(R):void 0,links:u?null:S(_)}}})]})}export{oe as E};
|
|
2
|
+
//# sourceMappingURL=event-detail-DkY95e5b.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,L as Be,C as Ge,dG as We,dH as B,dI as Ke,dJ as G,B as k,dK as W,cB as K,V as Qe,dL as Ue,dM as Ve,dN as Q,da as O,dO as z,bu as qe,S as $,b4 as Je,dn as Xe,r as w,aa as Ye,o as Ze,au as es,cw as ss,de as ts,dh as ns,di as as,dP as rs,dQ as is,dR as ls,dS as os,dT as cs,bW as ds,dU as ms,cu as ee,bo as de,cz as us}from"./index-4gCDI7m4.js";import{s as xe,E as H,t as xs}from"./event-card-Mcxv56DG.js";import{u as hs}from"./client-activity-scopes-boZOHuPW.js";import{a as ps}from"./client-rows-BJ2PxM4J.js";import{u as fs}from"./use-scroll-sentinel-Ct-jt7O0.js";function js(t,a){const r=a.parentEntityType&&a.parentEntitySlug?[{entity_type:a.parentEntityType,slug:a.parentEntitySlug},{entity_type:a.entityType,slug:a.entitySlug}]:[{entity_type:a.entityType,slug:a.entitySlug}];return We(t,r)}function gs({ownerSlug:t,entity:a,className:r}){const c=js(t,a);return e.jsxs(Be,{to:c,className:`flex items-center gap-1 text-primary hover:underline group ${r??""}`,children:[e.jsx("span",{className:"font-medium",children:a.entityName}),e.jsx(Ge,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Ns({toolName:t,count:a,titles:r=[],totalDurationMs:c,totalSdkCalls:x,newestAt:d,oldestAt:h,expanded:g,onToggle:v,children:j}){return e.jsx("div",{children:e.jsxs(B,{open:g,children:[e.jsx("div",{className:"rounded-lg p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{"aria-hidden":!0,className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:e.jsx(Ke,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"h-5 min-w-0 gap-1.5 px-0 text-sm text-muted-foreground",onClick:v,children:[e.jsxs("span",{className:"min-w-0 truncate font-medium text-foreground",children:[xe(t)," × ",a]}),g?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(K,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsx(he,{newestAt:d,oldestAt:h})]}),r.length>0&&e.jsx("p",{className:"mt-0.5 truncate text-sm text-muted-foreground",children:r.join(" · ")}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs(Qe,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Ue,{className:"h-3 w-3"}),"Completed"]}),x!=null&&e.jsxs("span",{children:[x," SDK ",x===1?"call":"calls"]}),c!=null&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ve,{className:"h-3 w-3"}),ys(c)]})]})]})]})}),e.jsx(Q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:j})]})})}function ys(t){return t<1e3?`${Math.round(t)}ms`:`${Number((t/1e3).toFixed(2))}s`}function he({newestAt:t,oldestAt:a}){const r=me(t),c=me(a);return r!=null&&c!=null&&r.getTime()-c.getTime()>ws&&c?e.jsxs("time",{dateTime:r.toISOString(),title:`${z(c)} – ${z(r)}`,className:"shrink-0 pt-0.5 text-xs text-muted-foreground",children:[O(c,"HH:mm"),"–",O(r,"HH:mm")]}):r?e.jsx("time",{dateTime:r.toISOString(),title:z(r),className:"shrink-0 pt-0.5 text-xs text-muted-foreground",children:O(r,"HH:mm")}):null}const ws=300*1e3;function me(t){if(t==null||t==="")return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:a}function vs({organizationId:t,clientId:a,activityId:r,activityKind:c,callCount:x,newestAt:d,oldestAt:h,expanded:g,onToggle:v,children:j}){const{data:b=[]}=hs({limit:100,organizationId:t??null}),C=b.find(I=>I.activityId===r&&(a==null||I.clientId===a))??null,S=C?ps(C):c==="session"?"MCP session":"Conversation",N=C?.clientName??null;return e.jsx("div",{children:e.jsxs(B,{open:g,children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background",children:e.jsx(qe,{name:N})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"h-5 min-w-0 gap-1.5 px-0 text-sm text-muted-foreground",onClick:v,children:[e.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:S}),g?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(K,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsx(he,{newestAt:d,oldestAt:h})]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[`${x} ${x===1?"call":"calls"}`,N?` · ${N}`:null]})]})]})}),e.jsx(Q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:j})]})})}function Cs({groupByDate:t=!0}){return e.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:e.jsxs("div",{"aria-hidden":"true",children:[t?e.jsx("div",{className:"px-3 pb-2",children:e.jsx($,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(a=>e.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[e.jsx($,{className:"h-8 w-8 shrink-0 rounded-none"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx($,{className:"h-4 w-3/5 max-w-sm rounded-none"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{className:"h-3 w-20 rounded-none"}),e.jsx($,{className:"h-3 w-12 rounded-none"})]})]})]},a))]})})}function ue(t){if(t==null||t==="")return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:O(a,"d MMMM yyyy")}function bs({items:t,isLoading:a,emptyState:r,hasNextPage:c,isFetching:x,isFetchingNextPage:d,onLoadMore:h,autoLoadMore:g=!0,groupByDate:v=!0}){const j=fs({onIntersect:h,enabled:g&&c&&!x});return a&&t.length===0?e.jsx(Cs,{groupByDate:v}):e.jsxs("div",{children:[t.length===0?r!==void 0?r:e.jsx(Je,{icon:Xe,title:"Nothing here yet",description:"No events match this view."}):t.map((b,C)=>{const S=ue(b.occurredAt),N=C>0?ue(t[C-1].occurredAt):null;return e.jsxs(w.Fragment,{children:[v&&S&&S!==N&&e.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:S}),e.jsx("div",{className:"mb-1",children:b.content})]},b.key)}),e.jsx("div",{ref:j,className:"h-1"}),d?e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(Ye,{size:"xl",className:"text-muted-foreground"})}):c&&e.jsx(k,{size:"sm",variant:"outline",disabled:x,onClick:h,children:"Load more"})]})}function Es({presentation:t="summary",renderDetail:a,onFiltersChange:r,hideDetails:c=!1,organizationId:x,ownerSlug:d,entityId:h,filters:g,showEntityLinks:v=!1,hideOriginator:j=!1,emptyState:b,foldConsecutiveCalls:C=!1,groupByConversation:S=!1,groupByRun:N=!1,onRunSelect:I,runs:pe,hideRunAction:D=!1,hideAttribution:E=!1,hiddenApprovalRunIds:U}){const{isAuthenticated:V,isReady:M}=Ze(),{isMember:se,isLoading:te}=es(),q=d==="me",R=!q&&M&&V&&se,J=!q&&M&&(!V||!te&&!se),{data:fe=[]}=ss(M&&R?x:null),{data:je=[]}=ts(J?d:null),F=R?fe:je,ge=ns(M&&R?x:null,h,g,d),Ne=as(J?d:null,h,g),X=J?Ne:ge,{data:ne,isLoading:ye,error:we,fetchNextPage:ve,hasNextPage:Ce,isFetchingNextPage:be}=X,ae=w.useMemo(()=>ne?.pages.flatMap(s=>s.content)??[],[ne]),Y=w.useMemo(()=>{const s=rs(ae,{foldRunSatellites:!N}),n=s.map(u=>u.head),o=new Map(s.map(u=>[u.head.id,u])),l=is(n,{groupByRun:N}),f=Array.from(l.entries()).map(([u,m])=>{const p=m.root||m.replies[0],_=p?o.get(p.id):void 0;return{rootId:u,group:m,history:_?.history??[],runId:_?.runId??null}});return U?ls(f,U):f},[ae,N,U]),[Se,ke]=w.useState(new Set),[Te,Ie]=w.useState(new Set),[De,Ee]=w.useState(new Set),[Me,Fe]=w.useState(new Set),[_e,Ae]=w.useState(new Set),Z=(s,n)=>s(o=>{const l=new Set(o);return l.has(n)?l.delete(n):l.add(n),l}),re=(s,n)=>n.some(o=>s.has(o)),ie=(s,n)=>s(o=>{const l=new Set(o),f=n.some(u=>l.has(u));for(const u of n)f?l.delete(u):l.add(u);return l}),le=C?os(Y):Y.map(s=>({kind:"single",node:s})),$e=S?cs(le):le,He=!q&&(!M||V&&te||R&&X.isPending);if(we)return e.jsx(ds,{label:"events"});const L=s=>{if(s.kind==="fold"){const{fold:i}=s,oe=i.nodes.map(A=>A.rootId),ze=re(Te,oe);return[{key:i.key,occurredAt:i.newestAt,content:e.jsx(Ns,{toolName:i.toolName,count:i.nodes.length,titles:[...new Set(i.nodes.flatMap(A=>{const T=A.group.root?.payload_data,ce=xs(T,T?.tool_name);return ce?[ce]:[]}))],totalDurationMs:i.totalDurationMs,totalSdkCalls:i.totalSdkCalls,newestAt:i.newestAt,oldestAt:i.oldestAt,expanded:ze,onToggle:()=>ie(Ie,oe),children:i.nodes.map(A=>{const T=A.group.root;return T?e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:T,renderDetail:a,connectorDefinitions:F,hideOriginator:j,hideRunAction:D,hideAttribution:E,hideDetails:c},T.id):null})})}]}const{rootId:n,group:o,history:l,runId:f}=s.node,u=o.replies.length>0,m=Se.has(n),p=_e.has(n),_=Me.has(n),Pe=o.replies.filter(i=>i.depth<=3),P=o.replies.filter(i=>i.depth>3),Oe=!o.root&&o.replies.length>0,y=o.root||o.replies[0];return y?[{key:n,occurredAt:y.occurred_at,content:e.jsxs(e.Fragment,{children:[v&&d&&y.entity_name&&y.entity_type&&y.entity_slug&&e.jsx("div",{className:"mb-2",children:e.jsx(gs,{ownerSlug:d,entity:{entityName:y.entity_name,entityType:y.entity_type,entitySlug:y.entity_slug}})}),e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:y,renderDetail:a,showParentContext:Oe&&!!y.parent_context,connectorDefinitions:F,hideOriginator:j,hideRunAction:D,hideAttribution:E,hideDetails:c}),l.length>0&&e.jsxs(B,{open:_,children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-1 h-7 gap-1 text-xs text-muted-foreground",onClick:()=>Z(Fe,n),children:[e.jsx(us,{className:"h-3.5 w-3.5"}),_?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Hide ",f!=null?`run #${f} `:"","history"]}):e.jsxs(e.Fragment,{children:[e.jsx(K,{className:"h-3.5 w-3.5"}),f!=null?`Run #${f} · ${l.length===1?"1 earlier step":`${l.length} earlier steps`}`:l.length===1?"1 earlier state":`${l.length} earlier states`]})]})}),e.jsx(Q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:l.map(i=>e.jsxs("div",{children:[e.jsx("time",{dateTime:new Date(i.occurred_at).toISOString(),title:z(i.occurred_at),className:"mb-1 block text-xs text-muted-foreground",children:de(i.occurred_at)}),e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,connectorDefinitions:F,hideOriginator:j,hideRunAction:D,hideAttribution:E})]},i.id))})]}),u&&e.jsxs(B,{open:m,children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-2 ml-6 gap-1",onClick:()=>Z(ke,n),children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),m?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Hide ",o.replies.length," replies"]}):e.jsxs(e.Fragment,{children:[e.jsx(K,{className:"h-3.5 w-3.5"}),"Show ",o.replies.length," replies"]})]})}),e.jsxs(Q,{className:"space-y-2 mt-2",children:[Pe.map(i=>e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,isReply:!0,connectorDefinitions:F,hideOriginator:j,hideRunAction:D,hideAttribution:E},i.id)),P.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"sm",className:"ml-12",onClick:()=>Z(Ae,n),children:p?e.jsxs(e.Fragment,{children:["Hide ",P.length," nested replies"]}):e.jsxs(e.Fragment,{children:["Show ",P.length," nested replies"]})}),p&&P.map(i=>e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,isReply:!0,connectorDefinitions:F,hideOriginator:j,hideRunAction:D,hideAttribution:E},i.id))]})]})]})]})}]:[]},Re=s=>{const n=s.nodes.length;return{key:s.key,occurredAt:s.newestAt,content:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[I?e.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1 text-xs font-medium",onClick:()=>I(s.runId),title:`Open run #${s.runId} conversation`,children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"Run #",s.runId]}):e.jsxs("span",{className:"inline-flex h-7 items-center gap-1 px-1 text-xs font-medium",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"Run #",s.runId]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.status!=null?`· ${xe(s.status)} · `:"· ",n===1?"1 event":`${n} events`,s.newestAt!=null?` · ${de(s.newestAt)}`:""]})]}),e.jsx("div",{className:"mt-2 space-y-2 border-l-2 border-l-muted pl-4",children:s.nodes.flatMap(o=>L({kind:"single",node:o}).map(l=>e.jsx(w.Fragment,{children:l.content},l.key)))})]})}},Le=s=>{const{block:n}=s,o=n.entries.flatMap(m=>m.kind==="fold"?m.fold.nodes.map(p=>p.rootId):[m.node.rootId]),l=re(De,o),f=n.entries.flatMap(m=>L(m).map(p=>({key:p.key,content:p.content})));if(f.length===0)return[];const u=n.entries.reduce((m,p)=>m+(p.kind==="fold"?p.fold.nodes.length:1),0);return[{key:n.key,occurredAt:n.newestAt,content:e.jsx(vs,{organizationId:x,clientId:n.clientId,activityId:n.activityId,activityKind:n.activityKind,callCount:u,newestAt:n.newestAt,oldestAt:n.oldestAt,expanded:l,onToggle:()=>ie(Ee,o),children:f.map(m=>e.jsx(w.Fragment,{children:m.content},m.key))})}]};return e.jsx(bs,{groupByDate:t==="summary",isLoading:ye||He,emptyState:b,hasNextPage:!!Ce,isFetching:X.isFetching,isFetchingNextPage:be,onLoadMore:()=>void ve(),items:N?ms(Y,pe).map(s=>"nodes"in s?Re(s):L({kind:"single",node:s})[0]).filter(s=>s!=null):$e.flatMap(s=>s.kind==="context"?Le(s):L(s))})}export{Es as E,Cs as a,bs as b};
|
|
2
|
-
//# sourceMappingURL=events-feed-
|
|
1
|
+
import{j as e,L as Be,C as Ge,dR as We,dS as B,dT as Ue,dU as G,B as k,dV as W,cI as U,V as qe,dW as Ke,dX as Qe,dY as q,di as O,dZ as z,d_ as Ve,S as $,b2 as Xe,dw as Ye,r as w,ab as Ze,q as Je,at as es,cD as ss,dm as ts,dq as ns,dr as as,d$ as rs,e0 as is,e1 as ls,e2 as os,e3 as cs,b_ as ds,e4 as ms,cA as ee,e5 as de,cG as us}from"./index-DdBTTN3y.js";import{s as xe,E as H,t as xs}from"./event-card-DVUB8my6.js";import{u as hs}from"./client-activity-scopes-CXOWB5co.js";import{c as ps}from"./client-rows-36VnmgMK.js";import{u as fs}from"./use-scroll-sentinel-DRyBMueA.js";function js(t,a){const r=a.parentEntityType&&a.parentEntitySlug?[{entity_type:a.parentEntityType,slug:a.parentEntitySlug},{entity_type:a.entityType,slug:a.entitySlug}]:[{entity_type:a.entityType,slug:a.entitySlug}];return We(t,r)}function gs({ownerSlug:t,entity:a,className:r}){const c=js(t,a);return e.jsxs(Be,{to:c,className:`flex items-center gap-1 text-primary hover:underline group ${r??""}`,children:[e.jsx("span",{className:"font-medium",children:a.entityName}),e.jsx(Ge,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Ns({toolName:t,count:a,titles:r=[],totalDurationMs:c,totalSdkCalls:x,newestAt:d,oldestAt:h,expanded:g,onToggle:v,children:j}){return e.jsx("div",{children:e.jsxs(B,{open:g,children:[e.jsx("div",{className:"rounded-lg p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{"aria-hidden":!0,className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:e.jsx(Ue,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"h-5 min-w-0 gap-1.5 px-0 text-sm text-muted-foreground",onClick:v,children:[e.jsxs("span",{className:"min-w-0 truncate font-medium text-foreground",children:[xe(t)," × ",a]}),g?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(U,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsx(he,{newestAt:d,oldestAt:h})]}),r.length>0&&e.jsx("p",{className:"mt-0.5 truncate text-sm text-muted-foreground",children:r.join(" · ")}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs(qe,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Ke,{className:"h-3 w-3"}),"Completed"]}),x!=null&&e.jsxs("span",{children:[x," SDK ",x===1?"call":"calls"]}),c!=null&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Qe,{className:"h-3 w-3"}),ys(c)]})]})]})]})}),e.jsx(q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:j})]})})}function ys(t){return t<1e3?`${Math.round(t)}ms`:`${Number((t/1e3).toFixed(2))}s`}function he({newestAt:t,oldestAt:a}){const r=me(t),c=me(a);return r!=null&&c!=null&&r.getTime()-c.getTime()>ws&&c?e.jsxs("time",{dateTime:r.toISOString(),title:`${z(c)} – ${z(r)}`,className:"shrink-0 pt-0.5 text-xs text-muted-foreground",children:[O(c,"HH:mm"),"–",O(r,"HH:mm")]}):r?e.jsx("time",{dateTime:r.toISOString(),title:z(r),className:"shrink-0 pt-0.5 text-xs text-muted-foreground",children:O(r,"HH:mm")}):null}const ws=300*1e3;function me(t){if(t==null||t==="")return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:a}function vs({organizationId:t,clientId:a,activityId:r,activityKind:c,callCount:x,newestAt:d,oldestAt:h,expanded:g,onToggle:v,children:j}){const{data:b=[]}=hs({limit:100,organizationId:t??null}),C=b.find(I=>I.activityId===r&&(a==null||I.clientId===a))??null,S=C?ps(C):c==="session"?"MCP session":"Conversation",N=C?.clientName??null;return e.jsx("div",{children:e.jsxs(B,{open:g,children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-3",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border bg-background",children:e.jsx(Ve,{name:N})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"h-5 min-w-0 gap-1.5 px-0 text-sm text-muted-foreground",onClick:v,children:[e.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:S}),g?e.jsx(W,{className:"h-3.5 w-3.5 shrink-0"}):e.jsx(U,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsx(he,{newestAt:d,oldestAt:h})]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[`${x} ${x===1?"call":"calls"}`,N?` · ${N}`:null]})]})]})}),e.jsx(q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:j})]})})}function Cs({groupByDate:t=!0}){return e.jsx("div",{role:"status","aria-label":"Loading activity","aria-busy":"true",children:e.jsxs("div",{"aria-hidden":"true",children:[t?e.jsx("div",{className:"px-3 pb-2",children:e.jsx($,{className:"h-4 w-28 rounded-none"})}):null,["first","second","third","fourth","fifth"].map(a=>e.jsxs("div",{className:"flex items-start gap-3 px-3 py-3",children:[e.jsx($,{className:"h-8 w-8 shrink-0 rounded-none"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[e.jsx($,{className:"h-4 w-3/5 max-w-sm rounded-none"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{className:"h-3 w-20 rounded-none"}),e.jsx($,{className:"h-3 w-12 rounded-none"})]})]})]},a))]})})}function ue(t){if(t==null||t==="")return null;const a=new Date(t);return Number.isNaN(a.getTime())?null:O(a,"d MMMM yyyy")}function bs({items:t,isLoading:a,emptyState:r,hasNextPage:c,isFetching:x,isFetchingNextPage:d,onLoadMore:h,autoLoadMore:g=!0,groupByDate:v=!0}){const j=fs({onIntersect:h,enabled:g&&c&&!x});return a&&t.length===0?e.jsx(Cs,{groupByDate:v}):e.jsxs("div",{children:[t.length===0?r!==void 0?r:e.jsx(Xe,{icon:Ye,title:"Nothing here yet",description:"No events match this view."}):t.map((b,C)=>{const S=ue(b.occurredAt),N=C>0?ue(t[C-1].occurredAt):null;return e.jsxs(w.Fragment,{children:[v&&S&&S!==N&&e.jsx("p",{className:"px-3 pb-2 pt-4 text-xs text-muted-foreground first:pt-0",children:S}),e.jsx("div",{className:"mb-1",children:b.content})]},b.key)}),e.jsx("div",{ref:j,className:"h-1"}),d?e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(Ze,{size:"xl",className:"text-muted-foreground"})}):c&&e.jsx(k,{size:"sm",variant:"outline",disabled:x,onClick:h,children:"Load more"})]})}function Es({presentation:t="summary",renderDetail:a,onFiltersChange:r,hideDetails:c=!1,organizationId:x,ownerSlug:d,entityId:h,filters:g,showEntityLinks:v=!1,hideOriginator:j=!1,emptyState:b,foldConsecutiveCalls:C=!1,groupByConversation:S=!1,groupByRun:N=!1,onRunSelect:I,runs:pe,hideRunAction:D=!1,hideAttribution:E=!1,hiddenApprovalRunIds:K}){const{isAuthenticated:Q,isReady:F}=Je(),{isMember:se,isLoading:te}=es(),V=d==="me",R=!V&&F&&Q&&se,X=!V&&F&&(!Q||!te&&!se),{data:fe=[]}=ss(F&&R?x:null),{data:je=[]}=ts(X?d:null),M=R?fe:je,ge=ns(F&&R?x:null,h,g,d),Ne=as(X?d:null,h,g),Y=X?Ne:ge,{data:ne,isLoading:ye,error:we,fetchNextPage:ve,hasNextPage:Ce,isFetchingNextPage:be}=Y,ae=w.useMemo(()=>ne?.pages.flatMap(s=>s.content)??[],[ne]),Z=w.useMemo(()=>{const s=rs(ae,{foldRunSatellites:!N}),n=s.map(u=>u.head),o=new Map(s.map(u=>[u.head.id,u])),l=is(n,{groupByRun:N}),f=Array.from(l.entries()).map(([u,m])=>{const p=m.root||m.replies[0],_=p?o.get(p.id):void 0;return{rootId:u,group:m,history:_?.history??[],runId:_?.runId??null}});return K?ls(f,K):f},[ae,N,K]),[Se,ke]=w.useState(new Set),[Te,Ie]=w.useState(new Set),[De,Ee]=w.useState(new Set),[Fe,Me]=w.useState(new Set),[_e,Ae]=w.useState(new Set),J=(s,n)=>s(o=>{const l=new Set(o);return l.has(n)?l.delete(n):l.add(n),l}),re=(s,n)=>n.some(o=>s.has(o)),ie=(s,n)=>s(o=>{const l=new Set(o),f=n.some(u=>l.has(u));for(const u of n)f?l.delete(u):l.add(u);return l}),le=C?os(Z):Z.map(s=>({kind:"single",node:s})),$e=S?cs(le):le,He=!V&&(!F||Q&&te||R&&Y.isPending);if(we)return e.jsx(ds,{label:"events"});const L=s=>{if(s.kind==="fold"){const{fold:i}=s,oe=i.nodes.map(A=>A.rootId),ze=re(Te,oe);return[{key:i.key,occurredAt:i.newestAt,content:e.jsx(Ns,{toolName:i.toolName,count:i.nodes.length,titles:[...new Set(i.nodes.flatMap(A=>{const T=A.group.root?.payload_data,ce=xs(T,T?.tool_name);return ce?[ce]:[]}))],totalDurationMs:i.totalDurationMs,totalSdkCalls:i.totalSdkCalls,newestAt:i.newestAt,oldestAt:i.oldestAt,expanded:ze,onToggle:()=>ie(Ie,oe),children:i.nodes.map(A=>{const T=A.group.root;return T?e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:T,renderDetail:a,connectorDefinitions:M,hideOriginator:j,hideRunAction:D,hideAttribution:E,hideDetails:c},T.id):null})})}]}const{rootId:n,group:o,history:l,runId:f}=s.node,u=o.replies.length>0,m=Se.has(n),p=_e.has(n),_=Fe.has(n),Pe=o.replies.filter(i=>i.depth<=3),P=o.replies.filter(i=>i.depth>3),Oe=!o.root&&o.replies.length>0,y=o.root||o.replies[0];return y?[{key:n,occurredAt:y.occurred_at,content:e.jsxs(e.Fragment,{children:[v&&d&&y.entity_name&&y.entity_type&&y.entity_slug&&e.jsx("div",{className:"mb-2",children:e.jsx(gs,{ownerSlug:d,entity:{entityName:y.entity_name,entityType:y.entity_type,entitySlug:y.entity_slug}})}),e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:y,renderDetail:a,showParentContext:Oe&&!!y.parent_context,connectorDefinitions:M,hideOriginator:j,hideRunAction:D,hideAttribution:E,hideDetails:c}),l.length>0&&e.jsxs(B,{open:_,children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-1 h-7 gap-1 text-xs text-muted-foreground",onClick:()=>J(Me,n),children:[e.jsx(us,{className:"h-3.5 w-3.5"}),_?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Hide ",f!=null?`run #${f} `:"","history"]}):e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-3.5 w-3.5"}),f!=null?`Run #${f} · ${l.length===1?"1 earlier step":`${l.length} earlier steps`}`:l.length===1?"1 earlier state":`${l.length} earlier states`]})]})}),e.jsx(q,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:l.map(i=>e.jsxs("div",{children:[e.jsx("time",{dateTime:new Date(i.occurred_at).toISOString(),title:z(i.occurred_at),className:"mb-1 block text-xs text-muted-foreground",children:de(i.occurred_at)}),e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,connectorDefinitions:M,hideOriginator:j,hideRunAction:D,hideAttribution:E})]},i.id))})]}),u&&e.jsxs(B,{open:m,children:[e.jsx(G,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"sm",className:"mt-2 ml-6 gap-1",onClick:()=>J(ke,n),children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),m?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3.5 w-3.5"}),"Hide ",o.replies.length," replies"]}):e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"h-3.5 w-3.5"}),"Show ",o.replies.length," replies"]})]})}),e.jsxs(q,{className:"space-y-2 mt-2",children:[Pe.map(i=>e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,isReply:!0,connectorDefinitions:M,hideOriginator:j,hideRunAction:D,hideAttribution:E},i.id)),P.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"sm",className:"ml-12",onClick:()=>J(Ae,n),children:p?e.jsxs(e.Fragment,{children:["Hide ",P.length," nested replies"]}):e.jsxs(e.Fragment,{children:["Show ",P.length," nested replies"]})}),p&&P.map(i=>e.jsx(H,{presentation:t,recordId:h,onFiltersChange:r,ownerSlug:d,content:i,isReply:!0,connectorDefinitions:M,hideOriginator:j,hideRunAction:D,hideAttribution:E},i.id))]})]})]})]})}]:[]},Re=s=>{const n=s.nodes.length;return{key:s.key,occurredAt:s.newestAt,content:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[I?e.jsxs(k,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1 text-xs font-medium",onClick:()=>I(s.runId),title:`Open run #${s.runId} conversation`,children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"Run #",s.runId]}):e.jsxs("span",{className:"inline-flex h-7 items-center gap-1 px-1 text-xs font-medium",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),"Run #",s.runId]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.status!=null?`· ${xe(s.status)} · `:"· ",n===1?"1 event":`${n} events`,s.newestAt!=null?` · ${de(s.newestAt)}`:""]})]}),e.jsx("div",{className:"mt-2 space-y-2 border-l-2 border-l-muted pl-4",children:s.nodes.flatMap(o=>L({kind:"single",node:o}).map(l=>e.jsx(w.Fragment,{children:l.content},l.key)))})]})}},Le=s=>{const{block:n}=s,o=n.entries.flatMap(m=>m.kind==="fold"?m.fold.nodes.map(p=>p.rootId):[m.node.rootId]),l=re(De,o),f=n.entries.flatMap(m=>L(m).map(p=>({key:p.key,content:p.content})));if(f.length===0)return[];const u=n.entries.reduce((m,p)=>m+(p.kind==="fold"?p.fold.nodes.length:1),0);return[{key:n.key,occurredAt:n.newestAt,content:e.jsx(vs,{organizationId:x,clientId:n.clientId,activityId:n.activityId,activityKind:n.activityKind,callCount:u,newestAt:n.newestAt,oldestAt:n.oldestAt,expanded:l,onToggle:()=>ie(Ee,o),children:f.map(m=>e.jsx(w.Fragment,{children:m.content},m.key))})}]};return e.jsx(bs,{groupByDate:t==="summary",isLoading:ye||He,emptyState:b,hasNextPage:!!Ce,isFetching:Y.isFetching,isFetchingNextPage:be,onLoadMore:()=>void ve(),items:N?ms(Z,pe).map(s=>"nodes"in s?Re(s):L({kind:"single",node:s})[0]).filter(s=>s!=null):$e.flatMap(s=>s.kind==="context"?Le(s):L(s))})}export{Es as E,Cs as a,bs as b};
|
|
2
|
+
//# sourceMappingURL=events-feed-B9CZHI_P.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,cU as C,$ as P,Y as O,i as g,di as j,r as m,B as h,dC as N,dD as b,I as y,dE as k,X as z,dF as S,dG as D,dH as B,m as I,dI as F,dJ as E,dK as L,dL as $,cT as R}from"./index-DdBTTN3y.js";import{a as _,C as H,s as Q}from"./calendar-Ck0yOLYu.js";function w(s,t,n){return _(s,-t,n)}function U({selected:s}){return e.jsx(O,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function Y({searchPlaceholder:s,emptyText:t="No options",options:n,selected:o,multiple:l=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(r=>{const i=o.includes(r.value);return e.jsxs(C,{value:`${r.label} ${r.keywords??r.value}`,onSelect:()=>{a(r.value),l||u()},"aria-label":r.label,className:"group gap-2",children:[l?e.jsx(P,{checked:i,className:"mr-1"}):e.jsx(U,{selected:i}),r.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.count.toLocaleString()}):null,r.action]},r.value)})}}function Z([s,t],n,o){return s<=n?`≤ ${t}`:t>=o?`≥ ${s}`:`${s}–${t}`}function A({value:s,min:t,max:n,onApply:o,close:l}){const[a,u]=m.useState(String(s?.[0]??t)),[r,i]=m.useState(String(s?.[1]??n)),[c,f]=m.useState(),d=x=>{x.preventDefault();const p=Number(a),v=Number(r);if(!Number.isFinite(p)||!Number.isFinite(v)){f("Enter a number.");return}if(p<t||v>n){f(`Use values between ${t} and ${n}.`);return}if(p>v){f("The lower bound must not exceed the upper bound.");return}o([p,v]),l()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:d,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[e.jsx(y,{"aria-label":"From",type:"number",min:t,max:n,value:a,onChange:x=>u(x.target.value)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"to"}),e.jsx(y,{"aria-label":"To",type:"number",min:t,max:n,value:r,onChange:x=>i(x.target.value)})]}),c?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:c}):null,e.jsx(h,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function ee(s){return{kind:"custom",render:t=>e.jsx(A,{...s,close:t})}}const G=[{label:"Today",range:()=>[N(new Date),b(new Date)]},{label:"Last 7 days",range:()=>[N(w(new Date,6)),b(new Date)]},{label:"Last 30 days",range:()=>[N(w(new Date,29)),b(new Date)]},{label:"This month",range:()=>[Q(new Date),b(new Date)]}];function se([s,t]){return j(s,"yyyy-MM-dd")===j(t,"yyyy-MM-dd")?j(s,"LLL d, y"):`${j(s,"LLL d")} – ${j(t,"LLL d, y")}`}function V({value:s,onApply:t,close:n}){const[o,l]=m.useState(s?{from:s[0],to:s[1]}:void 0);return e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"flex flex-col gap-0.5 border-b p-2 sm:w-36 sm:border-b-0 sm:border-r",children:G.map(a=>e.jsx(h,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>{t(a.range()),n()},children:a.label},a.label))}),e.jsx(H,{mode:"range",defaultMonth:o?.from,selected:o,onSelect:a=>{l(a),a?.from&&a.to&&a.from!==a.to&&(t([N(a.from),b(a.to)]),n())},numberOfMonths:1})]})}function te(s){return{kind:"custom",className:"w-auto",render:t=>e.jsx(V,{...s,close:t})}}function q({type:s,label:t,value:n,onApply:o,close:l}){const[a,u]=m.useState(n==null?"":String(n)),[r,i]=m.useState(),c=f=>{if(f.preventDefault(),s==="number"){const d=Number(a);if(a.trim()===""||!Number.isFinite(d)){i("Enter a number.");return}o(d)}else o(a);l()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:c,children:[e.jsx(y,{autoFocus:!0,"aria-label":t,type:s,step:s==="number"?"any":void 0,value:a,onChange:f=>u(f.target.value),placeholder:"Enter a value…"}),r?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:r}):null,e.jsx(h,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function ae(s){return{kind:"custom",render:t=>e.jsx(q,{...s,close:t})}}const T="w-72";function M({editor:s,close:t,header:n,footer:o}){const[l,a]=m.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(F,{shouldFilter:!s.onQueryChange,children:[e.jsx(E,{autoFocus:!0,placeholder:s.searchPlaceholder,value:l,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(L,{children:[e.jsx($,{children:s.emptyText}),e.jsx(R,{children:s.items(t,l)})]})]}):s.render(t),o]})}function J({chip:s,editor:t}){const[n,o]=m.useState(!1),l=s.onRemove!=null,a=[s.label,s.op,s.value].filter(Boolean).join(" "),u=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:s.label}),s.op?e.jsx("span",{className:"text-muted-foreground",children:s.op}):null,e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.value})]}),r=t?e.jsx(D,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Edit filter: ${a}`,className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1 focus-visible:outline-none",children:u})}):e.jsx("span",{className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1",children:u});return e.jsxs(k,{open:n,onOpenChange:o,children:[e.jsxs("div",{"data-filter-chip":s.id,title:s.title,className:g("inline-flex h-8 max-w-full items-stretch rounded-md border text-sm",s.tone==="warning"?"border-amber-500/60 bg-amber-500/10":l?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!l&&"pr-1.5"),children:[r,l?e.jsx("button",{type:"button","aria-label":`Remove filter: ${a}`,onClick:s.onRemove,className:"flex w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(z,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(S,{align:"start",className:g("p-0",T,t.className),children:e.jsx(M,{editor:t,close:()=>o(!1),footer:l?e.jsx("div",{className:"border-t p-1",children:e.jsx(h,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{o(!1),s.onRemove?.()},children:"Remove filter"})}):null})}):null]})}function K({fields:s}){const[t,n]=m.useState(!1),[o,l]=m.useState(),a=s.find(i=>i.key===o),u=[...new Set(s.map(i=>i.group??""))],r=()=>{n(!1),l(void 0)};return e.jsxs(k,{open:t,onOpenChange:i=>{n(i),i||l(void 0)},children:[e.jsx(D,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"Filter"]})}),e.jsx(S,{align:"start",className:g("p-0",T,a?.editor.className),children:a?e.jsx(M,{editor:a.editor,close:r,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>l(void 0),children:e.jsx(I,{className:"h-4 w-4"})}),a.label]})},a.key):e.jsxs(F,{children:[e.jsx(E,{autoFocus:!0,placeholder:"Filter by…"}),e.jsxs(L,{children:[e.jsx($,{children:"No matching filter"}),u.map(i=>e.jsx(R,{heading:i||void 0,children:s.filter(c=>(c.group??"")===i).map(c=>e.jsxs(C,{value:`${c.label} ${c.key}`,onSelect:()=>l(c.key),className:"gap-2",children:[c.icon?e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",children:c.icon}):null,c.label]},c.key))},i))]})]})})]})}function ne({fields:s,chips:t,meta:n,actions:o,trailing:l,onClearAll:a,hasClearableState:u=!1,className:r,label:i="Filters"}){const c=s.filter(d=>d.inMenu!==!1),f=t.filter(d=>d.onRemove).length;return e.jsxs("div",{role:"search","aria-label":i,className:g("flex min-w-0 flex-wrap items-center gap-2",r),children:[t.map(d=>e.jsx(J,{chip:d,editor:d.editor??s.find(x=>x.key===(d.field??d.id))?.editor},d.id)),c.length>0?e.jsx(K,{fields:c}):null,o,e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[n?e.jsx("span",{className:"text-sm text-muted-foreground",children:n}):null,a&&(f>0||u)?e.jsx(h,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,l]})]})}export{ne as F,U as S,Z as a,te as d,se as f,Y as o,ee as r,ae as v};
|
|
2
|
+
//# sourceMappingURL=filter-bar-wPaR12SS.js.map
|
package/dist/owletto/dist/assets/{full-page-spinner-BMiXl54z.js → full-page-spinner-BqmckkOf.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,j as t,
|
|
2
|
-
//# sourceMappingURL=full-page-spinner-
|
|
1
|
+
import{r,j as t,i as u}from"./index-DdBTTN3y.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
|
|
2
|
+
//# sourceMappingURL=full-page-spinner-BqmckkOf.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j4 as t,j as n}from"./index-DdBTTN3y.js";import{a as i}from"./agents-workbench-bPTjdVS1.js";import"./agent-editor-form-CdA5vLr8.js";import"./model-selector-CgU8SJMF.js";import"./proposal-review-shell-D6KABxah.js";import"./runs-fFJ1lPnw.js";import"./nav-pill-DrFkuyUQ.js";function g(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(i,{owner:o,agentId:r,tab:"identity",runId:e.run_id})}export{g as component};
|
|
2
|
+
//# sourceMappingURL=identity-Dmg3STO8.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ba as o,c as u,bb as i,r as c,j as g}from"./index-DdBTTN3y.js";import{C as f}from"./agent-loading-shells-ClY_O6lb.js";function d(t,n,e){const a=t.find(r=>r.system)??t[0];return a?{to:"/$owner/chat/$agentId",params:{owner:n,agentId:a.agentId},search:e,replace:!0}:null}function h(){const{owner:t}=o.useParams(),n=o.useSearch(),e=u(),{data:a=[],isLoading:r}=i(),s=d(a,t,n);return c.useEffect(()=>{s&&e(s)},[e,s]),c.useEffect(()=>{r||a.length>0||e({to:"/$owner/agents",params:{owner:t},replace:!0})},[a.length,r,e,t]),g.jsx(f,{})}export{d as chatEntryTarget,h as component};
|
|
2
|
+
//# sourceMappingURL=index--ZWegctR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{as as l,at as c,j as e,S as n,L as m,C as d,au as x}from"./index-DdBTTN3y.js";function u({owner:a}){const{destinations:r}=l(),{isMember:i,isLoading:o,org:t}=c(a);return e.jsxs("div",{className:"mx-auto flex w-full max-w-xl flex-col gap-6 px-4 pt-4 pb-8",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Settings"}),t?e.jsx("p",{className:"text-sm text-muted-foreground",children:t.name}):null]}),o?e.jsx("div",{role:"status","aria-label":"Loading settings","aria-busy":"true",children:e.jsx("div",{"aria-hidden":"true",children:r.map(s=>e.jsx("div",{className:s.separator?"mt-3 border-t border-border pt-3":void 0,children:e.jsxs("div",{className:"flex min-h-12 items-center gap-3 px-3",children:[e.jsx(n,{className:"h-4 w-4 shrink-0 rounded-none"}),e.jsx(n,{className:"h-4 w-24 rounded-none"})]})},s.key))})}):i?e.jsx("nav",{"aria-label":"Settings sections",children:e.jsx("ul",{children:r.map(s=>e.jsx("li",{className:s.separator?"mt-3 border-t border-border pt-3":void 0,children:e.jsxs(m,{to:s.to,params:s.params,search:s.search,className:"flex min-h-12 items-center gap-3 rounded-md px-3 text-sm font-medium transition-colors hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[e.jsx(s.icon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.label}),e.jsx(d,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})},s.key))})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace settings are available to members."})]})}function p(){const{owner:a}=x.useParams();return e.jsx(u,{owner:a})}export{p as component};
|
|
2
|
+
//# sourceMappingURL=index-B0kw2lFL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{at as S,bb as I,r,j as e,B as g,L as b,bg as y,b2 as E,b3 as B,bh as M,ak as O,az as T,al as W}from"./index-DdBTTN3y.js";import{A as P}from"./agent-client-setup-list-DbXtJTsO.js";import{A as R}from"./agent-list-row-rF5LH-3k.js";import{L as z}from"./list-skeleton-CXDLkYTg.js";import{u as F}from"./clients-BJRcMk1A.js";import{g as G}from"./client-rows-36VnmgMK.js";const _={all:"All",managed:"Managed",connected:"Connected"};function $({owner:t,isWorkspaceLoading:i}){const{isMember:C,isLoading:u}=S(),c=C&&!u,{data:h=[],isLoading:k}=I({enabled:c}),{data:x=[]}=F(null),p=r.useMemo(()=>G(x).filter(n=>n.connected),[x]),o=r.useMemo(()=>{const n=h.map(a=>({kind:"managed",key:a.agentId,agent:{agentId:a.agentId,name:a.name,status:a.status,connectionCount:a.connectionCount,userCount:a.userCount}})),m=p.map(a=>({kind:"connected",key:a.key,group:a}));return[...n,...m]},[h,p]),f=r.useMemo(()=>o.length>0?["all","managed","connected"]:[],[o]),[j,L]=r.useState("all"),s=f.includes(j)?j:"all",d=r.useMemo(()=>o.filter(n=>s==="all"?!0:s==="managed"?n.kind==="managed":n.kind==="connected"),[o,s]),w=i||u||k,l=o.length>0,N=!w&&!l&&c,A=c?l?s==="managed"?"No managed agents yet":s==="connected"?"No connected agents yet":"No agents match this filter":"No agents yet":"Workspace membership required",v=c?l?s==="managed"?"Build a managed agent to add one here.":s==="connected"?"Bring an agent you already run to this workspace.":"Try another filter.":"Build a managed agent, or bring one you already run to this workspace.":"Only workspace members can manage agents here.";return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Who works here — your agents and the ones connected to this workspace."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[f.map(n=>e.jsx(g,{type:"button",variant:s===n?"secondary":"ghost","aria-pressed":s===n,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>L(n),children:_[n]},n)),N?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect an agent below or build one with Lobu."}):null]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:ml-auto sm:w-auto sm:shrink-0",children:[l?e.jsx(g,{asChild:!0,size:"sm",className:"h-8 text-xs",children:e.jsxs(b,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(y,{className:"mr-1.5 h-3.5 w-3.5"}),"Connect an agent"]})}):null,e.jsx(g,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(b,{to:"/$owner/agents/new",params:{owner:t},search:{},children:[e.jsx(y,{className:"mr-1.5 h-3.5 w-3.5"}),"Build a managed agent"]})})]})]}),w?e.jsx(z,{label:"Loading agents"}):d.length===0?N?e.jsx(P,{owner:t,dashed:!0}):e.jsx(E,{icon:B.agents.icon,title:A,description:v}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:d.map((n,m)=>e.jsx(R,{owner:t,item:n,last:m===d.length-1},n.key))})]})}function U(){const{owner:t}=M.useParams();return e.jsx(O,{className:"gap-3 pt-2.5 pb-8",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(T,{owner:t,children:i=>e.jsx(W,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx($,{owner:i.ownerSlug,isWorkspaceLoading:i.isWorkspaceLoading})})})})})}export{U as component};
|
|
2
|
+
//# sourceMappingURL=index-BKrdVwW9.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{av as m,aw as s,j as t,ak as p,al as a}from"./index-DdBTTN3y.js";import{A as n}from"./activity-route-view-DN0ZEAzr.js";import{E as c}from"./events-feed-B9CZHI_P.js";import"./record-activity-C9gVBbF0.js";import"./filter-bar-wPaR12SS.js";import"./calendar-Ck0yOLYu.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-D8LMhehh.js";import"./runs-fFJ1lPnw.js";import"./source-record-panels-Bh0n4gGw.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./client-activity-scopes-CXOWB5co.js";import"./agent-loading-shells-ClY_O6lb.js";import"./member-scope-gate-4FQ0aanZ.js";import"./runs-panel-DEnZHTa5.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./runs-table-XGnxJl7S.js";import"./nav-pill-DrFkuyUQ.js";import"./public-shell-ready-BIVCHQHe.js";function J(){const{owner:r}=m.useParams(),i=m.useSearch();if(r==="me"){const o=s(i),e={sortBy:"date",sortOrder:"desc",...o.contentIds?.length?{contentIds:o.contentIds}:{clientIds:o.clientIds,mcpActivityId:o.mcpActivityId}};return t.jsx(p,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(a,{className:"flex flex-col gap-6",children:[t.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),t.jsx(c,{organizationId:null,ownerSlug:"me",filters:e})]})})}return t.jsx(n,{owner:r,search:i})}export{J as component};
|
|
2
|
+
//# sourceMappingURL=index-BUBcNNUY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as i,j as e,B as d,bc as M,bb as E,aG as O,aB as P,aH as D,b2 as A,bd as F,b3 as I,b4 as z,L as B,be as W,bf as U,ak as G,az as K,al as $}from"./index-DdBTTN3y.js";import{A as H}from"./automation-row-DCHM--aD.js";import{o as S,F as Q}from"./filter-bar-wPaR12SS.js";import{D as h,m as q,f as J,e as V}from"./model-jL871x2J.js";import{R as X}from"./run-activity-link-CaIBSRQj.js";import{L as Y}from"./list-skeleton-CXDLkYTg.js";import{u as Z,a as ee}from"./use-automations-BLNjxq2K.js";import"./calendar-Ck0yOLYu.js";const te=[{value:"all",label:"All"},{value:"event",label:"Event"},{value:"schedule",label:"Schedule"},{value:"manual",label:"Manual"}];function ae({pending:a,onConfirm:s}){const[u,l]=i.useState(!1);return u?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(d,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:s,children:"Delete"}),e.jsx(d,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"})]}):e.jsx(d,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete",onClick:()=>l(!0),children:e.jsx(M,{className:"h-4 w-4"})})}const C=[{value:"reply",label:"Reply to source"},{value:"silent",label:"Runs silently"}],_=[{value:"active",label:"Active"},{value:"failing",label:"Failing"}];function se({facets:a,onChange:s,trailing:u}){const l=[{key:"output",label:"Output",editor:S({searchPlaceholder:"Search outputs...",options:C,selected:a.output==="any"?[]:[a.output],onSelect:n=>s({output:n})})},{key:"state",label:"State",editor:S({searchPlaceholder:"Search states...",options:_,selected:a.state==="any"?[]:[a.state],onSelect:n=>s({state:n})})}],c=[];return a.output!=="any"&&c.push({id:"output",label:"Output",op:"is",value:C.find(n=>n.value===a.output)?.label??a.output,onRemove:()=>s({output:"any"})}),a.state!=="any"&&c.push({id:"state",label:"State",op:"is",value:_.find(n=>n.value===a.state)?.label??a.state,onRemove:()=>s({state:"any"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:te.map(n=>e.jsx(d,{type:"button",variant:a.kind===n.value?"secondary":"ghost","aria-pressed":a.kind===n.value,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>s({kind:n.value}),children:n.label},n.value))}),e.jsx(Q,{label:"Automation filters",className:"min-w-0 flex-1",fields:l,chips:c,trailing:u,onClearAll:()=>s(h),hasClearableState:a.kind!=="all"})]})}function ne(a,s){return`flex items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-accent/50 ${a===s-1?"":"border-b"}`}function oe({owner:a,organizationId:s,isWorkspaceLoading:u}){const[l,c]=i.useState(h),n=t=>c(o=>({...o,...t})),m=Z(s??void 0),{data:v=[]}=E({enabled:!!s}),{data:f=[]}=O(),{data:p=[]}=P(s),b=ee(),L=i.useMemo(()=>{const t=new Map;for(const o of v)t.set(o.agentId,o.name);return t},[v]),R=i.useMemo(()=>{const t=new Map;for(const o of f)t.set(o.id,o.label||o.platform||o.id);return t},[f]),y=i.useMemo(()=>new Map(p.map(t=>[t.key,t.name])),[p]),j=i.useMemo(()=>{const t=new Set;for(const o of m.data??[])for(const r of o.triggers??[])typeof r?.connection_id=="number"&&t.add(r.connection_id);return[...t].sort((o,r)=>o-r)},[m.data]),{data:w}=D(s,{connectionIds:j,enabled:j.length>0}),N=i.useMemo(()=>new Map((w??[]).map(t=>[t.id,t])),[w]),x=i.useMemo(()=>q(m.data??[],y,N),[m.data,y,N]),g=i.useMemo(()=>J(x,l),[x,l]),T=u||m.isLoading,k=e.jsx(d,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:e.jsxs(B,{to:"/$owner/automations/new",params:{owner:a},children:[e.jsx(W,{className:"mr-1.5 h-3.5 w-3.5"}),"New automation"]})});return T?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:k}),e.jsx(Y,{label:"Loading automations",actions:!0})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"What runs on its own — on a schedule, on an event, or when you ask."}),e.jsx(se,{facets:l,onChange:n,trailing:k}),x.length===0?e.jsx(A,{icon:F,title:"No automations yet",description:"Automations act on their own — reply to a message, run a nightly summary, react to a ticket. Use New automation to create one."}):g.length===0?e.jsx(A,{icon:I.automations.icon,title:"No automations match this filter",description:"Try another filter.",secondaryActionLabel:"Show all",secondaryOnAction:()=>c(h)}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:g.map((t,o)=>e.jsx(H,{automation:t,agentName:t.automation.managed_agent_id?L.get(t.automation.managed_agent_id)??t.automation.managed_agent_id:null,deviceLabel:t.automation.device_worker_id?R.get(t.automation.device_worker_id)??t.automation.device_worker_id:null,connectorDisplay:(()=>{const r=V(t.automation);return r?z(r,p):null})(),owner:a,rowClass:ne(o,g.length),actions:e.jsxs(e.Fragment,{children:[e.jsx(X,{owner:a,filters:{automationIds:[Number(t.automation.automation_id)],bucket:"automation"},name:t.does}),e.jsx(ae,{pending:b.isPending,onConfirm:()=>b.mutate(t.automation.automation_id)})]})},t.key))})]})}function xe(){const{owner:a}=U.useParams();return e.jsx(G,{className:"gap-3 pt-2.5 pb-8",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(K,{owner:a,children:s=>e.jsx($,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(oe,{owner:s.ownerSlug,organizationId:s.organizationId,isWorkspaceLoading:s.isWorkspaceLoading})})})})})}export{xe as component};
|
|
2
|
+
//# sourceMappingURL=index-BUDr4-Yv.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j9 as o,j as e}from"./index-DdBTTN3y.js";import{A as n}from"./agent-guardrails-route-BJyfalBY.js";import"./model-selector-CgU8SJMF.js";import"./agent-tab-intro-ednTs4WF.js";import"./table-BUqshjxa.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function d(){const{owner:r,agentId:t}=o.useParams();return e.jsx(n,{owner:r,agentId:t})}export{d as component};
|
|
2
|
+
//# sourceMappingURL=index-BYPQWVwD.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j7 as r,j as e}from"./index-DdBTTN3y.js";import{A as m}from"./agent-skills-route-Bv5luNdw.js";import"./agent-skill-context-BAaGpvfS.js";import"./core.esm-CQzL3ObT.js";import"./skill-editor-D_W3QlRz.js";import"./agent-tab-intro-ednTs4WF.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function j(){const{owner:t,agentId:o}=r.useParams();return e.jsx(m,{owner:t,agentId:o})}export{j as component};
|
|
2
|
+
//# sourceMappingURL=index-BfpaPJPj.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ax as r,j as m}from"./index-DdBTTN3y.js";import{M as p}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function v(){const{owner:t}=r.useParams(),o=r.useSearch();return m.jsx(p,{ownerSlug:t,create:!1,createType:o.create_type==="true"})}export{v as component};
|
|
2
|
+
//# sourceMappingURL=index-BicNFLBW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iv as e,j as o,az as n}from"./index-DdBTTN3y.js";import{A as a}from"./agent-connect-pages-DcTuiSt9.js";import"./agent-client-setup-list-DbXtJTsO.js";import"./connector-page-shell-Cs1SjrYB.js";import"./copy-button-DjMWgrBf.js";import"./clients-BJRcMk1A.js";import"./client-rows-36VnmgMK.js";function x(){const{owner:t}=e.useParams();return o.jsx(n,{owner:t,children:({ownerSlug:r})=>o.jsx(a,{owner:r})})}export{x as component};
|
|
2
|
+
//# sourceMappingURL=index-Bsdv5aks.js.map
|