@lobu/runtime-server 20.2.0 → 21.1.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 (270) hide show
  1. package/dist/catalogs/automations.json +0 -8
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/README.md +15 -16
  4. package/dist/connectors/github.ts +274 -193
  5. package/dist/connectors/google_calendar.ts +54 -160
  6. package/dist/connectors/google_drive.ts +106 -131
  7. package/dist/connectors/google_gmail.ts +53 -30
  8. package/dist/connectors/hackernews.ts +2 -5
  9. package/dist/connectors/jira.ts +71 -27
  10. package/dist/connectors/linear.ts +55 -21
  11. package/dist/connectors/microsoft_outlook.ts +151 -110
  12. package/dist/connectors/postgres.ts +19 -11
  13. package/dist/connectors/producthunt.ts +11 -7
  14. package/dist/connectors/reddit.ts +36 -6
  15. package/dist/connectors/rss.ts +2 -2
  16. package/dist/connectors/whatsapp_web.ts +5 -4
  17. package/dist/connectors/x.ts +32 -17
  18. package/dist/connectors/youtube.ts +18 -5
  19. package/dist/db/migrations/20260917000000_views.sql +271 -0
  20. package/dist/db/migrations/20260917000001_views_attach_index.sql +14 -0
  21. package/dist/db/migrations/20260918000000_runs_turn_tool_event_uniq.sql +51 -0
  22. package/dist/db/migrations/20260923230000_runs_connector_artifact_hash.sql +32 -0
  23. package/dist/db/migrations/20260924000000_resource_source_files.sql +17 -0
  24. package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
  25. package/dist/dependencies.bun.lock +113 -102
  26. package/dist/guest.bundle.js +78 -10
  27. package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
  28. package/dist/owletto/dist/assets/_-XlUwOWCI.js +2 -0
  29. package/dist/owletto/dist/assets/_agentId-B2DrawIk.js +1 -0
  30. package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
  31. package/dist/owletto/dist/assets/_automationId-BLnqLtUv.js +1 -0
  32. package/dist/owletto/dist/assets/{_connectorKey._connectionId-BAJGfcy7.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
  33. package/dist/owletto/dist/assets/{_connectorKey.index-BBF8vGJS.js → _connectorKey.index-C_yKycN_.js} +1 -1
  34. package/dist/owletto/dist/assets/_conversationId-CpuEvflw.js +1 -0
  35. package/dist/owletto/dist/assets/_deploymentId-BL9tnDFl.js +1 -0
  36. package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
  37. package/dist/owletto/dist/assets/_owner-Cg50UU6m.js +1 -0
  38. package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
  39. package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
  40. package/dist/owletto/dist/assets/_slug-DbD-wv2m.js +1 -0
  41. package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
  42. package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
  43. package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
  44. package/dist/owletto/dist/assets/accept-invitation-BmQKbQem.js +1 -0
  45. package/dist/owletto/dist/assets/activity-route-view-BvtAoGVt.js +1 -0
  46. package/dist/owletto/dist/assets/{agent-card-controls-CZO6GI0s.js → agent-card-controls-bhTMPoVi.js} +1 -1
  47. package/dist/owletto/dist/assets/{agent-client-setup-list-_chLOorY.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
  48. package/dist/owletto/dist/assets/{agent-connect-pages-DWBgSIYT.js → agent-connect-pages-DkDlFVY5.js} +1 -1
  49. package/dist/owletto/dist/assets/{agent-editor-form-BTNlg0kQ.js → agent-editor-form-DwHD9j1Y.js} +1 -1
  50. package/dist/owletto/dist/assets/{agent-guardrails-route-B5uoMC6o.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
  51. package/dist/owletto/dist/assets/{agent-loading-shells-CLoLeFcB.js → agent-loading-shells-BQLjzMPy.js} +1 -1
  52. package/dist/owletto/dist/assets/{agent-permissions-matrix-TP00-MYL.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
  53. package/dist/owletto/dist/assets/{agent-skill-context-D4a2QCoZ.js → agent-skill-context-s42Q4Wjo.js} +1 -1
  54. package/dist/owletto/dist/assets/{agent-skills-route-KVDDTbJB.js → agent-skills-route-Cwq1QrhW.js} +1 -1
  55. package/dist/owletto/dist/assets/{agent-subpage-shell-DuVYZvBE.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
  56. package/dist/owletto/dist/assets/agent-thread-D7AGGjRV.js +8 -0
  57. package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
  58. package/dist/owletto/dist/assets/agents-workbench-Cl7FO7b3.js +1 -0
  59. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +127 -0
  60. package/dist/owletto/dist/assets/{app._appId-D0_LQTJU.js → app._appId-CqYz3AOO.js} +1 -1
  61. package/dist/owletto/dist/assets/automation-detail-content-CKSywvzE.js +1 -0
  62. package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
  63. package/dist/owletto/dist/assets/{calendar-C0XpOHd8.js → calendar-CHXehtu0.js} +1 -1
  64. package/dist/owletto/dist/assets/{callback-CO_K9eR-.js → callback-DZ3YyXeV.js} +1 -1
  65. package/dist/owletto/dist/assets/{card-DeFQuU_J.js → card-4Ull9W6d.js} +1 -1
  66. package/dist/owletto/dist/assets/{claim-CUpWOSie.js → claim-BGLCPLXq.js} +1 -1
  67. package/dist/owletto/dist/assets/clients-C7ubnFsS.js +1 -0
  68. package/dist/owletto/dist/assets/{code-editor-BqGUZFt6.js → code-editor-BHiWR94J.js} +1 -1
  69. package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
  70. package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
  71. package/dist/owletto/dist/assets/connected._clientId-7RU89sVW.js +1 -0
  72. package/dist/owletto/dist/assets/{connection-BgAlYjeV.js → connection-CTaUGXl6.js} +1 -1
  73. package/dist/owletto/dist/assets/{connection-feed-detail-B3ePAinf.js → connection-feed-detail-B1xieiEh.js} +1 -1
  74. package/dist/owletto/dist/assets/{connector-provenance-DgsDg0Z9.js → connector-provenance-DRdUEmQ1.js} +1 -1
  75. package/dist/owletto/dist/assets/{connectors-CqPQPo9U.js → connectors-NBwCLuZg.js} +1 -1
  76. package/dist/owletto/dist/assets/{consent-bswcIzsf.js → consent-fmhPPlpi.js} +1 -1
  77. package/dist/owletto/dist/assets/{core.esm-DsLgjoel.js → core.esm-C-eNiUAl.js} +1 -1
  78. package/dist/owletto/dist/assets/{create-Dwo04oWV.js → create-8bBbQJGY.js} +1 -1
  79. package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
  80. package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
  81. package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
  82. package/dist/owletto/dist/assets/{create._connectorKey-CCBb2pil.js → create._connectorKey-CHAotlsF.js} +1 -1
  83. package/dist/owletto/dist/assets/{cronstrue-ChFyC9ps.js → cronstrue-C5yTgk5z.js} +1 -1
  84. package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
  85. package/dist/owletto/dist/assets/deployments-D1gbQwsy.js +1 -0
  86. package/dist/owletto/dist/assets/deployments-body-DycIGlnL.js +1 -0
  87. package/dist/owletto/dist/assets/device-DyPnQkhO.js +1 -0
  88. package/dist/owletto/dist/assets/{device-pin-tombstone-1ikyqSdb.js → device-pin-tombstone-CwJitllC.js} +1 -1
  89. package/dist/owletto/dist/assets/device-rows-BBhW1C7Y.js +1 -0
  90. package/dist/owletto/dist/assets/{device._deviceId-DTYKGBY8.js → device._deviceId-XswfXHOc.js} +1 -1
  91. package/dist/owletto/dist/assets/entity-options-utGBmFX0.js +1 -0
  92. package/dist/owletto/dist/assets/entity-page-BxwuqqWk.js +1 -0
  93. package/dist/owletto/dist/assets/entity-type-page-BrWqk6so.js +1 -0
  94. package/dist/owletto/dist/assets/event-page-LIm4EDmJ.js +1 -0
  95. package/dist/owletto/dist/assets/events-feed-C4L8mQV7.js +1 -0
  96. package/dist/owletto/dist/assets/{full-page-spinner-BN2G_YiM.js → full-page-spinner-DsU-Cb3L.js} +1 -1
  97. package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
  98. package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
  99. package/dist/owletto/dist/assets/{index-hSE2E46p.js → index-1YrrvVJ4.js} +1 -1
  100. package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
  101. package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
  102. package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
  103. package/dist/owletto/dist/assets/index-C8CR2-Ck.css +1 -0
  104. package/dist/owletto/dist/assets/{index-OUb5Mlez.js → index-CDz3-ieP.js} +10 -10
  105. package/dist/owletto/dist/assets/{index-C6VAJ8Ku.js → index-CQ4s6nzy.js} +1 -1
  106. package/dist/owletto/dist/assets/index-CpWKAAGX.js +1 -0
  107. package/dist/owletto/dist/assets/{index-vdqhlocx.js → index-D2dcENg2.js} +1 -1
  108. package/dist/owletto/dist/assets/{index-C2oCgDX7.js → index-DCK0KhMM.js} +1 -1
  109. package/dist/owletto/dist/assets/{index-C-u4yR8Z.js → index-DXqiRON3.js} +1 -1
  110. package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
  111. package/dist/owletto/dist/assets/index-DtRfQcRH.js +7898 -0
  112. package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
  113. package/dist/owletto/dist/assets/index-DwtfHCHB.js +1 -0
  114. package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
  115. package/dist/owletto/dist/assets/index-nOYvNROJ.js +1 -0
  116. package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
  117. package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
  118. package/dist/owletto/dist/assets/{json-diff-DnsW7Pin.js → json-diff-DYeX-xLk.js} +2 -2
  119. package/dist/owletto/dist/assets/{list-skeleton-CHzLN7GK.js → list-skeleton-s4GPSJ8J.js} +1 -1
  120. package/dist/owletto/dist/assets/login-Di5VF2F_.js +1 -0
  121. package/dist/owletto/dist/assets/logout-BuaQGSnw.js +1 -0
  122. package/dist/owletto/dist/assets/member-scope-gate-CJqJZk7T.js +1 -0
  123. package/dist/owletto/dist/assets/memory-browse-page-Bibfs2sK.js +101 -0
  124. package/dist/owletto/dist/assets/missing-view-CD4DOaG8.js +1 -0
  125. package/dist/owletto/dist/assets/{model-selector-DfbmHjLu.js → model-selector-XC5CI2Et.js} +1 -1
  126. package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
  127. package/dist/owletto/dist/assets/{new-Df_dY6Z5.js → new-BzkA1sq2.js} +1 -1
  128. package/dist/owletto/dist/assets/new-C3f0BShb.js +1 -0
  129. package/dist/owletto/dist/assets/new-DA5LF6iB.js +1 -0
  130. package/dist/owletto/dist/assets/{oauth-workspace-access-D9GmiMfK.js → oauth-workspace-access-D6epOq0R.js} +1 -1
  131. package/dist/owletto/dist/assets/{organization-uSDYkJpX.js → organization-DOtBRqDQ.js} +1 -1
  132. package/dist/owletto/dist/assets/{permissions-Fe0DP6b8.js → permissions-D8uJHINS.js} +1 -1
  133. package/dist/owletto/dist/assets/{proposal-review-shell-D9HwnDda.js → proposal-review-shell-C3K-JXjb.js} +1 -1
  134. package/dist/owletto/dist/assets/{recent-C03LhMD7.js → recent-CFcWceBl.js} +1 -1
  135. package/dist/owletto/dist/assets/{renderer-CHNejd95.js → renderer-1nRJFMGx.js} +2 -2
  136. package/dist/owletto/dist/assets/{reset-password-CuISnlG_.js → reset-password-9RTWhBEb.js} +1 -1
  137. package/dist/owletto/dist/assets/runs-_yVh6PPB.js +1 -0
  138. package/dist/owletto/dist/assets/{runs-panel-DsdESupx.js → runs-panel-B2852xus.js} +1 -1
  139. package/dist/owletto/dist/assets/runs-table--dnFQatY.js +1 -0
  140. package/dist/owletto/dist/assets/{schema-value-normalization-B--OWDL8.js → schema-value-normalization-BspxVEGy.js} +1 -1
  141. package/dist/owletto/dist/assets/{settings-wGNHtsDP.js → settings-9lDASETT.js} +1 -1
  142. package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
  143. package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
  144. package/dist/owletto/dist/assets/{switch-Dzse_XFM.js → switch-CxDXvPGE.js} +1 -1
  145. package/dist/owletto/dist/assets/use-applied-views-DvMT3wap.js +1 -0
  146. package/dist/owletto/dist/assets/{use-mention-search-uyW1Uwf6.js → use-mention-search-CeTEE3oE.js} +1 -1
  147. package/dist/owletto/dist/assets/view-frame-HoBawpT2.js +1 -0
  148. package/dist/owletto/dist/index.html +2 -2
  149. package/dist/providers.json +0 -1
  150. package/dist/server-main.bundle.mjs +8997 -7479
  151. package/npm-shrinkwrap.json +543 -485
  152. package/package.json +5 -2
  153. package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
  154. package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
  155. package/vendor/connector-sdk/dist/connector-types.d.ts +28 -15
  156. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
  157. package/vendor/connector-sdk/dist/define-connector.js +4 -1
  158. package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
  159. package/vendor/connector-sdk/dist/http-client.js +15 -13
  160. package/vendor/connector-sdk/dist/index.d.ts +1 -1
  161. package/vendor/connector-sdk/dist/retry.d.ts +15 -3
  162. package/vendor/connector-sdk/dist/retry.js +40 -64
  163. package/vendor/connector-sdk/package.json +1 -1
  164. package/vendor/core/dist/agent-policy.js +3 -0
  165. package/vendor/core/dist/connector-query-errors.d.ts +3 -3
  166. package/vendor/core/dist/connector-query-errors.js +8 -3
  167. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
  168. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
  169. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
  170. package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
  171. package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
  172. package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
  173. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
  174. package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
  175. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
  176. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
  177. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
  178. package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
  179. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
  180. package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
  181. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
  182. package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
  183. package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
  184. package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
  185. package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
  186. package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
  187. package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
  188. package/vendor/core/dist/contracts/tools/source-files.js +55 -0
  189. package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
  190. package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
  191. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
  192. package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
  193. package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
  194. package/vendor/core/dist/contracts/tools/view-path.js +24 -0
  195. package/vendor/core/dist/contracts/worker/protocol.d.ts +90 -8
  196. package/vendor/core/dist/contracts/worker/protocol.js +70 -10
  197. package/vendor/core/dist/index.d.ts +1 -1
  198. package/vendor/core/dist/provider-config-types.d.ts +0 -9
  199. package/vendor/core/dist/reserved.d.ts +3 -3
  200. package/vendor/core/dist/reserved.js +9 -1
  201. package/vendor/core/dist/sdk-compat.d.ts +1 -1
  202. package/vendor/core/dist/utils/secret-redaction.js +2 -0
  203. package/vendor/core/package.json +30 -5
  204. package/vendor/views/dist/api.d.ts +184 -0
  205. package/vendor/views/dist/api.js +410 -0
  206. package/vendor/views/dist/bridge.d.ts +141 -0
  207. package/vendor/views/dist/bridge.js +330 -0
  208. package/vendor/views/dist/index.d.ts +12 -0
  209. package/vendor/views/dist/index.js +10 -0
  210. package/vendor/views/package.json +35 -0
  211. package/dist/owletto/dist/assets/_-Ds4DyQjj.js +0 -2
  212. package/dist/owletto/dist/assets/_-VmyR6aN_.js +0 -1
  213. package/dist/owletto/dist/assets/_agentId-BAVnp0c7.js +0 -1
  214. package/dist/owletto/dist/assets/_agentId-Df-3rGi5.js +0 -1
  215. package/dist/owletto/dist/assets/_automationId-D696vOjd.js +0 -1
  216. package/dist/owletto/dist/assets/_conversationId-Ci4rgrHm.js +0 -1
  217. package/dist/owletto/dist/assets/_deploymentId-Iy-D5PDq.js +0 -1
  218. package/dist/owletto/dist/assets/_name-CeGwb0oK.js +0 -1
  219. package/dist/owletto/dist/assets/_owner-CFR1G8OX.js +0 -1
  220. package/dist/owletto/dist/assets/_skillKey-DuLcQWBu.js +0 -1
  221. package/dist/owletto/dist/assets/_slug-CDSO20ac.js +0 -1
  222. package/dist/owletto/dist/assets/accept-invitation-Db5jklHT.js +0 -1
  223. package/dist/owletto/dist/assets/activity-route-view-DVW3DoB7.js +0 -1
  224. package/dist/owletto/dist/assets/agent-thread-CzCJU3-R.js +0 -134
  225. package/dist/owletto/dist/assets/agents-DFs57C3c.js +0 -1
  226. package/dist/owletto/dist/assets/agents-workbench-C2bUlJP2.js +0 -1
  227. package/dist/owletto/dist/assets/automation-detail-content-DWkdhnv2.js +0 -1
  228. package/dist/owletto/dist/assets/automations-DFs57C3c.js +0 -1
  229. package/dist/owletto/dist/assets/clients-DhYr4lyL.js +0 -1
  230. package/dist/owletto/dist/assets/connect-Dtb-E5An.js +0 -1
  231. package/dist/owletto/dist/assets/connect._clientId-DWtceAAw.js +0 -1
  232. package/dist/owletto/dist/assets/connected._clientId-CMe-wTuV.js +0 -1
  233. package/dist/owletto/dist/assets/create-CcXUdke7.js +0 -1
  234. package/dist/owletto/dist/assets/create-Cp6hMoeU.js +0 -1
  235. package/dist/owletto/dist/assets/create-automation-form-CJ4meayB.js +0 -1
  236. package/dist/owletto/dist/assets/deployments-CjfFxyDA.js +0 -1
  237. package/dist/owletto/dist/assets/deployments-body-Cg0KiWGr.js +0 -1
  238. package/dist/owletto/dist/assets/device-DpY67Jaj.js +0 -1
  239. package/dist/owletto/dist/assets/device-rows-Cp3yMcuV.js +0 -1
  240. package/dist/owletto/dist/assets/entity-options-1EaSGMX4.js +0 -1
  241. package/dist/owletto/dist/assets/entity-page-DJmM70dv.js +0 -1
  242. package/dist/owletto/dist/assets/entity-type-page-C3mT7tXn.js +0 -1
  243. package/dist/owletto/dist/assets/events-feed-iliGfjit.js +0 -1
  244. package/dist/owletto/dist/assets/guardrails-CLlnRRy9.js +0 -1
  245. package/dist/owletto/dist/assets/identity-MSLryUi8.js +0 -1
  246. package/dist/owletto/dist/assets/index-3o4Eepb4.js +0 -1
  247. package/dist/owletto/dist/assets/index-BUr8321-.js +0 -7898
  248. package/dist/owletto/dist/assets/index-Bulu5ldM.js +0 -1
  249. package/dist/owletto/dist/assets/index-BvbfITqH.js +0 -1
  250. package/dist/owletto/dist/assets/index-ChcQMdod.css +0 -1
  251. package/dist/owletto/dist/assets/index-Clw9ZBj-.js +0 -1
  252. package/dist/owletto/dist/assets/index-D2oL4Ydo.js +0 -1
  253. package/dist/owletto/dist/assets/index-D7wulT4y.js +0 -1
  254. package/dist/owletto/dist/assets/index-DOLFe19K.js +0 -1
  255. package/dist/owletto/dist/assets/index-DTSA0Xh1.js +0 -1
  256. package/dist/owletto/dist/assets/index-DxXXVPU0.js +0 -1
  257. package/dist/owletto/dist/assets/index-nzvsA3hT.js +0 -1
  258. package/dist/owletto/dist/assets/login-CCKNM0gV.js +0 -1
  259. package/dist/owletto/dist/assets/logout-B-N2aodZ.js +0 -1
  260. package/dist/owletto/dist/assets/member-scope-gate-B560Wg-t.js +0 -1
  261. package/dist/owletto/dist/assets/memory-browse-page-DMDqKJn7.js +0 -101
  262. package/dist/owletto/dist/assets/models-M51OGDRE.js +0 -1
  263. package/dist/owletto/dist/assets/new-BVQS9H-Y.js +0 -1
  264. package/dist/owletto/dist/assets/new-DxDVE9nL.js +0 -1
  265. package/dist/owletto/dist/assets/runs-BnYdToDc.js +0 -1
  266. package/dist/owletto/dist/assets/runs-table-B7jKuILd.js +0 -1
  267. package/dist/owletto/dist/assets/settings-Bg9yCCoN.js +0 -1
  268. package/dist/owletto/dist/assets/skills-CN5Ube7A.js +0 -1
  269. package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
  270. package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
@@ -1 +0,0 @@
1
- import{hA as i,j as e}from"./index-BUr8321-.js";import{b as m}from"./agent-skills-route-KVDDTbJB.js";import"./agent-subpage-shell-DuVYZvBE.js";import"./agent-skill-context-D4a2QCoZ.js";import"./core.esm-DsLgjoel.js";import"./skill-editor-D_W3QlRz.js";import"./agent-loading-shells-CLoLeFcB.js";import"./agent-card-controls-CZO6GI0s.js";import"./switch-Dzse_XFM.js";function f(){const{owner:t,agentId:o,skillKey:r}=i.useParams();return e.jsx(m,{owner:t,agentId:o,skillKey:r})}export{f as component};
@@ -1 +0,0 @@
1
- import{e3 as l,a1 as y,a2 as x,c6 as c,c9 as d,j as t,c7 as g}from"./index-BUr8321-.js";import{E as u}from"./entity-type-page-C3mT7tXn.js";import"./json-diff-DnsW7Pin.js";import"./index-OUb5Mlez.js";import"./index-Vcq4gwWv.js";import"./code-editor-BqGUZFt6.js";function N(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=y(),o=x(),{data:i=[],isLoading:r}=c(s),e=i.find(p=>p.slug===n)??null,m=e?d(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/memory",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{N as component};
@@ -1 +0,0 @@
1
- import{Y as l,ay as m,r as c,ag as u,j as e,az as d,aw as h}from"./index-BUr8321-.js";import{S as f,A as x,a as g}from"./index-hSE2E46p.js";import{F as v}from"./full-page-spinner-BN2G_YiM.js";function p({alt:i="",...t}){return e.jsx("img",{alt:i,...t,referrerPolicy:"no-referrer"})}function j({children:i}){return e.jsx(g,{authClient:h,navigate:t=>{window.location.href=t},replace:t=>{window.location.replace(t)},Link:({href:t,children:n,className:a})=>e.jsx("a",{href:t,className:a,children:n}),basePath:"/auth",redirectTo:"/",magicLink:!0,social:{providers:[]},avatar:{Image:p},children:i})}function N(){const{session:i,sessionResult:t}=l(),{invitationId:n}=m.useSearch(),a=c.useRef(!1);return c.useEffect(()=>{t.isPending||i||!n||a.current||(a.current=!0,(async()=>{let s=null;try{const o=await fetch(`${u}/api/invitation-preview?id=${encodeURIComponent(n)}`,{credentials:"omit"});o.ok&&(s=await o.json())}catch{}const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",`/auth/accept-invitation?invitationId=${encodeURIComponent(n)}`),s&&(r.searchParams.set("loginHint",s.email),r.searchParams.set("invitationOrg",s.organizationName)),window.location.href=r.toString()})())},[i,t.isPending,n]),i&&!n?e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-md text-center",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx(d,{className:"mx-auto h-10 w-10 text-destructive mb-4"}),e.jsx("h1",{className:"text-xl font-semibold",children:"Invitation not found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"This invitation link is missing its ID. Ask the person who invited you to resend it."})]})}):i?e.jsxs("div",{className:"min-h-[calc(100vh-3.5rem)] flex flex-col items-center justify-center gap-6 p-4",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"h-8 w-auto"}),e.jsx(j,{children:e.jsx(f,{children:e.jsx(x,{})})})]}):e.jsx(v,{className:"min-h-[calc(100vh-3.5rem)]"})}export{N as component};
@@ -1 +0,0 @@
1
- import{a2 as me,K as Ft,bv as Be,bb as Gn,r as h,d8 as Un,j as e,bO as qe,L as Y,B as U,X as Te,aj as O,ci as Pt,cj as Mt,d9 as $t,bH as Rt,cP as ze,ck as Ot,da as Wn,db as Hn,b6 as Qn,a3 as st,dc as Yn,cE as Xn,cF as Zn,ct as qn,dd as Jn,E as es,de as he,df as q,ak as Kt,dg as ts,af as _e,a1 as Vt,cb as Bt,c9 as ns,bS as Ce,dh as zt,di as ss,aO as Ie,cl as Gt,P as Ut,cg as os,dj as as,dk as le,d5 as rs,dl as is,dm as cs,dn as ls,br as ds,n as us,dp as ms,dq as He,dr as fs,ds as ye,aE as Ae,dt as De,du as ps,dv as hs,dw as Wt,dx as xs,dy as gs,aH as vs,cM as ys,ab as bs,c0 as Qe,dz as Ht,S as Qt,dA as js,dB as Yt,dC as Xt,bY as ws,bZ as Ns,b_ as Ss,b$ as ks,dD as Cs,aS as Zt,Y as _s,bM as qt,dE as Jt,dF as Ts,dG as wt,dH as Is,dI as As,dJ as Ds,a as Ls,dK as Es,dL as Fs,dM as en,dN as Ps,dO as Ms,dP as $s,dQ as Rs,dR as Os,dS as Ks,c8 as Vs,dT as Bs,dU as tn,bm as Oe,I as Nt,b4 as zs,dV as Gs,dW as Us,dX as Ws,dY as Hs,dZ as Qs,d_ as Ys,p as Xs,q as Zs,cn as qs,c7 as St,cf as Js,d$ as eo,aX as to,e0 as no,bK as so,e1 as oo,aV as ao}from"./index-BUr8321-.js";import{A as ro}from"./device-automation-BIjs7DZJ.js";import{n as io}from"./agent-thread-storage-U6htL3ad.js";import{s as co}from"./pending-seed-CPbfgnLX.js";import{u as lo}from"./clients-DhYr4lyL.js";import{g as uo}from"./client-rows-EJSKR6z1.js";import{c as Je}from"./connection-label-BobuYiAG.js";import{E as mo}from"./events-feed-iliGfjit.js";import{C as fo}from"./calendar-C0XpOHd8.js";import{b as po,c as ho}from"./renderer-CHNejd95.js";import{E as xo}from"./agent-loading-shells-CLoLeFcB.js";import{M as go}from"./member-scope-gate-B560Wg-t.js";function Ke(t){return t.kind==="managed"?`managed:${t.agentId}`:`device:${t.executionTarget.deviceWorkerId}:${t.executionTarget.agentKind}`}function vo({ownerSlug:t}){const n=me(),o=Ft(),{data:s=[]}=Be(),{data:a=[]}=Gn(),[r,d]=h.useState(!1),[c,u]=h.useState(null),[i,m]=h.useState(""),[f,p]=h.useState(!1),v=h.useRef(null);h.useEffect(()=>{o&&r&&v.current?.focus()},[o,r]);const g=s.find(j=>j.system)??s[0]??null,x=h.useMemo(()=>{const j=s.map(T=>({kind:"managed",agentId:T.agentId,label:T.name})),D=g?a.filter(T=>T.online&&T.organization_slug===t&&T.capabilities.includes("automations.execute")&&(T.agent_kinds?.length??0)>0).flatMap(T=>(T.agent_kinds??[]).map(w=>({kind:"device",agentId:g.agentId,label:`${Un(T)} · ${ro[w]??w}`,executionTarget:{kind:"device",deviceWorkerId:T.id,agentKind:w}}))):[];return{managed:j,deviceTargets:D}},[s,g,a,t]),y=[...x.managed,...x.deviceTargets].find(j=>Ke(j)===c)??x.managed.find(j=>j.agentId===g?.agentId)??x.managed[0]??x.deviceTargets[0]??null,S=j=>{u(Ke(j)),p(!1)},C=()=>{const j=i.trim();if(!j||!y)return;const D=io();co(D,j,y.kind==="device"?y.executionTarget:void 0),m(""),n(Hn(t,y.agentId,D))};if(o&&!r){const j="flex h-14 w-14 items-center justify-center rounded-full border bg-background text-foreground transition-colors hover:bg-accent/60";return e.jsx("div",{className:"sticky bottom-0 z-20 mt-auto flex justify-center bg-gradient-to-t from-background via-background to-transparent pt-4 pb-1",children:y?e.jsx("button",{type:"button","aria-label":"Ask Lobu",className:j,onClick:()=>d(!0),children:e.jsx(qe,{className:"h-7 w-7"})}):e.jsx(Y,{to:"/$owner/agents",params:{owner:t},"aria-label":"Create an agent to start chatting",className:j,children:e.jsx(qe,{className:"h-7 w-7"})})})}return e.jsx("div",{className:"sticky bottom-0 z-20 mt-auto bg-gradient-to-t from-background via-background to-transparent pt-5",children:e.jsxs("div",{className:"relative rounded-2xl border bg-background transition-colors focus-within:ring-1 focus-within:ring-ring",children:[o?e.jsx(U,{type:"button",variant:"ghost",size:"icon","aria-label":"Collapse composer",className:"absolute top-1.5 right-1.5 size-7 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>d(!1),children:e.jsx(Te,{className:"h-4 w-4"})}):null,y?e.jsx("textarea",{value:i,onChange:j=>m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),C())},placeholder:"Ask Lobu…",rows:2,ref:v,className:O("max-h-40 min-h-16 w-full resize-none bg-transparent px-4 pt-3 text-sm outline-none placeholder:text-muted-foreground",o&&"pr-10")}):e.jsx(Y,{to:"/$owner/agents",params:{owner:t},className:O("block min-h-16 px-4 pt-3 text-sm text-muted-foreground hover:text-foreground",o&&"pr-10"),children:"Create an agent to start chatting"}),e.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 pb-2",children:[e.jsxs(Pt,{open:f,onOpenChange:p,children:[e.jsx(Mt,{asChild:!0,children:e.jsxs(U,{type:"button",variant:"ghost",size:"sm",disabled:!y,className:"h-8 max-w-[70%] gap-1.5 px-2 text-xs text-muted-foreground",children:[y?.kind==="device"?e.jsx($t,{className:"h-3.5 w-3.5"}):e.jsx(Rt,{className:"h-3.5 w-3.5"}),e.jsxs("span",{className:"truncate",children:["Run with: ",y?.label??"No agent"]}),e.jsx(ze,{className:"h-3.5 w-3.5 shrink-0"})]})}),e.jsxs(Ot,{align:"start",className:"max-h-80 w-72 overflow-y-auto p-1.5",children:[e.jsx("p",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Lobu agents"}),x.managed.map(j=>e.jsx(kt,{target:j,selected:y,onSelect:S},j.agentId)),x.deviceTargets.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"my-1 h-px bg-border"}),e.jsx("p",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Devices"}),x.deviceTargets.map(j=>e.jsx(kt,{target:j,selected:y,onSelect:S},`${j.executionTarget.deviceWorkerId}:${j.executionTarget.agentKind}`))]}):null]})]}),e.jsxs(U,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",disabled:!y||!i.trim(),onClick:C,children:[e.jsx(Wn,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})})}function kt({target:t,selected:n,onSelect:o}){const s=n?Ke(n)===Ke(t):!1;return e.jsxs("button",{type:"button",className:O("flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-accent",s&&"bg-accent"),onClick:()=>o(t),children:[t.kind==="device"?e.jsx($t,{className:"h-4 w-4 shrink-0"}):e.jsx(Rt,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t.label})]})}const ot=h.createContext(null);function yo({organizationId:t,isWorkspaceLoading:n,children:o}){const{data:s=[],isLoading:a}=Qn(t);return e.jsx(ot.Provider,{value:{groups:s,isLoading:!!n||a},children:o})}function bo(){const t=h.useContext(ot);if(!t)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return t}function jo(){return h.useContext(ot)}function wo(t){const{parse:n,serialize:o,filterKeys:s,clearClassifications:a=!0,merge:r}=t,d=me(),c=st(),u=h.useMemo(()=>{const f=Object.entries(c.search||{}).filter(v=>v[1]!==void 0&&v[1]!==null),p=new URLSearchParams(f);return n(p)},[c.search,n]),i=h.useCallback(f=>{const p=r?r(u,f):{...u,...f},v=o(p),g={};for(const[x,k]of Object.entries(c.search||{}))k!=null&&(g[x]=k);for(const x of s)delete g[x];if(a)for(const x of Object.keys(g))x.startsWith("clf_")&&delete g[x];for(const[x,k]of Object.entries(v))k!==void 0&&(g[x]=k);d({to:c.pathname,search:g,replace:!0})},[u,o,s,a,r,d,c]),m=h.useCallback(()=>{const f={};for(const[p,v]of Object.entries(c.search||{}))v!=null&&(s.includes(p)||a&&p.startsWith("clf_")||(f[p]=v));d({to:c.pathname,search:f,replace:!0})},[d,c.pathname,c.search,s,a]);return{filters:u,updateFilters:i,clearFilters:m}}function nn(t){const{slug:n}=Yn();return Xn({queryKey:["schedules",n,t],queryFn:async()=>((await Zn("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(s=>s.action_args?.agent_id===t),enabled:!!n&&!!t,staleTime:3e4})}function No(t,n){if(t.length===0)return"";const o=t.map(s=>{const a=n.find(r=>r.id===s);return a?Je(a):null}).filter(s=>s!=null);return o.length===0?`Filtered by connection${t.length>1?"s":""} #${t.join(", #")}`:o.length===1?`From ${o[0]}`:`From ${o.join(", ")}`}function So(t,n){if(t.length===0)return"";const s=t.map(a=>{const r=n.find(u=>u.id===a);if(!r)return null;const d=r.connection_name?.trim()||r.connector_name||r.connector_key||`connection #${r.connection_id}`,c=r.display_name?.trim()||r.feed_key||`feed #${r.id}`;return`${d} · ${c}`}).filter(a=>a!=null);return s.length===0?`Filtered by feed${t.length>1?"s":""} #${t.join(", #")}`:s.length===1?`From ${s[0]}`:`From ${s.join("; ")}`}function ko(t,n){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(n.connection_id)},search:{feedId:n.id}}}function Co(t,n){return{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(n.id)}}}function _o(t,n){return{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n}}}function Ct(t,n){return{to:"/$owner/events",params:{owner:t},search:{agent:n}}}function To(t,n){return{to:"/$owner/automations/$automationId",params:{owner:t,automationId:n}}}function Io(t,n,o){return{to:"/$owner/events",params:{owner:t},search:{agent:n,schedule:o}}}function Ao({text:t,sourceLink:n,details:o,onClear:s}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm",children:[e.jsx(Jn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),n?e.jsxs(Y,{to:n.to,params:n.params,search:n.search,className:"inline-flex min-w-0 items-center gap-1.5 font-medium text-foreground hover:underline",children:[e.jsx("span",{className:"truncate",children:t}),e.jsx(es,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):e.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t}),o,e.jsx(U,{variant:"ghost",size:"icon",className:"ml-auto h-5 w-5 shrink-0",onClick:s,"aria-label":"Clear filter",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]})}function Do({ownerSlug:t,clientIds:n,linkedUser:o,linkedUserEntitySlug:s}){const a=t&&s?qn(t,[{entity_type:"$member",slug:s}]):null;return e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"inline-flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:n.length===1?"Client ID":"Client IDs"}),n.map(r=>e.jsx("code",{className:"break-all text-foreground",children:r},r))]}),o?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?e.jsx(Y,{to:a,className:"font-medium text-foreground hover:underline",children:o}):e.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ke(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function $e(t,n,o){const s=new Set;for(const[a,r]of Object.entries(t.feeds_schema??{})){if(o&&!o.has(a))continue;const d=ke(ke(r)?.eventKinds);if(d)for(const[c,u]of Object.entries(d)){if(!n){s.add(c);continue}const i=ke(u)?.attributions;Array.isArray(i)&&i.some(m=>{const f=ke(ke(m)?.target);return typeof f?.entityType=="string"&&n.has(f.entityType)})&&s.add(c)}}return s}function Lo({connectors:t,entityTypes:n,selectedPlatforms:o=[],selectedFeeds:s=[],selectedEntityTypes:a=[]}){const r=new Set,d=new Set(o),c=new Set(a),u=new Map;for(const i of s){const m=u.get(i.connectorKey)??new Set;m.add(i.feedKey),u.set(i.connectorKey,m)}if(u.size>0)for(const i of t){const m=u.get(i.key);if(m)for(const f of $e(i,void 0,m))r.add(f)}else if(d.size>0){for(const i of t)if(d.has(i.key))for(const m of $e(i))r.add(m)}else if(c.size>0){for(const i of n)if(c.has(i.slug))for(const m of Object.keys(i.event_kinds??{}))r.add(m);for(const i of t)for(const m of $e(i,c))r.add(m)}else{for(const i of n)for(const m of Object.keys(i.event_kinds??{}))r.add(m);for(const i of t)for(const m of $e(i))r.add(m)}return[...r].sort((i,m)=>i.localeCompare(m))}function Eo({connectors:t,selectedKeys:n,onToggle:o,label:s="Connectors",searchPlaceholder:a="Search connectors...",emptyText:r="No connectors found"}){return e.jsx(he,{contentClassName:"w-80",searchPlaceholder:a,emptyText:r,trigger:()=>e.jsxs(U,{variant:"outline",className:"h-9",children:[s,n.length>0&&e.jsx(_e,{variant:"secondary",className:"ml-2 h-5 px-1.5",children:n.length})]}),children:()=>t.map(d=>e.jsxs(q,{onSelect:()=>o(d.key),children:[e.jsx(Kt,{checked:n.includes(d.key),className:"mr-3"}),e.jsx(ts,{connector:d,className:"flex-1"}),typeof d.count=="number"&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:d.count.toLocaleString()})]},d.key))})}function Fo(t){const{orgContext:n}=Vt(),{data:o=[],isLoading:s}=Bt(n);return{visible:h.useMemo(()=>o.filter(r=>!ns(r)&&(!r.organization_slug||r.organization_slug===t)),[o,t]),isTypesLoading:s}}function be(){return st().search??{}}function Po({ownerSlug:t,typeScope:n,agentScope:o,connectionScope:s,feedScope:a,visibility:r="all"}){const d=be(),c=typeof d.type=="string"&&d.type.trim()?d.type.trim():void 0,u=n??(c?Ce(c):void 0),i=o??zt(d),m=s??ss(d),f=a??(typeof d.feed_ids=="string"?d.feed_ids:typeof d.feed_ids=="number"?String(d.feed_ids):void 0),p=k=>r==="all"||(r==="active"?k:!k),v=p(!!u),g=p(!!i),x=p(!!(m||f));return!v&&!g&&!x?null:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[v?e.jsx(Mo,{ownerSlug:t,typeScope:u}):null,g?e.jsx($o,{ownerSlug:t,agentScope:i}):null,x?e.jsx(Ro,{ownerSlug:t,connectionScope:m,feedScope:f}):null]})}const Le=h.forwardRef(function({open:n,label:o,value:s,disabled:a,disabledReason:r,...d},c){const u=e.jsxs(U,{ref:c,variant:"outline",disabled:a,"aria-expanded":n,className:"h-9 gap-1.5 rounded-md bg-muted px-3 py-2 text-sm font-normal",...d,children:[e.jsx("span",{className:"text-muted-foreground",children:o}),s?e.jsx("span",{className:"max-w-[10rem] truncate font-medium",children:s}):e.jsx("span",{className:"text-muted-foreground",children:"Any"}),e.jsx(ze,{className:"h-3.5 w-3.5 shrink-0 opacity-60"})]});return a&&r?e.jsxs(is,{children:[e.jsx(cs,{asChild:!0,children:e.jsx("span",{className:"inline-flex",children:u})}),e.jsx(ls,{children:r})]}):u});function Mo({ownerSlug:t,typeScope:n}){const o=me(),s=be(),{visible:a}=Fo(t),r=a.find(u=>u.slug===n),d=u=>{o(le(t,s,{entity:void 0,create:void 0,type:u}))},c=()=>{o(le(t,s,{type:void 0}))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search types...",emptyText:"No entity types",trigger:u=>e.jsx(Le,{open:u,label:"Type",value:r?.name}),children:u=>e.jsxs(e.Fragment,{children:[n?e.jsx(q,{onSelect:()=>{c(),u()},className:"text-muted-foreground",children:"Clear type"}):null,a.map(i=>e.jsxs(q,{onSelect:()=>{d(i.slug),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(i.slug===n)}),e.jsx(Gt,{icon:i.icon,className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),typeof i.entity_count=="number"?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.entity_count}):null,e.jsx(at,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:i.slug},label:i.name})]},i.id)),e.jsxs(q,{onSelect:()=>{o(os(t)),u()},className:"text-muted-foreground",children:[e.jsx(Ut,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})})}function $o({ownerSlug:t,agentScope:n}){const o=me(),s=be(),{data:a=[]}=Be(),r=h.useMemo(()=>[...a].sort((i,m)=>i.name.localeCompare(m.name)),[a]),d=r.find(i=>i.agentId===n),c=i=>{o(le(t,s,_t(s,i)))},u=()=>{o(le(t,s,_t(s,void 0)))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search agents...",emptyText:"No agents",trigger:i=>e.jsx(Le,{open:i,label:"Agent",value:d?.name}),children:i=>e.jsxs(e.Fragment,{children:[n?e.jsx(q,{onSelect:()=>{u(),i()},className:"text-muted-foreground",children:"Clear agent"}):null,r.map(m=>e.jsxs(q,{onSelect:()=>{c(m.agentId),i()},className:"gap-2",children:[e.jsx(Ie,{className:Ee(m.agentId===n)}),e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:m.name.trim().charAt(0).toUpperCase()||"?"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m.name})]},m.agentId))]})})}function _t(t,n){const o={agent:n,automation:void 0,schedule:void 0,platforms:void 0};return t.schedule!=null&&(o.run_ids=void 0),typeof t.platforms=="string"&&t.platforms.trim().length>0&&(o.connection_ids=void 0,o.feed_ids=void 0),o}function Ro({ownerSlug:t,connectionScope:n,feedScope:o}){const{groups:s}=bo(),a=h.useMemo(()=>new Set((n??"").split(",").map(u=>u.trim()).filter(Boolean)),[n]),r=as(s,a),d=s.find(u=>u.connector_key===r),c=a.size===1?Number([...a][0]):void 0;return e.jsxs(e.Fragment,{children:[e.jsx(Oo,{ownerSlug:t,groups:s,scopedGroup:d}),d?e.jsx(Ko,{ownerSlug:t,group:d,selectedIds:a}):null,c?e.jsx(Vo,{ownerSlug:t,connectionId:c,feedScope:o}):null]})}function Oo({ownerSlug:t,groups:n,scopedGroup:o}){const s=me(),a=be(),r=u=>{const i=u.connections.map(m=>String(m.id)).join(",");i&&s(le(t,a,{connection_ids:i,feed_ids:void 0}))},d=()=>{s(le(t,a,{connection_ids:void 0,feed_ids:void 0}))},c=o?.connector_name??o?.connector_key;return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search connectors...",emptyText:"No connectors",trigger:u=>e.jsx(Le,{open:u,label:"Connector",value:c}),children:u=>e.jsxs(e.Fragment,{children:[o?e.jsx(q,{onSelect:()=>{d(),u()},className:"text-muted-foreground",children:"Clear connector"}):null,n.map(i=>{const m=i.connector_name??i.connector_key;return e.jsxs(q,{disabled:i.connections.length===0,onSelect:()=>{r(i),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(i.connector_key===o?.connector_key)}),e.jsx(ds,{plain:!0,name:m,faviconDomain:i.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m}),i.connection_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.connection_count}):null,e.jsx(at,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:i.connector_key},label:m})]},i.connector_key)}),e.jsx(Bo,{to:"/$owner/connectors/create",params:{owner:t},label:"Add connector",onSelect:u})]})})}function Ko({ownerSlug:t,group:n,selectedIds:o}){const s=me(),a=be(),r=o.size===1?n.connections.find(u=>o.has(String(u.id))):void 0,d=u=>{s(le(t,a,{connection_ids:String(u),feed_ids:void 0}))},c=r?Je({display_name:r.display_name,connector_name:n.connector_name,connector_key:n.connector_key}):"All connections";return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search connections...",emptyText:"No connections",trigger:u=>e.jsx(Le,{open:u,label:"Connection",value:c}),children:u=>n.connections.map(i=>{const m=Je({display_name:i.display_name,connector_name:n.connector_name,connector_key:n.connector_key});return e.jsxs(q,{onSelect:()=>{d(i.id),u()},className:"group gap-2",children:[e.jsx(Ie,{className:Ee(o.has(String(i.id)))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:m}),i.feed_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:i.feed_count}):null,e.jsx(at,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:t,connectorKey:n.connector_key,connectionId:String(i.id)},label:m})]},i.id)})})}function Vo({ownerSlug:t,connectionId:n,feedScope:o}){const s=me(),a=be(),{data:r=[],isLoading:d}=us(n),c=h.useMemo(()=>new Set((o??"").split(",").map(f=>f.trim()).filter(Boolean)),[o]),u=c.size===1?r.find(f=>c.has(String(f.id))):void 0,i=f=>{s(le(t,a,{connection_ids:String(n),feed_ids:String(f.id)}))},m=()=>{s(le(t,a,{connection_ids:String(n),feed_ids:void 0}))};return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search feeds...",emptyText:d?"Loading feeds...":"No feeds",trigger:f=>e.jsx(Le,{open:f,label:"Feed",value:u?Tt(u):void 0}),children:f=>e.jsxs(e.Fragment,{children:[c.size>0?e.jsx(q,{onSelect:()=>{m(),f()},className:"text-muted-foreground",children:"Clear feed"}):null,r.map(p=>e.jsxs(q,{onSelect:()=>{i(p),f()},className:"gap-2",children:[e.jsx(Ie,{className:Ee(c.has(String(p.id)))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:Tt(p)})]},p.id))]})})}function Tt(t){return t.display_name?.trim()||t.feed_key}function at({to:t,params:n,label:o}){return e.jsx(Y,{to:t,params:n,onClick:s=>s.stopPropagation(),onPointerDown:s=>s.stopPropagation(),className:"shrink-0 rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100","aria-label":`Manage ${o}`,children:e.jsx(rs,{className:"h-3.5 w-3.5"})})}function Bo({to:t,params:n,label:o,onSelect:s}){return e.jsx(q,{asChild:!0,onSelect:s,className:"text-muted-foreground",children:e.jsxs(Y,{to:t,params:n,className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4 shrink-0"}),o]})})}function Ee(t){return t?"h-4 w-4 shrink-0 opacity-100":"h-4 w-4 shrink-0 opacity-0"}function zo({value:t,onChange:n,onClear:o,placeholder:s="Pick a date range",className:a,align:r="start"}){const d=t?.from!=null,c=d&&o!=null;return e.jsxs("div",{className:O("relative grid gap-2",a),children:[e.jsxs(Pt,{children:[e.jsx(Mt,{asChild:!0,children:e.jsxs(U,{id:"date",variant:"outline",className:O("relative w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!d&&"text-muted-foreground",c&&"pr-8"),children:[e.jsx(ms,{className:"mr-2 h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:t?.from?t.to?e.jsxs(e.Fragment,{children:[He(t.from,"LLL dd, y")," -"," ",He(t.to,"LLL dd, y")]}):He(t.from,"LLL dd, y"):s})]})}),e.jsx(Ot,{className:"w-auto p-0",align:r,children:e.jsx(fo,{initialFocus:!0,mode:"range",defaultMonth:t?.from,selected:t,onSelect:n,numberOfMonths:2})})]}),c&&e.jsx("button",{type:"button","aria-label":"Clear date range",onClick:o,className:"absolute right-2 top-1/2 z-10 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]})}var sn=["PageUp","PageDown"],on=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],an={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},je="Slider",[et,Go,Uo]=ps(je),[rt]=vs(je,[Uo]),[Wo,Fe]=rt(je),it=h.forwardRef((t,n)=>{const{name:o,min:s=0,max:a=100,step:r=1,orientation:d="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:i=[s],value:m,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:v=!1,form:g,...x}=t,k=h.useRef(new Set),y=h.useRef(0),S=h.useRef(!1),j=d==="horizontal"?Ho:Qo,[D=[],T]=fs({prop:m,defaultProp:i,onChange:E=>{[...k.current][y.current]?.focus({preventScroll:!0,focusVisible:S.current}),S.current=!1,f(E)}}),w=h.useRef(D);function W(E){const $=qo(D,E);J(E,$)}function ae(E){J(E,y.current)}function re(){const E=w.current[y.current];D[y.current]!==E&&p(D)}function J(E,$,{commit:H}={commit:!1}){const ie=na(r),B=sa(Math.round((E-s)/r)*r+s,ie),A=Wt(B,[s,a]);T((M=[])=>{const z=Xo(M,A,$);if(ta(z,u*r)){y.current=z.indexOf(A);const G=String(z)!==String(M);return G&&H&&p(z),G?z:M}else return M})}return e.jsx(Wo,{scope:t.__scopeSlider,name:o,disabled:c,min:s,max:a,valueIndexToChangeRef:y,thumbs:k.current,values:D,orientation:d,form:g,children:e.jsx(et.Provider,{scope:t.__scopeSlider,children:e.jsx(et.Slot,{scope:t.__scopeSlider,children:e.jsx(j,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:ye(x.onPointerDown,()=>{c||(w.current=D,S.current=!1)}),min:s,max:a,inverted:v,onSlideStart:c?void 0:W,onSlideMove:c?void 0:ae,onSlideEnd:c?void 0:re,onHomeKeyDown:()=>{c||(S.current=!0,J(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(S.current=!0,J(a,D.length-1,{commit:!0}))},onStepKeyDown:({event:E,direction:$})=>{if(!c){S.current=!0;const B=sn.includes(E.key)||E.shiftKey&&on.includes(E.key)?10:1,A=y.current,M=D[A],z=r*B*$;J(M+z,A,{commit:!0})}}})})})})});it.displayName=je;var[rn,cn]=rt(je,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ho=h.forwardRef((t,n)=>{const{min:o,max:s,dir:a,inverted:r,onSlideStart:d,onSlideMove:c,onSlideEnd:u,onStepKeyDown:i,...m}=t,[f,p]=h.useState(null),v=De(n,C=>p(C)),g=h.useRef(void 0),x=hs(a),k=x==="ltr",y=k&&!r||!k&&r;function S(C){const j=g.current||f.getBoundingClientRect(),D=[0,j.width],w=ct(D,y?[o,s]:[s,o]);return g.current=j,w(C-j.left)}return e.jsx(rn,{scope:t.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:e.jsx(ln,{dir:x,"data-orientation":"horizontal",...m,ref:v,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const j=S(C.clientX);d?.(j)},onSlideMove:C=>{const j=S(C.clientX);c?.(j)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:C=>{const D=an[y?"from-left":"from-right"].includes(C.key);i?.({event:C,direction:D?-1:1})}})})}),Qo=h.forwardRef((t,n)=>{const{min:o,max:s,inverted:a,onSlideStart:r,onSlideMove:d,onSlideEnd:c,onStepKeyDown:u,...i}=t,m=h.useRef(null),f=De(n,m),p=h.useRef(void 0),v=!a;function g(x){const k=p.current||m.current.getBoundingClientRect(),y=[0,k.height],C=ct(y,v?[s,o]:[o,s]);return p.current=k,C(x-k.top)}return e.jsx(rn,{scope:t.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:e.jsx(ln,{"data-orientation":"vertical",...i,ref:f,style:{...i.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const k=g(x.clientY);r?.(k)},onSlideMove:x=>{const k=g(x.clientY);d?.(k)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:x=>{const y=an[v?"from-bottom":"from-top"].includes(x.key);u?.({event:x,direction:y?-1:1})}})})}),ln=h.forwardRef((t,n)=>{const{__scopeSlider:o,onSlideStart:s,onSlideMove:a,onSlideEnd:r,onHomeKeyDown:d,onEndKeyDown:c,onStepKeyDown:u,...i}=t,m=Fe(je,o);return e.jsx(Ae.span,{...i,ref:n,onKeyDown:ye(t.onKeyDown,f=>{f.key==="Home"?(d(f),f.preventDefault()):f.key==="End"?(c(f),f.preventDefault()):sn.concat(on).includes(f.key)&&(u(f),f.preventDefault())}),onPointerDown:ye(t.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),m.thumbs.has(p)?p.focus({preventScroll:!0,focusVisible:!1}):s(f)}),onPointerMove:ye(t.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&a(f)}),onPointerUp:ye(t.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),r(f))})})}),dn="SliderTrack",un=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(dn,o);return e.jsx(Ae.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:n})});un.displayName=dn;var tt="SliderRange",mn=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(tt,o),r=cn(tt,o),d=h.useRef(null),c=De(n,d),u=a.values.length,i=a.values.map(p=>bn(p,a.min,a.max)),m=u>1?Math.min(...i):0,f=100-Math.max(...i);return e.jsx(Ae.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...s,ref:c,style:{...t.style,[r.startEdge]:m+"%",[r.endEdge]:f+"%"}})});mn.displayName=tt;var fn="SliderThumb",[Yo,pn]=rt(fn),hn="SliderThumbProvider";function xn(t){const{__scopeSlider:n,name:o,children:s,internal_do_not_use_render:a}=t,r=Fe(hn,n),d=Go(n),[c,u]=h.useState(null),i=h.useMemo(()=>c?d().findIndex(k=>k.ref.current===c):-1,[d,c]),m=xs(c),f=c?!!r.form||!!c.closest("form"):!0,p=r.values[i],v=o??(r.name?r.name+(r.values.length>1?"[]":""):void 0),g=p===void 0?0:bn(p,r.min,r.max);h.useEffect(()=>{if(c)return r.thumbs.add(c),()=>{r.thumbs.delete(c)}},[c,r.thumbs]);const x={value:p,name:v,form:r.form,isFormControl:f,index:i,thumb:c,onThumbChange:u,percent:g,size:m};return e.jsx(Yo,{scope:n,...x,children:oa(a)?a(x):s})}xn.displayName=hn;var Re="SliderThumbTrigger",gn=h.forwardRef((t,n)=>{const{__scopeSlider:o,...s}=t,a=Fe(Re,o),r=cn(Re,o),{index:d,value:c,percent:u,size:i,onThumbChange:m}=pn(Re,o),f=De(n,x=>m(x)),p=Zo(d,a.values.length),v=i?.[r.size],g=v?Jo(v,u,r.direction):0;return e.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[r.startEdge]:`calc(${u}% + ${g}px)`},children:e.jsx(et.ItemSlot,{scope:o,children:e.jsx(Ae.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:c===void 0?{display:"none"}:t.style,onFocus:ye(t.onFocus,()=>{a.valueIndexToChangeRef.current=d})})})})});gn.displayName=Re;var nt=h.forwardRef((t,n)=>{const{__scopeSlider:o,name:s,...a}=t;return e.jsx(xn,{__scopeSlider:o,name:s,internal_do_not_use_render:({index:r,isFormControl:d})=>e.jsxs(e.Fragment,{children:[e.jsx(gn,{...a,ref:n,__scopeSlider:o}),d?e.jsx(yn,{__scopeSlider:o},r):null]})})});nt.displayName=fn;var vn="SliderBubbleInput",yn=h.forwardRef(({__scopeSlider:t,...n},o)=>{const{value:s,name:a,form:r}=pn(vn,t),d=h.useRef(null),c=De(d,o),u=gs(s);return h.useEffect(()=>{const i=d.current;if(!i)return;const m=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(m,"value").set;if(u!==s&&p){const v=new Event("input",{bubbles:!0});p.call(i,s),i.dispatchEvent(v)}},[u,s]),e.jsx(Ae.input,{style:{display:"none"},name:a,form:r,...n,ref:c,defaultValue:s})});yn.displayName=vn;function Xo(t=[],n,o){const s=[...t];return s[o]=n,s.sort((a,r)=>a-r)}function bn(t,n,o){const r=100/(o-n)*(t-n);return Wt(r,[0,100])}function Zo(t,n){return n>2?`Value ${t+1} of ${n}`:n===2?["Minimum","Maximum"][t]:void 0}function qo(t,n){if(t.length===1)return 0;const o=t.map(a=>Math.abs(a-n)),s=Math.min(...o);return o.indexOf(s)}function Jo(t,n,o){const s=t/2,r=ct([0,50],[0,s]);return(s-r(n)*o)*o}function ea(t){return t.slice(0,-1).map((n,o)=>t[o+1]-n)}function ta(t,n){if(n>0){const o=ea(t);return Math.min(...o)>=n}return!0}function ct(t,n){return o=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const s=(n[1]-n[0])/(t[1]-t[0]);return n[0]+s*(o-t[0])}}function na(t){if(!Number.isFinite(t))return 0;const n=t.toString();if(n.includes("e")){const[s,a]=n.split("e"),r=s.split(".")[1]||"",d=Number(a);return Math.max(0,r.length-d)}const o=n.split(".")[1];return o?o.length:0}function sa(t,n){const o=Math.pow(10,n);return Math.round(t*o)/o}function oa(t){return typeof t=="function"}const jn=h.forwardRef(({className:t,...n},o)=>e.jsxs(it,{ref:o,className:O("relative flex w-full touch-none select-none items-center",t),...n,children:[e.jsx(un,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:e.jsx(mn,{className:"absolute h-full bg-primary"})}),e.jsx(nt,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"}),n.value&&n.value.length>1&&e.jsx(nt,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));jn.displayName=it.displayName;const aa=["notification"],ra=["note","summary","decision","observation","fact","change","preference","identity"],ia=[...aa,...ra],ca="date-desc",It=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],At=[{value:"all",label:"Any reviewer"},{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],Dt=[{value:"all",label:"Any status"},{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}];function Ye(t,n){return e.jsxs("span",{className:"truncate",children:[e.jsxs("span",{className:"text-muted-foreground",children:[t,": "]}),n]})}function Ve(t){const n=t.replace(/[_-]+/g," ").trim();return n.length>0?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:t}function la({options:t,selected:n,onChange:o}){return e.jsx(he,{contentClassName:"w-72",searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",trigger:s=>e.jsxs(U,{variant:"outline","aria-expanded":s,className:"h-9 rounded-md bg-muted px-3 py-2 font-normal",children:["Kind",n.length>0?e.jsx(_e,{variant:"secondary",className:"h-5 px-1.5",children:n.length}):null]}),children:()=>t.map(s=>{const a=n.includes(s);return e.jsxs(q,{value:`${Ve(s)} ${s}`,onSelect:()=>o(a?n.filter(r=>r!==s):[...n,s]),children:[e.jsx(Kt,{checked:a,className:"mr-1"}),Ve(s)]},s)})})}function wn({"aria-label":t,onClick:n}){return e.jsx("button",{type:"button","aria-label":t,onClick:o=>{o.preventDefault(),o.stopPropagation(),n()},className:"rounded-sm p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})}function Xe({value:t,onValueChange:n,onClear:o,showClear:s,triggerClassName:a,displayValue:r,children:d}){return e.jsxs("div",{className:"relative shrink-0",children:[e.jsxs(ws,{value:t,onValueChange:n,children:[e.jsx(Ns,{className:O("px-2.5",s&&"pr-9",a),children:e.jsx(Ss,{children:r})}),e.jsx(ks,{children:d})]}),s&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-8 flex items-center",children:e.jsx("div",{className:"pointer-events-auto",children:e.jsx(wn,{"aria-label":"Clear filter",onClick:o})})})]})}function da({filters:t,onFiltersChange:n,connectors:o,eventKinds:s=[],searchQuery:a,onSearchChange:r,hideSourceFilter:d=!1,ownerSlug:c,total:u,isListLoading:i=!1,hasCursorInUrl:m=!1,onGoToLatest:f,open:p,onOpenChange:v,leading:g}){const x=a.trim().length>0,[k,y]=h.useState(x),S=p??k,C=v??y,j=t.dateRange?{from:t.dateRange[0],to:t.dateRange[1]}:void 0,D=N=>{N?.from&&N?.to?n({dateRange:[N.from,N.to]}):n({dateRange:null})},T=N=>{const X=t.platforms||[],_=X.includes(N)?X.filter(ue=>ue!==N):[...X,N];n({platforms:_})},w=`${t.sortBy??"date"}-${t.sortOrder??"desc"}`,W=t.reviewStatus||"all",ae=t.interactionStatus||"all",re=!!(t.dateRange?.[0]&&t.dateRange?.[1]),J=(t.engagementRange?.[0]??0)!==0||(t.engagementRange?.[1]??100)!==100,E=(t.platforms?.length??0)>0,$=t.semanticTypes??[],H=$.length>0,ie=!!(t.reviewStatus&&t.reviewStatus!=="all"),B=!!(t.interactionStatus&&t.interactionStatus!=="all"),A=(x?1:0)+(re?1:0)+(E?1:0)+(H?1:0)+(ie?1:0)+(B?1:0)+(J?1:0),M=s.length>0?s:ia,z=[...new Set([...M,...$])].sort((N,X)=>Ve(N).localeCompare(Ve(X))),G=It.find(N=>N.value===w)?.label??"Newest first",ee=At.find(N=>N.value===W)?.label??"Any reviewer",Q=Dt.find(N=>N.value===ae)?.label??"Any status",ne=e.jsxs("div",{className:"relative w-52 shrink-0",children:[e.jsx(ys,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(bs,{placeholder:d?"Search events...":"Search...",value:a,onChange:N=>r(N.target.value),className:O("pl-9",x&&"pr-8")}),x&&e.jsx("div",{className:"absolute inset-y-0 right-2 flex items-center",children:e.jsx(wn,{"aria-label":"Clear search",onClick:()=>r("")})})]}),fe=e.jsx(Xe,{value:w,onValueChange:N=>{const[X,_]=N.split("-");n({sortBy:X,sortOrder:_})},onClear:()=>n({sortBy:void 0,sortOrder:void 0}),showClear:w!==ca,triggerClassName:"w-[168px]",displayValue:Ye("Sort",G),children:It.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),de=e.jsx(Xe,{value:W,onValueChange:N=>n({reviewStatus:N}),onClear:()=>n({reviewStatus:void 0}),showClear:W!=="all",triggerClassName:"w-[186px]",displayValue:Ye("Review",ee),children:At.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),xe=e.jsx(Xe,{value:ae,onValueChange:N=>n({interactionStatus:N==="all"?null:N}),onClear:()=>n({interactionStatus:null}),showClear:ae!=="all",triggerClassName:"w-[178px]",displayValue:Ye("Approval",Q),children:Dt.map(N=>e.jsx(Qe,{value:N.value,children:N.label},N.value))}),we=e.jsxs("div",{className:"w-72 space-y-2 px-1 py-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:"Engagement score"}),e.jsxs("span",{className:"text-muted-foreground",children:[t.engagementRange?.[0]??0," –"," ",t.engagementRange?.[1]??100]})]}),e.jsx(jn,{value:t.engagementRange||[0,100],onValueChange:N=>n({engagementRange:N}),min:0,max:100,step:5})]}),K=e.jsx(la,{options:z,selected:$,onChange:N=>n({semanticTypes:N.length>0?N:void 0})});return e.jsxs(Ht,{open:S,onOpenChange:C,className:"w-full",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 text-sm text-muted-foreground",children:[g,i?e.jsx(Qt,{className:"h-4 w-20"}):u!=null&&u>0?e.jsx("span",{children:`${u.toLocaleString()} items`}):e.jsx("span",{}),!i&&u!=null&&u>0&&m&&f&&e.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 gap-1",onClick:f,children:[e.jsx(js,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[fe,e.jsx(Yt,{asChild:!0,children:e.jsxs(U,{variant:"outline",className:"h-9 rounded-md bg-muted px-3 py-2 font-normal",children:["Filters",A>0?e.jsx(_e,{variant:"secondary",className:"ml-1.5 h-5 px-1.5 text-[11px]",children:A}):null,e.jsx(ze,{className:O("ml-1 h-4 w-4 transition-transform",S&&"rotate-180")})]})})]})]}),e.jsx(Xt,{className:"pt-2.5",children:e.jsxs("div",{className:"flex flex-wrap items-start gap-2.5 border-t pt-3",children:[ne,d&&c?e.jsx(Po,{ownerSlug:c,visibility:"all"}):null,!d&&o.length>0?e.jsx(Eo,{connectors:o,selectedKeys:t.platforms||[],onToggle:T}):null,e.jsx(zo,{value:j,onChange:D,onClear:()=>n({dateRange:null}),placeholder:"Date range",className:"w-auto shrink-0"}),K,de,xe,we,A>0&&e.jsx(U,{type:"button",variant:"ghost",size:"sm",className:"h-9 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{r(""),n({dateRange:null,platforms:void 0,semanticTypes:void 0,reviewStatus:void 0,interactionStatus:null,engagementRange:void 0})},children:"Clear all"})]})})]})}function ua(t){const n=t instanceof Date?t:new Date(String(t));return Number.isNaN(n.getTime())?null:n}function Lt(t){return t.toISOString().split("T")[0]}function ma({entityId:t,organizationId:n,ownerSlug:o,selectedRange:s,onSelectRange:a}){const{data:r,isLoading:d,error:c}=Cs(n,{entityId:t},{slug:o}),u=h.useMemo(()=>{if(!r||r.length===0)return[];const p=r.map(y=>{const S=ua(y.date);return S?{date:S,count:y.count}:null}).filter(y=>y!==null).sort((y,S)=>y.date.getTime()-S.date.getTime());if(p.length===0)return[];const v=p[0].date;if((p[p.length-1].date.getTime()-v.getTime())/(1e3*60*60*24)>180){const y=new Map;for(const S of p){const C=new Date(S.date);C.setDate(S.date.getDate()-S.date.getDay());const j=Lt(C);y.set(j,(y.get(j)||0)+S.count)}return Array.from(y.entries()).map(([S,C])=>({date:S,count:C})).sort((S,C)=>new Date(S.date).getTime()-new Date(C.date).getTime())}return p.map(y=>({date:Lt(y.date),count:y.count}))},[r]),i=h.useCallback(p=>{if(p.name&&a){const v=new Date(p.name),g=new Date(v);g.setDate(g.getDate()+1),a(v,g)}},[a]),m=h.useCallback(p=>{if(a&&p.startValue!==void 0&&p.endValue!==void 0){const v=new Date(p.startValue),g=new Date(p.endValue);a(v,g)}},[a]),f=h.useMemo(()=>{if(u.length===0)return null;let p;if(s){const v=s[0].toISOString().split("T")[0],g=s[1].toISOString().split("T")[0];p=[[{xAxis:v},{xAxis:g}]]}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:v=>{const g=v[0];return`${new Date(g.name).toLocaleDateString()}: ${g.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:u.map(v=>v.date),axisLabel:{formatter:v=>{const g=new Date(v);return`${g.getMonth()+1}/${g.getDate()}`}}},yAxis:{type:"value",minInterval:1,splitLine:{lineStyle:{color:"rgba(0,0,0,0.05)"}}},dataZoom:[{type:"slider",start:0,end:100,height:20,bottom:10,borderColor:"transparent",backgroundColor:"rgba(0,0,0,0.02)",fillerColor:"rgba(99, 102, 241, 0.1)",handleStyle:{color:"#6366f1"}}],series:[{type:"line",smooth:!0,areaStyle:{opacity:.3,color:new po(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.5)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},lineStyle:{width:2,color:"#6366f1"},itemStyle:{color:"#6366f1"},showSymbol:!1,data:u.map(v=>v.count),markLine:{silent:!0,symbol:"none",label:{position:"insideEndTop",formatter:"avg: {c}",fontSize:10,color:"#9ca3af"},lineStyle:{color:"#d1d5db",type:"dashed",width:1},data:[{type:"average",name:"Average"}]},markArea:p?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:p}:void 0}]}},[u,s]);return d||c?e.jsx("div",{className:O(Zt,"p-4"),children:e.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:d?e.jsx(xo,{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})}):!f||u.length<2?null:e.jsx(fa,{option:f,onClick:i,onDataZoom:m})}function fa({option:t,onClick:n,onDataZoom:o}){const{chartRef:s,setOption:a}=ho({onClick:n,onDataZoom:o});return h.useEffect(()=>{a(t,!0)},[t,a]),e.jsx("div",{"data-testid":"events-timeline",className:O(Zt,"p-4 relative"),children:e.jsx("div",{ref:s,className:"h-48 w-full"})})}function pa({organizationId:t,ownerSlug:n,entityId:o,hideSourceFilter:s=!1,scopedEntityTypes:a,filterBarLeading:r}){const{isAuthenticated:d,isReady:c}=_s(),{isMember:u,isLoading:i}=qt(),m=c&&d&&u,f=c&&(!d||!i&&!u),p=me(),v=st(),g=Jt(v.search??{}),{filters:x,updateFilters:k,clearFilters:y}=wo({parse:zs,serialize:Us,filterKeys:Gs,merge:Ws}),[S,C]=h.useState(x.searchQuery||""),[j,D]=h.useState((x.searchQuery||"").trim().length>0),T=Ts(S,1e3),w=h.useMemo(()=>wt({...x,searchQuery:T.length>=3?T:void 0,...a?.length?{entityTypes:a}:{}}),[x,T,a]),W=k;h.useEffect(()=>{const l=T.length>=3?T:void 0;(x.searchQuery||void 0)!==l&&k({searchQuery:l})},[T,k,x.searchQuery]);const ae=()=>{C(""),y()},re=h.useMemo(()=>Is(wt({...x,searchQuery:T.length>=3?T:void 0})),[x,T]),J=o===void 0,{data:E=[]}=As(c&&m?t:null),{data:$=[]}=Ds(f?n:null),H=m?E:$,{data:ie=[]}=Bt(m&&t?{organizationId:t}:void 0),B=jo(),A=w.connectionIds,M=(A?.length??0)>0,{data:z=[]}=Ls(c&&m?t??"":"",{connectionIds:A??void 0,enabled:!B&&c&&m&&M}),G=w.feedIds,ee=(G?.length??0)>0,{data:Q=[]}=Es(c&&m?t:null,{feedIds:G??void 0,enabled:c&&m&&ee}),ne=h.useMemo(()=>B?B.groups.flatMap(l=>l.connections.map(b=>({id:b.id,display_name:b.display_name,connector_name:l.connector_name,connector_key:l.connector_key}))):z,[z,B]),fe=h.useMemo(()=>{const l=new Set(A??[]);return[...new Set([...w.platforms??[],...ne.filter(b=>l.has(b.id)).map(b=>b.connector_key)])]},[A,ne,w.platforms]),de=h.useMemo(()=>Q.map(l=>({connectorKey:l.connector_key,feedKey:l.feed_key})),[Q]),xe=h.useMemo(()=>M&&fe.length===0||ee&&de.length===0?[]:Lo({connectors:H,entityTypes:ie,selectedPlatforms:fe,selectedFeeds:de,selectedEntityTypes:w.entityTypes}),[H,w.entityTypes,M,ee,fe,de,ie]),we=h.useMemo(()=>M?No(A??[],ne):null,[A,ne,M]),K=w.clientIds,N=(K?.length??0)>0,{data:X=[]}=lo(null,{enabled:c&&m&&N}),_=h.useMemo(()=>{if(!K)return[];const l=new Set(K);return uo(X).filter(b=>b.clientIds.some(I=>l.has(I)))},[K,X]),ue=h.useMemo(()=>{if(!N||!K)return null;const l=_.map(b=>b.title);return l.length>0?`From ${l.join(", ")}`:`Filtered by client${K.length>1?" registrations":""}`},[_,K,N]),Pe=_.length===1?_[0]:null,Nn=n&&Pe?_o(n,Pe.clientId):void 0,Me=w.mcpActivityId??null,{data:lt=[]}=Fs({enabled:c&&m&&N&&!!Me,clientIds:K??[],limit:100}),Sn=h.useMemo(()=>{if(!Me)return null;const l=lt.find(I=>I.activityId===Me);if(!l)return"Selected conversation";const b=l.title?.trim();return b?`Conversation “${b}”`:l.activityKind==="session"?"MCP session":`Conversation ${l.clientId}`},[Me,lt]),kn=h.useMemo(()=>ee?So(G??[],Q):null,[G,ee,Q]),F=w.agentId,{data:dt=[]}=Be({enabled:c&&!!F}),Cn=h.useMemo(()=>{if(!F||w.automationId!=null||g||(w.platforms?.length??0)>0)return null;const l=dt.find(b=>b.agentId===F);return l?`From agent ${l.name}`:`From agent ${F}`},[F,w.platforms,w.automationId,g,dt]),se=w.automationId,{data:ut=[]}=en(F??void 0,{includeDetails:!1}),_n=h.useMemo(()=>{if(se==null)return null;const l=ut.find(b=>String(b.automation_id)===String(se));return l?`From watch “${l.name}”`:`From Automation #${se}`},[ut,se]),{data:mt=[]}=nn(F??void 0),Tn=h.useMemo(()=>{if(!g||!F)return null;const l=mt.find(b=>b.id===g);return l?.description?.trim()?`From schedule “${l.description.trim()}”`:"From scheduled task"},[F,g,mt]),Ge=h.useMemo(()=>{if(!F||se!=null||g||(w.platforms?.length??0)===0)return null;const l=w.platforms?.[0];return l?`From ${l} listen`:null},[F,w.platforms,g,se]),ge=h.useMemo(()=>{if(!n)return{};const l={};if(ee&&G?.length===1){const b=Q.find(I=>I.id===G[0]);b&&(l.feedIds=ko(n,b))}if(M&&A?.length===1){const b=ne.find(I=>I.id===A[0]);b?.connector_key&&(l.connectionIds=Co(n,{id:b.id,connector_key:b.connector_key}))}return F&&se==null&&!g&&(w.platforms?.length??0)===0&&(l.agentId=Ct(n,F)),F&&se!=null&&(l.automationId=To(n,String(se))),F&&g&&(l.schedule=Io(n,F,g)),Ge&&F&&(l.listen=Ct(n,F)),l},[F,A,ne,G,M,ee,w.platforms,Ge,n,g,se,Q]),{data:In}=Ps(c&&m?t:null,o),{data:An}=Ms(f&&!J?n:null,o),ft=m?In:An,Ue=h.useMemo(()=>{const l=new Map;for(const b of ft||[]){const I=b.automation_name??"__global__";l.has(I)||l.set(I,{automationName:b.automation_name??null,classifiers:[]});const P=l.get(I),R=b.attribute_values||{},te=Object.keys(R);let oe=null;const L={};for(const[V,ce]of Object.entries(R))if(ce.parent)for(const[ve,Se]of Object.entries(ce.parent))oe=ve,L[Se]||(L[Se]=[]),L[Se].push(V);const Z=P.classifiers.find(V=>V.slug===b.slug);if(Z){const V=new Set([...Z.values,...te]);Z.values=[...V];for(const[ce,ve]of Object.entries(L)){Z.valuesByParentValue[ce]||(Z.valuesByParentValue[ce]=[]);const Se=new Set([...Z.valuesByParentValue[ce],...ve]);Z.valuesByParentValue[ce]=[...Se]}oe&&(Z.parentSlug=oe)}else P.classifiers.push({slug:b.slug,name:b.name,values:te,parentSlug:oe,valuesByParentValue:L})}for(const b of l.values())b.classifiers.sort((I,P)=>I.parentSlug===null&&P.parentSlug!==null?-1:I.parentSlug!==null&&P.parentSlug===null?1:0);return[...l.values()]},[ft]),Dn=h.useMemo(()=>{const l=new Map(H.map(I=>[I.key,I]));return[...new Set(l.keys())].map(I=>{const P=l.get(I);return{key:I,name:P?.name||I,description:P?.description,icon:P?.icon,faviconDomain:$s(P?.auth_schema)}}).sort((I,P)=>I.name.localeCompare(P.name))},[H]),Ln=Rs(c&&m?t:null,o,w,n),En=Os(f?n:null,o,w),Fn=f?En:Ln,{data:Ne,isLoading:Pn,error:Mn}=Fn,pt=Ne?.pages[0],ht=pt?.total??0,xt=pt?.classification_stats,$n=!!(w.beforeOccurredAt||w.afterOccurredAt),gt=Ks(w),vt=Ne?.pages[Ne.pages.length-1],pe=vt?.content[vt.content.length-1];h.useEffect(()=>{!gt||!pe||Ne?.pages.length===1||x.beforeOccurredAt===pe.occurred_at&&x.beforeId===pe.id||k({beforeOccurredAt:pe.occurred_at,beforeId:pe.id})},[pe?.id,gt,k,Ne?.pages.length,pe,x.beforeOccurredAt,x.beforeId]);const Rn=h.useCallback(()=>{W({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[W]),[yt,On]=h.useState(new Set),Kn=l=>{const b=new Set(yt);b.has(l)?b.delete(l):b.add(l),On(b)},Vn=(l,b)=>{W({dateRange:[l,b]})},bt=(l,b)=>{const I=w.classificationFilters||{},P=I[l]||[],R=P.includes(b)?P.filter(oe=>oe!==b):[...P,b],te={...I};if(R.length>0)te[l]=R;else{delete te[l];for(const oe of Ue)for(const L of oe.classifiers)L.parentSlug===l&&delete te[L.slug]}W({classificationFilters:te})};if(Mn)return e.jsx(Vs,{label:"knowledge"});const We=!c||d&&i||Pn,Bn=!We&&ht===0&&!re,zn=d?m?"Activity is the workspace's live feed — every message, email, file, and record a connector pulls in lands here as an event. Connect your data to start collecting.":"Activity is the workspace's live feed of connector events. Join this workspace to add connectors and collect knowledge here.":"No public knowledge items are available yet",jt=!!(m&&n);return e.jsx(Bs,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:s?"sticky top-0 z-10 -mx-4 space-y-3 bg-background px-4 pb-3 lg:-mx-6 lg:px-6":void 0,children:e.jsx(da,{leading:r,open:j,onOpenChange:D,filters:w,onFiltersChange:W,connectors:Dn,eventKinds:xe,searchQuery:S,onSearchChange:C,hideSourceFilter:s,ownerSlug:n,total:ht,isListLoading:We,hasCursorInUrl:$n,onGoToLatest:Rn})}),[{key:"contentIds",label:l=>`Showing knowledge item #${l.join(", #")}`,ids:w.contentIds,clear:{contentIds:void 0}},{key:"runId",label:l=>`Filtered by Automation run #${l}`,id:w.runId,clear:{runId:void 0}},{key:"feedIds",text:kn,sourceLink:ge.feedIds,clear:{feedIds:void 0}},{key:"connectionIds",text:we,sourceLink:ge.connectionIds,clear:{connectionIds:void 0}},{key:"mcpActivityId",text:Sn,clear:{mcpActivityId:void 0}},{key:"clientIds",text:ue,sourceLink:Nn,details:K&&K.length>0?e.jsx(Do,{ownerSlug:n,clientIds:K,linkedUser:Pe?.linkedUser,linkedUserEntitySlug:Pe?.linkedUserEntitySlug}):void 0,clear:{clientIds:void 0}},{key:"automationId",text:_n,sourceLink:ge.automationId,clear:{automationId:void 0}},{key:"schedule",text:Tn,sourceLink:ge.schedule,clear:{schedule:void 0,runIds:void 0}},{key:"listen",text:Ge,sourceLink:ge.listen,clear:{platforms:void 0,connectionIds:void 0}},{key:"agentId",text:Cn,sourceLink:ge.agentId,clear:{agentId:void 0,automationId:void 0,schedule:void 0,platforms:void 0}},{key:"runIds",label:l=>`Filtered by run${l.length>1?"s":""} #${l.join(", #")}`,ids:w.runIds,clear:{runIds:void 0,schedule:void 0}}].map(l=>{const b="text"in l&&l.text?l.text:"ids"in l&&l.ids&&l.ids.length>0?l.label(l.ids):"id"in l&&l.id!=null?l.label(l.id):null;return b?e.jsx(Ao,{text:b,sourceLink:"sourceLink"in l?l.sourceLink:void 0,details:"details"in l?l.details:void 0,onClear:()=>W(l.clear)},l.key):null}).filter(Boolean),j&&m&&o&&t&&e.jsx(ma,{entityId:o,organizationId:t,ownerSlug:n||"",selectedRange:w.dateRange||void 0,onSelectRange:Vn}),Ue.length>0&&e.jsx("div",{className:"space-y-2",children:Ue.map(l=>{const b=l.automationName??"__global__",I=l.classifiers.some(R=>(w.classificationFilters?.[R.slug]?.length||0)>0),P=yt.has(b)||I;return e.jsxs(Ht,{open:P,onOpenChange:()=>Kn(b),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Yt,{asChild:!0,children:e.jsx(U,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:P?e.jsx(ze,{className:"h-3.5 w-3.5"}):e.jsx(tn,{className:"h-3.5 w-3.5"})})}),l.automationName&&e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:l.automationName})]}),e.jsx(Xt,{className:"space-y-1.5 mt-1.5 ml-6",children:l.classifiers.filter(R=>R.parentSlug===null).map(R=>{const te=w.classificationFilters?.[R.slug]||[],oe=l.classifiers.filter(L=>L.parentSlug===R.slug);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground shrink-0",children:R.name}),R.values.map(L=>{const Z=te.includes(L),V=xt?.[R.slug]?.[L];return e.jsxs(_e,{variant:Z?"default":"outline",className:"cursor-pointer",onClick:()=>bt(R.slug,L),children:[L,V!=null&&e.jsx("span",{className:"ml-1 opacity-60",children:V})]},L)})]}),te.length>0&&oe.map(L=>{const Z=[...new Set(te.flatMap(V=>L.valuesByParentValue[V]||[]))];return Z.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 ml-4 mt-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground shrink-0",children:L.name}),Z.map(V=>{const ce=w.classificationFilters?.[L.slug]?.includes(V),ve=xt?.[L.slug]?.[V];return e.jsxs(_e,{variant:ce?"default":"outline",className:"cursor-pointer",onClick:()=>bt(L.slug,V),children:[V,ve!=null&&e.jsx("span",{className:"ml-1 opacity-60",children:ve})]},V)})]},L.slug)})]},R.slug)})})]},b)})}),We?e.jsx("div",{className:"space-y-4",children:["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(l=>e.jsx(Qt,{className:"h-32 rounded-lg"},l))}):Bn?e.jsx(Oe,{icon:Nt,title:"No activity yet",description:zn,actionLabel:jt?"Add a connector":void 0,onAction:jt&&n?()=>void p({to:"/$owner/connectors/create",params:{owner:n}}):void 0}):e.jsx(mo,{organizationId:t,ownerSlug:n,entityId:o,filters:w,showEntityLinks:J,emptyState:e.jsx(Oe,{icon:Nt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:re?"Clear filters":void 0,onAction:re?ae:void 0})})]})})}function ha(t){const n=Hs();return e.jsx(xa,{...t,context:n},`${t.ownerSlug}:${t.attentionLens}:${Qs(n)}`)}function xa({organizationId:t,ownerSlug:n,typeScope:o,entityScope:s,agentScope:a,automationScope:r,scheduleScope:d,attentionLens:c=!1,activityTab:u="events",context:i}){const[m,f]=h.useState(c?"relevant":"activity"),p=i?m!=="activity":c,{orgContext:v}=Vt(),{isMember:g,isLoading:x}=qt(),k=g&&!!t,y=Ft(),S=u==="sessions"&&y,{attentionItems:C}=Ys(n),j=C.length,D=i?e.jsx("fieldset",{"aria-label":"Activity view",className:O("flex min-w-0 max-w-full items-center gap-1",y&&"justify-center"),children:[["relevant","Relevant here"],["attention","Needs attention"],["activity","All activity"]].map(([_,ue])=>e.jsxs("button",{type:"button","aria-pressed":m===_,onClick:()=>f(_),className:"flex min-w-0 items-center justify-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors aria-pressed:bg-muted aria-pressed:text-foreground hover:text-foreground",children:[ue,_==="attention"?e.jsx(Et,{count:j}):null]},_))}):e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>({..._??{}}),"aria-current":p?void 0:"page",className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",p?"text-muted-foreground hover:text-foreground":"bg-muted text-foreground"),children:"All activity"}),e.jsxs(Y,{to:"/$owner",params:{owner:n},search:_=>({..._??{}}),"aria-current":p?"page":void 0,className:O("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",p?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"),children:["Needs attention",e.jsx(Et,{count:j})]})]}),{data:T=[]}=Be(),w=a?T.find(_=>_.agentId===a)?.name??a:void 0,{data:W=[]}=en(a,{includeDetails:!1}),ae=r?W.find(_=>_.automation_id===r)?.name??`Automation ${r}`:void 0,{data:re=[]}=nn(a),J=d?re.find(_=>_.id===d)?.description??"Schedule":void 0,E=o?Ce(o):void 0,{data:$,isLoading:H,error:ie}=Xs(s?`/${n}/${Zs(s)}`:p?`/${n}`:"",v),B=s?$?.entity:void 0,A=s?B?.entity_type??Ce(s.split("/").at(-2)??""):E,M=A==="$member",z=s!=null&&!H&&(ie!=null||$?.entity==null),{data:G}=qs(A??"",v),ee=x||H,Q=$?.counts,ne=Q?Q.connections>0||Q.agents>0||Q.clients>0:!1,fe=k&&!ee&&Q!=null&&!ne,de={},xe=a?{agent:a}:{},we=A?{type:A}:{},K=s?e.jsx(Ze,{icon:B?.entity_type?e.jsx(Gt,{icon:G?.icon,className:"h-4 w-4 shrink-0"}):null,typeSegment:A?{label:G?.name??Ce(A),search:we}:void 0,label:B?.name??s.split("/").slice(-1)[0],ownerSlug:n,clearSearch:{}}):r&&a?e.jsx(Ze,{typeSegment:{label:w??"Agent",search:de},label:ae??"Automation",ownerSlug:n,clearSearch:xe}):d&&a?e.jsx(Ze,{typeSegment:{label:w??"Agent",search:de},label:J??"Schedule",ownerSlug:n,clearSearch:xe}):null,N=!y&&!S&&!z,X=s&&H?e.jsx(St,{label:"Loading record…"}):z?e.jsx(Oe,{icon:Js,title:"Record not found",description:"This record no longer exists."}):e.jsx(pa,{organizationId:t,ownerSlug:n,filterBarLeading:N?D:void 0,hideSourceFilter:!0,entityId:B?.id,scopedEntityTypes:!s&&E?[E]:void 0});if(p){const _=ee?e.jsx(St,{label:"workspace setup",variant:"panel",className:"px-6 py-8"}):fe?e.jsx("div",{className:"px-6",children:e.jsx(Oe,{icon:no,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:e.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[e.jsx(U,{asChild:!0,children:e.jsxs(Y,{to:"/$owner/connectors/create",params:{owner:n},children:[e.jsx(so,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),e.jsx(U,{asChild:!0,variant:"outline",children:e.jsxs(Y,{to:"/$owner/agents",params:{owner:n},children:[e.jsx(qe,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})}):e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"Nothing needs attention right now."});return e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:e.jsx(eo,{context:i,relevant:m==="relevant",owner:n,emptyState:_,tabs:D})})}return e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:[N?null:e.jsxs("div",{className:O("sticky top-0 z-20 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-2 bg-background pt-1",y?"justify-center":"justify-between"),children:[D,y?e.jsxs("div",{className:"flex items-center rounded-lg bg-muted/60 p-0.5 text-xs",children:[e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>{const ue={..._??{}};return delete ue.tab,ue},"aria-current":S?void 0:"page",className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",S?"text-muted-foreground hover:text-foreground":"bg-background text-foreground "),children:"Events"}),e.jsx(Y,{to:"/$owner/events",params:{owner:n},search:_=>({..._??{},tab:"sessions"}),"aria-current":S?"page":void 0,className:O("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",S?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:"Sessions"})]}):null]}),K&&!S?e.jsx("div",{className:"sticky top-0 z-20 flex min-w-0 flex-col gap-3 bg-background pt-1",children:K}):null,S?e.jsx(to,{owner:n,tone:"page",empty:"message"}):M?e.jsx(go,{ownerSlug:n,children:X}):X]})}function Et({count:t}){return t===0?null:e.jsx("span",{role:"img","aria-label":`${t} item${t===1?"":"s"} need attention`,className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:t})}function Ze({icon:t,typeSegment:n,label:o,ownerSlug:s,clearSearch:a}){return e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 border-l border-border/60 pb-1 pl-3 text-sm",children:[t,n?e.jsxs(e.Fragment,{children:[e.jsx(Y,{to:"/$owner/events",params:{owner:s},search:n.search,className:"shrink-0 font-medium text-muted-foreground transition-colors hover:text-foreground hover:underline",children:n.label}),e.jsx(tn,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]}):null,e.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:o}),e.jsx(U,{asChild:!0,variant:"ghost",size:"sm",className:"h-6 gap-1 px-2",children:e.jsxs(Y,{to:"/$owner/events",params:{owner:s},search:a,children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),"Clear"]})})]})}function Aa({owner:t,search:n,attentionLens:o,entityScope:s}){const a=typeof n.type=="string"&&n.type.trim()?Ce(n.type.trim()):void 0,r=zt(n),d=oo(n),c=Jt(n),u=n.tab==="sessions"?"sessions":"events";return e.jsx("div",{className:"flex flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:e.jsx(ao,{owner:t,children:i=>e.jsx(yo,{organizationId:i.organizationId,isWorkspaceLoading:i.isWorkspaceLoading,children:e.jsxs("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:[e.jsx(ha,{organizationId:i.organizationId,ownerSlug:i.ownerSlug,typeScope:a,entityScope:s,agentScope:r,automationScope:d,scheduleScope:c,attentionLens:o,activityTab:u}),e.jsx(vo,{ownerSlug:i.ownerSlug})]})})})})}export{Aa as A};