@lobu/runtime-server 23.0.0 → 24.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalogs/connectors.json +70 -6
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +1 -1
- package/dist/connectors/linkedin-inbox-adapter.js +4 -7
- package/dist/connectors/linkedin.ts +53 -34
- package/dist/connectors/reddit.ts +92 -20
- package/dist/connectors/slack.ts +1 -0
- package/dist/connectors/whatsapp-web-adapter.js +41 -11
- package/dist/connectors/whatsapp-web-helpers.ts +1 -1
- package/dist/connectors/whatsapp_web.ts +2 -2
- package/dist/connectors/x-identity.ts +5 -3
- package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
- package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
- package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
- package/dist/dependencies.bun.lock +63 -60
- package/dist/guest.bundle.js +362 -300
- package/dist/owletto/dist/assets/_-CC8cTmRg.js +3 -0
- package/dist/owletto/dist/assets/_-ksFp4zVf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DWUFSrVp.js +2 -0
- package/dist/owletto/dist/assets/_agentId-MENLoohA.js +2 -0
- package/dist/owletto/dist/assets/_automationId-BnHqdXOC.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CefXIqy2.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-C1QPGf9E.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-DinuPCUp.js +2 -0
- package/dist/owletto/dist/assets/{_deploymentId-BuUzGtVL.js → _deploymentId-BeyzVjRm.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-3L_qeL_l.js +2 -0
- package/dist/owletto/dist/assets/_name-Dgedji78.js +2 -0
- package/dist/owletto/dist/assets/_owner-DbrKma4e.js +3 -0
- package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +2 -0
- package/dist/owletto/dist/assets/_slug-ndDr_CUg.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-w17IFTtf.js → accept-invitation-CRKbM2Xy.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-CFLNukhD.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-mnTN2AZt.js → agent-card-controls-Be1Okb2C.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-Bg3hBfUV.js → agent-client-setup-list-BA8dU_C6.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-CAV-yXus.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-Bi6WvYX-.js +2 -0
- package/dist/owletto/dist/assets/{agent-guardrails-route-BOrCXcAl.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-Dqcvky-k.js → agent-loading-shells-De_2d8Lr.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-BOo_4r_4.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-CCdvtlmH.js → agent-skill-context-JLaTamGR.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BUxIswuq.js → agent-skills-route-DcK41PWj.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-BBJoyTuC.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +6 -0
- package/dist/owletto/dist/assets/agents-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CqaKGggb.js +2 -0
- package/dist/owletto/dist/assets/app._appId-Cl1fTuIt.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-BMLL4lxO.js +2 -0
- package/dist/owletto/dist/assets/automations-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/callback-DTKKsfkz.js +2 -0
- package/dist/owletto/dist/assets/{card-Djgp00r_.js → card-yU0TmNRH.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BYUZnyMp.js → claim-DJfTvlT2.js} +2 -2
- package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
- package/dist/owletto/dist/assets/{clients-D3Zbjxin.js → clients-L4K1UT8c.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-DHeyRGZI.js → code-editor-U54Gwjit.js} +2 -2
- package/dist/owletto/dist/assets/connect-4zqtnDHb.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-DTpSW1Xy.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-h9X5H1x8.js +2 -0
- package/dist/owletto/dist/assets/{connection-C3XXFEqh.js → connection-ByvKkyFm.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CIJJLDP8.js → connection-feed-detail-DWM9lTao.js} +2 -2
- package/dist/owletto/dist/assets/connections-browser-CEwYrYqt.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-8-d8hl10.js → connector-provenance-BocTm__v.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-OYDOydtz.js +2 -0
- package/dist/owletto/dist/assets/connectors-CyZpcE5f.js +2 -0
- package/dist/owletto/dist/assets/{consent-CdSvVCgx.js → consent-DdfINrVp.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BdXoZAfc.js → conversations-table-BSznfdYt.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CYvgWCuv.js → core.esm-Dr7tcIB-.js} +2 -2
- package/dist/owletto/dist/assets/create-CBGwASon.js +2 -0
- package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +2 -0
- package/dist/owletto/dist/assets/create-CwThQtd3.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-CtSSeYj3.js → create-automation-form-9T5WnoUs.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-n4qGUraE.js → cronstrue-BWFEyy_P.js} +2 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-BMp7UsMo.js → deployments-body-2xKS8gRo.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-RvUdVkj3.js → deployments-wG_8QzOF.js} +2 -2
- package/dist/owletto/dist/assets/{device-CPU6CjkJ.js → device-6z-xgsoW.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-Cwq88RMU.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-BDerBfD9.js +2 -0
- package/dist/owletto/dist/assets/entity-avatar-Cc1CuI-0.js +2 -0
- package/dist/owletto/dist/assets/entity-options-DHdMC1Lx.js +2 -0
- package/dist/owletto/dist/assets/entity-page--OkXmlNP.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-89RoK_-P.js +2 -0
- package/dist/owletto/dist/assets/event-detail-D4YZRtrA.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-B1_QUpg_.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DqpH99np.js → full-page-spinner-Cqih-8IW.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +2 -0
- package/dist/owletto/dist/assets/identity-B0nH4yiC.js +2 -0
- package/dist/owletto/dist/assets/index-4TSkcsth.js +2 -0
- package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
- package/dist/owletto/dist/assets/index-BgkhXElB.js +2 -0
- package/dist/owletto/dist/assets/index-CoW4Bz3w.js +2 -0
- package/dist/owletto/dist/assets/index-Codw-Qqi.js +2 -0
- package/dist/owletto/dist/assets/{index-BQVliQW1.js → index-DAOyXG1X.js} +2 -2
- package/dist/owletto/dist/assets/{index-B9uPN6FC.js → index-DKPwCasf.js} +2 -2
- package/dist/owletto/dist/assets/index-DMyXd3bJ.js +2 -0
- package/dist/owletto/dist/assets/index-DYCqXaMf.js +7950 -0
- package/dist/owletto/dist/assets/index-DYYZLcJ0.js +2 -0
- package/dist/owletto/dist/assets/index-DYzWV5_z.js +2 -0
- package/dist/owletto/dist/assets/index-Da6CrGEu.js +2 -0
- package/dist/owletto/dist/assets/{index-Hio-HRfo.js → index-DfyDUpuI.js} +2 -2
- package/dist/owletto/dist/assets/index-DneshLbf.js +2 -0
- package/dist/owletto/dist/assets/index-TgRS2v_F.js +2 -0
- package/dist/owletto/dist/assets/{index-ICgKp3YK.js → index-ZNlrDc_f.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DBoag_OS.js → json-diff-DFvYINBT.js} +3 -3
- package/dist/owletto/dist/assets/{list-skeleton-C_GuoxAH.js → list-skeleton-DFsEqLU1.js} +2 -2
- package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
- package/dist/owletto/dist/assets/{logout-CLGgeZB7.js → logout-BmNwoAf7.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-B2LrMWBU.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-Cjpl8EbB.js +103 -0
- package/dist/owletto/dist/assets/{model-selector-dAbDgJvx.js → model-selector-TQcA93xm.js} +2 -2
- package/dist/owletto/dist/assets/models-D7aED5Sa.js +2 -0
- package/dist/owletto/dist/assets/new-BMrFy5Qa.js +2 -0
- package/dist/owletto/dist/assets/{new-BkdULx2r.js → new-ByBhteWA.js} +2 -2
- package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-BxsjwgdH.js → oauth-workspace-access-D_5uESuz.js} +2 -2
- package/dist/owletto/dist/assets/{organization-gxGeDjIV.js → organization-DTFoYP4V.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
- package/dist/owletto/dist/assets/{permissions-aPHaKLec.js → permissions-C_auqxfP.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-DsNiavG_.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +2 -0
- package/dist/owletto/dist/assets/{recent-D-65Pgu-.js → recent-3d99S2IE.js} +2 -2
- package/dist/owletto/dist/assets/record-activity-C9KfBkXb.js +2 -0
- package/dist/owletto/dist/assets/record-field-peek-BBZcRuGT.js +2 -0
- package/dist/owletto/dist/assets/record-session-BizRugWs.js +2 -0
- package/dist/owletto/dist/assets/{reset-password-uX_V6bip.js → reset-password-DqfcSn8M.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-T1ZxTVz6.js +2 -0
- package/dist/owletto/dist/assets/runs-table-D_8QlCCN.js +2 -0
- package/dist/owletto/dist/assets/schema-value-normalization-CylKX3PK.js +97 -0
- package/dist/owletto/dist/assets/settings-B_ClYztB.js +2 -0
- package/dist/owletto/dist/assets/settings-DgX1-xo7.js +2 -0
- package/dist/owletto/dist/assets/skills-Drw5tcZw.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CPyzlfD1.js → source-record-panels-Cg249m1S.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-By8RZyKW.js → use-mention-search-BYbFvHbJ.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-DMSqkN2J.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +3881 -3215
- package/npm-shrinkwrap.json +277 -261
- package/package.json +6 -5
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/agent-policy.js +0 -3
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +3 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
- package/vendor/core/dist/contracts/agent-settings.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
- package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
- package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +39 -2
- package/vendor/core/dist/contracts/worker/protocol.js +24 -1
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/index.js +2 -1
- package/vendor/core/dist/suggestions.d.ts +15 -2
- package/vendor/core/dist/suggestions.js +48 -3
- package/vendor/core/dist/types.d.ts +26 -0
- package/vendor/core/dist/types.js +5 -0
- package/vendor/core/package.json +11 -5
- package/vendor/postgres/cf/src/connection.js +18 -0
- package/vendor/postgres/cjs/src/connection.js +18 -0
- package/vendor/postgres/src/connection.js +18 -0
- package/vendor/views/dist/api.d.ts +71 -17
- package/vendor/views/dist/api.js +200 -35
- package/vendor/views/dist/bridge.d.ts +3 -0
- package/vendor/views/dist/bridge.js +9 -1
- package/vendor/views/dist/components.d.ts +170 -0
- package/vendor/views/dist/components.js +361 -0
- package/vendor/views/dist/index.d.ts +1 -1
- package/vendor/views/package.json +11 -1
- package/dist/owletto/dist/assets/_-3J-IrxWk.js +0 -2
- package/dist/owletto/dist/assets/_-DYUE3ix4.js +0 -3
- package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cam7Z0N7.js +0 -2
- package/dist/owletto/dist/assets/_automationId-CXEiKVZJ.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CS85l61t.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-clVDIyW0.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-Ci2k-BuN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-B0662F8h.js +0 -2
- package/dist/owletto/dist/assets/_name-CwWePlOl.js +0 -2
- package/dist/owletto/dist/assets/_owner-dTWkrKsK.js +0 -3
- package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +0 -2
- package/dist/owletto/dist/assets/_slug-DQHutM41.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CMqYiiKM.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-B_vrqLVc.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-hTs7eO_U.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-D92imvSt.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +0 -6
- package/dist/owletto/dist/assets/agents-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-Bt5QCYQ7.js +0 -2
- package/dist/owletto/dist/assets/app._appId-CKv7_squ.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-vUwVumXf.js +0 -2
- package/dist/owletto/dist/assets/automations-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/callback-BRgcL8gz.js +0 -2
- package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
- package/dist/owletto/dist/assets/connect-CfsFsy9P.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-Ckdz6I0y.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-CNxafNeo.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CKZjzRz6.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CadPVsI3.js +0 -2
- package/dist/owletto/dist/assets/connectors-lvLJ30lo.js +0 -2
- package/dist/owletto/dist/assets/create-0xW9eXxG.js +0 -2
- package/dist/owletto/dist/assets/create-B0qhrrX4.js +0 -2
- package/dist/owletto/dist/assets/create-CAfF-yI1.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +0 -2
- package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-CrjG7gPo.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Cs3ZmXWo.js +0 -2
- package/dist/owletto/dist/assets/entity-options-uXjgT7y9.js +0 -2
- package/dist/owletto/dist/assets/entity-page-Dc0LGr5U.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CwZxa0BR.js +0 -2
- package/dist/owletto/dist/assets/event-detail-ve2d6Gbb.js +0 -2
- package/dist/owletto/dist/assets/events-feed-BtvhZF1f.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Cj-v6NtH.js +0 -2
- package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +0 -2
- package/dist/owletto/dist/assets/identity-BigVSBCl.js +0 -2
- package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
- package/dist/owletto/dist/assets/index-BfedB4Rc.js +0 -2
- package/dist/owletto/dist/assets/index-CUw3aKBI.js +0 -2
- package/dist/owletto/dist/assets/index-CXhxUkv3.js +0 -2
- package/dist/owletto/dist/assets/index-Cr5hwh-C.js +0 -7950
- package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +0 -2
- package/dist/owletto/dist/assets/index-DKSx8JN_.js +0 -2
- package/dist/owletto/dist/assets/index-DVk7Ug0d.js +0 -2
- package/dist/owletto/dist/assets/index-DmZuKGf8.js +0 -2
- package/dist/owletto/dist/assets/index-cPcroOH0.js +0 -2
- package/dist/owletto/dist/assets/index-n7sTbNv4.js +0 -2
- package/dist/owletto/dist/assets/index-xiFpcWKv.js +0 -2
- package/dist/owletto/dist/assets/login-Ci6ixHuL.js +0 -2
- package/dist/owletto/dist/assets/member-scope-gate-B44INDPY.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DyQiRvzl.js +0 -103
- package/dist/owletto/dist/assets/models-DpVP7ZwX.js +0 -2
- package/dist/owletto/dist/assets/new-BUb7AnEW.js +0 -2
- package/dist/owletto/dist/assets/new-CHOr-EcI.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-CHoQHe2H.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-UcZr87_Q.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CBXH6v1d.js +0 -2
- package/dist/owletto/dist/assets/renderer-mEDnVW0O.js +0 -97
- package/dist/owletto/dist/assets/runs-C0rCgGwX.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +0 -2
- package/dist/owletto/dist/assets/runs-table-syPJ6r6T.js +0 -2
- package/dist/owletto/dist/assets/settings-9NkNA1G1.js +0 -2
- package/dist/owletto/dist/assets/settings-E-10sLQX.js +0 -2
- package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +0 -2
- package/dist/owletto/dist/assets/status-dot-B-EWMgq6.js +0 -2
- package/dist/owletto/dist/assets/tabs-DqIIkCX-.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CqLZQrnO.js +0 -2
- /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iz as a,j as e}from"./index-Cr5hwh-C.js";import{b as i}from"./agent-guardrails-route-BOrCXcAl.js";import"./model-selector-dAbDgJvx.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function l(){const{owner:t,agentId:r,name:o}=a.useParams();return e.jsx(i,{owner:t,agentId:r,name:o})}export{l as component};
|
|
2
|
-
//# sourceMappingURL=_name-CwWePlOl.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-CHoQHe2H.js","assets/index-Cr5hwh-C.js","assets/index-BLEcy9-T.css","assets/automation-detail-content-vUwVumXf.js","assets/create-automation-form-CtSSeYj3.js","assets/cronstrue-n4qGUraE.js","assets/entity-options-uXjgT7y9.js","assets/connection-label-BobuYiAG.js","assets/model-selector-dAbDgJvx.js","assets/skill-editor-D_W3QlRz.js","assets/code-editor-DHeyRGZI.js","assets/index-CDz3-ieP.js","assets/index-Vcq4gwWv.js","assets/use-mention-search-By8RZyKW.js","assets/proposal-review-shell-UcZr87_Q.js","assets/runs-C0rCgGwX.js","assets/json-diff-DBoag_OS.js","assets/deployments-RvUdVkj3.js","assets/events-feed-BtvhZF1f.js","assets/conversations-table-BdXoZAfc.js","assets/renderer-mEDnVW0O.js","assets/card-Djgp00r_.js","assets/clients-D3Zbjxin.js","assets/agent-loading-shells-Dqcvky-k.js","assets/agent-thread-BJOijbT0.js","assets/app-bridge-BCm4muqj.js","assets/connection-feed-detail-CIJJLDP8.js","assets/runs-table-syPJ6r6T.js","assets/connector-scope-lists-CadPVsI3.js","assets/status-dot-B-EWMgq6.js","assets/connections-browser-CKZjzRz6.js","assets/source-record-panels-CPyzlfD1.js","assets/event-detail-ve2d6Gbb.js","assets/view-param-filters-CqLZQrnO.js","assets/filter-editors-Cj-v6NtH.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as f,a as h,j as e,p as m,r as x,D as p,b as g,c as k,d as w,e as j,B as c,C as b,L as v,A as y,X as N,l as P,_ as R,S as d,R as E,f as S,g as z,i as L,h as C,N as D,O}from"./index-Cr5hwh-C.js";const _=P(async()=>({default:(await R(async()=>{const{PeekPaneContent:a}=await import("./peek-pane-content-CHoQHe2H.js");return{PeekPaneContent:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))).PeekPaneContent}));function A(){return e.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[e.jsx(d,{className:"h-5 w-2/3"}),e.jsx(d,{className:"h-4 w-full"}),e.jsx(d,{className:"h-24 w-full rounded-lg"})]})}function I(){const a=f(),s=h();return a?.item?e.jsx(B,{item:a.item,onClose:a.close,onBack:a.back,isNarrow:s}):null}function B({item:a,onClose:s,onBack:o,isNarrow:t}){const r=a.href?m(a.href):null;x.useEffect(()=>{if(t)return;const n=u=>{u.key==="Escape"&&(u.preventDefault(),s())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[s,t]);const i=n=>e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",children:[o||n?e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:o??s,children:e.jsx(b,{className:"h-4 w-4"})}):null,e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:a.title}),r?e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:e.jsx(v,{to:r.pathname,search:r.search??{},onClick:s,children:e.jsx(y,{className:"h-4 w-4"})})}):null,e.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:s,children:e.jsx(N,{className:"h-4 w-4"})})]}),l=e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(x.Suspense,{fallback:e.jsx(A,{}),children:e.jsx(_,{item:a})})});return t?e.jsx(p,{open:!0,onOpenChange:n=>{n||s()},children:e.jsxs(g,{children:[e.jsx(k,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),e.jsxs(w,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[e.jsx(j,{className:"sr-only",children:a.title}),i(!0),l]})]})}):e.jsxs("aside",{className:"flex w-[460px] max-w-[45vw] shrink-0 flex-col border-l border-border bg-background",children:[i(!1),l]})}function W(){const{owner:a}=E.useParams(),{data:s,isLoading:o,error:t}=S(a==="me"?null:a,{slug:a}),{session:r,isReady:i}=z(),l=L(t)&&!s?.workspace;return C({active:!o&&!l&&i&&!r&&!s?.workspace,owner:a})?null:e.jsx(D,{children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-row",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e.jsx(O,{})}),e.jsx(I,{})]})})}export{W as component};
|
|
3
|
-
//# sourceMappingURL=_owner-dTWkrKsK.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{im as p,j as e,bl as m}from"./index-Cr5hwh-C.js";import{M as i}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function d(){const{owner:t,entityType:o,shape:r}=p.useParams();return e.jsx(i,{ownerSlug:t,typeScope:m(o),create:!1,shape:r})}export{d as component};
|
|
2
|
-
//# sourceMappingURL=_shape-BtS3y4M9.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ix as r,j as e}from"./index-Cr5hwh-C.js";import{b as m}from"./agent-skills-route-BUxIswuq.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-skill-context-CCdvtlmH.js";import"./core.esm-CYvgWCuv.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function c(){const{owner:t,agentId:o,skillKey:i}=r.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:i})}export{c as component};
|
|
2
|
-
//# sourceMappingURL=_skillKey-Dc9m-nlR.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{fK as l,k as x,m as d,em as y,ch as c,j as t,bx as g}from"./index-Cr5hwh-C.js";import{E as u}from"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";function N(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=x(),o=d(),{data:i=[],isLoading:r}=y(s),e=i.find(p=>p.slug===n)??null,m=e?c(e):!1;return t.jsx("div",{className:"flex flex-1 flex-col gap-4 px-4 py-6 lg:px-6",children:t.jsx("div",{className:"max-w-3xl",children:r?t.jsx(g,{label:"entity type",variant:"panel"}):e?t.jsx(u,{entityType:e,orgContext:s,hideDelete:m,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{N as component};
|
|
2
|
-
//# sourceMappingURL=_slug-DQHutM41.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iC as e,j as i,bl as p}from"./index-Cr5hwh-C.js";import{M as m}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function M(){const{owner:t,entityType:o,viewKey:r}=e.useParams();return i.jsx(m,{ownerSlug:t,typeScope:p(o),create:!1,viewKey:r})}export{M as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-B30ik8ma.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iu as t,j as m}from"./index-Cr5hwh-C.js";import{M as i}from"./memory-browse-page-DyQiRvzl.js";import"./public-shell-ready-DcnlADmj.js";import"./entity-type-page-CwZxa0BR.js";import"./json-diff-DBoag_OS.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-DHeyRGZI.js";import"./tabs-DqIIkCX-.js";import"./filter-editors-Cj-v6NtH.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";import"./core.esm-CYvgWCuv.js";import"./view-param-filters-CqLZQrnO.js";import"./app-bridge-BCm4muqj.js";import"./member-scope-gate-B44INDPY.js";function R(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{R as component};
|
|
2
|
-
//# sourceMappingURL=_viewKey-CUHypQnF.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c3 as K,j as e,c4 as Q,r as _,k as q,t as D,a as H,c5 as J,P as c,L as d,bl as N,an as U,c6 as X,c7 as Y,aj as Z,bx as A,aQ as E,c8 as S,B,be as ee,bh as te,c9 as ne,ah as se,ca as oe}from"./index-Cr5hwh-C.js";import{R as ae,E as re,M as ie}from"./record-activity-CBXH6v1d.js";import{M as ce}from"./member-scope-gate-B44INDPY.js";import{P as de}from"./public-shell-ready-DcnlADmj.js";function le(n){const t=K();return e.jsx(xe,{...n,context:t},`${n.ownerSlug}:${n.attentionLens}:${Q(t)}`)}function xe({organizationId:n,ownerSlug:t,typeScope:x,entityScope:o,attentionLens:m=!1,activityTab:f="events",context:a}){const[y,I]=_.useState(m?"relevant":"activity"),r=a?y!=="activity":m,{orgContext:R}=q(),{isMember:T,isLoading:M}=D(),O=T&&!!n,l=H(),i=f==="sessions"&&l,{attentionItems:W}=J(t),k=W.length,u=a?e.jsx("fieldset",{"aria-label":"Activity view",className:c("flex min-w-0 max-w-full items-center gap-1",l&&"justify-center"),children:[["relevant","Relevant here"],["attention","Needs attention"],["activity","All activity"]].map(([s,g])=>e.jsxs("button",{type:"button","aria-pressed":y===s,onClick:()=>I(s),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:[g,s==="attention"?e.jsx(P,{count:k}):null]},s))}):e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>({...s??{}}),"aria-current":r?void 0:"page",className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r?"text-muted-foreground hover:text-foreground":"bg-muted text-foreground"),children:"All activity"}),e.jsxs(d,{to:"/$owner",params:{owner:t},search:s=>({...s??{}}),"aria-current":r?"page":void 0,className:c("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:["Needs attention",e.jsx(P,{count:k})]})]}),h=x?N(x):void 0,{data:v,isLoading:b,error:z}=U(o?`/${t}/${X(o)}`:r?`/${t}`:"",R),j=o?v?.entity:void 0,F=(o?j?.entity_type??N(o.split("/").at(-2)??""):h)==="$member",L=o!=null&&!b&&(z!=null||v?.entity==null),C=M||b,p=v?.counts,G=p?p.connections>0||p.agents>0:!1,V=O&&!C&&p!=null&&!G,w=!l&&!i&&!L,$=o&&b?e.jsx(A,{label:"Loading record…"}):L?e.jsx(E,{icon:ne,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):j?e.jsx(ae,{ownerSlug:t,filterBarLeading:w?u:void 0,entity:j,organizationId:n}):e.jsx(re,{organizationId:n,ownerSlug:t,filterBarLeading:w?u:void 0,hideSourceFilter:!0,scopedEntityTypes:!o&&h?[h]:void 0});if(r){const s=C?e.jsx(A,{label:"workspace setup",variant:"panel",className:"px-6 py-8"}):V?e.jsx("div",{className:"px-6",children:e.jsx(E,{icon:S,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(B,{asChild:!0,children:e.jsxs(d,{to:"/$owner/connectors/create",params:{owner:t},children:[e.jsx(ee,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(B,{asChild:!0,variant:"outline",children:e.jsxs(d,{to:"/$owner/agents",params:{owner:t},children:[e.jsx(te,{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(Y,{context:a,relevant:y==="relevant",owner:t,emptyState:s,tabs:u})})}return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[w?null:e.jsxs("div",{className:c("sticky top-0 z-20 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 bg-background pt-1",l?"justify-center":"justify-between"),children:[u,l?e.jsxs("div",{className:"flex items-center rounded-lg bg-muted/60 p-0.5 text-xs",children:[e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>{const g={...s??{}};return delete g.tab,g},"aria-current":i?void 0:"page",className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i?"text-muted-foreground hover:text-foreground":"bg-background text-foreground "),children:"Events"}),e.jsx(d,{to:"/$owner/events",params:{owner:t},search:s=>({...s??{},tab:"sessions"}),"aria-current":i?"page":void 0,className:c("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:"Sessions"})]}):null]}),i?e.jsx(Z,{owner:t,tone:"page",empty:"message"}):F?e.jsx(ce,{children:$}):$]})}function P({count:n}){return n===0?null:e.jsx("span",{role:"img","aria-label":`${n} item${n===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:n})}function ye({owner:n,search:t,attentionLens:x,entityScope:o}){const m=typeof t.type=="string"&&t.type.trim()?N(t.type.trim()):void 0,f=t.tab==="sessions"?"sessions":"events";return e.jsxs("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:[e.jsx(de,{}),e.jsx(se,{owner:n,children:a=>e.jsx(ie,{organizationId:a.organizationId,isWorkspaceLoading:a.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(le,{organizationId:a.organizationId,ownerSlug:a.ownerSlug,typeScope:m,entityScope:o,attentionLens:x,activityTab:f}),e.jsx(oe,{ownerSlug:a.ownerSlug})]})})})]})}export{ye as A};
|
|
2
|
-
//# sourceMappingURL=activity-route-view-CMqYiiKM.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{H as m,j as e,aB as b,fL as N,af as A,fM as L,L as p,fN as w,f as k,r as C,h0 as S,hi as x,B as y,A as I,bi as f,dd as M,gA as P}from"./index-Cr5hwh-C.js";import{A as R,f as $,b as B}from"./agent-client-setup-list-Bg3hBfUV.js";import{u as T}from"./clients-D3Zbjxin.js";import{g as _,c as U}from"./client-rows-EJSKR6z1.js";function E(t){const n=t?`/mcp/${t}`:"/mcp";if(!m)return`http://localhost:8787${n}`;try{const s=new URL(m);return s.pathname=n,s.toString()}catch{return`${m}${n}`}}const u="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6";function D(t,n){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${t===n-1?"":"border-b"}`}function v({owner:t}){return e.jsx(L,{crumbs:[e.jsx(p,{to:"/$owner/agents",params:{owner:t},className:w,children:"Agents"},"agents")]})}function W({owner:t}){return e.jsx("div",{className:u,children:e.jsxs(b,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(N,{breadcrumb:e.jsx(v,{owner:t}),icon:e.jsx(A.agents.icon,{className:"h-6 w-6"}),title:"Connect an agent",caption:"Choose the agent you already use. Install directly where supported, or copy a setup prompt into the agent."}),e.jsx(R,{owner:t}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Local Automation delivery is separate and is not enabled by connecting an agent."})]})})}function j({text:t,label:n}){const[s,l]=C.useState(!1);return e.jsxs(y,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},children:[s?e.jsx(M,{className:"mr-1.5 h-3.5 w-3.5"}):e.jsx(P,{className:"mr-1.5 h-3.5 w-3.5"}),s?"Copied":n]})}function q({owner:t,clientId:n}){const s=$(n),{data:l}=k(t,{slug:t}),{data:h=[]}=T(null,{refetchInterval:2500}),r=C.useMemo(()=>_(h).filter(a=>a.connected),[h]);if(!s)return e.jsx("div",{className:u,children:e.jsxs(b,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no agent client by that name."}),e.jsx(p,{to:"/$owner/agents/connect",params:{owner:t},className:"text-sm text-primary hover:underline",children:"Back to agent clients"})]})});const o=E(t),c=B({workspaceName:l?.workspace?.name??t,owner:t,mcpUrl:o,clientLabel:s.id==="other"?void 0:s.label,terminalLogin:s.terminalLogin}),i=s.setupMode==="agent-prompt",g=i?c:s.installText?.(o)??c;return e.jsx("div",{className:u,children:e.jsxs(S,{header:e.jsx(N,{breadcrumb:e.jsx(v,{owner:t}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:s.label})}),title:s.label,caption:s.description}),children:[e.jsx(x,{title:"Set up",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.installTitle}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap font-mono text-xs leading-relaxed",children:g}),e.jsx(j,{text:g,label:i?"Copy setup prompt":"Copy"})]})]}),e.jsx("ol",{className:"space-y-1 text-xs text-muted-foreground",children:s.steps(o).map((a,d)=>e.jsxs("li",{children:[d+1,". ",a]},a))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[i?null:e.jsx(j,{text:c,label:"Copy setup prompt"}),s.guideLinks.map(a=>e.jsx(y,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 text-xs",children:e.jsxs("a",{href:a.href,target:"_blank",rel:"noreferrer",children:[a.label,e.jsx(I,{className:"ml-1.5 h-3.5 w-3.5"})]})},a.href))]})]})}),e.jsx(x,{title:"Connected agents",count:r.length>0?String(r.length):void 0,children:r.length===0?e.jsx("div",{className:"rounded-lg border border-dashed px-3 py-2.5 text-xs text-muted-foreground",children:"Nothing yet. Finish setup and make an authenticated Lobu MCP request; the agent appears here automatically."}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:r.map((a,d)=>e.jsxs(p,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:a.clientId},className:D(d,r.length),children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(f,{name:a.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:a.title}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:U(a)})]})]},a.key))})}),e.jsx(x,{title:"Manual MCP details",children:e.jsxs("dl",{className:"grid grid-cols-[5rem_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/40 p-3 text-xs",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Name"}),e.jsx("dd",{className:"font-mono",children:"lobu"}),e.jsx("dt",{className:"text-muted-foreground",children:"MCP URL"}),e.jsx("dd",{className:"break-all font-mono",children:o})]})})]})})}export{W as A,q as a};
|
|
2
|
-
//# sourceMappingURL=agent-connect-pages-B_vrqLVc.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aw as he,ax as xe,j as e,B as f,cC as pe,e1 as fe,a_ as ve,P as be,fe as je,ck as U,dd as V,cy as we,gH as ye,gI as Ne,gJ as Ce,gK as Me,fV as Se,gL as ke,bO as Ie,bP as Ae,ay as Pe,r as q,bH as E,ex as H,bS as Fe,y as b,f3 as $,I as De,Q as Te,bn as $e,bo as Re,bp as _e,bq as Ee,br as K}from"./index-Cr5hwh-C.js";import{b as Le,s as Be}from"./model-selector-dAbDgJvx.js";function Oe(t){const a=t.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-");return(a?/^[a-z]/.test(a)&&a.length>=3?a:`agent-${a}`:"agent").slice(0,60).replace(/-+$/g,"")||"agent"}function ze(t,a){const m=new Set(a),h=Oe(t);let x=h,u=2;for(;m.has(x);){const g=`-${u}`;x=`${h.slice(0,Math.max(1,60-g.length)).replace(/-+$/g,"")||"agent"}${g}`,u+=1}return x}const Ue="__unresolved__";function W(t){return t.endsWith(`/${Ue}`)}function G(t){const a=t.indexOf("/");return a===-1?{slug:t,model:""}:{slug:t.slice(0,a),model:t.slice(a+1)}}function Ve(t,a){const{slug:m,model:h}=G(t);return{provider:a.find(g=>g.value===t)?.provider??a.find(g=>G(g.value).slug===m)?.provider??m,model:h}}function qe({value:t,onChange:a,disabled:m}){const{data:h=[]}=he(),{data:x=[]}=xe(),u=Le(h,x),g=(s,o)=>{const n=s+o;if(n<0||n>=t.length)return;const c=[...t];[c[s],c[n]]=[c[n],c[s]],a(c)},C=s=>{a(t.filter((o,n)=>n!==s))},M=s=>{t.includes(s)||a([...t,s])},d=u.filter(s=>!t.includes(s.value)&&!W(s.value));return e.jsxs("div",{className:"grid gap-2",children:[t.length===0?e.jsx("p",{className:"rounded-lg border border-dashed bg-muted/20 px-3 py-4 text-center text-[11px] text-muted-foreground",children:"No models pinned — this agent uses the org default."}):e.jsx("ul",{className:"grid gap-1.5",children:t.map((s,o)=>{const n=W(s),{provider:c,model:i}=Ve(s,u);return e.jsxs("li",{className:be("flex items-center gap-2 rounded-lg border bg-muted/20 px-3 py-2",n&&"opacity-60"),children:[e.jsxs("div",{className:"grid min-w-0 flex-1 gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-sm",children:c}),o===0?e.jsx("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"Default"}):null]}),e.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:n?"no model selected":i})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move up",disabled:m||o===0,onClick:()=>g(o,-1),children:e.jsx(pe,{className:"h-4 w-4"})}),e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Move down",disabled:m||o===t.length-1,onClick:()=>g(o,1),children:e.jsx(fe,{className:"h-4 w-4"})}),e.jsx(f,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive","aria-label":"Remove model",disabled:m,onClick:()=>C(o),children:e.jsx(ve,{className:"h-4 w-4"})})]})]},s)})}),e.jsx(je,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:s=>e.jsxs(f,{type:"button",variant:"outline",role:"combobox","aria-expanded":s,disabled:m,className:"w-full justify-start font-normal text-muted-foreground",children:[e.jsx(we,{className:"mr-2 h-4 w-4 shrink-0"}),"Add model"]}),children:(s,o)=>{const n=o.trim(),c=Be(n,u)&&!t.includes(n);return e.jsxs(e.Fragment,{children:[d.map(i=>e.jsxs(U,{value:`${i.provider} ${i.model} ${i.value}`,onSelect:()=>{M(i.value),s()},className:"cursor-pointer",children:[e.jsx(V,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{className:"truncate",children:[i.provider," ",e.jsx("span",{className:"text-muted-foreground text-xs",children:i.model}),i.isDefault?e.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},i.value)),c?e.jsxs(U,{value:`__custom__ ${n}`,onSelect:()=>{M(n),s()},className:"cursor-pointer",children:[e.jsx(V,{className:"mr-2 h-4 w-4 opacity-0"}),e.jsxs("span",{children:["Use ",e.jsx("span",{className:"font-mono text-xs",children:n})]})]}):null]})}})]})}function Ge({mode:t,section:a="identity",existingAgentIds:m=[],onCreated:h,onCancel:x,onDone:u,reviewMode:g="none",reviewProposal:C=null,reviewControlsDisabled:M=!1}){const d=t.kind==="create",s=t.kind==="edit"?t.agent:null,o=!d&&a!=="platforms"&&a!=="skills"&&!!s,n=ye(),c=Ne(s?.agentId??""),i=Ce(s?.agentId??""),S=Me(s?.agentId??""),{data:p,isLoading:L}=Se(s?.agentId,{enabled:o}),B=!d&&g==="active"?C:null,R=B?ke(B.proposal):void 0,w=p,O=s?.agentId??"create",r=Ie(O,{name:R?.name??s?.name??"",description:R?.description??s?.description??"",identityMd:R?.identityMd??p?.identityMd??"",soulMd:p?.soulMd??"",userMd:p?.userMd??"",models:w?.models??w?.settings?.models??[],showToolCalls:w?.showToolCalls??w?.settings?.showToolCalls??!1,sandboxId:w?.sandboxId??w?.settings?.sandboxId??"builtin"}),[j,J]=r.field("name"),[y,Q]=r.field("description"),[k,Y]=r.field("identityMd"),[I,X]=r.field("soulMd"),[A,Z]=r.field("userMd"),[P,ee]=r.field("models"),[F,se]=r.field("showToolCalls"),[N,te]=r.field("sandboxId"),[ae,D]=Ae(O,!1),{data:ne}=Pe({enabled:a==="models"&&!d}),le=q.useCallback(async l=>{if(l.preventDefault(),!!r.canSubmit){if(d){const T=await n.mutateAsync({agentId:ze(j,m),name:j.trim(),description:y.trim()||void 0});h?await h(T.agentId):u?.();return}if(s){if(!p){E.error("Still loading agent settings — try again in a moment");return}try{await Promise.all([c.mutateAsync({name:j.trim()||s.name,description:y.trim()||void 0}),S.mutateAsync({identityMd:k.trim(),soulMd:I.trim(),userMd:A.trim(),models:P,authProfiles:p.authProfiles??[],skillsConfig:p.skillsConfig,showToolCalls:F,sandboxId:N==="builtin"?void 0:N})]),r.accept(r.values,{name:j.trim()||s.name,description:y.trim()||s.description||"",identityMd:k.trim(),soulMd:I.trim(),userMd:A.trim(),models:P,showToolCalls:F,sandboxId:N}),E.success("Agent saved"),u?.()}catch(T){E.error(T instanceof Error?T.message:"Failed to save agent")}}}},[p,n,y,r.accept,r.values,r.canSubmit,N,m,k,d,P,j,h,u,s,F,I,c,S,A]),ie=q.useCallback(async()=>{s&&(await i.mutateAsync(),D(!1),u?.())},[i,u,s,D]),_=n.isPending||c.isPending||i.isPending||S.isPending,re=d||!!p;if(o&&L)return e.jsx(H,{rows:6});const v=_||M,de=g==="none"||g==="gone",oe=j.trim().length>0&&re,ce=d||a==="settings",me=!d&&(a==="identity"||a==="settings"),ue=!d&&a==="settings",ge=!d&&a==="settings",z=!d&&a==="models";return e.jsxs("form",{onSubmit:le,className:"flex min-h-0 flex-col",children:[e.jsx(Fe,{visible:r.hasConflict,onReload:r.reset}),e.jsxs("div",{className:"grid content-start gap-4 py-2",children:[me?L?e.jsx(H,{rows:4}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"identity-md",children:"Identity"}),e.jsx($,{id:"identity-md",rows:6,value:k,onChange:l=>Y(l.target.value),disabled:v,placeholder:"You are a market intelligence agent. Track competitors, analyze launches and signals, and surface concise, decision-ready insights."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"soul-md",children:"Soul"}),e.jsx($,{id:"soul-md",rows:6,value:I,onChange:l=>X(l.target.value),disabled:v,placeholder:"Be rigorous, skeptical of weak signals, and calm under ambiguity. Prefer crisp summaries, explicit evidence, and clear confidence levels."})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"user-md",children:"User prompt"}),e.jsx($,{id:"user-md",rows:6,value:A,onChange:l=>Z(l.target.value),disabled:v,placeholder:"Monitor the market for notable competitor moves, pricing changes, launches, partnerships, and customer sentiment shifts. Summarize what changed, why it matters, and what to watch next."})]})]}):null,ce?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(b,{htmlFor:"agent-name",children:["Name ",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(De,{id:"agent-name",placeholder:"Support Bot",value:j,onChange:l=>J(l.target.value),disabled:v,required:!0}),d?e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"The agent ID will be generated automatically from the name."}):null]}),d?null:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-description",children:"Description"}),e.jsx($,{id:"agent-description",placeholder:"Handles customer support and triage across channels.",value:y,onChange:l=>Q(l.target.value),disabled:v,rows:3})]})]}):null,ge?e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/20 p-3",children:[e.jsx(Te,{id:"show-tool-calls",checked:F,onCheckedChange:l=>se(l===!0),disabled:v,className:"mt-0.5"}),e.jsxs("div",{className:"grid gap-0.5",children:[e.jsx(b,{htmlFor:"show-tool-calls",className:"cursor-pointer",children:"Show tool calls in chat"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Render the agent's tool invocations (name, arguments, and result) as cards in the web chat. Off by default."})]})]}):null,z?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{children:"Models"}),e.jsx(qe,{value:P,onChange:ee,disabled:v}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ordered list; the first is the default. Only these models may be used — a request for anything else falls back to the first available one. Leave empty to use the org default."})]}):null,z?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(b,{htmlFor:"agent-sandbox",children:"Run in sandbox"}),e.jsxs($e,{value:N,onValueChange:te,disabled:v,children:[e.jsx(Re,{id:"agent-sandbox",className:"w-full",children:e.jsx(_e,{placeholder:"Built-in"})}),e.jsxs(Ee,{children:[e.jsx(K,{value:"builtin",children:"Built-in (default)"}),(ne?.sandboxes??[]).map(l=>e.jsxs(K,{value:l.id,children:[l.name," (",l.providerKind,")",l.connected?"":" — no credential"]},l.id))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Where this agent's commands execute. Built-in runs in-process; sandboxes run on a connected provider. Manage sandboxes under Connect › Runtime."})]}):null]}),de?e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[ue?ae?e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(f,{type:"button",variant:"destructive",onClick:()=>void ie(),disabled:i.isPending,children:i.isPending?"Deleting...":"Delete agent"}),e.jsx(f,{type:"button",variant:"outline",onClick:()=>D(!1),disabled:i.isPending,children:"Cancel"})]}):e.jsx(f,{type:"button",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>D(!0),disabled:i.isPending,children:"Delete agent"}):e.jsx("span",{}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[x?e.jsx(f,{type:"button",variant:"outline",onClick:x,disabled:_,children:"Cancel"}):null,e.jsx(f,{type:"submit",disabled:!r.canSubmit||!oe||_,children:d?n.isPending?"Creating...":"Create agent":c.isPending||S.isPending?"Saving...":"Save changes"})]})]}):null]})}export{Ge as A};
|
|
2
|
-
//# sourceMappingURL=agent-editor-form-hTs7eO_U.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m,j as e,P as h,B as n,gj as i}from"./index-Cr5hwh-C.js";function p({owner:t,agentId:a,children:s,showBack:r,backLabel:o,backTo:x,title:c,className:u}){const d=m(),l=()=>{d({to:x,params:{owner:t,agentId:a}})};return e.jsx("div",{className:h("mx-auto w-full max-w-3xl pb-8",u),children:c?e.jsxs(e.Fragment,{children:[e.jsx(j,{title:c,onBack:l,backLabel:o}),s]}):r?e.jsx(g,{onBack:l,backLabel:o,children:s}):s})}function g({onBack:t,backLabel:a,children:s}){return e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"absolute right-full top-0 mr-1 size-8 text-muted-foreground hover:text-foreground","aria-label":`Back to ${a}`,onClick:t,children:e.jsx(i,{className:"h-4 w-4"})}),s]})}function j({title:t,onBack:a,backLabel:s,action:r}){return e.jsx("div",{className:"sticky top-0 z-10 mb-2 bg-background py-2",children:e.jsxs("div",{className:"relative flex items-center justify-center gap-1",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground","aria-label":`Back to ${s}`,onClick:a,children:e.jsx(i,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-base font-semibold",children:t}),r?e.jsx("div",{className:"absolute right-0",children:r}):null]})})}function v({title:t,description:a,onBack:s,backLabel:r}){return e.jsxs("div",{className:"mb-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(n,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground","aria-label":`Back to ${r}`,onClick:s,children:e.jsx(i,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-xl font-semibold",children:t})]}),e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:a})]})}export{p as A,v as a};
|
|
2
|
-
//# sourceMappingURL=agent-subpage-shell-D92imvSt.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{j as s,r as l,aD as Ut,Z as Ft,fU as Vt,fV as Bt,V as Je,H as Fe,W as Ze,bV as Ht,fW as et,fX as zt,fY as Wt,L as pt,P as M,fj as Kt,dO as mt,dP as qt,fZ as Gt,dv as Qt,dQ as Xt,f_ as Yt,ah as Jt,B as ue,e1 as Zt,f$ as en,g0 as Ve,X as tn,a1 as nn,cC as rn,ae as Te,g1 as on,d5 as sn,d7 as ln,g2 as an,d6 as cn,bb as un,g3 as dn,g4 as fn,ds as pn,b7 as mn,g5 as hn,g6 as gn}from"./index-Cr5hwh-C.js";import{D as bn,E as xn}from"./app-bridge-BCm4muqj.js";import{A as vn,a as yn,b as Rn,c as Ke,d as ht,e as wn}from"./agent-loading-shells-Dqcvky-k.js";import{h as Sn,t as Cn,R as jn,i as Tn,u as Nn,M as En,a as An}from"./use-mention-search-By8RZyKW.js";import{E as kn,c as In}from"./events-feed-BtvhZF1f.js";const gt=l.createContext(null);function _n({extension:e,children:t}){return s.jsx(gt.Provider,{value:e??null,children:t})}function qe(){return l.useContext(gt)}var Ge=(e=>(e.PROVIDER_QUOTA_EXHAUSTED="PROVIDER_QUOTA_EXHAUSTED",e.PROVIDER_AUTH="PROVIDER_AUTH",e.PROVIDER_UNKNOWN_MODEL="PROVIDER_UNKNOWN_MODEL",e.PROVIDER_BASE_URL_UNRESOLVED="PROVIDER_BASE_URL_UNRESOLVED",e.NO_MODEL_CONFIGURED="NO_MODEL_CONFIGURED",e.WORKER_UNRESPONSIVE="WORKER_UNRESPONSIVE",e.WORKER_DIED="WORKER_DIED",e.WORKER_STARTUP_FAILED="WORKER_STARTUP_FAILED",e.PROVIDER_TOOL_CALL_FAILED="PROVIDER_TOOL_CALL_FAILED",e.SESSION_TIMEOUT="SESSION_TIMEOUT",e))(Ge||{});const On={PROVIDER_QUOTA_EXHAUSTED:{cta:"provider-management",ctaLabel:"Manage provider"},PROVIDER_AUTH:{cta:"provider-management",ctaLabel:"Reconnect provider"},PROVIDER_UNKNOWN_MODEL:{cta:"agent-settings",ctaLabel:"Choose model"},PROVIDER_BASE_URL_UNRESOLVED:{cta:"provider-management",ctaLabel:"Manage provider"},PROVIDER_TOOL_CALL_FAILED:{message:"The model provider rejected its own tool call and ended the turn. This is usually temporary — please try again.",cta:"none"},NO_MODEL_CONFIGURED:{message:"No model is configured for this agent. Choose a model in agent settings.",cta:"agent-settings",ctaLabel:"Choose a model"},WORKER_UNRESPONSIVE:{message:"The agent didn't finish responding in time. This is usually temporary — please try again.",cta:"none"},WORKER_DIED:{message:"The agent stopped unexpectedly before it could reply. This is usually temporary — please try again.",cta:"none"},WORKER_STARTUP_FAILED:{message:"The agent couldn't start, so your request wasn't processed. Please try again in a moment.",cta:"none"},SESSION_TIMEOUT:{cta:"none",silent:!0}};function Pn(e){if(typeof e=="string")return Object.values(Ge).includes(e)?e:void 0}const Mn=Object.freeze(Object.defineProperty({__proto__:null,AGENT_ERRORS:On,AgentErrorCode:Ge,toAgentErrorCode:Pn},Symbol.toStringTag,{value:"Module"})),{AGENT_ERRORS:Ln,toAgentErrorCode:$n}=Mn;function tt(e,t){if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:new URL(e,`${n.origin}/`).toString()}catch{return null}}function bt(e,t){const n=$n(e);if(!n)return null;const r=Ln[n];if(r.cta==="none"||!t.workspaceSlug)return null;const o=encodeURIComponent(t.workspaceSlug);if(r.cta==="provider-connect"||r.cta==="provider-management"){const i=t.provider?`/${o}/connectors/${encodeURIComponent(`${Ut}${t.provider}`)}`:`/${o}/connectors`,c=tt(i,t.webOrigin);if(!c)return null;const u=new URL(c);return t.provider&&t.model&&u.searchParams.set("model",t.model),{label:r.ctaLabel??"Connect a provider",href:u.toString()}}if(!t.agentId)return null;const a=tt(`/${o}/agents/${encodeURIComponent(t.agentId)}/settings`,t.webOrigin);return a?{label:r.ctaLabel??"Open settings",href:a}:null}function xt(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.subscribable;if(!t||typeof t!="object"||Array.isArray(t))return null;const n=t;if(typeof n.connector_key!="string"||!n.connector_key||typeof n.resource_type!="string"||!n.resource_type||typeof n.resource_ref!="string"||!n.resource_ref||typeof n.label!="string"||!n.label)return null;const r=Array.isArray(n.suggested_event_keys)?n.suggested_event_keys.filter(o=>typeof o=="string"&&!!o):void 0;return{connector_key:n.connector_key,resource_type:n.resource_type,resource_ref:n.resource_ref,label:n.label,...r?.length?{suggested_event_keys:r}:{}}}const nt=new Set(["localhost","127.0.0.1","::1","[::1]"]);function Dn(e){return e?.trim().toLowerCase().replace(/^\.+|\.+$/g,"")||null}function rt(e,t){const n=Dn(t);if(!n)return!1;const r=e.toLowerCase().replace(/\.$/,"");return r===n||r.endsWith(`.${n}`)}function ot(e,t,n){try{const r=new URL(t),o=new URL(e,t),a=nt.has(o.hostname)&&nt.has(r.hostname),i=o.protocol===r.protocol&&(o.protocol==="https:"||o.protocol==="http:")&&rt(o.hostname,n)&&rt(r.hostname,n);return o.origin!==r.origin&&(a||i)&&(o.protocol=r.protocol,o.host=r.host),o.origin===r.origin&&o.pathname.startsWith("/api/v1/agents")&&(o.pathname=`/lobu${o.pathname}`),o.toString()}catch{return e}}const Un=/\.(png|jpe?g|gif|webp|avif|bmp|svg)$/i,vt=new Set(["suggest_actions"]),Oe="Thinking…";function Fn(e){const{textOut:t,statusLine:n,errorText:r,toolCalls:o}=e,a=[];n===Oe&&a.push({type:"reasoning"}),r&&a.push({type:"error",text:r});let i=t;return n&&n!==Oe&&(i=t?`${t}
|
|
2
|
-
|
|
3
|
-
${n}`:n),i&&a.push({type:"text",text:i}),a.push(...o),a}const Qe=l.createContext(null);function Ne(){const e=l.useContext(Qe);if(!e)throw new Error("useLobuChat must be used within <LobuChatProvider>");return e}function Io({messages:e,workspaceSlug:t=null,children:n}){const r=l.useMemo(()=>({messages:e,running:!1,append:()=>{},cancel:()=>{},pendingAttachments:[],addAttachments:()=>{},removeAttachment:()=>{},agentId:null,conversationId:"",workspaceSlug:t,currentSuggestions:null}),[e,t]);return s.jsx(Qe.Provider,{value:r,children:n})}const yt=/\[([^\]]*)\]\((\S*?\/api\/v1\/files\/[^)\s]+)\)/g;function st(e){return e.replace(/<lobu_internal_context>[\s\S]*?<\/lobu_internal_context>\n*/g,"").replace(yt,"").replace(/\n{3,}/g,`
|
|
4
|
-
|
|
5
|
-
`).trim()}function Vn(e){const t=[];for(const n of e.matchAll(yt)){const r=n[1]?.trim()||"file",o=n[2];o&&t.push({name:r,url:o})}return t}function Bn(e,t={}){if(typeof e=="string"){const r=st(e);return r?[{type:"text",text:r}]:[]}if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||typeof r!="object")continue;const o=r;if(o.type==="text"&&typeof o.text=="string"){const a=st(o.text);a&&n.push({type:"text",text:a})}else t.showToolCalls&&o.type==="toolCall"&&typeof o.name=="string"&&!vt.has(o.name)?n.push({type:"tool-call",toolCallId:o.id??`tc-${n.length}`,toolName:o.name,args:o.arguments??{},...o.result!==void 0?{result:o.result}:{}}):t.showToolCalls&&o.type==="tool_use"&&typeof o.name=="string"&&n.push({type:"tool-call",toolCallId:o.id??`tc-${n.length}`,toolName:o.name,args:o.input??{},...o.result!==void 0?{result:o.result}:{}})}return n}function Hn(e){const t=[],n=r=>{for(const{name:o,url:a}of Vn(r))t.push({id:`file-${t.length}`,name:o,url:a,isImage:Un.test(o)})};if(typeof e=="string")return n(e),t.length>0?t:void 0;if(Array.isArray(e)){for(const r of e){if(!r||typeof r!="object")continue;const o=r;if(o.type==="image"&&typeof o.data=="string"){const a=o.mimeType||"image/png";t.push({id:`img-${t.length}`,name:`image-${t.length+1}`,imageDataUrl:`data:${a};base64,${o.data}`,isImage:!0})}else o.type==="text"&&typeof o.text=="string"&&n(o.text)}return t.length>0?t:void 0}}function zn(e,t){if(e.type==="bashExecution"){const r=e.content??{},o=e.timestamp?new Date(e.timestamp).getTime():void 0;return{id:e.id,role:"user",parts:[{type:"bash",command:r.command??"",output:r.output??"",exitCode:r.exitCode,cancelled:r.cancelled??!1}],createdAt:o&&!Number.isNaN(o)?o:void 0}}if(e.type!=="message"||e.isVerbose||e.role!=="assistant"&&e.role!=="user"&&e.role!=="system")return null;const n=e.timestamp?new Date(e.timestamp).getTime():void 0;return{id:e.id,role:e.role,parts:Bn(e.content,t),attachments:Hn(e.content),createdAt:n&&!Number.isNaN(n)?n:void 0}}const Wn=[],Kn=[];function qn(e){let t=null;for(const n of e)n.type==="suggestion"&&(t=n.prompts.length>0?n.prompts:null);return t}function Gn(e,t){if(e.length===0)return null;const n=[];for(const r of e)if(r.type!=="suggestion"){if(r.type==="agent-error"){n.push({type:"error",text:String(r.error??"Agent reported an error.")});const o=bt(r.errorCode,{...t,provider:r.errorContext?.provider,model:r.errorContext?.model});o&&n.push({type:"tool-call",toolCallId:`error-run-${r.runId}`,toolName:"link-button",args:{label:o.label,url:o.href}});continue}n.push({type:"tool-call",toolCallId:`approval-event-${r.eventId}`,toolName:"tool-approval",args:{runId:r.runId,action:r.action,proposal:r.proposal,current:r.current,fields:r.fields??null,attribution:r.attribution??null,resourceKind:r.resourceKind??null,reason:r.reason??null,status:r.status??"pending",reviewedByName:r.reviewedByName??null}})}return n.length===0?null:{id:"history-interactions",role:"assistant",parts:n}}const Qn=3e4,Xn=3*Qn,Yn=15e3;function lt(e){try{return JSON.parse(e.data)}catch{return{content:e.data}}}const be=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;function at(e){const t=[],n=new Set;for(const r of e){if(!r||typeof r!="object")continue;const{title:o,message:a}=r;if(typeof o!="string"||typeof a!="string")continue;const i=o.trim(),c=a.trim();if(i.length===0||c.length===0)continue;const u=`${i}\0${c}`;n.has(u)||(n.add(u),t.push({title:i,message:c}))}return t.length>0?t:null}function _o({agentId:e,workspaceSlug:t,thread:n="agent-panel",loadHistory:r=!0,ephemeralContext:o,onFirstUserMessage:a,children:i,initialDraft:c}){const u=Ft(),d=l.useRef(null),f=l.useRef(null),v=l.useRef(!1),m=l.useRef(o),g=l.useRef(!1),R=l.useRef(null);m.current=o;const{data:I,isLoading:b}=Vt(e,n,{orgSlug:t,enabled:r&&!!e&&!!n}),T=I?.messages??Wn,W=I?.interactions??Kn,{data:B}=Bt(e,{enabled:!!e}),D=!!(B?.showToolCalls??B?.settings?.showToolCalls),[J,E]=l.useState([]),[U,Z]=l.useState(!1),[ne,H]=l.useState([]),[G,Q]=l.useState(null),y=l.useRef(!1);y.current=U;const j=l.useMemo(()=>T.map(w=>zn(w,{showToolCalls:D})).filter(w=>w!==null),[T,D]),A=l.useRef(!1);l.useEffect(()=>{if(A.current||b||y.current)return;A.current=!0;const w=Gn(W,{workspaceSlug:t,agentId:e,webOrigin:typeof window>"u"?null:window.location.origin});E(w?[...j,w]:j),Q(qn(W))},[e,b,j,W,t]);const _=l.useCallback(()=>{u.invalidateQueries({queryKey:["agent-thread-messages",t,e,n]}),u.invalidateQueries({queryKey:["agent-threads",t,e]})},[u,t,e,n]),O=l.useCallback(async()=>{if(d.current)return d.current;if(f.current)return f.current;if(!e)throw new Error("No agent selected");const w=(async()=>{const P=await Je(`${Fe}/lobu/api/v1/agents`,{method:"POST",headers:{"Content-Type":"application/json",...t?{"x-lobu-org":t}:{}},credentials:"include",body:JSON.stringify({agentId:e,thread:n}),timeoutMs:2e4});if(!P.ok)throw await Ze(P);const K=await P.json(),F=Ht(),N={sessionId:K.agentId,sseUrl:ot(K.sseUrl,Fe,F),messagesUrl:ot(K.messagesUrl,Fe,F)};return d.current=N,N})();f.current=w;try{return await w}catch(P){throw d.current=null,P}finally{f.current=null}},[e,t,n]),ee=l.useCallback(async(w,P,K)=>{const F=new AbortController;R.current=F;const N=C=>{E(z=>z.map(V=>V.id===K?{...V,parts:C}:V))};let oe;try{oe=await O()}catch(C){N([{type:"text",text:`Error: ${C instanceof Error?C.message:"Could not start a session."}`}]);return}let L=await et(oe.sseUrl,{throwOnFailure:!0});const me=[];let se=null;const Re=()=>{const C=se;se=null,C?.()},ce=C=>{me.push(C),Re()};let he=!1,ge=null;const Ae=new Promise(C=>{ge=C});let fe=0,we=Date.now();const pe=C=>{we=Date.now();const z=Number(C.lastEventId);Number.isFinite(z)&&z>fe&&(fe=z)},ke=["output","status","complete","closed","agent-error","question","suggestion","link-button","tool-approval","tool_use"],Se=C=>{C.addEventListener("open",()=>{he=!0,ge?.()}),C.addEventListener("connected",V=>{pe(V),he||(he=!0,ge?.())}),C.addEventListener("ping",pe);const z=V=>p=>{pe(p);const x=p;typeof x.data=="string"&&ce({kind:V,payload:lt(x)})};for(const V of ke)C.addEventListener(V,z(V));C.addEventListener("error",V=>{const p=V;if(typeof p.data=="string"&&p.data){pe(V),ce({kind:"error",payload:lt(p)});return}C.readyState===EventSource.CLOSED&&ce({kind:"error",payload:{error:"Connection closed"}})})};Se(L);const Ie=async()=>{L.close();let C=oe.sseUrl;if(fe){const z=new URL(oe.sseUrl,window.location.origin);z.searchParams.set("since",String(fe)),C=z.toString()}L=await et(C,{throwOnFailure:!1}),Se(L),we=Date.now()};await Promise.race([Ae,new Promise(C=>setTimeout(C,1500))]);const Ce=()=>{L.close(),Re()};F.signal.addEventListener("abort",Ce,{once:!0});try{const C=m.current?.trim(),z=!!C&&!g.current;z&&(g.current=!0);let V;if(P.length>0){const h=new FormData;h.set("content",w),z&&C&&h.set("ephemeralContext",C);for(const k of P)h.append("files",k,k.name);V={method:"POST",credentials:"include",body:h,timeoutMs:12e4}}else{const h={content:w};z&&C&&(h.ephemeralContext=C),V={method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(h),timeoutMs:2e4}}const p=await Je(oe.messagesUrl,V);if(!p.ok)throw d.current=null,await Ze(p);let x="",S=Oe,q=null;const te=[],$=()=>Fn({textOut:x,statusLine:S,errorText:q,toolCalls:te});for(N($());!F.signal.aborted;){if(me.length===0){let k;const re=await Promise.race([new Promise(Ue=>{se=()=>Ue(!0)}),new Promise(Ue=>{k=setTimeout(()=>Ue(!1),Yn)})]);k&&clearTimeout(k),!re&&Date.now()-we>=Xn&&(await Ie(),_());continue}const h=me.shift();if(h){if(h.kind==="output")S=null,x+=String(h.payload.content??"");else if(h.kind==="status")S=Oe;else if(h.kind==="complete"){S=null;const k=h.payload.finalText;typeof k=="string"&&k.length>0&&(x=k);const re=h.payload.suggestions;re!==void 0&&Q(Array.isArray(re)?at(re):null),_(),N($());return}else if(h.kind==="closed"){d.current=null;const k=h.payload.reason;S=`Session ended${k?`: ${k}`:""}.`,_(),N($());return}else if(h.kind==="error"||h.kind==="agent-error"){S=null,q=typeof h.payload.error=="string"&&h.payload.error?h.payload.error:"Agent reported an error.";const k=h.payload.errorContext&&typeof h.payload.errorContext=="object"?h.payload.errorContext:void 0,re=bt(h.payload.errorCode,{workspaceSlug:t,agentId:e,webOrigin:typeof window>"u"?null:window.location.origin,provider:typeof k?.provider=="string"?k.provider:void 0,model:typeof k?.model=="string"?k.model:void 0});re&&te.push({type:"tool-call",toolCallId:be("l"),toolName:"link-button",args:{label:re.label,url:re.href}}),_(),N($());return}else if(h.kind==="question")te.push({type:"tool-call",toolCallId:be("q"),toolName:"question",args:{question:h.payload.question??"",options:h.payload.options??[]}});else if(h.kind==="tool_use"){if(S=null,vt.has(h.payload.name??"")){N($());continue}const k=h.payload.result_summary,re=xt(k);if(!D&&!re){N($());continue}te.push({type:"tool-call",toolCallId:h.payload.toolCallId??be("t"),toolName:D?h.payload.name??"tool":"subscription-candidate",args:D?h.payload.input??{}:null,result:k,isError:h.payload.isError})}else if(h.kind==="suggestion"){const k=h.payload.prompts;k!==void 0&&(Q(Array.isArray(k)?at(k):null),N($()))}else if(h.kind==="link-button")te.push({type:"tool-call",toolCallId:be("l"),toolName:"link-button",args:{label:h.payload.label??"Open link",url:h.payload.url??""}});else if(h.kind==="tool-approval"){const k=h.payload.runId;if(typeof k!="number")continue;te.push({type:"tool-call",toolCallId:`run-${k}`,toolName:"tool-approval",args:{runId:k,action:h.payload.action??null,proposal:h.payload.proposal??null,current:h.payload.current??null,fields:h.payload.fields??null,attribution:h.payload.attribution??null,resourceKind:h.payload.resourceKind??null}})}N($())}}}catch(C){N([{type:"text",text:`Error: ${C instanceof Error?C.message:"Send failed."}`}])}finally{F.signal.removeEventListener("abort",Ce),L.close()}},[e,O,_,D,t]),X=l.useCallback(w=>{const P=w.trim(),K=ne.map(L=>L.file);if(!P&&K.length===0||y.current||!e)return;v.current||(v.current=!0,a?.(P||K[0]?.name||""));const F={id:be("u"),role:"user",parts:P?[{type:"text",text:P}]:[],attachments:ne.map(L=>({id:L.id,name:L.name,isImage:L.isImage,imageDataUrl:L.isImage?URL.createObjectURL(L.file):void 0})),createdAt:Date.now()},N=be("asst"),oe={id:N,role:"assistant",parts:[{type:"reasoning"}],createdAt:Date.now()};E(L=>[...L,F,oe]),H([]),Z(!0),y.current=!0,ee(P,K,N).finally(()=>{Z(!1),y.current=!1,R.current=null})},[e,a,ne,ee]),ie=l.useCallback(()=>{R.current?.abort()},[]),ae=l.useCallback(w=>{const P=Array.from(w);H(K=>[...K,...P.map(F=>({id:crypto.randomUUID(),name:F.name,file:F,isImage:F.type.startsWith("image/")}))])},[]),ye=l.useCallback(w=>{H(P=>P.filter(K=>K.id!==w))},[]),Y=l.useRef(!1);l.useEffect(()=>{if(Y.current)return;const w=zt(n);w&&(Y.current=!0,X(w))},[n,X]);const de=l.useMemo(()=>({messages:J,running:U,append:X,cancel:ie,pendingAttachments:ne,addAttachments:ae,removeAttachment:ye,initialDraft:c,agentId:e,conversationId:n,workspaceSlug:t,currentSuggestions:G}),[J,U,X,ie,ne,ae,ye,c,e,n,t,G]);return r&&b?s.jsx(vn,{}):s.jsx(Qe.Provider,{value:de,children:i})}const it="mx-0.5 inline-flex items-center gap-1 rounded-md bg-accent px-1.5 py-0.5 align-baseline font-medium text-[0.9em] text-accent-foreground no-underline";function Jn({refItem:e}){const t=jn[e.kind]??Wt;return Tn(e.path)?s.jsxs("span",{className:it,children:[s.jsx(t,{className:"h-3 w-3 shrink-0 opacity-70"}),e.label]}):s.jsxs(pt,{to:e.path,className:M(it,"hover:bg-accent/80"),children:[s.jsx(t,{className:"h-3 w-3 shrink-0 opacity-70"}),e.label]})}const Xe=({text:e,renderText:t})=>Sn(e)?s.jsx(s.Fragment,{children:Cn(e).map((n,r)=>n.type==="ref"?s.jsx(Jn,{refItem:n.ref},`r${r}`):s.jsx("span",{children:t(n.text)},`t${r}`))}):s.jsx(s.Fragment,{children:t(e)}),Zn=({label:e="Thinking"})=>s.jsx("span",{className:"aui-thinking-shimmer inline-block text-sm","aria-live":"polite","aria-busy":"true",children:e}),Rt=l.createContext(null),wt=()=>{const e=l.useContext(Rt);if(!e)throw new Error("ChainOfThought components must be used within ChainOfThought");return e},St=l.memo(({className:e,open:t,defaultOpen:n=!1,onOpenChange:r,children:o,...a})=>{const[i,c]=Kt({prop:t,defaultProp:n,onChange:r}),u=l.useMemo(()=>({isOpen:i,setIsOpen:c}),[i,c]);return s.jsx(Rt.Provider,{value:u,children:s.jsx("div",{className:M("not-prose max-w-prose space-y-4",e),...a,children:o})})}),Ct=l.memo(({className:e,children:t,...n})=>{const{isOpen:r,setIsOpen:o}=wt();return s.jsx(mt,{onOpenChange:o,open:r,children:s.jsxs(qt,{className:M("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...n,children:[s.jsx(Gt,{className:"size-4"}),s.jsx("span",{className:"flex-1 text-left",children:t??"Chain of Thought"}),s.jsx(Qt,{className:M("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),jt=l.memo(({className:e,icon:t=Yt,label:n,description:r,status:o="complete",children:a,...i})=>{const c={complete:"text-muted-foreground",active:"text-foreground",pending:"text-muted-foreground/50"};return s.jsxs("div",{className:M("flex gap-2 text-sm",c[o],"fade-in-0 slide-in-from-top-2 animate-in",e),...i,children:[s.jsxs("div",{className:"relative mt-0.5",children:[s.jsx(t,{className:"size-4"}),s.jsx("div",{className:"-mx-px absolute top-7 bottom-0 left-1/2 w-px bg-border"})]}),s.jsxs("div",{className:"flex-1 space-y-2 overflow-hidden",children:[s.jsx("div",{children:n}),r&&s.jsx("div",{className:"text-muted-foreground text-xs",children:r}),a]})]})}),Tt=l.memo(({className:e,children:t,...n})=>{const{isOpen:r}=wt();return s.jsx(mt,{open:r,children:s.jsx(Xt,{className:M("mt-2 space-y-3","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:t})})});St.displayName="ChainOfThought";Ct.displayName="ChainOfThoughtHeader";jt.displayName="ChainOfThoughtStep";Tt.displayName="ChainOfThoughtContent";function er(e){return{contentIds:e.filter(n=>Number.isSafeInteger(n)&&n>0),sortBy:"date",sortOrder:"asc"}}function tr({ownerSlug:e,eventIds:t}){const n=t.join(","),r=l.useMemo(()=>er(n.split(",").map(Number)),[n]);return r.contentIds.length===0?null:s.jsx(Jt,{owner:e,children:({organizationId:o,ownerSlug:a})=>o?s.jsx(kn,{organizationId:o,ownerSlug:a,filters:r,dense:!0,hideOriginator:!0}):null})}function nr({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:o}){let a=Be(rr(r,o),t);if(!n)return l.createElement(e,a);if(typeof n=="function")return n(a,r);if(!l.isValidElement(n))return null;let i=n.props,c={...Be(a,i),ref:Ee(a.ref,i.ref)};return l.cloneElement(n,c)}function Be(...e){let t={};for(let n of e){if(!n)continue;let r=n;for(let o of Object.keys(r)){let a=r[o];if(a===void 0)continue;let i=t[o];o==="className"?t[o]=[i,a].filter(Boolean).join(" "):o==="style"?t[o]={...i,...a}:o==="ref"?t[o]=Ee(i,a):sr(o)&&typeof i=="function"&&typeof a=="function"?t[o]=or(a,i):t[o]=a}}return t}function rr(e,t){let n={};for(let r of Object.keys(e)){let o=e[r],a=t?.[r]?.(o);if(a){Object.assign(n,a);continue}if(r==="slot"){n["data-slot"]=o;continue}let i=`data-${String(r).replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`)}`;typeof o=="boolean"?n[i]=o?"":void 0:o!=null&&(n[i]=String(o))}return n}function or(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function sr(e){return/^on[A-Z]/.test(e)}function Ee(...e){let t=e.filter(Boolean);if(t.length!==0)return n=>{for(let r of t)typeof r=="function"?r(n):r&&(r.current=n)}}var lr=8,ar=64,ir=0,Pe=.5,cr=180,ur=new Set(["ArrowDown","ArrowUp","End","Home","PageDown","PageUp"," "]),Nt={start:!1,end:!1},dr=[],Me={currentAnchorId:null,visibleMessageIds:dr};function fr({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Nt;let o=Ye({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:o-r.scrollTop-r.clientHeight>t}}function pr({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:o,visibleMessageIds:a}){if(!e||!o)return Me;let i=o.getBoundingClientRect(),c=i.top+t+n,u=typeof IntersectionObserver>"u",d=[],f=null;for(let v of je(e,r)){let m=v.dataset.messageId;if(!m)continue;let g=v.dataset.scrollAnchor==="true",R=g||u?v.getBoundingClientRect():null;(u&&R?R.bottom>c&&R.top<i.bottom:a.has(m))&&d.push(m),g&&R&&R.top<=c+Pe&&(f=m)}return d.length===0&&f===null?Me:{currentAnchorId:f,visibleMessageIds:d}}function je(e,t){return Array.from(e.children).filter(n=>n instanceof HTMLElement&&n!==t)}function mr(e,t){for(let n=t;n<e.length;n++){let r=e[n];if(r?.dataset.scrollAnchor==="true")return r}return null}function hr(e,t){for(let n of e)if(n.dataset.scrollAnchor==="true"&&!t.has(n))return n;return null}function gr(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor==="true"&&(n+=1,n>1))return!0;return!1}function br(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor==="true")return n}return null}function xr({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let o of je(e,t)){if(!o.dataset.messageId)continue;let a=o.getBoundingClientRect();if(a.bottom>r.top&&a.top<r.bottom)return o}return null}function vr({align:e,element:t,scrollMargin:n,spacer:r,viewport:o}){let a=Et(t,o),i=t.getBoundingClientRect().height,c=wr(r);if(e==="center"){let u=Math.max(0,o.clientHeight-c.start-c.end);return a-c.start-(u-i)/2-n}if(e==="end")return a-o.clientHeight+i+c.end+n;if(e==="nearest"){let u=a+i,d=o.scrollTop+c.start,f=o.scrollTop+o.clientHeight-c.end;return a>=d&&u<=f?o.scrollTop:a<d?a-c.start-n:u-o.clientHeight+c.end+n}return a-c.start-n}function Et(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function _e(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function yr({content:e,scrollTop:t,spacer:n,viewport:r}){let o=Ye({content:e,spacer:n,viewport:r});return t+r.clientHeight-o}function Ye({content:e,spacer:t,viewport:n}){let r=je(e,t),o=At(e),a=n.getBoundingClientRect(),i=n.scrollTop,c=o.start+o.end;for(let u of r){let d=u.getBoundingClientRect();c=Math.max(c,d.bottom-a.top+i+o.end)}return c}function Rr(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function At(e){let t=window.getComputedStyle(e);return{end:He(t.paddingBlockEnd||t.paddingBottom),start:He(t.paddingBlockStart||t.paddingTop)}}function wr(e){let t=e?.parentElement;return t?At(t):{end:0,start:0}}function Sr(e){if(!e)return 0;let t=window.getComputedStyle(e),n=t.rowGap==="normal"?t.gap:t.rowGap;return He(n)}function He(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function Cr({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:o,autoScrollRef:a,autoscrollingRef:i,autoscrollingTimeoutRef:c,contentRef:u,defaultScrollPositionAppliedRef:d,itemCountRef:f,messageElementsRef:v,modeRef:m,pendingScrollToMessageRef:g,prependRestoreRef:R,scrollMarginRef:I,scrollPreviousItemPeekRef:b,spacerGapRef:T,spacerHeightRef:W,spacerRef:B,viewportRef:D}=e,J=l.useCallback(y=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null),i.current!==y&&(i.current=y,t()),y&&(c.current=window.setTimeout(()=>{c.current=null,i.current=!1,t()},cr))},[t]),E=l.useCallback(y=>{let j=B.current;if(!j)return;let A=Math.max(0,Math.ceil(y));W.current!==A&&(W.current=A,j.hidden=A===0,j.style.height=`${A}px`,j.style.marginTop=A>0?`${-T.current}px`:"")},[]),U=l.useCallback((y,{behavior:j="auto",autoscrolling:A=!1}={})=>{let _=D.current;if(!_)return;let O=Math.max(0,y);if(Math.abs(_.scrollTop-O)<=Pe){_.scrollTop=O,t();return}A&&J(!0),_.scrollTo({top:O,behavior:j}),n()},[t,n,J]),Z=l.useCallback(({behavior:y="auto"}={})=>D.current?(E(0),o.current=null,m.current="free-scrolling",U(0,{behavior:y}),r(),!0):!1,[r,U,E]),ne=l.useCallback(({behavior:y="auto"}={})=>{let j=D.current;return j?(E(0),o.current=null,m.current=a.current?"following-bottom":"free-scrolling",U(Rr(j),{autoscrolling:!0,behavior:y}),r(),!0):!1},[r,U,E]),H=l.useCallback((y,{align:j="start",behavior:A="auto",scrollMargin:_=I.current}={},{keepPreviousPeek:O=!1}={})=>{let ee=u.current,X=D.current;if(!ee||!X||!ee.contains(y))return!1;let ie=vr({align:j,element:y,scrollMargin:O?_+b.current:_,spacer:B.current,viewport:X}),ae=yr({content:ee,scrollTop:ie,spacer:B.current,viewport:X});return E(ae),R.current={element:y,viewportTop:_e(y,X)},m.current=O?"anchored-to-message":"settling-jump",o.current=O?y:null,U(ie,{behavior:A}),r(),!0},[r,U,E]),G=l.useCallback(()=>{let y=o.current;return!y||!y.isConnected||m.current!=="anchored-to-message"?!1:H(y,{align:"start"},{keepPreviousPeek:!0})},[H]),Q=l.useCallback((y,j)=>{let A=v.current.get(y);return A?(d.current=!0,H(A,j)?(g.current=null,!0):(g.current={messageId:y,options:j},!0)):f.current===0?(g.current={messageId:y,options:j},d.current=!0,!0):!1},[H]);return{flushPendingScrollToMessage:l.useCallback(()=>{let y=g.current;if(!y)return!1;let j=v.current.get(y.messageId);return!j||!H(j,y.options)?!1:(g.current=null,d.current=!0,!0)},[H]),reanchorToAnchoredMessage:G,scrollToElement:H,scrollToEnd:ne,scrollToMessage:Q,scrollToStart:Z}}function kt(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:o=>{t(n,o)||(n=o,r.forEach(a=>a()))},subscribe:(o,a,i)=>{let c=r.size===0;return r.add(o),c&&a?.(),()=>{r.delete(o),r.size===0&&i?.()}}}}function jr(e,t){return kt(e,t)}function Tr(){return kt(Me,Er)}function Nr(e,t){return e.start===t.start&&e.end===t.end}function Er(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((n,r)=>n===t.visibleMessageIds[r])}function Ar({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let o=l.useRef(e),a=l.useRef(!1),i=l.useRef(null),c=l.useRef(!1),u=l.useRef(t),d=l.useRef(0),f=l.useRef(null),v=l.useRef(0),m=l.useRef(e?"following-bottom":"free-scrolling"),g=l.useRef(new Map),R=l.useRef(null),I=l.useRef(null),b=l.useRef(null),T=l.useRef(r),W=l.useRef(!0),B=l.useRef(null),D=l.useRef(n),J=l.useRef(null),E=l.useRef(0),U=l.useRef(0),Z=l.useRef(null),ne=l.useRef(null),H=l.useRef(null),G=l.useRef(null),Q=l.useRef(null),y=l.useRef(null),j=l.useRef(null),A=l.useRef(null),_=l.useRef(new Set),O=l.useRef(new WeakSet);return H.current===null&&(H.current=jr(Nt,Nr)),A.current===null&&(A.current=Tr()),o.current=e,u.current=t,D.current=n,T.current=r,{autoScrollRef:o,autoscrollingRef:a,autoscrollingTimeoutRef:G,streamingTurnRef:b,contentRef:i,defaultScrollPositionAppliedRef:c,firstItemRef:f,itemCountRef:d,lastScrollTopRef:v,messageElementsRef:g,modeRef:m,pendingScrollFrameRef:J,pendingScrollToMessageRef:R,prependRestoreRef:I,preserveScrollOnPrependRef:W,rootRef:B,scrollEdgeThresholdRef:u,scrollMarginRef:D,scrollPreviousItemPeekRef:T,spacerGapRef:E,spacerHeightRef:U,spacerRef:Z,stateFrameRef:ne,stateStore:H.current,viewportRef:Q,visibilityFrameRef:y,visibilityObserverRef:j,visibilityStore:A.current,visibleMessageIdsRef:_,handledScrollAnchorsRef:O}}function ct(e,t){return l.useCallback(n=>{e.current=n,n&&t()},[e,t])}function kr({autoScroll:e=!1,defaultScrollPosition:t="end",scrollEdgeThreshold:n=lr,scrollPreviousItemPeek:r=ar,scrollMargin:o=ir}){let a=Ar({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:o,scrollPreviousItemPeek:r}),{streamingTurnRef:i,autoScrollRef:c,autoscrollingRef:u,autoscrollingTimeoutRef:d,contentRef:f,defaultScrollPositionAppliedRef:v,firstItemRef:m,itemCountRef:g,lastScrollTopRef:R,messageElementsRef:I,modeRef:b,pendingScrollFrameRef:T,pendingScrollToMessageRef:W,prependRestoreRef:B,preserveScrollOnPrependRef:D,rootRef:J,scrollEdgeThresholdRef:E,scrollMarginRef:U,scrollPreviousItemPeekRef:Z,spacerGapRef:ne,spacerHeightRef:H,spacerRef:G,stateFrameRef:Q,stateStore:y,viewportRef:j,visibilityFrameRef:A,visibilityObserverRef:_,visibilityStore:O,visibleMessageIdsRef:ee,handledScrollAnchorsRef:X}=a,ie=l.useRef(t);ie.current!==t&&(ie.current=t,v.current=!1);let ae=l.useCallback(p=>{let x=J.current,S=j.current,q=[p.start&&"start",p.end&&"end"].filter(Boolean).join(" "),te=u.current;for(let $ of[x,S])$&&(q?$.setAttribute("data-scrollable",q):$.removeAttribute("data-scrollable"),$.toggleAttribute("data-autoscrolling",te))},[]),ye=l.useCallback(p=>{let x=j.current?.scrollTop??0,S=x<R.current-Pe;R.current=x,c.current&&!p.end&&b.current!=="settling-jump"&&b.current!=="anchored-to-message"?b.current="following-bottom":b.current==="following-bottom"&&p.end&&S&&!u.current&&(b.current="free-scrolling")},[]),Y=l.useCallback(()=>{let p=fr({content:f.current,scrollEdgeThreshold:E.current,spacer:G.current,viewport:j.current});ye(p);let x=b.current==="following-bottom"?{...p,end:!1}:p;ae(x),y.setSnapshot(x)},[ye,y,ae]),de=l.useCallback(()=>{Q.current===null&&(Q.current=window.requestAnimationFrame(()=>{Q.current=null,Y()}))},[Y]),w=l.useCallback(()=>{O.hasListeners()&&A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,O.hasListeners()&&O.setSnapshot(pr({content:f.current,scrollMargin:U.current,scrollPreviousItemPeek:Z.current,spacer:G.current,viewport:j.current,visibleMessageIds:ee.current}))}))},[O]),{flushPendingScrollToMessage:P,reanchorToAnchoredMessage:K,scrollToElement:F,scrollToEnd:N,scrollToMessage:oe,scrollToStart:L}=Cr({refs:a,commitScrollState:Y,scheduleStateCommit:de,scheduleVisibilitySync:w}),me=l.useCallback(()=>{let p=B.current,x=j.current;if(!p||!x||!p.element.isConnected)return!1;let S=_e(p.element,x)-p.viewportTop;return Math.abs(S)<=Pe?!1:(x.scrollTop+=S,p.viewportTop=_e(p.element,x),de(),w(),!0)},[de,w]),se=l.useCallback(()=>{let p=f.current,x=j.current;if(!p||!x){B.current=null;return}let S=xr({content:p,spacer:G.current,viewport:x});B.current=S?{element:S,viewportTop:_e(S,x)}:null},[]),Re=l.useCallback(()=>{T.current===null&&(T.current=window.requestAnimationFrame(()=>{T.current=null,P()&&se()}))},[se,P]),ce=l.useCallback(()=>{if(!t||v.current||g.current===0)return!1;let p=!1;if(t==="last-anchor"){let x=f.current,S=j.current,q=x&&S?br(je(x,G.current)):null;if(!x||!S||!q)p=N({behavior:"auto"});else{let te=Et(q,S);p=Ye({content:x,spacer:G.current,viewport:S})-te<=S.clientHeight?N({behavior:"auto"}):F(q,{align:"start"},{keepPreviousPeek:!0})}}else p=t==="end"?N({behavior:"auto"}):L({behavior:"auto"});return p?(v.current=!0,!0):!1},[t,F,N,L]),he=l.useCallback(()=>{let p=f.current;if(!p)return;let x=je(p,G.current),S=g.current,q=m.current;g.current=x.length,m.current=x[0]??null,(()=>{if(P())return;if(S===0){if(ce()||x.length>0&&c.current&&N({behavior:"auto"}))return;Y(),w();return}let te=q?x.indexOf(q):-1;if(D.current&&te>0){me();return}if(x.length>S){let $=mr(x,S);if($){if(c.current&&b.current==="following-bottom"&&gr(x,S)){N({behavior:"auto"});return}F($,{align:"start"},{keepPreviousPeek:!0}),X.current.add($);return}}if(x.length===S){let $=hr(x,X.current);if($){F($,{align:"start"},{keepPreviousPeek:!0}),X.current.add($);return}}b.current==="following-bottom"&&c.current?N({behavior:"auto"}):(Y(),w())})(),se()},[ce,se,Y,P,me,w,F,N]),ge=l.useCallback(()=>{if(b.current==="following-bottom"&&c.current){N({behavior:"auto"});return}let p=H.current;if(K()){c.current&&p>0&&H.current===0&&N({behavior:"auto"});return}de(),w()},[K,de,w,N]),Ae=l.useCallback(()=>{let p=j.current;if(!(!p||!O.hasListeners())){if(typeof IntersectionObserver>"u"){w();return}_.current||(_.current=new IntersectionObserver(x=>{for(let S of x){let q=S.target.dataset.messageId;q&&(S.isIntersecting?ee.current.add(q):ee.current.delete(q))}w()},{root:p,rootMargin:`${-(U.current+Z.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]})),I.current.forEach(x=>{_.current?.observe(x)}),w()}},[w,O]),fe=l.useCallback(()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),_.current?.disconnect(),_.current=null,ee.current.clear(),O.setSnapshot(Me)},[O]),we=l.useCallback((p,x,S)=>{if(x){I.current.set(p,x),_.current?.observe(x),w(),W.current?.messageId===p&&Re();return}S&&I.current.get(p)===S&&(I.current.delete(p),ee.current.delete(p),_.current?.unobserve(S),w())},[Re,w]),pe=l.useCallback(()=>{(b.current==="following-bottom"||b.current==="anchored-to-message"||b.current==="settling-jump")&&(i.current=null,b.current="free-scrolling")},[]),ke=l.useCallback(()=>ae(y.getSnapshot()),[y,ae]),Se=ct(J,ke),Ie=ct(j,ke),Ce=l.useCallback(p=>{f.current=p},[]),C=l.useCallback(p=>{G.current=p,ne.current=Sr(p?.parentElement??null)},[]),z=l.useCallback(()=>{Y(),w(),se()},[se,Y,w]),V=l.useMemo(()=>({handleContentChange:he,handleResize:ge,observeVisibility:Ae,preserveScrollOnPrependRef:D,scrollToEnd:N,scrollToMessage:oe,scrollToStart:L,setContentElement:Ce,setRootElement:Se,setSpacerElement:C,setViewportElement:Ie,stateStore:y,syncAfterScroll:z,unobserveVisibility:fe,userScrollIntent:pe,viewportRef:j,visibilityStore:O}),[he,ge,Ae,N,oe,L,Ce,Se,C,Ie,y,z,fe,pe,O]);return l.useLayoutEffect(()=>{ce()},[ce]),l.useEffect(()=>()=>{Q.current!==null&&(window.cancelAnimationFrame(Q.current),Q.current=null),A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),d.current!==null&&(window.clearTimeout(d.current),d.current=null),T.current!==null&&(window.cancelAnimationFrame(T.current),T.current=null),_.current?.disconnect(),_.current=null},[]),l.useLayoutEffect(()=>{if(e&&b.current==="following-bottom"&&g.current>0){N({behavior:"auto"});return}Y()},[e,Y,N]),{context:V,registerMessage:we}}function Ir(e){let t=l.useRef(e);return t.current=e,t}var It=l.createContext(null),_t=l.createContext(null);function xe(){let e=l.useContext(It);if(!e)throw new Error("useMessageScroller must be used within a MessageScroller.");return e}function _r(){let e=l.useContext(_t);if(!e)throw new Error("MessageScrollerItem must be used within a MessageScroller.");return e}function Ot(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=xe();return l.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function Pt(){let{observeVisibility:e,unobserveVisibility:t,visibilityStore:n}=xe(),r=l.useCallback(o=>n.subscribe(o,e,t),[e,t,n]);return l.useSyncExternalStore(r,n.getSnapshot,n.getSnapshot)}function Or({autoScroll:e=!1,children:t,defaultScrollPosition:n="end",scrollEdgeThreshold:r,scrollPreviousItemPeek:o,scrollMargin:a}){let{context:i,registerMessage:c}=kr({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:o,scrollMargin:a});return s.jsx(It.Provider,{value:i,children:s.jsx(_t.Provider,{value:c,children:t})})}function Pr({children:e,...t}){let{setRootElement:n}=xe();return s.jsx("div",{ref:n,...t,children:e})}function Mr({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:o,onWheel:a,preserveScrollOnPrepend:i=!0,ref:c,role:u,tabIndex:d,...f}){let{handleResize:v,preserveScrollOnPrependRef:m,setViewportElement:g,syncAfterScroll:R,userScrollIntent:I,viewportRef:b}=xe();m.current=i;let T=l.useCallback(E=>{g(E),Ee(c)?.(E)},[c,g]);function W(E){R(),r?.(E)}function B(E){I(),a?.(E)}function D(E){I(),o?.(E)}function J(E){ur.has(E.key)&&I(),n?.(E)}return l.useEffect(()=>{let E=b.current;if(!E||typeof ResizeObserver>"u")return;let U=0,Z=new ResizeObserver(()=>{window.cancelAnimationFrame(U),U=window.requestAnimationFrame(v)});return Z.observe(E),()=>{window.cancelAnimationFrame(U),Z.disconnect()}},[v,b]),s.jsx("div",{ref:T,role:u??"region","aria-label":e??"Messages",tabIndex:d??0,onKeyDown:J,onScroll:W,onTouchMove:D,onWheel:B,...f,children:t})}function Lr({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:o,...a}){let{handleContentChange:i,handleResize:c,setContentElement:u,setSpacerElement:d}=xe(),f=l.useRef(null),v=l.useCallback(m=>{f.current=m,u(m),Ee(n)?.(m)},[n,u]);return l.useLayoutEffect(()=>{let m=f.current;if(!m||(i(),typeof MutationObserver>"u"))return;let g=new MutationObserver(()=>{i()});return g.observe(m,{childList:!0}),()=>g.disconnect()},[i]),l.useEffect(()=>{let m=f.current;if(!m||typeof ResizeObserver>"u")return;let g=0,R=new ResizeObserver(()=>{window.cancelAnimationFrame(g),g=window.requestAnimationFrame(c)});return R.observe(m),()=>{window.cancelAnimationFrame(g),R.disconnect()}},[c]),s.jsxs("div",{ref:v,role:r??"log","aria-relevant":e??"additions",...a,children:[t,s.jsx("div",{ref:d,"aria-hidden":"true","data-message-scroller-spacer":"",hidden:!0,className:o})]})}function $r({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let o=_r(),a=l.useRef(null),i=l.useCallback(c=>{let u=a.current;a.current=c,e&&o(e,c,u),Ee(t)?.(c)},[e,t,o]);return s.jsx("div",{ref:i,"data-message-id":e,"data-scroll-anchor":n?"true":"false",...r})}function Dr({behavior:e="smooth",children:t,direction:n="end",onClick:r,render:o,tabIndex:a,type:i="button",...c}){let{scrollToEnd:u,scrollToStart:d,stateStore:f}=xe(),v=Ir(r),m=l.useCallback(b=>f.subscribe(b),[f]),g=l.useCallback(()=>{let b=f.getSnapshot();return n==="start"?b.start:b.end},[n,f]),R=l.useSyncExternalStore(m,g,g),I=l.useCallback(b=>{R&&(v.current?.(b),b.defaultPrevented||(b.currentTarget.blur(),n==="start"?d({behavior:e}):u({behavior:e})))},[e,n,R,v,u,d]);return nr({defaultTagName:"button",props:Be({type:i,inert:!R,tabIndex:R?a:-1,children:t??s.jsxs("span",{children:["Scroll to ",n]}),onClick:I},c),render:o,state:{active:R,direction:n},stateAttributesMapping:{active:b=>({"data-active":b?"true":"false"})}})}var ve={Provider:Or,Root:Pr,Viewport:Mr,Content:Lr,Item:$r,Button:Dr};const Ur=ve.Provider;function Fr({className:e,...t}){return s.jsx(ve.Root,{className:M("relative flex size-full min-h-0 flex-col overflow-hidden",e),...t})}function Vr({className:e,...t}){return s.jsx(ve.Viewport,{className:M("size-full min-h-0 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]",e),...t})}function Br({className:e,...t}){return s.jsx(ve.Content,{className:M("flex h-max min-h-full flex-col",e),...t})}function Hr({className:e,...t}){return s.jsx(ve.Item,{className:M("min-w-0 shrink-0",e),...t})}function zr({className:e,...t}){return s.jsx(ve.Button,{direction:"end",behavior:"smooth",render:({active:n,...r})=>n?s.jsx(ue,{...r,type:"button",variant:"outline",size:"icon",className:M("absolute right-4 bottom-4 z-20 rounded-full bg-background ",e),"aria-label":"Scroll to latest message",children:s.jsx(Zt,{})}):null,...t})}function Wr(e){if(!e)return"";const t=e.startsWith("?")?e.slice(1):e,n=new URLSearchParams(t);return n.get("message_id")?.trim()||n.get("message")?.trim()||""}function Kr(e){const t=e.scrollTarget.trim();return t?e.alreadyScrolledTo===t?{scroll:!1}:e.messageIds.includes(t)?{scroll:!0,id:t}:{scroll:!1}:{scroll:!1}}const qr="lobu-spa";function ut(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function Le(e,t){return t.type==="tool-call"?`tc-${t.toolCallId}`:t.type==="reasoning"?`${e.id}-reasoning`:t.type==="bash"?`${e.id}-bash-${t.command.slice(0,24)}`:t.type==="error"?`${e.id}-error`:`${e.id}-text-${t.text.slice(0,24)}`}const Oo=({afterMessagesContent:e,readOnly:t=!1,readerPositionMode:n="messages",interactionExtension:r,onRunSelect:o})=>{const{messages:a,agentId:i,conversationId:c}=Ne(),{data:u=[]}=en(i,{conversationId:c});return s.jsx(_n,{extension:r,children:s.jsxs("div",{"data-agent-thread":!0,className:"flex min-h-0 flex-1 flex-col",children:[s.jsx(Gr,{messages:a,trips:u,mode:n,afterMessagesContent:e,onRunSelect:o}),t?null:s.jsx("div",{className:yn,children:s.jsx(Co,{})})]})})},Gr=({messages:e,trips:t,mode:n,afterMessagesContent:r,onRunSelect:o})=>s.jsx(Ur,{autoScroll:!0,defaultScrollPosition:n==="runs"?"last-anchor":"end",scrollPreviousItemPeek:48,children:s.jsx(Xr,{messages:e,trips:t,mode:n,afterMessagesContent:r,onRunSelect:o})});function Qr(e){if(!e.startsWith("sep:"))return null;const t=Number(e.slice(4));return Number.isFinite(t)&&t>0?t:null}const Xr=({messages:e,trips:t,mode:n,afterMessagesContent:r,onRunSelect:o})=>{const{currentAnchorId:a}=Pt(),{scrollToMessage:i}=Ot(),c=l.useRef(null);l.useEffect(()=>{if(e.length===0||typeof window>"u")return;const d=Kr({messageIds:e.map(f=>f.id),scrollTarget:Wr(window.location.search),alreadyScrolledTo:c.current});d.scroll&&(c.current=d.id,i(d.id,{align:"start",behavior:"smooth"}))},[e,i]);const u=d=>n==="runs"?d.id.startsWith("sep:"):d.role==="user";return s.jsxs(Fr,{children:[s.jsx(Vr,{"aria-label":n==="runs"?"Automation run history":"Conversation",children:s.jsxs(Br,{className:M(Ke,Rn),children:[e.map(d=>{const f=n==="runs"&&o?Qr(d.id):null;return s.jsx(Hr,{messageId:d.id,scrollAnchor:u(d),"aria-current":d.id===a?"location":void 0,className:M("flex flex-col",n==="runs"&&u(d)&&"border-l-2 border-transparent pl-2 transition-colors",n==="runs"&&d.id===a&&"border-primary"),children:f!=null?s.jsx(fo,{message:d,onClick:()=>o?.(f)}):s.jsx(to,{message:d})},d.id)}),t.map(d=>s.jsx(Jr,{trip:d},d.id)),s.jsx(eo,{}),r?s.jsx("div",{className:"mt-auto shrink-0 py-2",children:r}):null]})}),e.length>0?s.jsx(Yr,{messages:e,mode:n}):null,s.jsx(zr,{})]})},Yr=({messages:e,mode:t})=>{const{scrollToMessage:n}=Ot(),{currentAnchorId:r,visibleMessageIds:o}=Pt(),a=t==="runs"?e.flatMap(c=>c.parts).filter(c=>c.type==="tool-call"&&c.toolName==="tool-approval"&&c.args!==null&&typeof c.args=="object"&&c.args.status==="pending").length:0,i=e.flatMap(c=>{if(!(t==="runs"?c.id.startsWith("sep:"):c.role==="user"))return[];const d=c.parts.find(f=>f.type==="text");return[{id:c.id,label:d?.type==="text"?d.text:"Automation run"}]});return i.length===0?null:s.jsxs(sn,{children:[s.jsx(ln,{asChild:!0,children:s.jsxs(ue,{type:"button",variant:"outline",size:"icon",className:M("absolute top-1/2 right-4 z-20 -translate-y-1/2 rounded-full bg-background/95 ",a>0&&"w-auto px-3"),"aria-label":a>0?`Open transcript outline, ${a} ${a===1?"approval":"approvals"} waiting`:"Open transcript outline",children:[s.jsx(an,{}),a>0?s.jsxs("span",{className:"text-xs tabular-nums",children:[a," waiting"]}):null]})}),s.jsxs(cn,{side:"left",align:"center",className:"w-80 space-y-3 p-3",children:[s.jsxs("div",{className:"px-1",children:[s.jsx("p",{className:"text-sm font-medium",children:"Transcript outline"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t==="runs"?"Track and jump between Automation runs.":"Track and jump between your messages."})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-y-auto",children:i.map(c=>{const u=c.id===r,d=o.includes(c.id);return s.jsxs(ue,{type:"button",variant:u?"secondary":"ghost",className:"h-auto w-full justify-start gap-2 px-2 py-2 text-left text-xs font-normal","aria-current":u?"location":void 0,onClick:()=>n(c.id,{align:"start",behavior:"smooth"}),children:[s.jsx("span",{className:M("size-1.5 shrink-0 rounded-full bg-muted-foreground/30",d&&"bg-primary/60",u&&"bg-primary")}),s.jsx("span",{className:"line-clamp-2",children:c.label})]},c.id)})})]})]})},Jr=({trip:e})=>s.jsxs("div",{className:M(Ke,"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive"),children:[s.jsx(on,{className:"mt-0.5 size-4 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"font-medium",children:["Guardrail blocked: ",e.guardrailName," ",s.jsxs("span",{className:"font-normal opacity-70",children:["(",e.stage,")"]})]}),e.reason?s.jsx("div",{className:"mt-0.5 break-words opacity-80",children:e.reason}):null]})]}),Zr=({prompts:e,onPick:t,className:n})=>e.length===0?null:s.jsx("div",{className:M("flex flex-wrap gap-2",n),children:e.map(r=>s.jsx(ue,{type:"button",variant:"outline",size:"sm",className:"h-auto rounded-full whitespace-normal text-left",title:r.message,"aria-label":`${r.title}: ${r.message}`,onClick:()=>t(r.message),children:r.title},`${r.title}\0${r.message}`))}),eo=()=>{const{currentSuggestions:e,running:t,append:n}=Ne();return t||!e||e.length===0?null:s.jsx(Zr,{prompts:e,className:Ke,onPick:r=>n(r)})},to=({message:e})=>e.role==="user"?s.jsx(no,{message:e}):e.role==="system"?s.jsx(po,{message:e}):s.jsx(so,{message:e}),Mt=({attachment:e})=>{const t=e.isImage?e.imageDataUrl??e.url:void 0;if(t)return s.jsx("a",{href:e.url??t,target:"_blank",rel:"noreferrer",children:s.jsx("img",{src:t,alt:e.name,className:"max-h-64 rounded-lg border object-contain"})});const n=s.jsxs(s.Fragment,{children:[s.jsx(Ve,{className:"h-3 w-3 shrink-0"}),s.jsx("span",{className:"max-w-[14rem] truncate",children:e.name})]});return s.jsx("div",{className:"flex items-center gap-1.5 rounded-md border bg-background px-2 py-1 text-xs",children:e.url?s.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1.5 hover:underline",children:n}):n})},no=({message:e})=>{const t=e.parts.filter(n=>n.type==="bash");return t.length>0?s.jsx("div",{className:ht,children:s.jsx("div",{className:"space-y-2",children:t.map(n=>s.jsx(ro,{part:n},Le(e,n)))})}):s.jsx("div",{className:wn,children:s.jsxs("div",{className:M(Te,"px-3 py-2 text-sm"),children:[e.attachments&&e.attachments.length>0?s.jsx("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:e.attachments.map(n=>s.jsx(Mt,{attachment:n},n.id))}):null,e.parts.map(n=>n.type==="text"?s.jsx("div",{className:"whitespace-pre-wrap break-words",children:s.jsx(Xe,{text:n.text,renderText:r=>r})},Le(e,n)):null)]})})},ro=({part:e})=>{const t=e.cancelled||e.exitCode!==void 0&&e.exitCode!==0;return s.jsxs("div",{className:M(Te,"overflow-hidden text-xs"),children:[s.jsxs("div",{className:"flex items-center gap-1.5 border-border/60 border-b px-3 py-1.5",children:[s.jsx(un,{className:"size-3.5 shrink-0 text-muted-foreground"}),s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-foreground/90",children:e.command}),e.cancelled?s.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-medium text-[10px] text-muted-foreground",children:"cancelled"}):t?s.jsxs("span",{className:"rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-[10px] text-destructive",children:["exit ",e.exitCode]}):null]}),e.output.trim()?s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words px-3 py-2 font-mono text-foreground/80",children:e.output}):null]})},Lt=new Set(["question","link-button","tool-approval"]),oo="subscription-candidate",so=({message:e})=>{const t=qe(),{agentId:n,workspaceSlug:r}=Ne(),o=u=>u.type==="tool-call"&&(Lt.has(u.toolName)||t?.toolNames.has(u.toolName)),a=e.parts.filter(u=>u.type==="tool-call"&&!o(u)&&u.toolName!==oo),i=e.parts.filter(u=>u.type!=="tool-call"||o(u)),c=e.parts.flatMap(u=>{if(u.type!=="tool-call")return[];const d=xt(u.result);return d?[d]:[]});return s.jsx("div",{className:ht,children:s.jsxs("div",{className:"space-y-2 text-sm",children:[a.length>0?s.jsx(io,{tools:a,workspaceSlug:r}):null,n&&r?c.map(u=>s.jsx(lo,{candidate:u,agentId:n,workspaceSlug:r},`${u.connector_key}:${u.resource_ref}`)):null,i.map(u=>s.jsx(uo,{part:u},Le(e,u))),e.attachments&&e.attachments.length>0?s.jsx("div",{className:"flex flex-wrap gap-2",children:e.attachments.map(u=>s.jsx(Mt,{attachment:u},u.id))}):null]})})},lo=({candidate:e,agentId:t,workspaceSlug:n})=>s.jsxs("div",{className:M(Te,"flex items-center justify-between gap-3 p-3"),children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:e.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Run this agent when the resource changes."})]}),s.jsx(ue,{asChild:!0,size:"sm",variant:"outline",className:"shrink-0",children:s.jsxs(pt,{to:"/$owner/automations/new",params:{owner:n},search:{agent:t,platform:e.connector_key,resource_type:e.resource_type,resource:e.resource_ref,events:e.suggested_event_keys?.join(","),label:e.label},children:[s.jsx(fn,{className:"mr-1.5 h-4 w-4"}),"Add automation"]})})]});function ao(e){try{return JSON.parse(e)}catch{return null}}function $t(e){if(Array.isArray(e)){const o=e.flatMap(a=>a?.type==="text"&&typeof a.text=="string"?$t(a.text)??[]:[]);return o.length>0?[...new Set(o)]:null}const t=typeof e=="string"&&e.trimStart().startsWith("{")?ao(e):e;if(!t||typeof t!="object")return null;const n=t.events_persisted;if(!Array.isArray(n))return null;const r=n.flatMap(o=>{const a=o&&typeof o=="object"?o.id:null;return typeof a=="number"&&Number.isSafeInteger(a)&&a>0?[a]:[]});return r.length>0?r:null}const io=({tools:e,workspaceSlug:t})=>s.jsxs(St,{defaultOpen:!1,children:[s.jsx(Ct,{children:e.length===1?e[0].toolName:`${e.length} tool calls`}),s.jsx(Tt,{children:e.map(n=>{const r=n.args!==void 0&&n.args!==null,o=n.result!==void 0&&n.result!==null,a=$t(n.result);return s.jsxs(jt,{icon:dn,label:s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"font-medium",children:n.toolName}),n.isError?s.jsx("span",{className:"rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-[10px] text-destructive",children:"error"}):null]}),status:n.isError?"active":"complete",children:[r?s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-foreground/80 text-xs",children:De(n.args)}):null,o?s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-foreground/80 text-xs",children:De(n.result)}):null,a&&t?s.jsx(tr,{ownerSlug:t,eventIds:a}):null]},n.toolCallId)})})]}),co=({text:e})=>{let t=e,n=null;const r=e.match(/\{[\s\S]*\}/);if(r)try{const a=JSON.parse(r[0])?.error?.message;typeof a=="string"&&a.trim()&&(t=a,n=e)}catch{}return s.jsxs("div",{className:"flex gap-2 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2.5 text-sm",children:[s.jsx(mn,{className:"mt-0.5 size-4 shrink-0 text-destructive"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[s.jsx("p",{className:"text-foreground/80",children:t}),n&&s.jsxs("details",{className:"text-xs text-muted-foreground",children:[s.jsx("summary",{className:"cursor-pointer select-none hover:text-foreground",children:"Technical details"}),s.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-all font-mono",children:n})]})]})]})},uo=({part:e})=>{const t=qe();return e.type==="reasoning"?s.jsx(Zn,{}):e.type==="error"?s.jsx(co,{text:e.text}):e.type==="text"?e.text.trim()?s.jsx(Xe,{text:e.text,renderText:n=>s.jsx(pn,{text:n})}):null:e.type!=="tool-call"?null:Lt.has(e.toolName)||t?.toolNames.has(e.toolName)?s.jsx(So,{toolName:e.toolName,args:e.args}):null},fo=({message:e,onClick:t})=>{const n=e.parts.find(r=>r.type==="text");return s.jsx("button",{type:"button",onClick:t,className:M(Te,"block w-full cursor-pointer whitespace-pre-wrap break-words px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/50"),children:n?.type==="text"?n.text:"Automation run"})},po=({message:e})=>s.jsx("div",{className:"self-stretch",children:s.jsx("div",{className:M(Te,"px-3 py-2 text-xs text-muted-foreground"),children:e.parts.map(t=>t.type==="text"?s.jsx("div",{className:"whitespace-pre-wrap break-words",children:s.jsx(Xe,{text:t.text,renderText:n=>n})},Le(e,t)):null)})}),mo="/mcp-apps/interaction/index.html";function dt(e){return new Promise(t=>{e({onSettled:(n,r)=>t(!!r)})})}const ho=({src:e,title:t,renderPayload:n,onToolCall:r,onOpenLink:o})=>{const a=l.useRef(null),[i,c]=l.useState(48),u=l.useRef({renderPayload:n,onToolCall:r,onOpenLink:o});return u.current={renderPayload:n,onToolCall:r,onOpenLink:o},l.useEffect(()=>{const d=a.current;if(!d?.contentWindow)return;const f=new bn(null,{name:"Lobu",version:"1.0.0"},{openLinks:{},serverTools:{}},{hostContext:{theme:document.documentElement.classList.contains("dark")?"dark":"light",displayMode:"inline",platform:"web"}});f.addEventListener("sizechange",({height:g})=>{typeof g=="number"&&c(Math.max(32,Math.ceil(g)))}),f.oncalltool=async({name:g,arguments:R})=>{const I=await u.current.onToolCall(g,R??{});return{isError:I,content:[{type:"text",text:I?"Action failed.":"Action completed."}]}},f.onopenlink=async({url:g})=>({isError:await u.current.onOpenLink(g)}),f.addEventListener("initialized",()=>{(async()=>(await f.sendToolInput({arguments:{}}),await f.sendToolResult({content:[],structuredContent:{...u.current.renderPayload,version:1,source:qr}})))()});const v=new xn(d.contentWindow,d.contentWindow);f.connect(v).catch(g=>{console.error("[mcp-app-host] failed to initialize",g)});const m=new MutationObserver(()=>{f.setHostContext({theme:document.documentElement.classList.contains("dark")?"dark":"light",displayMode:"inline",platform:"web"})});return m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{m.disconnect(),v.close()}},[]),s.jsx("iframe",{ref:a,title:t,src:e,sandbox:"allow-scripts",style:{width:"100%",height:i,border:"none",display:"block"}})},go=new Set(["action"]),bo=["name","description","identity_md"];function le(e){return e==null||e===""?"":typeof e=="string"?e:De(e)}function ft(e){return e===null?"(cleared)":e===void 0?"":typeof e=="string"?e===""?"":e:De(e)}function $e(e){return e.length>0?e[0].toUpperCase()+e.slice(1):e}const Dt=new Set(["delete","disconnect","remove","remove_rule","reset","revoke"]);function ze(e){return e&&Dt.has(e)?"warning":"default"}function We(e,t){return e&&Dt.has(e)?{level:"high",reason:t}:{level:"normal"}}function xo(e,t){const n=e.attribution==="automation"?"An Automation":"An agent",r=Object.keys(t),o=r.map(a=>({label:a,before:le(e.current?.[a]),after:le(t[a])}));return{title:`${n} proposes a change`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:o.length>0?[{type:"diff",fields:o}]:[{type:"text",value:"No field changes.",muted:!0}],actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved — ${r.join(", ")} is being applied.`},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected — ${r.join(", ")} was not applied.`}]}}function vo(e){const t=e.action??"change",n=e.proposal?.slug??e.proposal?.name??(e.proposal?.automation_id!=null?String(e.proposal.automation_id):void 0)??e.current?.slug??e.current?.name??"automation",r=[];e.action==="delete"&&r.push({type:"text",value:"This will archive the Automation.",muted:!0});const o=e.proposal??{},a=Object.keys(o).filter(i=>!go.has(i)&&o[i]!==void 0).map(i=>({label:i,...e.action==="update"&&e.current?.[i]!==void 0?{before:ft(e.current?.[i])}:{},after:ft(o[i])}));return r.push(a.length>0?{type:"diff",fields:a}:{type:"text",value:"No field changes.",muted:!0}),{title:`${$e(t)} Automation ${n}`,icon:"automation",impact:We(e.action,"This archives the Automation and stops future runs."),tone:ze(e.action),blocks:r,actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved — ${t} ${n} is being applied.`},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected — ${t} ${n} was not applied.`}]}}function yo(e){if(e.resourceKind==="automation")return vo(e);if(e.fields&&Object.keys(e.fields).length>0)return xo(e,e.fields);const t=e.resourceKind==="entity"||e.proposal?.entity_id!==void 0||e.current?.entity_type!==void 0||e.proposal?.entity_type!==void 0;if(t&&(e.action==="link"||e.action==="unlink"))return In({...e,action:e.action});if(t){const a=e.proposal?.name??e.current?.name??e.proposal?.entity_id??e.current?.id??"entity",i=e.action??"change",c=[];if(e.action==="delete")c.push({type:"text",value:"This will delete the entity.",muted:!0});else{const u=Object.keys(e.proposal??{}).filter(d=>!["entity_id","id"].includes(d)&&e.proposal?.[d]!==void 0&&le(e.proposal?.[d])!==le(e.current?.[d])).map(d=>({label:d,...e.action==="update"?{before:le(e.current?.[d])}:{},after:le(e.proposal?.[d])}));c.push(u.length>0?{type:"diff",fields:u}:{type:"text",value:"No field changes.",muted:!0})}return{title:`${$e(i)} entity ${a}`,icon:"entity",impact:We(e.action,"This deletes the entity."),tone:ze(e.action),blocks:c,actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved — ${i} ${a} is being applied.`},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected — ${i} ${a} was not applied.`}]}}const n=e.proposal?.agent_id??e.current?.id??"agent",r=e.action??"change",o=[];if(e.action==="delete")o.push({type:"text",value:"This will permanently delete the agent.",muted:!0});else{const a=bo.filter(i=>e.proposal?.[i]!==void 0&&le(e.proposal?.[i])!==le(e.current?.[i])).map(i=>({label:i,...e.action==="update"?{before:le(e.current?.[i])}:{},after:le(e.proposal?.[i])}));o.push(a.length>0?{type:"diff",fields:a}:{type:"text",value:"No field changes.",muted:!0})}return{title:`${$e(r)} agent ${n}`,icon:"agent",impact:We(e.action,"This permanently deletes the agent and its configuration."),tone:ze(e.action),blocks:o,actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved — ${r} ${n} is being applied.`},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected — ${r} ${n} was not applied.`}]}}function Ro(e){const t=Array.isArray(e.options)?e.options.filter(o=>typeof o=="string"):[],n=[{type:"text",value:e.question||"The agent has a question."}];t.length===0&&n.push({type:"text",value:"Reply below to answer.",muted:!0});const r=t.map(o=>({id:o,label:o,variant:"outline",tool:"answer_question",args:{answer:o},resolvedLabel:`Answered: ${o}`}));return{title:"Input needed",icon:"question",tone:"default",blocks:n,actions:r}}function wo(e,t){return{tone:"bare",actions:[{id:"open",label:e.label??"Open link",variant:"outline",icon:"external",terminal:!1,href:t}]}}const So=({toolName:e,args:t})=>{const n=hn(),r=gn(),{append:o}=Ne(),a=qe(),i=t??{},c=a?.resolve(e,t)??null;let u=c?.view??null;const d={...c?.handlers??{}},f=new Set;if(!c){if(e==="tool-approval"&&typeof i.runId=="number"&&Number.isSafeInteger(i.runId)&&i.runId>0){const v=i.runId,m=typeof i.status=="string"?i.status:"pending",g=m==="pending",R=yo(i),I=m==="confirmed"?"Approved":$e(m);u=g?R:{...R,title:`${R.title??"Approval"} · ${I}`,tone:m==="failed"?"warning":"default",blocks:[...R.blocks??[],{type:"text",value:typeof i.reviewedByName=="string"?`${m==="rejected"?"Rejected":"Approved"} by ${i.reviewedByName}.`:`${I}.`,muted:!0}],actions:(R.actions??[]).filter(b=>b.terminal===!1)},g&&(d.manage_operations=b=>{if(b.action==="approve")return dt(T=>n.mutate({run_id:v},T));if(b.action==="reject"){const T=typeof b.reason=="string"?b.reason:void 0;return dt(W=>r.mutate({run_id:v,...T?{reason:T}:{}},W))}return Promise.resolve(!0)})}else if(e==="question"){const v=Array.isArray(i.options)?i.options.filter(m=>typeof m=="string"):[];u=Ro(i),d.answer_question=m=>{const g=typeof m.answer=="string"?m.answer:"";return v.includes(g)?(o(g),Promise.resolve(!1)):Promise.resolve(!0)}}else if(e==="link-button"){if(!ut(i.url))return null;const v=i.url;f.add(v),u=wo(i,v)}}return u?s.jsx(ho,{src:mo,title:u.title??"Interaction",renderPayload:u,onToolCall:(v,m)=>d[v]?d[v](m):Promise.resolve(!0),onOpenLink:v=>!f.has(v)||!ut(v)?Promise.resolve(!0):(window.open(v,"_blank","noopener,noreferrer"),Promise.resolve(!1))}):null};function De(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Co=()=>{const{running:e,append:t,cancel:n,pendingAttachments:r,addAttachments:o,removeAttachment:a,initialDraft:i,currentSuggestions:c}=Ne(),u=jo({suggestions:e?null:c}),[d,f]=l.useState(i??""),v=l.useRef(null),m=l.useRef(null),g=Nn(An),R=l.useRef(i??"");l.useEffect(()=>{const T=i??"";if(T===R.current)return;const W=R.current;R.current=T,T!==""&&f(B=>B===""||B===W?T:B)},[i]);const I=l.useRef(d);I.current=d;const b=()=>{e||(t(I.current),f(""),m.current?.clear())};return s.jsxs("div",{className:"rounded-2xl border bg-background transition-colors focus-within:ring-1 focus-within:ring-ring",children:[r.length>0?s.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 pt-3",children:r.map(T=>s.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border bg-muted/50 px-2 py-1 text-xs",children:[s.jsx(Ve,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"max-w-[12rem] truncate",children:T.name}),s.jsx("button",{type:"button",className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Remove attachment",onClick:()=>a(T.id),children:s.jsx(tn,{className:"h-3 w-3"})})]},T.id))}):null,s.jsx(En,{value:d,onChange:f,onSubmit:b,searchRefs:g,handleRef:m,placeholder:u,className:"max-h-48 overflow-y-auto"}),s.jsxs("div",{className:"flex items-center justify-between px-3 pb-2",children:[s.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:T=>{T.target.files&&o(T.target.files),T.target.value=""}}),s.jsxs(ue,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 rounded-full text-muted-foreground hover:text-foreground",onClick:()=>v.current?.click(),children:[s.jsx(Ve,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Attach files"})]}),e?s.jsxs(ue,{type:"button",size:"icon",variant:"secondary",className:"h-8 w-8 rounded-full",onClick:n,children:[s.jsx(nn,{size:"lg"}),s.jsx("span",{className:"sr-only",children:"Cancel"})]}):s.jsxs(ue,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:b,children:[s.jsx(rn,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})};function jo({suggestions:e}){const t=e?.find(n=>n.message.trim().length>0)?.message;return t?`Recommended: ${t.trim()}`:"Chat… (@ to mention, / for commands)"}export{Oo as A,_o as L,Io as R,Gn as h,zn as s};
|
|
6
|
-
//# sourceMappingURL=agent-thread-BJOijbT0.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t,gN as N,gO as $,dv as L,P as x,gP as M,gQ as S,m as b,n as I,g as j,t as k,aZ as w,r as O,O as P,gR as W,gS as D,bQ as R,gT as E,gU as F,k as y,eq as U,L as G,an as H}from"./index-Cr5hwh-C.js";import{A as Q}from"./agent-editor-form-hTs7eO_U.js";import{P as T}from"./proposal-review-shell-UcZr87_Q.js";function _({identity:e,sections:n,activeSection:s,activeItem:o,onSectionSelect:r,sectionLabel:c,highlightSection:l=!0,className:g}){const a=o??n.find(i=>i.key===s)??n[0];if(!a)return null;const d=a.icon;return t.jsx("div",{className:x("flex shrink-0 flex-col items-center px-4 lg:px-6",g),children:t.jsxs("div",{className:"flex min-w-0 max-w-full flex-wrap items-center justify-center gap-x-3 gap-y-2",children:[e,t.jsxs(N,{children:[t.jsx($,{asChild:!0,children:t.jsxs("button",{type:"button",className:x("inline-flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",l?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),"aria-label":c,children:[t.jsx(d,{className:"h-3.5 w-3.5 shrink-0"}),a.label,t.jsx(L,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]})}),t.jsx(M,{align:"center",className:"min-w-[11rem]",children:n.map(({key:i,label:u,icon:m})=>t.jsxs(S,{className:x(i===s&&"bg-accent font-medium"),onSelect:()=>r(i),children:[t.jsx(m,{className:"h-4 w-4"}),t.jsx("span",{children:u})]},i))})]})]})})}const p=[{key:"skills",label:"Skills",icon:W},{key:"guardrails",label:"Guardrails",icon:D},{key:"permissions",label:"Permissions",icon:R,adminOnly:!0},{key:"models",label:"Models",icon:E},{key:"settings",label:"Settings",icon:F}];function q(e){return p.filter(n=>!n.adminOnly||e)}function z(e,n){if(n===`${e}/conversations`||n.startsWith(`${e}/conversations/`))return null;for(const{key:s}of p)if(n===`${e}/${s}`||n.startsWith(`${e}/${s}/`))return s;return n===`${e}/identity`||n===`${e}/identity/`?"settings":null}function Z(e){return e.trim().charAt(0).toUpperCase()||"?"}function B({owner:e,agentId:n,agentName:s,activeDest:o}){const r=b(),{orgContext:c}=y(),{isAdmin:l}=U(c.organizationId),g=q(!!l),a=o??"settings",d=p.find(i=>i.key===a);return t.jsx(_,{identity:t.jsxs(G,{to:"/$owner/agents/$agentId/settings",params:{owner:e,agentId:n},search:{run_id:void 0},className:"flex min-w-0 items-center gap-2 rounded-md outline-none transition-colors hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring",title:"Agent settings",children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold text-foreground",children:Z(s)}),t.jsx("h1",{className:"min-w-0 truncate text-base font-semibold tracking-tight",children:s})]}),sections:g,activeSection:a,activeItem:d,sectionLabel:"Agent section",highlightSection:o!==null,onSectionSelect:i=>{r({to:`/$owner/agents/$agentId/${i}`,params:{owner:e,agentId:n}})}})}function Y({owner:e,agentId:n}){const s=b(),{pathname:o}=I(),{isAuthenticated:r}=j(),{isMember:c}=k(),l=r&&c,{data:g=[],isLoading:a}=w({enabled:l}),d=g.find(C=>C.agentId===n)??null,i=!d&&!a&&l,u=`/${e}/agents/${n}`,m=`${u}/conversations`,f=o===m||o.startsWith(`${m}/`),h=z(u,o);O.useEffect(()=>{i&&s({to:"/$owner",params:{owner:e},replace:!0})},[i,s,e]);const A=d?.name??"Agent";return t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-hidden py-4 md:py-6",children:[t.jsx(B,{owner:e,agentId:n,agentName:A,activeDest:h}),t.jsx("div",{className:x("flex min-h-0 min-w-0 flex-1 flex-col px-4 lg:px-6",f?"overflow-hidden":"overflow-y-auto"),children:t.jsx(P,{})})]})}function J({agent:e,tab:n,runId:s}){return t.jsx("div",{className:"mx-auto w-full max-w-3xl pb-6",children:t.jsx(T,{resource:{kind:"agent",agentId:e.agentId},runId:s,children:({reviewMode:o,proposal:r,controlsDisabled:c})=>t.jsx(Q,{mode:{kind:"edit",agent:e},section:n,reviewMode:o,reviewProposal:r,reviewControlsDisabled:c},e.agentId)})})}function ee({owner:e,agentId:n,tab:s,runId:o}){const{orgContext:r,hasOrgContext:c}=y(),{isLoading:l}=H(`/${e}`,r),{isAuthenticated:g}=j(),{isMember:a,isLoading:d}=k(),i=g&&a,{data:u=[],isLoading:m}=w({enabled:i}),v=i?!c||l||m||d:l||d,f=u.find(h=>h.agentId===n)??null;return v||!f?null:t.jsx(J,{agent:f,tab:s,runId:o})}export{Y as A,ee as a};
|
|
2
|
-
//# sourceMappingURL=agents-workbench-Bt5QCYQ7.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as c,hU as b,aO as w,az as y,aU as C,aA as u,j as e,aB as k,L as i,h0 as A,hi as j,B as N,g$ as D,i5 as P,hO as v,fL as B,fM as L,fN as $,A as I,dd as M,gA as O,i6 as R,ah as _}from"./index-Cr5hwh-C.js";import{C as z}from"./connections-browser-CKZjzRz6.js";import"./status-dot-B-EWMgq6.js";import"./connection-label-BobuYiAG.js";function E({ownerSlug:s,appId:a}){const n=c.useMemo(()=>b(s,a,w()),[s,a]),{data:r=[],isLoading:l,isError:d,refetch:g}=y(),[m,x]=c.useMemo(()=>{const t=n?.devicePlatforms;if(!t?.length)return[[],[]];const p=r.filter(o=>{const f=C(o);return f!=null&&t.includes(f)});return[p.filter(o=>u(o,s)),p.filter(o=>!u(o,s))]},[n,r,s]);if(!n)return e.jsxs(k,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"There is no app by that name."}),e.jsx(i,{to:"/$owner/connectors",params:{owner:s},search:{},className:"text-sm text-primary hover:underline",children:"Back to connectors"})]});const h=(n.devicePlatforms?.length??0)>0;return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(A,{header:e.jsx(B,{breadcrumb:e.jsx(L,{crumbs:[e.jsx(i,{to:"/$owner/connectors",params:{owner:s},search:{},className:$,children:"Connectors"},"connectors")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:n.icon}),title:n.name,caption:n.description}),children:[e.jsx("div",{id:"setup",className:"scroll-mt-40",children:e.jsx(j,{title:m.length>0?a==="owletto-chrome"?"Connect another profile":"Connect another device":"Set up",children:e.jsx("div",{className:"space-y-3",children:n.steps.map(t=>e.jsx(T,{step:t},t.label))})})}),h?e.jsx(z,{entries:m.map(t=>({id:t.id,name:v(t),description:P(t,s),tone:t.online?null:"muted",link:D({to:"/$owner/connectors/device/$deviceId",params:{owner:s,deviceId:t.id}})})),isLoading:l,isError:d,onRetry:()=>void g(),action:e.jsx(N,{asChild:!0,variant:"outline",size:"sm",children:e.jsx("a",{href:"#setup",children:"Add connection"})})}):null,h&&!l&&!d&&x.length>0?e.jsxs(j,{title:"Your devices in other workspaces",children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Open a device to connect its capabilities here. Moving it is confirmed first and pauses its connections where it is now."}),e.jsx("ul",{className:"divide-y border-y",children:x.map(t=>e.jsx("li",{children:e.jsxs(i,{to:"/$owner/connectors/device/$deviceId",params:{owner:s,deviceId:t.id},className:"flex items-center justify-between gap-3 py-2.5 text-sm hover:text-primary",children:[e.jsx("span",{className:"font-medium",children:v(t)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Attached to"," ",t.organization_name??"another workspace"]})]})},t.id))})]}):null]})})}function T({step:s}){const[a,n]=c.useState(!1);if(s.href)return e.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium text-primary hover:bg-accent/50",children:[s.label,e.jsx(I,{className:"h-3 w-3"})]});const r=s.command??"";return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border bg-muted/40 p-2.5",children:[e.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-xs leading-relaxed",children:r}),e.jsxs(N,{variant:"ghost",size:"sm",className:"h-6 shrink-0 px-1.5 text-xs",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})},children:[a?e.jsx(M,{className:"h-3.5 w-3.5"}):e.jsx(O,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"sr-only",children:"Copy"})]})]})]})}function K(){const{owner:s,appId:a}=R.useParams();return e.jsx(_,{owner:s,children:({ownerSlug:n})=>e.jsx(E,{ownerSlug:n,appId:a})})}export{K as component};
|
|
2
|
-
//# sourceMappingURL=app._appId-CKv7_squ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e,S as p,dG as y,k as A,an as _,g as b,t as C,u as k,gE as S}from"./index-Cr5hwh-C.js";import{C as P,A as E}from"./create-automation-form-CtSSeYj3.js";import{P as D}from"./proposal-review-shell-UcZr87_Q.js";import{J as j}from"./json-diff-DBoag_OS.js";import{u as R,a as w}from"./deployments-RvUdVkj3.js";import{E as F}from"./events-feed-BtvhZF1f.js";const L=20;function N({automationId:a}){const t=R({resourceKind:"automation",resourceId:a}),[d,c]=f.useState(null),s=w(d!=null?String(d):null),o=(t.data?.pages.length??0)>=L&&!!t.hasNextPage,r=!!t.isFetchNextPageError;f.useEffect(()=>{!o&&t.hasNextPage&&!t.isFetchingNextPage&&!t.isError&&!r&&t.fetchNextPage()},[o,t.fetchNextPage,t.hasNextPage,t.isFetchingNextPage,t.isError,r]);const l=f.useMemo(()=>(t.data?.pages??[]).flatMap(x=>x.items).filter(x=>x.type==="change"&&x.resourceKind==="automation"&&x.resourceId===String(a)),[t.data,a]),i=!!t.hasNextPage&&!o,m=typeof t.refetch=="function",h=typeof t.fetchNextPage=="function";return t.isLoading?e.jsx(p,{className:"h-20 w-full rounded-lg"}):t.isError&&!r?e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-error",children:"Definition history unavailable."}),m?e.jsx("button",{type:"button",className:"text-sm underline","data-testid":"automation-definition-history-retry",onClick:()=>void t.refetch(),children:"Retry"}):null]}):e.jsxs("section",{className:"space-y-2","aria-label":"Automation definition history","data-testid":"automation-definition-history",children:[e.jsx("h3",{className:"font-medium text-sm",children:"Definition history"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Runtime and delivery configuration changes with actor and before/after. Content versions (prompt, sources) are listed separately."}),l.length===0&&!i?e.jsx("p",{className:"py-4 text-sm text-muted-foreground","data-testid":"automation-definition-history-empty",children:"No definition changes recorded yet."}):e.jsx("ul",{className:"space-y-1","data-testid":"automation-definition-history-list",children:l.map(n=>{if(n.type!=="change")return null;const g=n.createdBy??n.agentId??n.actorSource??"unknown";return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"flex w-full flex-wrap items-center justify-between gap-2 rounded-lg border border-border/60 px-3 py-2 text-left text-sm hover:bg-muted/50",onClick:()=>c(x=>x===n.id?null:n.id),"data-testid":`automation-definition-history-item-${n.id}`,children:[e.jsx("span",{className:"font-medium",children:n.action??n.op??"change"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:(n.changedFields??[]).join(", ")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(n.createdAt).toLocaleString()})]})},n.id)})}),i?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-loading-more",children:"Loading more history…"}):null,o?e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-capped",children:"Showing recent definition changes"}):null,r?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"automation-definition-history-page-error",children:"Couldn't load more history."}),h?e.jsx("button",{type:"button",className:"text-xs underline","data-testid":"automation-definition-history-retry-next",onClick:()=>void t.fetchNextPage(),children:"Retry"}):null]}):null,d!=null?e.jsx("div",{"data-testid":"automation-definition-history-detail",children:s.isLoading?e.jsx(p,{className:"h-24 w-full rounded-lg"}):s.isError?e.jsx("p",{className:"text-sm text-muted-foreground","data-testid":"automation-definition-history-detail-error",children:"Change detail unavailable."}):s.data?e.jsx(j,{before:s.data.before,after:s.data.after}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Change detail unavailable."})}):null]})}function v(a){const{orgContext:t,hasOrgContext:d}=A(),{data:c,isLoading:s}=_(`/${a}`,t),{isAuthenticated:u}=b(),{isMember:o,isLoading:r}=C(),l=u&&o,i=c?.workspace,m=l?!d||s||r:s||r;return{organizationId:i?.id??"",isLoading:m}}function K(a){return v(a)}function O({owner:a,automationId:t,organizationId:d}){const c=Number(t),s=f.useMemo(()=>({producedByAutomationId:c}),[c]),u=k(),o=y(t,void 0,d),r=o.data?.automation?.automation_name?.trim()||null,l=o.data?.automation?.managed_agent_id??null,{data:i}=S(l,t,{orgSlug:a}),m=f.useMemo(()=>(i?.runs??[]).map(n=>({runId:n.runId,status:n.status,completedAt:n.completedAt})),[i]),h=f.useCallback(n=>{u?.open({href:`/${a}/automations/${t}?run_id=${n}`,title:r!=null?`${r} · Run #${n}`:`Automation run #${n}`,runId:n})},[u,a,t,r]);return Number.isFinite(c)?e.jsx(F,{organizationId:d,ownerSlug:a,filters:s,groupByRun:!0,onRunSelect:h,runs:m,hideRunAction:!0,hideAttribution:!0,emptyState:e.jsx("p",{className:"py-6 text-sm text-muted-foreground",children:"This Automation hasn't written anything yet. Runs appear here with the events they created; clicking a run opens its conversation."})}):null}function T({agentId:a,automationId:t,runId:d,organizationId:c,onDone:s}){const[u,o]=f.useState({ready:!1,triggers:[]}),r=f.useCallback(n=>{o(g=>JSON.stringify(g)===JSON.stringify(n)?g:n)},[]),l=y(t,void 0,c,{includeVersions:!0}),i=l.data?.automation,m=e.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(n=>e.jsx(p,{className:"h-16 w-full rounded-lg"},n))}),h=l.isLoading?m:i?e.jsx(P,{organizationId:c,prefillAgentId:a??void 0,editingAutomation:{automation_id:i.automation_id,name:i.automation_name,slug:i.slug,description:i.description,prompt:i.prompt,sources:i.sources,reaction_script:i.reaction_script,managed_agent_id:i.managed_agent_id,device_worker_id:i.device_worker_id,agent_kind:i.agent_kind,delivery_target:i.delivery_target??void 0,execution_config:i.execution_config??void 0,keying_config:i.keying_config,reactions_guidance:i.reactions_guidance,triggers:i.triggers},createFields:{triggers:u.triggers},triggerFields:e.jsx(E,{organizationId:c,initialTriggers:i.triggers??[],onChange:r},JSON.stringify(i.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!u.ready,onClose:s,onSuccess:s}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return a?e.jsxs("div",{className:"space-y-6",children:[e.jsx(D,{resource:{kind:"automation",agentId:a,automationId:t},runId:d,onDone:s,children:({reviewMode:n,proposal:g})=>n==="active"?e.jsx(j,{before:g?.current??null,after:{...g?.current??{},...g?.proposedAfter??{}}}):n==="loading"?m:n==="error"?null:h}),e.jsx(N,{automationId:t})]}):e.jsxs("div",{className:"space-y-6",children:[h,e.jsx(N,{automationId:t})]})}function V({owner:a,agentId:t,automationId:d,view:c,runId:s,onDone:u}){const{organizationId:o}=v(a),r=y(d,void 0,o),l=t??r.data?.automation?.managed_agent_id??null;return s||c==="definition"?e.jsx(T,{agentId:l,automationId:d,runId:s,organizationId:o,onDone:u}):e.jsx(O,{owner:a,automationId:d,organizationId:o})}export{V as A,K as u};
|
|
2
|
-
//# sourceMappingURL=automation-detail-content-vUwVumXf.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as a,g as i,r as n,j as t}from"./index-Cr5hwh-C.js";function r(){const s=a(),{isReady:e}=i();return n.useEffect(()=>{e&&setTimeout(()=>{s({to:"/"})},500)},[e,s]),t.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:t.jsx("div",{className:"text-center",children:t.jsx("p",{className:"text-muted-foreground",children:e?"Redirecting...":"Completing sign in..."})})})}export{r as component};
|
|
2
|
-
//# sourceMappingURL=callback-BRgcL8gz.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function o(n){const t=new Map;for(const e of n){if(e.kind!=="mcp")continue;const i=e.title?.trim()||e.identifier||"Unknown app",l=e.registrationGroupKey||e.id,s=t.get(l);if(!s){t.set(l,{key:l,clientId:e.id,title:i,drivenBy:e.drivenBy?.trim()||null,clientIds:[e.id],connected:e.status==="connected",lastSeenAt:e.lastSeenAt??null,linkedUser:e.linkedUserName??e.linkedUserEmail??null,linkedUserEntitySlug:e.linkedUserEntitySlug??null});continue}s.clientIds.push(e.id),s.connected=s.connected||e.status==="connected",(e.lastSeenAt??0)>(s.lastSeenAt??0)&&(s.lastSeenAt=e.lastSeenAt??null,s.drivenBy=e.drivenBy?.trim()||null)}return[...t.values()].sort((e,i)=>(i.lastSeenAt??0)-(e.lastSeenAt??0))}function r(n){if(!n)return"never";const t=Date.now()-n;if(t<6e4)return"just now";const e=Math.floor(t/6e4);if(e<60)return`${e}m ago`;const i=Math.floor(e/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function c(n){const t=[n.linkedUser];return t.push(n.connected?`active ${r(n.lastSeenAt)}`:"disconnected"),n.drivenBy&&n.drivenBy!==n.title&&t.push(`via ${n.drivenBy}`),t.filter(Boolean).join(" · ")}export{c,o as g,r};
|
|
2
|
-
//# sourceMappingURL=client-rows-EJSKR6z1.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ig as r,j as t,ah as a}from"./index-Cr5hwh-C.js";import{a as s}from"./agent-connect-pages-B_vrqLVc.js";import"./agent-client-setup-list-Bg3hBfUV.js";import"./clients-D3Zbjxin.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};
|
|
2
|
-
//# sourceMappingURL=connect._clientId-DkiC8xos.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,ah as w,r as N,cO as y,h0 as p,fL as x,fM as h,L as r,fN as o,w as _,bi as j,aQ as L,cY as A,B as $,A as E,iv as f}from"./index-Cr5hwh-C.js";import{c as k}from"./conversations-table-BdXoZAfc.js";import{E as B}from"./events-feed-BtvhZF1f.js";import{u as P}from"./clients-D3Zbjxin.js";import{g as S}from"./client-rows-EJSKR6z1.js";import"./renderer-mEDnVW0O.js";import"./card-Djgp00r_.js";const D="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6";function O({owner:s,clientId:a,mcpActivityId:t}){return e.jsx("div",{className:D,children:e.jsx(w,{owner:s,children:({organizationId:n,ownerSlug:l})=>e.jsx(R,{ownerSlug:l,organizationId:n,clientId:a,mcpActivityId:t})})})}function R({ownerSlug:s,organizationId:a,clientId:t,mcpActivityId:n}){const{data:l=[],isLoading:g}=P(null),i=N.useMemo(()=>S(l).find(u=>u.clientIds.includes(t)),[t,l]),d=i?.clientIds??[],{data:v=[],isLoading:C}=y({enabled:!!i&&!!a,limit:100,clientIds:d,organizationId:a}),c=n?v.find(u=>u.activityId===n)??null:null,m=i?.title??"Connected agent",b=c?k(c):"Conversation";return!a||g||n&&C?e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(h,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"py-3 text-xs text-muted-foreground",children:"Loading…"})}):n&&(!i||!c||c.organizationId===null)?e.jsx(_,{to:"/$owner/events",params:{owner:"me"},search:{client_ids:i?d.join(","):t,mcp_activity_id:n},replace:!0}):i?n?e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(h,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:m},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:c?.clientName??m})}),title:b,meta:e.jsx($,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(r,{to:"/$owner/events",params:{owner:s},search:{client_ids:d.join(","),mcp_activity_id:n},children:["See in Activity",e.jsx(E,{className:"h-3.5 w-3.5"})]})})}),children:e.jsx(B,{organizationId:a,ownerSlug:s,filters:{clientIds:d,mcpActivityId:n,sortBy:"date",sortOrder:"desc"},hideOriginator:!0,foldConsecutiveCalls:!0,emptyState:e.jsx(L,{icon:A,title:"No activity in this conversation yet",description:"Calls this app makes will appear here."})})}):e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(h,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents"),e.jsx(r,{to:"/$owner/agents/connected/$clientId",params:{owner:s,clientId:t},className:o,children:m},"app")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(j,{name:m})}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a conversation on this app's page to see its activity."})}):e.jsx(p,{header:e.jsx(x,{breadcrumb:e.jsx(h,{crumbs:[e.jsx(r,{to:"/$owner/agents",params:{owner:s},className:o,children:"Agents"},"agents")]}),title:"Conversation"}),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"This app isn't connected to this workspace, so its activity isn't available."})})}function Q(){const{owner:s,clientId:a}=f.useParams(),t=f.useSearch();return e.jsx(O,{owner:s,clientId:a,mcpActivityId:typeof t.mcp_activity_id=="string"?t.mcp_activity_id:null})}export{Q as component};
|
|
2
|
-
//# sourceMappingURL=connected._clientId.activity-Ckdz6I0y.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k as z,eq as E,r as c,cO as N,j as e,S as C,cf as P,L as I,hi as p,B as v,a1 as U,h0 as B,fL as D,bi as M,fM as _,fN as T,io as G,ah as K}from"./index-Cr5hwh-C.js";import{C as k}from"./conversations-table-BdXoZAfc.js";import{u as S,a as O}from"./clients-D3Zbjxin.js";import{g as L,r as $}from"./client-rows-EJSKR6z1.js";function Q({ownerSlug:n,clientId:i}){const{orgContext:a}=z(),{isAdmin:f}=E(a.organizationId),{data:l=[],isLoading:d}=S(null),r=O(),[w,u]=c.useState(!1),s=c.useMemo(()=>L(l),[l]).find(t=>t.clientIds.includes(i)),j=s?.clientIds??[],m=N({enabled:!!s,limit:100,clientIds:j,activityKind:"conversation",organizationId:a?.organizationId??null}),x=N({enabled:!!s,limit:100,clientIds:j,activityKind:"session",organizationId:a?.organizationId??null,refetchInterval:t=>t?5e3:!1}),o=m.data??[],g=x.data??[],A=c.useMemo(()=>l.filter(t=>s?.clientIds.includes(t.id)),[l,s]);if(d)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(C,{className:"h-16 w-full rounded-lg"}),e.jsx(C,{className:"h-24 w-full rounded-lg"})]});if(!s)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"This app isn't connected to this workspace, so its details aren't available."});const h=A[0],b=h?.details?.redirectUris??[],y=s.linkedUserEntitySlug?P(n,[{entity_type:"$member",slug:s.linkedUserEntitySlug}]):null,R=[{label:"Registered",value:s.title},{label:s.clientIds.length===1?"Client ID":"Client IDs",value:e.jsx("div",{className:"space-y-1",children:s.clientIds.map(t=>e.jsx("code",{className:"block break-all",children:t},t))})},...s.drivenBy&&s.drivenBy!==s.title?[{label:"Driven by",value:s.drivenBy}]:[],...h?.platform?[{label:"Software",value:h.platform}]:[],...b.length>0?[{label:"Redirects",value:b.join(", ")}]:[],{label:"Granted by",value:y&&s.linkedUser?e.jsx(I,{to:y,className:"font-medium text-primary hover:underline",children:s.linkedUser}):s.linkedUser??"—"},{label:"Last active",value:s.connected?$(s.lastSeenAt):"disconnected"},{label:"Registrations",value:String(s.clientIds.length)}];return e.jsxs("div",{className:"space-y-7",children:[e.jsx(p,{title:"Settings",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"overflow-hidden rounded-lg border text-xs",children:e.jsx("dl",{className:"divide-y",children:R.map(t=>e.jsxs("div",{className:"flex gap-3 px-3 py-2",children:[e.jsx("dt",{className:"w-28 shrink-0 text-muted-foreground",children:t.label}),e.jsx("dd",{className:"min-w-0 flex-1 break-words",children:t.value})]},t.label))})}),f&&s.connected?e.jsxs("div",{className:"space-y-2 rounded-lg border p-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Revoking disconnects every registration this app holds",s.clientIds.length>1?` (${s.clientIds.length} of them)`:""," ","and kills its live sessions. It can reconnect by authorizing again."]}),w?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"destructive",size:"sm",className:"h-7 px-2 text-xs",disabled:r.isPending,onClick:()=>r.mutate({clientId:s.clientIds[0],scope:"all"},{onSettled:()=>u(!1)}),children:r.isPending?"Revoking…":"Confirm revoke"}),e.jsx(v,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:r.isPending,onClick:()=>u(!1),children:"Cancel"})]}):e.jsx(v,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive",onClick:()=>u(!0),children:"Revoke"})]}):null]})}),e.jsx(p,{title:"Conversations",count:o.length>0?String(o.length):void 0,children:m.isLoading||x.isLoading?e.jsxs("div",{className:"flex items-center py-4 text-xs text-muted-foreground",children:[e.jsx(U,{className:"mr-2"})," Loading client activity…"]}):m.isError||x.isError?e.jsx("p",{className:"py-3 text-xs text-destructive",children:"Could not load this app's activity."}):o.length===0?e.jsx("p",{className:"py-3 text-xs text-muted-foreground",children:"No recent conversations."}):e.jsx(k,{scopes:o,ownerSlug:n})}),g.length>0?e.jsx(p,{title:"Sessions",count:String(g.length),children:e.jsx(k,{scopes:g,ownerSlug:n})}):null]})}const q="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6";function H({owner:n,clientId:i}){const{data:a=[]}=S(null),l=c.useMemo(()=>L(a).find(d=>d.clientIds.includes(i)),[i,a])?.title??"Connected agent";return e.jsx("div",{className:q,children:e.jsx(B,{header:e.jsx(D,{breadcrumb:e.jsx(_,{crumbs:[e.jsx(I,{to:"/$owner/agents",params:{owner:n},className:T,children:"Agents"},"agents")]}),icon:e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:e.jsx(M,{name:l})}),title:l,caption:"An external agent connected to this workspace through Lobu. Review its Lobu conversations, activity, and access."}),children:e.jsx(Q,{ownerSlug:n,clientId:i},i)})})}function Y(){const{owner:n,clientId:i}=G.useParams();return e.jsx(K,{owner:n,children:({ownerSlug:a})=>e.jsx(H,{owner:a,clientId:i})})}export{Y as component};
|
|
2
|
-
//# sourceMappingURL=connected._clientId.index-CNxafNeo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{hy as h,g$ as g,j as e,B as u,L as m,cy as j,hi as p,r as f,hE as v,dj as N}from"./index-Cr5hwh-C.js";import{S as w}from"./status-dot-B-EWMgq6.js";import{c as b}from"./connection-label-BobuYiAG.js";function C(n){return e.jsx(p,{title:"Connections",count:n.isLoading||n.isError?void 0:String(n.entries.length),children:e.jsx(x,{...n})})}function x({entries:n,action:r,isLoading:i,isError:o,onRetry:c}){const[a,d]=f.useState("");if(i)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connections…"});if(o)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load connections."}),c&&e.jsx(u,{variant:"outline",size:"sm",onClick:c,children:"Retry"})]});const s=n.filter(t=>`${t.name} ${t.description??""}`.toLowerCase().includes(a.trim().toLowerCase())).sort((t,l)=>+!!l.needsAttention-+!!t.needsAttention);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{label:"connections",query:a,onQueryChange:d,count:s.length,action:r}),e.jsx("ul",{className:s.length>0?"overflow-hidden rounded-lg border divide-y":void 0,children:s.map(t=>e.jsx("li",{children:e.jsxs(m,{...t.link,className:"flex items-center justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(w,{tone:t.tone}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:t.name}),t.description&&e.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:t.description})]})]}),e.jsxs("span",{className:"flex min-w-0 max-w-1/2 shrink-0 items-center gap-2",children:[t.status&&e.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:t.status}),e.jsx(N,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]})]})},t.id))}),s.length===0&&e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:a.trim()?"No matches. Try another search.":"No connections yet."})]})}function _({connections:n,connector:r,connectorKey:i,ownerSlug:o,section:c=!1}){const a=n.filter(s=>s.connector_key===i).map(s=>{const t=!!r&&h(r)&&!s.device_worker_id,l=["error","revoked","pending_auth"].includes(s.status);return{id:String(s.id),name:b({...s,connector_name:s.connector_name??r?.name??null}),needsAttention:l||t,tone:s.status==="error"||s.status==="revoked"?"destructive":t||s.status!=="active"?"amber":null,status:t?"Needs a device":l?s.error_message?.trim()||(s.status==="pending_auth"?"needs reconnect":s.status):void 0,link:g({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:o,connectorKey:i,connectionId:String(s.id)},search:{}})}}),d=c?C:x;return e.jsx(d,{entries:a,action:e.jsx(u,{asChild:!0,size:"sm",variant:"outline",children:e.jsxs(m,{to:"/$owner/connectors/create/$connectorKey",params:{owner:o,connectorKey:i},children:[e.jsx(j,{className:"size-3.5"}),"Add connection"]})})})}export{C,_ as a};
|
|
2
|
-
//# sourceMappingURL=connections-browser-CKZjzRz6.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ct as y,j as t,S as f,B as p,aQ as v,cw as j,L as _,cy as N,bc as $,u as b,hw as w}from"./index-Cr5hwh-C.js";import{S as k}from"./status-dot-B-EWMgq6.js";function g(e){switch(e.attention){case"needs_auth":return"Needs authentication";case"setup_required":return e.attention_reason?.trim()||"Setup required";case"paused":return"Paused";case"misconfigured":return"Configuration error";case"device_offline":return`Waiting for ${e.device_label||e.device_platform||"device"}`;case"last_attempt_failed":{const r=Number(e.consecutive_failures??0);return e.last_error?.trim()||(r>0?`${r} consecutive sync ${r===1?"failure":"failures"}`:"Last sync failed")}case"overdue":return"Scheduled run overdue";case"no_trigger":return"No schedule — this feed only runs when you sync it";case"never_run":return e.execution_mode==="scheduled"?"Scheduled, not run yet":"Not synced yet";default:return null}}function C(e){switch(e.attention){case"last_attempt_failed":case"misconfigured":return"destructive";case"needs_auth":case"setup_required":case"device_offline":case"overdue":case"no_trigger":case"never_run":return e.attention==="never_run"&&e.execution_mode!=="scheduled"?"muted":"amber";case"paused":return"muted";default:return e.status==="active"?null:e.status==="error"?"destructive":"muted"}}function S(e){return Object.keys(e?.feeds_schema??{}).length>0}function F({connection:e,ownerSlug:r,connectorKey:u,connectorDef:h}){const{data:i=[],isLoading:l,isError:m,refetch:a}=y(e.id),d=S(h),c=e.facets?.chat??!1,o={owner:r,connectorKey:u,connectionId:String(e.id)};return l?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(f,{className:"h-12 w-full rounded-lg"}),t.jsx(f,{className:"h-12 w-full rounded-lg"})]}):m?t.jsxs("div",{role:"alert",className:"space-y-2",children:[t.jsx("p",{children:"Could not load feeds."}),t.jsx(p,{variant:"outline",size:"sm",onClick:()=>void a(),children:"Retry"})]}):i.length===0?t.jsx(v,{icon:j,title:c?"No channels":"No feeds",description:d?c?"Bind a channel to route conversations to this connection.":"Add a feed to start collecting data from this connection.":c?"This chat connection has no bound channels yet.":"This connector doesn't provide any feeds.",children:d?t.jsx(p,{asChild:!0,size:"sm",children:t.jsxs(_,{to:"/$owner/connectors/$connectorKey/$connectionId",params:o,search:{addFeed:!0},children:[t.jsx(N,{className:"h-3.5 w-3.5"}),c?"Add channel":"Add feed"]})}):null}):t.jsx("ul",{className:"flex flex-col gap-2",children:i.map(n=>{const s=n.display_name?.trim()||n.feed_key,x=g(n);return t.jsx("li",{children:t.jsxs(_,{to:"/$owner/connectors/$connectorKey/$connectionId",params:o,search:{feedId:n.id},className:"flex w-full items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(k,{tone:C(n)}),t.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:s})]}),t.jsx("span",{className:n.attention==="last_attempt_failed"||n.attention==="misconfigured"?"max-w-[50%] shrink-0 text-right text-xs text-destructive":n.attention&&n.attention!=="healthy"?"max-w-[50%] shrink-0 text-right text-xs text-amber-600 dark:text-amber-400":"shrink-0 text-xs text-muted-foreground",title:x??void 0,children:x??(n.store==="channel_messages"?"chat channel":n.operations.includes("read")&&n.operations.includes("sync")?"synced + live":n.operations.includes("read")?"live":n.last_sync_at?`synced ${$(n.last_sync_at)}`:"not synced yet")})]})},n.id)})})}function I({connection:e,ownerSlug:r,title:u}){const h=b(),{data:i=[],isLoading:l,isError:m}=y(e.id),a=i.filter(s=>["needs_auth","setup_required","misconfigured","last_attempt_failed","device_offline","overdue"].includes(s.attention??"")),d=i.filter(s=>s.status==="paused").length,c=l?e.feed_count:i.length,o=e.facets?.chat?"channels":"feeds",n=l?`Loading ${o}…`:m?`Could not load ${o} — open to retry`:`${c} ${o}${a.length?` · ${a.length} need attention`:""}${d?` · ${d} paused`:""}`;return t.jsxs("div",{className:"space-y-2",children:[t.jsx(w,{title:u,summary:n,onOpen:()=>h?.open({href:"",title:e.facets?.chat?"Channels":"Feeds",connectorPanel:{section:"feeds",connectorKey:e.connector_key,connectionId:e.id,organizationId:e.organization_id,ownerSlug:r}})}),a.length>0&&t.jsxs("ul",{className:"space-y-1 text-xs text-destructive",children:[a.slice(0,3).map(s=>t.jsxs("li",{children:[s.display_name||s.feed_key,": ",g(s)]},s.id)),a.length>3&&t.jsxs("li",{children:[a.length-3," more sources need attention."]})]})]})}export{F as C,I as a,S as c,g as f};
|
|
2
|
-
//# sourceMappingURL=connector-scope-lists-CadPVsI3.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,O as l}from"./index-Cr5hwh-C.js";function n(){return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(l,{})})})}export{n as component};
|
|
2
|
-
//# sourceMappingURL=connectors-lvLJ30lo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iy as o,j as e}from"./index-Cr5hwh-C.js";import{a}from"./agent-guardrails-route-BOrCXcAl.js";import"./model-selector-dAbDgJvx.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function g(){const{owner:r,agentId:t}=o.useParams();return e.jsx(a,{owner:r,agentId:t})}export{g as component};
|
|
2
|
-
//# sourceMappingURL=create-0xW9eXxG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as n,ah as t,O as c,cN as r,aB as i,fL as l,af as x,fM as m,L as d,fN as C,fO as u,ex as j}from"./index-Cr5hwh-C.js";function p({owner:o,initialConnectorKey:e}){return n.jsx(t,{owner:o,children:a=>n.jsx(f,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,initialConnectorKey:e})})}function f({ownerSlug:o,organizationId:e,initialConnectorKey:a}){const{data:s=[]}=r(e??"");return n.jsxs(i,{className:"flex flex-1 flex-col gap-6",children:[n.jsx(l,{breadcrumb:n.jsx(m,{crumbs:[n.jsx(d,{to:"/$owner/connectors",params:{owner:o},search:{},className:C,children:"Connectors"},"connectors")]}),icon:n.jsx(x.connectors.icon,{className:"h-6 w-6"}),title:"Add a connection",caption:"Pick a connector from the catalog or drop in an MCP URL — Lobu handles auth and brings the data into memory."}),e?n.jsx(u,{ownerSlug:o,organizationId:e,connections:s,initialConnectorKey:a}):n.jsx("div",{className:"max-w-3xl",children:n.jsx(j,{rows:4})})]})}const L=()=>n.jsx(c,{});export{p as ConnectionsCreateRouteContent,L as component};
|
|
2
|
-
//# sourceMappingURL=create-B0qhrrX4.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{iw as r,j as e}from"./index-Cr5hwh-C.js";import{a as i}from"./agent-skills-route-BUxIswuq.js";import"./agent-subpage-shell-D92imvSt.js";import"./agent-skill-context-CCdvtlmH.js";import"./core.esm-CYvgWCuv.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-Dqcvky-k.js";import"./agent-card-controls-mnTN2AZt.js";function x(){const{owner:t,agentId:o}=r.useParams();return e.jsx(i,{owner:t,agentId:o})}export{x as component};
|
|
2
|
-
//# sourceMappingURL=create-CAfF-yI1.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,ex as f,r as y,hZ as C,h_ as k,hi as g,B as A,L as w,cy as E,h$ as I,i0 as L,i1 as N,u as P,i2 as F,hw as O}from"./index-Cr5hwh-C.js";import{a as R,R as S}from"./runs-panel-Du1JMjg5.js";import{c as v,C as $,a as b}from"./connector-scope-lists-CadPVsI3.js";function M({formRows:s=5}){return e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsx(R,{}),e.jsx(f,{rows:s})]})}function V({connection:s,connectorDef:t,ownerSlug:a,openSettings:n=!1,authResult:o,showActivity:r=!0,embedded:i=!1,showShare:c=!0}){const[l,d]=y.useState(n);y.useEffect(()=>{n&&d(!0)},[n]);const m=s.id,h=s.connector_key,u=s.facets?.chat??!1,p=u?"Channels":"Feeds",x=s.has_operations===!0,_=s.feed_count>0||v(t),j=e.jsx(N,{connection:s,connectorDef:t,ownerSlug:a,showShare:c});return e.jsxs("div",{className:"space-y-6",children:[o&&e.jsx(C,{result:o}),s.auth_profile_kind==="oauth_account"&&e.jsx(k,{connection:s,connectorDef:t,onReview:()=>{d(!0),requestAnimationFrame(()=>document.getElementById("connection-auth")?.scrollIntoView({block:"nearest"}))}}),(_||x)&&e.jsxs("div",{className:i?"space-y-6":"grid grid-cols-1 items-start gap-3 sm:grid-cols-2",children:[_&&(i?e.jsx(g,{title:p,count:s.feed_count===1?"1 source":`${s.feed_count} sources`,action:v(t)?e.jsx(A,{asChild:!0,size:"sm",variant:"outline",children:e.jsxs(w,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:a,connectorKey:h,connectionId:String(m)},search:{addFeed:!0},children:[e.jsx(E,{className:"h-3.5 w-3.5"}),u?"Add channel":"Add source"]})}):null,children:e.jsx($,{connection:s,ownerSlug:a,connectorKey:h,connectorDef:t})}):e.jsx(b,{connection:s,ownerSlug:a,title:p})),x&&(i?e.jsx(I,{connection:s,ownerSlug:a}):e.jsx(B,{connection:s,ownerSlug:a}))]}),i?e.jsx(L,{title:"Connection settings",summary:"name, visibility, credentials, remove",open:l,onOpenChange:d,children:j}):j,r&&!u&&e.jsx(g,{title:"Recent activity",children:e.jsx(S,{scope:{connectionId:m},ownerSlug:a})})]})}function B({connection:s,ownerSlug:t}){const a=P(),{data:n=[],isLoading:o,isError:r}=F(s.id),i=n.filter(l=>l.readiness==="scope_upgrade_required").length,c=o?"Loading actions…":r?"Could not load actions — open to retry":`${n.length} actions${i?` · ${i} need additional provider access`:" · permissions and approval policy"}`;return e.jsx(O,{title:"Actions",summary:c,onOpen:()=>a?.open({href:"",title:"Actions",connectorPanel:{section:"actions",connectionId:s.id,connectorKey:s.connector_key,organizationId:s.organization_id,ownerSlug:t}})})}const T=new Set(["Device was removed","Device was moved to another workspace"]);function H(s){const t=s.error_message??null;return!t||!T.has(t)?t:!!s.device_worker_id&&(s.device_last_seen_at!=null||s.device_worker_handle!=null||s.device_label!=null)?null:t}export{V as C,M as R,H as c};
|
|
2
|
-
//# sourceMappingURL=device-pin-tombstone-CrjG7gPo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{aI as U,hL as ne,hM as V,r as v,j as e,hN as L,B as b,a1 as z,hO as C,cN as Y,au as te,hi as I,S as R,aU as T,dO as ae,dP as ce,dj as ie,dQ as oe,hP as re,T as le,m as de,az as me,hQ as ue,hR as xe,hS as he,aA as pe,av as fe,aB as P,aT as O,L as E,hT as ge,hU as je,aO as ve,hV as ye,hW as be,h0 as Ne,b7 as _e,fL as ke,hX as q,I as we,a_ as Ce,b8 as Se,fM as $e,fN as K,bc as De,hY as W,ah as Pe}from"./index-Cr5hwh-C.js";import{c as Q,C as Le,R as ze}from"./device-pin-tombstone-CrjG7gPo.js";import{R as Ie}from"./runs-panel-Du1JMjg5.js";import{S as Re,g as Ae}from"./runs-table-syPJ6r6T.js";import{c as Ee}from"./connection-label-BobuYiAG.js";import{w as M}from"./workspace-label-o_QfBuCM.js";import"./connector-scope-lists-CadPVsI3.js";import"./status-dot-B-EWMgq6.js";import"./runs-C0rCgGwX.js";import"./filter-editors-Cj-v6NtH.js";function Me(s,n,o){const h=new Set(s.capabilities??[]),m=new Set(s.connectors.filter(t=>t.organization_slug===o).map(t=>t.connector_key)),r=new Set(G(s,o).map(t=>t.connector_key));return n.filter(t=>U(t)&&!!t.required_capability&&h.has(t.required_capability)&&!m.has(t.key)&&!r.has(t.key))}function G(s,n){return s.organization_slug===n?s.update_required:[]}function Te(s,n,o){const h=s.organization_slug;if(!h||h===o)return[];const m=new Set(n.map(t=>t.key)),r=new Set(s.connectors.filter(t=>t.organization_slug===o).map(t=>t.connector_key));return s.connectors.filter(t=>t.organization_slug!==h||m.has(t.connector_key)||r.has(t.connector_key)?!1:(r.add(t.connector_key),!0))}function Be({device:s,organizationId:n,ownerSlug:o,connectable:h,unavailable:m}){const r=ne(),t=V(),[u,p]=v.useState(null),[g,a]=v.useState(null),[f,N]=v.useState(null),[j,d]=v.useState([]),x=s.organization_id===n,y=async c=>{p(null),N(null),a(c.key);try{x||await t.mutateAsync({deviceWorkerId:s.id,organizationId:n});const w=await r.mutateAsync({connector_key:c.key,device_worker_id:s.id}),S=w.connection_id??w.connection?.id;if(S===void 0)throw new Error(w.instructions??"The connection was not created.");d($=>[...$.filter(D=>D.connectorKey!==c.key),{connectorKey:c.key,name:c.name,connectionId:S,instructions:w.status==="setup_required"?w.instructions:void 0}])}catch(w){N({key:c.key,message:w instanceof Error?w.message:"Could not connect."})}finally{a(null)}},_=new Set(j.map(c=>c.connectorKey)),l=G(s,o),i=h.filter(c=>!_.has(c.key));return e.jsxs("div",{className:"mt-4 space-y-3",children:[j.map(c=>e.jsx(Oe,{outcome:c,device:s,organizationId:n},c.connectorKey)),i.length>0?e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",children:"Supported by this device"}),e.jsxs("p",{className:"mb-2 text-xs text-muted-foreground",children:["Not connected in this workspace yet.",x?null:" Connecting one moves the device here; you will be asked to confirm first."]}),e.jsx("div",{className:"divide-y border-y",children:i.map(c=>e.jsxs("div",{className:"space-y-2 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"min-w-0 flex-1 text-sm font-medium",children:[c.name,c.required_capability&&L[c.required_capability]&&L[c.required_capability]!==c.name?e.jsx("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:L[c.required_capability]}):null]}),e.jsxs(b,{size:"sm",variant:"outline","aria-label":`Connect ${c.name}`,disabled:g!==null,onClick:()=>x?void y(c):p(c.key),children:[g===c.key?e.jsx(z,{className:"mr-1.5"}):null,"Connect"]})]}),u===c.key?e.jsx(X,{device:s,ownerSlug:o,title:"Move device to this workspace",intro:`${C(s)} lives in ${s.organization_name??"another workspace"}. A device serves one workspace at a time, so it has to move here before it can be connected.`,confirmLabel:"Move here and connect",onConfirm:()=>void y(c),onCancel:()=>p(null)}):null,f?.key===c.key?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:f.message}):null]},c.key))})]}):null,l.length>0?e.jsxs("div",{role:"status",children:[e.jsx("p",{className:"text-xs font-medium",children:"Update Lobu on this device"}),e.jsx("ul",{className:"mt-1 space-y-1 text-xs text-muted-foreground",children:l.map(c=>e.jsx("li",{children:`${c.display_name} — this device has ${c.device_version}, this workspace uses ${c.workspace_version}`},c.connector_key))})]}):null,m.length>0?e.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:m.map(c=>e.jsx("li",{children:`${c.display_name} — set up on this device in ${s.organization_name??"its home workspace"}, not available in this workspace yet`},c.connector_key))}):null]})}function X({device:s,ownerSlug:n,title:o,intro:h,aftermath:m,confirmLabel:r,pending:t=!1,onConfirm:u,onCancel:p}){const g=s.connector_count,a=s.connectors.filter(f=>f.organization_slug===n).length;return e.jsxs("div",{role:"alertdialog","aria-label":o,className:"space-y-2 rounded-lg bg-amber-500/10 px-3 py-2 text-xs",children:[e.jsx("p",{children:h}),e.jsxs("p",{className:"text-muted-foreground",children:[g>0?`Moving pauses and unpins all ${g} connection${g===1?"":"s"} pinned to it${a>0?`, including ${a} in this workspace`:""}. They stay paused until you reconnect them.`:"It has no pinned connections, so nothing is paused.",m?` ${m}`:null]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(b,{size:"sm",disabled:t,onClick:u,children:[t?e.jsx(z,{className:"mr-1.5"}):null,r]}),e.jsx(b,{size:"sm",variant:"ghost",disabled:t,onClick:p,children:"Cancel"})]})]})}function Oe({outcome:s,device:n,organizationId:o}){const{data:h=[],isLoading:m}=Y(o,{connectionIds:[s.connectionId]}),r=h.find(p=>p.id===s.connectionId),t=C(n);if(m)return e.jsxs("p",{role:"status",className:"text-sm text-muted-foreground",children:["Checking ",s.name,"…"]});const u=[];if(!r)u.push(`${s.name} was created but could not be loaded yet.`);else if(r.status!=="active"){const p=Q(r);u.push(`${s.name} is ${r.status}${p?`: ${p}`:"."}`)}return s.instructions&&u.push(s.instructions),n.online||u.push(`${t} is offline. ${s.name} runs once it reconnects.`),e.jsx("div",{role:"status",className:"rounded-lg border px-3 py-2 text-sm",children:u.length===0?e.jsxs("p",{children:[s.name," is ready on ",t,"."]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"font-medium",children:[s.name," connected, not ready yet"]}),e.jsx("ul",{className:"mt-1 list-disc pl-4 text-xs text-muted-foreground",children:u.map(p=>e.jsx("li",{children:p},p))})]})})}function H({device:s,organizationId:n,ownerSlug:o,selectedConnection:h,openSettings:m}){const{data:r=[],isLoading:t,isError:u,refetch:p}=te(n),g=new Map(r.map(d=>[d.key,d])),a=new Map,f=[];for(const d of s.connectors){if(d.organization_slug!==o)continue;const x=g.get(d.connector_key);if(!x||!U(x)){f.push(d);continue}const y=x.required_capability??`connector:${x.key}`,_=a.get(y)??{key:y,name:x.name,connections:[]};_.name=L[y]??x.name,_.connections.push(d),a.set(y,_)}const N=Me(s,r,o),j=Te(s,r,o);return e.jsxs(e.Fragment,{children:[e.jsxs(I,{title:"Capabilities",children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Manage the native connections available to this workspace."}),s.online?null:e.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:"This device is offline. You can edit its settings; actions and sync need it to reconnect."}),!n||t?e.jsx(R,{className:"h-24 w-full"}):u?e.jsxs("div",{role:"alert",className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Could not load capability settings."}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>void p(),children:"Retry"})]}):a.size===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No native connections on this device in this workspace."}):e.jsx("div",{className:"divide-y border-y",children:[...a.values()].map(d=>e.jsx(F,{group:d,deviceId:s.id,organizationId:n,ownerSlug:o,definitionsByKey:g,selectedConnection:h,openSettings:m},d.key))}),n&&!t&&!u?e.jsx(Be,{device:s,organizationId:n,ownerSlug:o,connectable:N,unavailable:j}):null,T(s)==="macos"?e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Manage macOS permissions in the Lobu app on this device."}):null]}),n&&f.length>0&&!t&&!u?e.jsxs(I,{title:"Apps and sources",count:String(f.length),children:[e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Apps and sources that use this device."}),e.jsx("div",{className:"divide-y border-y",children:[...new Set(f.map(d=>d.connector_key))].map(d=>e.jsx(F,{group:{key:d,name:g.get(d)?.name??d,connections:f.filter(x=>x.connector_key===d)},deviceId:s.id,organizationId:n,ownerSlug:o,definitionsByKey:g,selectedConnection:h,openSettings:m},d))})]}):null]})}function F({group:s,deviceId:n,organizationId:o,ownerSlug:h,definitionsByKey:m,selectedConnection:r,openSettings:t}){const u=s.connections.some(a=>a.connection_id===r),[p,g]=v.useState(u);return v.useEffect(()=>{u&&r!==void 0&&g(!0)},[u,r]),e.jsxs(ae,{open:p,onOpenChange:g,children:[e.jsxs(ce,{className:"group flex w-full items-center gap-3 py-3 text-left",children:[e.jsx(ie,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90"}),e.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium",children:s.name}),e.jsx("span",{className:"text-right text-xs text-muted-foreground",children:s.connections.some(a=>a.status==="error"||a.status==="revoked")?"Needs attention":s.connections.length>1?`${s.connections.length} connections`:"Configured"})]}),e.jsx(oe,{className:"pb-4 pl-6",children:e.jsx("div",{className:"space-y-5",children:s.connections.map(a=>e.jsx(qe,{summary:a,deviceId:n,organizationId:o,ownerSlug:h,connectorDef:m.get(a.connector_key),openSettings:a.connection_id===r&&t},a.connection_id))})})]})}function qe({summary:s,deviceId:n,organizationId:o,ownerSlug:h,connectorDef:m,openSettings:r}){const{data:t=[],isLoading:u,isError:p,refetch:g}=Y(o,{connectionIds:[s.connection_id]}),a=t.find(j=>j.id===s.connection_id&&j.device_worker_id===n),f=m?.name??s.connector_key,N=a?Q(a):null;return e.jsxs("section",{id:`connection-${s.connection_id}`,"aria-label":f,className:"scroll-mt-24",children:[a?e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:Ee(a)}),e.jsx("span",{children:a.status})]}):null,u||!o?e.jsx(R,{className:"h-24 w-full"}):p?e.jsxs("div",{role:"alert",className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Could not load this connection."}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>void g(),children:"Retry"})]}):a?e.jsxs(e.Fragment,{children:[N?e.jsx("p",{role:"alert",className:"mb-4 text-sm text-destructive",children:N}):null,e.jsx("div",{className:"mb-4",children:e.jsx(re,{connection:a})}),e.jsx(Le,{connection:a,connectorDef:m,ownerSlug:h,openSettings:r,showActivity:!1,showShare:!1,embedded:!0})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection is no longer available on this device."})]})}function Ke({device:s,ownerSlug:n}){const o=v.useId(),{data:h=[]}=le(),m=V(),[r,t]=v.useState(!1),[u,p]=v.useState(null),[g,a]=v.useState(null),f=h.filter(l=>l.is_member).map(l=>({id:l.id,name:l.name,isPersonal:l.is_personal===!0})),N=f.find(l=>l.id===s.organization_id),j=N?M(N):s.organization_name??"No workspace",d=f.filter(l=>l.id!==s.organization_id),x=d.find(l=>l.id===u)??null,y=()=>{t(!1),p(null)},_=async l=>{a(null);try{await m.mutateAsync({deviceWorkerId:s.id,organizationId:l}),y()}catch(i){a(i instanceof Error?i.message:"Could not move the device.")}};return e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Workspace: "}),j]}),!r&&d.length>0?e.jsx(b,{size:"sm",variant:"outline",onClick:()=>{a(null),t(!0)},children:"Change workspace"}):null]}),r?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("label",{htmlFor:o,className:"text-xs text-muted-foreground",children:"Move to"}),e.jsxs("select",{id:o,value:u??"",disabled:m.isPending,onChange:l=>p(l.target.value||null),className:"h-8 rounded-md border border-input bg-background px-2 text-sm",children:[e.jsx("option",{value:"",children:"Choose a workspace"}),d.map(l=>e.jsx("option",{value:l.id,children:M(l)},l.id))]}),x?null:e.jsx(b,{size:"sm",variant:"ghost",onClick:y,children:"Cancel"})]}):null,x?e.jsx(X,{device:s,ownerSlug:n,title:`Move device to ${x.name}`,intro:`Move ${C(s)} from ${j} to ${M(x)}?`,aftermath:`It is set up fresh in ${x.name}, with its connections there private to you until you share them.`,confirmLabel:"Move device",pending:m.isPending,onConfirm:()=>void _(x.id),onCancel:y}):null,g?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:g}):null]})}function We({ownerSlug:s,deviceId:n,organizationId:o,selectedConnection:h,openSettings:m}){const r=de(),{data:t=[],isLoading:u,isError:p,refetch:g}=me(),a=ue(),f=xe(),[N,j]=v.useState(!1),[d,x]=v.useState(!1),[y,_]=v.useState(""),l=he(t,n),i=l&&pe(l,s)?l:void 0,c=i?.id??n,{data:w=[]}=fe(o,{profileKind:"browser_session"}),S=v.useMemo(()=>w.filter(k=>k.device_worker_id===c&&k.status!=="revoked"),[w,c]),$=i?.label?.trim()??"";if(v.useEffect(()=>{d||_($)},[$,d]),u)return e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-6 w-6 rounded"}),e.jsx(R,{className:"h-5 w-40"})]}),e.jsx(ze,{})]});if(p)return e.jsx(P,{children:e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsx("p",{children:"Could not load this device."}),e.jsx(b,{variant:"outline",size:"sm",onClick:()=>void g(),children:"Retry"})]})});if(!i&&l&&o)return e.jsxs(P,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{platform:T(l),className:"h-5 w-5"}),e.jsx("h1",{className:"text-base font-semibold",children:C(l)})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This device lives in"," ",l.organization_name??"another workspace",", not this workspace."]}),e.jsx(H,{device:l,organizationId:o,ownerSlug:s})]});if(!i)return e.jsxs(P,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"This device isn't in this workspace, so its details aren't available."}),e.jsx(E,{to:"/$owner/connectors",params:{owner:s},search:{},className:"text-sm text-primary hover:underline",children:"Back to connectors"})]});const D=ge(i),A=D?je(s,D,ve()):void 0,J=T(i),Z=ye(i.app_version),ee=be(i,Z),B=()=>{const k=y.trim(),se=i.label?.trim()??"";if(k===se){x(!1);return}f.mutate({deviceWorkerId:i.id,label:k.length===0?null:k},{onSuccess:()=>x(!1)})};return e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsxs(Ne,{header:e.jsx(ke,{breadcrumb:e.jsx($e,{crumbs:[e.jsx(E,{to:"/$owner/connectors",params:{owner:s},search:{},className:K,children:"Connectors"},"connectors"),...A?[e.jsx(E,{to:"/$owner/connectors/app/$appId",params:{owner:s,appId:A.id},className:K,children:A.name},"app")]:[]]}),icon:e.jsx(O,{platform:J,className:"h-5 w-5"}),title:d?e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(we,{"aria-label":"Device name",value:y,onChange:k=>_(k.target.value),placeholder:C({...i,label:null}),maxLength:80,className:"h-9 max-w-sm text-base font-semibold",autoFocus:!0,onKeyDown:k=>{k.key==="Enter"?(k.preventDefault(),N||B()):k.key==="Escape"&&(j(!1),_(i.label?.trim()??""),x(!1))}}),N?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-lg bg-destructive/10 px-3 py-2",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Forgets this device"," ",i.connector_count>0?`and un-pins ${i.connector_count} connector${i.connector_count===1?"":"s"} across every workspace, not just this one.`:"with no pinned connections."]}),e.jsxs(b,{variant:"destructive",size:"sm",disabled:a.isPending,onClick:()=>a.mutate(i.id,{onSuccess:()=>{j(!1),r({to:"/$owner/connectors",params:{owner:s},search:{}})}}),children:[a.isPending?e.jsx(z,{className:"mr-1.5"}):null,a.isPending?"Removing...":"Confirm remove"]}),e.jsx(b,{size:"sm",variant:"ghost",disabled:a.isPending,onClick:()=>j(!1),children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{size:"sm",onClick:B,disabled:f.isPending,children:[f.isPending?e.jsx(z,{className:"mr-1.5"}):null,f.isPending?"Saving...":"Save"]}),e.jsx(b,{size:"sm",variant:"ghost",disabled:f.isPending,onClick:()=>{_(i.label?.trim()??""),x(!1)},children:"Cancel"}),e.jsxs(b,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",disabled:f.isPending||a.isPending,onClick:()=>j(!0),children:[e.jsx(Ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove device"]})]})]}):e.jsxs("span",{className:"flex items-center gap-1.5",children:[C(i),e.jsx(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground","aria-label":"Edit device",onClick:()=>{j(!1),_(i.label?.trim()??""),x(!0)},children:e.jsx(Se,{className:"h-3.5 w-3.5"})})]}),badge:e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{className:`size-1.5 rounded-full ${i.online?"bg-emerald-500":"bg-muted-foreground/50"}`}),i.online?i.connector_error_count>0?"Needs attention":"Online":"Offline"]}),meta:ee||void 0,caption:`Last seen ${q(new Date(i.last_seen_at),{addSuffix:!0})}${i.last_sync_at?` · Last sync ${q(new Date(i.last_sync_at),{addSuffix:!0})}`:""}`}),children:[e.jsx(Ke,{device:i,ownerSlug:s}),i.connector_error_count>0?e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-amber-500/10 px-3 py-2 text-xs text-amber-600",children:[e.jsx(_e,{className:"h-3.5 w-3.5 shrink-0"}),i.connector_error_count," connector",i.connector_error_count===1?"":"s"," pinned to this device ",i.connector_error_count===1?"is":"are"," erroring."]}):null,e.jsx(H,{device:i,organizationId:o,ownerSlug:s,selectedConnection:h,openSettings:m}),S.length>0?e.jsx(I,{title:"Browser auth profiles",children:e.jsx(He,{profiles:S})}):null,e.jsx(I,{title:"Runs",children:e.jsx(Ie,{scope:{deviceId:c},ownerSlug:s})})]})})}function He({profiles:s}){return s.length===0?null:e.jsx("div",{className:"rounded-lg border",children:e.jsx("ul",{className:"divide-y",children:s.map(n=>e.jsxs("li",{className:"space-y-2 px-3 py-2.5 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-medium",children:n.display_name}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:n.connector_key??"Any connector"}),n.browser_kind?e.jsxs("span",{children:["· ",n.browser_kind]}):null,n.captured_at?e.jsxs("span",{title:n.captured_at,children:["· captured ",De(n.captured_at)]}):null,typeof n.cookie_count=="number"?e.jsxs("span",{children:["· ",n.cookie_count," cookie",n.cookie_count===1?"":"s"]}):null]})]}),e.jsx(Re,{status:n.is_expired?"error":Ae(n.status),showDot:!0,children:n.is_expired?"expired":n.status})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Refresh the session using the connector’s authorization instructions."})]},n.id))})})}function ss(){const{owner:s,deviceId:n}=W.useParams(),{connection:o,settings:h}=W.useSearch();return e.jsx(Pe,{owner:s,children:({ownerSlug:m,organizationId:r})=>e.jsx(We,{ownerSlug:m,deviceId:n,organizationId:r,selectedConnection:o,openSettings:h})})}export{ss as component};
|
|
2
|
-
//# sourceMappingURL=device._deviceId-Cs3ZmXWo.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as x,t as m,j as e,bn as C,bo as _,bp as S,bq as b,br as c,eh as u}from"./index-Cr5hwh-C.js";import{c as w}from"./connection-label-BobuYiAG.js";const h="__connection_picker_create_new__";function y({connections:s,value:r,onValueChange:n,connectorKey:a,disabled:p,placeholder:d="Choose a connection",includeWorkspaceEvents:i=!1,ariaLabel:g="Connection"}){const f=x(),l=m().org?.slug,o=a?s.filter(t=>t.connector_key===a):s,j=t=>{if(t===h){if(!l)return;f({to:"/$owner/connectors/create",params:{owner:l},search:a?{connector:a}:{}});return}n(t)};return e.jsxs(C,{value:r,onValueChange:j,disabled:p,children:[e.jsx(_,{"aria-label":g,children:e.jsx(S,{placeholder:d})}),e.jsxs(b,{children:[i?e.jsxs(e.Fragment,{children:[e.jsx(c,{value:"workspace",children:"Current workspace"}),o.length>0?e.jsx(u,{}):null]}):null,o.map(t=>e.jsx(c,{value:String(t.id),children:w(t)},t.id)),l?e.jsxs(e.Fragment,{children:[o.length>0||i?e.jsx(u,{}):null,e.jsx(c,{value:h,children:"Connect an app…"})]}):null]})]})}function v(s){const r=[];for(const n of s)r.push({id:n.id,name:n.name,entityType:n.entity_type}),n.children&&n.children.length>0&&r.push(...v(n.children));return r}export{y as C,v as f};
|
|
2
|
-
//# sourceMappingURL=entity-options-uXjgT7y9.js.map
|