@lobu/runtime-server 24.1.0 → 24.2.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 +151 -37
- package/dist/catalogs/skills.json +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/google_gmail.ts +70 -41
- package/dist/connectors/google_gmail_references.ts +406 -0
- package/dist/connectors/linkedin-inbox-adapter.js +107 -36
- package/dist/connectors/linkedin-inbox.ts +13 -0
- package/dist/connectors/linkedin.ts +1 -1
- package/dist/connectors/postgres.ts +5 -3
- package/dist/connectors/reddit.ts +171 -5
- package/dist/connectors/whatsapp-web-adapter.js +147 -61
- package/dist/connectors/whatsapp-web-helpers.ts +6 -2
- package/dist/connectors/whatsapp_web.ts +48 -17
- package/dist/connectors/x-dm-adapter.js +252 -35
- package/dist/connectors/x.ts +189 -13
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +3 -1
- package/dist/db/migrations/20261024050000_events_source_reference_arrival.sql +27 -0
- package/dist/db/migrations/20261026000000_turn_write_receipts.sql +36 -0
- package/dist/db/migrations/20261026190000_federated_relationship_endpoints.sql +143 -0
- package/dist/dependencies.bun.lock +81 -83
- package/dist/embeddings-server.mjs +81 -11
- package/dist/guest.bundle.js +62 -25
- package/dist/owletto/dist/assets/_-Cjvw31gU.js +2 -0
- package/dist/owletto/dist/assets/_-iToIRRFt.js +3 -0
- package/dist/owletto/dist/assets/_agentId-CLdj0X7j.js +2 -0
- package/dist/owletto/dist/assets/_agentId-D5cAWjrP.js +2 -0
- package/dist/owletto/dist/assets/_automationId-BhEZmkJU.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DZtLc3WW.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-BoYpah_l.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-ML2TjCwN.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BYc3I2EL.js +2 -0
- package/dist/owletto/dist/assets/_name-BsOZmvlH.js +2 -0
- package/dist/owletto/dist/assets/_owner-UuyQLJ-0.js +3 -0
- package/dist/owletto/dist/assets/_shape-BpnVAYWH.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CYrGvNn-.js +2 -0
- package/dist/owletto/dist/assets/_slug-MHQU8ftJ.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CGAJ1ucr.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CMkhfs1k.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-D2T_a2dj.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-_G_lDz5K.js +2 -0
- package/dist/owletto/dist/assets/agent-card-controls-ColL5rdd.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-BlXB4SE5.js → agent-client-setup-list-BgyLhJCo.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BryZas7Z.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-DsSoeQeF.js → agent-editor-form-C24p9LLg.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-D9PpDgR-.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-B7v6Cffw.js → agent-loading-shells-jkf9DjdO.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-C8j8kRB1.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DFucg4c4.js → agent-skill-context-B9giw2u2.js} +2 -2
- package/dist/owletto/dist/assets/agent-skills-route-BMZ3r1bP.js +2 -0
- package/dist/owletto/dist/assets/agent-subpage-shell-D49f-bzP.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-D38STyeu.js → agent-thread-BGHYHWDO.js} +4 -4
- package/dist/owletto/dist/assets/agents-C05k-Xw6.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-D1YL3VAB.js +2 -0
- package/dist/owletto/dist/assets/app._appId-A51tx2jU.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-DCAZBKle.js +2 -0
- package/dist/owletto/dist/assets/automations-C05k-Xw6.js +2 -0
- package/dist/owletto/dist/assets/callback-WmyCei3R.js +2 -0
- package/dist/owletto/dist/assets/{card-jzhQrMDP.js → card-Cspo-4M6.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B-wq745Q.js → claim-CCKdBtFt.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-CmK3DkSP.js +2 -0
- package/dist/owletto/dist/assets/client-rows-fFuxzFtE.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-CEqoCky-.js → code-editor-C8FJbT2P.js} +3 -3
- package/dist/owletto/dist/assets/connect-BmCUJ3lr.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-B6StGCPK.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-CPiMA6Bx.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-BialEDmu.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-X1wVi6v0.js +2 -0
- package/dist/owletto/dist/assets/{connection-CNm2ukrI.js → connection-DJd9bnEc.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-WcGCA6qY.js → connection-feed-detail-IO6G5QjL.js} +2 -2
- package/dist/owletto/dist/assets/connections-browser-CzdcZeiU.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-D-ECOlMJ.js → connector-provenance-bmBJJ9B4.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-B44Q9W-j.js +2 -0
- package/dist/owletto/dist/assets/{connectors-CH4KBZyT.js → connectors-CTWPDH8f.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C9ZpHb7V.js → consent-C_WBfmQ8.js} +2 -2
- package/dist/owletto/dist/assets/copy-button-kcjg8Giw.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-BupT3V0i.js → core.esm-CoJ5Splc.js} +2 -2
- package/dist/owletto/dist/assets/create-CQE5rD0i.js +2 -0
- package/dist/owletto/dist/assets/create-DQNlRTUX.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-y3tq2QIJ.js +3 -0
- package/dist/owletto/dist/assets/create-lOFSQV_5.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-icyNicvn.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CWImw-kf.js → cronstrue-CeUS_78Q.js} +2 -2
- package/dist/owletto/dist/assets/{device-D-7WBe9E.js → device-Br9JHadR.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-7UpeD4Sq.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-DGMmjr01.js +2 -0
- package/dist/owletto/dist/assets/elk-worker.min-BENGc9gn.js +23 -0
- package/dist/owletto/dist/assets/{entity-avatar-mdh7Kq5D.js → entity-avatar-BZIa-7i5.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-BcTafZ2e.js +2 -0
- package/dist/owletto/dist/assets/entity-page-CY7PF3X9.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-BzMZttzh.js +2 -0
- package/dist/owletto/dist/assets/{event-detail-DV_zfWnC.js → event-detail-C25TvOb_.js} +2 -2
- package/dist/owletto/dist/assets/events-feed-C4VrjIc1.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-oNjBX9a2.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-BVbcpW3R.js → full-page-spinner-DtmqQmgl.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-Acfam-JF.js +2 -0
- package/dist/owletto/dist/assets/identity-BkK8ggdp.js +2 -0
- package/dist/owletto/dist/assets/index-BhBYXtEN.js +2 -0
- package/dist/owletto/dist/assets/{index-BTlx9K_t.js → index-Bhop_otG.js} +2 -2
- package/dist/owletto/dist/assets/index-Bw5iV_J7.js +2 -0
- package/dist/owletto/dist/assets/index-C3dpyynY.js +2 -0
- package/dist/owletto/dist/assets/index-C3zAbslo.js +2 -0
- package/dist/owletto/dist/assets/index-CGKN_WN_.js +2 -0
- package/dist/owletto/dist/assets/{index-DB1iWI_a.js → index-CgRaCOzW.js} +2 -2
- package/dist/owletto/dist/assets/{index-D7gHOpfg.js → index-DRbaESbJ.js} +2 -2
- package/dist/owletto/dist/assets/index-DfIoxD5Q.js +2 -0
- package/dist/owletto/dist/assets/index-DijuudSs.js +2 -0
- package/dist/owletto/dist/assets/index-Dr7bouPX.css +1 -0
- package/dist/owletto/dist/assets/index-JmEl29py.js +7950 -0
- package/dist/owletto/dist/assets/index-NK2VKPoL.js +2 -0
- package/dist/owletto/dist/assets/index-_5qsmBkt.js +2 -0
- package/dist/owletto/dist/assets/{index-B64PGxQm.js → index-qkOKpRYs.js} +2 -2
- package/dist/owletto/dist/assets/index-wHFQv1aT.js +12 -0
- package/dist/owletto/dist/assets/index-wzYkECAe.js +2 -0
- package/dist/owletto/dist/assets/json-diff-4sMmayDd.js +4 -0
- package/dist/owletto/dist/assets/linked-record-peek-B0_B4PnF.js +97 -0
- package/dist/owletto/dist/assets/{list-skeleton-CepswBka.js → list-skeleton-BafzvpOM.js} +2 -2
- package/dist/owletto/dist/assets/login-XL5XxN6y.js +2 -0
- package/dist/owletto/dist/assets/{logout-Bkzc7J44.js → logout-CMxdhLbM.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-DD4YBFn-.js → member-scope-gate-Dit3MXBQ.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-DTlM_9MY.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-CDrAjH31.js → model-selector-BeFuFH7p.js} +2 -2
- package/dist/owletto/dist/assets/models-BAVaDnKN.js +2 -0
- package/dist/owletto/dist/assets/new-1QLuS1o-.js +2 -0
- package/dist/owletto/dist/assets/{new-ktz9Cs_P.js → new-ChwqLmVY.js} +2 -2
- package/dist/owletto/dist/assets/new-D21LGMl6.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-lZNZ9gul.js → oauth-workspace-access-D15LYKSe.js} +2 -2
- package/dist/owletto/dist/assets/organization-CoUJYXx7.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-BvkYk72J.js +2 -0
- package/dist/owletto/dist/assets/permissions-C6UFdvz2.js +2 -0
- package/dist/owletto/dist/assets/proposal-review-shell-CmLy1MZf.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-_awBxu2Y.js +2 -0
- package/dist/owletto/dist/assets/record-activity-Doeu5kPO.js +2 -0
- package/dist/owletto/dist/assets/{record-session-Pbr5czGw.js → record-session-CJzFoVKc.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-CzZw6RcC.js → reset-password-Y-WO77iR.js} +2 -2
- package/dist/owletto/dist/assets/runs-B0zVYb-w.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-Dkyybqos.js +2 -0
- package/dist/owletto/dist/assets/{runs-table-B1APZv7d.js → runs-table-9OVdfPXZ.js} +2 -2
- package/dist/owletto/dist/assets/schema-type-editor-panel-DcJqbCrU.js +2 -0
- package/dist/owletto/dist/assets/settings-Cfy9tCOF.js +2 -0
- package/dist/owletto/dist/assets/settings-Dg0D_l_w.js +2 -0
- package/dist/owletto/dist/assets/skills-oxA7P5Fe.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-BeAZeMLy.js +2 -0
- package/dist/owletto/dist/assets/status-dot-_LQZmEIX.js +2 -0
- package/dist/owletto/dist/assets/use-automations-DS3uz3pb.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-Dcunv4L0.js → use-mention-search-CAFbh-Dk.js} +4 -4
- package/dist/owletto/dist/assets/use-scroll-sentinel-BpQ70c28.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-FuOZyjMg.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-CWwlobOd.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +44222 -40683
- package/npm-shrinkwrap.json +389 -402
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/browser-requirement.js +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +5 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/agent-tooling.d.ts +8 -0
- package/vendor/core/dist/agent-tooling.js +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +5 -0
- package/vendor/core/dist/contracts/entity-reference.d.ts +3 -0
- package/vendor/core/dist/contracts/entity-reference.js +31 -0
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +3 -0
- package/vendor/core/dist/contracts/tools/manage-connections.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 +113 -34
- package/vendor/core/dist/contracts/tools/manage-entity.js +41 -14
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
- package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
- package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
- package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
- package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
- package/vendor/core/dist/contracts/worker/protocol.js +20 -0
- package/vendor/core/dist/reserved.d.ts +6 -3
- package/vendor/core/dist/reserved.js +6 -3
- package/vendor/core/dist/worker/auth.d.ts +3 -2
- package/vendor/core/package.json +6 -1
- package/vendor/postgres/cf/src/query.js +3 -1
- package/vendor/postgres/cjs/src/query.js +3 -1
- package/vendor/postgres/src/query.js +3 -1
- package/vendor/views/dist/api.js +31 -7
- package/vendor/views/dist/bridge.d.ts +2 -1
- package/vendor/views/dist/bridge.js +10 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-BorucF19.js +0 -3
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +0 -2
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +0 -2
- package/dist/owletto/dist/assets/_deploymentId-B1UWPY0i.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +0 -2
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +0 -2
- package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +0 -3
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +0 -2
- package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-UXU5Fx2G.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-CplnPhbv.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-TdvvIc_J.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-BkZu1LYE.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-B3vvvZZe.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +0 -2
- package/dist/owletto/dist/assets/agents-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +0 -2
- package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +0 -2
- package/dist/owletto/dist/assets/automations-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/callback-CBexCo3F.js +0 -2
- package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +0 -2
- package/dist/owletto/dist/assets/clients-BhNl1tVq.js +0 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +0 -2
- package/dist/owletto/dist/assets/conversations-table-D_HOe1jN.js +0 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +0 -2
- package/dist/owletto/dist/assets/create-CCjZxIkK.js +0 -2
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-Bpy92SM5.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +0 -2
- package/dist/owletto/dist/assets/deployments-C5hvipQh.js +0 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +0 -2
- package/dist/owletto/dist/assets/deployments-body-DGII20dQ.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-2U0UMu3_.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +0 -2
- package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +0 -2
- package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +0 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +0 -2
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +0 -2
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +0 -2
- package/dist/owletto/dist/assets/index-9YuSRymd.js +0 -7950
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +0 -2
- package/dist/owletto/dist/assets/index-BSH07yVD.css +0 -1
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +0 -2
- package/dist/owletto/dist/assets/index-CDz3-ieP.js +0 -12
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +0 -2
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +0 -2
- package/dist/owletto/dist/assets/index-CxF2XXzl.js +0 -2
- package/dist/owletto/dist/assets/index-D3WHeGql.js +0 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +0 -2
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +0 -2
- package/dist/owletto/dist/assets/index-Vcq4gwWv.js +0 -2
- package/dist/owletto/dist/assets/index-fgAJydgX.js +0 -2
- package/dist/owletto/dist/assets/json-diff-DIN5Jhfx.js +0 -4
- package/dist/owletto/dist/assets/login-DxGYyE4n.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-BnuhLJ6X.css +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +0 -103
- package/dist/owletto/dist/assets/models-BAVeysNq.js +0 -2
- package/dist/owletto/dist/assets/new-C2av0diq.js +0 -2
- package/dist/owletto/dist/assets/new-snm1ctHn.js +0 -2
- package/dist/owletto/dist/assets/organization-Cb0W823y.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +0 -2
- package/dist/owletto/dist/assets/permissions-Dv39zWKt.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +0 -2
- package/dist/owletto/dist/assets/recent-QhnLDU1_.js +0 -2
- package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +0 -2
- package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +0 -2
- package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +0 -97
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +0 -2
- package/dist/owletto/dist/assets/settings-VDNiffKU.js +0 -2
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BdfOVPWn.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +0 -2
- /package/vendor/postgres/{.bun-tag-2f292c6554a8475e → .bun-tag-22d644c2873790db} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a0 as ge,r as j,bs as Ie,bt as Be,bu as Ke,bv as Me,bw as be,j as e,bx as Y,B as C,by as Ve,aR as Ge,bz as He,bA as Ue,bB as Ye,bC as Je,bD as Ze,bE as Xe,bF as es,bG as ve,bH as ie,bI as ss,bJ as ts,bK as ns,bL as me,bM as is,bN as as,q as os,V as Le,o as rs,bO as cs,bP as ne,m as ls,E as je,I as Ne,bQ as ds,bR as us,bS as ms,a3 as Ce,b0 as hs,S as O,F as le,bT as ps,bU as _e,bV as ke,bW as gs,G as xs,bX as Se,s as fs,bY as ys,bZ as bs}from"./index-JmEl29py.js";import{P as he,a as De,A as vs}from"./agent-permissions-matrix-C8j8kRB1.js";import{C as we,a as Ae,b as ze,c as Oe}from"./card-Cspo-4M6.js";const Pe=["auto","approval","deny"],js={matched_rule:"Matching policy rules apply.",default_approval:"No rule matches; approval is required.",unresolved_principal:"The requesting agent or Automation could not be identified.",parent_approval:"Approval is inherited from the parent action.",unavailable_operation:"This action is unavailable on the connection."},We={read:"Reads",write:"Writes",destructive:"Destructive writes",non_destructive:"Non-destructive writes",unknown:"Unclassified writes"};function pe(s){return{operation_key:s.operation_key??null,connector_key:s.connector_key??null,connection_id:s.connection_id??null,operation_category:s.operation_category??null}}const de=s=>JSON.stringify(pe(s)),$e=s=>({...s,effect:s.effects.execute??"approval"});function F({label:s,value:n,onChange:o,children:r,disabled:h}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("select",{"aria-label":s,value:n,onChange:c=>o(c.target.value),disabled:h,className:"h-9 w-full rounded-lg border bg-background px-2 text-foreground",children:r})]})}function Ns(s,n){const o=n.connections?.find(r=>r.id===s.connection_id);return s.connection_id?`Connection: ${o?.display_name||o?.connector_key||"Unavailable"} (#${s.connection_id})`:s.connector_key?`Connector: ${n.connectors?.find(r=>r.key===s.connector_key)?.name||s.connector_key}`:"All connectors"}function Cs(s,n){return s.operation_key?n.connector_operations.find(o=>o.operation_key===s.operation_key)?.name||s.operation_key:s.operation_category?We[s.operation_category]:"All actions"}function ue(s,n){return`${Ns(s,n)} · ${Cs(s,n)}`}function Ee(s){return s.connection_id?`connection:${s.connection_id}`:s.connector_key?`connector:${s.connector_key}`:"all"}function Te({catalog:s}){return e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All connectors"}),e.jsx("optgroup",{label:"Connectors",children:s.connectors?.map(n=>e.jsx("option",{value:`connector:${n.key}`,children:n.name},n.key))}),e.jsx("optgroup",{label:"Connections",children:s.connections?.map(n=>e.jsxs("option",{value:`connection:${n.id}`,children:[n.display_name||n.connector_key," (#",n.id,")"]},n.id))})]})}function _s({label:s,ariaLabel:n,disabled:o,onRemove:r}){const[h,c]=j.useState(!1);return h?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(C,{type:"button",variant:"destructive",size:"sm",disabled:o,"aria-label":"Confirm removal",onClick:async()=>{await r()&&c(!1)},children:"Confirm"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>c(!1),children:"Cancel"})]}):e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":n,onClick:()=>c(!0),children:s})}function ks({owner:s,connector:n,connection:o,agent:r}){const h=ge(),[c,b]=j.useState(r??""),y=Ie(s),l=y.data,u=l?.agents.some(t=>t.id===c)?c:"",m=Be(s,u),i=Ke(s,!u),[P,_]=j.useState(o?`connection:${o}`:n?`connector:${n}`:"all"),[M,J]=j.useState(P),[I,L]=j.useState(!1),[k,D]=j.useState(""),[A,V]=j.useState("all"),[Z,E]=j.useState("approval"),[g,S]=j.useState(!1),[W,T]=j.useState(null),[G,X]=j.useState(o?String(o):""),[H,q]=j.useState(""),R=l?.connections?.some(t=>String(t.id)===G)?G:"",w=Me(s,R?Number(R):void 0,H,u||void 0);async function U(t,f){S(!0),T(null);try{if(u){const d={resource_class:"connector_action",...pe(t)};f?await Ye(s,u,{...d,effects:{execute:f}}):await Je(s,u,d)||T("This rule was already removed. The list has been refreshed.")}else{const d=i.data;if(!d)return;const K=d.rules.filter(Qe=>de(Qe)!==de(t));f&&K.push({...pe(t),effect:f});const ce=await Ze(s,{revision:d.revision,rules:K});h.setQueryData(Xe(s),ce)}return await Promise.all(["write-permissions","agent-permissions","available-operations","connector-operations","policy-explanation"].map(d=>h.invalidateQueries({queryKey:[d]}))),t}catch(d){d instanceof be&&d.status===409?(T("Policies changed in another session. Review the refreshed rules before saving again."),await i.refetch()):T(d instanceof Error?d.message:"Could not save policy.")}finally{S(!1)}}const Q=y.error||(u?m.error:i.error);if(Q instanceof be&&Q.status===403)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Only organization owners and admins can manage policies."});if(Q)return e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load policies. ",String(Q)]});if(!l||(u?!m.data:!i.data))return e.jsx(Y,{label:"policies",rows:2});const v=t=>t==="all"||l.connectors?.some(f=>`connector:${f.key}`===t)||l.connections?.some(f=>`connection:${f.id}`===t)?t:"all",a=v(P),p=v(M),N=l.connections?.find(t=>`connection:${t.id}`===p),$=N?.connector_key??(p.startsWith("connector:")?p.slice(10):void 0),x=t=>p==="all"||Ee(t)==="all"?!0:t.connection_id?N?t.connection_id===N.id:l.connections?.some(f=>f.id===t.connection_id&&f.connector_key===$):t.connector_key===$;function B(t){return u?t.principal_kind==="agent"&&t.principal_id===u:!t.principal_kind}const ee=a.startsWith("connector:")?a.slice(10):a.startsWith("connection:")?l.connections?.find(t=>t.id===Number(a.slice(11)))?.connector_key:void 0,z=l.connector_operations.filter(t=>!ee||t.connector_key===ee),se=l.connections?.find(t=>t.id===Number(R))?.connector_key,ae=l.connector_operations.filter(t=>t.connector_key===se),oe=u?(m.data?.agent??[]).filter(t=>t.resource_class==="connector_action").map($e):i.data?.rules??[],te=(m.data?.floor??[]).filter(t=>t.resource_class==="connector_action"&&x(t)).map($e),qe={connector_key:a.startsWith("connector:")?a.slice(10):a==="all"&&A==="specific"?z.find(t=>t.operation_key===k)?.connector_key??null:null,connection_id:a.startsWith("connection:")?Number(a.slice(11)):null,operation_key:A==="specific"?k:null,operation_category:A.startsWith("category:")?A.slice(9):null},re=oe.filter(x);function fe(){_(p),V("all"),D(""),E("approval"),L(!0)}const ye=(t,f=!1)=>e.jsx("div",{className:"divide-y rounded-lg border",children:t.map(d=>{const K=!f&&B(d);return e.jsxs(De,{controls:e.jsxs(e.Fragment,{children:[e.jsx(he,{options:Pe,value:d.effect,floor:"auto",compact:!0,disabled:g||!K,ariaLabel:`Policy for ${ue(d,l)}`,onChange:ce=>void U(d,ce)}),K&&e.jsx(_s,{label:"Remove",disabled:g,ariaLabel:`Remove rule: ${ue(d,l)}`,onRemove:()=>U(d)})]}),children:[e.jsx("p",{className:"text-sm break-words",children:ue(d,l)}),!K&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.principal_kind==="agent"&&!d.principal_id?"All agents":"Inherited restriction"})]},JSON.stringify([d.principal_kind,d.principal_id,de(d)]))})});return e.jsxs("div",{className:"space-y-4",children:[(p!==M||u!==c)&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"The requested scope is unavailable. Showing organization rules; install the connector or choose an available scope."}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Auto runs immediately. Ask waits for human approval. Block prevents execution and hides the action from agents. Authentication and guardrails still apply."}),e.jsxs("details",{className:"space-y-2",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-foreground",children:"How rules combine"}),e.jsx("p",{children:"A rule overrides another when it is narrower in target or actions and at least as narrow in the other. When rules are narrower in different ways, or use different categories, the stricter choice wins: Block, then Ask, then Auto. With no matching rule, the result is Ask. Impact categories apply only to writes."}),e.jsx("p",{children:"A connection-wide Auto does not override an organization-wide destructive Block. Add a destructive rule for that connection to make an exception."}),e.jsx("p",{children:"Agents and their Automations can only tighten organization policy. Internal browser steps inherit the parent approval; an explicit browser Block still wins."})]})]}),e.jsxs(F,{label:"Policy owner",value:u,onChange:b,disabled:g,children:[e.jsx("option",{value:"",children:"Organization"}),l.agents.map(t=>e.jsxs("option",{value:t.id,children:["Agent: ",t.name]},t.id))]}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto adds no restriction for this agent. It inherits organization policy and cannot bypass Ask or Block."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Without a matching restriction, this agent inherits organization policy.":"Without a matching rule, actions require approval (Ask)."}),e.jsx(F,{label:"Show rules for",value:p,onChange:J,disabled:g,children:e.jsx(Te,{catalog:l})}),u&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Inherited organization rules"}),ye(te,!0)]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:u?"Saved restrictions":"Saved rules"}),!I&&re.length>0&&e.jsx(C,{variant:"outline",size:"sm",disabled:g,onClick:fe,children:"Add rule"})]}),I&&e.jsxs("form",{className:"space-y-3 border-t pt-4",onSubmit:t=>{t.preventDefault(),!g&&(A!=="specific"||k)&&U(qe,Z).then(f=>{f&&(L(!1),J(Ee(f)))})},children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add rule"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(F,{label:"Applies to",value:a,onChange:t=>{_(t),V("all"),D("")},disabled:g,children:e.jsx(Te,{catalog:l})}),e.jsxs(F,{label:"Actions",value:A,onChange:V,disabled:g,children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("optgroup",{label:"Categories",children:l.operation_categories?.map(t=>e.jsx("option",{value:`category:${t}`,children:We[t]},t))}),e.jsx("option",{value:"specific",children:"Specific action"})]})]}),A==="specific"&&e.jsxs(F,{label:"Specific action",value:k,onChange:D,disabled:g,children:[e.jsx("option",{value:"",children:"Choose action"}),z.map(t=>e.jsxs("option",{value:t.operation_key,children:[t.connector_name,": ",t.name]},t.operation_key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(he,{options:Pe,value:Z,floor:"auto",compact:!0,disabled:g,ariaLabel:"New rule decision",onChange:E}),e.jsx(Ve,{onCancel:()=>L(!1),cancelDisabled:g,children:e.jsx(C,{type:"submit",disabled:g||A==="specific"&&!k,children:g?"Saving…":"Save rule"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving an existing scope replaces its decision. Removing a rule reveals the next matching rule."})]}),re.length?ye(re):!I&&e.jsx(Ge,{icon:He,title:"No saved rules in this scope",description:"Add a rule for all actions, a category, or a specific action.",actionLabel:"Add rule",onAction:fe})]}),W&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:W}),e.jsxs("details",{className:"space-y-3 border-t pt-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Check an action"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(F,{label:"Check connection",value:R,onChange:t=>{X(t),q("")},children:[e.jsx("option",{value:"",children:"Choose connection"}),l.connections?.map(t=>e.jsxs("option",{value:String(t.id),children:[t.display_name||t.connector_key," (#",t.id,")"]},t.id))]}),e.jsxs(F,{label:"Check action",value:H,onChange:q,disabled:!R,children:[e.jsx("option",{value:"",children:"Choose action"}),ae.map(t=>e.jsx("option",{value:t.operation_key.slice(t.connector_key.length+2),children:t.name},t.operation_key))]})]}),w.error?e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not check policy. ",String(w.error)]}):e.jsx("p",{"aria-live":"polite",className:"text-sm",children:H?w.isPending?"Checking…":w.data?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:Ue[w.data.effect]})," ·"," ",js[w.data.reason]??"The server evaluated this action.",w.data.rule_ids.length>0?` · Rules ${w.data.rule_ids.map(t=>`#${t}`).join(", ")}`:""]}):"":""})]})]})}const Ss=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],ws=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function xe(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function As(s){return s.agent.find(xe)}function zs(s,n){return{...s,agent:[...s.agent.filter(o=>!xe(o)),n]}}function Os(s){return{...s,agent:s.agent.filter(n=>!xe(n))}}function Ps({label:s,description:n,action:o,value:r,pending:h,onChange:c}){return e.jsxs(De,{controls:e.jsx(he,{options:as("entity_schema",o),value:r,floor:"auto",disabled:h,compact:!0,ariaLabel:s,onChange:c}),children:[e.jsx("p",{children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n})]})}function Re({title:s,actions:n,effects:o,pending:r,onChange:h}){return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:n.map(({action:c,label:b,description:y})=>e.jsx(Ps,{action:c,label:b,description:y,value:o[c]??me.entity_schema[c]??"deny",pending:r,onChange:l=>h(c,l)},c))})]})}function $s({owner:s}){const n=ge(),o=es(s),r=Ie(s),h=ve({mutationFn:m=>ss(s,{resource_class:"entity_schema",effects:m}),onSuccess:m=>{n.setQueryData(o,i=>i&&zs(i,m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to save schema policy")}}),c=ve({mutationFn:()=>ts(s,{resource_class:"entity_schema"}),onSuccess:()=>{n.setQueryData(o,m=>m&&Os(m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to reset schema policy")}});if(r.isLoading)return e.jsx(Y,{label:"schema policy",variant:"cards",cards:1});if(r.isError||!r.data)return e.jsx(ns,{label:"schema policy"});const b=As(r.data),y=b?.effects??me.entity_schema,l=h.isPending||c.isPending,u=(m,i)=>{h.mutate({...b?.effects??me.entity_schema,[m]:i})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:b?"Custom policy":"Workspace defaults"}),b?e.jsxs(C,{type:"button",variant:"outline",size:"sm",disabled:l,onClick:()=>c.mutate(),children:[e.jsx(is,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{title:"Entity types",actions:Ss,effects:y,pending:l,onChange:u}),e.jsx(Re,{title:"Relationship types",actions:ws,effects:y,pending:l,onChange:u})]})]})}function Fe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Es(s,n,o){const r=s.split("/");return r[1]===n?(r[1]=o,r.join("/")||"/"):`/${o}`}function Ts({section:s}){return s==="policies"?e.jsx(Y,{label:"policies",rows:2}):s==="governance"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx(Y,{label:"agent write defaults",variant:"table",rows:3})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx(Y,{label:"schema governance",rows:3})]})]}):e.jsxs("div",{role:"status","aria-label":"Loading general settings","aria-busy":"true",className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{"aria-hidden":"true",className:"space-y-4",children:[["name","slug"].map(n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(O,{className:"h-3.5 w-12 rounded-none"}),e.jsx("div",{className:"flex h-9 items-center border border-input bg-background px-3",children:e.jsx(O,{className:"h-4 w-32 rounded-none"})})]},n)),e.jsx(O,{className:"h-3 w-4/5 rounded-none"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-2 sm:grid-cols-2",children:["private","public"].map(n=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(O,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(O,{className:"h-4 w-16 rounded-none"}),e.jsx(O,{className:"h-3 w-full rounded-none"}),e.jsx(O,{className:"h-3 w-2/3 rounded-none"})]})]},n))})]}),e.jsxs("div",{"aria-hidden":"true",className:"flex justify-end gap-2",children:[e.jsx(O,{className:"h-9 w-20 rounded-none"}),e.jsx(O,{className:"h-9 w-28 rounded-none"})]})]})}function Rs({owner:s,section:n="general",connector:o,connection:r,agent:h}){const c=os(),b=ge(),{data:y,error:l}=Le(),{activeOrg:u,urlOrgSlug:m}=rs(),i=(y??[]).find(a=>a.slug===s&&a.is_member)??null,P=i?.id??s,_=cs(P,{name:i?.name??"",slug:i?.slug??"",visibility:i?.visibility??"private"}),[M,J]=_.field("name"),[I,L]=_.field("slug"),[k,D]=_.field("visibility"),[A,V]=ne(P,!!i),[Z,E]=ne(P,!1),[g,S]=ne(P,null),[W,T]=j.useState(!1),[G,X]=j.useState(!1),[H,q]=ne(P,!1);if(ls(l)&&y===void 0)return e.jsxs(we,{role:"alert",children:[e.jsx(Ae,{children:e.jsx(ze,{children:"Couldn't load organizations"})}),e.jsx(Oe,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(y===void 0)return e.jsx(Ts,{section:n});if(!i)return e.jsxs(we,{children:[e.jsx(Ae,{children:e.jsx(ze,{children:"Organization not found"})}),e.jsx(Oe,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});if(n==="policies")return e.jsx("div",{className:"space-y-6",children:e.jsxs("section",{id:"policies",className:"scroll-mt-6 space-y-4",children:[e.jsx("div",{className:"space-y-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control connector actions across the organization. Changes to existing rules save automatically."})}),e.jsx(ks,{owner:s,connector:o,connection:r,agent:h},`${s}:${h??""}:${o??""}:${r??""}`)]})});if(n==="governance")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the defaults agents inherit for entities and agents. Changes save automatically; agents can only tighten them."})]}),e.jsx(vs,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control structural changes by agents and connected AI clients. Changes save automatically."})]}),e.jsx($s,{owner:s})]})]});const R=a=>{const p=xs(a);if(p.kind==="cross-host"){window.location.assign(p.href);return}c({to:p.to})},w=a=>{if(a==="public"&&i.visibility!=="public"){E(!0);return}D(a),E(!1)},U=async()=>{if(!_.canSubmit)return;const a=M.trim();if(!a){S("Name is required");return}const p=I.trim()||Fe(a);if(!p){S("Slug is required");return}T(!0),S(null);try{const N=a!==i.name||p!==i.slug,$=k!==i.visibility;let x=i.slug;if(N){const z=await le.update({organizationId:i.id,data:{name:a,slug:p}});if(z.error){S(z.error.message||"Failed to update organization");return}x=z.data?.slug??p}$&&(x=(await ps(x,k)).slug),(N||$)&&(_.accept(_.values,{name:a,slug:x,visibility:k}),await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization updated"));const B=u?.id===i.id||m===i.slug,ee=x!==i.slug;if(B&&ee){const z=_e(),se=ke();if(z===i.slug&&se){const oe=gs(window.location.pathname,i.slug)||"/",te=`${window.location.protocol}//${x}.${se}${oe}${window.location.search}${window.location.hash}`;window.location.assign(te);return}const ae=Es(window.location.pathname,i.slug,x);c({to:`${ae}${window.location.search}${window.location.hash}`});return}}catch(N){S(N instanceof Error?N.message:"Failed to update organization")}finally{T(!1)}},Q=async()=>{X(!0),S(null);try{const a=await le.delete({organizationId:i.id});if(a.error){S(a.error.message||"Failed to delete organization");return}await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization deleted");const N=(y??[]).filter(x=>x.is_member).find(x=>x.id!==i.id)??null,$=u?.id===i.id||m===i.slug;if($&&N){await le.setActive({organizationId:N.id}),R(N.slug);return}if($){const x=_e(),B=ke();if(x===i.slug&&B){window.location.assign(`${window.location.protocol}//app.${B}/`);return}c({to:"/"});return}c({to:"/"})}catch(a){S(a instanceof Error?a.message:"Failed to delete organization")}finally{X(!1),q(!1)}},v=W||G;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-name",children:"Name"}),e.jsx(Ne,{id:"org-name",value:M,onChange:a=>{J(a.target.value),A||L(Fe(a.target.value))},placeholder:"e.g. My Team",disabled:v})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-slug",children:"Slug"}),e.jsx(Ne,{id:"org-slug",value:I,onChange:a=>{V(!0),L(a.target.value)},placeholder:"e.g. my-team",disabled:v}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",i.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("private"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>w("public"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(us,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),Z&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(C,{type:"button",size:"sm",onClick:()=>{D("public"),E(!1)},disabled:v,children:"Confirm public"}),e.jsx(C,{type:"button",size:"sm",variant:"ghost",onClick:()=>E(!1),disabled:v,children:"Cancel"})]})]})]}),g&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),e.jsx(ms,{visible:_.hasConflict,onReload:_.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>void c({to:`/${s}`}),disabled:v,children:"Cancel"}),e.jsxs(C,{onClick:U,disabled:v||!_.canSubmit,children:[W?e.jsx(Ce,{size:"lg",className:"mr-1.5"}):null,W?"Saving...":"Save changes"]})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:i.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!i.is_personal&&e.jsx("div",{className:"mt-3",children:H?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"destructive",size:"sm",onClick:Q,disabled:v,children:[G?e.jsx(Ce,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>q(!1),disabled:v,children:"Cancel"})]}):e.jsxs(C,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>q(!0),disabled:v,children:[e.jsx(hs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Ds(){const{owner:s}=Se.useParams(),n=Se.useSearch(),{hash:o}=fs(),r=ys(n,o),h={general:"General",policies:"Policies",governance:"Governance"}[r],{data:c}=Le(),b=(c??[]).find(y=>y.slug===s&&y.is_member)?.name;return e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-1 flex-col gap-6 px-4 pt-2.5 pb-8 lg:px-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(bs,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:h})]}),b?e.jsx("p",{className:"text-base font-medium text-foreground",children:b}):null]}),e.jsx(Rs,{owner:s,...n,section:r})]})}export{Ds as component};
|
|
2
|
+
//# sourceMappingURL=organization-CoUJYXx7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jg as K,jh as V,r as f,h0 as q,u as $,j as e,dv as H,av as U,cA as G,S as w,iE as W,B as v,ji as Q,jj as k,jk as Z,jl as P,jm as O,jn as Y,d0 as J,i as A,ak as D,cr as z,a3 as C,fb as X,o as ee,dk as te,fy as se,s as ne,L as T,jo as re,fc as ie,fB as oe,fe as ae,jp as ce,b8 as F,at as de,jq as le,an as ue,g as me,jr as pe,cg as xe,e0 as he,cN as fe,p as ge,dZ as ye,js as je,bc as ve,jt as Ne,e8 as we,cO as be,ju as ke}from"./index-JmEl29py.js";import{u as Ae,A as Ce}from"./automation-detail-content-DCAZBKle.js";import{A as Se}from"./agent-loading-shells-jkf9DjdO.js";import{s as Ie,h as _e,R as Le,A as Pe}from"./agent-thread-BGHYHWDO.js";import{C as $e,b as Re,A as Te}from"./connection-feed-detail-IO6G5QjL.js";import{f as Ee}from"./connector-scope-lists-B44Q9W-j.js";import{a as Oe}from"./connections-browser-CzdcZeiU.js";import{S as De}from"./source-record-panels-BeAZeMLy.js";import{E as R,R as ze,d as Fe}from"./events-feed-C4VrjIc1.js";import{S as Me}from"./schema-type-editor-panel-DcJqbCrU.js";import{h as Be,s as Ke,i as Ve}from"./linked-record-peek-B0_B4PnF.js";import{E as qe}from"./event-detail-C25TvOb_.js";import{V as He,R as Ue}from"./views-access-required-CWwlobOd.js";import{V as Ge,a as We}from"./view-param-filters-FuOZyjMg.js";import{S as Qe,g as Ze}from"./runs-table-9OVdfPXZ.js";import{b as Ye}from"./use-automations-DS3uz3pb.js";import"./create-automation-form-y3tq2QIJ.js";import"./cronstrue-CeUS_78Q.js";import"./entity-options-BcTafZ2e.js";import"./connection-label-BobuYiAG.js";import"./model-selector-BeFuFH7p.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-C8FJbT2P.js";import"./index-wHFQv1aT.js";import"./use-mention-search-CAFbh-Dk.js";import"./proposal-review-shell-CmLy1MZf.js";import"./runs-B0zVYb-w.js";import"./json-diff-4sMmayDd.js";import"./app-bridge-BCm4muqj.js";import"./status-dot-_LQZmEIX.js";import"./client-activity-scopes-CmK3DkSP.js";import"./client-rows-fFuxzFtE.js";import"./copy-button-kcjg8Giw.js";import"./use-scroll-sentinel-BpQ70c28.js";import"./entity-type-page-BzMZttzh.js";import"./card-Cspo-4M6.js";import"./record-session-CJzFoVKc.js";import"./filter-editors-oNjBX9a2.js";const M=Symbol("trusted-automation-interaction");function Je(t){return Object.defineProperty(t,M,{value:!0}),t}function Xe(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const et=new Set(["automation-approval-batch"]);function tt(t){return new Promise(s=>{t({onSettled:(i,n)=>s(!!n)})})}function st(){const t=K(),s=V();return f.useMemo(()=>({toolNames:et,resolve:(i,n)=>{if(!n||typeof n!="object"||n[M]!==!0)return null;const r=n;if(i==="automation-approval-batch"){const o=typeof r.runId=="number"&&Number.isSafeInteger(r.runId)&&r.runId>0?r.runId:null,c=typeof r.count=="number"&&Number.isSafeInteger(r.count)&&r.count>1?r.count:null,a=Array.isArray(r.runIds)?r.runIds.filter(d=>typeof d=="number"&&Number.isSafeInteger(d)&&d>0):[];return o===null||c===null||a.length!==c||new Set(a).size!==c?null:{view:Xe(c),handlers:{manage_operations:d=>d.action!=="approve"&&d.action!=="reject"?Promise.resolve(!0):tt(m=>d.action==="approve"?t.mutate({run_id:o,run_ids:a},m):s.mutate({run_id:o,run_ids:a},m))}}}return null}}),[t,s])}function nt(t){const s=[];return t.forEach((i,n)=>{s.push({id:`sep:${i.runId}`,role:"system",parts:[{type:"text",text:rt(i,n)}],createdAt:i.completedAt?new Date(i.completedAt).getTime():void 0});for(const r of i.messages)s.push({...r,id:`r${i.runId}:${r.id}`})}),s}function rt(t,s){const i=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",n=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",r=t.completedAt?new Date(t.completedAt).toLocaleString():null;return r?`Run ${s+1} · ${i}${n} · ${r}`:`Run ${s+1} · ${i}${n}`}const it=/(?:^|\n)Run this Automation now/;function ot(t){return t.role==="user"&&t.parts.some(s=>s.type==="text"&&it.test(s.text))}function at(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function ct({agentId:t,automationId:s,ownerSlug:i,runId:n}){const{data:r,isLoading:o}=q(t,s,{orgSlug:i,...n!=null?{runId:n}:{}}),c=st(),a=$(),d=f.useCallback(l=>{a?.open({href:`/${i}/automations/${s}?run_id=${l}`,title:`Automation run #${l}`,runId:l})},[a,i,s]),m=f.useMemo(()=>{const l=r?.runs??[],g=(n!=null?l.filter(u=>u.runId===n):l).slice().reverse();return nt(g.map(u=>{const h=u.messages.map(x=>Ie(x,{showToolCalls:!0})).filter(x=>x!==null&&!ot(x));u.task?.trim()&&h.unshift({id:"task",role:"user",parts:[{type:"text",text:u.task.trim()}]});const p=u.actions??[],y=p.filter(x=>x.status==="pending");if(y.length>1){const x=y.map(j=>j.runId).sort((j,I)=>j-I);h.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${u.runId}`,toolName:"automation-approval-batch",args:Je({runId:u.runId,count:y.length,runIds:x})}]})}for(const x of p){const j=_e([x],{workspaceSlug:i,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});j&&h.push({...j,id:at(x)})}return{runId:u.runId,completedAt:u.completedAt,status:u.status,pendingActionCount:u.pendingActionCount,autoAppliedCount:u.autoAppliedCount,messages:h}}))},[t,r,i,n]);return o?e.jsx(Se,{readOnly:!0}):m.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(Le,{messages:m,workspaceSlug:i,children:e.jsx(Pe,{readOnly:!0,readerPositionMode:"runs",interactionExtension:c,onRunSelect:n==null&&a?d:void 0})})})}function dt(t){if(!t||typeof t!="object")return[];const s=t.properties;if(!s)return[];const i=Array.isArray(t.required)?new Set(t.required.map(String)):new Set;return Object.entries(s).map(([n,r])=>({name:n,type:String(r.type??"any"),required:i.has(n),description:typeof r.description=="string"?r.description:void 0}))}function lt({fields:t}){return t.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):e.jsx("ul",{className:"space-y-2",children:t.map(s=>e.jsxs("li",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("code",{className:"text-xs font-medium text-foreground",children:s.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:s.type}),s.required?e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),s.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}):null]},s.name))})}function S({item:t,hideHeading:s=!1}){const i=t.schemaSections;return i?e.jsxs("article",{className:s?"space-y-4":"space-y-4 px-5 py-5",children:[!s&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("h2",{className:"text-base font-medium text-foreground",children:t.title}),i.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:i.description}):null]})]}),i.sections.map(n=>{const r=dt(n.schema);return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n.title}),n.description?e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:n.description}):null]}),e.jsx(lt,{fields:r})]},n.title)})]}):null}function ut({panel:t}){const s=U(t.organizationId),i=t.section==="connections"||!!t.connectionId,n=G(t.organizationId,{connectorKey:t.connectorKey,connectionIds:t.connectionId?[t.connectionId]:void 0,enabled:i}),r=s.data?.find(c=>c.key===t.connectorKey),o=n.data?.find(c=>c.id===t.connectionId&&c.connector_key===t.connectorKey);return s.isLoading||i&&n.isLoading?e.jsx("div",{className:"p-5",children:e.jsx(w,{className:"h-28 w-full"})}):s.isError||i&&n.isError?e.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):t.connectionId&&!o||!r&&!o&&t.section!=="connections"?e.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):e.jsx("div",{className:"p-5",children:t.section==="connections"?e.jsx(Oe,{connections:n.data??[],connector:r,connectorKey:t.connectorKey,ownerSlug:t.ownerSlug}):o?e.jsx(xt,{connection:o,connector:r,panel:t}):r?t.section==="feeds"?e.jsx(mt,{connector:r}):r.installed===!1?e.jsx(pt,{connector:r,ownerSlug:t.ownerSlug}):e.jsx(ft,{connector:r,ownerSlug:t.ownerSlug}):null},`${t.connectorKey}:${t.connectionId??"connector"}:${t.section}`)}function mt({connector:t}){const s=Object.entries(t.feeds_schema??{}).map(([i,n])=>{const r=n;return{id:i,name:r.name??i,description:r.description,feed:r}});return e.jsx(k,{entries:s,label:"feed types",renderDetail:({name:i,feed:n})=>e.jsx(S,{item:{href:"",title:i,schemaSections:Z(n)},hideHeading:!0})})}function pt({connector:t,ownerSlug:s}){const i=Object.entries(t.actions_schema??{}).map(([n,r])=>{const o=r;return{id:n,name:o.name??n,description:o.description,action:o}});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",e.jsx(P,{ownerSlug:s,connectorKey:t.key})]}),e.jsx(k,{entries:i,label:"actions",renderDetail:({name:n,action:r})=>e.jsx(S,{hideHeading:!0,item:{href:"",title:n,schemaSections:O(r)}})})]})}function xt({connection:t,connector:s,panel:i}){const[n,r]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:n,children:i.section==="feeds"?e.jsx(ht,{connection:t,connector:s,ownerSlug:i.ownerSlug}):e.jsx(W,{connection:t,ownerSlug:i.ownerSlug,inPeek:!0,onReviewPermissions:s?()=>r(!0):void 0})}),n&&s&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Back to actions"}),e.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),e.jsx(Q,{connection:t,connectorDef:s})]})]})}function ht({connection:t,connector:s,ownerSlug:i}){const{data:n=[],isLoading:r,isError:o}=J(t.id),[c,a]=f.useState(!1),d=t.facets?.chat??!1;if(r)return e.jsx(w,{className:"h-28 w-full"});if(o)return e.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const m=n.map(l=>({id:String(l.id),name:l.display_name||l.feed_key,status:Ee(l)??(l.operations.includes("sync")?"Sync enabled":"Live access"),feed:l}));return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:c,children:e.jsx(k,{entries:m,label:d?"channels":"feeds",action:Object.keys(s?.feeds_schema??{}).length>0?e.jsx(v,{size:"sm",variant:"outline",onClick:()=>a(!0),children:d?"Add channel":"Add feed"}):void 0,renderDetail:({feed:l})=>l.store==="channel_messages"?e.jsx($e,{feed:l,hideHeader:!0}):e.jsx(Re,{feed:l,connectorDef:s,ownerSlug:i})})}),c&&s&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:d?"Add channel":"Add feed"}),e.jsx(Te,{organizationId:t.organization_id,connections:[t],connectorDefinitions:[s],onClose:()=>a(!1)})]})]})}function ft({connector:t,ownerSlug:s}){const{data:i=[],isLoading:n,isError:r}=Y(t.key);if(n)return e.jsx(w,{className:"h-28 w-full"});if(r)return e.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const o=t.actions_schema??{},c=i.map(a=>({id:a.operation_key,name:a.name??a.operation_key,description:a.description,operation:a}));return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",e.jsx(P,{ownerSlug:s,connectorKey:t.key})]}),e.jsx(k,{entries:c,label:"actions",renderControl:()=>e.jsx(P,{ownerSlug:s,connectorKey:t.key}),renderDetail:({operation:a,name:d})=>o[a.operation_key]?e.jsx(S,{hideHeading:!0,item:{href:"",title:d,schemaSections:O(o[a.operation_key])}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function gt({owner:t,path:s}){const{data:i,isLoading:n}=A(t,{slug:t}),r=i?.workspace,o=r?.type==="organization"?r.id:null,c=o?{slug:t}:void 0,{data:a,isLoading:d}=D(`/${t}/${z(s)}`,c),m=a?.entity,l=m?.id;return n||d?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(C,{className:"mr-2"})," Loading…"]}):o?l==null?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):m?.is_derived?e.jsx(De,{record:{type:m.entity_type,key:m.slug},orgContext:c}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{organizationId:o,ownerSlug:t,entityId:typeof l=="number"?l:void 0,filters:{sortBy:"date",sortOrder:"desc"},emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function yt(t){if(Array.isArray(t.enum))return`One of ${t.enum.length}`;if(t.format==="date"||t.format==="date-time")return"Date";if(t.format==="uri")return"Link";if(t.format==="email")return"Email";const s=Array.isArray(t.type)?t.type[0]:t.type;return s==="array"?"List":s==="object"?"Group":s==="integer"||s==="number"?"Number":s==="boolean"?"Yes / no":"Text"}function jt({owner:t,typeSlug:s}){const{data:i,isLoading:n}=A(t,{slug:t}),r=i?.workspace,o=r?.type==="organization"?r.id:null,{isAdmin:c}=X(o??void 0),[a,d]=f.useState(!1),{orgContext:m}=ee(),{data:l,isSuccess:b}=te(m),g=(l??[]).find(N=>N.slug===s),u=b&&!g,h=`/${t}/${se(s)}`,{pathname:p}=ne(),y=p===h||p===`${h}/`||p.startsWith(`${h}/-/`),x=f.useMemo(()=>Be(g?.metadata_schema),[g?.metadata_schema]),j=$()?.close;f.useEffect(()=>{u&&j?.()},[u,j]);const I=f.useMemo(()=>({entityTypes:[s],sortBy:"date",sortOrder:"desc"}),[s]);return n?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(C,{className:"mr-2"})," Loading…"]}):u?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This entity type no longer exists."}):o?e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[y?null:e.jsx(v,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(T,{...ie(t,s),children:[e.jsx(re,{className:"mr-1.5 h-3.5 w-3.5"}),"Browse records"]})}),g&&!y&&!oe(g)&&g.entity_count!==0?e.jsx(v,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(T,{to:"/$owner/$entityType/-/$shape",params:{owner:t,entityType:s,shape:"graph"},search:ce(`/${t}/events?${new URLSearchParams({type:s})}`),children:[e.jsx(ae,{className:"mr-1.5 h-3.5 w-3.5"}),"Graph"]})}):null,c?e.jsx(v,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground","aria-pressed":a,onClick:()=>d(N=>!N),children:a?"Done":e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-3.5 w-3.5"}),"Edit type"]})}):null]}),a?e.jsx("div",{className:"p-4",children:e.jsx(Me,{slug:s,onClose:()=>d(!1)})}):e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[x.length>0?e.jsxs("section",{"aria-labelledby":"entity-type-peek-fields",children:[e.jsx("h3",{id:"entity-type-peek-fields",className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Fields"}),e.jsx("dl",{className:"divide-y divide-border/60 text-sm",children:x.map(N=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",title:N.prop.description,children:[e.jsx("dt",{className:"min-w-0 truncate",children:Ke(N)}),e.jsx("dd",{className:"shrink-0 text-xs text-muted-foreground",children:yt(N.prop)})]},N.key))})]}):null,e.jsx(R,{organizationId:o,ownerSlug:t,filters:I,showEntityLinks:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to these records yet."})})]})]}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function vt({owner:t,eventId:s,viewKey:i}){const n=$(),r=(o,c)=>e.jsx(qe,{owner:c,organizationId:o,eventId:s,viewKey:i,dense:!0,onSelectView:n?a=>n.retarget(a):void 0},`${c}/${s}/${i??""}`);return e.jsx("div",{className:"px-4 py-4",children:t==="me"?r(null,t):e.jsx(de,{owner:t,children:({organizationId:o,ownerSlug:c})=>o?r(o,c):e.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function _({owner:t,runId:s,runIds:i,contentIds:n}){const{data:r,isLoading:o}=A(t==="me"?null:t,{slug:t}),c=r?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,d=f.useMemo(()=>{if(t==="me")return n?.length?{contentIds:n,sortBy:"date",sortOrder:"desc"}:void 0;const l=i??(s!=null?[s]:void 0);if(!(!l?.length&&!n?.length))return{...l?.length?{runIds:l}:{},...n?.length?{contentIds:n}:{}}},[t,n,s,i]),m=d!=null;return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(C,{className:"mr-2"})," Loading…"]}):t!=="me"&&a==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):m?e.jsx("div",{className:"px-4 py-4",children:e.jsx(R,{presentation:"detail",organizationId:a,ownerSlug:t,filters:d,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:s!=null||i?.length?"No matching events from this run yet.":"No matching events yet."})})}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}const L=25;function Nt({target:t}){const[s,i]=f.useState(0),{data:n,isLoading:r,isError:o,refetch:c}=le(t.entityId,t.orgContext,{relationshipType:t.relationshipType,limit:L,offset:s}),a=n?.total;return e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.label," · ",t.entityName,a!==void 0?` · ${a} current ${a===1?"link":"links"}`:n?` · ${n.rows.length} shown`:""]}),e.jsx(ze,{count:n?.failures?.length??0,onRetry:()=>void c()}),r?e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{className:"h-6 w-full"}),e.jsx(w,{className:"h-6 w-full"})]}):o||!n?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load these links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void c(),children:"Retry"})]}):n.rows.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No links on this page."}):e.jsx("ul",{className:"divide-y divide-border",children:n.rows.map(d=>e.jsx("li",{className:"flex items-center justify-between gap-3 py-1.5",children:e.jsx(Fe,{row:d,entityId:t.entityId,ownerSlug:t.ownerSlug,orgContext:t.orgContext})},d.id))}),n&&(s>0||n.hasMore)?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(v,{type:"button",variant:"outline",size:"sm",disabled:s===0,onClick:()=>i(Math.max(0,s-L)),children:"Previous"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[n.rows.length," shown",a===void 0?"":` of ${a}`]}),e.jsx(v,{type:"button",variant:"outline",size:"sm",disabled:!n.hasMore,onClick:()=>i(s+L),children:"Next"})]}):null]})}function wt({owner:t,path:s,viewKey:i}){const[n,r]=f.useState({}),{data:o,isLoading:c}=A(t,{slug:t}),a=o?.workspace,d=a?.type==="organization"?a.id:null,m=d?{slug:t,organizationId:d}:void 0,{data:l,isLoading:b}=D(`/${t}/${z(s)}`,m),{isMember:g,isLoading:u}=ue(t),h=me({slug:t,organizationId:g?d:null}),p=l?.entity;if(c||b||u||g&&h.isLoading)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(C,{className:"mr-2"})," Loading…"]});if(!g)return e.jsx(He,{});if(h.isError)return e.jsx(Ge,{onRetry:()=>void h.refetch()});const y=p?pe(h.data??[],{type:p.entity_type,id:p.id??p.slug}).find(x=>x.key===i):void 0;return!d||!p||!y?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This view isn't attached to this record any more."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(We,{orgSlug:t,viewKey:y.key,scope:{type:p.entity_type,entity:p.is_derived?p.slug:p.id??p.slug},params:n,onParamsChange:r,contentHash:y.content_hash,title:y.name,minHeight:320})})}function B({owner:t,runId:s}){const i=xe({queryKey:["run-outcome",t,s],queryFn:async()=>{const r=await fe("manage_operations",{action:"get_run",run_id:s},{slug:t});if(!r.run)throw new Error(r.error||"Run not found");return r.run},enabled:t!=="me",staleTime:15e3,refetchInterval:r=>["pending","claimed","running"].includes(r.state.data?.status??"")?5e3:!1});if(t==="me")return null;if(i.isLoading)return e.jsx("p",{role:"status",className:"px-4 pt-4 text-xs text-muted-foreground",children:"Loading run…"});if(!i.data)return e.jsx("p",{role:"alert",className:"px-4 pt-4 text-sm text-destructive",children:"Could not load this run."});const n=i.data;return e.jsxs("section",{"aria-label":"Run outcome",className:"space-y-2 border-b px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Qe,{status:Ze(n.status),children:n.status}),e.jsx("time",{dateTime:n.created_at,className:"text-xs text-muted-foreground",children:he(n.created_at)})]}),n.connection_display_name?e.jsx("p",{className:"text-sm",children:n.connection_display_name}):null,n.error_message?e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-destructive",children:n.error_message}):null,i.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not refresh this run. Showing its last known outcome."}):null]})}function ds({item:t}){if(t.connectorPanel)return e.jsx(ut,{panel:t.connectorPanel});if(t.schemaSections)return e.jsx(S,{item:t});if(t.recordField)return e.jsx(Ue,{target:t.recordField});if(t.recordPeer)return e.jsx(Ve,{target:t.recordPeer});if(t.recordLinks)return e.jsx(Nt,{target:t.recordLinks});if(typeof t.browserUrl=="string"&&t.browserUrl.length>0)return e.jsx(E,{item:t});const s=t.href?ge(t.href):null;return s?s.kind==="memory"?"runId"in s?e.jsxs(e.Fragment,{children:[e.jsx(B,{owner:s.owner,runId:s.runId}),e.jsx(_,{owner:s.owner,runId:s.runId})]}):"runIds"in s?e.jsx(_,{owner:s.owner,runIds:s.runIds}):e.jsx(_,{owner:s.owner,contentIds:s.contentIds}):s.kind==="entity"?e.jsx(gt,{owner:s.owner,path:s.path}):s.kind==="entity-type"?e.jsx(jt,{owner:s.owner,typeSlug:s.typeSlug}):s.kind==="record-view"?e.jsx(wt,{owner:s.owner,path:s.path,viewKey:s.viewKey}):s.kind==="event"?e.jsx(vt,{owner:s.owner,eventId:s.eventId,viewKey:s.viewKey}):t.runId?e.jsx(bt,{owner:s.owner,automationId:s.automationId,runId:t.runId}):e.jsx(kt,{owner:s.owner,automationId:s.automationId,initialView:s.view??"activity",runId:s.runId}):e.jsx(E,{item:t})}function E({item:t}){const s=t.body,i=t.notificationType??"generic",n=t.createdAt,r=t.browserUrl??null,o=t.browserHandoff??null;return e.jsxs("article",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ye,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:je(i)}),n?e.jsx("span",{children:ve(n)}):null]})]}),s?e.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:e.jsx(Ne,{text:s,linkPolicy:i==="action_approval_needed"?"app-links":"strip"})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),t.owner&&t.sourceAttribution?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),e.jsx(we,{owner:t.owner,source:t.sourceAttribution,className:"text-xs"})]}):null,r?e.jsx("div",{className:"space-y-2",children:o?.state==="expired"?e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:o.error_message??"This draft expired before the page was opened."}):o?.state==="completed"||o?.state==="preparing"?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):e.jsxs(v,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{ke(r)},children:[e.jsx(be,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function bt({owner:t,automationId:s,runId:i}){const{organizationId:n}=Ae(t),r=Ye(s,void 0,n),o=r.data?.automation?.managed_agent_id??null;return o?e.jsx(ct,{agentId:o,automationId:s,ownerSlug:t,runId:i}):r.isLoading?e.jsx(w,{className:"h-24 w-full rounded-lg"}):e.jsx(B,{owner:t,runId:i})}function kt({owner:t,automationId:s,initialView:i,runId:n}){const[r,o]=f.useState(i),c=r==="definition";return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(v,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>o(c?"activity":"definition"),children:c?"Done":e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-3.5 w-3.5"}),"Edit"]})})}),e.jsx(Ce,{owner:t,agentId:null,automationId:s,view:r,runId:n,onDone:()=>o("activity")})]})}export{ds as PeekPaneContent};
|
|
2
|
+
//# sourceMappingURL=peek-pane-content-BvkYk72J.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as r,fb as i,j as e,iV as m}from"./index-JmEl29py.js";import{A as c}from"./agent-permissions-matrix-C8j8kRB1.js";import{A as l}from"./agent-subpage-shell-D49f-bzP.js";function x({owner:t,agentId:s}){const{orgContext:n}=r(),{isAdmin:o,isLoading:a}=i(n.organizationId);return e.jsx(l,{children:o?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(c,{owner:t,agentId:s})})]}):a?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function p(){const{owner:t,agentId:s}=m.useParams();return e.jsx(x,{owner:t,agentId:s})}export{p as component};
|
|
2
|
+
//# sourceMappingURL=permissions-C6UFdvz2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h1 as f,gA as w,gB as y,r as N,j as e,b7 as P,B as d,E as k,fP as A}from"./index-JmEl29py.js";import{a as C}from"./runs-B0zVYb-w.js";function B({resource:g,runId:t,children:h,onDone:l}){const c=!!t,{data:a,isLoading:E,isError:u,refetch:v}=C(g,c?t:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[p,x]=N.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{t&&n.mutate({run_id:t},{onSuccess:()=>l?.()})},R=()=>{if(!t)return;const r=p.trim();i.mutate({run_id:t,...r?{reason:r}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. The values below show the proposed change — ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(k,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(A,{id:"review-reject-reason",rows:2,value:p,onChange:r=>x(r.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{B as P};
|
|
2
|
+
//# sourceMappingURL=proposal-review-shell-CmLy1MZf.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{au as vn,j as n,r as b,q as G,s as ie,cM as yn,cg as It,cN as Tt,L as Ne,cO as gn,cP as xn,bZ as bn,cQ as jn,cD as kn,cR as At,cS as T,bl as ft,cT as Cn,cU as Sn,ai as Nn,cV as _n,ah as In,cW as Tn,cX as ae,cs as An,cY as Et,cZ as En,ak as Fn,c_ as wn,a$ as Rn,ba as Mn,aq as Ce,c$ as Pn,d0 as $n,an as Ft,ch as wt,d1 as On,cJ as Ln,d2 as Dn,d3 as Rt,d4 as Kn,d5 as Bn,be as Un,aX as Vn,bn as Gn,bo as Qn,d6 as zn,bp as Wn,bq as Hn,br as qn,S as Yn,d7 as Zn,I as Xn,T as _e,X as Jn,B as W,d8 as es,d9 as ts,da as ns,bz as ss,db as os,dc as as,dd as is,de as Mt,df as pt,k as rs,dg as cs,dh as Oe,di as ht,cf as ls,dj as ds,dk as us,cA as ms,dl as fs,dm as ps,dn as hs,dp as vs,dq as ys,dr as gs,ds as xs,bK as bs,dt as js,du as ks,aR as vt,dv as yt,dw as Pt,cu as Le,cL as $t,dx as Cs,dy as De}from"./index-JmEl29py.js";import{S as K,F as Ss,d as Ns,o as ke,r as _s,f as Is,a as Ts}from"./filter-editors-oNjBX9a2.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as As}from"./runs-B0zVYb-w.js";import{S as Es}from"./source-record-panels-BeAZeMLy.js";import{u as Fs,g as ws}from"./client-rows-fFuxzFtE.js";import{u as Rs}from"./client-activity-scopes-CmK3DkSP.js";import{a as Ms,E as Ps}from"./events-feed-C4VrjIc1.js";import{L as $s,u as Os}from"./linked-record-peek-B0_B4PnF.js";import{E as Ls}from"./agent-loading-shells-jkf9DjdO.js";import{M as Ds}from"./member-scope-gate-Dit3MXBQ.js";const Ve=b.createContext(null);function Ks({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:a}=vn(e);return n.jsx(Ve.Provider,{value:{groups:s,isLoading:!!t||a},children:o})}function Bs(){const e=b.useContext(Ve);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Us(){return b.useContext(Ve)}function Ot(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:a=!0,replace:r=!0,merge:f}=e,m=G(),u=ie(),c=b.useMemo(()=>{const g=new URLSearchParams;for(const[l,h]of Object.entries(u.search||{}))h!=null&&g.set(l,typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h):String(h));return t(g)},[u.search,t]),i=b.useCallback((g,l)=>{const h=f?f(c,g):{...c,...g},y=o(h),C={};for(const[S,x]of Object.entries(u.search||{}))x!=null&&(C[S]=x);for(const S of s)delete C[S];if(a)for(const S of Object.keys(C))S.startsWith("clf_")&&delete C[S];for(const[S,x]of Object.entries(y))x!==void 0&&(C[S]=x);m({to:u.pathname,search:C,replace:l?.replace??r})},[c,o,s,a,f,m,u,r]),d=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(u.search||{}))h!=null&&(s.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));m({to:u.pathname,search:g,replace:r})},[m,u.pathname,u.search,s,a,r]);return{filters:c,updateFilters:i,clearFilters:d}}function Vs(e){const{slug:t}=yn();return It({queryKey:["schedules",t,e],queryFn:async()=>((await Tt("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Gs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Qs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function zs(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function Ws(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Hs(e,t,o){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:o}}}function ye({id:e,label:t,value:o,sourceLink:s,details:a,onRemove:r}){return{id:e,label:t,op:"is",value:o,onRemove:r,editor:s||a?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(Ne,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:o}),n.jsx(gn,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function qs({ownerSlug:e,clientIds:t,linkedUser:o,linkedUserEntitySlug:s}){const a=e&&s?xn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(r=>n.jsx("code",{className:"break-all text-foreground",children:r},r))]}),o?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?n.jsx(Ne,{to:a,className:"font-medium text-foreground hover:underline",children:o}):n.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ge(e,t,o){const s=new Set;for(const[a,r]of Object.entries(e.feeds_schema??{})){if(o&&!o.has(a))continue;const f=ee(ee(r)?.eventKinds);if(f)for(const[m,u]of Object.entries(f)){if(!t){s.add(m);continue}const c=ee(u)?.attributions;Array.isArray(c)&&c.some(i=>{const d=ee(ee(i)?.target);return typeof d?.entityType=="string"&&t.has(d.entityType)})&&s.add(m)}}return s}function Ys({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const r=new Set,f=new Set(o),m=new Set(a),u=new Map;for(const c of s){const i=u.get(c.connectorKey)??new Set;i.add(c.feedKey),u.set(c.connectorKey,i)}if(u.size>0)for(const c of e){const i=u.get(c.key);if(i)for(const d of ge(c,void 0,i))r.add(d)}else if(f.size>0){for(const c of e)if(f.has(c.key))for(const i of ge(c))r.add(i)}else if(m.size>0){for(const c of t)if(m.has(c.slug))for(const i of Object.keys(c.event_kinds??{}))r.add(i);for(const c of e)for(const i of ge(c,m))r.add(i)}else{for(const c of t)for(const i of Object.keys(c.event_kinds??{}))r.add(i);for(const c of e)for(const i of ge(c))r.add(i)}return[...r].sort((c,i)=>c.localeCompare(i))}function oe({to:e,params:t,search:o,label:s}){return n.jsx(Ne,{to:e,params:t,search:o,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(bn,{className:"h-3.5 w-3.5"})})}const Ke=["produced","analyzed"],Se=e=>e==="produced"?"Produced by":"Analyzed by";function Zs({enabled:e,...t}){const o=Xs(t,e);if(!e)return{fields:[],chips:[]};const s=Js(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Xs({ownerSlug:e,filters:t,onFiltersChange:o},s){const a=It({queryKey:["automations-list","activity",e],queryFn:async()=>{const i=await Promise.all(["active","archived"].map(d=>Tt("manage_automations",{action:"list",status:d,include_details:!1},{slug:e})));return[...new Map(i.flatMap(d=>d.automations).map(d=>[Number(d.automation_id),d])).values()].sort((d,g)=>d.name.localeCompare(g.name))},enabled:s&&!!e,staleTime:3e4}),r=a.data??[],f=i=>i==="produced"?t.producedByAutomationId:t.automationId,m=i=>r.find(d=>Number(d.automation_id)===i)?.name??`#${i}`,u=Ke.flatMap(i=>{const d=f(i);return d==null?[]:[{id:`automation-${i}`,field:"automation",label:Se(i),value:m(d),onRemove:()=>o(i==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),c={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:i=>n.jsxs(n.Fragment,{children:[Ke.map(d=>{const g=f(d),l=r.map(y=>({id:Number(y.automation_id),label:`${y.name}${y.status==="archived"?" (archived)":""}`}));g!=null&&!l.some(y=>y.id===g)&&l.unshift({id:g,label:`Automation #${g} (selected)`});const h=y=>{o(d==="produced"?{producedByAutomationId:y}:{automationId:y}),i()};return n.jsx(At,{heading:Se(d),children:l.map(y=>n.jsxs(T,{"aria-label":y.label,value:`${d} ${y.label} ${y.id}`,onSelect:()=>h(y.id),className:"group",children:[n.jsx(K,{selected:g===y.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),n.jsx(oe,{...Ws(e,String(y.id)),label:y.label})]},y.id))},d)}),a.isError?n.jsx(T,{forceMount:!0,onSelect:()=>void a.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:u,field:{key:"automation",label:"Automation",group:"Scope",icon:n.jsx(jn,{className:"h-4 w-4"}),editor:c}}}function Js(e){const{filters:t,onFiltersChange:o}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(r=>`#${r}`).join(", "),onRemove:()=>o({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.runId}`,onRemove:()=>o({runId:null})});const a={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(r,f)=>Ke.map(m=>n.jsx(eo,{...e,mode:m,query:f,close:r},m))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(kn,{className:"h-4 w-4"}),editor:a}}}function eo({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:a,close:r}){const f=s==="produced"?t.producedByAutomationId:t.automationId,m=As({workspace:!0},{automationIds:f==null?void 0:[f],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),u=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],c=m.data?.pages.flatMap(l=>l.runs)??[],i=[...new Map(c.map(l=>[l.id,{id:l.id,label:`Run #${l.id} · ${l.feed_display_name??l.operation_key??l.run_type} · ${l.status}`}])).values()];for(const l of u)i.some(h=>h.id===l)||i.unshift({id:l,label:`Run #${l} (selected)`});const d=l=>{if(s==="produced"){const h=u.includes(l)?u.filter(y=>y!==l):[...u,l];o({runIds:h.length?h:null})}else o({runId:l}),r()},g=/^\d+$/.test(a.trim())?Number(a.trim()):0;return n.jsxs(At,{heading:Se(s),children:[i.map(l=>n.jsxs(T,{value:`${s} ${l.label}`,onSelect:()=>d(l.id),children:[n.jsx(K,{selected:u.includes(l.id)}),n.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!i.some(l=>l.id===g)?n.jsxs(T,{value:`${s} ${g}`,onSelect:()=>d(g),children:[Se(s)," run #",g]}):null,m.isLoading?n.jsx(T,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,m.isError?n.jsx(T,{forceMount:!0,onSelect:()=>void(m.isFetchNextPageError?m.fetchNextPage():m.refetch()),children:"Could not load runs. Retry"}):null,!m.isLoading&&!m.isError&&!i.length?n.jsx(T,{disabled:!0,forceMount:!0,children:"No runs found"}):null,m.hasNextPage?n.jsx(T,{forceMount:!0,disabled:m.isFetching,onSelect:()=>void m.fetchNextPage(),children:m.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ge="Scope",$e="Source",z="h-4 w-4";function re(){return ie().search??{}}function Lt(e){const{pathname:t}=ie(),o=t.startsWith(`/${e}/events/`),s=Nn(t,o?1:0),a=!!(s&&!o&&!_n(s.split("/")[0]));return{pathname:t,embedded:a,recordPath:a?In(s)?.entityPath:o?s:void 0}}function Dt(e){const t=re(),{recordPath:o,pathname:s,embedded:a}=Lt(e);return r=>{const f=ae(e,t,r,o);return a?{to:s,search:f.search}:f}}const xt=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function to({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const a=re(),{recordPath:r,embedded:f}=Lt(e),m=r?r.split("/").at(-2):void 0,u=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,c=(m?ft(m):void 0)??(u?ft(u):void 0),i=Cn(a),d=Sn(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=no(e,c,!f),h=so(e,c,r,f),y=oo(e,i,!t),C=Zs({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),S=ao(e,d,g);return[l,h,y,C,S].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function no(e,t,o){const s=G(),a=re(),{visible:r}=Tn(e);if(!o)return{fields:[],chips:[]};const f=r.find(u=>u.slug===t),m={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:u=>n.jsxs(n.Fragment,{children:[r.map(c=>n.jsxs(T,{onSelect:()=>{s(ae(e,a,{entity:void 0,create:void 0,type:c.slug})),u()},className:"group gap-2",children:[n.jsx(K,{selected:c.slug===t}),n.jsx(Dn,{icon:c.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.name}),typeof c.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:c.entity_count}):null,n.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:c.slug},label:c.name})]},c.id)),n.jsxs(T,{onSelect:()=>{s(Kn(e)),u()},className:"text-muted-foreground",children:[n.jsx(Rt,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ge,icon:n.jsx(An,{className:z}),editor:m}],chips:t?[{id:"type",label:"Entity type",op:"is",value:f?.name??t,onRemove:()=>void s(ae(e,a,{type:void 0}))}]:[]}}function so(e,t,o,s){const a=G(),r=re(),[f,m]=b.useState(""),[u,c]=b.useState(0),i=Et(f,250),d={slug:e},{data:g,isLoading:l,isError:h,refetch:y}=En(t??"",d,{search:i,offset:u,limit:30,enabled:!s&&!!t}),{data:C}=Fn(o?`/${e}/${o}`:"",d),S=o?C?.entity:void 0,x=S?.name??(o?o.split("/").at(-1):void 0);if(s)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!t)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:l?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:M=>{m(M),c(0)},items:M=>n.jsxs(n.Fragment,{children:[h?n.jsx(T,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>n.jsxs(T,{value:I.slug,onSelect:()=>{const P=Bn([...I.parent_slug&&I.parent_entity_type?[{entity_type:I.parent_entity_type,slug:I.parent_slug}]:[],{entity_type:I.entity_type,slug:I.slug}]);a(ae(e,r,{type:t},P)),M()},children:[n.jsx(K,{selected:S?.slug===I.slug}),I.name]},I.slug)),u>0&&n.jsx(T,{onSelect:()=>c(Math.max(0,u-30)),children:"Previous entities"}),g?.metadata.has_more&&n.jsx(T,{disabled:l,onSelect:()=>c(u+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ge,icon:n.jsx(wn,{className:z}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(e,r,{type:t}))}]:[]}}function oo(e,t,o){const s=G(),a=Dt(e),{data:r=[]}=Rn(),f=b.useMemo(()=>[...r].sort((c,i)=>c.name.localeCompare(i.name)),[r]);if(!o)return{fields:[],chips:[]};const m=f.find(c=>c.agentId===t),u={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:c=>f.map(i=>n.jsxs(T,{onSelect:()=>{s(a({agent:i.agentId,schedule:void 0})),c()},className:"gap-2",children:[n.jsx(K,{selected:i.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:i.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]},i.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ge,icon:n.jsx(Mn,{className:z}),editor:u}],chips:t?[{id:"agent",label:"Agent",op:"is",value:m?.name??t,onRemove:()=>void s(a({agent:void 0,schedule:void 0}))}]:[]}}function ao(e,t,o){const s=G(),a=Dt(e),{groups:r}=Bs(),f=re(),m=Ce({platforms:String(f.platforms??f.platform??"")}).platforms??[],u=b.useMemo(()=>xt(t),[t]),c=b.useMemo(()=>xt(o),[o]),i=m.length===1?m[0]:Pn(r,u),d=r.find(_=>_.connector_key===i),g=u.size===1?Number([...u][0]):void 0,l=$n(g),{org:h}=Ft(),y=wt(h?.id,{feedIds:[...c].map(Number),enabled:g==null&&c.size>0}),C=g==null?y:l,S=C.data??[],x={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},F={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:_=>n.jsxs(n.Fragment,{children:[r.map(k=>{const A=k.connector_name??k.connector_key;return n.jsxs(T,{disabled:k.connections.length===0,onSelect:()=>{s(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[n.jsx(K,{selected:k.connector_key===d?.connector_key}),n.jsx(Vn,{plain:!0,name:A,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:A}),k.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,n.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:k.connector_key},label:A})]},k.connector_key)}),n.jsx(T,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:n.jsxs(Ne,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},M=[{key:"connector",label:"Connector",group:$e,icon:n.jsx(Un,{className:z}),editor:F}],I=[],P=d?.connector_name??d?.connector_key??(m.join(", ")||(u.size?`Connections ${[...u].join(", ")}`:void 0));if(P&&I.push({id:"connector",label:"Connector",op:"is",value:P,onRemove:()=>void s(a(x))}),d){M.push({key:"connection",label:"Connection",group:$e,icon:n.jsx(On,{className:z}),editor:Q(d)});const _=u.size===1?d.connections.find(k=>u.has(String(k.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:gt({display_name:_.display_name,connector_name:d.connector_name,connector_key:d.connector_key}),onRemove:()=>void s(a({...x,platforms:d.connector_key}))})}if((g||o)&&M.push({key:"feed",label:"Feed",group:$e,icon:n.jsx(Ln,{className:z}),editor:H()}),c.size>0){const _=c.size===1?S.find(k=>c.has(String(k.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?xe(_):`#${o}`,onRemove:()=>void s(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:M,chips:I};function Q(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:k=>_.connections.map(A=>{const O=gt({display_name:A.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return n.jsxs(T,{onSelect:()=>{s(a({connection_ids:String(A.id),feed_ids:void 0})),k()},className:"group gap-2",children:[n.jsx(K,{selected:u.has(String(A.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:O}),A.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:A.feed_count}):null,n.jsx(oe,{...Qs(e,{id:A.id,connector_key:_.connector_key}),label:O})]},A.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>n.jsxs(T,{"aria-label":xe(k),onSelect:()=>{s(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[n.jsx(K,{selected:c.has(String(k.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),n.jsx(oe,{...Gs(e,k),label:xe(k)})]},k.id))}}}function xe(e){return e.display_name?.trim()||e.feed_key}const io=["notification"],ro=["note","summary","decision","observation","fact","change","preference","identity"],co=[...io,...ro],bt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],Kt={value:"notifications",label:"Notifications"};function lo({value:e,onChange:t,withNotifications:o=!1}){const s=o?[Kt,...bt]:bt,a=s.find(r=>r.value===e)?.label??"Newest first";return n.jsxs(Gn,{value:e,onValueChange:t,children:[n.jsxs(Qn,{"aria-label":"Sort",className:"h-9 w-auto shrink-0 gap-2 bg-background px-2.5",children:[n.jsx(zn,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),n.jsx(Wn,{children:a})]}),n.jsx(Hn,{align:"end",className:"min-w-40",children:s.map(r=>n.jsx(qn,{value:r.value,children:r.label},r.value))})]})}const jt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],kt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],be=0,je=100,te="Event",ne="h-4 w-4";function se(e){const t=e.replace(/[_-]+/g," ").trim();return t.length>0?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e}function uo(e,t,o){const s=e.semanticTypes??[],a=o.length>0?o:co,r=[...new Set([...a,...s])].sort((d,g)=>se(d).localeCompare(se(g))).map(d=>({value:d,label:se(d)})),f=e.engagementRange??[be,je],m=e.reviewStatus,u=e.interactionStatus,c=[{key:"date",label:"Date",group:te,icon:n.jsx(ts,{className:ne}),editor:Ns({value:e.dateRange??void 0,onApply:d=>t({dateRange:d})})},{key:"kind",label:"Event kind",group:te,icon:n.jsx(ns,{className:ne}),editor:ke({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:r,selected:s,multiple:!0,onSelect:d=>{const g=s.includes(d)?s.filter(l=>l!==d):[...s,d];t({semanticTypes:g.length>0?g:void 0})}})},{key:"approval",label:"Approval",group:te,icon:n.jsx(ss,{className:ne}),editor:ke({searchPlaceholder:"Search statuses...",options:[...kt],selected:u?[u]:[],onSelect:d=>t({interactionStatus:d})})},{key:"review",label:"Reviewed by",group:te,icon:n.jsx(os,{className:ne}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:m&&m!=="all"?[m]:[],onSelect:d=>t({reviewStatus:d})})},{key:"score",label:"Engagement score",group:te,icon:n.jsx(as,{className:ne}),editor:_s({value:f,min:be,max:je,onApply:d=>t({engagementRange:d})})}],i=[];return e.dateRange&&i.push({id:"date",label:"Date",op:"is",value:Is(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&i.push({id:"kind",label:"Event kind",op:s.length>1?"is any of":"is",value:s.length<=2?s.map(se).join(", "):`${s.length} kinds`,title:s.map(se).join(", "),onRemove:()=>t({semanticTypes:void 0})}),u&&i.push({id:"approval",label:"Approval",op:"is",value:kt.find(d=>d.value===u)?.label??u,onRemove:()=>t({interactionStatus:null})}),m&&m!=="all"&&i.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(d=>d.value===m)?.label??m,onRemove:()=>t({reviewStatus:void 0})}),(f[0]!==be||f[1]!==je)&&i.push({id:"score",label:"Engagement score",value:Ts(f,be,je),onRemove:()=>t({engagementRange:void 0})}),{fields:c,chips:i}}function Bt({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:a,scope:r,extraFields:f=[],drillChips:m=[],total:u,isListLoading:c=!1,isTotalLoading:i=!1,hasCursorInUrl:d=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=s.trim().length>0,F=h?{fields:[],chips:[]}:uo(e,t,o),M=[...r?.fields??[],...F.fields,...f],I=[...r?.chips??[],...m,...F.chips],P=I.length>0||x,Q=`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,H=c||i?n.jsx(Yn,{className:"h-4 w-20"}):u==null?null:P?`${u.toLocaleString()} ${u===1?"match":"matches"}`:`${u.toLocaleString()} ${u===1?"item":"items"}`;return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!h&&n.jsxs("div",{className:"relative min-w-0 flex-1",children:[n.jsx(Zn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Xn,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:s,onChange:_=>a(_.target.value),className:_e("bg-background pl-9",x&&"pr-9")}),x&&n.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-0.5 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:n.jsx(Jn,{className:"h-3.5 w-3.5"})})]}),!h&&n.jsx(lo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===Kt.value){l?.();return}const[k,A]=_.split("-");t({sortBy:k,sortOrder:A})}})]}),n.jsx(Ss,{label:"Event filters",fields:M,chips:I,meta:H,actions:C,trailing:n.jsxs(n.Fragment,{children:[y,!c&&d&&g&&n.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",onClick:g,children:[n.jsx(es,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),onClearAll:S,hasClearableState:x})]})}function Ut({ownerSlug:e,...t}){const o=to({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Bt,{...t,scope:o})}const Be=3600*1e3,Ct=24*Be;function St(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function Nt(e){return e.toISOString().split("T")[0]}function Ue(e){return e.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(e){const o=e[e.length-1].date.getTime()-e[0].date.getTime()>180*Ct,s=new Map;for(const a of e){const r=new Date(a.date);o&&r.setUTCDate(r.getUTCDate()-r.getUTCDay()),s.set(r.getTime(),(s.get(r.getTime())??0)+a.count)}return[...s.entries()].sort(([a],[r])=>a-r).map(([a,r])=>{const f=new Date(a);return{start:f,end:new Date(a+(o?7:1)*Ct),count:r,label:`${f.getUTCMonth()+1}/${f.getUTCDate()}`,tooltip:o?`Week of ${Ue(f)}`:Ue(f)}})}function fo(e){const t=f=>{const m=new Date(f);return m.setMinutes(0,0,0),m.getTime()},o=new Map;for(const f of e)o.set(t(f),(o.get(t(f))??0)+1);const s=Math.min(...o.keys()),a=Math.max(...o.keys()),r=[];for(let f=s;f<=a;f+=Be){const m=new Date(f);r.push({start:m,end:new Date(f+Be),count:o.get(f)??0,label:pt(m,"HH:mm"),tooltip:pt(m,"MMM d, HH:mm")})}return r}function po({entityId:e,organizationId:t,ownerSlug:o,eventTimes:s,selectedRange:a,onSelectRange:r}){const{data:f,isLoading:m,error:u}=is(t,{entityId:e},{slug:o}),c=b.useMemo(()=>(f??[]).map(h=>{const y=St(h.date);return y?{date:y,count:h.count}:null}).filter(h=>h!==null).sort((h,y)=>h.date.getTime()-y.date.getTime()),[f]),i=b.useMemo(()=>{if(c.length===0)return[];if(c.length>1)return mo(c);const[h]=c,y=Nt(h.date),C=(s??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?fo(C):[]},[c,s]),d=b.useCallback(h=>{const y=i[h.dataIndex];y&&r&&r(y.start,y.end)},[i,r]),g=b.useCallback(h=>{if(r&&h.startValue!==void 0&&h.endValue!==void 0){const y=new Date(h.startValue),C=new Date(h.endValue);r(y,C)}},[r]),l=b.useMemo(()=>{if(i.length<2)return null;let h;if(a){const[y,C]=a,S=i.filter(x=>x.start<C&&x.end>y);S.length>0&&(h=[[{xAxis:S[0].label},{xAxis:S[S.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:y=>{const C=y[0];return`${i[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:i.map(y=>y.label)},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new $s(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:i.map(y=>y.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:h?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:h}:void 0}]}},[i,a]);if(m||u)return n.jsx("div",{className:_e(Mt,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:m?n.jsx(Ls,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(c.length===0)return null;if(!l){const[h]=c;return n.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.count===1?"1 event":`All ${h.count} events`," on"," ",Ue(h.date),"."]})}return n.jsx(ho,{option:l,onClick:d,onDataZoom:g})}function ho({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:a}=Os({onClick:t,onDataZoom:o});return b.useEffect(()=>{a(e,!0)},[e,a]),n.jsx("div",{"data-testid":"events-timeline",className:_e(Mt,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}const _t="change";function vo({kinds:e,onFiltersChange:t}){const o=!e?.length,s=e?.length===1&&e[0]===_t,a=r=>_e("h-7 px-2.5 text-xs",r?"bg-muted text-foreground":"text-muted-foreground");return n.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>t({semanticTypes:void 0}),children:"All"}),n.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(s),"aria-pressed":s,onClick:()=>t({semanticTypes:[_t]}),children:"Changes"})]})}function yo({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,pinned:r,onShowNotifications:f,emptyState:m,changesShortcut:u=!1}){const{isAuthenticated:c,isReady:i}=rs(),{isMember:d,isLoading:g}=Ft(),l=i&&c&&d,h=i&&(!c||!g&&!d),y=G(),C=ie(),S=cs(),{filters:x,updateFilters:F,clearFilters:M}=Ot({parse:Ce,serialize:Le,filterKeys:$t,replace:!1,merge:Pt}),[I,P]=b.useState(x.searchQuery||""),[Q,H]=b.useState(Oe(x)||s&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,A=Et(k,1e3),O=b.useRef(!1);b.useEffect(()=>S.history.subscribe(({location:p,action:v})=>{const N=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&O.current&&(N===(x.searchQuery??"")||N===(k??""))||(O.current=!1,P(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>ht({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),w=F;b.useEffect(()=>{O.current&&(x.searchQuery||void 0)!==A&&F({searchQuery:A})},[A,F,x.searchQuery]);const Qe=()=>{O.current=!1,P(""),s&&t?y({...De(t,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${t}/events/`)?{to:C.pathname}:{}}):M()},ce=Oe(ht(x)),Ie=o===void 0,{data:Vt=[]}=ls(i&&l?e:null),{data:Gt=[]}=ds(h?t:null),ze=l?Vt:Gt,{data:We=[]}=us(l&&e?{organizationId:e}:void 0),le=Us(),de=j.connectionIds,Te=(de?.length??0)>0,{data:He=[]}=ms(i&&l?e??"":"",{connectionIds:de??void 0,enabled:!le&&i&&l&&Te}),qe=j.feedIds,Ae=(qe?.length??0)>0,{data:Ye=[]}=wt(i&&l?e:null,{feedIds:qe??void 0,enabled:i&&l&&Ae}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Ee=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Fe=b.useMemo(()=>Ye.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[Ye]),Qt=b.useMemo(()=>Te&&Ee.length===0||Ae&&Fe.length===0?[]:Ys({connectors:ze,entityTypes:We,selectedPlatforms:Ee,selectedFeeds:Fe,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Te,Ae,Ee,Fe,We]),R=j.clientIds,ue=(R?.length??0)>0,{data:Xe=[]}=Fs(null,{enabled:i&&l&&ue}),me=b.useMemo(()=>{if(!R)return[];const p=new Set(R);return ws(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[R,Xe]),Je=b.useMemo(()=>{if(!ue||!R)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):R.length>1?`${R.length} client registrations`:"Client registration"},[me,R,ue]),fe=me.length===1?me[0]:null,zt=t&&fe?zs(t,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=Rs({enabled:i&&l&&ue&&!!pe,clientIds:R??[],limit:100}),tt=b.useMemo(()=>{if(!pe)return null;const p=et.find(N=>N.activityId===pe);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[pe,et]),q=j.agentId,Y=j.schedule,{data:nt=[]}=Vs(q??void 0),st=b.useMemo(()=>!Y||!q?null:nt.find(v=>v.id===Y)?.description?.trim()||"Scheduled task",[q,Y,nt]),{data:Wt}=fs(i&&l?e:null,o),{data:Ht}=ps(h&&!Ie?t:null,o),ot=l?Wt:Ht,we=b.useMemo(()=>{const p=new Map;for(const v of ot||[]){const N=v.automation_name??"__global__";p.has(N)||p.set(N,{automationName:v.automation_name??null,classifiers:[]});const E=p.get(N),L=v.attribute_values||{},$=Object.keys(L);let ve=null;const Z={};for(const[X,V]of Object.entries(L))if(V.parent)for(const[Pe,J]of Object.entries(V.parent))ve=Pe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=E.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...$]);D.values=[...X];for(const[V,Pe]of Object.entries(Z)){D.valuesByParentValue[V]||(D.valuesByParentValue[V]=[]);const J=new Set([...D.valuesByParentValue[V],...Pe]);D.valuesByParentValue[V]=[...J]}ve&&(D.parentSlug=ve)}else E.classifiers.push({slug:v.slug,name:v.name,values:$,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,E)=>N.parentSlug===null&&E.parentSlug!==null?-1:N.parentSlug!==null&&E.parentSlug===null?1:0);return[...p.values()]},[ot]),qt=hs(i&&l?e:null,o,j,t),Yt=vs(h?t:null,o,j),Zt=h?Yt:qt,{data:B,isLoading:Xt,error:Jt}=Zt,en=b.useMemo(()=>B?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[B]),at=B?.pages[0],it=(at?.content.length??0)>0,tn=ys(i&&l?e:null,o,j,t),nn=gs(h?t:null,o,j),Re=h?nn:tn,sn=Re.data?.total??void 0,on=Re.data?.classification_stats,an=Re.isLoading,rn=!!(j.beforeOccurredAt||j.afterOccurredAt),rt=xs(j),ct=B?.pages[B.pages.length-1],U=ct?.content[ct.content.length-1];b.useEffect(()=>{!rt||!U||B?.pages.length===1||x.beforeOccurredAt===U.occurred_at&&x.beforeId===U.id||F({beforeOccurredAt:U.occurred_at,beforeId:U.id},{replace:!0})},[U?.id,rt,F,B?.pages.length,U,x.beforeOccurredAt,x.beforeId]);const cn=b.useCallback(()=>{w({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[w]),ln=(p,v)=>{w({dateRange:[p,v]})},lt=(p,v)=>{const N={...j.classificationFilters||{}};if(v.length>0)N[p]=v;else{delete N[p];for(const E of we)for(const L of E.classifiers)L.parentSlug===p&&delete N[L.slug]}w({classificationFilters:N})},dn=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(E=>E!==v):[...N,v])},un=p=>lt(p,[]);if(Jt)return n.jsx(bs,{label:"knowledge"});const Me=!i||c&&g||l&&!e||Xt,he={fields:[],chips:[]};for(const p of we)for(const v of p.classifiers){const N=j.classificationFilters?.[v.slug]??[],E=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,L=E?[...new Set(E.flatMap($=>v.valuesByParentValue[$]??[]))]:v.values;L.length>0&&he.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:n.jsx(js,{className:"h-4 w-4"}),editor:ke({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:L.map($=>({value:$,label:$,count:on?.[v.slug]?.[$]})),selected:N,multiple:!0,onSelect:$=>dn(v.slug,$)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=we.flatMap(E=>E.classifiers).find(E=>E.slug===p);he.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:N?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>un(p)})}const mn=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>w({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>w({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:zt,details:R&&R.length>0?n.jsx(qs,{ownerSlug:t,clientIds:R,linkedUser:fe?.linkedUser,linkedUserEntitySlug:fe?.linkedUserEntitySlug}):void 0,onRemove:()=>w({clientIds:void 0})}):null,st?ye({id:"schedule",label:"Schedule",value:st,sourceLink:t&&q&&Y?Hs(t,q,Y):void 0,onRemove:()=>w({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>w({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>w({resourceKind:void 0,resourceId:void 0})}]:[],...he.chips].filter(p=>p!=null),fn=!!(l&&o&&e),dt=r&&!ce?r:void 0,ut={filterActions:u?n.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:w}):Ie&&l?n.jsx("div",{className:"flex items-center gap-1",children:[["config","Configuration"],["deployment","Applies"]].map(([p,v])=>n.jsx(W,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>w({eventCategory:x.eventCategory===p?void 0:p,semanticTypes:x.eventCategory===p?void 0:["change"],resourceKind:void 0,resourceId:void 0}),children:v},p))}):void 0,filterTrailing:fn?n.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":Q,onClick:()=>H(p=>!p),children:[n.jsx(Cs,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Qe,onShowNotifications:f,filters:j,onFiltersChange:w,eventKinds:Qt,searchQuery:I,onSearchChange:p=>{O.current=!0,P(p)},extraFields:he.fields,drillChips:mn,total:sn,isListLoading:Me,isTotalLoading:an,hasCursorInUrl:rn&&it,onGoToLatest:cn},pn=!Me&&!!at&&!it&&!ce,hn=c?l?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",mt=!!(l&&t);return n.jsx(ks,{children:n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(Ut,{...ut,ownerSlug:t}):n.jsx(Bt,{...ut})}),Q&&l&&o&&e&&n.jsx(po,{entityId:o,organizationId:e,ownerSlug:t||"",eventTimes:en,selectedRange:j.dateRange||void 0,onSelectRange:ln}),dt?.rows,Me?n.jsx(Ms,{}):pn?m??n.jsx(vt,{icon:yt,title:"No activity yet",description:hn,actionLabel:mt?"Add a connector":void 0,onAction:mt&&t?()=>void y({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(Ps,{onFiltersChange:w,organizationId:e,ownerSlug:t,entityId:o,filters:j,showEntityLinks:Ie,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:n.jsx(vt,{icon:yt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:ce?"Clear filters":void 0,onAction:ce?Qe:void 0})})]})})}function go({record:e,ownerSlug:t}){const o=ie(),s=G(),{filters:a,updateFilters:r}=Ot({parse:Ce,serialize:Le,filterKeys:$t,replace:!1,merge:Pt}),f=Oe({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",m=()=>{s({...De(t,o.search??{}),...o.pathname.startsWith(`/${t}/events/`)?{}:{to:o.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(Ut,{ownerSlug:t,sourceRead:!0,filters:a,onFiltersChange:r,searchQuery:a.searchQuery??"",onSearchChange:u=>r({searchQuery:u}),onClearFilters:m}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),f?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx(W,{variant:"outline",size:"sm",onClick:()=>{const u=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),c={...De(t,o.search??{}).search,...u};s({to:o.pathname,search:c})},children:"Clear unsupported filters"})]}):n.jsx(Es,{record:e,orgContext:{slug:t},filters:a})]})}function Fo({entity:e,organizationId:t,ownerSlug:o}){const s=e.is_derived?n.jsx(go,{ownerSlug:o,record:{type:e.entity_type,key:e.slug}}):n.jsx(yo,{organizationId:t,ownerSlug:o,entityId:typeof e.id=="number"?e.id:void 0,hideSourceFilter:!0,changesShortcut:!0});return n.jsx(Ks,{organizationId:t,children:e.entity_type==="$member"?n.jsx(Ds,{children:s}):s})}export{yo as E,Ks as M,Kt as N,Fo as R,lo as S};
|
|
2
|
+
//# sourceMappingURL=record-activity-Doeu5kPO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,j as c}from"./index-
|
|
2
|
-
//# sourceMappingURL=record-session-
|
|
1
|
+
import{r as s,j as c}from"./index-JmEl29py.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
|
|
2
|
+
//# sourceMappingURL=record-session-CJzFoVKc.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=reset-password-
|
|
1
|
+
import{W as v,r as o,j as e,L as h,Y as j,K as y,Z as N}from"./index-JmEl29py.js";import{C as k,a as C,b as S,c as L}from"./card-Cspo-4M6.js";function R(){const{token:n,error:x}=v.useSearch(),[a,p]=o.useState(""),[i,f]=o.useState(""),[d,s]=o.useState(null),[l,c]=o.useState(!1),[u,g]=o.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(a.length<8){s("Password must be at least 8 characters.");return}if(a!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:a})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:a,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
2
|
+
//# sourceMappingURL=reset-password-Y-WO77iR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{eV as r,cN as s,cM as c,cg as l,Y as g,eW as I}from"./index-JmEl29py.js";const f=30,_=new Set(["running","pending","claimed"]);function m(n){return"workspace"in n?["workspace"]:"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function y(n){return"workspace"in n?{}:"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,e,i){return r({queryKey:["runs-infinite",i??null,n?m(n):null,e.runTypes??null,e.status??null,e.automationIds??null,e.connectionIds??null,e.feedIds??null],queryFn:async({pageParam:t})=>{const a=t;return s("manage_operations",{action:"list_runs",...y(n),...e.runTypes&&e.runTypes.length>0?{run_types:e.runTypes}:{},...e.status?{status:e.status}:{},...e.automationIds?.length?{automation_ids:e.automationIds}:{},...e.connectionIds?.length?{connection_ids:e.connectionIds}:{},...e.feedIds?.length?{feed_ids:e.feedIds}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:f},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:t=>{if(!t.has_more)return;const a=t.runs[t.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:t=>(t.state.data?.pages??[]).some(d=>d.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,e){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${e}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${e}`:null}function T(n,e){const{slug:i}=c(),t=e!=null?p(n,e):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return l({queryKey:["pending-proposal",i,...a,e],queryFn:async()=>{const o=await g(I(i,t),{credentials:"include"});if(o.status===404)return{status:"gone"};if(!o.ok)throw new Error(`Failed to fetch pending proposal: ${o.status}`);return{status:"pending",proposal:await o.json()}},enabled:!!i&&!!t&&!!e,staleTime:0,retry:!1})}export{T as a,v as u};
|
|
2
|
+
//# sourceMappingURL=runs-B0zVYb-w.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,T as x,ih as k,S as r,r as o,a3 as T}from"./index-JmEl29py.js";import{u as w}from"./use-scroll-sentinel-BpQ70c28.js";import{u as A}from"./runs-B0zVYb-w.js";import{F,o as P}from"./filter-editors-oNjBX9a2.js";import{R as B}from"./runs-table-9OVdfPXZ.js";const m=[{value:"all",label:"All"},{value:"sync",label:"Sync",runTypes:["sync"]},{value:"action",label:"Action",runTypes:["action"]},{value:"auth",label:"Auth",runTypes:["auth"]}];function E(s){return m.find(a=>a.value===s)?.runTypes}const c=[{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}];function C({bucket:s,status:a,onBucketChange:n,onStatusChange:t}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:m.map(l=>e.jsx("button",{type:"button",onClick:()=>n(l.value),className:x("rounded px-3 py-1 transition-colors",s===l.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:l.label},l.value))}),e.jsx(F,{label:"Run filters",className:"flex-1",fields:[{key:"status",label:"Status",icon:e.jsx(k,{className:"h-4 w-4"}),editor:P({searchPlaceholder:"Search statuses...",options:c,selected:a==="all"?[]:[a],onSelect:t})}],chips:a==="all"?[]:[{id:"status",label:"Status",op:"is",value:c.find(l=>l.value===a)?.label??a,onRemove:()=>t("all")}]})]})}function I({labels:s,className:a}){return e.jsx("div",{className:x("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",a),children:s.map((n,t)=>e.jsx("span",{className:t===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:n},n))})}function p({rows:s=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(r,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:s}).map((a,n)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(r,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(r,{className:"h-3 w-20"}),e.jsx(r,{className:"h-3 w-16"}),e.jsx(r,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(r,{className:"h-7 w-7 rounded-md shrink-0"})]},n))})]})}function O({rows:s=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(I,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(p,{rows:s})]})}function z({scope:s,ownerSlug:a}){const[n,t]=o.useState("all"),[l,h]=o.useState("all"),f=o.useMemo(()=>({runTypes:E(n),status:l==="all"?void 0:l}),[n,l]),{data:i,isLoading:g,isError:d,hasNextPage:v,isFetching:b,isFetchingNextPage:j,fetchNextPage:N}=A(s,f,a),u=o.useMemo(()=>i?.pages.flatMap(R=>R.runs)??[],[i]),y={runType:n==="all",feed:!0,connection:"deviceId"in s||"connectorKey"in s},S=w({onIntersect:()=>void N(),enabled:!!v&&!b&&!d,rootMargin:"200px"});return e.jsxs("div",{className:"space-y-3",children:[e.jsx(C,{bucket:n,status:l,onBucketChange:t,onStatusChange:h}),g?e.jsx(p,{}):d?e.jsx("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:"Failed to load runs."}):u.length===0?e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:n==="all"&&l==="all"?"No runs yet.":"No runs match these filters."}):e.jsxs(e.Fragment,{children:[e.jsx(B,{runs:u,ownerSlug:a,columns:y}),e.jsx("div",{ref:S,className:"h-1"}),j&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(T,{size:"lg",className:"text-muted-foreground"})})]})]})}export{z as R,O as a};
|
|
2
|
+
//# sourceMappingURL=runs-panel-Dkyybqos.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,
|
|
2
|
-
//# sourceMappingURL=runs-table-
|
|
1
|
+
import{j as e,T as d,ii as u,B as N,L as b,d7 as w,e5 as k,e6 as v,e7 as T,ij as C,ik as _,er as S,es as V,et as p,eu as n,ex as R,ey as i,bc as D,e0 as L,Q as E,il as B,e3 as I,ac as M,a3 as O,bd as P,r as h,dC as m,dE as g,dD as j}from"./index-JmEl29py.js";const A=u("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),F=u("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function H({className:t,status:a,showDot:r=!0,children:x,...s}){return e.jsxs("span",{className:d(A({status:a}),t),...s,children:[r&&e.jsx("span",{className:F({status:a})}),x]})}function z(t,a){switch(a.kind){case"connection":return _(t,a.id);case"feed":return C(t,a.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(a.id)}}}}function J({ownerSlug:t,scope:a,variant:r="outline",iconOnly:x=!1,label:s,className:c,title:f}){const l=z(t,a),y=f??s??"View in memory",o=e.jsx(N,{asChild:!0,variant:r,size:x?"icon":"sm",className:d(x&&"h-7 w-7",c),children:e.jsxs(b,{to:l.to,params:l.params,search:l.search,children:[e.jsx(w,{className:d("h-3.5 w-3.5",!x&&"mr-1.5")}),!x&&(s??"View in memory")]})});return x?e.jsxs(k,{children:[e.jsx(v,{asChild:!0,children:o}),e.jsx(T,{children:y})]}):o}const Q=new Set(["error","failed","revoked"]);function U(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":Q.has(t)?"error":"default"}function W({status:t}){return t==="completed"?e.jsx(I,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(M,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(O,{className:"text-blue-500"}):e.jsx(P,{className:"h-3.5 w-3.5 text-muted-foreground"})}function X({error:t}){const[a,r]=h.useState(!1);return t.length>80?e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(j,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function $({checkpoint:t}){const[a,r]=h.useState(!1);return e.jsxs(m,{open:a,onOpenChange:r,children:[e.jsx(g,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(j,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function q(t){return t.feed_display_name??t.feed_key??"—"}function K({runs:t,ownerSlug:a,columns:r={}}){const x=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(S,{children:[e.jsx(V,{children:e.jsxs(p,{children:[e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Version"}),x&&e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(n,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(n,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(R,{children:t.map(s=>{const c=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(p,{children:[e.jsx(i,{className:"py-1.5 px-3",children:e.jsx(W,{status:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:L(s.created_at),children:D(s.created_at)}),r.runType&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(E,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:q(s)}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:e.jsx(H,{status:U(s.status),children:s.status})}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:c!=null?B(c):"—"}),e.jsx(i,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),x&&e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx($,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(i,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(X,{error:s.error_message}):""}),e.jsx(i,{className:"py-1.5 px-3 text-right",children:e.jsx(J,{ownerSlug:a,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{K as R,H as S,J as V,U as g};
|
|
2
|
+
//# sourceMappingURL=runs-table-9OVdfPXZ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as u,fK as l,j as t,bx as m,bK as x,f9 as f}from"./index-JmEl29py.js";import{E as i}from"./entity-type-page-BzMZttzh.js";function E({slug:r,onClose:a}){const{orgContext:e}=u(),{data:s=[],isLoading:o,isError:y}=l(e);if(r===null)return t.jsx(i,{entityType:null,orgContext:e,onClose:a,compact:!0});if(o)return t.jsx(m,{label:"entity type",variant:"panel"});if(y)return t.jsx(x,{label:"entity type"});const n=s.find(p=>p.slug===r)??null;return n?t.jsx(i,{entityType:n,orgContext:e,hideDelete:f(n),onClose:a,compact:!0}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Entity type not found."})}export{E as S};
|
|
2
|
+
//# sourceMappingURL=schema-type-editor-panel-DcJqbCrU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iU as t,j as n}from"./index-JmEl29py.js";import{a as s}from"./agents-workbench-D1YL3VAB.js";import"./agent-editor-form-C24p9LLg.js";import"./model-selector-BeFuFH7p.js";import"./proposal-review-shell-CmLy1MZf.js";import"./runs-B0zVYb-w.js";function c(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(s,{owner:o,agentId:r,tab:"settings",runId:e.run_id})}export{c as component};
|
|
2
|
+
//# sourceMappingURL=settings-Cfy9tCOF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{k as l,j as e,B as i,L as a,v as c}from"./index-JmEl29py.js";import{F as o}from"./full-page-spinner-DtmqQmgl.js";function u(){const{session:t,isReady:n}=l();if(!n)return e.jsx(o,{});if(!t?.user)return e.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 px-4 py-8 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Account settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to view your profile and account details."}),e.jsx(i,{asChild:!0,children:e.jsx(a,{to:"/auth/login",search:c({intent:"sign-in",callbackUrl:"/account/settings"}),children:"Sign in"})})]});const{user:s}=t,r=s.name?.trim()||"User";return e.jsxs("div",{className:"mx-auto w-full max-w-3xl space-y-8 px-4 py-8 lg:px-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Account settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your personal profile and sign-in details."})]}),e.jsxs("section",{"aria-labelledby":"account-profile-heading",className:"space-y-5 border-b border-border pb-8",children:[e.jsx("h2",{id:"account-profile-heading",className:"text-sm font-medium",children:"Profile"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[s.image?e.jsx("img",{src:s.image,alt:"",referrerPolicy:"no-referrer",className:"h-12 w-12 shrink-0 rounded-full object-cover"}):e.jsx("div",{"aria-hidden":"true",className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-muted text-lg font-medium",children:(s.name?.trim()||s.email||"U").charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"break-words font-medium",children:r}),e.jsx("p",{className:"break-all text-sm text-muted-foreground",children:s.email})]})]}),e.jsxs("details",{className:"space-y-3",children:[e.jsx("summary",{className:"w-fit cursor-pointer rounded-sm text-sm text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Account details"}),e.jsxs("dl",{className:"space-y-1 text-sm",children:[e.jsx("dt",{className:"text-muted-foreground",children:"User ID"}),e.jsx("dd",{className:"break-all font-mono text-xs",children:s.id})]})]})]}),e.jsxs("section",{"aria-labelledby":"account-session-heading",className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{id:"account-session-heading",className:"text-sm font-medium",children:"Session"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."})]}),e.jsx(i,{variant:"outline",asChild:!0,children:e.jsx(a,{to:"/auth/logout",children:"Sign out"})})]})]})}export{u as component};
|
|
2
|
+
//# sourceMappingURL=settings-Dg0D_l_w.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{iT as r,j as t,O as s}from"./index-JmEl29py.js";import{A as e}from"./agent-skill-context-B9giw2u2.js";import"./core.esm-CoJ5Splc.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
2
|
+
//# sourceMappingURL=skills-oxA7P5Fe.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as f,cg as b,eR as R,j as e,B as j,eS as v,S as _,bw as C,L,dQ as F,t as E}from"./index-JmEl29py.js";import{b as S,c as $,R as P,d as A}from"./events-feed-C4VrjIc1.js";function y({failures:o,onRetry:c,isError:l=!1,isFetching:d=!1}){return o.length===0&&!l?null:e.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-3 rounded-md border border-destructive/40 px-3 py-2 text-xs",children:[e.jsxs("span",{children:[o.length<=1?"A source":`${o.length} sources`," could not be read, so some items may be missing."]}),e.jsx(j,{size:"sm",variant:"outline",className:"h-7",onClick:c,disabled:d,children:"Retry"})]})}function z({record:o,orgContext:c,filters:l}){const{orgContext:d}=f(),t=c??d,{data:p}=b({queryKey:["connector-definitions","source-record",t.organizationId,t.slug],queryFn:()=>E(t),enabled:!!(t.organizationId||t.slug),staleTime:6e4}),{data:i,isLoading:u,isError:n,refetch:x,fetchNextPage:a,hasNextPage:h,isFetching:g,isFetchingNextPage:s}=R(o,t,l),N=i?.pages.flatMap(r=>r.events)??[],m=i?.pages.flatMap(r=>r.failures)??[];return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(y,{failures:m,isError:n,isFetching:g,onRetry:()=>void x()}),e.jsx(S,{isLoading:u,hasNextPage:!!h&&!n,autoLoadMore:m.length===0,isFetching:g,isFetchingNextPage:s,onLoadMore:()=>void a(),emptyState:n||m.length>0||h?null:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No activity for this record in its connected sources."}),items:N.map(r=>({key:`${r.feed_id}:${r.origin_id}`,occurredAt:r.occurred_at,content:e.jsx("div",{className:"p-3",children:e.jsx($,{ownerSlug:t.slug,connectorDefinitions:p,content:{...r,title:r.title||r.origin_type||r.origin_id,text_content:r.payload_text??""}})})}))})]})}function I({record:o,ownerSlug:c,orgContext:l}){const{orgContext:d}=f(),{data:t,isLoading:p,isError:i,refetch:u,hasNextPage:n,fetchNextPage:x,isFetching:a,isFetchNextPageError:h,error:g}=v(o,l??d);return p?e.jsx(_,{className:"h-12 w-full rounded-lg"}):t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{count:t.relationshipFailures?.length??0,onRetry:()=>void u()}),e.jsx(y,{failures:t.failures,isError:i,isFetching:a,onRetry:()=>{if(a)return;const s=g instanceof C&&g.status===400;h&&!s||!i&&n?x():u()}}),t.links.length===0&&(t.relationships?.length??0)===0&&t.failures.length===0&&(t.relationshipFailures?.length??0)===0&&!n&&!i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No relationships for this record in its connected sources."}),t.links.length===0&&(t.relationships?.length??0)===0&&n&&!i&&t.failures.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"More source records remain to check for relationships."}),e.jsxs("ul",{className:"space-y-1",children:[(t.relationships??[]).map(s=>e.jsx("li",{className:"rounded-lg border px-3 py-2",children:e.jsx(A,{row:s,entityId:o.key,entityType:o.type,ownerSlug:c,orgContext:l??d})},`authored:${s.id}`)),t.links.map(s=>e.jsx("li",{children:e.jsx(L,{to:F(c,[{entity_type:s.entity_type,slug:s.key}]),className:"flex items-center justify-between rounded-lg border px-3 py-2 text-sm hover:bg-muted/50",children:e.jsxs("span",{children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.relationship_type.replaceAll("_"," "),s.direction==="incoming"?" (from)":""," ·"," ",s.entity_type," ·"," "]}),s.name]})})},`${s.relationship_type}:${s.direction}:${s.entity_type}:${s.key}`))]}),n&&!i&&t.failures.length===0&&e.jsx(j,{variant:"outline",size:"sm",disabled:a,onClick:()=>void x(),children:a?"Loading…":"Load more"})]}):e.jsx(y,{failures:[],isError:!0,isFetching:a,onRetry:()=>void u()})}export{z as S,I as a};
|
|
2
|
+
//# sourceMappingURL=source-record-panels-BeAZeMLy.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,T as t}from"./index-JmEl29py.js";const s={live:"bg-green-500",amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function a({tone:r}){return e.jsx("span",{"aria-hidden":r===null,className:t("h-1.5 w-1.5 shrink-0 rounded-full",r===null?"bg-transparent":s[r])})}export{a as S};
|
|
2
|
+
//# sourceMappingURL=status-dot-_LQZmEIX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{eT as c,cg as n,eU as o,a0 as r,bG as l,cN as s}from"./index-JmEl29py.js";function y(){return n({queryKey:["automation-catalog"],queryFn:async()=>(await s("manage_catalog",{action:"list_catalog",kinds:["automations"]})).catalogs?.automations?.entries??[],staleTime:6e4})}function g(e,a,u){return n({queryKey:["automations-list",e,a,!0],queryFn:async()=>(await s("manage_automations",{action:"list",entity_id:a,status:"active",include_details:!0})).automations||[],enabled:!!e,staleTime:3e4})}function _(e,a,u,t={}){const i=c(t.ownerSlug);return n({queryKey:["automation-detail",i,e,a,t.since,t.until,t.templateVersion,t.includeVersions??!1],queryFn:async()=>await s("get_automation",{automation_id:e,entity_id:a,content_since:t.since,content_until:t.until,template_version:t.templateVersion,page_size:100,include_classification:"summary",include_versions:t.includeVersions??!1},{slug:i},{timeoutMs:3e4}),enabled:!!i&&!!e&&!!(t.ownerSlug||u),staleTime:3e4})}const q=o({tool:"manage_automations",body:e=>({action:"update",...e}),invalidateKeys:["automations-list","automation-detail","automations"],checkError:!1,successMessage:"Automation updated",errorMessage:"Failed to update Automation"}),v=o({tool:"manage_automations",body:e=>({action:"delete",automation_ids:[e]}),invalidateKeys:["automations-list","automation-detail","automations","agent-threads"],checkError:!1,successMessage:"Automation deleted",errorMessage:"Failed to delete Automation"}),A=o({tool:"manage_automations",body:e=>({action:"create",...e}),invalidateKeys:["automations-list","automations"],successMessage:"Automation created",errorMessage:"Failed to create Automation"});function f(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"create_version",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}function K(){const e=r();return l({mutationFn:async a=>s("manage_automations",{action:"set_reaction_script",...a}),onSuccess:()=>{e.invalidateQueries({queryKey:["automations-list"]}),e.invalidateQueries({queryKey:["automation-detail"]}),e.invalidateQueries({queryKey:["automations"]})}})}export{v as a,_ as b,A as c,f as d,K as e,q as f,y as g,g as u};
|
|
2
|
+
//# sourceMappingURL=use-automations-DS3uz3pb.js.map
|