@lobu/runtime-server 24.2.0 → 24.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +24 -2
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/postgres.ts +9 -5
- package/dist/db/migrations/20261101010000_public_source_type_references.sql +157 -0
- package/dist/dependencies.bun.lock +117 -178
- package/dist/owletto/dist/assets/_-DIK0ae_S.js +2 -0
- package/dist/owletto/dist/assets/_-gTbcArpS.js +3 -0
- package/dist/owletto/dist/assets/_agentId-DOmcJZfk.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DW6wRCVC.js +2 -0
- package/dist/owletto/dist/assets/_automationId-B9IcDYBu.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-C6PmMPTA.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-BrJ8Pzze.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-BpJAeYYW.js +2 -0
- package/dist/owletto/dist/assets/_eventId-DarQJo0G.js +2 -0
- package/dist/owletto/dist/assets/_name-DtmNTcUm.js +2 -0
- package/dist/owletto/dist/assets/_owner-Db8at3hk.js +3 -0
- package/dist/owletto/dist/assets/_shape-6iFA8A86.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CXkHn3Nl.js +2 -0
- package/dist/owletto/dist/assets/{_slug-MHQU8ftJ.js → _slug-DBOuBLoX.js} +2 -2
- package/dist/owletto/dist/assets/_viewKey-DC27aIN9.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DuYDieln.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-D2T_a2dj.js → accept-invitation-BbDCVvur.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-V4ftmSN7.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-ColL5rdd.js → agent-card-controls-99mG6H5k.js} +2 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-kMmqQSrf.js +4 -0
- package/dist/owletto/dist/assets/agent-connect-pages-B-NPTFs6.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-C24p9LLg.js → agent-editor-form-DfMTSIvj.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-BvGgfd-h.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-jkf9DjdO.js → agent-loading-shells-Dnmb6W5Y.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-C8j8kRB1.js → agent-permissions-matrix-CbhXlbgY.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-B9giw2u2.js → agent-skill-context-V__2i6Vl.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BMZ3r1bP.js → agent-skills-route-DFXr_bHp.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-D49f-bzP.js → agent-subpage-shell-DWzljvFb.js} +2 -2
- package/dist/owletto/dist/assets/{agent-thread-BGHYHWDO.js → agent-thread-DQIr20H-.js} +4 -4
- package/dist/owletto/dist/assets/agents-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-C8bTa2rv.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
- package/dist/owletto/dist/assets/{app._appId-A51tx2jU.js → app._appId-Bsq40nak.js} +2 -2
- package/dist/owletto/dist/assets/{automation-detail-content-DCAZBKle.js → automation-detail-content-C9Cgr5Zj.js} +2 -2
- package/dist/owletto/dist/assets/automations-CLbeiqTR.js +2 -0
- package/dist/owletto/dist/assets/calendar-DMq3Dtqy.js +2 -0
- package/dist/owletto/dist/assets/{callback-WmyCei3R.js → callback-B-CAz-bK.js} +2 -2
- package/dist/owletto/dist/assets/{card-Cspo-4M6.js → card-SFtxv9f2.js} +2 -2
- package/dist/owletto/dist/assets/{claim-CCKdBtFt.js → claim-DrxIRWKt.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-boZOHuPW.js +2 -0
- package/dist/owletto/dist/assets/client-rows-BJ2PxM4J.js +2 -0
- package/dist/owletto/dist/assets/clients-C7Lnuc3S.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-C8FJbT2P.js → code-editor-rX0t1g5C.js} +2 -2
- package/dist/owletto/dist/assets/connect-BcwgytDV.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-BF-AlunU.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-sDypRDeN.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-C9OkW1tv.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dc6HYr55.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-C6qbqgwF.js +2 -0
- package/dist/owletto/dist/assets/connection-88YzIBK9.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-D7pnWaFB.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-DDJQh8Na.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DDX7Ebc4.js +2 -0
- package/dist/owletto/dist/assets/connector-provenance-Th8ymGec.js +2 -0
- package/dist/owletto/dist/assets/{connector-scope-lists-B44Q9W-j.js → connector-scope-lists-BibdzKl1.js} +2 -2
- package/dist/owletto/dist/assets/{connectors-CTWPDH8f.js → connectors-BqwgLUUK.js} +2 -2
- package/dist/owletto/dist/assets/consent-BR5U7dwb.js +2 -0
- package/dist/owletto/dist/assets/{copy-button-kcjg8Giw.js → copy-button-2swYh4jb.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CoJ5Splc.js → core.esm-CHnfRiEM.js} +2 -2
- package/dist/owletto/dist/assets/{create-CQE5rD0i.js → create-BsPVnRpG.js} +2 -2
- package/dist/owletto/dist/assets/create-CVPYVOR5.js +2 -0
- package/dist/owletto/dist/assets/create-QFjmhOEU.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DmCOFbRT.js +3 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLDDVtLS.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CeUS_78Q.js → cronstrue-CKwjNYgj.js} +2 -2
- package/dist/owletto/dist/assets/device-CKup7kvB.js +2 -0
- package/dist/owletto/dist/assets/device-pin-tombstone-xGhCTU5_.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-B1H_ivDT.js +2 -0
- package/dist/owletto/dist/assets/{entity-avatar-BZIa-7i5.js → entity-avatar-HloBoalJ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-BSW_EG0W.js +2 -0
- package/dist/owletto/dist/assets/entity-page-D-WDWrAe.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-BCBdFndu.js +2 -0
- package/dist/owletto/dist/assets/event-card-Mcxv56DG.js +2 -0
- package/dist/owletto/dist/assets/event-detail-DXifj49J.js +2 -0
- package/dist/owletto/dist/assets/events-feed-BysC9HgU.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-BQm-ubB1.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-BMiXl54z.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-D7W80sJO.js +2 -0
- package/dist/owletto/dist/assets/identity-N0cAO9BR.js +2 -0
- package/dist/owletto/dist/assets/index-4gCDI7m4.js +7950 -0
- package/dist/owletto/dist/assets/index-B4wXJwQY.js +2 -0
- package/dist/owletto/dist/assets/index-BNaI5GpS.js +2 -0
- package/dist/owletto/dist/assets/index-BUUrHuJJ.js +2 -0
- package/dist/owletto/dist/assets/index-BqrvJmLh.js +2 -0
- package/dist/owletto/dist/assets/{index-DRbaESbJ.js → index-C-WaHj1Y.js} +2 -2
- package/dist/owletto/dist/assets/index-CnvQEA5V.js +2 -0
- package/dist/owletto/dist/assets/index-Cq7P2c_E.js +2 -0
- package/dist/owletto/dist/assets/{index-BhBYXtEN.js → index-CzoK57xp.js} +2 -2
- package/dist/owletto/dist/assets/index-D3omC3Us.js +2 -0
- package/dist/owletto/dist/assets/{index-Bhop_otG.js → index-D4-uel59.js} +2 -2
- package/dist/owletto/dist/assets/index-DDGdlQrt.css +1 -0
- package/dist/owletto/dist/assets/index-DFEW7hMg.js +2 -0
- package/dist/owletto/dist/assets/index-DVV-WWuT.js +2 -0
- package/dist/owletto/dist/assets/index-DduQ_e9q.js +2 -0
- package/dist/owletto/dist/assets/index-DutlI1d-.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-4sMmayDd.js → json-diff-E5D-NGYT.js} +4 -4
- package/dist/owletto/dist/assets/{list-skeleton-BafzvpOM.js → list-skeleton-Bp4HNgJ9.js} +2 -2
- package/dist/owletto/dist/assets/login-7F48UJGx.js +2 -0
- package/dist/owletto/dist/assets/logout-DxmfsVKD.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-Dit3MXBQ.js → member-scope-gate-vp3FihBD.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-CfDmjhDl.js +74 -0
- package/dist/owletto/dist/assets/model-Dn40BUzs.js +2 -0
- package/dist/owletto/dist/assets/{model-selector-BeFuFH7p.js → model-selector-88PJnyTq.js} +2 -2
- package/dist/owletto/dist/assets/models-BBK_n2RP.js +2 -0
- package/dist/owletto/dist/assets/new-4ruWHLR5.js +2 -0
- package/dist/owletto/dist/assets/{new-ChwqLmVY.js → new-CvX8_gIb.js} +2 -2
- package/dist/owletto/dist/assets/new-gMD1PHTL.js +2 -0
- package/dist/owletto/dist/assets/oauth-workspace-access-D9BNmyMY.js +2 -0
- package/dist/owletto/dist/assets/organization-BHcp5Pzg.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-0sa10jER.js +2 -0
- package/dist/owletto/dist/assets/{permissions-C6UFdvz2.js → permissions-hhxosugv.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-B4CSiyLB.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-CsenJeXa.js +2 -0
- package/dist/owletto/dist/assets/record-activity-D7bRaMk2.js +2 -0
- package/dist/owletto/dist/assets/{record-session-CJzFoVKc.js → record-session-CWXnCVln.js} +2 -2
- package/dist/owletto/dist/assets/{linked-record-peek-B0_B4PnF.js → renderer-7EGgTVX0.js} +30 -30
- package/dist/owletto/dist/assets/reset-password-CFUzxH7m.js +2 -0
- package/dist/owletto/dist/assets/runs-BPtQBTRN.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-Bj63_hb9.js +2 -0
- package/dist/owletto/dist/assets/{schema-type-editor-panel-DcJqbCrU.js → schema-type-editor-panel-CAhOB648.js} +2 -2
- package/dist/owletto/dist/assets/{settings-Dg0D_l_w.js → settings-Dg6nxKyw.js} +2 -2
- package/dist/owletto/dist/assets/settings-KJJ6WihO.js +2 -0
- package/dist/owletto/dist/assets/skills-ayt06_o2.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-Bh5F4C5K.js +2 -0
- package/dist/owletto/dist/assets/{status-dot-_LQZmEIX.js → status-dot-D3FoDRcc.js} +2 -2
- package/dist/owletto/dist/assets/table-DFcJRNk7.js +2 -0
- package/dist/owletto/dist/assets/use-automations-BHoV0dLs.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-CAFbh-Dk.js → use-mention-search-C3rWLuKm.js} +2 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-Ct-jt7O0.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-mKoqDsaD.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-DHrDO333.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +100623 -98589
- package/npm-shrinkwrap.json +615 -960
- package/package.json +7 -10
- package/vendor/@better-auth-kysely-adapter/.bun-tag-abf95749a412716 +0 -0
- package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
- package/vendor/@better-auth-kysely-adapter/README.md +17 -0
- package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
- package/vendor/@better-auth-kysely-adapter/package.json +52 -0
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/connector-sdk/dist/redact.js +130 -0
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +49 -20
- package/vendor/core/dist/contracts/tools/manage-entity.js +23 -5
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
- package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/index.d.ts +1 -0
- package/vendor/core/dist/index.js +4 -1
- package/vendor/core/dist/logger.js +8 -2
- package/vendor/core/dist/otel.d.ts +13 -2
- package/vendor/core/dist/otel.js +98 -44
- package/vendor/core/dist/trace-context.d.ts +12 -0
- package/vendor/core/dist/trace-context.js +50 -0
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/package.json +26 -5
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-Cjvw31gU.js +0 -2
- package/dist/owletto/dist/assets/_-iToIRRFt.js +0 -3
- package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +0 -2
- package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +0 -2
- package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +0 -2
- package/dist/owletto/dist/assets/_name-BsOZmvlH.js +0 -2
- package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +0 -3
- package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-_G_lDz5K.js +0 -2
- package/dist/owletto/dist/assets/agent-client-setup-list-BgyLhJCo.js +0 -5
- package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +0 -2
- package/dist/owletto/dist/assets/agents-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/automations-C05k-Xw6.js +0 -2
- package/dist/owletto/dist/assets/client-activity-scopes-CmK3DkSP.js +0 -2
- package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +0 -2
- package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +0 -2
- package/dist/owletto/dist/assets/connection-DJd9bnEc.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-IO6G5QjL.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +0 -2
- package/dist/owletto/dist/assets/connector-provenance-bmBJJ9B4.js +0 -2
- package/dist/owletto/dist/assets/consent-C_WBfmQ8.js +0 -2
- package/dist/owletto/dist/assets/create-DQNlRTUX.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +0 -3
- package/dist/owletto/dist/assets/create-lOFSQV_5.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +0 -2
- package/dist/owletto/dist/assets/device-Br9JHadR.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +0 -2
- package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +0 -2
- package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +0 -2
- package/dist/owletto/dist/assets/event-detail-C25TvOb_.js +0 -2
- package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +0 -2
- package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +0 -2
- package/dist/owletto/dist/assets/identity-BkK8ggdp.js +0 -2
- package/dist/owletto/dist/assets/index-Bw5iV_J7.js +0 -2
- package/dist/owletto/dist/assets/index-C3dpyynY.js +0 -2
- package/dist/owletto/dist/assets/index-C3zAbslo.js +0 -2
- package/dist/owletto/dist/assets/index-CGKN_WN_.js +0 -2
- package/dist/owletto/dist/assets/index-CgRaCOzW.js +0 -2
- package/dist/owletto/dist/assets/index-DfIoxD5Q.js +0 -2
- package/dist/owletto/dist/assets/index-DijuudSs.js +0 -2
- package/dist/owletto/dist/assets/index-Dr7bouPX.css +0 -1
- package/dist/owletto/dist/assets/index-JmEl29py.js +0 -7950
- package/dist/owletto/dist/assets/index-NK2VKPoL.js +0 -2
- package/dist/owletto/dist/assets/index-_5qsmBkt.js +0 -2
- package/dist/owletto/dist/assets/index-qkOKpRYs.js +0 -2
- package/dist/owletto/dist/assets/index-wzYkECAe.js +0 -2
- package/dist/owletto/dist/assets/login-XL5XxN6y.js +0 -2
- package/dist/owletto/dist/assets/logout-CMxdhLbM.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +0 -74
- package/dist/owletto/dist/assets/models-BAVaDnKN.js +0 -2
- package/dist/owletto/dist/assets/new-1QLuS1o-.js +0 -2
- package/dist/owletto/dist/assets/new-D21LGMl6.js +0 -2
- package/dist/owletto/dist/assets/oauth-workspace-access-D15LYKSe.js +0 -2
- package/dist/owletto/dist/assets/organization-CoUJYXx7.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CmLy1MZf.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +0 -2
- package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +0 -2
- package/dist/owletto/dist/assets/reset-password-Y-WO77iR.js +0 -2
- package/dist/owletto/dist/assets/runs-B0zVYb-w.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +0 -2
- package/dist/owletto/dist/assets/runs-table-9OVdfPXZ.js +0 -2
- package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +0 -2
- package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +0 -2
- package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +0 -2
- package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{cJ as $e,bI as zt,i as ct,r as g,e9 as ut,ea as Ut,a2 as Vt,Q as qt,dF as Jt,u as mt,j as t,h as xe,eb as st,ec as ze,ed as pt,ee as Kt,dI as Ht,bj as xt,ef as Qt,eg as Wt,cV as Yt,eh as ft,ei as Gt,ej as Xt,L as _e,dO as Zt,ek as es,B as E,dK as Ue,cB as Ve,V as ie,ct as ht,dL as yt,dM as ts,dx as ss,dz as ns,dy as rs,b1 as as,b2 as is,$ as gt,b3 as os,el as ls,v as ds,w as cs,t as us,bT as Ee,ca as nt,em as ms,a5 as ps,en as rt,eo as xs,I as fs,ep as hs,bK as ys,aa as oe,cF as gs,cE as vs,eq as js,er as _s,es as bs,et as Ns,b_ as ws,eu as ks,c2 as Cs,ev as Ss,du as As,ew as Rs,X as Es,bk as Is,be as Ts,ex as $s,ey as Os,dG as Ps}from"./index-4gCDI7m4.js";import{R as Ms,p as Ds}from"./use-scroll-sentinel-Ct-jt7O0.js";import{b as vt}from"./use-automations-BHoV0dLs.js";import{l as Fs,s as Ls,S as Bs,J as zs}from"./renderer-7EGgTVX0.js";import{C as Us,J as Fe}from"./json-diff-E5D-NGYT.js";import{C as at}from"./copy-button-2swYh4jb.js";function Vs(e,s){if(!e||typeof e!="object"||Array.isArray(e))return null;const n=e.title;if(typeof n!="string")return null;const a=n.trim();return a&&a!==s?a:null}function jt(e){const s=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(n=>{const r=s.find(o=>o&&typeof o=="object"&&"id"in o&&o.id===n);return{id:String(n??"unknown"),name:typeof r?.name=="string"?r.name:`Record ${String(n??"unknown")}`}})}function _t(e,s){return s==="rejected"?"The proposed relationship change was rejected. Both records remain available.":s==="failed"?"The relationship change failed. Both records remain available.":s==="completed"?e==="link"?"The records were linked. Both records remain available.":"The relationship was removed. Both records remain available.":s==="approved"||s==="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 Jn(e){const s=jt(e.proposal);return{title:e.action==="link"?"Link records":"Unlink records",icon:"entity",impact:{level:"normal"},tone:"default",blocks:[...s.map((n,a)=>({type:"text",label:a===0?"From":"To",value:n.name})),{type:"text",label:"Relationship",value:String(e.proposal?.relationship_type??e.proposal?.relationship_type_slug??"Relationship")},{type:"text",value:_t(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 bt(e,s,n){return{queryKey:["event-view-match",e,s.key,s.content_hash,n],queryFn:async()=>{try{const r=(await $e("open_view",{key:s.key,scope:{event:n}},{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 zt&&(a.status===400||a.status===404))return null;throw a}},staleTime:6e4}}function Kn(e,s){const n=ct(e??{slug:null,organizationId:null}),a=e?.slug??null,r=g.useMemo(()=>a?ut(n.data??[]):[],[a,n.data]),o=Ut({queries:r.map(l=>bt(a,l,s))});return a?{views:r.flatMap((l,h)=>{const i=o[h]?.data;return i?[{...l,eventId:i}]:[]}),isLoading:n.data===void 0?!n.isError:o.some(l=>l.isPending),isError:n.isError||o.some(l=>l.isError),refetch:()=>{n.refetch();for(const l of o)l.isError&&l.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function qs(e,s,n,a){const r=await Promise.all(n.map(o=>e.fetchQuery(bt(s,o,a))));return n.find((o,l)=>r[l])??null}async function Js(e,s,n,a){const r=await Vt(`${qt}/api/${encodeURIComponent(e)}/events/${s}/actions/${encodeURIComponent(n.action)}`,{method:"POST",timeoutMs:9e4,credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:n.value,interaction_id:a})});return await Jt(r,"Could not record interaction"),r.json()}function P(e){if(typeof e!="string")return;const s=e.trim();return s.length>0?s:void 0}function Le(e){return typeof e=="boolean"?e:void 0}function Ks(e,s,n){const a=(n??"").toLowerCase();return!!(a==="prepare_comment"||a==="verify_staged_comment"||a.includes("prepare_")||a.includes("verify_staged")||s?.prepared===!0||typeof s?.verified=="boolean"||P(s?.reason_preview)&&P(s?.message)||P(e?.body)&&(P(e?.post_url)||P(e?.activity_id)))}function Hs(e,s,n){if(!Ks(e,s,n))return null;const a=(n??"").toLowerCase(),r=P(s?.body)??P(e?.body),o=P(s?.reason_preview)??P(e?.reason),l=P(s?.post_url)??P(e?.post_url)??(P(e?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${P(e?.activity_id)}`:void 0),h=Le(s?.prepared),i=Le(s?.verified),u=Le(s?.banner_shown),_=P(s?.message),m=s?.match&&typeof s.match=="object"?s.match:null,v=P(m?.text_preview),w=P(m?.author);let I="generic";a==="verify_staged_comment"||a.includes("verify")||typeof i=="boolean"?I="verify":(a==="prepare_comment"||a.includes("prepare")||h===!0||r&&l)&&(I="prepare");const y=[];return h===!0&&y.push("Staged — not posted"),h===!1&&y.push("Not staged"),i===!0&&y.push("Verified posted"),i===!1&&y.push("Not verified as posted"),u===!0&&y.push("In-page banner"),u===!1&&y.push("No banner"),{kind:I,message:_,reason:o,body:r,postUrl:l,prepared:h,bannerShown:u,verified:i,matchPreview:v,matchAuthor:w,chips:y}}const it="inline-flex max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs";function qe({peer:e,ownerSlug:s,orgContext:n}){const a=mt();if(e.self||!e.type||!a)return t.jsx("span",{className:xe(it,"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:xe(it,"hover:bg-muted",r&&"ring-1 ring-primary"),onClick:o=>{o.stopPropagation(),a.open(Fs({...typeof e.id=="number"?{entityId:e.id}:{record:{type:e.type,key:e.id}},ownerSlug:s,orgContext:n,name:e.name}))},children:t.jsx("span",{className:"truncate",children:e.name})})}function Hn(e,s=e.relationship_type_name){const n=e.from_entity_name??`Record #${e.from_entity_id}`,a=e.to_entity_name??`Record #${e.to_entity_id}`;return e.is_symmetric?`${n} ${s} ${a}`:`${n} → ${s} → ${a}`}function Qn({row:e,entityId:s,entityType:n,ownerSlug:a,orgContext:r,label:o=e.relationship_type_name}){const l=(h,i,u)=>t.jsx(qe,{peer:{id:h,name:i??`Record #${h}`,type:u,self:h===s&&(typeof h=="number"||u===n)},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.is_symmetric&&t.jsx(st,{"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(st,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),l(e.to_entity_id,e.to_entity_name,e.to_entity_type)]})}function Wn({count:e,onRetry:s}){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:s,children:"Retry"})]}):null}const Nt={name:"Name",slug:"URL slug",parent_id:"Parent",content:"Content changed"};function re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ie(e){return e==null||e===""}function Qs(e,s){return ze(e??null)===ze(s??null)}function Ws(e){return!!(e?.type==="array"&&(e.items?.type==="object"||e.items?.properties))}function Ys(e){return!!(e&&(e.type==="object"||e.properties)&&e.type!=="array")}function Qe(e,s){return Ls({key:e,prop:s??{}})}function Gs(e,s){return e?.properties?.[s]}function Je(e,s,n,a,r){if(Qs(s,n))return;const o=i=>Array.isArray(i)?i:[];if((Array.isArray(s)||Ie(s))&&(Array.isArray(n)||Ie(n))&&(Array.isArray(s)||Array.isArray(n)||a?.type==="array")){const i=o(s),u=o(n);if(Ws(a)||[...i,...u].some(p=>re(p))){const p=Math.min(i.length,u.length);for(let k=0;k<p;k++)Je([...e,`item ${k+1}`],i[k],u[k],a?.items,r);const C=Math.max(0,u.length-i.length),q=Math.max(0,i.length-u.length);(C||q)&&r.push({kind:"items",path:e,added:C,removed:q});return}const m=p=>ze(p),v=new Set(i.map(m)),w=new Set(u.map(m)),I=u.filter(p=>!v.has(m(p))),y=i.filter(p=>!w.has(m(p)));r.push(I.length||y.length?{kind:"values",path:e,added:I,removed:y,prop:a?.items}:{kind:"reordered",path:e});return}if((re(s)||Ie(s))&&(re(n)||Ie(n))&&(re(s)||re(n)||Ys(a))){const i=re(s)?s:{},u=re(n)?n:{},_=[...new Set([...Object.keys(a?.properties??{}),...Object.keys(i),...Object.keys(u)])];for(const m of _){const v=Gs(a,m);Je([...e,Qe(m,v)],i[m],u[m],v,r)}return}r.push({kind:"set",path:e,old:s,new:n,prop:a})}function Xs(e,s){const n=Nt[e.field];if(n)return e.field==="content"?[{kind:"note",path:[n]}]:e.field==="parent_id"?[{kind:"parent",path:[n],old:e.old,new:e.new}]:[{kind:"set",path:[n],old:e.old,new:e.new}];const a=s?.properties?.[e.field],r=[];return Je([Qe(e.field,a)],e.old,e.new,a,r),r}function Zs(e,s){const n=s?.properties;return e.map(a=>a.field==="content"?"Content":Nt[a.field]??Qe(a.field,n?.[a.field]))}const en="entity.updated",tn=new Set(["link","unlink","update_link"]);function ot(e){const s=typeof e=="string"||typeof e=="number"?Number(e):Number.NaN;return Number.isSafeInteger(s)&&s>0?s:null}function sn(e){const s=e.split("_").join(" ").trim();return s?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:e}function nn(e){const s=e.metadata;if(e.semantic_type!=="change"||!s||s._lobu_relationship_change!==!0||typeof s.op!="string"||!tn.has(s.op))return null;const n=ot(s.fromEntityId),a=ot(s.toEntityId);if(n==null||a==null)return null;const r=typeof s.relationshipTypeSlug=="string"?s.relationshipTypeSlug:null,o=Array.isArray(s.changes)?s.changes:[];return{op:s.op,fromId:n,toId:a,typeLabel:r?sn(r):"relationship",changedFields:o.flatMap(l=>l&&typeof l=="object"&&typeof l.field=="string"?[l.field]:[])}}function Oe({id:e,recordId:s,ownerSlug:n}){const a=e===s,r={slug:n},{data:o,isLoading:l,isError:h}=pt(a?void 0:e,r);return a?t.jsx(qe,{peer:{id:e,name:"this record",type:null,self:!0},ownerSlug:n,orgContext:r}):l?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Record #",e]}):h||!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(qe,{peer:{id:e,name:o.name,type:o.entity_type},ownerSlug:n,orgContext:r})}function rn({change:e,recordId:s,ownerSlug:n}){const a=e.op==="link"?`Linked as ${e.typeLabel}`:e.op==="unlink"?`Unlinked ${e.typeLabel}`:`Updated ${e.typeLabel} link`,r=s===e.toId&&s!==e.fromId,o=s===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(Oe,{id:e.fromId,ownerSlug:n}):null,t.jsx("span",{children:r?`${a} from`:a}),r?t.jsx(Oe,{id:e.fromId,recordId:s,ownerSlug:n}):t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:"→"}),t.jsx(Oe,{id:e.toId,recordId:s,ownerSlug:n})]}),e.op==="update_link"&&e.changedFields.length>0?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",e.changedFields.join(", ")]}):null]})}function an(e){if(!Array.isArray(e)||e.length===0)return null;const s=[];for(const n of e){if(!n||typeof n!="object"||typeof n.field!="string")return null;const{field:a,old:r,new:o}=n;s.push({field:a,old:r??null,new:o??null})}return s}function on(e){const s=nn(e);if(s)return{kind:"relationship",change:s};const n=e.metadata;if(e.semantic_type!=="change"||!n)return null;const a=n._lobu_event_type;if(a!==en&&(a!==void 0||n.category))return null;const r=an(n.changes);if(!r)return null;const o=e.entity_ids?.[0];return{kind:"fields",entityId:typeof o=="number"?o:null,changes:r}}function wt(e,s){const n={slug:s},{data:a}=pt(e.entityType?void 0:e.entityId??void 0,n),{data:r}=Kt(e.entityType??a?.entity_type??"",n);return r?.metadata_schema}const ln=4;function Te({value:e,prop:s}){return t.jsx("span",{className:"inline-block max-w-[18rem] truncate align-bottom",title:typeof e=="string"?e:void 0,children:t.jsx(Bs,{value:e,prop:s,empty:t.jsx("span",{className:"italic",children:"empty"})})})}function lt({id:e,ownerSlug:s}){const n=typeof e=="number"||typeof e=="string"?Number(e):Number.NaN;return Number.isSafeInteger(n)&&n>0?t.jsx(Oe,{id:n,ownerSlug:s}):t.jsx("span",{className:"italic text-muted-foreground",children:"empty"})}function Ke(e,s){return`${e} ${s}${e===1?"":"s"}`}function dn({line:e,ownerSlug:s}){const n=t.jsx("span",{className:"text-muted-foreground",children:e.path.join(" · ")});switch(e.kind){case"note":return n;case"set":return t.jsxs(t.Fragment,{children:[n,": ",t.jsx(Te,{value:e.old,prop:e.prop})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(Te,{value:e.new,prop:e.prop})]});case"parent":return t.jsxs(t.Fragment,{children:[n,": ",t.jsx(lt,{id:e.old,ownerSlug:s})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(lt,{id:e.new,ownerSlug:s})]});case"items":return t.jsxs(t.Fragment,{children:[n,":"," ",[e.added?`${Ke(e.added,"item")} added`:null,e.removed?`${Ke(e.removed,"item")} removed`:null].filter(Boolean).join(", ")]});case"values":return t.jsxs(t.Fragment,{children:[n,":",e.added.map((a,r)=>t.jsxs("span",{className:"ml-1.5",children:["+",t.jsx(Te,{value:a,prop:e.prop})]},`+${r}`)),e.removed.map((a,r)=>t.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["−",t.jsx(Te,{value:a,prop:e.prop})]},`-${r}`))]});case"reordered":return t.jsxs(t.Fragment,{children:[n,": reordered"]})}}function cn({change:e,ownerSlug:s}){const n=wt(e,s);return t.jsxs(t.Fragment,{children:["Updated ",Zs(e.changes,n).join(", ")]})}function We({changes:e,entityId:s,entityType:n,ownerSlug:a,showAll:r=!1}){const o=wt({entityId:s,entityType:n},a),[l,h]=g.useState(r),i=e.flatMap(m=>Xs(m,o)),u=l?i:i.slice(0,ln),_=i.length-u.length;return t.jsxs("ul",{"data-testid":"field-changes",className:"space-y-0.5 text-sm",children:[u.map((m,v)=>t.jsx("li",{className:"min-w-0 truncate",children:t.jsx(dn,{line:m,ownerSlug:a})},v)),_>0?t.jsx("li",{children:t.jsxs("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:m=>{m.stopPropagation(),h(!0)},children:["+",Ke(_,"more change")]})}):null]})}function un({event:e,recordId:s,ownerSlug:n}){return e.kind==="relationship"?t.jsx(rn,{change:e.change,recordId:s,ownerSlug:n}):t.jsx(cn,{change:e,ownerSlug:n})}function mn({event:e,ownerSlug:s}){return e.kind==="fields"?t.jsx(We,{changes:e.changes,entityId:e.entityId,ownerSlug:s}):null}function pn(e){return e.semantic_type==="change"&&(e.metadata?.category==="config"||e.metadata?.category==="deployment")}function ae(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function xn({content:e,detail:s=!1}){const n=e.metadata??{},a=e.payload_data??{},r=n.category==="deployment",o=typeof n.apply_id=="string"?n.apply_id:null,l=ae(a.manifest),h=o&&/^apl_[A-Za-z0-9-]{1,48}$/.test(o)&&e.origin_type==="deployment"&&e.origin_id===`deployment_${o}`&&(n.status==="succeeded"||n.status==="partial_failure")&&ae(l?.state);return t.jsxs("div",{className:"space-y-3","data-testid":"config-change-event",children:[t.jsx(Us,{showAttribution:s,operation:r?String(n.status??"Apply"):typeof n.op=="string"?n.op:null,actor:e.author_name??(typeof n.actor_source=="string"?n.actor_source:null),createdAt:e.occurred_at??e.created_at,resource:r?"Configuration apply":`${n.resource_kind??"Configuration"} · ${n.resource_id??""}`,changedFields:Array.isArray(n.changed_fields)?n.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(at,{text:o,label:"Copy apply ID"})]}):null,s?r?t.jsxs(t.Fragment,{children:[typeof n.rollback_of=="string"?t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["Restores apply ",n.rollback_of]}):null,ae(n.counts)?t.jsx("dl",{className:"flex flex-wrap gap-4 text-xs",children:Object.entries(ae(n.counts)??{}).map(([i,u])=>t.jsxs("div",{children:[t.jsx("dt",{className:"text-muted-foreground",children:i}),t.jsx("dd",{children:String(u)})]},i))}):null,typeof a.error=="string"?t.jsx("p",{className:"text-sm text-destructive",children:a.error}):null,h?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(at,{text:`lobu rollback ${o}`,label:"restore command",iconOnly:!0})]})]}):null,t.jsx(Fe,{before:null,after:l})]}):Object.hasOwn(a,"before")?t.jsx(Fe,{before:ae(a.before),after:ae(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(Fe,{before:null,after:ae(a.state)})]}):null]})}function je(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function fn({template:e,data:s,onAction:n}){const[a,r]=g.useState(null),[o,l]=g.useState(!1),[h,i]=g.useState(null),[u,_]=g.useState(!1),m=g.useRef(!1),v=g.useRef(!0);g.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const w=async I=>{if(!(!n||m.current)){m.current=!0,l(!0),i(null),_(!1);try{const y=await n(I);if(!v.current)return;if(je(y)&&y.kind==="sdk"){const p=y.result;if(!je(p)||p.success!==!0){const C=je(p)&&je(p.error)?p.error.message:null;throw new Error(typeof C=="string"?C:"Could not update this event.")}if(p.return_truncated||!je(p.return_value))throw new Error("The update did not return a complete data object.");r(p.return_value),_(!0)}}catch(y){v.current&&i(y instanceof Error?y.message:"Could not update this event.")}finally{m.current=!1,v.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,u?t.jsx("p",{role:"status",className:"sr-only",children:"Updated"}):null,h?t.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:[h," Previous data is still shown."]}):null,t.jsx("fieldset",{disabled:!n||o,"aria-busy":o,className:"min-w-0",children:t.jsx(zs,{template:{root:e.root},data:a??s,onAction:n?w:void 0,interactions:e.interactions})})]})}function kt(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 hn={};function fe(e){return e.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,s=>s.toUpperCase())}const yn={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function gn(e){return e.author_name?e.author_name:e.platform?fe(e.platform):e.origin_type?yn[e.origin_type]??fe(e.origin_type):null}function vn(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(s=>typeof s!="object")?e.map(s=>String(s)).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 Be=1e5;function dt({value:e}){const s=JSON.stringify(e,null,2)??"null",n=s.length>Be;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:n?s.slice(0,Be):s}),n&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",Be.toLocaleString()," of"," ",s.length.toLocaleString()," characters."]})]})}function jn(e){return Object.entries(e).filter(([,s])=>s==null?!1:typeof s=="string"?s.trim().length>0:Array.isArray(s)?s.length>0:typeof s=="object"?Object.keys(s).length>0:!0).sort(([s],[n])=>s.localeCompare(n))}function _n({breakdown:e}){if(!e)return null;const s=[{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:s.map(n=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-20 text-muted-foreground",children:n.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:`${n.value/n.max*100}%`}})}),t.jsx("span",{className:"w-8 text-right",children:n.value})]},n.label))})}function bn({slug:e,value:s,isManual:n}){return t.jsxs(ie,{variant:"secondary",className:"text-xs",children:[e,": ",s,n&&t.jsx(ft,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Nn(e){if(e&&typeof e=="object"){const s=e;if(Array.isArray(s.values))return{values:s.values.map(n=>String(n)).filter(n=>n.length>0),isManual:s.is_manual===!0};if(s.value!==void 0&&s.value!==null)return{values:[String(s.value)],isManual:s.is_manual===!0};if(typeof s.values=="string"&&s.values.length>0)return{values:[s.values],isManual:s.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 Ct(e,s){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 s||"pending_approval"}function He(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function wn(e){return e.replace(/\s+[—-]\s+pending approval$/i,"")}function Pe(e){return e.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,s=>s.toUpperCase())}function kn(e){const s=Object.keys(e.fields),n=s.map(Pe).join(", ")||"field",a=s.length===1?"field":"fields";return`Update ${e.entityType?Pe(e.entityType).toLowerCase():"entity"} ${a}: ${n}`}function Cn(e,s){const n=He(s.fields);if(!n||Object.keys(n).length===0||s.action_key!=="entity_field_change"&&s.tool!=="entity_field_change")return null;const a=He(s.current)??{},r=e;return{fields:n,current:a,reason:typeof s.reason=="string"?s.reason:void 0,automationId:s.automation_id!=null?String(s.automation_id):void 0,automationName:typeof s.automation_name=="string"?s.automation_name:void 0,automationAgentId:typeof s.automation_agent_id=="string"?s.automation_agent_id:void 0,entityType:typeof s.entity_type=="string"?s.entity_type:void 0,entityName:(typeof s.entity_name=="string"?s.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof s.entity_slug=="string"?s.entity_slug:void 0,parentSlug:typeof s.parent_slug=="string"?s.parent_slug:void 0,parentEntityType:typeof s.parent_entity_type=="string"?s.parent_entity_type:void 0,attribution:typeof s.attribution=="string"?s.attribution:void 0,initiator:s.initiator&&typeof s.initiator=="object"?s.initiator:void 0}}function Sn(e){const s=e.entityType?Pe(e.entityType).toLowerCase():"entity";return`${Pe(e.operation)} ${s}`}function An(e,s){if(s.action_key!=="entity_change"&&s.tool!=="entity_change")return null;const n=s.action;if(n!=="create"&&n!=="delete"&&n!=="link"&&n!=="unlink")return null;const a=e;return{operation:n,proposal:He(s.proposal),reason:typeof s.reason=="string"?s.reason:void 0,automationId:s.automation_id!=null?String(s.automation_id):void 0,automationName:typeof s.automation_name=="string"?s.automation_name:void 0,automationAgentId:typeof s.automation_agent_id=="string"?s.automation_agent_id:void 0,entityType:typeof s.entity_type=="string"?s.entity_type:void 0,entityName:(typeof s.entity_name=="string"?s.entity_name:void 0)??a.entity_name??void 0,entitySlug:typeof s.entity_slug=="string"?s.entity_slug:void 0,parentSlug:typeof s.parent_slug=="string"?s.parent_slug:void 0,parentEntityType:typeof s.parent_entity_type=="string"?s.parent_entity_type:void 0,attribution:typeof s.attribution=="string"?s.attribution:void 0,proposerRationale:typeof s.proposer_rationale=="string"?s.proposer_rationale:void 0,initiator:s.initiator&&typeof s.initiator=="object"?s.initiator:void 0}}function Rn(e,s){return!s.entityType||!s.entitySlug?null:Ps(e,s.parentEntityType&&s.parentSlug?[{entity_type:s.parentEntityType,slug:s.parentSlug},{entity_type:s.entityType,slug:s.entitySlug}]:[{entity_type:s.entityType,slug:s.entitySlug}])}function St({ownerSlug:e,runId:s,details:n}){const r=vt(n.automationId,void 0,void 0,{ownerSlug:e,includeVersions:!1}).data?.automation,o=Ds(n.initiator,n.attribution,n.automationId),l=r?.automation_name??n.automationName??o;return t.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",n.automationId?t.jsx(_e,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:n.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}),s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:" · "}),t.jsxs(_e,{to:"/$owner/events",params:{owner:e},search:{run_ids:String(s)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",s]})]})]})}function At({ownerSlug:e,details:s}){const n=Rn(e,s);return s.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:n?t.jsx(_e,{to:n,className:"underline-offset-4 hover:underline",children:s.entityName}):s.entityName})]}):null}function En({ownerSlug:e,runId:s,details:n}){return t.jsxs("div",{className:"space-y-3",children:[t.jsx(St,{ownerSlug:e,runId:s,details:n}),t.jsx(At,{ownerSlug:e,details:n}),t.jsx("div",{className:"rounded-md border border-border/70 px-3 py-2",children:t.jsx(We,{changes:Object.entries(n.fields).map(([a,r])=>({field:a,old:n.current[a]??null,new:r??null})),entityType:n.entityType,ownerSlug:e,showAll:!0})}),n.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:n.reason})]})]})}function In({ownerSlug:e,runId:s,details:n,status:a}){const{operation:r}=n,o=r==="link"||r==="unlink";return t.jsxs("div",{className:"space-y-3",children:[t.jsx(St,{ownerSlug:e,runId:s,details:n}),!o&&t.jsx(At,{ownerSlug:e,details:n}),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?_t(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:[jt(n.proposal).map((l,h)=>t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:h===0?"From: ":"To: "}),l.name]},l.id)),t.jsxs("div",{className:"text-muted-foreground",children:["Relationship:"," ",String(n.proposal?.relationship_type??n.proposal?.relationship_type_slug??"Relationship")]})]})]}),!o&&n.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(n.proposal,null,2)})]}),n.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:n.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:n.proposerRationale})]}),n.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:n.reason})]})]})}function Tn({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(s=>t.jsx(ie,{variant:"outline",className:"text-[10px] font-normal",children:s},s))}),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(gt,{className:"h-3 w-3"})]})]})}function $n({ownerSlug:e,content:s,batchReview:n}){const a=s.metadata||{},r=s.run_id??void 0,o=Cn(s,a),l=An(s,a),h=(o?kn(o):l?Sn(l):void 0)||a.operation_name||a.action_name||(s.title?wn(s.title):void 0)||"Action",i=a.connection_name,u=a.operation_key||a.action_key||null,_=s.interaction_input_schema||a.input_schema||null,m=g.useMemo(()=>s.interaction_input||a.action_input||a.operation_input||hn,[s.interaction_input,a.action_input,a.operation_input]),v=s.interaction_output||a.action_output||void 0,w=Hs(m,v??null,u),I=s.interaction_error||a.error_message||void 0,y=Ct(s.interaction_status,a.status),p=a.reviewed_by_name||a.reviewed_by_id||void 0,C=a.reject_reason||void 0,q=a.initiator,k=bs({slug:e}),D=Ns({slug:e}),F=ws(s.id,ks(_,m),_),{values:M,setValues:$}=F,[b,B]=g.useState(null),[c,z]=g.useState(!1),[T,H]=g.useState(""),N=y==="pending_approval"&&b?b:y,S=N==="pending_approval",Z=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(xt,{className:"h-4 w-4 text-yellow-500"}),t.jsx("span",{className:"font-medium",children:h}),i&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",i]}),N==="confirmed"&&t.jsx(ie,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:"Approved"}),N==="completed"&&t.jsx(ie,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),N==="failed"&&t.jsx(ie,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),N==="rejected"&&t.jsx(ie,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!o&&!l&&(s.author_name||p)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[s.author_name&&t.jsxs("span",{children:["Requested by"," ",t.jsx(Ms,{ownerSlug:e,initiator:q,clientName:s.author_name,fallback:s.author_name})]}),s.author_name&&p&&t.jsx("span",{children:"·"}),p&&t.jsxs("span",{children:[N==="rejected"?"Rejected":"Approved"," by"," ",t.jsx("span",{className:"font-medium text-foreground",children:p})]})]}),o&&t.jsx(En,{ownerSlug:e,runId:r,details:o}),!o&&l&&t.jsx(In,{ownerSlug:e,runId:r,details:l,status:N}),N==="rejected"&&C&&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:"})," ",C]}),w&&t.jsx(Tn,{summary:w}),(S?F.revision:_)&&(S||Object.keys(m).length>0)&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:w?"Full input":"Input"}),S?t.jsxs(t.Fragment,{children:[t.jsx(Cs,{visible:F.hasConflict,onReload:F.reset}),t.jsx(Ss,{schema:F.revision,values:M,onValuesChange:$,fieldIdPrefix:`action-${s.id}-`},`action-${s.id}`)]}):w?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(m,null,2)})]}):t.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}),N==="completed"&&v&&Object.keys(v).length>0&&!w&&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(yt,{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(v,null,2)})]}),N==="completed"&&v&&Object.keys(v).length>0&&w&&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(v,null,2)})]}),N==="failed"&&I&&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(ht,{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:I})]}),S&&!b&&Z&&t.jsxs("div",{className:"pt-1 text-xs text-muted-foreground",children:["Review this proposal with the other changes in its Automation run.",n]}),S&&r&&!b&&!Z&&t.jsx("div",{className:"flex items-center gap-2 pt-1",children:c?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"Reason (optional)",value:T,onChange:A=>H(A.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(E,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>D.mutate({run_id:r,reason:T||void 0},{onSuccess:()=>{B("rejected")}}),disabled:D.isPending,children:[D.isPending&&t.jsx(oe,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),t.jsx(E,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{z(!1),H("")},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[t.jsxs(E,{size:"sm",className:"h-7 text-xs",onClick:()=>k.mutate({run_id:r,input:Rs(M)},{onSuccess:()=>{B("confirmed")}}),disabled:!F.canSubmit||k.isPending||D.isPending,children:[k.isPending?t.jsx(oe,{size:"sm",className:"mr-1"}):t.jsx(As,{className:"h-3 w-3 mr-1"}),"Confirm"]}),t.jsxs(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>z(!0),disabled:k.isPending||D.isPending,children:[t.jsx(Es,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function On({content:e,ownerSlug:s}){const n=e.metadata||{},a=n.kind,r=e.run_id??null,o=typeof n.automation_id=="number"?n.automation_id:null,i=vt(o!=null?String(o):void 0,void 0,void 0,{includeVersions:!1,ownerSlug:s}).data?.automation?.automation_name??(o!=null?`Automation ${o}`:"An Automation"),u=js({slug:s}),_=_s({slug:s}),[m,v]=g.useState(!1),[w,I]=g.useState(""),[y,p]=g.useState(null);if(a==="automation_batch_reject"){const c=n.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"}),c&&t.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:c}),t.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const C=Array.isArray(n.changes)?n.changes:[],q=typeof n.created_count=="number"?n.created_count:C.filter(c=>c.kind==="created").length,k=typeof n.updated_count=="number"?n.updated_count:C.filter(c=>c.kind==="updated").length,D=typeof n.denied_count=="number"?n.denied_count:C.filter(c=>c.kind==="denied").length,F=C.filter(c=>c.kind==="denied"),M=C.filter(c=>c.kind==="updated"&&Object.keys(c.applied||{}).length>0),$=typeof n.pending_proposal_count=="number"?n.pending_proposal_count:null,b=$==null||$>0,B=b?"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 + ",k," updated",D>0&&t.jsxs(t.Fragment,{children:[" + ",D," denied"]})]}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[o!=null?t.jsx(_e,{to:"/$owner/automations/$automationId",params:{owner:s,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"]})]})]}),M.length>0&&t.jsx("div",{className:"mt-3 space-y-2",children:M.map(c=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:c.name}),t.jsx(We,{changes:Object.entries(c.applied).map(([z,T])=>({field:z,old:T.old??null,new:T.new??null})),entityId:c.entityId,ownerSlug:s,showAll:!0})]},c.entityId))}),F.length>0&&t.jsx("div",{className:"mt-3 space-y-1.5",children:F.map(c=>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:[c.name," — not written"]}),c.denied&&t.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[c.denied.reason,t.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",c.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${c.entityId}-${c.name}`))}),r!=null&&y==null&&b&&t.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:m?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"What should the agent change?",value:w,onChange:c=>I(c.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(E,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>_.mutate({run_id:r,reason:w||void 0},{onSuccess:()=>p("rejected")}),disabled:_.isPending,children:[_.isPending&&t.jsx(oe,{size:"sm",className:"mr-1"}),"Reject all"]}),t.jsx(E,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{v(!1),I("")},children:"Cancel"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(E,{size:"sm",className:"h-7 text-xs",onClick:()=>u.mutate({run_id:r},{onSuccess:()=>p("approved")}),disabled:u.isPending||_.isPending,children:[u.isPending&&t.jsx(oe,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),t.jsx(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>v(!0),disabled:u.isPending||_.isPending,children:"Reject with feedback"})]})}),y==="approved"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),y==="rejected"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&y==null&&!b&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function Pn(e){if(!e)return;const s={};for(const[n,a]of Object.entries(e))n==="_lobu_idempotency_key"||n==="agent_id"||(s[n]=a);return Object.keys(s).length>0?s:void 0}function Yn({presentation:e="summary",renderDetail:s,onFiltersChange:n,ownerSlug:a,content:r,isReply:o,showParentContext:l,connectorDefinitions:h,hideOriginator:i=!1,hideRunAction:u=!1,hideAttribution:_=!1,hideDetails:m=!1,recordId:v}){const[w,I]=g.useState(null),[y,p]=g.useState(!1),[C,q]=g.useState(!1),[k,D]=g.useState(!1),[F,M]=g.useState(!1),[$,b]=g.useState(!1),[B,c]=g.useState(null),[z,T]=g.useState(r.title??""),[H,N]=g.useState(r.text_content??""),S=ds(),Z=cs(),A=e==="detail",U=mt(),{currentOwner:be,allOrgs:le,isAuthenticated:Ne}=us(),W=a??be,x=W==="me"?null:W,we=g.useCallback(async d=>{if(!x){Ee.error("Open this event inside a workspace to interact with it.");return}const j=await Js(x,Number(r.id),d,crypto.randomUUID());return"event_id"in j&&Ee.success("Recorded"),j},[r.id,x]),V=r.payload_data??{},{audit:L,operation:ee,changeSet:Y}=kt(r),te=L&&(V.request!==void 0||V.request_status==="too_large"),de=L&&Array.isArray(V.sdk_call_trace)&&V.sdk_call_trace.length>0,G=W?nt(W,Number(r.id)):null,J=Ne&&x?(le??[]).find(d=>d.slug===x):void 0,ce=A?void 0:J,he=r.semantic_type==="guidance",{isAdmin:ke,isLoading:ye}=ms(he?J?.id:void 0),K=ce?{slug:ce.slug,organizationId:ce.id}:null,Ce=ct(K??{slug:null,organizationId:null}),Q=K?.slug??null,Se=g.useMemo(()=>Q&&!L?ut(Ce.data??[],r.semantic_type):[],[Q,L,Ce.data,r.semantic_type]),se=ps(),X=pn(r),ne=!!(!(ee||Y||X)&&K&&Se.length>0),me=!A&&!y&&!!G,f=rt(U?.item?.href.split(/[?#]/)[0]??""),R=f?.owner===W&&f?.eventId===Number(r.id),pe=(d,j,O)=>{U?U.open({href:d,title:j,...O==null?{}:{runId:O}}):S({to:d})},Ae=(d,j)=>{if(!x)return null;const O=`/${x}/events?run_ids=${d}`;return U?.item?.href===O?null:t.jsxs(E,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>n?n({runIds:[d]}):pe(O,"Run activity",d),title:n?"Filter by this run":"Open run activity",children:[t.jsx(vs,{className:"h-3.5 w-3.5"}),j]})},Rt=r.run_id!=null&&(n||!(U&&x&&r.automation_id!=null))?Ae(r.run_id,n?"Run":"Open run"):null,ge=xs(r),Me=r.automation_id,Et=U&&x&&ge!=null&&Me!=null?()=>U.open({href:`/${x}/automations/${Me}?run_id=${ge}`,title:`${r.automation_name??`Automation ${Me}`} · Run #${ge}`,runId:ge}):void 0,Ye=()=>{if(ne&&K&&x){const d=Number(r.id);qs(se,K.slug,Se,d).catch(()=>null).then(j=>pe(nt(x,d,j?.key),r.title??"Event"));return}G&&pe(G,r.title??"Event")},Ge=d=>{const j=d.target;if(!(j instanceof Element))return!1;const O=j.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return O!==null&&O!==d.currentTarget},It=d=>{Ge(d)||Ye()},Tt=d=>{d.key!=="Enter"&&d.key!==" "||Ge(d)||(d.preventDefault(),Ye())},Xe=r.metadata?.source_run_id,ve=on(r),$t=(!r.platform||r.platform==="lobu")&&r.connection_id==null&&r.feed_id==null&&r.origin_type==null&&r.automation_id==null&&!L&&!ee&&!Y&&!X&&ve==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,Ze=!!(x&&J&&$t&&(!he||!ye&&ke)),et=Ze&&r.payload_type!=="json_template"&&r.payload_type!=="media",tt=()=>{se.invalidateQueries({queryKey:[$s]}),se.invalidateQueries({queryKey:[Os]}),se.invalidateQueries({queryKey:["search-memory"]})},Ot=async()=>{if(!(!x||!et)){if(M(!1),c(null),r.payload_truncated){q(!0);try{const j=(await $e("read_knowledge",{content_ids:[Number(r.id)]},{slug:x})).content?.find(O=>Number(O.id)===Number(r.id));T(j?.title??r.title??""),N(j?.text_content??j?.payload_text??r.text_content??""),p(!0)}catch(d){c(d instanceof Error?d.message:"Failed to load full memory.")}finally{q(!1)}return}T(r.title??""),N(r.text_content??""),p(!0)}},Pt=async()=>{if(!x||k)return;if(!H.trim()){c("Memory content cannot be empty.");return}D(!0),c(null);try{const j=r.payload_type==="markdown"||r.payload_type==="text"?r.payload_type:"text",O=Pn(r.metadata);await $e("save_memory",{supersedes_event_id:Number(r.id),semantic_type:r.semantic_type||"note",payload_type:j,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}:{},...O?{metadata:O}:{}},{slug:x}),p(!1),tt(),Ee.success("Memory updated")}catch(j){c(j instanceof Error?j.message:"Failed to update memory.")}finally{D(!1)}},Mt=async()=>{if(!(!x||$)){b(!0),c(null);try{const d=Number(r.id),j=await $e("run_sdk",{title:"Delete memory",script:`export default async (_ctx, client) => client.knowledge.delete(${JSON.stringify({content_id:d,reason:"Deleted from web UI"})});`},{slug:x});if(j?.success===!1){const Bt=typeof j.error=="string"?j.error:j.error?.message||"Failed to delete memory.";throw new Error(Bt)}M(!1),R&&U?.close();const O=rt(Z.pathname);O?.owner===x&&O.eventId===d&&S({to:"/$owner/events",params:{owner:x}}),tt(),Ee.success("Memory deleted")}catch(d){c(d instanceof Error?d.message:"Failed to delete memory.")}finally{b(!1)}}},Dt=Ze&&!y?F?t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsxs(E,{type:"button",variant:"destructive",size:"sm",className:"h-7 px-2.5 text-xs",disabled:$,onClick:()=>void Mt(),children:[$&&t.jsx(oe,{size:"xs",className:"mr-1.5"}),$?"Deleting...":"Delete"]}),t.jsx(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:$,onClick:()=>{M(!1),c(null)},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[et&&t.jsxs(E,{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:C||$,onClick:()=>void Ot(),children:[C?t.jsx(oe,{size:"xs"}):t.jsx(Is,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:C?"Loading...":"Edit"})]}),t.jsxs(E,{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:C,onClick:()=>{c(null),M(!0)},children:[t.jsx(Ts,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"Delete"})]})]}):null,Ft=y?t.jsxs("form",{className:"mt-2 space-y-3 rounded-lg border bg-background p-3 text-foreground",onSubmit:d=>{d.preventDefault(),Pt()},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(fs,{id:`memory-title-${r.id}`,"aria-label":"Memory title",value:z,onChange:d=>T(d.target.value),placeholder:"Optional short summary",disabled:k})]}),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(hs,{id:`memory-content-${r.id}`,"aria-label":"Memory content",value:H,onChange:d=>N(d.target.value),rows:5,disabled:k})]}),B&&t.jsx("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:B}),t.jsx(ys,{onCancel:()=>{p(!1),c(null)},cancelDisabled:k,children:t.jsxs(E,{type:"submit",disabled:k||H.trim().length===0,children:[k&&t.jsx(oe,{size:"xs",className:"mr-1.5"}),k?"Saving...":"Save"]})})]}):null,Lt=!y&&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,De=X?t.jsx(xn,{content:r,detail:A}):A&&x?Y?t.jsx(On,{content:r,ownerSlug:x}):ee?t.jsx($n,{ownerSlug:x,content:r,batchReview:typeof Xe=="number"?Ae(Xe,"Review run"):null}):void 0:void 0,Re=A&&s?s(De):{content:De,nativeHeading:De!=null};return t.jsx("div",{className:xe(o?"border-l-2 border-l-muted pl-4":"",me&&"cursor-pointer rounded-lg p-3 transition-colors hover:bg-accent/40",me&&R&&"bg-accent ring-1 ring-inset ring-primary/20"),...me?{role:"button","aria-current":R?"true":void 0,tabIndex:0,onClick:It,onKeyDown:Tt}:{},children:t.jsx(Fn,{primaryContent:Re.content,nativeHeading:Re.nativeHeading,heading:ve&&x?t.jsx(un,{event:ve,recordId:v,ownerSlug:x}):void 0,body:Ft??(ve&&x?t.jsx(mn,{event:ve,ownerSlug:x}):void 0),detailLinks:Re.links,headingAside:Re.headingAside,hideDetails:m,onFiltersChange:n,presentation:e,content:r,ownerSlug:W??void 0,showParentContext:l,connectorDefinitions:h,onRenderedAction:x?we:void 0,runAction:u?null:Rt,memoryActions:Dt,memoryFeedback:Lt,hideOriginator:i,hideAttribution:_,runId:ge??r.run_id??null,onRunSelect:Et,auditDetails:A&&(te||de)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"request",label:"Request",available:te},{key:"calls",label:"SDK calls",available:de}].map(d=>d.available?t.jsxs(E,{variant:"outline",size:"sm","aria-expanded":w===d.key,onClick:()=>I(j=>j===d.key?null:d.key),children:[w===d.key?t.jsx(Ue,{className:"h-3.5 w-3.5"}):t.jsx(Ve,{className:"h-3.5 w-3.5"}),d.label]},d.key):null)}),w==="request"&&(V.request_status==="too_large"?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof V.request_bytes=="number"?` (${V.request_bytes.toLocaleString()} bytes).`:"."]}):t.jsx(dt,{value:V.request})),w==="calls"&&t.jsx(dt,{value:V.sdk_call_trace})]})})})}function Mn(e,s){const n=e.payload_data??{},a=e.metadata??{};if(s.audit&&typeof n.success=="boolean")return n.success?"completed":"failed";if(s.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(s.operation)return Ct(e.interaction_status,typeof a.status=="string"?a.status:void 0)}function Dn(e){return e==="pending_approval"?"Needs approval":e==="confirmed"?"Approved":e?fe(e):null}function Fn({presentation:e,primaryContent:s,nativeHeading:n=!1,heading:a,body:r,detailLinks:o,headingAside:l,onFiltersChange:h,content:i,ownerSlug:u,showParentContext:_,connectorDefinitions:m,onRenderedAction:v,runAction:w,memoryActions:I,memoryFeedback:y,auditDetails:p,hideOriginator:C=!1,hideAttribution:q=!1,runId:k,onRunSelect:D,hideDetails:F=!1}){const[M,$]=g.useState(!1),b=i.metadata??{},B=typeof i.score=="number"&&Number.isFinite(i.score)?Math.round(i.score):"-",c=i.payload_type||"text",z=i.text_content||"",T=e==="summary",H=e==null&&(c==="text"||c==="markdown")&&z.length>500,N=H&&!M?`${z.slice(0,500)}...`:z,S=i.payload_data??{},Z=kt(i),{audit:A,operation:U,changeSet:be}=Z,le=Mn(i,Z),Ne=Dn(le),W=(A?Vs(S,S.tool_name):null)??(T&&A&&typeof S.tool_name=="string"?fe(S.tool_name):i.title),x=A&&S.error&&typeof S.error=="object"?S.error.message:void 0,we=(typeof x=="string"?x:void 0)??i.interaction_error??(typeof b.error_message=="string"?b.error_message:void 0),V=we||(A?"":z),[L,ee]=g.useState(e!=="summary"&&A&&s==null&&o==null),Y=A?S.duration_ms:b.duration_ms,te=typeof Y=="number"&&Number.isFinite(Y)&&Y>=0?Y:null,de=A&&typeof S.sdk_call_count=="number"&&Number.isSafeInteger(S.sdk_call_count)&&S.sdk_call_count>=0?S.sdk_call_count:null,G=b.thumbnail_url||b.thumbnail,J=b.media_url,ce=T?[]:jn(b),he=Object.entries(i.classifications||{}).flatMap(([f,R])=>{const pe=Nn(R);return pe.values.map(Ae=>({slug:f,value:Ae,isManual:pe.isManual}))}),ke=(()=>{const f=i.platform||(typeof b.platform=="string"?b.platform:null),R=i.connection_id!=null?i.connection_id:b.source_connection_id!=null?Number(b.source_connection_id):null;return{...i,platform:f,connection_id:R!=null&&Number.isFinite(R)?R:null}})(),ye=(()=>{const f=i.source_url??b.browser_url;if(typeof f!="string"||!URL.canParse(f))return null;const R=new URL(f);return R.protocol==="https:"||R.protocol==="http:"?R:null})(),K=i.occurred_at?new Date(i.occurred_at):null,Ce=A?Ht:U?xt:be?Qt:i.semantic_type==="notification"?Wt:Yt,Q=A?"SDK call":fe(i.semantic_type||i.origin_type||"Event"),Se=t.jsx(gs,{source:ke,connectorDefinitions:m,sourceUrl:ye,label:Q,fallback:t.jsx(Ce,{className:"h-4 w-4"})}),se=ce.length>0?t.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:ce.map(([f,R])=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:fe(f)}),t.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:vn(R)})]},f))}):null,X=r?t.jsx("div",{className:"mt-1",children:r}):T?V?t.jsx("p",{className:xe("line-clamp-2 text-sm whitespace-pre-wrap",we&&"text-destructive"),children:V.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(f=>t.jsx(ft,{className:`h-4 w-4 ${f<=Number(i.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},f))}),G&&t.jsx("a",{href:J||i.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:t.jsx("img",{src:G,alt:"",className:`rounded-md object-cover ${c==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(c){case"markdown":if(N)return t.jsx("div",{className:"max-w-none text-sm space-y-2",children:t.jsx(Gt,{text:N})});break;case"json_template":{const f=i.payload_template;if(f?.root)return t.jsx(fn,{template:f,data:i.payload_data||{},onAction:s?void 0:v},`${u}:${i.id}`);if(N)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:N});break}case"media":return t.jsxs("div",{className:"space-y-3",children:[!G&&J&&t.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:J}),N&&t.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:N})]});case"empty":return t.jsxs("div",{className:"space-y-3",children:[p,se??(p?null:t.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"}))]});default:if(N)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:N});break}return t.jsxs("div",{className:"space-y-3",children:[J&&!G&&t.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:J}),se]})})()]}),ue=s!=null||e==="detail"&&A,ne=l!==void 0,me=ue||o!=null;return g.useEffect(()=>{if(!ne||!L)return;const f=R=>{R.key==="Escape"&&(R.preventDefault(),ee(!1))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[ne,L]),t.jsxs(t.Fragment,{children:[_&&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:xe("flex gap-3",e==="detail"&&"mb-5",ne&&"relative"),children:[t.jsx(Xt,{children:Se}),t.jsxs("div",{className:"min-w-0 flex-1",children:[e==="detail"&&(()=>{const f={semanticTypes:[i.semantic_type],...typeof i.automation_id=="number"?{producedByAutomationId:i.automation_id}:{},...typeof i.run_id=="number"?{runIds:[i.run_id]}:{}},R={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?h?t.jsx("button",{type:"button",className:"hover:underline",title:`Show all ${Q} events`,onClick:()=>h(f),children:Q}):u?t.jsx(_e,{to:"/$owner/events",params:{owner:u},search:R,className:"hover:underline",title:`Show all ${Q} events`,children:Q}):t.jsx("span",{children:Q}):t.jsx("span",{children:Q}),K&&t.jsx("time",{dateTime:K.toISOString(),children:Zt(K)})]})})(),t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[(a??W)&&!n&&t.jsx("h4",{className:xe("min-w-0 font-medium",e==="detail"?"text-xl leading-snug":"line-clamp-2 text-sm"),children:a??W}),e!=="detail"&&K&&t.jsx(es,{at:K}),ne&&t.jsxs("div",{className:"flex shrink-0 items-center gap-1 pt-0.5",children:[l,me&&t.jsxs(E,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-muted-foreground hover:text-foreground","aria-expanded":L,onClick:()=>ee(f=>!f),children:["Details",L?t.jsx(Ue,{className:"h-3.5 w-3.5"}):t.jsx(Ve,{className:"h-3.5 w-3.5"})]})]})]}),T&&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:[Ne&&!n&&t.jsxs(ie,{variant:le==="failed"?"destructive":"secondary",className:"gap-1 text-xs",children:[le==="failed"?t.jsx(ht,{className:"h-3 w-3"}):le==="completed"?t.jsx(yt,{className:"h-3 w-3"}):null,Ne]}),de!=null&&t.jsxs("span",{children:[de," SDK ",de===1?"call":"calls"]}),te!=null&&t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(ts,{className:"h-3 w-3"}),te<1e3?`${Math.round(te)}ms`:`${Number((te/1e3).toFixed(2))}s`]}),w,B==="-"||T&&(A||U||be)?null:i.score_breakdown?t.jsxs(ss,{children:[t.jsx(ns,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 px-2",children:t.jsx("span",{className:"font-medium",children:B})})}),t.jsx(rs,{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(_n,{breakdown:i.score_breakdown})]})})]}):null,ye&&t.jsxs(as,{children:[t.jsx(is,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1",asChild:!0,children:t.jsxs("a",{href:ye.href,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(gt,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:T?"sr-only":void 0,children:"View original"})]})})}),t.jsx(os,{children:"View original"})]}),I]}),y,u&&!q&&t.jsx(ls,{owner:u,source:ke,connectorDefinitions:m,onFiltersChange:h,variant:"chips",className:"mt-2 text-xs",hideOriginator:C,runId:k,onRunSelect:D}),(i.author_name||!u)&&!(e==="detail"&&U)&&t.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:i.author_name||gn(i)})]}),ne&&L&&me&&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,ue&&X]})]}),!T&&typeof x=="string"&&t.jsx("p",{className:"mb-2 text-sm whitespace-pre-wrap text-destructive",children:x}),s,!T&&!ue&&X,(ue||o!=null)&&l===void 0&&!(F&&s!=null)&&t.jsxs("details",{className:"mt-5 border-t pt-3",open:L,onToggle:f=>ee(f.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,ue&&X]})]}),H&&t.jsx(E,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>$(!M),children:M?t.jsxs(t.Fragment,{children:[t.jsx(Ue,{className:"h-3 w-3 mr-1"})," Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(Ve,{className:"h-3 w-3 mr-1"})," Show more"]})}),he.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:he.map(f=>t.jsx(bn,{slug:f.slug,value:f.value||"",isManual:f.isManual},f.slug))})]})}export{Yn as E,Wn as R,Fn as a,Qn as b,Jn as c,Hn as r,fe as s,Vs as t,Kn as u};
|
|
2
|
+
//# sourceMappingURL=event-card-Mcxv56DG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as q,a0 as I,r as D,gi as J,fU as Q,j as s,ca as M,L as W}from"./index-4gCDI7m4.js";import{E as X}from"./events-feed-BysC9HgU.js";import{b as Y,a as Z,V as z,M as K}from"./view-param-filters-mKoqDsaD.js";import{u as ee}from"./event-card-Mcxv56DG.js";const se={},te="calc(100dvh - 120px)";function oe({owner:n,organizationId:o,eventId:c,viewKey:r,params:p,onParamsChange:d,onSelectView:g,dense:h=!1,fullBleed:k=!1}){const{isAuthenticated:y,isReady:E}=q(),{data:U,isLoading:w}=I(),O=U?.some(t=>t.id===o&&t.is_member),l=n!=="me"&&o!==null&&E&&y&&!w&&O,a=ee(l?{slug:n,organizationId:o}:null,c),[j,L]=D.useState(se),[P,b]=D.useState(null),m=J(a.views,r),e=l&&!a.isLoading&&!a.isError&&m.kind==="view"?m.view:null,v=e?`${Q(n,e.key)}/${e.content_hash}/${e.eventId}`:null,f=e!==null&&P===v,V=M(n,c),F=n!=="me"&&(!E||y&&(w||a.isLoading)),H=e!==null&&!f&&!F,u=k&&H,T=(k||h)&&H,N=F?s.jsx("div",{role:"status",className:"py-8 text-sm text-muted-foreground",children:"Loading event view…"}):e&&!f?s.jsxs(s.Fragment,{children:[s.jsx(Y,{decls:e.params,params:p??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:p??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:T?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:[l&&a.isError&&s.jsx(z,{onRetry:a.refetch}),(l||n==="me"&&r)&&!a.isLoading&&!a.isError&&m.kind==="missing"&&s.jsx(K,{viewKey:m.key,backTo:V,backLabel:"Back to the event"}),f&&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 x=N!=null&&(t==null||!!r),A=(l?a.views:[]).filter(i=>!x||i.key!==e?.key).map(i=>({key:i.key,name:i.name,href:M(n,c,i.key)})),S=i=>i.length?s.jsx("nav",{"aria-label":"Event views",className:"flex flex-wrap gap-3 text-sm",children:i.map(({key:$,name:C,href:B})=>s.jsx(W,{to:B,className:"underline",onClick:g?G=>{G.preventDefault(),g(B)}:void 0,children:C},$))}):null,R=[...A],_=[...A];return l&&r&&t!=null&&_.unshift({key:":event",name:"Event details",href:V}),{content:x?N:t,nativeHeading:!x&&t!=null,headingAside:u?S(R):void 0,links:u?null:S(_)}}})]})}export{oe as E};
|
|
2
|
+
//# sourceMappingURL=event-detail-DXifj49J.js.map
|
|
@@ -0,0 +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-BysC9HgU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const n=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:null;function d(t){const p=n(n(t)?.eventKinds)??{};return Object.entries(p).map(([f,y])=>{const c=n(y),i=new Map,a=c?.attributions;for(const s of Array.isArray(a)?a:[]){const e=n(s),r=n(e?.target)?.entityType;typeof r!="string"||!r||i.set(r,(i.get(r)??!1)||e?.autoCreate===!0)}const o=c?.description;return{kind:f,description:typeof o=="string"&&o?o:void 0,targets:[...i].map(([s,e])=>({entityType:s,creates:e}))}})}export{d as f};
|
|
2
|
+
//# sourceMappingURL=feed-event-kinds-BYuZCoU4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,cN as C,Y as P,da as j,du as z,h as g,r as m,B as h,dv as N,dw as b,I as y,dx as k,X as O,dy as S,dz as D,dA as B,l as I,dB as E,dC as F,dD as L,dE as $,cM as R}from"./index-4gCDI7m4.js";import{a as _,C as A,s as Q}from"./calendar-DMq3Dtqy.js";function w(s,t,n){return _(s,-t,n)}function H({selected:s}){return e.jsx(z,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function K({searchPlaceholder:s,emptyText:t="No options",options:n,selected:o,multiple:r=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(l=>{const i=o.includes(l.value);return e.jsxs(C,{value:`${l.label} ${l.keywords??l.value}`,onSelect:()=>{a(l.value),r||u()},className:"gap-2",children:[r?e.jsx(P,{checked:i,className:"mr-1"}):e.jsx(H,{selected:i}),l.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:l.label}),l.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:l.count.toLocaleString()}):null]},l.value)})}}function Z([s,t],n,o){return s<=n?`≤ ${t}`:t>=o?`≥ ${s}`:`${s}–${t}`}function U({value:s,min:t,max:n,onApply:o,close:r}){const[a,u]=m.useState(String(s?.[0]??t)),[l,i]=m.useState(String(s?.[1]??n)),[c,x]=m.useState(),d=f=>{f.preventDefault();const p=Number(a),v=Number(l);if(!Number.isFinite(p)||!Number.isFinite(v)){x("Enter a number.");return}if(p<t||v>n){x(`Use values between ${t} and ${n}.`);return}if(p>v){x("The lower bound must not exceed the upper bound.");return}o([p,v]),r()};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:f=>u(f.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:l,onChange:f=>i(f.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(U,{...s,close:t})}}const V=[{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 q({value:s,onApply:t,close:n}){const[o,r]=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:V.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(A,{mode:"range",defaultMonth:o?.from,selected:o,onSelect:a=>{r(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(q,{...s,close:t})}}function G({type:s,label:t,value:n,onApply:o,close:r}){const[a,u]=m.useState(n==null?"":String(n)),[l,i]=m.useState(),c=x=>{if(x.preventDefault(),s==="number"){const d=Number(a);if(a.trim()===""||!Number.isFinite(d)){i("Enter a number.");return}o(d)}else o(a);r()};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:x=>u(x.target.value),placeholder:"Enter a value…"}),l?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:l}):null,e.jsx(h,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function ae(s){return{kind:"custom",render:t=>e.jsx(G,{...s,close:t})}}const M="w-72";function T({editor:s,close:t,header:n,footer:o}){const[r,a]=m.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(E,{shouldFilter:!s.onQueryChange,children:[e.jsx(F,{autoFocus:!0,placeholder:s.searchPlaceholder,value:r,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(L,{children:[e.jsx($,{children:s.emptyText}),e.jsx(R,{children:s.items(t,r)})]})]}):s.render(t),o]})}function W({chip:s,editor:t}){const[n,o]=m.useState(!1),r=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})]}),l=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":r?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!r&&"pr-1.5"),children:[l,r?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(O,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(S,{align:"start",className:g("p-0",M,t.className),children:e.jsx(T,{editor:t,close:()=>o(!1),footer:r?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 X({fields:s}){const[t,n]=m.useState(!1),[o,r]=m.useState(),a=s.find(i=>i.key===o),u=[...new Set(s.map(i=>i.group??""))],l=()=>{n(!1),r(void 0)};return e.jsxs(k,{open:t,onOpenChange:i=>{n(i),i||r(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",M,a?.editor.className),children:a?e.jsx(T,{editor:a.editor,close:l,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:()=>r(void 0),children:e.jsx(I,{className:"h-4 w-4"})}),a.label]})},a.key):e.jsxs(E,{children:[e.jsx(F,{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:()=>r(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:r,onClearAll:a,hasClearableState:u=!1,className:l,label:i="Filters"}){const c=s.filter(d=>d.inMenu!==!1),x=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",l),children:[t.map(d=>e.jsx(W,{chip:d,editor:d.editor??s.find(f=>f.key===(d.field??d.id))?.editor},d.id)),c.length>0?e.jsx(X,{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&&(x>0||u)?e.jsx(h,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,r]})]})}export{ne as F,H as S,Z as a,te as d,se as f,K as o,ee as r,ae as v};
|
|
2
|
+
//# sourceMappingURL=filter-bar-BQm-ubB1.js.map
|
package/dist/owletto/dist/assets/{full-page-spinner-DtmqQmgl.js → full-page-spinner-BMiXl54z.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,j as t,
|
|
2
|
-
//# sourceMappingURL=full-page-spinner-
|
|
1
|
+
import{r,j as t,h as u}from"./index-4gCDI7m4.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-BMiXl54z.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iJ as t,j as n}from"./index-4gCDI7m4.js";import{a as i}from"./agents-workbench-C8bTa2rv.js";import"./agent-editor-form-DfMTSIvj.js";import"./model-selector-88PJnyTq.js";import"./proposal-review-shell-B4CSiyLB.js";import"./runs-BPtQBTRN.js";function d(){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{d as component};
|
|
2
|
+
//# sourceMappingURL=identity-N0cAO9BR.js.map
|