@lobu/runtime-server 22.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.
Files changed (303) hide show
  1. package/dist/catalogs/connectors.json +1448 -212
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +15 -2
  5. package/dist/connectors/google_gmail.ts +1 -0
  6. package/dist/connectors/jira-helpers.ts +313 -0
  7. package/dist/connectors/jira.ts +29 -221
  8. package/dist/connectors/linkedin-browser-script.ts +13 -0
  9. package/dist/connectors/linkedin-draft-page.js +104 -0
  10. package/dist/connectors/linkedin-drafts.ts +73 -0
  11. package/dist/connectors/linkedin-identity.ts +32 -0
  12. package/dist/connectors/linkedin-inbox-adapter.js +1182 -0
  13. package/dist/connectors/linkedin-inbox.ts +156 -0
  14. package/dist/connectors/linkedin-like.ts +114 -0
  15. package/dist/connectors/linkedin-takeout.ts +577 -0
  16. package/dist/connectors/linkedin.ts +4017 -0
  17. package/dist/connectors/reddit.ts +92 -20
  18. package/dist/connectors/slack.ts +1 -0
  19. package/dist/connectors/takeout-utils.ts +240 -0
  20. package/dist/connectors/tiktok-inbox-page.js +9 -9
  21. package/dist/connectors/tiktok-web-page.js +21 -15
  22. package/dist/connectors/tiktok_web.ts +63 -30
  23. package/dist/connectors/whatsapp-web-adapter.js +104 -574
  24. package/dist/connectors/whatsapp-web-helpers.ts +30 -444
  25. package/dist/connectors/whatsapp-web-identity.ts +20 -6
  26. package/dist/connectors/whatsapp_web.ts +46 -646
  27. package/dist/connectors/x-dm-adapter.js +556 -0
  28. package/dist/connectors/x-identity.ts +33 -2
  29. package/dist/connectors/x.ts +266 -120
  30. package/dist/db/migrations/20261017120000_drop_feeds_kind_virtual.sql +26 -0
  31. package/dist/db/migrations/20261017130000_drop_retired_dead_code_columns.sql +46 -0
  32. package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
  33. package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
  34. package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
  35. package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
  36. package/dist/dependencies.bun.lock +78 -75
  37. package/dist/guest.bundle.js +650 -448
  38. package/dist/owletto/dist/assets/_-CC8cTmRg.js +3 -0
  39. package/dist/owletto/dist/assets/_-ksFp4zVf.js +2 -0
  40. package/dist/owletto/dist/assets/_agentId-DWUFSrVp.js +2 -0
  41. package/dist/owletto/dist/assets/_agentId-MENLoohA.js +2 -0
  42. package/dist/owletto/dist/assets/_automationId-BnHqdXOC.js +2 -0
  43. package/dist/owletto/dist/assets/_connectorKey._connectionId-CefXIqy2.js +2 -0
  44. package/dist/owletto/dist/assets/_connectorKey.index-C1QPGf9E.js +2 -0
  45. package/dist/owletto/dist/assets/_conversationId-DinuPCUp.js +2 -0
  46. package/dist/owletto/dist/assets/{_deploymentId-BQfYN1U2.js → _deploymentId-BeyzVjRm.js} +2 -2
  47. package/dist/owletto/dist/assets/_eventId-3L_qeL_l.js +2 -0
  48. package/dist/owletto/dist/assets/_name-Dgedji78.js +2 -0
  49. package/dist/owletto/dist/assets/_owner-DbrKma4e.js +3 -0
  50. package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +2 -0
  51. package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +2 -0
  52. package/dist/owletto/dist/assets/_slug-ndDr_CUg.js +2 -0
  53. package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +2 -0
  54. package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +2 -0
  55. package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-CRKbM2Xy.js} +2 -2
  56. package/dist/owletto/dist/assets/activity-route-view-CFLNukhD.js +2 -0
  57. package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-Be1Okb2C.js} +2 -2
  58. package/dist/owletto/dist/assets/{agent-client-setup-list-B2SvH7xD.js → agent-client-setup-list-BA8dU_C6.js} +2 -2
  59. package/dist/owletto/dist/assets/agent-connect-pages-CAV-yXus.js +2 -0
  60. package/dist/owletto/dist/assets/agent-editor-form-Bi6WvYX-.js +2 -0
  61. package/dist/owletto/dist/assets/{agent-guardrails-route-BaV1VpDh.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
  62. package/dist/owletto/dist/assets/{agent-loading-shells-CtZJM2Gc.js → agent-loading-shells-De_2d8Lr.js} +2 -2
  63. package/dist/owletto/dist/assets/{agent-permissions-matrix-Ds48KFK9.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
  64. package/dist/owletto/dist/assets/{agent-skill-context-DPk5r08w.js → agent-skill-context-JLaTamGR.js} +2 -2
  65. package/dist/owletto/dist/assets/{agent-skills-route-DYpB5H1J.js → agent-skills-route-DcK41PWj.js} +2 -2
  66. package/dist/owletto/dist/assets/agent-subpage-shell-BBJoyTuC.js +2 -0
  67. package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +6 -0
  68. package/dist/owletto/dist/assets/agents-C-ReckCa.js +2 -0
  69. package/dist/owletto/dist/assets/agents-workbench-CqaKGggb.js +2 -0
  70. package/dist/owletto/dist/assets/app._appId-Cl1fTuIt.js +2 -0
  71. package/dist/owletto/dist/assets/automation-detail-content-BMLL4lxO.js +2 -0
  72. package/dist/owletto/dist/assets/automations-C-ReckCa.js +2 -0
  73. package/dist/owletto/dist/assets/callback-DTKKsfkz.js +2 -0
  74. package/dist/owletto/dist/assets/{card-DIF8SF9b.js → card-yU0TmNRH.js} +2 -2
  75. package/dist/owletto/dist/assets/{claim-DELEa-gH.js → claim-DJfTvlT2.js} +2 -2
  76. package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
  77. package/dist/owletto/dist/assets/{clients-CpG676mg.js → clients-L4K1UT8c.js} +2 -2
  78. package/dist/owletto/dist/assets/{code-editor-V27Z4o3P.js → code-editor-U54Gwjit.js} +2 -2
  79. package/dist/owletto/dist/assets/connect-4zqtnDHb.js +2 -0
  80. package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +2 -0
  81. package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +2 -0
  82. package/dist/owletto/dist/assets/connected._clientId.activity-DTpSW1Xy.js +2 -0
  83. package/dist/owletto/dist/assets/connected._clientId.index-h9X5H1x8.js +2 -0
  84. package/dist/owletto/dist/assets/{connection-DySpRE9x.js → connection-ByvKkyFm.js} +2 -2
  85. package/dist/owletto/dist/assets/{connection-feed-detail-C_D68j6d.js → connection-feed-detail-DWM9lTao.js} +2 -2
  86. package/dist/owletto/dist/assets/connections-browser-CEwYrYqt.js +2 -0
  87. package/dist/owletto/dist/assets/{connector-provenance-CNXtzYg5.js → connector-provenance-BocTm__v.js} +2 -2
  88. package/dist/owletto/dist/assets/connector-scope-lists-OYDOydtz.js +2 -0
  89. package/dist/owletto/dist/assets/connectors-CyZpcE5f.js +2 -0
  90. package/dist/owletto/dist/assets/{consent-BVzxrAO9.js → consent-DdfINrVp.js} +2 -2
  91. package/dist/owletto/dist/assets/{conversations-table-DfZGICl7.js → conversations-table-BSznfdYt.js} +2 -2
  92. package/dist/owletto/dist/assets/{core.esm-DiTpULFl.js → core.esm-Dr7tcIB-.js} +2 -2
  93. package/dist/owletto/dist/assets/create-CBGwASon.js +2 -0
  94. package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +2 -0
  95. package/dist/owletto/dist/assets/create-CwThQtd3.js +2 -0
  96. package/dist/owletto/dist/assets/create-automation-form-9T5WnoUs.js +3 -0
  97. package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
  98. package/dist/owletto/dist/assets/{cronstrue-DPXl0qA2.js → cronstrue-BWFEyy_P.js} +2 -2
  99. package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
  100. package/dist/owletto/dist/assets/{deployments-body-D6TAWs_6.js → deployments-body-2xKS8gRo.js} +2 -2
  101. package/dist/owletto/dist/assets/{deployments-DCQdFdwG.js → deployments-wG_8QzOF.js} +2 -2
  102. package/dist/owletto/dist/assets/{device-CntqYW65.js → device-6z-xgsoW.js} +2 -2
  103. package/dist/owletto/dist/assets/device-pin-tombstone-Cwq88RMU.js +2 -0
  104. package/dist/owletto/dist/assets/device._deviceId-BDerBfD9.js +2 -0
  105. package/dist/owletto/dist/assets/entity-avatar-Cc1CuI-0.js +2 -0
  106. package/dist/owletto/dist/assets/entity-options-DHdMC1Lx.js +2 -0
  107. package/dist/owletto/dist/assets/entity-page--OkXmlNP.js +2 -0
  108. package/dist/owletto/dist/assets/entity-type-page-89RoK_-P.js +2 -0
  109. package/dist/owletto/dist/assets/event-detail-D4YZRtrA.js +2 -0
  110. package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +2 -0
  111. package/dist/owletto/dist/assets/filter-editors-B1_QUpg_.js +2 -0
  112. package/dist/owletto/dist/assets/{full-page-spinner-KpV2FS2u.js → full-page-spinner-Cqih-8IW.js} +2 -2
  113. package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +2 -0
  114. package/dist/owletto/dist/assets/identity-B0nH4yiC.js +2 -0
  115. package/dist/owletto/dist/assets/index-4TSkcsth.js +2 -0
  116. package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
  117. package/dist/owletto/dist/assets/index-BgkhXElB.js +2 -0
  118. package/dist/owletto/dist/assets/index-CoW4Bz3w.js +2 -0
  119. package/dist/owletto/dist/assets/index-Codw-Qqi.js +2 -0
  120. package/dist/owletto/dist/assets/{index-BNh2cidi.js → index-DAOyXG1X.js} +2 -2
  121. package/dist/owletto/dist/assets/{index-BEvyBdOU.js → index-DKPwCasf.js} +2 -2
  122. package/dist/owletto/dist/assets/index-DMyXd3bJ.js +2 -0
  123. package/dist/owletto/dist/assets/index-DYCqXaMf.js +7950 -0
  124. package/dist/owletto/dist/assets/index-DYYZLcJ0.js +2 -0
  125. package/dist/owletto/dist/assets/index-DYzWV5_z.js +2 -0
  126. package/dist/owletto/dist/assets/index-Da6CrGEu.js +2 -0
  127. package/dist/owletto/dist/assets/{index-DCdkwg9H.js → index-DfyDUpuI.js} +2 -2
  128. package/dist/owletto/dist/assets/index-DneshLbf.js +2 -0
  129. package/dist/owletto/dist/assets/index-TgRS2v_F.js +2 -0
  130. package/dist/owletto/dist/assets/{index-BJXkc60S.js → index-ZNlrDc_f.js} +2 -2
  131. package/dist/owletto/dist/assets/{json-diff-D_Ym3Uku.js → json-diff-DFvYINBT.js} +3 -3
  132. package/dist/owletto/dist/assets/{list-skeleton-Bl0OS39L.js → list-skeleton-DFsEqLU1.js} +2 -2
  133. package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
  134. package/dist/owletto/dist/assets/{logout-DUccApuZ.js → logout-BmNwoAf7.js} +2 -2
  135. package/dist/owletto/dist/assets/member-scope-gate-B2LrMWBU.js +2 -0
  136. package/dist/owletto/dist/assets/memory-browse-page-Cjpl8EbB.js +103 -0
  137. package/dist/owletto/dist/assets/{model-selector-CB1BDvlW.js → model-selector-TQcA93xm.js} +2 -2
  138. package/dist/owletto/dist/assets/models-D7aED5Sa.js +2 -0
  139. package/dist/owletto/dist/assets/new-BMrFy5Qa.js +2 -0
  140. package/dist/owletto/dist/assets/{new-B5UsLiy6.js → new-ByBhteWA.js} +2 -2
  141. package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
  142. package/dist/owletto/dist/assets/{oauth-workspace-access-PGyTnW2K.js → oauth-workspace-access-D_5uESuz.js} +2 -2
  143. package/dist/owletto/dist/assets/{organization-BH8PYlVu.js → organization-DTFoYP4V.js} +2 -2
  144. package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
  145. package/dist/owletto/dist/assets/{permissions-CwN_YP3u.js → permissions-C_auqxfP.js} +2 -2
  146. package/dist/owletto/dist/assets/proposal-review-shell-DsNiavG_.js +2 -0
  147. package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +2 -0
  148. package/dist/owletto/dist/assets/{recent-DqdZE_TI.js → recent-3d99S2IE.js} +2 -2
  149. package/dist/owletto/dist/assets/record-activity-C9KfBkXb.js +2 -0
  150. package/dist/owletto/dist/assets/record-field-peek-BBZcRuGT.js +2 -0
  151. package/dist/owletto/dist/assets/record-session-BizRugWs.js +2 -0
  152. package/dist/owletto/dist/assets/{reset-password-DAvBYkiI.js → reset-password-DqfcSn8M.js} +2 -2
  153. package/dist/owletto/dist/assets/runs-panel-T1ZxTVz6.js +2 -0
  154. package/dist/owletto/dist/assets/runs-table-D_8QlCCN.js +2 -0
  155. package/dist/owletto/dist/assets/schema-value-normalization-CylKX3PK.js +97 -0
  156. package/dist/owletto/dist/assets/settings-B_ClYztB.js +2 -0
  157. package/dist/owletto/dist/assets/settings-DgX1-xo7.js +2 -0
  158. package/dist/owletto/dist/assets/skills-Drw5tcZw.js +2 -0
  159. package/dist/owletto/dist/assets/{source-record-panels-CRIPMWfN.js → source-record-panels-Cg249m1S.js} +2 -2
  160. package/dist/owletto/dist/assets/{use-mention-search-DqEykWl_.js → use-mention-search-BYbFvHbJ.js} +2 -2
  161. package/dist/owletto/dist/assets/view-param-filters-DMSqkN2J.js +2 -0
  162. package/dist/owletto/dist/index.html +2 -2
  163. package/dist/server-main.bundle.mjs +14031 -12680
  164. package/npm-shrinkwrap.json +329 -313
  165. package/package.json +6 -5
  166. package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
  167. package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
  168. package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
  169. package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
  170. package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
  171. package/vendor/connector-sdk/dist/index.d.ts +3 -0
  172. package/vendor/connector-sdk/dist/index.js +2 -0
  173. package/vendor/connector-sdk/package.json +9 -1
  174. package/vendor/core/dist/agent-policy.js +0 -3
  175. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  176. package/vendor/core/dist/agent-tooling.js +3 -1
  177. package/vendor/core/dist/capabilities.d.ts +1 -1
  178. package/vendor/core/dist/capabilities.js +0 -1
  179. package/vendor/core/dist/connector-query-errors.d.ts +32 -0
  180. package/vendor/core/dist/connector-query-errors.js +41 -1
  181. package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
  182. package/vendor/core/dist/contracts/agent-settings.js +12 -1
  183. package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
  184. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
  185. package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
  186. package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
  187. package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
  188. package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
  189. package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
  190. package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
  191. package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
  192. package/vendor/core/dist/contracts/worker/protocol.d.ts +47 -133
  193. package/vendor/core/dist/contracts/worker/protocol.js +33 -62
  194. package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
  195. package/vendor/core/dist/device-pin-tombstones.js +57 -0
  196. package/vendor/core/dist/index.d.ts +3 -2
  197. package/vendor/core/dist/index.js +3 -1
  198. package/vendor/core/dist/logger.js +10 -25
  199. package/vendor/core/dist/suggestions.d.ts +15 -2
  200. package/vendor/core/dist/suggestions.js +48 -3
  201. package/vendor/core/dist/types.d.ts +26 -0
  202. package/vendor/core/dist/types.js +5 -0
  203. package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
  204. package/vendor/core/dist/worker/wire.d.ts +0 -10
  205. package/vendor/core/package.json +16 -10
  206. package/vendor/postgres/cf/src/connection.js +18 -0
  207. package/vendor/postgres/cjs/src/connection.js +18 -0
  208. package/vendor/postgres/src/connection.js +18 -0
  209. package/vendor/views/dist/api.d.ts +71 -17
  210. package/vendor/views/dist/api.js +200 -35
  211. package/vendor/views/dist/bridge.d.ts +3 -0
  212. package/vendor/views/dist/bridge.js +9 -1
  213. package/vendor/views/dist/components.d.ts +170 -0
  214. package/vendor/views/dist/components.js +361 -0
  215. package/vendor/views/dist/index.d.ts +1 -1
  216. package/vendor/views/package.json +11 -1
  217. package/dist/owletto/dist/assets/_-CEPl6gU4.js +0 -3
  218. package/dist/owletto/dist/assets/_-C_zNZben.js +0 -2
  219. package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +0 -2
  220. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +0 -2
  221. package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +0 -2
  222. package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +0 -2
  223. package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +0 -2
  224. package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +0 -2
  225. package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +0 -2
  226. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +0 -2
  227. package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +0 -3
  228. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +0 -2
  229. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +0 -2
  230. package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +0 -2
  231. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +0 -2
  232. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +0 -2
  233. package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +0 -2
  234. package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +0 -2
  235. package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +0 -2
  236. package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +0 -2
  237. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +0 -6
  238. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +0 -2
  239. package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +0 -2
  240. package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +0 -2
  241. package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +0 -2
  242. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +0 -2
  243. package/dist/owletto/dist/assets/callback-CU-hb8JB.js +0 -2
  244. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
  245. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +0 -2
  246. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +0 -2
  247. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +0 -2
  248. package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +0 -2
  249. package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +0 -2
  250. package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +0 -2
  251. package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +0 -2
  252. package/dist/owletto/dist/assets/connectors-BJnk1z_2.js +0 -2
  253. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +0 -2
  254. package/dist/owletto/dist/assets/create-JRFM8mMf.js +0 -2
  255. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +0 -3
  256. package/dist/owletto/dist/assets/create-iHcxV0xd.js +0 -2
  257. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +0 -2
  258. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +0 -2
  259. package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +0 -2
  260. package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +0 -2
  261. package/dist/owletto/dist/assets/entity-options-UJs64GdQ.js +0 -2
  262. package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +0 -2
  263. package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +0 -2
  264. package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +0 -2
  265. package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +0 -2
  266. package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +0 -2
  267. package/dist/owletto/dist/assets/guardrails-molekzAF.js +0 -2
  268. package/dist/owletto/dist/assets/identity-BJcaG66g.js +0 -2
  269. package/dist/owletto/dist/assets/index-B04ON9Jv.js +0 -2
  270. package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
  271. package/dist/owletto/dist/assets/index-BOsK-K-2.js +0 -2
  272. package/dist/owletto/dist/assets/index-BOzuAbvi.js +0 -2
  273. package/dist/owletto/dist/assets/index-Bk1x7A67.js +0 -2
  274. package/dist/owletto/dist/assets/index-CFnx5huL.js +0 -2
  275. package/dist/owletto/dist/assets/index-D3s8rhG9.js +0 -2
  276. package/dist/owletto/dist/assets/index-Dbd1jusf.js +0 -2
  277. package/dist/owletto/dist/assets/index-DqZuqC08.js +0 -2
  278. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +0 -2
  279. package/dist/owletto/dist/assets/index-KPOvMVa-.js +0 -2
  280. package/dist/owletto/dist/assets/index-_oPeVpL_.js +0 -7950
  281. package/dist/owletto/dist/assets/login-QHdxqX-4.js +0 -2
  282. package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +0 -2
  283. package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +0 -103
  284. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +0 -2
  285. package/dist/owletto/dist/assets/new-BWo8_Pms.js +0 -2
  286. package/dist/owletto/dist/assets/new-DpmDXmFI.js +0 -2
  287. package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +0 -2
  288. package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +0 -2
  289. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +0 -2
  290. package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +0 -2
  291. package/dist/owletto/dist/assets/renderer-BL6VcwQH.js +0 -97
  292. package/dist/owletto/dist/assets/runs-BWtc5rmc.js +0 -2
  293. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +0 -2
  294. package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +0 -2
  295. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +0 -2
  296. package/dist/owletto/dist/assets/settings-Crxlwps-.js +0 -2
  297. package/dist/owletto/dist/assets/skills-D0X430X8.js +0 -2
  298. package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +0 -2
  299. package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +0 -2
  300. package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +0 -2
  301. package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
  302. package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
  303. /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
@@ -1,2 +0,0 @@
1
- import{io as e,j as r}from"./index-_oPeVpL_.js";import{a as m}from"./agents-workbench-CMyk4PI7.js";import"./agent-editor-form-oUnIYHd7.js";import"./model-selector-CB1BDvlW.js";import"./proposal-review-shell-DKKGu4Ww.js";import"./runs-BWtc5rmc.js";function g(){const{owner:o,agentId:t}=e.useParams();return r.jsx(m,{owner:o,agentId:t,tab:"models"})}export{g as component};
2
- //# sourceMappingURL=models-DnMb3n-Z.js.map
@@ -1,2 +0,0 @@
1
- import{gJ as o,m as p,Z as x,g as f,t as h,aZ as L,j as e,aB as b,fL as w,af as A,fM as j,L as C,fN as N,ex as S,aQ as k,bQ as y}from"./index-_oPeVpL_.js";import{A as E}from"./agent-editor-form-oUnIYHd7.js";import"./model-selector-CB1BDvlW.js";const _="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6";function B(){const{owner:a}=o.useParams(),t=o.useSearch(),r=p(),i=x(),{isAuthenticated:c}=f(),{isMember:g,isLoading:m}=h(),n=c&&g,{data:u=[],isLoading:l}=L({enabled:n});return e.jsx("div",{className:_,children:e.jsxs(b,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(w,{breadcrumb:e.jsx(j,{crumbs:[e.jsx(C,{to:"/$owner/agents",params:{owner:a},className:N,children:"Agents"},"agents")]}),icon:e.jsx(A.agents.icon,{className:"h-6 w-6"}),title:"Build a managed agent",caption:"Create an agent that Lobu runs and manages for this workspace."}),m||n&&l?e.jsx(S,{rows:1}):n?e.jsx(E,{mode:{kind:"create"},existingAgentIds:u.map(s=>s.agentId),onCreated:async s=>{const d=["agents",a];if(await i.refetchQueries({queryKey:d,exact:!0}),t.platform&&t.listen){await r({to:"/$owner/automations/new",params:{owner:a},search:{...t,agent:s}});return}await r({to:"/$owner/agents/$agentId/settings",params:{owner:a,agentId:s},search:{run_id:void 0}})}}):e.jsx(k,{icon:y,title:"Workspace membership required",description:"Only workspace members can build managed agents."})]})})}export{B as component};
2
- //# sourceMappingURL=new-BWo8_Pms.js.map
@@ -1,2 +0,0 @@
1
- import{m as N,t as j,cN as p,r as x,j as e,B as w,gj as y,ba as _,L as b,S as f,gk as v,ah as C}from"./index-_oPeVpL_.js";import{C as k,A}from"./create-automation-form-_4vUkrls.js";import"./cronstrue-DPXl0qA2.js";import"./entity-options-UJs64GdQ.js";import"./connection-label-BobuYiAG.js";import"./model-selector-CB1BDvlW.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-V27Z4o3P.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-DqEykWl_.js";function S(s){return s.includes(":")?s.slice(s.indexOf(":")+1):s}function T({prefillAgentId:s,onCancel:t,initialTriggers:m}){const{org:g}=j(),[o,i]=x.useState({ready:!1,triggers:[]}),[a,l]=x.useState(),h=x.useCallback(n=>{i(u=>JSON.stringify(u)===JSON.stringify(n)?u:n)},[]),c=a??m;return e.jsx(k,{startFromScratch:!!m,organizationId:g?.id??"",prefillAgentId:s,onClose:t,onPrefillTriggers:n=>l(n.length>0?n:void 0),onSuccess:t,hideHeader:!0,hideCancel:!0,submitLabel:"Create Automation",submitDisabled:!o.ready,createFields:{triggers:o.triggers},triggerFields:e.jsx(A,{organizationId:g?.id??null,initialTriggers:c,onChange:h},JSON.stringify(c??"new"))})}function B({owner:s,prefilled:t}){const m=N(),{org:g}=j(),o=p(g?.id??null,{status:"active",limit:500}),i=!!(t?.platform&&(t.listen||t.resource)),a=x.useMemo(()=>{if(!t?.platform||!t.listen&&!t.resource)return;const c=o.data??[],n=t.connection?c.find(r=>r.slug===t.connection):(()=>{const r=c.filter(d=>d.connector_key!==t.platform?!1:t.resource?!0:d.facets.chat&&(d.external_tenant_id??"")===(t.team??""));return r.length===1?r[0]:void 0})();if(t.connection&&!n)return;const u=t.events?.split(",").map(r=>r.trim()).filter(Boolean)??[];return[{kind:"event",source:"connector",connector_key:t.platform,...n?{connection_id:n.id}:{},event_types:u.length>0?u:t.listen?["message.created"]:[],match:t.resource?{resource_ref:t.resource,...t.resource_type?{resource_type:t.resource_type}:{}}:{channel_id:S(t.listen??"")},execution:"turn",active_run:t.listen?"steer":"queue",output:t.listen?"reply_to_source":"silent",skip_if_unchanged:!t.listen}]},[o.data,t]),l=()=>void m({to:"/$owner/automations",params:{owner:s}}),h=a?t?.resource?`React to changes on ${t.label??t.resource}.`:`React to messages in ${t?.label??t?.listen}.`:i&&!o.isLoading?"Choose the matching connection and event, then define the reaction.":"Start from a template, from scratch, or clone an existing Automation.";return e.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:e.jsxs("div",{className:"mx-auto flex w-full min-w-0 max-w-3xl flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsxs(w,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:l,children:[e.jsx(y,{className:"h-3.5 w-3.5"}),"Automations"]}),e.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[e.jsx(_,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),"New automation"]})]})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:h}),t?.listen&&a?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Choose an agent below, or"," ",e.jsx(b,{to:"/$owner/agents/new",params:{owner:s},search:t,className:"underline underline-offset-4",children:"create an agent"})," ","and return to this conversation setup."]}):null,i&&o.isLoading?e.jsxs("div",{className:"space-y-3",children:[e.jsx(f,{className:"h-10 w-full"}),e.jsx(f,{className:"h-32 w-full"})]}):i&&t?.connection&&!a?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"This connection is no longer available. Reopen setup from your conversation."}):e.jsx(T,{prefillAgentId:t?.agent,onCancel:l,initialTriggers:a})]})})}function W(){const{owner:s}=v.useParams(),t=v.useSearch();return e.jsx(C,{owner:s,children:()=>e.jsx(B,{owner:s,prefilled:t})})}export{W as component};
2
- //# sourceMappingURL=new-DpmDXmFI.js.map
@@ -1,2 +0,0 @@
1
- import{iG as T,iH as L,r as x,gH as E,u as C,j as t,cY as D,au as z,cN as B,S as g,i2 as M,B as j,iI as K,iJ as y,iK as F,iL as b,iM as S,iN as H,ct as q,f as I,an as U,c6 as G,a1 as P,ah as V,iO as W,dq as J,iP as Q,bc as Y,iQ as X,dC as Z,ce as ee,iR as te,dG as ne,b8 as se}from"./index-_oPeVpL_.js";import{u as re,A as oe}from"./automation-detail-content-CEDNboId.js";import{A as ie}from"./agent-loading-shells-CtZJM2Gc.js";import{s as ae,h as ce,R as de,A as le}from"./agent-thread-C8UaUTWc.js";import{C as ue,b as pe,A as me}from"./connection-feed-detail-C_D68j6d.js";import{f as xe}from"./connector-scope-lists-BKDetNDc.js";import{a as fe}from"./connections-browser-Cnv2iBbZ.js";import{S as he}from"./source-record-panels-CRIPMWfN.js";import{E as _}from"./events-feed-fucGZSJR.js";import{E as ge}from"./event-detail-04qOUGIP.js";import"./create-automation-form-_4vUkrls.js";import"./cronstrue-DPXl0qA2.js";import"./entity-options-UJs64GdQ.js";import"./connection-label-BobuYiAG.js";import"./model-selector-CB1BDvlW.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-V27Z4o3P.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-DqEykWl_.js";import"./proposal-review-shell-DKKGu4Ww.js";import"./runs-BWtc5rmc.js";import"./json-diff-D_Ym3Uku.js";import"./deployments-DCQdFdwG.js";import"./app-bridge-BCm4muqj.js";import"./runs-table-DxIiqrSk.js";import"./status-dot-C5KDvvm9.js";import"./conversations-table-DfZGICl7.js";import"./renderer-BL6VcwQH.js";import"./card-DIF8SF9b.js";import"./clients-CpG676mg.js";import"./view-param-filters-Cylutoy1.js";import"./filter-editors-DCQgGLyR.js";const $=Symbol("trusted-automation-interaction");function je(e){return Object.defineProperty(e,$,{value:!0}),e}function ye(e){return{title:`${e} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${e} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${e} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${e} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${e} proposals.`}]}}const ve=new Set(["automation-approval-batch"]);function Ne(e){return new Promise(n=>{e({onSettled:(o,s)=>n(!!s)})})}function we(){const e=T(),n=L();return x.useMemo(()=>({toolNames:ve,resolve:(o,s)=>{if(!s||typeof s!="object"||s[$]!==!0)return null;const r=s;if(o==="automation-approval-batch"){const i=typeof r.runId=="number"&&Number.isSafeInteger(r.runId)&&r.runId>0?r.runId:null,a=typeof r.count=="number"&&Number.isSafeInteger(r.count)&&r.count>1?r.count:null,c=Array.isArray(r.runIds)?r.runIds.filter(l=>typeof l=="number"&&Number.isSafeInteger(l)&&l>0):[];return i===null||a===null||c.length!==a||new Set(c).size!==a?null:{view:ye(a),handlers:{manage_operations:l=>l.action!=="approve"&&l.action!=="reject"?Promise.resolve(!0):Ne(u=>l.action==="approve"?e.mutate({run_id:i,run_ids:c},u):n.mutate({run_id:i,run_ids:c},u))}}}return null}}),[e,n])}function be(e){const n=[];return e.forEach((o,s)=>{n.push({id:`sep:${o.runId}`,role:"system",parts:[{type:"text",text:Ae(o,s)}],createdAt:o.completedAt?new Date(o.completedAt).getTime():void 0});for(const r of o.messages)n.push({...r,id:`r${o.runId}:${r.id}`})}),n}function Ae(e,n){const o=(e.pendingActionCount??0)>0?`Waiting for you (${e.pendingActionCount})`:e.status==="completed"?"Completed":e.status??"Completed",s=(e.autoAppliedCount??0)>0?` · ${e.autoAppliedCount} applied automatically`:"",r=e.completedAt?new Date(e.completedAt).toLocaleString():null;return r?`Run ${n+1} · ${o}${s} · ${r}`:`Run ${n+1} · ${o}${s}`}const ke=/(?:^|\n)Run this Automation now/;function Ce(e){return e.role==="user"&&e.parts.some(n=>n.type==="text"&&ke.test(n.text))}function Se(e){return`history-interaction:${e.runId}:${e.eventId??"error"}`}function Ie({agentId:e,automationId:n,ownerSlug:o,runId:s}){const{data:r,isLoading:i}=E(e,n,{orgSlug:o,...s!=null?{runId:s}:{}}),a=we(),c=C(),l=x.useCallback(d=>{c?.open({href:`/${o}/automations/${n}?run_id=${d}`,title:`Automation run #${d}`,runId:d})},[c,o,n]),u=x.useMemo(()=>{const d=r?.runs??[],R=(s!=null?d.filter(p=>p.runId===s):d).slice().reverse();return be(R.map(p=>{const h=p.messages.map(m=>ae(m,{showToolCalls:!0})).filter(m=>m!==null&&!Ce(m));p.task?.trim()&&h.unshift({id:"task",role:"user",parts:[{type:"text",text:p.task.trim()}]});const A=p.actions??[],N=A.filter(m=>m.status==="pending");if(N.length>1){const m=N.map(f=>f.runId).sort((f,O)=>f-O);h.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${p.runId}`,toolName:"automation-approval-batch",args:je({runId:p.runId,count:N.length,runIds:m})}]})}for(const m of A){const f=ce([m],{workspaceSlug:o,agentId:e,webOrigin:typeof window>"u"?null:window.location.origin});f&&h.push({...f,id:Se(m)})}return{runId:p.runId,completedAt:p.completedAt,status:p.status,pendingActionCount:p.pendingActionCount,autoAppliedCount:p.autoAppliedCount,messages:h}}))},[e,r,o,s]);return i?t.jsx(ie,{readOnly:!0}):u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):t.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:t.jsx(de,{messages:u,workspaceSlug:o,children:t.jsx(le,{readOnly:!0,readerPositionMode:"runs",interactionExtension:a,onRunSelect:s==null&&c?l:void 0})})})}function Pe(e){if(!e||typeof e!="object")return[];const n=e.properties;if(!n)return[];const o=Array.isArray(e.required)?new Set(e.required.map(String)):new Set;return Object.entries(n).map(([s,r])=>({name:s,type:String(r.type??"any"),required:o.has(s),description:typeof r.description=="string"?r.description:void 0}))}function _e({fields:e}){return e.length===0?t.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):t.jsx("ul",{className:"space-y-2",children:e.map(n=>t.jsxs("li",{className:"space-y-0.5",children:[t.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[t.jsx("code",{className:"text-xs font-medium text-foreground",children:n.name}),t.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:n.type}),n.required?t.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),n.description?t.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}):null]},n.name))})}function v({item:e,hideHeading:n=!1}){const o=e.schemaSections;return o?t.jsxs("article",{className:n?"space-y-4":"space-y-4 px-5 py-5",children:[!n&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(D,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[t.jsx("h2",{className:"text-base font-medium text-foreground",children:e.title}),o.description?t.jsx("p",{className:"text-xs text-muted-foreground",children:o.description}):null]})]}),o.sections.map(s=>{const r=Pe(s.schema);return t.jsxs("section",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s.title}),s.description?t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.description}):null]}),t.jsx(_e,{fields:r})]},s.title)})]}):null}function $e({panel:e}){const n=z(e.organizationId),o=e.section==="connections"||!!e.connectionId,s=B(e.organizationId,{connectorKey:e.connectorKey,connectionIds:e.connectionId?[e.connectionId]:void 0,enabled:o}),r=n.data?.find(a=>a.key===e.connectorKey),i=s.data?.find(a=>a.id===e.connectionId&&a.connector_key===e.connectorKey);return n.isLoading||o&&s.isLoading?t.jsx("div",{className:"p-5",children:t.jsx(g,{className:"h-28 w-full"})}):n.isError||o&&s.isError?t.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):e.connectionId&&!i||!r&&!i&&e.section!=="connections"?t.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):t.jsx("div",{className:"p-5",children:e.section==="connections"?t.jsx(fe,{connections:s.data??[],connector:r,connectorKey:e.connectorKey,ownerSlug:e.ownerSlug}):i?t.jsx(Te,{connection:i,connector:r,panel:e}):r?e.section==="feeds"?t.jsx(Re,{connector:r}):r.installed===!1?t.jsx(Oe,{connector:r,ownerSlug:e.ownerSlug}):t.jsx(Ee,{connector:r,ownerSlug:e.ownerSlug}):null},`${e.connectorKey}:${e.connectionId??"connector"}:${e.section}`)}function Re({connector:e}){const n=Object.entries(e.feeds_schema??{}).map(([o,s])=>{const r=s;return{id:o,name:r.name??o,description:r.description,feed:r}});return t.jsx(y,{entries:n,label:"feed types",renderDetail:({name:o,feed:s})=>t.jsx(v,{item:{href:"",title:o,schemaSections:F(s)},hideHeading:!0})})}function Oe({connector:e,ownerSlug:n}){const o=Object.entries(e.actions_schema??{}).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,action:i}});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",t.jsx(b,{ownerSlug:n,connectorKey:e.key})]}),t.jsx(y,{entries:o,label:"actions",renderDetail:({name:s,action:r})=>t.jsx(v,{hideHeading:!0,item:{href:"",title:s,schemaSections:S(r)}})})]})}function Te({connection:e,connector:n,panel:o}){const[s,r]=x.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("div",{hidden:s,children:o.section==="feeds"?t.jsx(Le,{connection:e,connector:n,ownerSlug:o.ownerSlug}):t.jsx(M,{connection:e,ownerSlug:o.ownerSlug,inPeek:!0,onReviewPermissions:n?()=>r(!0):void 0})}),s&&n&&t.jsxs("div",{className:"space-y-4",children:[t.jsx(j,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Back to actions"}),t.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),t.jsx(K,{connection:e,connectorDef:n})]})]})}function Le({connection:e,connector:n,ownerSlug:o}){const{data:s=[],isLoading:r,isError:i}=q(e.id),[a,c]=x.useState(!1),l=e.facets?.chat??!1;if(r)return t.jsx(g,{className:"h-28 w-full"});if(i)return t.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const u=s.map(d=>({id:String(d.id),name:d.display_name||d.feed_key,status:xe(d)??(d.operations.includes("sync")?"Sync enabled":"Live access"),feed:d}));return t.jsxs(t.Fragment,{children:[t.jsx("div",{hidden:a,children:t.jsx(y,{entries:u,label:l?"channels":"feeds",action:Object.keys(n?.feeds_schema??{}).length>0?t.jsx(j,{size:"sm",variant:"outline",onClick:()=>c(!0),children:l?"Add channel":"Add feed"}):void 0,renderDetail:({feed:d})=>d.store==="channel_messages"?t.jsx(ue,{feed:d,hideHeader:!0}):t.jsx(pe,{feed:d,connectorDef:n,ownerSlug:o})})}),a&&n&&t.jsxs("div",{className:"space-y-4",children:[t.jsx("h2",{className:"text-base font-semibold",children:l?"Add channel":"Add feed"}),t.jsx(me,{organizationId:e.organization_id,connections:[e],connectorDefinitions:[n],onClose:()=>c(!1)})]})]})}function Ee({connector:e,ownerSlug:n}){const{data:o=[],isLoading:s,isError:r}=H(e.key);if(s)return t.jsx(g,{className:"h-28 w-full"});if(r)return t.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const i=e.actions_schema??{},a=o.map(c=>({id:c.operation_key,name:c.name??c.operation_key,description:c.description,operation:c}));return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",t.jsx(b,{ownerSlug:n,connectorKey:e.key})]}),t.jsx(y,{entries:a,label:"actions",renderControl:()=>t.jsx(b,{ownerSlug:n,connectorKey:e.key}),renderDetail:({operation:c,name:l})=>i[c.operation_key]?t.jsx(v,{hideHeading:!0,item:{href:"",title:l,schemaSections:S(i[c.operation_key])}}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function De({owner:e,path:n}){const{data:o,isLoading:s}=I(e,{slug:e}),r=o?.workspace,i=r?.type==="organization"?r.id:null,a=i?{slug:e}:void 0,{data:c,isLoading:l}=U(`/${e}/${G(n)}`,a),u=c?.entity,d=u?.id;return s||l?t.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[t.jsx(P,{className:"mr-2"})," Loading…"]}):i?d==null?t.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):u?.is_derived?t.jsx(he,{record:{type:u.entity_type,key:u.slug},orgContext:a}):t.jsx("div",{className:"px-4 py-4",children:t.jsx(_,{organizationId:i,ownerSlug:e,entityId:d,filters:{sortBy:"date",sortOrder:"desc"},dense:!0,emptyState:t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):t.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function ze({owner:e,eventId:n,viewKey:o}){const s=C(),r=(i,a)=>t.jsx(ge,{owner:a,organizationId:i,eventId:n,viewKey:o,dense:!0,onSelectView:s?c=>s.retarget(c):void 0},`${a}/${n}/${o??""}`);return t.jsx("div",{className:"px-4 py-4",children:e==="me"?r(null,e):t.jsx(V,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?r(i,a):t.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function w({owner:e,runId:n,runIds:o,contentIds:s}){const{data:r,isLoading:i}=I(e==="me"?null:e,{slug:e}),a=r?.workspace,c=e!=="me"&&a?.type==="organization"?a.id:null,l=x.useMemo(()=>{if(e==="me")return s?.length?{contentIds:s,sortBy:"date",sortOrder:"desc"}:void 0;const d=o??(n!=null?[n]:void 0);if(!(!d?.length&&!s?.length))return{...d?.length?{runIds:d}:{},...s?.length?{contentIds:s}:{}}},[e,s,n,o]),u=l!=null;return e!=="me"&&i?t.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[t.jsx(P,{className:"mr-2"})," Loading…"]}):e!=="me"&&c==null?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):u?t.jsx("div",{className:"px-4 py-4",children:t.jsx(_,{presentation:"detail",organizationId:c,ownerSlug:e,filters:l,dense:!0,emptyState:t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No matching events yet."})})}):t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}function Nt({item:e}){if(e.connectorPanel)return t.jsx($e,{panel:e.connectorPanel});if(e.schemaSections)return t.jsx(v,{item:e});if(typeof e.browserUrl=="string"&&e.browserUrl.length>0)return t.jsx(k,{item:e});const n=e.href?W(e.href):null;return n?n.kind==="memory"?"runId"in n?t.jsx(w,{owner:n.owner,runId:n.runId}):"runIds"in n?t.jsx(w,{owner:n.owner,runIds:n.runIds}):t.jsx(w,{owner:n.owner,contentIds:n.contentIds}):n.kind==="entity"?t.jsx(De,{owner:n.owner,path:n.path}):n.kind==="event"?t.jsx(ze,{owner:n.owner,eventId:n.eventId,viewKey:n.viewKey}):e.runId?t.jsx(Be,{owner:n.owner,automationId:n.automationId,runId:e.runId}):t.jsx(Me,{owner:n.owner,automationId:n.automationId,initialView:n.view??"activity",runId:n.runId}):t.jsx(k,{item:e})}function k({item:e}){const n=e.body,o=e.notificationType??"generic",s=e.createdAt,r=e.browserUrl??null,i=e.browserHandoff??null;return t.jsxs("article",{className:"space-y-4 px-5 py-5",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:Q(o)}),s?t.jsx("span",{children:Y(s)}):null]})]}),n?t.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:t.jsx(X,{text:n,linkPolicy:o==="action_approval_needed"?"app-links":"strip"})}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),e.owner&&e.sourceAttribution?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),t.jsx(Z,{owner:e.owner,source:e.sourceAttribution,className:"text-xs"})]}):null,r?t.jsx("div",{className:"space-y-2",children:i?.state==="expired"?t.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:i.error_message??"This draft expired before the page was opened."}):i?.state==="completed"||i?.state==="preparing"?t.jsx("p",{className:"text-sm text-muted-foreground",children:i.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):t.jsxs(j,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{te(r)},children:[t.jsx(ee,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function Be({owner:e,automationId:n,runId:o}){const{organizationId:s}=re(e),r=ne(n,void 0,s),i=r.data?.automation?.managed_agent_id??null;return i?t.jsx(Ie,{agentId:i,automationId:n,ownerSlug:e,runId:o}):r.isLoading?t.jsx(g,{className:"h-24 w-full rounded-lg"}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"This run has no agent transcript."})}function Me({owner:e,automationId:n,initialView:o,runId:s}){const[r,i]=x.useState(o),a=r==="definition";return t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"flex justify-end",children:t.jsx(j,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(a?"activity":"definition"),children:a?"Done":t.jsxs(t.Fragment,{children:[t.jsx(se,{className:"h-3.5 w-3.5"}),"Edit"]})})}),t.jsx(oe,{owner:e,agentId:null,automationId:n,view:r,runId:s,onDone:()=>i("activity")})]})}export{Nt as PeekPaneContent};
2
- //# sourceMappingURL=peek-pane-content-B2AFNTzP.js.map
@@ -1,2 +0,0 @@
1
- import{gI as f,g5 as w,g6 as y,r as N,j as e,b7 as k,B as d,y as C,f3 as P}from"./index-_oPeVpL_.js";import{a as A}from"./runs-BWtc5rmc.js";function B({resource:p,runId:t,children:h,onDone:l}){const c=!!t,{data:a,isLoading:E,isError:u,refetch:v}=A(p,c?t:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[g,x]=N.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{t&&n.mutate({run_id:t},{onSuccess:()=>l?.()})},R=()=>{if(!t)return;const r=g.trim();i.mutate({run_id:t,...r?{reason:r}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. The values below show the proposed change — ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(P,{id:"review-reject-reason",rows:2,value:g,onChange:r=>x(r.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{B as P};
2
- //# sourceMappingURL=proposal-review-shell-DKKGu4Ww.js.map
@@ -1,2 +0,0 @@
1
- import{r as e,d2 as l}from"./index-_oPeVpL_.js";function a(){return e.useEffect(()=>{l()},[]),null}export{a as P};
2
- //# sourceMappingURL=public-shell-ready-7KYnww6e.js.map
@@ -1,2 +0,0 @@
1
- import{at as sn,j as n,r as k,m as V,n as se,cb as on,cc as vt,cd as yt,L as je,ce as an,cf as cn,k as rn,cg as gt,ch as ln,bY as dn,ci as un,ai as mn,cj as xt,ck as A,bl as fn,cl as pn,cm as hn,bm as vn,cn as yn,co as ne,c9 as gn,cp as bt,cq as xn,an as bn,cr as jn,aZ as kn,ba as Sn,aq as xe,cs as Nn,ct as Cn,t as jt,cu as kt,cv as _n,cw as In,cx as En,cy as St,cz as An,c6 as Fn,cA as Tn,be as wn,aV as Rn,S as Nt,cB as Pn,I as Ln,P as Oe,X as On,B as $e,cC as $n,bn as Mn,bo as Dn,bp as Kn,bq as Bn,br as Vn,cD as Gn,cE as Qn,bz as Un,cF as Wn,cG as zn,cH as qn,ae as Ct,g as Yn,cI as Zn,cJ as we,cK as ct,cL as Hn,cM as Xn,cN as Jn,cO as es,cP as ts,cQ as ns,cR as ss,cS as os,cT as as,cU as is,cV as cs,bK as rs,cW as ls,cX as ds,aQ as rt,cY as lt,cZ as _t,c_ as Re,c$ as It,d0 as us,d1 as Pe}from"./index-_oPeVpL_.js";import{S as $,F as ms,d as fs,o as ge,r as ps,f as hs,a as vs}from"./filter-editors-DCQgGLyR.js";import{c as dt}from"./connection-label-BobuYiAG.js";import{u as ys}from"./runs-BWtc5rmc.js";import{S as gs}from"./source-record-panels-CRIPMWfN.js";import{u as xs}from"./clients-CpG676mg.js";import{g as bs}from"./client-rows-EJSKR6z1.js";import{E as js}from"./events-feed-fucGZSJR.js";import{L as ks,u as Ss}from"./renderer-BL6VcwQH.js";import{E as Ns}from"./agent-loading-shells-CtZJM2Gc.js";import{M as Cs}from"./member-scope-gate-CFbrq1by.js";const Me=k.createContext(null);function _s({organizationId:e,isWorkspaceLoading:t,children:o}){const{data:s=[],isLoading:i}=sn(e);return n.jsx(Me.Provider,{value:{groups:s,isLoading:!!t||i},children:o})}function Is(){const e=k.useContext(Me);if(!e)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return e}function Es(){return k.useContext(Me)}function Et(e){const{parse:t,serialize:o,filterKeys:s,clearClassifications:i=!0,replace:l=!0,merge:y}=e,m=V(),d=se(),r=k.useMemo(()=>{const f=new URLSearchParams;for(const[u,g]of Object.entries(d.search||{}))g!=null&&f.set(u,typeof g=="object"&&!Array.isArray(g)?JSON.stringify(g):String(g));return t(f)},[d.search,t]),a=k.useCallback((f,u)=>{const g=y?y(r,f):{...r,...f},x=o(g),_={};for(const[j,b]of Object.entries(d.search||{}))b!=null&&(_[j]=b);for(const j of s)delete _[j];if(i)for(const j of Object.keys(_))j.startsWith("clf_")&&delete _[j];for(const[j,b]of Object.entries(x))b!==void 0&&(_[j]=b);m({to:d.pathname,search:_,replace:u?.replace??l})},[r,o,s,i,y,m,d,l]),c=k.useCallback(()=>{const f={};for(const[u,g]of Object.entries(d.search||{}))g!=null&&(s.includes(u)||i&&u.startsWith("clf_")||(f[u]=g));m({to:d.pathname,search:f,replace:l})},[m,d.pathname,d.search,s,i,l]);return{filters:r,updateFilters:a,clearFilters:c}}function As(e){const{slug:t}=on();return vt({queryKey:["schedules",t,e],queryFn:async()=>((await yt("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===e),enabled:!!t&&!!e,staleTime:3e4})}function Fs(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.connection_id)},search:{feedId:t.id}}}function Ts(e,t){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:t.connector_key,connectionId:String(t.id)}}}function ws(e,t){return{to:"/$owner/agents/connected/$clientId",params:{owner:e,clientId:t}}}function Rs(e,t){return{to:"/$owner/automations/$automationId",params:{owner:e,automationId:t}}}function Ps(e,t,o){return{to:"/$owner/events",params:{owner:e},search:{agent:t,schedule:o}}}function fe({id:e,label:t,value:o,sourceLink:s,details:i,onRemove:l}){return{id:e,label:t,op:"is",value:o,onRemove:l,editor:s||i?{kind:"custom",className:"w-80",render:()=>n.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[s?n.jsxs(je,{to:s.to,params:s.params,search:s.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[n.jsx("span",{className:"truncate",children:o}),n.jsx(an,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):n.jsx("span",{className:"font-medium",children:o}),i]})}:void 0}}function Ls({ownerSlug:e,clientIds:t,linkedUser:o,linkedUserEntitySlug:s}){const i=e&&s?cn(e,[{entity_type:"$member",slug:s}]):null;return n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[n.jsx("span",{children:t.length===1?"Client ID":"Client IDs"}),t.map(l=>n.jsx("code",{className:"break-all text-foreground",children:l},l))]}),o?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",i?n.jsx(je,{to:i,className:"font-medium text-foreground hover:underline",children:o}):n.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function H(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function pe(e,t,o){const s=new Set;for(const[i,l]of Object.entries(e.feeds_schema??{})){if(o&&!o.has(i))continue;const y=H(H(l)?.eventKinds);if(y)for(const[m,d]of Object.entries(y)){if(!t){s.add(m);continue}const r=H(d)?.attributions;Array.isArray(r)&&r.some(a=>{const c=H(H(a)?.target);return typeof c?.entityType=="string"&&t.has(c.entityType)})&&s.add(m)}}return s}function Os({connectors:e,entityTypes:t,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:i=[]}){const l=new Set,y=new Set(o),m=new Set(i),d=new Map;for(const r of s){const a=d.get(r.connectorKey)??new Set;a.add(r.feedKey),d.set(r.connectorKey,a)}if(d.size>0)for(const r of e){const a=d.get(r.key);if(a)for(const c of pe(r,void 0,a))l.add(c)}else if(y.size>0){for(const r of e)if(y.has(r.key))for(const a of pe(r))l.add(a)}else if(m.size>0){for(const r of t)if(m.has(r.slug))for(const a of Object.keys(r.event_kinds??{}))l.add(a);for(const r of e)for(const a of pe(r,m))l.add(a)}else{for(const r of t)for(const a of Object.keys(r.event_kinds??{}))l.add(a);for(const r of e)for(const a of pe(r))l.add(a)}return[...l].sort((r,a)=>r.localeCompare(a))}function $s(e){const{orgContext:t}=rn(),{data:o=[],isLoading:s}=gt(t);return{visible:k.useMemo(()=>o.filter(l=>!ln(l)&&(!l.organization_slug||l.organization_slug===e)),[o,e]),isTypesLoading:s}}function te({to:e,params:t,search:o,label:s}){return n.jsx(je,{to:e,params:t,search:o,onClick:i=>i.stopPropagation(),onPointerDown:i=>i.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${s}`,children:n.jsx(dn,{className:"h-3.5 w-3.5"})})}const Le=["produced","analyzed"],be=e=>e==="produced"?"Produced by":"Analyzed by";function Ms({enabled:e,...t}){const o=Ds(t,e);if(!e)return{fields:[],chips:[]};const s=Ks(t);return{fields:[o.field,s.field],chips:[...o.chips,...s.chips]}}function Ds({ownerSlug:e,filters:t,onFiltersChange:o},s){const i=vt({queryKey:["automations-list","activity",e],queryFn:async()=>{const a=await Promise.all(["active","archived"].map(c=>yt("manage_automations",{action:"list",status:c,include_details:!1},{slug:e})));return[...new Map(a.flatMap(c=>c.automations).map(c=>[Number(c.automation_id),c])).values()].sort((c,f)=>c.name.localeCompare(f.name))},enabled:s&&!!e,staleTime:3e4}),l=i.data??[],y=a=>a==="produced"?t.producedByAutomationId:t.automationId,m=a=>l.find(c=>Number(c.automation_id)===a)?.name??`#${a}`,d=Le.flatMap(a=>{const c=y(a);return c==null?[]:[{id:`automation-${a}`,field:"automation",label:be(a),value:m(c),onRemove:()=>o(a==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),r={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:i.isLoading?"Loading Automations...":"No Automations found",items:a=>n.jsxs(n.Fragment,{children:[Le.map(c=>{const f=y(c),u=l.map(x=>({id:Number(x.automation_id),label:`${x.name}${x.status==="archived"?" (archived)":""}`}));f!=null&&!u.some(x=>x.id===f)&&u.unshift({id:f,label:`Automation #${f} (selected)`});const g=x=>{o(c==="produced"?{producedByAutomationId:x}:{automationId:x}),a()};return n.jsx(xt,{heading:be(c),children:u.map(x=>n.jsxs(A,{"aria-label":x.label,value:`${c} ${x.label} ${x.id}`,onSelect:()=>g(x.id),className:"group",children:[n.jsx($,{selected:f===x.id}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.label}),n.jsx(te,{...Rs(e,String(x.id)),label:x.label})]},x.id))},c)}),i.isError?n.jsx(A,{forceMount:!0,onSelect:()=>void i.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:d,field:{key:"automation",label:"Automation",group:"Scope",icon:n.jsx(un,{className:"h-4 w-4"}),editor:r}}}function Ks(e){const{filters:t,onFiltersChange:o}=e,s=[];t.runIds?.length&&s.push({id:"run-produced",field:"run",label:"Produced by run",value:t.runIds.map(l=>`#${l}`).join(", "),onRemove:()=>o({runIds:null})}),t.runId!=null&&s.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${t.runId}`,onRemove:()=>o({runId:null})});const i={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(l,y)=>Le.map(m=>n.jsx(Bs,{...e,mode:m,query:y,close:l},m))};return{chips:s,field:{key:"run",label:"Run",group:"Scope",icon:n.jsx(mn,{className:"h-4 w-4"}),editor:i}}}function Bs({ownerSlug:e,filters:t,onFiltersChange:o,mode:s,query:i,close:l}){const y=s==="produced"?t.producedByAutomationId:t.automationId,m=ys({workspace:!0},{automationIds:y==null?void 0:[y],runTypes:s==="analyzed"?["automation"]:void 0,connectionIds:s==="produced"?t.connectionIds??void 0:void 0,feedIds:s==="produced"?t.feedIds??void 0:void 0},e),d=s==="produced"?t.runIds??[]:t.runId==null?[]:[t.runId],r=m.data?.pages.flatMap(u=>u.runs)??[],a=[...new Map(r.map(u=>[u.id,{id:u.id,label:`Run #${u.id} · ${u.feed_display_name??u.operation_key??u.run_type} · ${u.status}`}])).values()];for(const u of d)a.some(g=>g.id===u)||a.unshift({id:u,label:`Run #${u} (selected)`});const c=u=>{if(s==="produced"){const g=d.includes(u)?d.filter(x=>x!==u):[...d,u];o({runIds:g.length?g:null})}else o({runId:u}),l()},f=/^\d+$/.test(i.trim())?Number(i.trim()):0;return n.jsxs(xt,{heading:be(s),children:[a.map(u=>n.jsxs(A,{value:`${s} ${u.label}`,onSelect:()=>c(u.id),children:[n.jsx($,{selected:d.includes(u.id)}),n.jsx("span",{className:"truncate",children:u.label})]},u.id)),Number.isSafeInteger(f)&&f>0&&!a.some(u=>u.id===f)?n.jsxs(A,{value:`${s} ${f}`,onSelect:()=>c(f),children:[be(s)," run #",f]}):null,m.isLoading?n.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,m.isError?n.jsx(A,{forceMount:!0,onSelect:()=>void(m.isFetchNextPageError?m.fetchNextPage():m.refetch()),children:"Could not load runs. Retry"}):null,!m.isLoading&&!m.isError&&!a.length?n.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,m.hasNextPage?n.jsx(A,{forceMount:!0,disabled:m.isFetching,onSelect:()=>void m.fetchNextPage(),children:m.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const De="Scope",Te="Source",G="h-4 w-4";function oe(){return se().search??{}}function At(e){const{pathname:t}=se(),{_splat:o}=vn({strict:!1}),s=!!(o&&!yn(o.split("/")[0])&&!t.startsWith(`/${e}/events/`));return{pathname:t,embedded:s,recordPath:s||t.startsWith(`/${e}/events/`)?o:void 0}}function Ft(e){const t=oe(),{recordPath:o,pathname:s,embedded:i}=At(e);return l=>{const y=ne(e,t,l,o);return i?{to:s,search:y.search}:y}}const ut=e=>new Set((e??"").split(",").map(t=>t.trim()).filter(Boolean));function Vs({ownerSlug:e,sourceRead:t=!1,filters:o,onFiltersChange:s}){const i=oe(),{recordPath:l,embedded:y}=At(e),m=l?l.split("/").at(-2):void 0,d=typeof i.type=="string"&&i.type.trim()?i.type.trim():void 0,r=m??(d?fn(d):void 0),a=pn(i),c=hn(i),f=typeof i.feed_ids=="string"?i.feed_ids:typeof i.feed_ids=="number"?String(i.feed_ids):void 0,u=Gs(e,r,!y),g=Qs(e,r,l,y),x=Us(e,a,!t),_=Ms({ownerSlug:e,filters:o,onFiltersChange:s,enabled:!t}),j=Ws(e,c,f);return[u,g,x,_,j].reduce((b,I)=>({fields:[...b.fields,...I.fields],chips:[...b.chips,...I.chips]}),{fields:[],chips:[]})}function Gs(e,t,o){const s=V(),i=oe(),{visible:l}=$s(e);if(!o)return{fields:[],chips:[]};const y=l.find(d=>d.slug===t),m={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>n.jsxs(n.Fragment,{children:[l.map(r=>n.jsxs(A,{onSelect:()=>{s(ne(e,i,{entity:void 0,create:void 0,type:r.slug})),d()},className:"group gap-2",children:[n.jsx($,{selected:r.slug===t}),n.jsx(En,{icon:r.icon,className:"h-4 w-4 shrink-0"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),typeof r.entity_count=="number"?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.entity_count}):null,n.jsx(te,{to:"/$owner/entity-types/$slug",params:{owner:e,slug:r.slug},label:r.name})]},r.id)),n.jsxs(A,{onSelect:()=>{s(An(e)),d()},className:"text-muted-foreground",children:[n.jsx(St,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:De,icon:n.jsx(gn,{className:G}),editor:m}],chips:t?[{id:"type",label:"Entity type",op:"is",value:y?.name??t,onRemove:()=>void s(ne(e,i,{type:void 0}))}]:[]}}function Qs(e,t,o,s){const i=V(),l=oe(),[y,m]=k.useState(""),[d,r]=k.useState(0),a=bt(y,250),c={slug:e},{data:f,isLoading:u,isError:g,refetch:x}=xn(t??"",c,{search:a,offset:d,limit:30,enabled:!s&&!!t}),{data:_}=bn(o?`/${e}/${o}`:"",c),j=o?_?.entity:void 0,b=j?.name??(o?o.split("/").at(-1):void 0);if(s)return{fields:[],chips:b?[{id:"entity",label:"Entity",op:"is",value:b}]:[]};if(!t)return{fields:[],chips:[]};const I={kind:"list",searchPlaceholder:"Search entities...",emptyText:u?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:T=>{m(T),r(0)},items:T=>n.jsxs(n.Fragment,{children:[g?n.jsx(A,{onSelect:()=>void x(),children:"Could not load entities. Retry"}):f?.entities.map(E=>n.jsxs(A,{value:E.slug,onSelect:()=>{const R=Fn(Tn([...E.parent_slug&&E.parent_entity_type?[{entity_type:E.parent_entity_type,slug:E.parent_slug}]:[],{entity_type:E.entity_type,slug:E.slug}]));i(ne(e,l,{type:t},R)),T()},children:[n.jsx($,{selected:j?.slug===E.slug}),E.name]},E.slug)),d>0&&n.jsx(A,{onSelect:()=>r(Math.max(0,d-30)),children:"Previous entities"}),f?.metadata.has_more&&n.jsx(A,{disabled:u,onSelect:()=>r(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:De,icon:n.jsx(jn,{className:G}),editor:I}],chips:b?[{id:"entity",label:"Entity",op:"is",value:b,onRemove:()=>void i(ne(e,l,{type:t}))}]:[]}}function Us(e,t,o){const s=V(),i=Ft(e),{data:l=[]}=kn(),y=k.useMemo(()=>[...l].sort((r,a)=>r.name.localeCompare(a.name)),[l]);if(!o)return{fields:[],chips:[]};const m=y.find(r=>r.agentId===t),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:r=>y.map(a=>n.jsxs(A,{onSelect:()=>{s(i({agent:a.agentId,schedule:void 0})),r()},className:"gap-2",children:[n.jsx($,{selected:a.agentId===t}),n.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:a.name.trim().charAt(0).toUpperCase()||"?"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.name})]},a.agentId))};return{fields:[{key:"agent",label:"Agent",group:De,icon:n.jsx(Sn,{className:G}),editor:d}],chips:t?[{id:"agent",label:"Agent",op:"is",value:m?.name??t,onRemove:()=>void s(i({agent:void 0,schedule:void 0}))}]:[]}}function Ws(e,t,o){const s=V(),i=Ft(e),{groups:l}=Is(),y=oe(),m=xe({platforms:String(y.platforms??y.platform??"")}).platforms??[],d=k.useMemo(()=>ut(t),[t]),r=k.useMemo(()=>ut(o),[o]),a=m.length===1?m[0]:Nn(l,d),c=l.find(S=>S.connector_key===a),f=d.size===1?Number([...d][0]):void 0,u=Cn(f),{org:g}=jt(),x=kt(g?.id,{feedIds:[...r].map(Number),enabled:f==null&&r.size>0}),_=f==null?x:u,j=_.data??[],b={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},I={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:S=>n.jsxs(n.Fragment,{children:[l.map(p=>{const C=p.connector_name??p.connector_key;return n.jsxs(A,{disabled:p.connections.length===0,onSelect:()=>{s(i({...b,platforms:p.connector_key})),S()},className:"group gap-2",children:[n.jsx($,{selected:p.connector_key===c?.connector_key}),n.jsx(Rn,{plain:!0,name:C,faviconDomain:p.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:C}),p.connection_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:p.connection_count}):null,n.jsx(te,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:p.connector_key},label:C})]},p.connector_key)}),n.jsx(A,{asChild:!0,onSelect:S,className:"text-muted-foreground",children:n.jsxs(je,{to:"/$owner/connectors/create",params:{owner:e},className:"flex items-center gap-2",children:[n.jsx(St,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},T=[{key:"connector",label:"Connector",group:Te,icon:n.jsx(wn,{className:G}),editor:I}],E=[],R=c?.connector_name??c?.connector_key??(m.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(R&&E.push({id:"connector",label:"Connector",op:"is",value:R,onRemove:()=>void s(i(b))}),c){T.push({key:"connection",label:"Connection",group:Te,icon:n.jsx(_n,{className:G}),editor:M(c)});const S=d.size===1?c.connections.find(p=>d.has(String(p.id))):void 0;S&&E.push({id:"connection",label:"Connection",op:"is",value:dt({display_name:S.display_name,connector_name:c.connector_name,connector_key:c.connector_key}),onRemove:()=>void s(i({...b,platforms:c.connector_key}))})}if((f||o)&&T.push({key:"feed",label:"Feed",group:Te,icon:n.jsx(In,{className:G}),editor:D()}),r.size>0){const S=r.size===1?j.find(p=>r.has(String(p.id))):void 0;E.push({id:"feed",label:"Feed",op:"is",value:S?he(S):`#${o}`,onRemove:()=>void s(i({...f!=null?{connection_ids:String(f)}:{},feed_ids:void 0}))})}return{fields:T,chips:E};function M(S){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:p=>S.connections.map(C=>{const Q=dt({display_name:C.display_name,connector_name:S.connector_name,connector_key:S.connector_key});return n.jsxs(A,{onSelect:()=>{s(i({connection_ids:String(C.id),feed_ids:void 0})),p()},className:"group gap-2",children:[n.jsx($,{selected:d.has(String(C.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:Q}),C.feed_count>0?n.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:C.feed_count}):null,n.jsx(te,{...Ts(e,{id:C.id,connector_key:S.connector_key}),label:Q})]},C.id)})}}function D(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:_.isLoading?"Loading feeds...":"No feeds",items:S=>j.map(p=>n.jsxs(A,{"aria-label":he(p),onSelect:()=>{s(i({...f!=null?{connection_ids:String(f)}:{},feed_ids:String(p.id)})),S()},className:"group gap-2",children:[n.jsx($,{selected:r.has(String(p.id))}),n.jsx("span",{className:"min-w-0 flex-1 truncate",children:he(p)}),n.jsx(te,{...Fs(e,p),label:he(p)})]},p.id))}}}function he(e){return e.display_name?.trim()||e.feed_key}const zs=["notification"],qs=["note","summary","decision","observation","fact","change","preference","identity"],Ys=[...zs,...qs],mt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],ft=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],pt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],ve=0,ye=100,X="Event",J="h-4 w-4";function ee(e){const t=e.replace(/[_-]+/g," ").trim();return t.length>0?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e}function Zs(e,t,o){const s=e.semanticTypes??[],i=o.length>0?o:Ys,l=[...new Set([...i,...s])].sort((c,f)=>ee(c).localeCompare(ee(f))).map(c=>({value:c,label:ee(c)})),y=e.engagementRange??[ve,ye],m=e.reviewStatus,d=e.interactionStatus,r=[{key:"date",label:"Date",group:X,icon:n.jsx(Gn,{className:J}),editor:fs({value:e.dateRange??void 0,onApply:c=>t({dateRange:c})})},{key:"kind",label:"Event kind",group:X,icon:n.jsx(Qn,{className:J}),editor:ge({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:l,selected:s,multiple:!0,onSelect:c=>{const f=s.includes(c)?s.filter(u=>u!==c):[...s,c];t({semanticTypes:f.length>0?f:void 0})}})},{key:"approval",label:"Approval",group:X,icon:n.jsx(Un,{className:J}),editor:ge({searchPlaceholder:"Search statuses...",options:[...pt],selected:d?[d]:[],onSelect:c=>t({interactionStatus:c})})},{key:"review",label:"Reviewed by",group:X,icon:n.jsx(Wn,{className:J}),editor:ge({searchPlaceholder:"Search reviewers...",options:[...ft],selected:m&&m!=="all"?[m]:[],onSelect:c=>t({reviewStatus:c})})},{key:"score",label:"Engagement score",group:X,icon:n.jsx(zn,{className:J}),editor:ps({value:y,min:ve,max:ye,onApply:c=>t({engagementRange:c})})}],a=[];return e.dateRange&&a.push({id:"date",label:"Date",op:"is",value:hs(e.dateRange),onRemove:()=>t({dateRange:null})}),s.length&&a.push({id:"kind",label:"Event kind",op:s.length>1?"is any of":"is",value:s.length<=2?s.map(ee).join(", "):`${s.length} kinds`,title:s.map(ee).join(", "),onRemove:()=>t({semanticTypes:void 0})}),d&&a.push({id:"approval",label:"Approval",op:"is",value:pt.find(c=>c.value===d)?.label??d,onRemove:()=>t({interactionStatus:null})}),m&&m!=="all"&&a.push({id:"review",label:"Reviewed by",op:"is",value:ft.find(c=>c.value===m)?.label??m,onRemove:()=>t({reviewStatus:void 0})}),(y[0]!==ve||y[1]!==ye)&&a.push({id:"score",label:"Engagement score",value:vs(y,ve,ye),onRemove:()=>t({engagementRange:void 0})}),{fields:r,chips:a}}function Tt({filters:e,onFiltersChange:t,eventKinds:o=[],searchQuery:s,onSearchChange:i,scope:l,extraFields:y=[],drillChips:m=[],total:d,isListLoading:r=!1,isTotalLoading:a=!1,hasCursorInUrl:c=!1,onGoToLatest:f,leading:u,sourceRead:g=!1,filterTrailing:x,onClearFilters:_}){const j=s.trim().length>0,b=g?{fields:[],chips:[]}:Zs(e,t,o),I=[...l?.fields??[],...b.fields,...y],T=[...l?.chips??[],...m,...b.chips],E=T.length>0||j,R=`${e.sortBy??"date"}-${e.sortOrder??"desc"}`,M=mt.find(S=>S.value===R)?.label??"Newest first",D=r||a?n.jsx(Nt,{className:"h-4 w-20"}):d==null?null:E?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return n.jsxs("div",{className:"w-full space-y-2.5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[u,!g&&n.jsxs("div",{className:"relative w-full min-w-48 flex-1 sm:max-w-xs",children:[n.jsx(Pn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),n.jsx(Ln,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:s,onChange:S=>i(S.target.value),className:Oe("pl-9",j&&"pr-8")}),j&&n.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>i(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:n.jsx(On,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[!r&&c&&f&&n.jsxs($e,{variant:"ghost",size:"sm",className:"h-8 gap-1",onClick:f,children:[n.jsx($n,{className:"h-3.5 w-3.5"}),"Back to latest"]}),!g&&n.jsxs(Mn,{value:R,onValueChange:S=>{const[p,C]=S.split("-");t({sortBy:p,sortOrder:C})},children:[n.jsx(Dn,{"aria-label":"Sort",className:"h-9 w-[168px] px-2.5",children:n.jsx(Kn,{children:n.jsxs("span",{className:"truncate",children:[n.jsx("span",{className:"text-muted-foreground",children:"Sort: "}),M]})})}),n.jsx(Bn,{children:mt.map(S=>n.jsx(Vn,{value:S.value,children:S.label},S.value))})]})]})]}),n.jsx(ms,{label:"Event filters",fields:I,chips:T,meta:D,trailing:x,onClearAll:_,hasClearableState:j})]})}function wt({ownerSlug:e,...t}){const o=Vs({ownerSlug:e,sourceRead:t.sourceRead,filters:t.filters,onFiltersChange:t.onFiltersChange});return n.jsx(Tt,{...t,scope:o})}function Hs(e){const t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t}function ht(e){return e.toISOString().split("T")[0]}function Xs({entityId:e,organizationId:t,ownerSlug:o,selectedRange:s,onSelectRange:i}){const{data:l,isLoading:y,error:m}=qn(t,{entityId:e},{slug:o}),d=k.useMemo(()=>{if(!l||l.length===0)return[];const f=l.map(j=>{const b=Hs(j.date);return b?{date:b,count:j.count}:null}).filter(j=>j!==null).sort((j,b)=>j.date.getTime()-b.date.getTime());if(f.length===0)return[];const u=f[0].date;if((f[f.length-1].date.getTime()-u.getTime())/(1e3*60*60*24)>180){const j=new Map;for(const b of f){const I=new Date(b.date);I.setDate(b.date.getDate()-b.date.getDay());const T=ht(I);j.set(T,(j.get(T)||0)+b.count)}return Array.from(j.entries()).map(([b,I])=>({date:b,count:I})).sort((b,I)=>new Date(b.date).getTime()-new Date(I.date).getTime())}return f.map(j=>({date:ht(j.date),count:j.count}))},[l]),r=k.useCallback(f=>{if(f.name&&i){const u=new Date(f.name),g=new Date(u);g.setDate(g.getDate()+1),i(u,g)}},[i]),a=k.useCallback(f=>{if(i&&f.startValue!==void 0&&f.endValue!==void 0){const u=new Date(f.startValue),g=new Date(f.endValue);i(u,g)}},[i]),c=k.useMemo(()=>{if(d.length===0)return null;let f;if(s){const u=s[0].toISOString().split("T")[0],g=s[1].toISOString().split("T")[0];f=[[{xAxis:u},{xAxis:g}]]}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:u=>{const g=u[0];return`${new Date(g.name).toLocaleDateString()}: ${g.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:d.map(u=>u.date),axisLabel:{formatter:u=>{const g=new Date(u);return`${g.getMonth()+1}/${g.getDate()}`}}},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new ks(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:d.map(u=>u.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:f?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:f}:void 0}]}},[d,s]);return y||m?n.jsx("div",{className:Oe(Ct,"p-4"),children:n.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:y?n.jsx(Ns,{}):n.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})}):!c||d.length<2?null:n.jsx(Js,{option:c,onClick:r,onDataZoom:a})}function Js({option:e,onClick:t,onDataZoom:o}){const{chartRef:s,setOption:i}=Ss({onClick:t,onDataZoom:o});return k.useEffect(()=>{i(e,!0)},[e,i]),n.jsx("div",{"data-testid":"events-timeline",className:Oe(Ct,"p-4 relative"),children:n.jsx("div",{ref:s,className:"h-48 w-full"})})}function eo({organizationId:e,ownerSlug:t,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:i,filterBarLeading:l}){const{isAuthenticated:y,isReady:m}=Yn(),{isMember:d,isLoading:r}=jt(),a=m&&y&&d,c=m&&(!y||!r&&!d),f=V(),u=se(),g=Zn(),{filters:x,updateFilters:_,clearFilters:j}=Et({parse:xe,serialize:Re,filterKeys:It,replace:!1,merge:_t}),[b,I]=k.useState(x.searchQuery||""),[T,E]=k.useState(we(x)||s&&(o!=null||!!i?.length)),R=b.trim(),M=R.length>=3?R:void 0,D=bt(M,1e3),S=k.useRef(!1);k.useEffect(()=>g.history.subscribe(({location:h,action:v})=>{const N=xe(new URLSearchParams(h.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&S.current&&(N===(x.searchQuery??"")||N===(M??""))||(S.current=!1,I(N))}),[g.history,M,x.searchQuery]);const p=k.useMemo(()=>ct({...x,...i?.length?{entityTypes:i}:{}}),[x,i]),C=_;k.useEffect(()=>{S.current&&(x.searchQuery||void 0)!==D&&_({searchQuery:D})},[D,_,x.searchQuery]);const Q=()=>{S.current=!1,I(""),s&&t?f({...Pe(t,u.search??{}),...o!==void 0&&!u.pathname.startsWith(`/${t}/events/`)?{to:u.pathname}:{}}):j()},ke=we(ct(x)),Ke=o===void 0,{data:Rt=[]}=Hn(m&&a?e:null),{data:Pt=[]}=Xn(c?t:null),Be=a?Rt:Pt,{data:Ve=[]}=gt(a&&e?{organizationId:e}:void 0),ae=Es(),ie=p.connectionIds,Se=(ie?.length??0)>0,{data:Ge=[]}=Jn(m&&a?e??"":"",{connectionIds:ie??void 0,enabled:!ae&&m&&a&&Se}),Qe=p.feedIds,Ne=(Qe?.length??0)>0,{data:Ue=[]}=kt(m&&a?e:null,{feedIds:Qe??void 0,enabled:m&&a&&Ne}),We=k.useMemo(()=>ae?ae.groups.flatMap(h=>h.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:h.connector_name,connector_key:h.connector_key}))):Ge,[Ge,ae]),Ce=k.useMemo(()=>{const h=new Set(ie??[]);return[...new Set([...p.platforms??[],...We.filter(v=>h.has(v.id)).map(v=>v.connector_key)])]},[ie,We,p.platforms]),_e=k.useMemo(()=>Ue.map(h=>({connectorKey:h.connector_key,feedKey:h.feed_key})),[Ue]),Lt=k.useMemo(()=>Se&&Ce.length===0||Ne&&_e.length===0?[]:Os({connectors:Be,entityTypes:Ve,selectedPlatforms:Ce,selectedFeeds:_e,selectedEntityTypes:p.entityTypes}),[Be,p.entityTypes,Se,Ne,Ce,_e,Ve]),w=p.clientIds,ce=(w?.length??0)>0,{data:ze=[]}=xs(null,{enabled:m&&a&&ce}),re=k.useMemo(()=>{if(!w)return[];const h=new Set(w);return bs(ze).filter(v=>v.clientIds.some(N=>h.has(N)))},[w,ze]),qe=k.useMemo(()=>{if(!ce||!w)return null;const h=re.map(v=>v.title);return h.length>0?h.join(", "):w.length>1?`${w.length} client registrations`:"Client registration"},[re,w,ce]),le=re.length===1?re[0]:null,Ot=t&&le?ws(t,le.clientId):void 0,de=p.mcpActivityId??null,{data:Ye=[]}=es({enabled:m&&a&&ce&&!!de,clientIds:w??[],limit:100}),Ze=k.useMemo(()=>{if(!de)return null;const h=Ye.find(N=>N.activityId===de);if(!h)return"Selected conversation";const v=h.title?.trim();return v||(h.activityKind==="session"?"MCP session":h.clientId)},[de,Ye]),U=p.agentId,W=p.schedule,{data:He=[]}=As(U??void 0),Xe=k.useMemo(()=>!W||!U?null:He.find(v=>v.id===W)?.description?.trim()||"Scheduled task",[U,W,He]),{data:$t}=ts(m&&a?e:null,o),{data:Mt}=ns(c&&!Ke?t:null,o),Je=a?$t:Mt,Ie=k.useMemo(()=>{const h=new Map;for(const v of Je||[]){const N=v.automation_name??"__global__";h.has(N)||h.set(N,{automationName:v.automation_name??null,classifiers:[]});const F=h.get(N),L=v.attribute_values||{},P=Object.keys(L);let me=null;const q={};for(const[Y,B]of Object.entries(L))if(B.parent)for(const[Fe,Z]of Object.entries(B.parent))me=Fe,q[Z]||(q[Z]=[]),q[Z].push(Y);const O=F.classifiers.find(Y=>Y.slug===v.slug);if(O){const Y=new Set([...O.values,...P]);O.values=[...Y];for(const[B,Fe]of Object.entries(q)){O.valuesByParentValue[B]||(O.valuesByParentValue[B]=[]);const Z=new Set([...O.valuesByParentValue[B],...Fe]);O.valuesByParentValue[B]=[...Z]}me&&(O.parentSlug=me)}else F.classifiers.push({slug:v.slug,name:v.name,values:P,parentSlug:me,valuesByParentValue:q})}for(const v of h.values())v.classifiers.sort((N,F)=>N.parentSlug===null&&F.parentSlug!==null?-1:N.parentSlug!==null&&F.parentSlug===null?1:0);return[...h.values()]},[Je]),Dt=ss(m&&a?e:null,o,p,t),Kt=os(c?t:null,o,p),Bt=c?Kt:Dt,{data:z,isLoading:Vt,error:Gt}=Bt,et=z?.pages[0],tt=(et?.content.length??0)>0,Qt=as(m&&a?e:null,o,p,t),Ut=is(c?t:null,o,p),Ee=c?Ut:Qt,Wt=Ee.data?.total??void 0,zt=Ee.data?.classification_stats,qt=Ee.isLoading,Yt=!!(p.beforeOccurredAt||p.afterOccurredAt),nt=cs(p),st=z?.pages[z.pages.length-1],K=st?.content[st.content.length-1];k.useEffect(()=>{!nt||!K||z?.pages.length===1||x.beforeOccurredAt===K.occurred_at&&x.beforeId===K.id||_({beforeOccurredAt:K.occurred_at,beforeId:K.id},{replace:!0})},[K?.id,nt,_,z?.pages.length,K,x.beforeOccurredAt,x.beforeId]);const Zt=k.useCallback(()=>{C({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[C]),Ht=(h,v)=>{C({dateRange:[h,v]})},ot=(h,v)=>{const N={...p.classificationFilters||{}};if(v.length>0)N[h]=v;else{delete N[h];for(const F of Ie)for(const L of F.classifiers)L.parentSlug===h&&delete N[L.slug]}C({classificationFilters:N})},Xt=(h,v)=>{const N=p.classificationFilters?.[h]||[];ot(h,N.includes(v)?N.filter(F=>F!==v):[...N,v])},Jt=h=>ot(h,[]);if(Gt)return n.jsx(rs,{label:"knowledge"});const Ae=!m||y&&r||a&&!e||Vt,ue={fields:[],chips:[]};for(const h of Ie)for(const v of h.classifiers){const N=p.classificationFilters?.[v.slug]??[],F=v.parentSlug?p.classificationFilters?.[v.parentSlug]??[]:void 0,L=F?[...new Set(F.flatMap(P=>v.valuesByParentValue[P]??[]))]:v.values;L.length>0&&ue.fields.push({key:`clf:${v.slug}`,label:v.name,group:h.automationName??"Classifiers",icon:n.jsx(ls,{className:"h-4 w-4"}),editor:ge({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:L.map(P=>({value:P,label:P,count:zt?.[v.slug]?.[P]})),selected:N,multiple:!0,onSelect:P=>Xt(v.slug,P)})})}for(const[h,v]of Object.entries(p.classificationFilters??{})){if(v.length===0)continue;const N=Ie.flatMap(F=>F.classifiers).find(F=>F.slug===h);ue.chips.push({id:`clf:${h}`,field:`clf:${h}`,label:N?.name??h,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>Jt(h)})}const en=[p.contentIds?.length?fe({id:"contentIds",label:p.contentIds.length>1?"Events":"Event",value:`#${p.contentIds.join(", #")}`,onRemove:()=>C({contentIds:void 0})}):null,Ze?fe({id:"mcpActivityId",label:"Conversation",value:Ze,onRemove:()=>C({mcpActivityId:void 0})}):null,qe?fe({id:"clientIds",label:"Connected app",value:qe,sourceLink:Ot,details:w&&w.length>0?n.jsx(Ls,{ownerSlug:t,clientIds:w,linkedUser:le?.linkedUser,linkedUserEntitySlug:le?.linkedUserEntitySlug}):void 0,onRemove:()=>C({clientIds:void 0})}):null,Xe?fe({id:"schedule",label:"Schedule",value:Xe,sourceLink:t&&U&&W?Ps(t,U,W):void 0,onRemove:()=>C({schedule:void 0,runIds:void 0})}):null,...ue.chips].filter(h=>h!=null),at={filterTrailing:!!(a&&o&&e)?n.jsxs($e,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":T,onClick:()=>E(h=>!h),children:[n.jsx(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Q,leading:l,filters:p,onFiltersChange:C,eventKinds:Lt,searchQuery:b,onSearchChange:h=>{S.current=!0,I(h)},extraFields:ue.fields,drillChips:en,total:Wt,isListLoading:Ae,isTotalLoading:qt,hasCursorInUrl:Yt&&tt,onGoToLatest:Zt},tn=!Ae&&!!et&&!tt&&!ke,nn=y?a?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",it=!!(a&&t);return n.jsx(ds,{children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-3 lg:-mx-6 lg:px-6":void 0,children:s&&t?n.jsx(wt,{...at,ownerSlug:t}):n.jsx(Tt,{...at})}),T&&a&&o&&e&&n.jsx(Xs,{entityId:o,organizationId:e,ownerSlug:t||"",selectedRange:p.dateRange||void 0,onSelectRange:Ht}),Ae?n.jsx("div",{className:"space-y-4",children:["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(h=>n.jsx(Nt,{className:"h-32 rounded-lg"},h))}):tn?n.jsx(rt,{icon:lt,title:"No activity yet",description:nn,actionLabel:it?"Add a connector":void 0,onAction:it&&t?()=>void f({to:"/$owner/connectors/create",params:{owner:t}}):void 0}):n.jsx(js,{onFiltersChange:C,organizationId:e,ownerSlug:t,entityId:o,filters:p,showEntityLinks:Ke,foldConsecutiveCalls:!0,groupByConversation:!0,emptyState:n.jsx(rt,{icon:lt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:ke?"Clear filters":void 0,onAction:ke?Q:void 0})})]})})}function to({record:e,ownerSlug:t,filterBarLeading:o}){const s=se(),i=V(),{filters:l,updateFilters:y}=Et({parse:xe,serialize:Re,filterKeys:It,replace:!1,merge:_t}),m=we({...l,platforms:void 0,connectionIds:void 0,feedIds:void 0})||l.sortBy!=null&&l.sortBy!=="date"||l.sortOrder!=null&&l.sortOrder!=="desc",d=()=>{i({...Pe(t,s.search??{}),...s.pathname.startsWith(`/${t}/events/`)?{}:{to:s.pathname}})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx(wt,{ownerSlug:t,sourceRead:!0,leading:o,filters:l,onFiltersChange:y,searchQuery:l.searchQuery??"",onSearchChange:r=>y({searchQuery:r}),onClearFilters:d}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),m?n.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[n.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),n.jsx($e,{variant:"outline",size:"sm",onClick:()=>{const r=Re({platforms:l.platforms,connectionIds:l.connectionIds,feedIds:l.feedIds}),a={...Pe(t,s.search??{}).search,...r};i({to:s.pathname,search:a})},children:"Clear unsupported filters"})]}):n.jsx(gs,{record:e,orgContext:{slug:t},filters:l})]})}function vo({entity:e,organizationId:t,ownerSlug:o,filterBarLeading:s}){const i=e.is_derived?n.jsx(to,{ownerSlug:o,record:{type:e.entity_type,key:e.slug},filterBarLeading:s}):n.jsx(eo,{organizationId:t,ownerSlug:o,entityId:e.id,hideSourceFilter:!0,filterBarLeading:s});return n.jsx(_s,{organizationId:t,children:e.entity_type==="$member"?n.jsx(Cs,{children:i}):i})}export{eo as E,_s as M,vo as R};
2
- //# sourceMappingURL=record-activity-CvgZyCmw.js.map