@lobu/runtime-server 20.0.0 → 20.0.1
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 +165 -15
- package/dist/component.json +1 -1
- package/dist/connectors/chat-automation-events.ts +33 -0
- package/dist/connectors/discord.ts +2 -0
- package/dist/connectors/gchat.ts +2 -0
- package/dist/connectors/google_drive.ts +210 -40
- package/dist/connectors/slack-automation-events.ts +0 -31
- package/dist/connectors/slack.ts +2 -2
- package/dist/connectors/teams.ts +2 -0
- package/dist/connectors/telegram.ts +2 -0
- package/dist/connectors/whatsapp.ts +2 -0
- package/dist/dependencies.bun.lock +4 -4
- package/dist/guest.bundle.js +13 -1
- package/dist/owletto/dist/apple-touch-icon.png +0 -0
- package/dist/owletto/dist/assets/{_-WVpKI9q9.js → _-BTmsEMQo.js} +2 -2
- package/dist/owletto/dist/assets/_-ea0K1u_g.js +1 -0
- package/dist/owletto/dist/assets/{_agentId-U2D1yGV_.js → _agentId-DON3NuNk.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-qF8hi8Cf.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-BggDSfkK.js → _automationId-Bprfhhg8.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-BalfcgLi.js → _connectorKey._connectionId-75LMK1pB.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-IRfifXtO.js → _connectorKey.index-N0fJPz8N.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-1GSbJquw.js → _conversationId-BY5q9MHG.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-DpMLDfMN.js → _deploymentId-DFh2d5Pm.js} +1 -1
- package/dist/owletto/dist/assets/_name-OY_X_Zm-.js +1 -0
- package/dist/owletto/dist/assets/{_owner-CZwj2Fc5.js → _owner-B92z-CVu.js} +1 -1
- package/dist/owletto/dist/assets/_skillKey-CeEE23_w.js +1 -0
- package/dist/owletto/dist/assets/{_slug-5SDJ_Zlr.js → _slug-CvHxtUEf.js} +1 -1
- package/dist/owletto/dist/assets/accept-invitation-CXSrxBJN.js +1 -0
- package/dist/owletto/dist/assets/activity-route-view-C9W2Ipni.js +1 -0
- package/dist/owletto/dist/assets/{agent-card-controls-Duh-6QNV.js → agent-card-controls-CLupkefQ.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-u6MIKBDe.js → agent-client-setup-list-DgFv4h0W.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-22bJIutE.js → agent-connect-pages-DT8R_qnj.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-DIo7SWp4.js → agent-editor-form-ayUg3Ws1.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-Duv7Rpd9.js → agent-guardrails-route-D-b6CIt2.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-D6mLqg3d.js → agent-loading-shells-DjMpSoub.js} +1 -1
- package/dist/owletto/dist/assets/agent-permissions-matrix-BuGatiEq.js +1 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DjPLOCBS.js → agent-skill-context-DKpIFmCh.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-CdCVU8ZJ.js → agent-skills-route-DqIMttMK.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-BfomD6m2.js → agent-subpage-shell-Bojgj1uq.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-COEinkFo.js → agent-thread-R8Pego9t.js} +2 -2
- package/dist/owletto/dist/assets/agents-C9x76gSX.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-BuIaYVFK.js → agents-workbench-BojDv6gX.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-BULz-FRp.js → app._appId-DNNB5FaI.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-Ck6YhKpX.js → automation-detail-content-CzqrHc4P.js} +1 -1
- package/dist/owletto/dist/assets/automations-C9x76gSX.js +1 -0
- package/dist/owletto/dist/assets/{calendar-BZSx-Jno.js → calendar-VAaxHxss.js} +1 -1
- package/dist/owletto/dist/assets/{callback-DTbt2OS1.js → callback-0VB9tUCF.js} +1 -1
- package/dist/owletto/dist/assets/{card-BsWGRkun.js → card-HMQT7vU5.js} +1 -1
- package/dist/owletto/dist/assets/{claim-6BXg-jBt.js → claim-C2-YTMw-.js} +1 -1
- package/dist/owletto/dist/assets/{clients-CJI4gT-V.js → clients-C0I3V7XE.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-C104Bzj2.js → code-editor-hOZHdlxM.js} +1 -1
- package/dist/owletto/dist/assets/connect-DSr_gD8x.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-CTamwGrw.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-L6cpG1ip.js → connected._clientId-BFuU4-8j.js} +1 -1
- package/dist/owletto/dist/assets/{connection-CqXJ7EAc.js → connection-De_2AD46.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-DgZF0nux.js → connection-feed-detail-Cbn85fG9.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-DyEHCwrM.js → connector-provenance-B17-ze5S.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-zM9Yv-LM.js → connectors-KnNED_-4.js} +1 -1
- package/dist/owletto/dist/assets/{consent-CvL2QShm.js → consent-BOYb4pNu.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-DUExfZp5.js → core.esm-COW6Pfy6.js} +1 -1
- package/dist/owletto/dist/assets/{create-BiERXyJD.js → create-BFpUZ_mU.js} +1 -1
- package/dist/owletto/dist/assets/create-CblXKFGZ.js +1 -0
- package/dist/owletto/dist/assets/create-ChUbSYvl.js +1 -0
- package/dist/owletto/dist/assets/create-automation-form-CRenA7Ix.js +1 -0
- package/dist/owletto/dist/assets/{create._connectorKey-DWUsdgk7.js → create._connectorKey-D4dIDQIQ.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-Bmga7mGH.js → cronstrue-BrlFh5Jy.js} +1 -1
- package/dist/owletto/dist/assets/deployments-DTFrUY7p.js +1 -0
- package/dist/owletto/dist/assets/{deployments-body-Cw9tB9-c.js → deployments-body-CXqfjLqj.js} +1 -1
- package/dist/owletto/dist/assets/{device-Dy4u9FiS.js → device-B0BBIdVx.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-CmAxFq2z.js → device-pin-tombstone-BBYes4en.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-CVv5-okl.js → device-rows-E63OZ9Cp.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-DNKPNnE2.js → device._deviceId-JN0cUCGe.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-C5Mj2ZVk.js → entity-options-qan9-Ycm.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-BdTxty8B.js → entity-page-CozUOlVP.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-jhiER8wM.js → entity-type-page-xISySjVW.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-CEQj2uAu.js → events-feed-DmZ3Ig3X.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-BSp5F0ls.js → full-page-spinner-Q_J5Wcop.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-BB9iOxE3.js +1 -0
- package/dist/owletto/dist/assets/identity-DYbfG4hU.js +1 -0
- package/dist/owletto/dist/assets/index-7d9B918E.js +1 -0
- package/dist/owletto/dist/assets/{index-C2YGEKPo.js → index-BKZMzuMS.js} +7 -7
- package/dist/owletto/dist/assets/index-BsDA0XzK.js +1 -0
- package/dist/owletto/dist/assets/{index-1D5YJuZt.js → index-BwN9pHNs.js} +1 -1
- package/dist/owletto/dist/assets/{index-DFD8r981.js → index-BwVojwkg.js} +1 -1
- package/dist/owletto/dist/assets/index-C4Lz_gB-.js +1 -0
- package/dist/owletto/dist/assets/{index-BO8P4P_v.js → index-C78ucWDF.js} +1 -1
- package/dist/owletto/dist/assets/{index-D6nIYLM-.js → index-C9Dtjaoi.js} +1 -1
- package/dist/owletto/dist/assets/{index-CKWRiFJL.js → index-CGx4og7r.js} +1 -1
- package/dist/owletto/dist/assets/index-CO65Rkad.js +1 -0
- package/dist/owletto/dist/assets/index-CT_kxGkR.js +1 -0
- package/dist/owletto/dist/assets/index-ChcQMdod.css +1 -0
- package/dist/owletto/dist/assets/index-CrKgNtiq.js +1 -0
- package/dist/owletto/dist/assets/{index-CLQ-2wO3.js → index-DLZbFRSM.js} +1 -1
- package/dist/owletto/dist/assets/index-DUIbfL6x.js +1 -0
- package/dist/owletto/dist/assets/{index-DtRraJyI.js → index-DmB-3GhU.js} +1 -1
- package/dist/owletto/dist/assets/{index-CyT-Rwip.js → index-pKfsEvLt.js} +1 -1
- package/dist/owletto/dist/assets/{json-diff-gsOHOgl7.js → json-diff-1FNS_wGA.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-Cs18bNnk.js → list-skeleton-B6gjzr8t.js} +1 -1
- package/dist/owletto/dist/assets/login-S9EGV_EA.js +1 -0
- package/dist/owletto/dist/assets/{logout-DKUiKENJ.js → logout-BOXPSr57.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-g7uB6GYE.js → member-scope-gate-yGr4lrGD.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-BUwnO2o2.js → memory-browse-page-5n3MvqdS.js} +2 -2
- package/dist/owletto/dist/assets/{model-selector-DfsEq1db.js → model-selector-9ZRlR7Sa.js} +1 -1
- package/dist/owletto/dist/assets/models-LOhfJ0sb.js +1 -0
- package/dist/owletto/dist/assets/{new-BWw3u5jE.js → new-BeZJOJgR.js} +1 -1
- package/dist/owletto/dist/assets/{new-CW9MfqPX.js → new-D4wlbvAZ.js} +1 -1
- package/dist/owletto/dist/assets/{new-BSo83s7P.js → new-Dxn1qrmS.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-DM3uXXPM.js → oauth-workspace-access-DoE-9F42.js} +1 -1
- package/dist/owletto/dist/assets/{organization-DJtG7bUJ.js → organization-BezNEJK7.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-DcYSiYWQ.js → permissions-GkKtC6a5.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-CLrF2OFP.js → proposal-review-shell-Bk9D_9YN.js} +1 -1
- package/dist/owletto/dist/assets/{recent-BAuh77AP.js → recent-BVvscz1V.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-BdAH16jE.js → renderer-CAyr3B3s.js} +2 -2
- package/dist/owletto/dist/assets/reset-password-atCMI5uQ.js +1 -0
- package/dist/owletto/dist/assets/{runs-tK0NlrM5.js → runs-CftQDTkq.js} +1 -1
- package/dist/owletto/dist/assets/runs-panel-BkRtr_C4.js +1 -0
- package/dist/owletto/dist/assets/{runs-table-BQACrHq5.js → runs-table-CWCl38L5.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-Dr5Osu6u.js → schema-value-normalization-C9Lm83-q.js} +1 -1
- package/dist/owletto/dist/assets/settings-BKMOjfYf.js +1 -0
- package/dist/owletto/dist/assets/{settings-D9ezdxp8.js → settings-CgTgofgd.js} +1 -1
- package/dist/owletto/dist/assets/skills-DWr8qR3U.js +1 -0
- package/dist/owletto/dist/assets/{switch-C1vQiKIo.js → switch-BOGbkDQb.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-CCqN_8wM.js → use-mention-search-C9ckRw0s.js} +2 -2
- package/dist/owletto/dist/favicon.ico +0 -0
- package/dist/owletto/dist/favicon.svg +5 -6
- package/dist/owletto/dist/fonts/dm-mono-latin-500-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/dm-sans-latin-400-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/dm-sans-latin-600-normal.woff2 +0 -0
- package/dist/owletto/dist/index.html +8 -8
- package/dist/owletto/dist/lobu-logo.svg +16 -0
- package/dist/server-main.bundle.mjs +2415 -1268
- package/npm-shrinkwrap.json +17 -17
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/index.d.ts +1 -1
- package/vendor/connector-sdk/dist/logger.js +4 -1
- package/vendor/connector-sdk/dist/reaction-sdk.d.ts +9 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +16 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +12 -3
- package/vendor/core/dist/contracts/worker/protocol.d.ts +9 -0
- package/vendor/core/dist/contracts/worker/protocol.js +10 -1
- package/vendor/core/dist/logger.js +4 -2
- package/vendor/core/package.json +1 -1
- package/dist/owletto/dist/assets/_-BjTOSrPW.js +0 -1
- package/dist/owletto/dist/assets/_agentId-E5FuvQ_W.js +0 -1
- package/dist/owletto/dist/assets/_name-Ca5sRv2h.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-BnDO8aEk.js +0 -1
- package/dist/owletto/dist/assets/accept-invitation-tMqF2W59.js +0 -1
- package/dist/owletto/dist/assets/activity-route-view-DSJj0TBg.js +0 -1
- package/dist/owletto/dist/assets/agent-permissions-matrix-QvA6xL8Q.js +0 -1
- package/dist/owletto/dist/assets/agents-DztpCplG.js +0 -1
- package/dist/owletto/dist/assets/automations-DztpCplG.js +0 -1
- package/dist/owletto/dist/assets/connect-9tegWawc.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-Dh6e0n6A.js +0 -1
- package/dist/owletto/dist/assets/create-BL_WcDoF.js +0 -1
- package/dist/owletto/dist/assets/create-Dyz5QbON.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-DCYFtK4q.js +0 -1
- package/dist/owletto/dist/assets/deployments-h8jIWEVy.js +0 -1
- package/dist/owletto/dist/assets/guardrails-DrOhJHr5.js +0 -1
- package/dist/owletto/dist/assets/identity-BTE8ZlL9.js +0 -1
- package/dist/owletto/dist/assets/index-Be4XiWxU.js +0 -1
- package/dist/owletto/dist/assets/index-CPqabIYs.css +0 -1
- package/dist/owletto/dist/assets/index-CS1UPepo.js +0 -1
- package/dist/owletto/dist/assets/index-DGinfBZr.js +0 -1
- package/dist/owletto/dist/assets/index-DJs1EEbu.js +0 -1
- package/dist/owletto/dist/assets/index-DZb_utnT.js +0 -1
- package/dist/owletto/dist/assets/index-RH7aiqHs.js +0 -1
- package/dist/owletto/dist/assets/index-xwlLZWva.js +0 -1
- package/dist/owletto/dist/assets/login-B3RTCs3p.js +0 -1
- package/dist/owletto/dist/assets/models-CZZt4VcZ.js +0 -1
- package/dist/owletto/dist/assets/reset-password-DjgDJAYG.js +0 -1
- package/dist/owletto/dist/assets/runs-panel-Dqq-0G9H.js +0 -1
- package/dist/owletto/dist/assets/settings-DZifZxa5.js +0 -1
- package/dist/owletto/dist/assets/skills-CNtoLPU_.js +0 -1
- package/dist/owletto/dist/fonts/geist-pixel-square.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjnTLgNs.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zsTjnTLgNuZ5w.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjgn7Motmp5r61.woff2 +0 -0
- package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7Motmp5g.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD0OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD1OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD2OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD4OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD7OwGtT0rU.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD_OwGtT0rU3BE.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw2nSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw6nSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwCnSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwOnSGjW7BA.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwenSGjW7BDEAQ.woff2 +0 -0
- package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwynSGjW7BDEAQ.woff2 +0 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/runtime-server",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@lobu/runtime-server",
|
|
9
|
-
"version": "20.0.
|
|
9
|
+
"version": "20.0.1",
|
|
10
10
|
"license": "BUSL-1.1",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
@@ -4191,12 +4191,12 @@
|
|
|
4191
4191
|
"license": "MIT"
|
|
4192
4192
|
},
|
|
4193
4193
|
"node_modules/@types/node": {
|
|
4194
|
-
"version": "
|
|
4195
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-
|
|
4196
|
-
"integrity": "sha512-
|
|
4194
|
+
"version": "26.5.1",
|
|
4195
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.5.1.tgz",
|
|
4196
|
+
"integrity": "sha512-CzNm2FezW4VR/LjG6yUdiEgLE/rAQ9Slj5gCu/C2VrdcW7I0ahNZ8DRbHT7zOZ6r3ONgd/bsQIeSaoDGrd1C6g==",
|
|
4197
4197
|
"license": "MIT",
|
|
4198
4198
|
"dependencies": {
|
|
4199
|
-
"undici-types": "~
|
|
4199
|
+
"undici-types": "~8.9.0"
|
|
4200
4200
|
}
|
|
4201
4201
|
},
|
|
4202
4202
|
"node_modules/@types/retry": {
|
|
@@ -4512,9 +4512,9 @@
|
|
|
4512
4512
|
}
|
|
4513
4513
|
},
|
|
4514
4514
|
"node_modules/b4a": {
|
|
4515
|
-
"version": "1.
|
|
4516
|
-
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.
|
|
4517
|
-
"integrity": "sha512-
|
|
4515
|
+
"version": "1.9.0",
|
|
4516
|
+
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.9.0.tgz",
|
|
4517
|
+
"integrity": "sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==",
|
|
4518
4518
|
"license": "Apache-2.0",
|
|
4519
4519
|
"peerDependencies": {
|
|
4520
4520
|
"react-native-b4a": "*"
|
|
@@ -10765,9 +10765,9 @@
|
|
|
10765
10765
|
}
|
|
10766
10766
|
},
|
|
10767
10767
|
"node_modules/undici-types": {
|
|
10768
|
-
"version": "
|
|
10769
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-
|
|
10770
|
-
"integrity": "sha512-
|
|
10768
|
+
"version": "8.9.0",
|
|
10769
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
|
10770
|
+
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
|
10771
10771
|
"license": "MIT"
|
|
10772
10772
|
},
|
|
10773
10773
|
"node_modules/unified": {
|
|
@@ -11769,9 +11769,9 @@
|
|
|
11769
11769
|
}
|
|
11770
11770
|
},
|
|
11771
11771
|
"node_modules/zod": {
|
|
11772
|
-
"version": "4.6.
|
|
11773
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.
|
|
11774
|
-
"integrity": "sha512-
|
|
11772
|
+
"version": "4.6.5",
|
|
11773
|
+
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz",
|
|
11774
|
+
"integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==",
|
|
11775
11775
|
"license": "MIT",
|
|
11776
11776
|
"funding": {
|
|
11777
11777
|
"url": "https://github.com/sponsors/colinhacks"
|
|
@@ -11798,7 +11798,7 @@
|
|
|
11798
11798
|
},
|
|
11799
11799
|
"vendor/connector-sdk": {
|
|
11800
11800
|
"name": "@lobu/connector-sdk",
|
|
11801
|
-
"version": "20.0.
|
|
11801
|
+
"version": "20.0.1",
|
|
11802
11802
|
"license": "BUSL-1.1",
|
|
11803
11803
|
"dependencies": {
|
|
11804
11804
|
"@lobu/core": "file:../core",
|
|
@@ -11813,7 +11813,7 @@
|
|
|
11813
11813
|
},
|
|
11814
11814
|
"vendor/core": {
|
|
11815
11815
|
"name": "@lobu/core",
|
|
11816
|
-
"version": "20.0.
|
|
11816
|
+
"version": "20.0.1",
|
|
11817
11817
|
"license": "Apache-2.0",
|
|
11818
11818
|
"dependencies": {
|
|
11819
11819
|
"@opentelemetry/api": "^1.9.0",
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ export type { ExtensionDomScrapeResult, ExtensionScrapeConfig, ExtensionScrapeOb
|
|
|
39
39
|
export { extensionDomScrape } from './extension-dom-scrape.js';
|
|
40
40
|
export type { ChromeActionDispatcher, ChromeActionInput, ChromeActionOutput, ExtensionNetworkConfig, ExtensionNetworkPattern, ExtensionNetworkResult, InterceptedResponse, NavigateObservation, NetworkInterceptDrainObservation, NetworkInterceptStartObservation, } from './extension-network.js';
|
|
41
41
|
export { extensionNetworkSync } from './extension-network.js';
|
|
42
|
-
export type { ReactionContext } from './reaction-sdk.js';
|
|
42
|
+
export type { AutomationScriptContext, ReactionContext, } from './reaction-sdk.js';
|
|
43
43
|
export type { ReactionClient } from './reaction-client-types.js';
|
|
44
44
|
export type { CardElement, KnowledgeDeleteInput, KnowledgeReadInput, KnowledgeSaveInput, KnowledgeSaveResult, KnowledgeSearchInput, NotificationsSendInput, NotificationsSendResult, } from './reaction-client-types.js';
|
|
45
45
|
export type { ConnectionListInput } from '@lobu/core/contracts/tools/manage-connections';
|
|
@@ -55,8 +55,11 @@ function formatMessage(level, serviceName, message, args) {
|
|
|
55
55
|
// pino-style: logger.info({ meta }, 'message')
|
|
56
56
|
if (typeof message === 'object' && message !== null && !Array.isArray(message) && !(message instanceof Error)) {
|
|
57
57
|
if (rest.length > 0 && typeof rest[0] === 'string') {
|
|
58
|
+
// Keep the metadata object as a trailing arg so it still renders.
|
|
59
|
+
// Slicing it away accepted the signature and then dropped the payload,
|
|
60
|
+
// leaving a connector diagnostic with its message but no fields.
|
|
58
61
|
msgStr = rest[0];
|
|
59
|
-
rest = rest.slice(1);
|
|
62
|
+
rest = [message, ...rest.slice(1)];
|
|
60
63
|
}
|
|
61
64
|
else {
|
|
62
65
|
msgStr = safeStringify(message);
|
|
@@ -46,4 +46,13 @@ export interface ReactionContext {
|
|
|
46
46
|
/** Stable workspace slug for relative app permalinks. */
|
|
47
47
|
organization_slug: string;
|
|
48
48
|
}
|
|
49
|
+
/** Context of a script executing the Automation itself, before completion. */
|
|
50
|
+
export interface AutomationScriptContext extends Omit<ReactionContext, 'extracted_data' | 'window'> {
|
|
51
|
+
window: Omit<ReactionContext['window'], 'content_analyzed'>;
|
|
52
|
+
/**
|
|
53
|
+
* Durable event activations, frozen when the run is claimed. Empty for
|
|
54
|
+
* scheduled and manual runs.
|
|
55
|
+
*/
|
|
56
|
+
trigger_signals: unknown[];
|
|
57
|
+
}
|
|
49
58
|
//# sourceMappingURL=reaction-sdk.d.ts.map
|
|
@@ -135,7 +135,18 @@ export declare const AutomationOutputSchema: import("@sinclair/typebox").TUnion<
|
|
|
135
135
|
export type AutomationOutput = Static<typeof AutomationOutputSchema>;
|
|
136
136
|
export declare const AutomationOutputsSchema: import("@sinclair/typebox").TObject<{}>;
|
|
137
137
|
export type AutomationOutputs = Record<string, AutomationOutput>;
|
|
138
|
+
export declare const AutomationScriptExecutorSchema: import("@sinclair/typebox").TObject<{
|
|
139
|
+
kind: import("@sinclair/typebox").TLiteral<"script">;
|
|
140
|
+
source: import("@sinclair/typebox").TString;
|
|
141
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
142
|
+
}>;
|
|
143
|
+
export type AutomationScriptExecutor = Static<typeof AutomationScriptExecutorSchema>;
|
|
138
144
|
export declare const AutomationExecutionConfigSchema: import("@sinclair/typebox").TObject<{
|
|
145
|
+
executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
146
|
+
kind: import("@sinclair/typebox").TLiteral<"script">;
|
|
147
|
+
source: import("@sinclair/typebox").TString;
|
|
148
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
149
|
+
}>>;
|
|
139
150
|
timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
140
151
|
max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
141
152
|
model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -248,6 +259,11 @@ export declare const ManageAutomationsSchema: import("@sinclair/typebox").TObjec
|
|
|
248
259
|
min_cooldown_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
249
260
|
model_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
|
250
261
|
execution_config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNull, import("@sinclair/typebox").TObject<{
|
|
262
|
+
executor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
263
|
+
kind: import("@sinclair/typebox").TLiteral<"script">;
|
|
264
|
+
source: import("@sinclair/typebox").TString;
|
|
265
|
+
params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
266
|
+
}>>;
|
|
251
267
|
timeout_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
252
268
|
max_budget_usd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
253
269
|
model: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListAutomationsResultSchema = exports.ListAutomationsSchema = exports.ManageAutomationsResultSchema = exports.AutomationTriggerResultSchema = exports.AutomationTriggerExecutionSchema = exports.AutomationClaimNextWindowResultSchema = exports.AutomationClaimNextWindowContextSchema = exports.ManageAutomationsPromotedEntitySchema = exports.ManageAutomationsFeedbackItemSchema = exports.ManageAutomationsDeleteResultSchema = exports.ManageAutomationsSchema = exports.AutomationSkillSchema = exports.SourceSchema = exports.AutomationDeliveryTargetSchema = exports.AutomationExecutionConfigSchema = exports.AutomationOutputsSchema = exports.AutomationOutputSchema = exports.AutomationEventOutputSchema = exports.AutomationEntityOutputSchema = exports.AutomationSourceSchema = exports.AutomationTriggerSchema = exports.AutomationScheduleTriggerSchema = exports.AutomationWorkspaceEventTriggerSchema = exports.AutomationEventTriggerSchema = void 0;
|
|
3
|
+
exports.ListAutomationsResultSchema = exports.ListAutomationsSchema = exports.ManageAutomationsResultSchema = exports.AutomationTriggerResultSchema = exports.AutomationTriggerExecutionSchema = exports.AutomationClaimNextWindowResultSchema = exports.AutomationClaimNextWindowContextSchema = exports.ManageAutomationsPromotedEntitySchema = exports.ManageAutomationsFeedbackItemSchema = exports.ManageAutomationsDeleteResultSchema = exports.ManageAutomationsSchema = exports.AutomationSkillSchema = exports.SourceSchema = exports.AutomationDeliveryTargetSchema = exports.AutomationExecutionConfigSchema = exports.AutomationScriptExecutorSchema = exports.AutomationOutputsSchema = exports.AutomationOutputSchema = exports.AutomationEventOutputSchema = exports.AutomationEntityOutputSchema = exports.AutomationSourceSchema = exports.AutomationTriggerSchema = exports.AutomationScheduleTriggerSchema = exports.AutomationWorkspaceEventTriggerSchema = exports.AutomationEventTriggerSchema = void 0;
|
|
4
4
|
exports.resolvedEventExecution = resolvedEventExecution;
|
|
5
5
|
exports.normalizeWorkspaceEventTrigger = normalizeWorkspaceEventTrigger;
|
|
6
6
|
exports.normalizeAutomationTags = normalizeAutomationTags;
|
|
@@ -202,7 +202,16 @@ exports.AutomationOutputsSchema = typebox_1.Type.Object({}, {
|
|
|
202
202
|
maxProperties: 20,
|
|
203
203
|
description: "Named top-level arrays persisted after a completed window. Entity outputs are validated against their entity type; event rows require content and may include title, metadata, author, source_url, occurred_at, parent_event_id, payload_type, and idempotency_key.",
|
|
204
204
|
});
|
|
205
|
+
exports.AutomationScriptExecutorSchema = typebox_1.Type.Object({
|
|
206
|
+
kind: typebox_1.Type.Literal("script"),
|
|
207
|
+
source: typebox_1.Type.String({ minLength: 1, maxLength: 131072 }),
|
|
208
|
+
params: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Unknown())),
|
|
209
|
+
}, {
|
|
210
|
+
additionalProperties: false,
|
|
211
|
+
description: "Run this TypeScript module directly in the Automation sandbox. Export default async (ctx, client). The runtime pins the script and window at activation and completes the run only after success. SDK writes retain the owning agent's permissions. Use ctx.window.run_id for retry idempotency.",
|
|
212
|
+
});
|
|
205
213
|
exports.AutomationExecutionConfigSchema = typebox_1.Type.Object({
|
|
214
|
+
executor: typebox_1.Type.Optional(exports.AutomationScriptExecutorSchema),
|
|
206
215
|
timeout_seconds: typebox_1.Type.Optional(typebox_1.Type.Integer({
|
|
207
216
|
minimum: 1,
|
|
208
217
|
maximum: 86400,
|
|
@@ -235,7 +244,7 @@ exports.AutomationExecutionConfigSchema = typebox_1.Type.Object({
|
|
|
235
244
|
})),
|
|
236
245
|
}, {
|
|
237
246
|
additionalProperties: false,
|
|
238
|
-
description: "[create/update] Per-Automation execution settings: device-worker CLI flags
|
|
247
|
+
description: "[create/update] Per-Automation execution settings: a sandboxed script executor, device-worker CLI flags, or the server-side finalize-nudge budget. Omitted fields fall back to dispatcher/CLI/global defaults; pass null to clear.",
|
|
239
248
|
});
|
|
240
249
|
exports.AutomationDeliveryTargetSchema = typebox_1.Type.Object({
|
|
241
250
|
connection_id: typebox_1.Type.Integer({
|
|
@@ -423,7 +432,7 @@ exports.ManageAutomationsSchema = typebox_1.Type.Object({
|
|
|
423
432
|
})),
|
|
424
433
|
// Automation config fields (create/create_version/update)
|
|
425
434
|
prompt: typebox_1.Type.Optional(typebox_1.Type.String({
|
|
426
|
-
description: "[create/create_version] Literal LLM instruction text for the Automation — the task statement, frozen into the version. No template expansion happens: the text is delivered to the agent verbatim, and the window's data (content, sources, entities, extraction_schema) arrives alongside it in the knowledge-read payload. Reusable know-how belongs in `skills` instead, which is delivered as readable files rather than pasted in here. A schedule trigger, an event trigger with execution 'window', and an Automation with no triggers each need an instruction source — supply `prompt`, `skills`, or
|
|
435
|
+
description: "[create/create_version] Literal LLM instruction text for the Automation — the task statement, frozen into the version. No template expansion happens: the text is delivered to the agent verbatim, and the window's data (content, sources, entities, extraction_schema) arrives alongside it in the knowledge-read payload. Reusable know-how belongs in `skills` instead, which is delivered as readable files rather than pasted in here. A schedule trigger, an event trigger with execution 'window', and an Automation with no triggers each need an instruction source — supply `prompt`, `skills`, a reaction script, or a script executor; an event trigger with execution 'turn' may omit all instruction sources and use the built-in default.",
|
|
427
436
|
})),
|
|
428
437
|
skills: typebox_1.Type.Optional(typebox_1.Type.Array(exports.AutomationSkillSchema, {
|
|
429
438
|
maxItems: 5,
|
|
@@ -83,9 +83,18 @@ export declare const FeedNotificationSchema: import("@sinclair/typebox").TObject
|
|
|
83
83
|
notification_id: import("@sinclair/typebox").TString;
|
|
84
84
|
changed: import("@sinclair/typebox").TBoolean;
|
|
85
85
|
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Ceiling on how long the gateway holds an empty claim request. A client that
|
|
88
|
+
* asks for more is rejected, so the client's own hold MUST be read from here
|
|
89
|
+
* rather than restated: the two are one contract, and a client-side literal
|
|
90
|
+
* above the schema maximum 400s every poll — a total dispatch outage.
|
|
91
|
+
*/
|
|
92
|
+
export declare const WORKER_POLL_MAX_WAIT_SECONDS = 25;
|
|
86
93
|
/** `POST /api/workers/poll` request body. */
|
|
87
94
|
export declare const PollRequestSchema: import("@sinclair/typebox").TObject<{
|
|
88
95
|
worker_id: import("@sinclair/typebox").TString;
|
|
96
|
+
/** Maximum time to hold an empty claim request; available work returns immediately. */
|
|
97
|
+
wait_seconds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
89
98
|
capabilities: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TBoolean>>;
|
|
90
99
|
/** Number of additional runs the worker can accept at this instant. */
|
|
91
100
|
capacity_available: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* not change that boundary, it only types what already crosses it.
|
|
27
27
|
*/
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.HeartbeatResponseSchema = exports.DispatchChromeActionResponseSchema = exports.DispatchChromeActionRequestSchema = exports.HeartbeatRequestSchema = exports.AGENT_TURN_BRIDGE_BYTES = exports.TURN_DELTA_MAX_CHARS = exports.PollAuthSignalResponseSchema = exports.PollAuthSignalRequestSchema = exports.EmitAuthArtifactRequestSchema = exports.CompleteAgentTurnResponseSchema = exports.CompleteAgentTurnRequestSchema = exports.AGENT_TURN_INPUT_MAX = exports.TURN_TOOL_EVENT_QUEUE_MAX = exports.TurnToolEventSchema = exports.TURN_TOOL_OUTPUT_MAX_CHARS = exports.CompleteDeviceChatResponseSchema = exports.CompleteDeviceChatRequestSchema = exports.CompleteAutomationResponseSchema = exports.CompleteAutomationRequestSchema = exports.CompleteAuthRequestSchema = exports.CompleteEmbeddingsRequestSchema = exports.EmbeddingEntrySchema = exports.EmbedEventSchema = exports.CompleteActionRequestSchema = exports.CompleteRequestSchema = exports.StreamBatchSchema = exports.ContentItemSchema = exports.ActivatePageResponseSchema = exports.ActivatePageRequestSchema = exports.PollResponseSchema = exports.FeedSourceAckSchema = exports.AgentTurnPollPayloadSchema = exports.DeviceChatPollPayloadSchema = exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH = exports.DeviceChatHistoryMessageSchema = exports.AutomationPollPayloadSchema = exports.AutomationPollContextSchema = exports.AutomationPollEventSchema = exports.AutomationPollMetaSchema = exports.AutomationExecutionConfigSchema = exports.PollRequestSchema = exports.FeedNotificationSchema = exports.EXECUTION_BACKENDS = exports.OAuthCredentialsSchema = exports.WorkerExitDiagnosticsSchema = exports.WorkerExitReasonSchema = exports.RunTypeSchema = void 0;
|
|
29
|
+
exports.HeartbeatResponseSchema = exports.DispatchChromeActionResponseSchema = exports.DispatchChromeActionRequestSchema = exports.HeartbeatRequestSchema = exports.AGENT_TURN_BRIDGE_BYTES = exports.TURN_DELTA_MAX_CHARS = exports.PollAuthSignalResponseSchema = exports.PollAuthSignalRequestSchema = exports.EmitAuthArtifactRequestSchema = exports.CompleteAgentTurnResponseSchema = exports.CompleteAgentTurnRequestSchema = exports.AGENT_TURN_INPUT_MAX = exports.TURN_TOOL_EVENT_QUEUE_MAX = exports.TurnToolEventSchema = exports.TURN_TOOL_OUTPUT_MAX_CHARS = exports.CompleteDeviceChatResponseSchema = exports.CompleteDeviceChatRequestSchema = exports.CompleteAutomationResponseSchema = exports.CompleteAutomationRequestSchema = exports.CompleteAuthRequestSchema = exports.CompleteEmbeddingsRequestSchema = exports.EmbeddingEntrySchema = exports.EmbedEventSchema = exports.CompleteActionRequestSchema = exports.CompleteRequestSchema = exports.StreamBatchSchema = exports.ContentItemSchema = exports.ActivatePageResponseSchema = exports.ActivatePageRequestSchema = exports.PollResponseSchema = exports.FeedSourceAckSchema = exports.AgentTurnPollPayloadSchema = exports.DeviceChatPollPayloadSchema = exports.DEVICE_CHAT_MAX_CONTEXT_LENGTH = exports.DeviceChatHistoryMessageSchema = exports.AutomationPollPayloadSchema = exports.AutomationPollContextSchema = exports.AutomationPollEventSchema = exports.AutomationPollMetaSchema = exports.AutomationExecutionConfigSchema = exports.PollRequestSchema = exports.WORKER_POLL_MAX_WAIT_SECONDS = exports.FeedNotificationSchema = exports.EXECUTION_BACKENDS = exports.OAuthCredentialsSchema = exports.WorkerExitDiagnosticsSchema = exports.WorkerExitReasonSchema = exports.RunTypeSchema = void 0;
|
|
30
30
|
exports.defaultBackendCapacity = defaultBackendCapacity;
|
|
31
31
|
const typebox_1 = require("@sinclair/typebox");
|
|
32
32
|
// Wire mirror of connector-sdk's ConnectorAutomationSignalDraftSchema. Core is
|
|
@@ -132,9 +132,18 @@ exports.FeedNotificationSchema = typebox_1.Type.Object({
|
|
|
132
132
|
notification_id: typebox_1.Type.String({ minLength: 1, maxLength: 200 }),
|
|
133
133
|
changed: typebox_1.Type.Boolean(),
|
|
134
134
|
});
|
|
135
|
+
/**
|
|
136
|
+
* Ceiling on how long the gateway holds an empty claim request. A client that
|
|
137
|
+
* asks for more is rejected, so the client's own hold MUST be read from here
|
|
138
|
+
* rather than restated: the two are one contract, and a client-side literal
|
|
139
|
+
* above the schema maximum 400s every poll — a total dispatch outage.
|
|
140
|
+
*/
|
|
141
|
+
exports.WORKER_POLL_MAX_WAIT_SECONDS = 25;
|
|
135
142
|
/** `POST /api/workers/poll` request body. */
|
|
136
143
|
exports.PollRequestSchema = typebox_1.Type.Object({
|
|
137
144
|
worker_id: typebox_1.Type.String(),
|
|
145
|
+
/** Maximum time to hold an empty claim request; available work returns immediately. */
|
|
146
|
+
wait_seconds: typebox_1.Type.Optional(typebox_1.Type.Integer({ minimum: 0, maximum: exports.WORKER_POLL_MAX_WAIT_SECONDS })),
|
|
138
147
|
capabilities: typebox_1.Type.Optional(typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Boolean())),
|
|
139
148
|
/** Number of additional runs the worker can accept at this instant. */
|
|
140
149
|
capacity_available: typebox_1.Type.Optional(typebox_1.Type.Integer({ minimum: 0, maximum: 1024 })),
|
|
@@ -59,9 +59,11 @@ function createConsoleLogger(serviceName) {
|
|
|
59
59
|
!Array.isArray(message) &&
|
|
60
60
|
!(message instanceof Error)) {
|
|
61
61
|
if (args.length > 0 && typeof args[0] === "string") {
|
|
62
|
-
//
|
|
62
|
+
// Keep the metadata object as a trailing arg so it still renders.
|
|
63
|
+
// Slicing it away accepted the signature and then dropped the payload,
|
|
64
|
+
// emptying every structured diagnostic that uses this call shape.
|
|
63
65
|
msgStr = args[0];
|
|
64
|
-
args = args.slice(1);
|
|
66
|
+
args = [message, ...args.slice(1)];
|
|
65
67
|
}
|
|
66
68
|
else {
|
|
67
69
|
// Just an object, stringify it
|
package/vendor/core/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d6 as t,j as p,d7 as e}from"./index-C2YGEKPo.js";import{A as m}from"./activity-route-view-DSJj0TBg.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-CJI4gT-V.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./events-feed-CEQj2uAu.js";import"./renderer-BdAH16jE.js";import"./card-BsWGRkun.js";import"./calendar-BZSx-Jno.js";import"./agent-loading-shells-D6mLqg3d.js";import"./member-scope-gate-g7uB6GYE.js";function d(){const{owner:o,_splat:r}=t.useParams(),i=t.useSearch();return p.jsx(m,{owner:o,search:i,attentionLens:!1,entityScope:e(r||"").path})}export{d as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gh as r,j as e}from"./index-C2YGEKPo.js";import{A as n}from"./agents-workbench-BuIaYVFK.js";import"./agent-editor-form-DIo7SWp4.js";import"./model-selector-DfsEq1db.js";import"./proposal-review-shell-CLrF2OFP.js";import"./runs-tK0NlrM5.js";function c(){const{owner:o,agentId:t}=r.useParams();return e.jsx(n,{owner:o,agentId:t})}export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hC as a,j as e}from"./index-C2YGEKPo.js";import{b as i}from"./agent-guardrails-route-Duv7Rpd9.js";import"./model-selector-DfsEq1db.js";import"./agent-subpage-shell-BfomD6m2.js";import"./agent-loading-shells-D6mLqg3d.js";import"./agent-card-controls-Duh-6QNV.js";import"./switch-C1vQiKIo.js";function x(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{x as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hA as i,j as e}from"./index-C2YGEKPo.js";import{b as m}from"./agent-skills-route-CdCVU8ZJ.js";import"./agent-subpage-shell-BfomD6m2.js";import"./agent-skill-context-DjPLOCBS.js";import"./core.esm-DUExfZp5.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-D6mLqg3d.js";import"./agent-card-controls-Duh-6QNV.js";import"./switch-C1vQiKIo.js";function f(){const{owner:t,agentId:o,skillKey:r}=i.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:r})}export{f as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as l,ay as m,r as c,ag as d,j as e,az as u,aw as h}from"./index-C2YGEKPo.js";import{S as f,A as v,a as x}from"./index-BO8P4P_v.js";import{F as p}from"./full-page-spinner-BSp5F0ls.js";function g({alt:i="",...t}){return e.jsx("img",{alt:i,...t,referrerPolicy:"no-referrer"})}function j({children:i}){return e.jsx(x,{authClient:h,navigate:t=>{window.location.href=t},replace:t=>{window.location.replace(t)},Link:({href:t,children:n,className:a})=>e.jsx("a",{href:t,className:a,children:n}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:g},children:i})}function A(){const{session:i,sessionResult:t}=l(),{invitationId:n}=m.useSearch(),a=c.useRef(!1);return c.useEffect(()=>{t.isPending||i||!n||a.current||(a.current=!0,(async()=>{let r=null;try{const o=await fetch(`${d}/api/invitation-preview?id=${encodeURIComponent(n)}`,{credentials:"omit"});o.ok&&(r=await o.json())}catch{}const s=new URL("/auth/login",window.location.origin);s.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(n)}`),r&&(s.searchParams.set("loginHint",r.email),s.searchParams.set("invitationOrg",r.organizationName)),window.location.href=s.toString()})())},[i,t.isPending,n]),i&&!n?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx(u,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):i?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsx(j,{children:e.jsx(f,{children:e.jsx(v,{})})})}):e.jsx(p,{className:"min-h-[calc(100vh-3.5rem)]"})}export{A as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as me,K as Ft,bv as Be,bb as Gn,r as h,d8 as Un,j as e,bO as qe,L as Y,B as U,X as Te,aj as O,ci as Pt,cj as Mt,d9 as $t,bH as Rt,cP as ze,ck as Ot,da as Wn,db as Hn,b6 as Qn,a3 as st,dc as Yn,cE as Xn,cF as Zn,ct as qn,dd as Jn,E as es,de as he,df as q,ak as Kt,dg as ts,af as _e,a1 as Vt,cb as Bt,c9 as ns,bS as Ce,dh as zt,di as ss,aO as Ie,cl as Gt,P as Ut,cg as os,dj as as,dk as le,d5 as rs,dl as is,dm as cs,dn as ls,br as ds,n as us,dp as ms,dq as He,dr as fs,ds as ye,aE as Ae,dt as De,du as ps,dv as hs,dw as Wt,dx as xs,dy as gs,aH as vs,cM as ys,ab as bs,c0 as Qe,dz as Ht,S as Qt,dA as js,dB as Yt,dC as Xt,bY as ws,bZ as Ns,b_ as Ss,b$ as ks,dD as Cs,aS as Zt,Y as _s,bM as qt,dE as Jt,dF as Ts,dG as wt,dH as Is,dI as As,dJ as Ds,a as Ls,dK as Es,dL as Fs,dM as en,dN as Ps,dO as Ms,dP as $s,dQ as Rs,dR as Os,dS as Ks,c8 as Vs,dT as Bs,dU as tn,bm as Oe,I as Nt,b4 as zs,dV as Gs,dW as Us,dX as Ws,dY as Hs,dZ as Qs,d_ as Ys,p as Xs,q as Zs,cn as qs,c7 as St,cf as Js,d$ as eo,aX as to,e0 as no,bK as so,e1 as oo,aV as ao}from"./index-C2YGEKPo.js";import{A as ro}from"./device-automation-BIjs7DZJ.js";import{n as io}from"./agent-thread-storage-U6htL3ad.js";import{s as co}from"./pending-seed-CPbfgnLX.js";import{u as lo}from"./clients-CJI4gT-V.js";import{g as uo}from"./client-rows-EJSKR6z1.js";import{c as Je}from"./connection-label-BobuYiAG.js";import{E as mo}from"./events-feed-CEQj2uAu.js";import{C as fo}from"./calendar-BZSx-Jno.js";import{b as po,c as ho}from"./renderer-BdAH16jE.js";import{E as xo}from"./agent-loading-shells-D6mLqg3d.js";import{M as go}from"./member-scope-gate-g7uB6GYE.js";function Ke(t){return t.kind==="managed"?`managed:${t.agentId}`:`device:${t.executionTarget.deviceWorkerId}:${t.executionTarget.agentKind}`}function vo({ownerSlug:t}){const n=me(),o=Ft(),{data:s=[]}=Be(),{data:a=[]}=Gn(),[r,d]=h.useState(!1),[c,u]=h.useState(null),[i,m]=h.useState(""),[f,p]=h.useState(!1),v=h.useRef(null);h.useEffect(()=>{o&&r&&v.current?.focus()},[o,r]);const g=s.find(j=>j.system)??s[0]??null,x=h.useMemo(()=>{const j=s.map(T=>({kind:"managed",agentId:T.agentId,label:T.name})),D=g?a.filter(T=>T.online&&T.organization_slug===t&&T.capabilities.includes("automations.execute")&&(T.agent_kinds?.length??0)>0).flatMap(T=>(T.agent_kinds??[]).map(w=>({kind:"device",agentId:g.agentId,label:`${Un(T)} · ${ro[w]??w}`,executionTarget:{kind:"device",deviceWorkerId:T.id,agentKind:w}}))):[];return{managed:j,deviceTargets:D}},[s,g,a,t]),y=[...x.managed,...x.deviceTargets].find(j=>Ke(j)===c)??x.managed.find(j=>j.agentId===g?.agentId)??x.managed[0]??x.deviceTargets[0]??null,S=j=>{u(Ke(j)),p(!1)},C=()=>{const j=i.trim();if(!j||!y)return;const D=io();co(D,j,y.kind==="device"?y.executionTarget:void 0),m(""),n(Hn(t,y.agentId,D))};if(o&&!r){const j="flex h-14 w-14 items-center justify-center rounded-full border bg-background text-foreground shadow-md transition-colors hover:bg-accent/60";return e.jsx("div",{className:"sticky bottom-0 z-20 mt-auto flex justify-center bg-gradient-to-t from-background via-background to-transparent pt-4 pb-1",children:y?e.jsx("button",{type:"button","aria-label":"Ask Lobu",className:j,onClick:()=>d(!0),children:e.jsx(qe,{className:"h-7 w-7"})}):e.jsx(Y,{to:"/$owner/agents",params:{owner:t},"aria-label":"Create an agent to start chatting",className:j,children:e.jsx(qe,{className:"h-7 w-7"})})})}return e.jsx("div",{className:"sticky bottom-0 z-20 mt-auto bg-gradient-to-t from-background via-background to-transparent pt-5",children:e.jsxs("div",{className:"relative rounded-2xl border bg-background shadow-sm transition-colors focus-within:ring-1 focus-within:ring-ring",children:[o?e.jsx(U,{type:"button",variant:"ghost",size:"icon","aria-label":"Collapse composer",className:"absolute top-1.5 right-1.5 size-7 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>d(!1),children:e.jsx(Te,{className:"h-4 w-4"})}):null,y?e.jsx("textarea",{value:i,onChange:j=>m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),C())},placeholder:"Ask Lobu…",rows:2,ref:v,className:O("max-h-40 min-h-16 w-full resize-none bg-transparent px-4 pt-3 text-sm outline-none placeholder:text-muted-foreground",o&&"pr-10")}):e.jsx(Y,{to:"/$owner/agents",params:{owner:t},className:O("block min-h-16 px-4 pt-3 text-sm text-muted-foreground hover:text-foreground",o&&"pr-10"),children:"Create an agent to start chatting"}),e.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 pb-2",children:[e.jsxs(Pt,{open:f,onOpenChange:p,children:[e.jsx(Mt,{asChild:!0,children:e.jsxs(U,{type:"button",variant:"ghost",size:"sm",disabled:!y,className:"h-8 max-w-[70%] gap-1.5 px-2 text-xs text-muted-foreground",children:[y?.kind==="device"?e.jsx($t,{className:"h-3.5 w-3.5"}):e.jsx(Rt,{className:"h-3.5 w-3.5"}),e.jsxs("span",{className:"truncate",children:["Run with: ",y?.label??"No agent"]}),e.jsx(ze,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsxs(Ot,{align:"start",className:"max-h-80 w-72 overflow-y-auto p-1.5",children:[e.jsx("p",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Lobu agents"}),x.managed.map(j=>e.jsx(kt,{target:j,selected:y,onSelect:S},j.agentId)),x.deviceTargets.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"my-1 h-px bg-border"}),e.jsx("p",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Devices"}),x.deviceTargets.map(j=>e.jsx(kt,{target:j,selected:y,onSelect:S},`${j.executionTarget.deviceWorkerId}:${j.executionTarget.agentKind}`))]}):null]})]}),e.jsxs(U,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",disabled:!y||!i.trim(),onClick:C,children:[e.jsx(Wn,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})})}function kt({target:t,selected:n,onSelect:o}){const s=n?Ke(n)===Ke(t):!1;return e.jsxs("button",{type:"button",className:O("flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent",s&&"bg-accent"),onClick:()=>o(t),children:[t.kind==="device"?e.jsx($t,{className:"h-4 w-4 shrink-0"}):e.jsx(Rt,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t.label})]})}const ot=h.createContext(null);function yo({organizationId:t,isWorkspaceLoading:n,children:o}){const{data:s=[],isLoading:a}=Qn(t);return e.jsx(ot.Provider,{value:{groups:s,isLoading:!!n||a},children:o})}function bo(){const t=h.useContext(ot);if(!t)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return t}function jo(){return h.useContext(ot)}function wo(t){const{parse:n,serialize:o,filterKeys:s,clearClassifications:a=!0,merge:r}=t,d=me(),c=st(),u=h.useMemo(()=>{const f=Object.entries(c.search||{}).filter(v=>v[1]!==void 0&&v[1]!==null),p=new URLSearchParams(f);return n(p)},[c.search,n]),i=h.useCallback(f=>{const p=r?r(u,f):{...u,...f},v=o(p),g={};for(const[x,k]of Object.entries(c.search||{}))k!=null&&(g[x]=k);for(const x of s)delete g[x];if(a)for(const x of Object.keys(g))x.startsWith("clf_")&&delete g[x];for(const[x,k]of Object.entries(v))k!==void 0&&(g[x]=k);d({to:c.pathname,search:g,replace:!0})},[u,o,s,a,r,d,c]),m=h.useCallback(()=>{const f={};for(const[p,v]of Object.entries(c.search||{}))v!=null&&(s.includes(p)||a&&p.startsWith("clf_")||(f[p]=v));d({to:c.pathname,search:f,replace:!0})},[d,c.pathname,c.search,s,a]);return{filters:u,updateFilters:i,clearFilters:m}}function nn(t){const{slug:n}=Yn();return Xn({queryKey:["schedules",n,t],queryFn:async()=>((await Zn("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===t),enabled:!!n&&!!t,staleTime:3e4})}function No(t,n){if(t.length===0)return"";const o=t.map(s=>{const a=n.find(r=>r.id===s);return a?Je(a):null}).filter(s=>s!=null);return o.length===0?`Filtered by connection${t.length>1?"s":""} #${t.join(", #")}`:o.length===1?`From ${o[0]}`:`From ${o.join(", ")}`}function So(t,n){if(t.length===0)return"";const s=t.map(a=>{const r=n.find(u=>u.id===a);if(!r)return null;const d=r.connection_name?.trim()||r.connector_name||r.connector_key||`connection #${r.connection_id}`,c=r.display_name?.trim()||r.feed_key||`feed #${r.id}`;return`${d} · ${c}`}).filter(a=>a!=null);return s.length===0?`Filtered by feed${t.length>1?"s":""} #${t.join(", #")}`:s.length===1?`From ${s[0]}`:`From ${s.join("; ")}`}function ko(t,n){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(n.connection_id)},search:{feedId:n.id}}}function Co(t,n){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(n.id)}}}function _o(t,n){return{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n}}}function Ct(t,n){return{to:"/$owner/events",params:{owner:t},search:{agent:n}}}function To(t,n){return{to:"/$owner/automations/$automationId",params:{owner:t,automationId:n}}}function Io(t,n,o){return{to:"/$owner/events",params:{owner:t},search:{agent:n,schedule:o}}}function Ao({text:t,sourceLink:n,details:o,onClear:s}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm",children:[e.jsx(Jn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),n?e.jsxs(Y,{to:n.to,params:n.params,search:n.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[e.jsx("span",{className:"truncate",children:t}),e.jsx(es,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):e.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t}),o,e.jsx(U,{variant:"ghost",size:"icon",className:"ml-auto h-5 w-5 shrink-0",onClick:s,"aria-label":"Clear filter",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]})}function Do({ownerSlug:t,clientIds:n,linkedUser:o,linkedUserEntitySlug:s}){const a=t&&s?qn(t,[{entity_type:"$member",slug:s}]):null;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:n.length===1?"Client ID":"Client IDs"}),n.map(r=>e.jsx("code",{className:"break-all text-foreground",children:r},r))]}),o?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?e.jsx(Y,{to:a,className:"font-medium text-foreground hover:underline",children:o}):e.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ke(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function $e(t,n,o){const s=new Set;for(const[a,r]of Object.entries(t.feeds_schema??{})){if(o&&!o.has(a))continue;const d=ke(ke(r)?.eventKinds);if(d)for(const[c,u]of Object.entries(d)){if(!n){s.add(c);continue}const i=ke(u)?.attributions;Array.isArray(i)&&i.some(m=>{const f=ke(ke(m)?.target);return typeof f?.entityType=="string"&&n.has(f.entityType)})&&s.add(c)}}return s}function Lo({connectors:t,entityTypes:n,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const r=new Set,d=new Set(o),c=new Set(a),u=new Map;for(const i of s){const m=u.get(i.connectorKey)??new Set;m.add(i.feedKey),u.set(i.connectorKey,m)}if(u.size>0)for(const i of t){const m=u.get(i.key);if(m)for(const f of $e(i,void 0,m))r.add(f)}else if(d.size>0){for(const i of t)if(d.has(i.key))for(const m of $e(i))r.add(m)}else if(c.size>0){for(const i of n)if(c.has(i.slug))for(const m of Object.keys(i.event_kinds??{}))r.add(m);for(const i of t)for(const m of $e(i,c))r.add(m)}else{for(const i of n)for(const m of Object.keys(i.event_kinds??{}))r.add(m);for(const i of t)for(const m of $e(i))r.add(m)}return[...r].sort((i,m)=>i.localeCompare(m))}function Eo({connectors:t,selectedKeys:n,onToggle:o,label:s="Connectors",searchPlaceholder:a="Search connectors...",emptyText:r="No connectors found"}){return e.jsx(he,{contentClassName:"w-80",searchPlaceholder:a,emptyText:r,trigger:()=>e.jsxs(U,{variant:"outline",className:"h-9",children:[s,n.length>0&&e.jsx(_e,{variant:"secondary",className:"ml-2 h-5 px-1.5",children:n.length})]}),children:()=>t.map(d=>e.jsxs(q,{onSelect:()=>o(d.key),children:[e.jsx(Kt,{checked:n.includes(d.key),className:"mr-3"}),e.jsx(ts,{connector:d,className:"flex-1"}),typeof d.count=="number"&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:d.count.toLocaleString()})]},d.key))})}function Fo(t){const{orgContext:n}=Vt(),{data:o=[],isLoading:s}=Bt(n);return{visible:h.useMemo(()=>o.filter(r=>!ns(r)&&(!r.organization_slug||r.organization_slug===t)),[o,t]),isTypesLoading:s}}function be(){return st().search??{}}function Po({ownerSlug:t,typeScope:n,agentScope:o,connectionScope:s,feedScope:a,visibility:r="all"}){const d=be(),c=typeof d.type=="string"&&d.type.trim()?d.type.trim():void 0,u=n??(c?Ce(c):void 0),i=o??zt(d),m=s??ss(d),f=a??(typeof d.feed_ids=="string"?d.feed_ids:typeof d.feed_ids=="number"?String(d.feed_ids):void 0),p=k=>r==="all"||(r==="active"?k:!k),v=p(!!u),g=p(!!i),x=p(!!(m||f));return!v&&!g&&!x?null:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[v?e.jsx(Mo,{ownerSlug:t,typeScope:u}):null,g?e.jsx($o,{ownerSlug:t,agentScope:i}):null,x?e.jsx(Ro,{ownerSlug:t,connectionScope:m,feedScope:f}):null]})}const Le=h.forwardRef(function({open:n,label:o,value:s,disabled:a,disabledReason:r,...d},c){const u=e.jsxs(U,{ref:c,variant:"outline",disabled:a,"aria-expanded":n,className:"h-9 gap-1.5 rounded-md bg-muted px-3 py-2 text-sm font-normal",...d,children:[e.jsx("span",{className:"text-muted-foreground",children:o}),s?e.jsx("span",{className:"max-w-[10rem] truncate font-medium",children:s}):e.jsx("span",{className:"text-muted-foreground",children:"Any"}),e.jsx(ze,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]});return a&&r?e.jsxs(is,{children:[e.jsx(cs,{asChild:!0,children:e.jsx("span",{className:"inline-flex",children:u})}),e.jsx(ls,{children:r})]}):u});function Mo({ownerSlug:t,typeScope:n}){const o=me(),s=be(),{visible:a}=Fo(t),r=a.find(u=>u.slug===n),d=u=>{o(le(t,s,{entity:void 0,create:void 0,type:u}))},c=()=>{o(le(t,s,{type:void 0}))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search types...",emptyText:"No entity types",trigger:u=>e.jsx(Le,{open:u,label:"Type",value:r?.name}),children:u=>e.jsxs(e.Fragment,{children:[n?e.jsx(q,{onSelect:()=>{c(),u()},className:"text-muted-foreground",children:"Clear type"}):null,a.map(i=>e.jsxs(q,{onSelect:()=>{d(i.slug),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(i.slug===n)}),e.jsx(Gt,{icon:i.icon,className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),typeof i.entity_count=="number"?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.entity_count}):null,e.jsx(at,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:i.slug},label:i.name})]},i.id)),e.jsxs(q,{onSelect:()=>{o(os(t)),u()},className:"text-muted-foreground",children:[e.jsx(Ut,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})})}function $o({ownerSlug:t,agentScope:n}){const o=me(),s=be(),{data:a=[]}=Be(),r=h.useMemo(()=>[...a].sort((i,m)=>i.name.localeCompare(m.name)),[a]),d=r.find(i=>i.agentId===n),c=i=>{o(le(t,s,_t(s,i)))},u=()=>{o(le(t,s,_t(s,void 0)))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search agents...",emptyText:"No agents",trigger:i=>e.jsx(Le,{open:i,label:"Agent",value:d?.name}),children:i=>e.jsxs(e.Fragment,{children:[n?e.jsx(q,{onSelect:()=>{u(),i()},className:"text-muted-foreground",children:"Clear agent"}):null,r.map(m=>e.jsxs(q,{onSelect:()=>{c(m.agentId),i()},className:"gap-2",children:[e.jsx(Ie,{className:Ee(m.agentId===n)}),e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:m.name.trim().charAt(0).toUpperCase()||"?"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m.name})]},m.agentId))]})})}function _t(t,n){const o={agent:n,automation:void 0,schedule:void 0,platforms:void 0};return t.schedule!=null&&(o.run_ids=void 0),typeof t.platforms=="string"&&t.platforms.trim().length>0&&(o.connection_ids=void 0,o.feed_ids=void 0),o}function Ro({ownerSlug:t,connectionScope:n,feedScope:o}){const{groups:s}=bo(),a=h.useMemo(()=>new Set((n??"").split(",").map(u=>u.trim()).filter(Boolean)),[n]),r=as(s,a),d=s.find(u=>u.connector_key===r),c=a.size===1?Number([...a][0]):void 0;return e.jsxs(e.Fragment,{children:[e.jsx(Oo,{ownerSlug:t,groups:s,scopedGroup:d}),d?e.jsx(Ko,{ownerSlug:t,group:d,selectedIds:a}):null,c?e.jsx(Vo,{ownerSlug:t,connectionId:c,feedScope:o}):null]})}function Oo({ownerSlug:t,groups:n,scopedGroup:o}){const s=me(),a=be(),r=u=>{const i=u.connections.map(m=>String(m.id)).join(",");i&&s(le(t,a,{connection_ids:i,feed_ids:void 0}))},d=()=>{s(le(t,a,{connection_ids:void 0,feed_ids:void 0}))},c=o?.connector_name??o?.connector_key;return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search connectors...",emptyText:"No connectors",trigger:u=>e.jsx(Le,{open:u,label:"Connector",value:c}),children:u=>e.jsxs(e.Fragment,{children:[o?e.jsx(q,{onSelect:()=>{d(),u()},className:"text-muted-foreground",children:"Clear connector"}):null,n.map(i=>{const m=i.connector_name??i.connector_key;return e.jsxs(q,{disabled:i.connections.length===0,onSelect:()=>{r(i),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(i.connector_key===o?.connector_key)}),e.jsx(ds,{plain:!0,name:m,faviconDomain:i.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m}),i.connection_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.connection_count}):null,e.jsx(at,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:i.connector_key},label:m})]},i.connector_key)}),e.jsx(Bo,{to:"/$owner/connectors/create",params:{owner:t},label:"Add connector",onSelect:u})]})})}function Ko({ownerSlug:t,group:n,selectedIds:o}){const s=me(),a=be(),r=o.size===1?n.connections.find(u=>o.has(String(u.id))):void 0,d=u=>{s(le(t,a,{connection_ids:String(u),feed_ids:void 0}))},c=r?Je({display_name:r.display_name,connector_name:n.connector_name,connector_key:n.connector_key}):"All connections";return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search connections...",emptyText:"No connections",trigger:u=>e.jsx(Le,{open:u,label:"Connection",value:c}),children:u=>n.connections.map(i=>{const m=Je({display_name:i.display_name,connector_name:n.connector_name,connector_key:n.connector_key});return e.jsxs(q,{onSelect:()=>{d(i.id),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(o.has(String(i.id)))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m}),i.feed_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.feed_count}):null,e.jsx(at,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(i.id)},label:m})]},i.id)})})}function Vo({ownerSlug:t,connectionId:n,feedScope:o}){const s=me(),a=be(),{data:r=[],isLoading:d}=us(n),c=h.useMemo(()=>new Set((o??"").split(",").map(f=>f.trim()).filter(Boolean)),[o]),u=c.size===1?r.find(f=>c.has(String(f.id))):void 0,i=f=>{s(le(t,a,{connection_ids:String(n),feed_ids:String(f.id)}))},m=()=>{s(le(t,a,{connection_ids:String(n),feed_ids:void 0}))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search feeds...",emptyText:d?"Loading feeds...":"No feeds",trigger:f=>e.jsx(Le,{open:f,label:"Feed",value:u?Tt(u):void 0}),children:f=>e.jsxs(e.Fragment,{children:[c.size>0?e.jsx(q,{onSelect:()=>{m(),f()},className:"text-muted-foreground",children:"Clear feed"}):null,r.map(p=>e.jsxs(q,{onSelect:()=>{i(p),f()},className:"gap-2",children:[e.jsx(Ie,{className:Ee(c.has(String(p.id)))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:Tt(p)})]},p.id))]})})}function Tt(t){return t.display_name?.trim()||t.feed_key}function at({to:t,params:n,label:o}){return e.jsx(Y,{to:t,params:n,onClick:s=>s.stopPropagation(),onPointerDown:s=>s.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 ${o}`,children:e.jsx(rs,{className:"h-3.5 w-3.5"})})}function Bo({to:t,params:n,label:o,onSelect:s}){return e.jsx(q,{asChild:!0,onSelect:s,className:"text-muted-foreground",children:e.jsxs(Y,{to:t,params:n,className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4 shrink-0"}),o]})})}function Ee(t){return t?"h-4 w-4 shrink-0 opacity-100":"h-4 w-4 shrink-0 opacity-0"}function zo({value:t,onChange:n,onClear:o,placeholder:s="Pick a date range",className:a,align:r="start"}){const d=t?.from!=null,c=d&&o!=null;return e.jsxs("div",{className:O("relative grid gap-2",a),children:[e.jsxs(Pt,{children:[e.jsx(Mt,{asChild:!0,children:e.jsxs(U,{id:"date",variant:"outline",className:O("relative w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!d&&"text-muted-foreground",c&&"pr-8"),children:[e.jsx(ms,{className:"mr-2 h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t?.from?t.to?e.jsxs(e.Fragment,{children:[He(t.from,"LLL dd, y")," -"," ",He(t.to,"LLL dd, y")]}):He(t.from,"LLL dd, y"):s})]})}),e.jsx(Ot,{className:"w-auto p-0",align:r,children:e.jsx(fo,{initialFocus:!0,mode:"range",defaultMonth:t?.from,selected:t,onSelect:n,numberOfMonths:2})})]}),c&&e.jsx("button",{type:"button","aria-label":"Clear date range",onClick:o,className:"absolute right-2 top-1/2 z-10 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]})}var sn=["PageUp","PageDown"],on=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],an={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},je="Slider",[et,Go,Uo]=ps(je),[rt]=vs(je,[Uo]),[Wo,Fe]=rt(je),it=h.forwardRef((t,n)=>{const{name:o,min:s=0,max:a=100,step:r=1,orientation:d="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:i=[s],value:m,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:v=!1,form:g,...x}=t,k=h.useRef(new Set),y=h.useRef(0),S=h.useRef(!1),j=d==="horizontal"?Ho:Qo,[D=[],T]=fs({prop:m,defaultProp:i,onChange:E=>{[...k.current][y.current]?.focus({preventScroll:!0,focusVisible:S.current}),S.current=!1,f(E)}}),w=h.useRef(D);function W(E){const $=qo(D,E);J(E,$)}function ae(E){J(E,y.current)}function re(){const E=w.current[y.current];D[y.current]!==E&&p(D)}function J(E,$,{commit:H}={commit:!1}){const ie=na(r),B=sa(Math.round((E-s)/r)*r+s,ie),A=Wt(B,[s,a]);T((M=[])=>{const z=Xo(M,A,$);if(ta(z,u*r)){y.current=z.indexOf(A);const G=String(z)!==String(M);return G&&H&&p(z),G?z:M}else return M})}return e.jsx(Wo,{scope:t.__scopeSlider,name:o,disabled:c,min:s,max:a,valueIndexToChangeRef:y,thumbs:k.current,values:D,orientation:d,form:g,children:e.jsx(et.Provider,{scope:t.__scopeSlider,children:e.jsx(et.Slot,{scope:t.__scopeSlider,children:e.jsx(j,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:ye(x.onPointerDown,()=>{c||(w.current=D,S.current=!1)}),min:s,max:a,inverted:v,onSlideStart:c?void 0:W,onSlideMove:c?void 0:ae,onSlideEnd:c?void 0:re,onHomeKeyDown:()=>{c||(S.current=!0,J(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(S.current=!0,J(a,D.length-1,{commit:!0}))},onStepKeyDown:({event:E,direction:$})=>{if(!c){S.current=!0;const B=sn.includes(E.key)||E.shiftKey&&on.includes(E.key)?10:1,A=y.current,M=D[A],z=r*B*$;J(M+z,A,{commit:!0})}}})})})})});it.displayName=je;var[rn,cn]=rt(je,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ho=h.forwardRef((t,n)=>{const{min:o,max:s,dir:a,inverted:r,onSlideStart:d,onSlideMove:c,onSlideEnd:u,onStepKeyDown:i,...m}=t,[f,p]=h.useState(null),v=De(n,C=>p(C)),g=h.useRef(void 0),x=hs(a),k=x==="ltr",y=k&&!r||!k&&r;function S(C){const j=g.current||f.getBoundingClientRect(),D=[0,j.width],w=ct(D,y?[o,s]:[s,o]);return g.current=j,w(C-j.left)}return e.jsx(rn,{scope:t.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:e.jsx(ln,{dir:x,"data-orientation":"horizontal",...m,ref:v,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const j=S(C.clientX);d?.(j)},onSlideMove:C=>{const j=S(C.clientX);c?.(j)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:C=>{const D=an[y?"from-left":"from-right"].includes(C.key);i?.({event:C,direction:D?-1:1})}})})}),Qo=h.forwardRef((t,n)=>{const{min:o,max:s,inverted:a,onSlideStart:r,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...i}=t,m=h.useRef(null),f=De(n,m),p=h.useRef(void 0),v=!a;function g(x){const k=p.current||m.current.getBoundingClientRect(),y=[0,k.height],C=ct(y,v?[s,o]:[o,s]);return p.current=k,C(x-k.top)}return e.jsx(rn,{scope:t.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:e.jsx(ln,{"data-orientation":"vertical",...i,ref:f,style:{...i.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const k=g(x.clientY);r?.(k)},onSlideMove:x=>{const k=g(x.clientY);d?.(k)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:x=>{const y=an[v?"from-bottom":"from-top"].includes(x.key);u?.({event:x,direction:y?-1:1})}})})}),ln=h.forwardRef((t,n)=>{const{__scopeSlider:o,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:d,onEndKeyDown:c,onStepKeyDown:u,...i}=t,m=Fe(je,o);return e.jsx(Ae.span,{...i,ref:n,onKeyDown:ye(t.onKeyDown,f=>{f.key==="Home"?(d(f),f.preventDefault()):f.key==="End"?(c(f),f.preventDefault()):sn.concat(on).includes(f.key)&&(u(f),f.preventDefault())}),onPointerDown:ye(t.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),m.thumbs.has(p)?p.focus({preventScroll:!0,focusVisible:!1}):s(f)}),onPointerMove:ye(t.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&a(f)}),onPointerUp:ye(t.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),r(f))})})}),dn="SliderTrack",un=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(dn,o);return e.jsx(Ae.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:n})});un.displayName=dn;var tt="SliderRange",mn=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(tt,o),r=cn(tt,o),d=h.useRef(null),c=De(n,d),u=a.values.length,i=a.values.map(p=>bn(p,a.min,a.max)),m=u>1?Math.min(...i):0,f=100-Math.max(...i);return e.jsx(Ae.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...s,ref:c,style:{...t.style,[r.startEdge]:m+"%",[r.endEdge]:f+"%"}})});mn.displayName=tt;var fn="SliderThumb",[Yo,pn]=rt(fn),hn="SliderThumbProvider";function xn(t){const{__scopeSlider:n,name:o,children:s,internal_do_not_use_render:a}=t,r=Fe(hn,n),d=Go(n),[c,u]=h.useState(null),i=h.useMemo(()=>c?d().findIndex(k=>k.ref.current===c):-1,[d,c]),m=xs(c),f=c?!!r.form||!!c.closest("form"):!0,p=r.values[i],v=o??(r.name?r.name+(r.values.length>1?"[]":""):void 0),g=p===void 0?0:bn(p,r.min,r.max);h.useEffect(()=>{if(c)return r.thumbs.add(c),()=>{r.thumbs.delete(c)}},[c,r.thumbs]);const x={value:p,name:v,form:r.form,isFormControl:f,index:i,thumb:c,onThumbChange:u,percent:g,size:m};return e.jsx(Yo,{scope:n,...x,children:oa(a)?a(x):s})}xn.displayName=hn;var Re="SliderThumbTrigger",gn=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(Re,o),r=cn(Re,o),{index:d,value:c,percent:u,size:i,onThumbChange:m}=pn(Re,o),f=De(n,x=>m(x)),p=Zo(d,a.values.length),v=i?.[r.size],g=v?Jo(v,u,r.direction):0;return e.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[r.startEdge]:`calc(${u}% + ${g}px)`},children:e.jsx(et.ItemSlot,{scope:o,children:e.jsx(Ae.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:c===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{a.valueIndexToChangeRef.current=d})})})})});gn.displayName=Re;var nt=h.forwardRef((t,n)=>{const{__scopeSlider:o,name:s,...a}=t;return e.jsx(xn,{__scopeSlider:o,name:s,internal_do_not_use_render:({index:r,isFormControl:d})=>e.jsxs(e.Fragment,{children:[e.jsx(gn,{...a,ref:n,__scopeSlider:o}),d?e.jsx(yn,{__scopeSlider:o},r):null]})})});nt.displayName=fn;var vn="SliderBubbleInput",yn=h.forwardRef(({__scopeSlider:t,...n},o)=>{const{value:s,name:a,form:r}=pn(vn,t),d=h.useRef(null),c=De(d,o),u=gs(s);return h.useEffect(()=>{const i=d.current;if(!i)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(u!==s&&p){const v=new Event("input",{bubbles:!0});p.call(i,s),i.dispatchEvent(v)}},[u,s]),e.jsx(Ae.input,{style:{display:"none"},name:a,form:r,...n,ref:c,defaultValue:s})});yn.displayName=vn;function Xo(t=[],n,o){const s=[...t];return s[o]=n,s.sort((a,r)=>a-r)}function bn(t,n,o){const r=100/(o-n)*(t-n);return Wt(r,[0,100])}function Zo(t,n){return n>2?`Value ${t+1} of ${n}`:n===2?["Minimum","Maximum"][t]:void 0}function qo(t,n){if(t.length===1)return 0;const o=t.map(a=>Math.abs(a-n)),s=Math.min(...o);return o.indexOf(s)}function Jo(t,n,o){const s=t/2,r=ct([0,50],[0,s]);return(s-r(n)*o)*o}function ea(t){return t.slice(0,-1).map((n,o)=>t[o+1]-n)}function ta(t,n){if(n>0){const o=ea(t);return Math.min(...o)>=n}return!0}function ct(t,n){return o=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const s=(n[1]-n[0])/(t[1]-t[0]);return n[0]+s*(o-t[0])}}function na(t){if(!Number.isFinite(t))return 0;const n=t.toString();if(n.includes("e")){const[s,a]=n.split("e"),r=s.split(".")[1]||"",d=Number(a);return Math.max(0,r.length-d)}const o=n.split(".")[1];return o?o.length:0}function sa(t,n){const o=Math.pow(10,n);return Math.round(t*o)/o}function oa(t){return typeof t=="function"}const jn=h.forwardRef(({className:t,...n},o)=>e.jsxs(it,{ref:o,className:O("relative flex w-full touch-none select-none items-center",t),...n,children:[e.jsx(un,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(mn,{className:"absolute h-full bg-primary"})}),e.jsx(nt,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"}),n.value&&n.value.length>1&&e.jsx(nt,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));jn.displayName=it.displayName;const aa=["notification"],ra=["note","summary","decision","observation","fact","change","preference","identity"],ia=[...aa,...ra],ca="date-desc",It=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],At=[{value:"all",label:"Any reviewer"},{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],Dt=[{value:"all",label:"Any status"},{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}];function Ye(t,n){return e.jsxs("span",{className:"truncate",children:[e.jsxs("span",{className:"text-muted-foreground",children:[t,": "]}),n]})}function Ve(t){const n=t.replace(/[_-]+/g," ").trim();return n.length>0?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:t}function la({options:t,selected:n,onChange:o}){return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",trigger:s=>e.jsxs(U,{variant:"outline","aria-expanded":s,className:"h-9 rounded-md bg-muted px-3 py-2 font-normal",children:["Kind",n.length>0?e.jsx(_e,{variant:"secondary",className:"h-5 px-1.5",children:n.length}):null]}),children:()=>t.map(s=>{const a=n.includes(s);return e.jsxs(q,{value:`${Ve(s)} ${s}`,onSelect:()=>o(a?n.filter(r=>r!==s):[...n,s]),children:[e.jsx(Kt,{checked:a,className:"mr-1"}),Ve(s)]},s)})})}function wn({"aria-label":t,onClick:n}){return e.jsx("button",{type:"button","aria-label":t,onClick:o=>{o.preventDefault(),o.stopPropagation(),n()},className:"rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})}function Xe({value:t,onValueChange:n,onClear:o,showClear:s,triggerClassName:a,displayValue:r,children:d}){return e.jsxs("div",{className:"relative shrink-0",children:[e.jsxs(ws,{value:t,onValueChange:n,children:[e.jsx(Ns,{className:O("px-2.5",s&&"pr-9",a),children:e.jsx(Ss,{children:r})}),e.jsx(ks,{children:d})]}),s&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-8 flex items-center",children:e.jsx("div",{className:"pointer-events-auto",children:e.jsx(wn,{"aria-label":"Clear filter",onClick:o})})})]})}function da({filters:t,onFiltersChange:n,connectors:o,eventKinds:s=[],searchQuery:a,onSearchChange:r,hideSourceFilter:d=!1,ownerSlug:c,total:u,isListLoading:i=!1,hasCursorInUrl:m=!1,onGoToLatest:f,open:p,onOpenChange:v,leading:g}){const x=a.trim().length>0,[k,y]=h.useState(x),S=p??k,C=v??y,j=t.dateRange?{from:t.dateRange[0],to:t.dateRange[1]}:void 0,D=N=>{N?.from&&N?.to?n({dateRange:[N.from,N.to]}):n({dateRange:null})},T=N=>{const X=t.platforms||[],_=X.includes(N)?X.filter(ue=>ue!==N):[...X,N];n({platforms:_})},w=`${t.sortBy??"date"}-${t.sortOrder??"desc"}`,W=t.reviewStatus||"all",ae=t.interactionStatus||"all",re=!!(t.dateRange?.[0]&&t.dateRange?.[1]),J=(t.engagementRange?.[0]??0)!==0||(t.engagementRange?.[1]??100)!==100,E=(t.platforms?.length??0)>0,$=t.semanticTypes??[],H=$.length>0,ie=!!(t.reviewStatus&&t.reviewStatus!=="all"),B=!!(t.interactionStatus&&t.interactionStatus!=="all"),A=(x?1:0)+(re?1:0)+(E?1:0)+(H?1:0)+(ie?1:0)+(B?1:0)+(J?1:0),M=s.length>0?s:ia,z=[...new Set([...M,...$])].sort((N,X)=>Ve(N).localeCompare(Ve(X))),G=It.find(N=>N.value===w)?.label??"Newest first",ee=At.find(N=>N.value===W)?.label??"Any reviewer",Q=Dt.find(N=>N.value===ae)?.label??"Any status",ne=e.jsxs("div",{className:"relative w-52 shrink-0",children:[e.jsx(ys,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(bs,{placeholder:d?"Search events...":"Search...",value:a,onChange:N=>r(N.target.value),className:O("pl-9",x&&"pr-8")}),x&&e.jsx("div",{className:"absolute inset-y-0 right-2 flex items-center",children:e.jsx(wn,{"aria-label":"Clear search",onClick:()=>r("")})})]}),fe=e.jsx(Xe,{value:w,onValueChange:N=>{const[X,_]=N.split("-");n({sortBy:X,sortOrder:_})},onClear:()=>n({sortBy:void 0,sortOrder:void 0}),showClear:w!==ca,triggerClassName:"w-[168px]",displayValue:Ye("Sort",G),children:It.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),de=e.jsx(Xe,{value:W,onValueChange:N=>n({reviewStatus:N}),onClear:()=>n({reviewStatus:void 0}),showClear:W!=="all",triggerClassName:"w-[186px]",displayValue:Ye("Review",ee),children:At.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),xe=e.jsx(Xe,{value:ae,onValueChange:N=>n({interactionStatus:N==="all"?null:N}),onClear:()=>n({interactionStatus:null}),showClear:ae!=="all",triggerClassName:"w-[178px]",displayValue:Ye("Approval",Q),children:Dt.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),we=e.jsxs("div",{className:"w-72 space-y-2 px-1 py-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Engagement score"}),e.jsxs("span",{className:"text-muted-foreground",children:[t.engagementRange?.[0]??0," –"," ",t.engagementRange?.[1]??100]})]}),e.jsx(jn,{value:t.engagementRange||[0,100],onValueChange:N=>n({engagementRange:N}),min:0,max:100,step:5})]}),K=e.jsx(la,{options:z,selected:$,onChange:N=>n({semanticTypes:N.length>0?N:void 0})});return e.jsxs(Ht,{open:S,onOpenChange:C,className:"w-full",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 text-sm text-muted-foreground",children:[g,i?e.jsx(Qt,{className:"h-4 w-20"}):u!=null&&u>0?e.jsx("span",{children:`${u.toLocaleString()} items`}):e.jsx("span",{}),!i&&u!=null&&u>0&&m&&f&&e.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 gap-1",onClick:f,children:[e.jsx(js,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[fe,e.jsx(Yt,{asChild:!0,children:e.jsxs(U,{variant:"outline",className:"h-9 rounded-md bg-muted px-3 py-2 font-normal",children:["Filters",A>0?e.jsx(_e,{variant:"secondary",className:"ml-1.5 h-5 px-1.5 text-[11px]",children:A}):null,e.jsx(ze,{className:O("ml-1 h-4 w-4 transition-transform",S&&"rotate-180")})]})})]})]}),e.jsx(Xt,{className:"pt-2.5",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-2.5 border-t pt-3",children:[ne,d&&c?e.jsx(Po,{ownerSlug:c,visibility:"all"}):null,!d&&o.length>0?e.jsx(Eo,{connectors:o,selectedKeys:t.platforms||[],onToggle:T}):null,e.jsx(zo,{value:j,onChange:D,onClear:()=>n({dateRange:null}),placeholder:"Date range",className:"w-auto shrink-0"}),K,de,xe,we,A>0&&e.jsx(U,{type:"button",variant:"ghost",size:"sm",className:"h-9 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{r(""),n({dateRange:null,platforms:void 0,semanticTypes:void 0,reviewStatus:void 0,interactionStatus:null,engagementRange:void 0})},children:"Clear all"})]})})]})}function ua(t){const n=t instanceof Date?t:new Date(String(t));return Number.isNaN(n.getTime())?null:n}function Lt(t){return t.toISOString().split("T")[0]}function ma({entityId:t,organizationId:n,ownerSlug:o,selectedRange:s,onSelectRange:a}){const{data:r,isLoading:d,error:c}=Cs(n,{entityId:t},{slug:o}),u=h.useMemo(()=>{if(!r||r.length===0)return[];const p=r.map(y=>{const S=ua(y.date);return S?{date:S,count:y.count}:null}).filter(y=>y!==null).sort((y,S)=>y.date.getTime()-S.date.getTime());if(p.length===0)return[];const v=p[0].date;if((p[p.length-1].date.getTime()-v.getTime())/(1e3*60*60*24)>180){const y=new Map;for(const S of p){const C=new Date(S.date);C.setDate(S.date.getDate()-S.date.getDay());const j=Lt(C);y.set(j,(y.get(j)||0)+S.count)}return Array.from(y.entries()).map(([S,C])=>({date:S,count:C})).sort((S,C)=>new Date(S.date).getTime()-new Date(C.date).getTime())}return p.map(y=>({date:Lt(y.date),count:y.count}))},[r]),i=h.useCallback(p=>{if(p.name&&a){const v=new Date(p.name),g=new Date(v);g.setDate(g.getDate()+1),a(v,g)}},[a]),m=h.useCallback(p=>{if(a&&p.startValue!==void 0&&p.endValue!==void 0){const v=new Date(p.startValue),g=new Date(p.endValue);a(v,g)}},[a]),f=h.useMemo(()=>{if(u.length===0)return null;let p;if(s){const v=s[0].toISOString().split("T")[0],g=s[1].toISOString().split("T")[0];p=[[{xAxis:v},{xAxis:g}]]}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:v=>{const g=v[0];return`${new Date(g.name).toLocaleDateString()}: ${g.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:u.map(v=>v.date),axisLabel:{formatter:v=>{const g=new Date(v);return`${g.getMonth()+1}/${g.getDate()}`}}},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 po(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:u.map(v=>v.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:p?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:p}:void 0}]}},[u,s]);return d||c?e.jsx("div",{className:O(Zt,"p-4"),children:e.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:d?e.jsx(xo,{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})}):!f||u.length<2?null:e.jsx(fa,{option:f,onClick:i,onDataZoom:m})}function fa({option:t,onClick:n,onDataZoom:o}){const{chartRef:s,setOption:a}=ho({onClick:n,onDataZoom:o});return h.useEffect(()=>{a(t,!0)},[t,a]),e.jsx("div",{"data-testid":"events-timeline",className:O(Zt,"p-4 relative"),children:e.jsx("div",{ref:s,className:"h-48 w-full"})})}function pa({organizationId:t,ownerSlug:n,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,filterBarLeading:r}){const{isAuthenticated:d,isReady:c}=_s(),{isMember:u,isLoading:i}=qt(),m=c&&d&&u,f=c&&(!d||!i&&!u),p=me(),v=st(),g=Jt(v.search??{}),{filters:x,updateFilters:k,clearFilters:y}=wo({parse:zs,serialize:Us,filterKeys:Gs,merge:Ws}),[S,C]=h.useState(x.searchQuery||""),[j,D]=h.useState((x.searchQuery||"").trim().length>0),T=Ts(S,1e3),w=h.useMemo(()=>wt({...x,searchQuery:T.length>=3?T:void 0,...a?.length?{entityTypes:a}:{}}),[x,T,a]),W=k;h.useEffect(()=>{const l=T.length>=3?T:void 0;(x.searchQuery||void 0)!==l&&k({searchQuery:l})},[T,k,x.searchQuery]);const ae=()=>{C(""),y()},re=h.useMemo(()=>Is(wt({...x,searchQuery:T.length>=3?T:void 0})),[x,T]),J=o===void 0,{data:E=[]}=As(c&&m?t:null),{data:$=[]}=Ds(f?n:null),H=m?E:$,{data:ie=[]}=Bt(m&&t?{organizationId:t}:void 0),B=jo(),A=w.connectionIds,M=(A?.length??0)>0,{data:z=[]}=Ls(c&&m?t??"":"",{connectionIds:A??void 0,enabled:!B&&c&&m&&M}),G=w.feedIds,ee=(G?.length??0)>0,{data:Q=[]}=Es(c&&m?t:null,{feedIds:G??void 0,enabled:c&&m&&ee}),ne=h.useMemo(()=>B?B.groups.flatMap(l=>l.connections.map(b=>({id:b.id,display_name:b.display_name,connector_name:l.connector_name,connector_key:l.connector_key}))):z,[z,B]),fe=h.useMemo(()=>{const l=new Set(A??[]);return[...new Set([...w.platforms??[],...ne.filter(b=>l.has(b.id)).map(b=>b.connector_key)])]},[A,ne,w.platforms]),de=h.useMemo(()=>Q.map(l=>({connectorKey:l.connector_key,feedKey:l.feed_key})),[Q]),xe=h.useMemo(()=>M&&fe.length===0||ee&&de.length===0?[]:Lo({connectors:H,entityTypes:ie,selectedPlatforms:fe,selectedFeeds:de,selectedEntityTypes:w.entityTypes}),[H,w.entityTypes,M,ee,fe,de,ie]),we=h.useMemo(()=>M?No(A??[],ne):null,[A,ne,M]),K=w.clientIds,N=(K?.length??0)>0,{data:X=[]}=lo(null,{enabled:c&&m&&N}),_=h.useMemo(()=>{if(!K)return[];const l=new Set(K);return uo(X).filter(b=>b.clientIds.some(I=>l.has(I)))},[K,X]),ue=h.useMemo(()=>{if(!N||!K)return null;const l=_.map(b=>b.title);return l.length>0?`From ${l.join(", ")}`:`Filtered by client${K.length>1?" registrations":""}`},[_,K,N]),Pe=_.length===1?_[0]:null,Nn=n&&Pe?_o(n,Pe.clientId):void 0,Me=w.mcpActivityId??null,{data:lt=[]}=Fs({enabled:c&&m&&N&&!!Me,clientIds:K??[],limit:100}),Sn=h.useMemo(()=>{if(!Me)return null;const l=lt.find(I=>I.activityId===Me);if(!l)return"Selected conversation";const b=l.title?.trim();return b?`Conversation “${b}”`:l.activityKind==="session"?"MCP session":`Conversation ${l.clientId}`},[Me,lt]),kn=h.useMemo(()=>ee?So(G??[],Q):null,[G,ee,Q]),F=w.agentId,{data:dt=[]}=Be({enabled:c&&!!F}),Cn=h.useMemo(()=>{if(!F||w.automationId!=null||g||(w.platforms?.length??0)>0)return null;const l=dt.find(b=>b.agentId===F);return l?`From agent ${l.name}`:`From agent ${F}`},[F,w.platforms,w.automationId,g,dt]),se=w.automationId,{data:ut=[]}=en(F??void 0,{includeDetails:!1}),_n=h.useMemo(()=>{if(se==null)return null;const l=ut.find(b=>String(b.automation_id)===String(se));return l?`From watch “${l.name}”`:`From Automation #${se}`},[ut,se]),{data:mt=[]}=nn(F??void 0),Tn=h.useMemo(()=>{if(!g||!F)return null;const l=mt.find(b=>b.id===g);return l?.description?.trim()?`From schedule “${l.description.trim()}”`:"From scheduled task"},[F,g,mt]),Ge=h.useMemo(()=>{if(!F||se!=null||g||(w.platforms?.length??0)===0)return null;const l=w.platforms?.[0];return l?`From ${l} listen`:null},[F,w.platforms,g,se]),ge=h.useMemo(()=>{if(!n)return{};const l={};if(ee&&G?.length===1){const b=Q.find(I=>I.id===G[0]);b&&(l.feedIds=ko(n,b))}if(M&&A?.length===1){const b=ne.find(I=>I.id===A[0]);b?.connector_key&&(l.connectionIds=Co(n,{id:b.id,connector_key:b.connector_key}))}return F&&se==null&&!g&&(w.platforms?.length??0)===0&&(l.agentId=Ct(n,F)),F&&se!=null&&(l.automationId=To(n,String(se))),F&&g&&(l.schedule=Io(n,F,g)),Ge&&F&&(l.listen=Ct(n,F)),l},[F,A,ne,G,M,ee,w.platforms,Ge,n,g,se,Q]),{data:In}=Ps(c&&m?t:null,o),{data:An}=Ms(f&&!J?n:null,o),ft=m?In:An,Ue=h.useMemo(()=>{const l=new Map;for(const b of ft||[]){const I=b.automation_name??"__global__";l.has(I)||l.set(I,{automationName:b.automation_name??null,classifiers:[]});const P=l.get(I),R=b.attribute_values||{},te=Object.keys(R);let oe=null;const L={};for(const[V,ce]of Object.entries(R))if(ce.parent)for(const[ve,Se]of Object.entries(ce.parent))oe=ve,L[Se]||(L[Se]=[]),L[Se].push(V);const Z=P.classifiers.find(V=>V.slug===b.slug);if(Z){const V=new Set([...Z.values,...te]);Z.values=[...V];for(const[ce,ve]of Object.entries(L)){Z.valuesByParentValue[ce]||(Z.valuesByParentValue[ce]=[]);const Se=new Set([...Z.valuesByParentValue[ce],...ve]);Z.valuesByParentValue[ce]=[...Se]}oe&&(Z.parentSlug=oe)}else P.classifiers.push({slug:b.slug,name:b.name,values:te,parentSlug:oe,valuesByParentValue:L})}for(const b of l.values())b.classifiers.sort((I,P)=>I.parentSlug===null&&P.parentSlug!==null?-1:I.parentSlug!==null&&P.parentSlug===null?1:0);return[...l.values()]},[ft]),Dn=h.useMemo(()=>{const l=new Map(H.map(I=>[I.key,I]));return[...new Set(l.keys())].map(I=>{const P=l.get(I);return{key:I,name:P?.name||I,description:P?.description,icon:P?.icon,faviconDomain:$s(P?.auth_schema)}}).sort((I,P)=>I.name.localeCompare(P.name))},[H]),Ln=Rs(c&&m?t:null,o,w,n),En=Os(f?n:null,o,w),Fn=f?En:Ln,{data:Ne,isLoading:Pn,error:Mn}=Fn,pt=Ne?.pages[0],ht=pt?.total??0,xt=pt?.classification_stats,$n=!!(w.beforeOccurredAt||w.afterOccurredAt),gt=Ks(w),vt=Ne?.pages[Ne.pages.length-1],pe=vt?.content[vt.content.length-1];h.useEffect(()=>{!gt||!pe||Ne?.pages.length===1||x.beforeOccurredAt===pe.occurred_at&&x.beforeId===pe.id||k({beforeOccurredAt:pe.occurred_at,beforeId:pe.id})},[pe?.id,gt,k,Ne?.pages.length,pe,x.beforeOccurredAt,x.beforeId]);const Rn=h.useCallback(()=>{W({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[W]),[yt,On]=h.useState(new Set),Kn=l=>{const b=new Set(yt);b.has(l)?b.delete(l):b.add(l),On(b)},Vn=(l,b)=>{W({dateRange:[l,b]})},bt=(l,b)=>{const I=w.classificationFilters||{},P=I[l]||[],R=P.includes(b)?P.filter(oe=>oe!==b):[...P,b],te={...I};if(R.length>0)te[l]=R;else{delete te[l];for(const oe of Ue)for(const L of oe.classifiers)L.parentSlug===l&&delete te[L.slug]}W({classificationFilters:te})};if(Mn)return e.jsx(Vs,{label:"knowledge"});const We=!c||d&&i||Pn,Bn=!We&&ht===0&&!re,zn=d?m?"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",jt=!!(m&&n);return e.jsx(Bs,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 space-y-3 bg-background px-4 pb-3 lg:-mx-6 lg:px-6":void 0,children:e.jsx(da,{leading:r,open:j,onOpenChange:D,filters:w,onFiltersChange:W,connectors:Dn,eventKinds:xe,searchQuery:S,onSearchChange:C,hideSourceFilter:s,ownerSlug:n,total:ht,isListLoading:We,hasCursorInUrl:$n,onGoToLatest:Rn})}),[{key:"contentIds",label:l=>`Showing knowledge item #${l.join(", #")}`,ids:w.contentIds,clear:{contentIds:void 0}},{key:"runId",label:l=>`Filtered by Automation run #${l}`,id:w.runId,clear:{runId:void 0}},{key:"feedIds",text:kn,sourceLink:ge.feedIds,clear:{feedIds:void 0}},{key:"connectionIds",text:we,sourceLink:ge.connectionIds,clear:{connectionIds:void 0}},{key:"mcpActivityId",text:Sn,clear:{mcpActivityId:void 0}},{key:"clientIds",text:ue,sourceLink:Nn,details:K&&K.length>0?e.jsx(Do,{ownerSlug:n,clientIds:K,linkedUser:Pe?.linkedUser,linkedUserEntitySlug:Pe?.linkedUserEntitySlug}):void 0,clear:{clientIds:void 0}},{key:"automationId",text:_n,sourceLink:ge.automationId,clear:{automationId:void 0}},{key:"schedule",text:Tn,sourceLink:ge.schedule,clear:{schedule:void 0,runIds:void 0}},{key:"listen",text:Ge,sourceLink:ge.listen,clear:{platforms:void 0,connectionIds:void 0}},{key:"agentId",text:Cn,sourceLink:ge.agentId,clear:{agentId:void 0,automationId:void 0,schedule:void 0,platforms:void 0}},{key:"runIds",label:l=>`Filtered by run${l.length>1?"s":""} #${l.join(", #")}`,ids:w.runIds,clear:{runIds:void 0,schedule:void 0}}].map(l=>{const b="text"in l&&l.text?l.text:"ids"in l&&l.ids&&l.ids.length>0?l.label(l.ids):"id"in l&&l.id!=null?l.label(l.id):null;return b?e.jsx(Ao,{text:b,sourceLink:"sourceLink"in l?l.sourceLink:void 0,details:"details"in l?l.details:void 0,onClear:()=>W(l.clear)},l.key):null}).filter(Boolean),j&&m&&o&&t&&e.jsx(ma,{entityId:o,organizationId:t,ownerSlug:n||"",selectedRange:w.dateRange||void 0,onSelectRange:Vn}),Ue.length>0&&e.jsx("div",{className:"space-y-2",children:Ue.map(l=>{const b=l.automationName??"__global__",I=l.classifiers.some(R=>(w.classificationFilters?.[R.slug]?.length||0)>0),P=yt.has(b)||I;return e.jsxs(Ht,{open:P,onOpenChange:()=>Kn(b),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Yt,{asChild:!0,children:e.jsx(U,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:P?e.jsx(ze,{className:"h-3.5 w-3.5"}):e.jsx(tn,{className:"h-3.5 w-3.5"})})}),l.automationName&&e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.automationName})]}),e.jsx(Xt,{className:"space-y-1.5 mt-1.5 ml-6",children:l.classifiers.filter(R=>R.parentSlug===null).map(R=>{const te=w.classificationFilters?.[R.slug]||[],oe=l.classifiers.filter(L=>L.parentSlug===R.slug);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground shrink-0",children:R.name}),R.values.map(L=>{const Z=te.includes(L),V=xt?.[R.slug]?.[L];return e.jsxs(_e,{variant:Z?"default":"outline",className:"cursor-pointer",onClick:()=>bt(R.slug,L),children:[L,V!=null&&e.jsx("span",{className:"ml-1 opacity-60",children:V})]},L)})]}),te.length>0&&oe.map(L=>{const Z=[...new Set(te.flatMap(V=>L.valuesByParentValue[V]||[]))];return Z.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 ml-4 mt-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground shrink-0",children:L.name}),Z.map(V=>{const ce=w.classificationFilters?.[L.slug]?.includes(V),ve=xt?.[L.slug]?.[V];return e.jsxs(_e,{variant:ce?"default":"outline",className:"cursor-pointer",onClick:()=>bt(L.slug,V),children:[V,ve!=null&&e.jsx("span",{className:"ml-1 opacity-60",children:ve})]},V)})]},L.slug)})]},R.slug)})})]},b)})}),We?e.jsx("div",{className:"space-y-4",children:["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(l=>e.jsx(Qt,{className:"h-32 rounded-lg"},l))}):Bn?e.jsx(Oe,{icon:Nt,title:"No activity yet",description:zn,actionLabel:jt?"Add a connector":void 0,onAction:jt&&n?()=>void p({to:"/$owner/connectors/create",params:{owner:n}}):void 0}):e.jsx(mo,{organizationId:t,ownerSlug:n,entityId:o,filters:w,showEntityLinks:J,emptyState:e.jsx(Oe,{icon:Nt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:re?"Clear filters":void 0,onAction:re?ae:void 0})})]})})}function ha(t){const n=Hs();return e.jsx(xa,{...t,context:n},`${t.ownerSlug}:${t.attentionLens}:${Qs(n)}`)}function xa({organizationId:t,ownerSlug:n,typeScope:o,entityScope:s,agentScope:a,automationScope:r,scheduleScope:d,attentionLens:c=!1,activityTab:u="events",context:i}){const[m,f]=h.useState(c?"relevant":"activity"),p=i?m!=="activity":c,{orgContext:v}=Vt(),{isMember:g,isLoading:x}=qt(),k=g&&!!t,y=Ft(),S=u==="sessions"&&y,{attentionItems:C}=Ys(n),j=C.length,D=i?e.jsx("fieldset",{"aria-label":"Activity view",className:O("flex min-w-0 max-w-full items-center gap-1",y&&"justify-center"),children:[["relevant","Relevant here"],["attention","Needs attention"],["activity","All activity"]].map(([_,ue])=>e.jsxs("button",{type:"button","aria-pressed":m===_,onClick:()=>f(_),className:"flex min-w-0 items-center justify-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors aria-pressed:bg-muted aria-pressed:text-foreground hover:text-foreground",children:[ue,_==="attention"?e.jsx(Et,{count:j}):null]},_))}):e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>({..._??{}}),"aria-current":p?void 0:"page",className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",p?"text-muted-foreground hover:text-foreground":"bg-muted text-foreground"),children:"All activity"}),e.jsxs(Y,{to:"/$owner",params:{owner:n},search:_=>({..._??{}}),"aria-current":p?"page":void 0,className:O("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",p?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:["Needs attention",e.jsx(Et,{count:j})]})]}),{data:T=[]}=Be(),w=a?T.find(_=>_.agentId===a)?.name??a:void 0,{data:W=[]}=en(a,{includeDetails:!1}),ae=r?W.find(_=>_.automation_id===r)?.name??`Automation ${r}`:void 0,{data:re=[]}=nn(a),J=d?re.find(_=>_.id===d)?.description??"Schedule":void 0,E=o?Ce(o):void 0,{data:$,isLoading:H,error:ie}=Xs(s?`/${n}/${Zs(s)}`:p?`/${n}`:"",v),B=s?$?.entity:void 0,A=s?B?.entity_type??Ce(s.split("/").at(-2)??""):E,M=A==="$member",z=s!=null&&!H&&(ie!=null||$?.entity==null),{data:G}=qs(A??"",v),ee=x||H,Q=$?.counts,ne=Q?Q.connections>0||Q.agents>0||Q.clients>0:!1,fe=k&&!ee&&Q!=null&&!ne,de={},xe=a?{agent:a}:{},we=A?{type:A}:{},K=s?e.jsx(Ze,{icon:B?.entity_type?e.jsx(Gt,{icon:G?.icon,className:"h-4 w-4 shrink-0"}):null,typeSegment:A?{label:G?.name??Ce(A),search:we}:void 0,label:B?.name??s.split("/").slice(-1)[0],ownerSlug:n,clearSearch:{}}):r&&a?e.jsx(Ze,{typeSegment:{label:w??"Agent",search:de},label:ae??"Automation",ownerSlug:n,clearSearch:xe}):d&&a?e.jsx(Ze,{typeSegment:{label:w??"Agent",search:de},label:J??"Schedule",ownerSlug:n,clearSearch:xe}):null,N=!y&&!S&&!z,X=s&&H?e.jsx(St,{label:"Loading record…"}):z?e.jsx(Oe,{icon:Js,title:"Record not found",description:"This record no longer exists."}):e.jsx(pa,{organizationId:t,ownerSlug:n,filterBarLeading:N?D:void 0,hideSourceFilter:!0,entityId:B?.id,scopedEntityTypes:!s&&E?[E]:void 0});if(p){const _=ee?e.jsx(St,{label:"workspace setup",variant:"panel",className:"px-6 py-8"}):fe?e.jsx("div",{className:"px-6",children:e.jsx(Oe,{icon:no,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(U,{asChild:!0,children:e.jsxs(Y,{to:"/$owner/connectors/create",params:{owner:n},children:[e.jsx(so,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(U,{asChild:!0,variant:"outline",children:e.jsxs(Y,{to:"/$owner/agents",params:{owner:n},children:[e.jsx(qe,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})}):e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"Nothing needs attention right now."});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:e.jsx(eo,{context:i,relevant:m==="relevant",owner:n,emptyState:_,tabs:D})})}return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[N?null:e.jsxs("div",{className:O("sticky top-0 z-20 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 bg-background pt-1",y?"justify-center":"justify-between"),children:[D,y?e.jsxs("div",{className:"flex items-center rounded-lg bg-muted/60 p-0.5 text-xs",children:[e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>{const ue={..._??{}};return delete ue.tab,ue},"aria-current":S?void 0:"page",className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",S?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Events"}),e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>({..._??{},tab:"sessions"}),"aria-current":S?"page":void 0,className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Sessions"})]}):null]}),K&&!S?e.jsx("div",{className:"sticky top-0 z-20 flex min-w-0 flex-col gap-3 bg-background pt-1",children:K}):null,S?e.jsx(to,{owner:n,tone:"page",empty:"message"}):M?e.jsx(go,{ownerSlug:n,children:X}):X]})}function Et({count:t}){return t===0?null:e.jsx("span",{role:"img","aria-label":`${t} item${t===1?"":"s"} need attention`,className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:t})}function Ze({icon:t,typeSegment:n,label:o,ownerSlug:s,clearSearch:a}){return e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 border-l border-border/60 pb-1 pl-3 text-sm",children:[t,n?e.jsxs(e.Fragment,{children:[e.jsx(Y,{to:"/$owner/events",params:{owner:s},search:n.search,className:"shrink-0 font-medium text-muted-foreground transition-colors hover:text-foreground hover:underline",children:n.label}),e.jsx(tn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]}):null,e.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:o}),e.jsx(U,{asChild:!0,variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:e.jsxs(Y,{to:"/$owner/events",params:{owner:s},search:a,children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),"Clear"]})})]})}function Aa({owner:t,search:n,attentionLens:o,entityScope:s}){const a=typeof n.type=="string"&&n.type.trim()?Ce(n.type.trim()):void 0,r=zt(n),d=oo(n),c=Jt(n),u=n.tab==="sessions"?"sessions":"events";return e.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:e.jsx(ao,{owner:t,children:i=>e.jsx(yo,{organizationId:i.organizationId,isWorkspaceLoading:i.isWorkspaceLoading,children:e.jsxs("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:[e.jsx(ha,{organizationId:i.organizationId,ownerSlug:i.ownerSlug,typeScope:a,entityScope:s,agentScope:r,automationScope:d,scheduleScope:c,attentionLens:o,activityTab:u}),e.jsx(vo,{ownerSlug:i.ownerSlug})]})})})})}export{Aa as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cE as ae,g1 as T,an as O,ao as A,ag as ie,j as s,aj as Q,dl as le,dm as ce,dn as ue,cU as ye,cV as re,aD as oe,r as S,c7 as he,c8 as je,cl as de,L as X,df as z,X as ve,de as be,P as ke}from"./index-C2YGEKPo.js";const $={auto:0,approval:1,deny:2,disabled:2};function ee(t,n){return`${ie}/api/${t}/agent/${encodeURIComponent(n)}/permissions`}function fe(t,n){return["agent-permissions",typeof t=="string"?t:t?.slug??null,n]}function Ne(t,n,r){return ae({queryKey:fe(t,n),enabled:(r?.enabled??!0)&&!!n,queryFn:async()=>{const e=T(t??void 0),o=await O(ee(e.slug,n),{credentials:"include"});if(!o.ok)throw await A(o);return await o.json()},staleTime:3e4})}async function we(t,n,r){const e=T(t),o=await O(ee(e.slug,n),{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)});if(!o.ok)throw await A(o);const l=await o.json();if(!l.policy)throw new Error("Agent permission update did not return a policy.");return l.policy}async function Ee(t,n,r){const e=T(t),o=new URLSearchParams;o.set("resource_class",r.resource_class),r.entity_type_slug&&o.set("entity_type_slug",r.entity_type_slug),r.operation_key&&o.set("operation_key",r.operation_key),r.target_agent_id&&o.set("target_agent_id",r.target_agent_id);const l=await O(`${ee(e.slug,n)}?${o.toString()}`,{method:"DELETE",credentials:"include"});if(!l.ok)throw await A(l);return(await l.json()).deleted===!0}function te(t){return`${ie}/api/${t}/write-permissions`}function me(t){return["write-permissions",typeof t=="string"?t:t?.slug??null]}function Se(t,n){return ae({queryKey:me(t),enabled:n?.enabled??!0,queryFn:async()=>{const r=T(t??void 0),e=await O(te(r.slug),{credentials:"include"});if(!e.ok)throw await A(e);return await e.json()},staleTime:3e4})}async function $e(t,n){const r=T(t),e=await O(te(r.slug),{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)});if(!e.ok)throw await A(e);const o=await e.json();if(!o.policy)throw new Error("Org write permission update did not return a policy.");return o.policy}async function Te(t,n){const r=T(t),e=new URLSearchParams;e.set("resource_class",n.resource_class),n.entity_type_slug&&e.set("entity_type_slug",n.entity_type_slug),n.operation_key&&e.set("operation_key",n.operation_key),n.target_agent_id&&e.set("target_agent_id",n.target_agent_id);const o=await O(`${te(r.slug)}?${e.toString()}`,{method:"DELETE",credentials:"include"});if(!o.ok)throw await A(o);return(await o.json()).deleted===!0}const W={entity:["read","create","update","delete"],agent_config:["read","create","update","delete"],connector_action:["execute"],entity_schema:["create_type","update_type","delete_type","create_relationship_type","update_relationship_type","delete_relationship_type"]},Oe={entity:{read:"auto",create:"auto",update:"auto",delete:"approval"},agent_config:{read:"auto",create:"approval",update:"approval",delete:"deny"},connector_action:{execute:"auto"},entity_schema:{create_type:"auto",update_type:"auto",delete_type:"auto",create_relationship_type:"auto",update_relationship_type:"auto",delete_relationship_type:"auto"}};function Ae(t,n){return(t==="entity"||t==="agent_config")&&n==="read"?["auto","deny"]:Re[t]}const Re={entity:["auto","approval","deny"],agent_config:["auto","approval","deny"],connector_action:["auto","approval","deny","disabled"],entity_schema:["auto","approval","deny"]},pe={auto:"Auto",approval:"Approval",deny:"Deny",disabled:"Disabled"},Ce={auto:"Auto-approve",approval:"Requires approval",deny:"Deny",disabled:"Disabled"};function H(t,n){return t.effects?.[n]}function Fe(t,n){return $[t]<$[n]}function q(t,n){return $[t]!==$[n]?$[t]>$[n]?t:n:t==="deny"||n==="deny"?"deny":t}function ne(t,n,r,e,o=null,l=null){let c=null;for(const a of t){if(a.resource_class!==n||a.field_path!==null||a.entity_id!==null||a.entity_type_slug!==null&&a.entity_type_slug!==e||a.operation_key!==null&&a.operation_key!==o||a.target_agent_id!==null&&a.target_agent_id!==l)continue;const m=H(a,r);m&&(c=c===null?m:q(c,m))}return c??Oe[n]?.[r]??"deny"}function se(t,n,r,e,o=null,l=null){return t.some(c=>c.resource_class!==n||c.field_path!==null||c.entity_id!==null||c.entity_type_slug!==null&&c.entity_type_slug!==e||c.operation_key!==null&&c.operation_key!==o||c.target_agent_id!==null&&c.target_agent_id!==l?!1:H(c,r)!==void 0)}function Le(t,n,r){const e=U(t,n,null);return e?H(e,r)!==void 0:!1}function U(t,n,r,e=null,o=null){return t.find(l=>l.resource_class===n&&(l.entity_type_slug??null)===r&&(l.operation_key??null)===e&&(l.target_agent_id??null)===o)}function Pe(t,n,r,e=null,o=null){const l=U(t.agent,n,r,e,o),c={};if(!l?.effects)return c;for(const a of W[n]){const m=l.effects[a];m&&(c[a]=m)}return c}function h(t,n,r,e,o=null,l=null){const c=ne(t.floor,n,r,e,o,l),a=se(t.floor,n,r,e,o,l),m=e!==null||o!==null||l!==null?U(t.agent,n,e,o,l):void 0,j=U(t.agent,n,null);let p=null;for(const v of[j,m]){const x=v&&H(v,r);x&&(p=p===null?x:q(p,x))}return p===null?c:a?q(p,c):p}function Me(t){const{option:n,floor:r}=t;return Fe(n,r)?{disabled:!0,reason:`Below org floor (${Ce[r]})`}:{disabled:!1}}function De(t){const n=new Set;for(const e of t.agent)e.resource_class==="entity"&&e.entity_type_slug&&n.add(e.entity_type_slug);for(const e of t.floor)e.resource_class==="entity"&&e.entity_type_slug&&e.field_path===null&&e.entity_id===null&&n.add(e.entity_type_slug);const r=new Map(t.entity_types.map(e=>[e.slug,e]));return[...n].map(e=>r.get(e)??{slug:e,name:e})}function Be(t,n){return t.agent.some(r=>r.resource_class==="entity"&&r.entity_type_slug===n)}function Qe(t,n){let r=0;for(const e of W.entity){const o=h(t,"entity",e,null);h(t,"entity",e,n)!==o&&(r+=1)}return r}function qe(t){const n=new Set;for(const e of t.agent)e.resource_class==="connector_action"&&e.operation_key&&n.add(e.operation_key);for(const e of t.floor)e.resource_class==="connector_action"&&e.operation_key&&n.add(e.operation_key);const r=new Map(t.connector_operations.map(e=>[e.operation_key,e]));return[...n].map(e=>r.get(e)??{operation_key:e,name:e,connector_key:e.split("::")[0]??e,connector_name:e.split("::")[0]??e})}function Ue(t,n){return t.agent.some(r=>r.resource_class==="connector_action"&&r.operation_key===n)}function We(t,n){const r=h(t,"connector_action","execute",null),e=h(t,"connector_action","execute",null,n);return r!==e}function He(t){const n=new Set;for(const e of t.agent)e.resource_class==="agent_config"&&e.target_agent_id&&n.add(e.target_agent_id);for(const e of t.floor)e.resource_class==="agent_config"&&e.target_agent_id&&n.add(e.target_agent_id);const r=new Map(t.agents.map(e=>[e.id,e]));return[...n].map(e=>r.get(e)??{id:e,name:e})}function Je(t,n){return t.agent.some(r=>r.resource_class==="agent_config"&&r.target_agent_id===n)}function Ke(t,n){let r=0;for(const e of W.agent_config){const o=h(t,"agent_config",e,null);h(t,"agent_config",e,null,null,n)!==o&&(r+=1)}return r}const Ge={auto:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",approval:"bg-amber-500/15 text-amber-600 dark:text-amber-400",deny:"bg-red-500/15 text-red-600 dark:text-red-400",disabled:"bg-muted text-foreground"},Ve={auto:"Auto",approval:"Ask",deny:"Deny",disabled:"Off"};function Xe({options:t,value:n,floor:r,onChange:e,disabled:o,ariaLabel:l,compact:c}){return s.jsx("div",{role:"radiogroup","aria-label":l,className:Q("inline-flex shrink-0 items-stretch gap-0.5 rounded-lg border border-border bg-muted/40 p-0.5"),children:t.map(a=>{const m=Me({option:a,floor:r}),j=a===n,p=m.disabled&&!j,v=c?Ve[a]:pe[a],x=s.jsx("button",{type:"button",role:"radio","aria-checked":j,disabled:o||p,onClick:()=>{!j&&!p&&!o&&e(a)},className:Q("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",c?"min-w-[3rem] rounded-md px-2.5 py-1.5 text-xs leading-none":"min-w-[3.25rem] rounded-md px-3 py-1.5 text-sm leading-none",j?Q(Ge[a],"shadow-sm"):"text-muted-foreground hover:bg-background/60 hover:text-foreground",p&&"cursor-not-allowed opacity-40",o&&!p&&"cursor-not-allowed opacity-60"),children:v},a);return p&&m.reason?s.jsxs(le,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("span",{className:"inline-flex shrink-0",children:x})}),s.jsx(ue,{children:m.reason})]},a):x})})}const ze=[{resourceClass:"entity",title:"Entities",sub:"Defaults for every type · exceptions below"},{resourceClass:"connector_action",title:"Connector writes",sub:"Write ops only · reads follow the connection"},{resourceClass:"agent_config",title:"Agents",sub:"Read peers · create / edit / delete · exceptions below"}];function Ye(t,n,r,e,o=null,l=null){const c=ne(t.floor,n,r,e,o,l),a=se(t.floor,n,r,e,o,l)?c:"auto";return(e!==null||o!==null||l!==null)&&Le(t.agent,n,r)?q(a,h(t,n,r,null)):a}function B({response:t,resourceClass:n,action:r,entityTypeSlug:e,operationKey:o=null,targetAgentId:l=null,dimmed:c,pending:a,onSave:m}){const j=ne(t.floor,n,r,e,o,l),p=se(t.floor,n,r,e,o,l),v=h(t,n,r,e,o,l),x=Ye(t,n,r,e,o,l),w=Ae(n,r),y=e??o??l??"default",E=s.jsx("div",{className:Q("inline-flex shrink-0",c&&"opacity-45"),children:s.jsx(Xe,{options:w,value:v,floor:x,disabled:a,compact:!0,ariaLabel:`${y} ${r}`,onChange:m})});return p?s.jsxs(le,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("span",{className:"inline-flex shrink-0",children:E})}),s.jsxs(ue,{children:["Org floor ",pe[j]," — can only go stricter"]})]}):E}function Ze(t,n){const r=o=>o.resource_class===n.resource_class&&(o.entity_type_slug??null)===(n.entity_type_slug??null)&&(o.operation_key??null)===(n.operation_key??null)&&(o.target_agent_id??null)===(n.target_agent_id??null),e=t.map(o=>r(o)?n:o);return e.some(r)?e:[...e,n]}function Ie(t,n,r,e,o,l,c){const a=Pe(t,n,r,e,o);return a[l]=c,a}const Y="font-medium text-foreground hover:text-primary hover:underline";function et({type:t}){return s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(de,{icon:t.icon,className:"h-3.5 w-3.5 shrink-0"}),s.jsx("span",{className:"font-medium",children:t.name}),s.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:t.slug})]})}function Z({label:t,disabled:n,hint:r,searchPlaceholder:e,emptyText:o,children:l}){return n?s.jsxs("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:[t,r?` ${r}`:""]}):s.jsx(be,{contentClassName:"w-[min(100vw-2rem,22rem)]",searchPlaceholder:e,emptyText:o,trigger:c=>s.jsxs("button",{type:"button","aria-expanded":c,className:"flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-primary hover:bg-muted/50",children:[s.jsx(ke,{className:"h-3 w-3"}),t]}),children:c=>l(c)})}function I({pending:t,onClick:n,label:r}){return s.jsx("button",{type:"button",disabled:t,onClick:n,"aria-label":r,className:"rounded p-0.5 text-muted-foreground hover:bg-red-500/10 hover:text-red-600 disabled:opacity-50 dark:hover:text-red-400",children:s.jsx(ve,{className:"h-3 w-3"})})}function C(t,n){const c=`repeat(${t}, minmax(${10.25}rem, 1fr))`;return{gridTemplateColumns:n?`minmax(${5.5}rem, 8rem) ${c} ${1.5}rem`:`minmax(${5.5}rem, 8rem) ${c}`,minWidth:`${5.5+t*10.25+1.5+2}rem`}}function nt({owner:t,agentId:n,variant:r="agent"}){const e=r==="org-floor",o=ye(),l=Ne(t,n??"",{enabled:!e&&!!n}),c=Se(t,{enabled:e}),{data:a,isLoading:m,isError:j,error:p}=e?c:l,v=e?me(t):fe(t,n??""),x=re({mutationFn:u=>e?$e(t,u):we(t,n??"",u),onSuccess:u=>{o.setQueryData(v,f=>f&&{...f,agent:Ze(f.agent,u)}),o.invalidateQueries({queryKey:v}),e&&o.invalidateQueries({queryKey:["agent-permissions"]})},onError:u=>{oe.error(u instanceof Error?u.message:"Failed to save permission")}}),w=re({mutationFn:u=>e?Te(t,u):Ee(t,n??"",u),onSuccess:()=>{o.invalidateQueries({queryKey:v}),e&&o.invalidateQueries({queryKey:["agent-permissions"]})},onError:u=>{oe.error(u instanceof Error?u.message:"Failed to remove override")}}),y=x.isPending||w.isPending,E=S.useMemo(()=>a?De(a):[],[a]),J=S.useMemo(()=>{if(!a)return[];const u=new Set(E.map(f=>f.slug));return a.entity_types.filter(f=>!u.has(f.slug))},[a,E]),K=S.useMemo(()=>a?qe(a):[],[a]),G=S.useMemo(()=>{if(!a)return[];const u=new Set(K.map(f=>f.operation_key));return a.connector_operations.filter(f=>!u.has(f.operation_key))},[a,K]),F=S.useMemo(()=>a?He(a):[],[a]),L=S.useMemo(()=>{if(!a)return[];const u=new Set(F.map(f=>f.id));return a.agents.filter(f=>(e||f.id!==n)&&!u.has(f.id))},[a,F,n,e]);if(m)return s.jsx(he,{label:"permissions",variant:"cards",cards:2});if(j||!a)return s.jsx(je,{label:p instanceof Error?p.message:"permissions"});const g=a,P=(u,f,M,D,b=null,k=null)=>{const i=Ie(g,u,f,b,k,M,D);x.mutate({resource_class:u,effects:i,entity_type_slug:f,operation_key:b,target_agent_id:k})},ge=g.entity_types.length===0?"— none yet":J.length===0?"— all covered":null,_e=g.connector_operations.length===0?"— none installed":G.length===0?"— all covered":null,xe=L.length===0&&F.length===0?"— no other agents":L.length===0?"— all covered":null;return s.jsx("div",{className:"space-y-2",children:ze.map(u=>{const f=u.resourceClass==="entity",M=u.resourceClass==="connector_action",D=u.resourceClass==="agent_config",b=W[u.resourceClass],k=b.length;return s.jsxs("section",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-baseline gap-2 px-0.5",children:[s.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u.title}),s.jsx("span",{className:"text-[11px] text-muted-foreground",children:u.sub})]}),s.jsxs("div",{className:"",children:[s.jsxs("div",{className:"grid items-center gap-x-3 rounded-md bg-muted/50 px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",style:C(k,!0),children:[s.jsx("span",{}),b.map(i=>s.jsx("span",{className:"text-center",children:i},i)),s.jsx("span",{})]}),s.jsxs("div",{className:"grid items-center gap-x-3 px-3 py-1.5",style:C(k,!0),children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Default"}),b.map(i=>s.jsx("div",{className:"flex min-w-0 justify-center overflow-visible",children:s.jsx(B,{response:g,resourceClass:u.resourceClass,action:i,entityTypeSlug:null,pending:y,onSave:d=>P(u.resourceClass,null,i,d)})},i)),s.jsx("span",{})]}),f?E.map(i=>{const d=Be(g,i.slug),N=Qe(g,i.slug);return s.jsxs("div",{className:"grid items-center gap-x-3 px-3 py-1.5",style:C(k,!0),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(de,{icon:i.icon,className:"h-3.5 w-3.5 shrink-0"}),s.jsx(X,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:i.slug},className:Y,title:`Open ${i.name}`,children:s.jsx("span",{className:"truncate text-sm",children:i.name})}),d?N>0?s.jsxs("span",{className:"shrink-0 text-[10px] text-amber-600 dark:text-amber-400",children:[N,"≠"]}):null:s.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"floor"})]}),b.map(_=>{const R=h(g,"entity",_,i.slug)===h(g,"entity",_,null);return s.jsx("div",{className:"flex min-w-0 justify-center",children:s.jsx(B,{response:g,resourceClass:"entity",action:_,entityTypeSlug:i.slug,dimmed:R,pending:y,onSave:V=>P("entity",i.slug,_,V)})},_)}),d?s.jsx(I,{pending:y,label:`Remove ${i.name} exception`,onClick:()=>w.mutate({resource_class:"entity",entity_type_slug:i.slug})}):s.jsx("span",{})]},i.slug)}):null,M?K.map(i=>{const d=Ue(g,i.operation_key),N=We(g,i.operation_key);return s.jsxs("div",{className:"grid items-center gap-x-3 px-3 py-1.5",style:C(k,!0),children:[s.jsxs("div",{className:"flex min-w-0 flex-col gap-0",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(X,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:i.connector_key},className:Y,title:`Open ${i.connector_name}`,children:s.jsx("span",{className:"truncate font-mono text-sm",children:i.name})}),i.destructive?s.jsx("span",{className:"shrink-0 text-[10px] text-amber-600 dark:text-amber-400",children:"!"}):null,d?N?s.jsx("span",{className:"shrink-0 text-[10px] text-amber-600 dark:text-amber-400",children:"≠"}):null:s.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"floor"})]}),s.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:i.connector_name})]}),b.map(_=>s.jsx("div",{className:"flex min-w-0 justify-center",children:s.jsx(B,{response:g,resourceClass:"connector_action",action:_,entityTypeSlug:null,operationKey:i.operation_key,dimmed:!N,pending:y,onSave:R=>P("connector_action",null,_,R,i.operation_key)})},_)),d?s.jsx(I,{pending:y,label:`Remove ${i.name} exception`,onClick:()=>w.mutate({resource_class:"connector_action",operation_key:i.operation_key})}):s.jsx("span",{})]},i.operation_key)}):null,D?F.map(i=>{const d=Je(g,i.id),N=Ke(g,i.id);return s.jsxs("div",{className:"grid items-center gap-x-3 px-3 py-1.5",style:C(k,!0),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[s.jsx(X,{to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:i.id},search:{run_id:void 0},className:Y,title:`Open ${i.name}`,children:s.jsx("span",{className:"truncate text-sm",children:i.name})}),d?N>0?s.jsxs("span",{className:"shrink-0 text-[10px] text-amber-600 dark:text-amber-400",children:[N,"≠"]}):null:s.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:"floor"})]}),b.map(_=>{if(_==="create")return s.jsx("div",{className:"text-center text-[10px] text-muted-foreground",children:"—"},_);const R=h(g,"agent_config",_,null,null,i.id)===h(g,"agent_config",_,null);return s.jsx("div",{className:"flex min-w-0 justify-center",children:s.jsx(B,{response:g,resourceClass:"agent_config",action:_,entityTypeSlug:null,targetAgentId:i.id,dimmed:R,pending:y,onSave:V=>P("agent_config",null,_,V,null,i.id)})},_)}),d?s.jsx(I,{pending:y,label:`Remove ${i.name} exception`,onClick:()=>w.mutate({resource_class:"agent_config",target_agent_id:i.id})}):s.jsx("span",{})]},i.id)}):null,s.jsxs("div",{className:"border-t",children:[f?s.jsx(Z,{label:"Add type",disabled:y||J.length===0,hint:ge,searchPlaceholder:"Search types…",emptyText:"No matching types.",children:i=>J.map(d=>s.jsx(z,{value:`${d.name} ${d.slug}`,onSelect:()=>{x.mutate({resource_class:"entity",effects:{},entity_type_slug:d.slug}),i()},className:"cursor-pointer",children:s.jsx(et,{type:d})},d.slug))}):null,M?s.jsx(Z,{label:"Add operation",disabled:y||G.length===0,hint:_e,searchPlaceholder:"Search ops…",emptyText:"No matching ops.",children:i=>G.map(d=>s.jsx(z,{value:`${d.name} ${d.connector_name} ${d.operation_key}`,onSelect:()=>{x.mutate({resource_class:"connector_action",effects:{},operation_key:d.operation_key}),i()},className:"cursor-pointer",children:s.jsxs("span",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:d.name}),s.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:d.connector_name})]})},d.operation_key))}):null,D?s.jsx(Z,{label:"Add agent",disabled:y||L.length===0,hint:xe,searchPlaceholder:"Search agents…",emptyText:"No matching agents.",children:i=>L.map(d=>s.jsxs(z,{value:`${d.name} ${d.id}`,onSelect:()=>{x.mutate({resource_class:"agent_config",effects:{},target_agent_id:d.id}),i()},className:"cursor-pointer",children:[s.jsx("span",{className:"font-medium",children:d.name}),s.jsx("span",{className:"ml-1.5 font-mono text-[10px] text-muted-foreground",children:d.id})]},d.id))}):null]})]})]},u.resourceClass)})})}export{nt as A,Oe as C,Xe as P,$e as a,Te as d,Ae as e,me as o,Se as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a0 as o}from"./index-C2YGEKPo.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a0 as o}from"./index-C2YGEKPo.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a0 as o}from"./index-C2YGEKPo.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ho as r,j as t,aV as a}from"./index-C2YGEKPo.js";import{a as s}from"./agent-connect-pages-22bJIutE.js";import"./agent-client-setup-list-u6MIKBDe.js";import"./clients-CJI4gT-V.js";import"./client-rows-EJSKR6z1.js";function x(){const{owner:e,clientId:o}=r.useParams();return t.jsx(a,{owner:e,children:({ownerSlug:n})=>t.jsx(s,{owner:n,clientId:o})})}export{x as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hz as r,j as e}from"./index-C2YGEKPo.js";import{a as m}from"./agent-skills-route-CdCVU8ZJ.js";import"./agent-subpage-shell-BfomD6m2.js";import"./agent-skill-context-DjPLOCBS.js";import"./core.esm-DUExfZp5.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-D6mLqg3d.js";import"./agent-card-controls-Duh-6QNV.js";import"./switch-C1vQiKIo.js";function c(){const{owner:t,agentId:o}=r.useParams();return e.jsx(m,{owner:t,agentId:o})}export{c as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hB as o,j as e}from"./index-C2YGEKPo.js";import{a}from"./agent-guardrails-route-Duv7Rpd9.js";import"./model-selector-DfsEq1db.js";import"./agent-subpage-shell-BfomD6m2.js";import"./agent-loading-shells-D6mLqg3d.js";import"./agent-card-controls-Duh-6QNV.js";import"./switch-C1vQiKIo.js";function x(){const{owner:r,agentId:t}=o.useParams();return e.jsx(a,{owner:r,agentId:t})}export{x as component};
|