@lobu/runtime-server 21.2.1 → 22.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 (388) hide show
  1. package/dist/catalogs/automations.json +40 -13
  2. package/dist/catalogs/connectors.json +16601 -597
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +7 -5
  5. package/dist/connectors/_google/actions.ts +270 -0
  6. package/dist/connectors/_google/discovery/calendar_v3.json +1 -0
  7. package/dist/connectors/_google/discovery/chat_v1.json +1 -0
  8. package/dist/connectors/_google/discovery/docs_v1.json +1 -0
  9. package/dist/connectors/_google/discovery/drive_v3.json +1 -0
  10. package/dist/connectors/_google/discovery/gmail_v1.json +1 -0
  11. package/dist/connectors/_google/discovery/people_v1.json +1 -0
  12. package/dist/connectors/_google/discovery/sheets_v4.json +1 -0
  13. package/dist/connectors/_google/discovery/tasks_v1.json +1 -0
  14. package/dist/connectors/_google/discovery/youtube_v3.json +1 -0
  15. package/dist/connectors/_google/discovery.ts +442 -0
  16. package/dist/connectors/_google/errors.ts +91 -0
  17. package/dist/connectors/_google/list-feed.ts +223 -0
  18. package/dist/connectors/_google/policies.ts +127 -0
  19. package/dist/connectors/agentid.ts +43 -0
  20. package/dist/connectors/chat-user-identity.ts +2 -1
  21. package/dist/connectors/github-automation-events.ts +9 -0
  22. package/dist/connectors/github-identity.ts +28 -3
  23. package/dist/connectors/github.ts +101 -59
  24. package/dist/connectors/google_calendar.ts +207 -719
  25. package/dist/connectors/google_drive.ts +16 -2
  26. package/dist/connectors/google_gmail.ts +51 -33
  27. package/dist/connectors/herdr.ts +406 -0
  28. package/dist/connectors/jira.ts +6 -6
  29. package/dist/connectors/linear.ts +7 -4
  30. package/dist/connectors/postgres.ts +27 -2
  31. package/dist/connectors/tiktok-inbox-page.js +230 -0
  32. package/dist/connectors/tiktok-web-page.js +211 -0
  33. package/dist/connectors/tiktok_web.ts +286 -0
  34. package/dist/connectors/whatsapp-web-adapter.js +228 -10
  35. package/dist/connectors/whatsapp-web-helpers.ts +47 -14
  36. package/dist/connectors/whatsapp-web-identity.ts +121 -0
  37. package/dist/connectors/whatsapp_web.ts +170 -29
  38. package/dist/connectors/x.ts +276 -136
  39. package/dist/db/migrations/20261005150000_retire_agent_tool_config.sql +31 -0
  40. package/dist/db/migrations/20261005173700_drop_retired_agent_tool_config.sql +29 -0
  41. package/dist/db/migrations/20261007010000_identity_association_guards.sql +242 -0
  42. package/dist/db/migrations/20261007010001_identity_association_indexes.sql +35 -0
  43. package/dist/db/migrations/20261007012000_connector_browser_requirement.sql +7 -0
  44. package/dist/db/migrations/20261009010000_identity_member_decision_indexes.sql +22 -0
  45. package/dist/db/migrations/20261009015900_retire_remaining_physical_merges.sql +196 -0
  46. package/dist/db/migrations/20261009020000_retire_physical_entity_merge.sql +82 -0
  47. package/dist/db/migrations/20261009030000_retire_physical_merge_indexes.sql +39 -0
  48. package/dist/db/migrations/20261009030001_drop_physical_entity_redirect.sql +62 -0
  49. package/dist/db/migrations/20261009040000_normalize_identity_decisions.sql +60 -0
  50. package/dist/db/migrations/20261010220000_notification_targets_user_event_order.sql +53 -0
  51. package/dist/db/migrations/20261010223000_device_workers_user_fresh_cover.sql +39 -0
  52. package/dist/db/migrations/20261010223001_runs_org_default_view.sql +41 -0
  53. package/dist/db/migrations/20261010223002_events_org_guidance.sql +42 -0
  54. package/dist/db/migrations/20261011002000_finish_product_eval_retirement.sql +37 -0
  55. package/dist/db/migrations/20261011160000_mcp_conversation_workspaces.sql +97 -0
  56. package/dist/db/migrations/20261013120000_events_live_org_effective_date.sql +42 -0
  57. package/dist/db/migrations/20261013150000_events_live_linked_org_ids_gin.sql +41 -0
  58. package/dist/db/migrations/20261014120000_clear_team_device_auto_pause.sql +34 -0
  59. package/dist/db/migrations/20261014150000_connector_webhook_event_type_backfill.sql +30 -0
  60. package/dist/db/migrations/20261014170000_retire_atlassian_mcp_webhook_refresh.sql +51 -0
  61. package/dist/db/migrations/20261015010000_connection_auth_profile_fk_set_null_column.sql +53 -0
  62. package/dist/db/migrations/20261015120000_personal_org_connector_auto_policy.sql +38 -0
  63. package/dist/db/migrations/preconditions/20261005150000_retire_agent_tool_config.sql +22 -0
  64. package/dist/db/migrations/preconditions/20261005173700_drop_retired_agent_tool_config.sql +13 -0
  65. package/dist/db/migrations/preconditions/20261009020000_retire_physical_entity_merge.sql +26 -0
  66. package/dist/db/migrations/preconditions/20261011002000_finish_product_eval_retirement.sql +14 -0
  67. package/dist/dependencies.bun.lock +135 -128
  68. package/dist/guest.bundle.js +131 -185
  69. package/dist/owletto/dist/assets/_-CEPl6gU4.js +3 -0
  70. package/dist/owletto/dist/assets/_-C_zNZben.js +2 -0
  71. package/dist/owletto/dist/assets/_-DtqBFgK5.js +1 -0
  72. package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +2 -0
  73. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +2 -0
  74. package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +2 -0
  75. package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +2 -0
  76. package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +2 -0
  77. package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +2 -0
  78. package/dist/owletto/dist/assets/_deploymentId-BQfYN1U2.js +2 -0
  79. package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +2 -0
  80. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +2 -0
  81. package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +3 -0
  82. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +2 -0
  83. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +2 -0
  84. package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +2 -0
  85. package/dist/owletto/dist/assets/_threadId-DtqBFgK5.js +1 -0
  86. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +2 -0
  87. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +2 -0
  88. package/dist/owletto/dist/assets/accept-invitation-D3OgJG4i.js +2 -0
  89. package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +2 -0
  90. package/dist/owletto/dist/assets/agent-card-controls-DzRs4Ix9.js +2 -0
  91. package/dist/owletto/dist/assets/{agent-client-setup-list-BFtgRwe8.js → agent-client-setup-list-B2SvH7xD.js} +4 -3
  92. package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +2 -0
  93. package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +2 -0
  94. package/dist/owletto/dist/assets/agent-guardrails-route-BaV1VpDh.js +2 -0
  95. package/dist/owletto/dist/assets/agent-loading-shells-CtZJM2Gc.js +2 -0
  96. package/dist/owletto/dist/assets/agent-permissions-matrix-Ds48KFK9.js +2 -0
  97. package/dist/owletto/dist/assets/{agent-skill-context-BAr2Dw3F.js → agent-skill-context-DPk5r08w.js} +2 -1
  98. package/dist/owletto/dist/assets/agent-skills-route-DYpB5H1J.js +2 -0
  99. package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +2 -0
  100. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +6 -0
  101. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +2 -0
  102. package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +2 -0
  103. package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +128 -0
  104. package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +2 -0
  105. package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +2 -0
  106. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +2 -0
  107. package/dist/owletto/dist/assets/{callback-CaRe2TOT.js → callback-CU-hb8JB.js} +2 -1
  108. package/dist/owletto/dist/assets/{card-CMmh2mzo.js → card-DIF8SF9b.js} +2 -1
  109. package/dist/owletto/dist/assets/claim-DELEa-gH.js +2 -0
  110. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +1 -0
  111. package/dist/owletto/dist/assets/clients-CpG676mg.js +2 -0
  112. package/dist/owletto/dist/assets/code-editor-V27Z4o3P.js +16 -0
  113. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +2 -0
  114. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +2 -0
  115. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +2 -0
  116. package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +2 -0
  117. package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +2 -0
  118. package/dist/owletto/dist/assets/connection-DySpRE9x.js +2 -0
  119. package/dist/owletto/dist/assets/connection-feed-detail-C_D68j6d.js +2 -0
  120. package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +1 -0
  121. package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +2 -0
  122. package/dist/owletto/dist/assets/{connector-provenance-BjKiUhYE.js → connector-provenance-CNXtzYg5.js} +2 -1
  123. package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +2 -0
  124. package/dist/owletto/dist/assets/{connectors-Baejya0T.js → connectors-BJnk1z_2.js} +2 -1
  125. package/dist/owletto/dist/assets/consent-BVzxrAO9.js +2 -0
  126. package/dist/owletto/dist/assets/conversations-table-DfZGICl7.js +2 -0
  127. package/dist/owletto/dist/assets/{core.esm-QA7BQgiK.js → core.esm-DiTpULFl.js} +2 -1
  128. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +2 -0
  129. package/dist/owletto/dist/assets/create-JRFM8mMf.js +2 -0
  130. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +3 -0
  131. package/dist/owletto/dist/assets/create-iHcxV0xd.js +2 -0
  132. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +2 -0
  133. package/dist/owletto/dist/assets/{cronstrue-2GHCtD7h.js → cronstrue-DPXl0qA2.js} +2 -1
  134. package/dist/owletto/dist/assets/deployments-DCQdFdwG.js +2 -0
  135. package/dist/owletto/dist/assets/{deployments-body-Bm2upStd.js → deployments-body-D6TAWs_6.js} +2 -1
  136. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +2 -0
  137. package/dist/owletto/dist/assets/device-CntqYW65.js +2 -0
  138. package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +2 -0
  139. package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +2 -0
  140. package/dist/owletto/dist/assets/{entity-options-CrbS6K-i.js → entity-options-UJs64GdQ.js} +2 -1
  141. package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +2 -0
  142. package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +2 -0
  143. package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +2 -0
  144. package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +2 -0
  145. package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +2 -0
  146. package/dist/owletto/dist/assets/full-page-spinner-KpV2FS2u.js +2 -0
  147. package/dist/owletto/dist/assets/guardrails-molekzAF.js +2 -0
  148. package/dist/owletto/dist/assets/identity-BJcaG66g.js +2 -0
  149. package/dist/owletto/dist/assets/index-B04ON9Jv.js +2 -0
  150. package/dist/owletto/dist/assets/index-BEvyBdOU.js +2 -0
  151. package/dist/owletto/dist/assets/{index-Cf0GJoiG.js → index-BJXkc60S.js} +2 -1
  152. package/dist/owletto/dist/assets/index-BLEcy9-T.css +1 -0
  153. package/dist/owletto/dist/assets/index-BNh2cidi.js +2 -0
  154. package/dist/owletto/dist/assets/index-BOsK-K-2.js +2 -0
  155. package/dist/owletto/dist/assets/{index-DlepU3cY.js → index-BOzuAbvi.js} +2 -1
  156. package/dist/owletto/dist/assets/index-Bk1x7A67.js +2 -0
  157. package/dist/owletto/dist/assets/index-CDz3-ieP.js +1 -0
  158. package/dist/owletto/dist/assets/index-CFnx5huL.js +2 -0
  159. package/dist/owletto/dist/assets/index-D3s8rhG9.js +2 -0
  160. package/dist/owletto/dist/assets/index-DCdkwg9H.js +2 -0
  161. package/dist/owletto/dist/assets/index-Dbd1jusf.js +2 -0
  162. package/dist/owletto/dist/assets/index-DqZuqC08.js +2 -0
  163. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +2 -0
  164. package/dist/owletto/dist/assets/index-DtqBFgK5.js +1 -0
  165. package/dist/owletto/dist/assets/index-KPOvMVa-.js +2 -0
  166. package/dist/owletto/dist/assets/index-Vcq4gwWv.js +1 -0
  167. package/dist/owletto/dist/assets/index-_oPeVpL_.js +7950 -0
  168. package/dist/owletto/dist/assets/index-rrnUF981.js +1 -0
  169. package/dist/owletto/dist/assets/json-diff-D_Ym3Uku.js +4 -0
  170. package/dist/owletto/dist/assets/{list-skeleton-BtWn2eo2.js → list-skeleton-Bl0OS39L.js} +2 -1
  171. package/dist/owletto/dist/assets/login-QHdxqX-4.js +2 -0
  172. package/dist/owletto/dist/assets/logout-DUccApuZ.js +2 -0
  173. package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +2 -0
  174. package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +103 -0
  175. package/dist/owletto/dist/assets/model-selector-CB1BDvlW.js +2 -0
  176. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +2 -0
  177. package/dist/owletto/dist/assets/new-B5UsLiy6.js +2 -0
  178. package/dist/owletto/dist/assets/new-BWo8_Pms.js +2 -0
  179. package/dist/owletto/dist/assets/new-DpmDXmFI.js +2 -0
  180. package/dist/owletto/dist/assets/oauth-workspace-access-PGyTnW2K.js +2 -0
  181. package/dist/owletto/dist/assets/organization-BH8PYlVu.js +2 -0
  182. package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +2 -0
  183. package/dist/owletto/dist/assets/{permissions-h_qSft1A.js → permissions-CwN_YP3u.js} +2 -1
  184. package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +2 -0
  185. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +2 -0
  186. package/dist/owletto/dist/assets/{recent-JiBNvZzD.js → recent-DqdZE_TI.js} +2 -1
  187. package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +2 -0
  188. package/dist/owletto/dist/assets/{renderer-DgPLyEbx.js → renderer-BL6VcwQH.js} +28 -27
  189. package/dist/owletto/dist/assets/reset-password-DAvBYkiI.js +2 -0
  190. package/dist/owletto/dist/assets/runs-BWtc5rmc.js +2 -0
  191. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +2 -0
  192. package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +2 -0
  193. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +2 -0
  194. package/dist/owletto/dist/assets/settings-Crxlwps-.js +2 -0
  195. package/dist/owletto/dist/assets/skill-editor-D_W3QlRz.js +1 -0
  196. package/dist/owletto/dist/assets/skills-D0X430X8.js +2 -0
  197. package/dist/owletto/dist/assets/source-record-panels-CRIPMWfN.js +2 -0
  198. package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +2 -0
  199. package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +2 -0
  200. package/dist/owletto/dist/assets/{use-mention-search-B4DfZFm5.js → use-mention-search-DqEykWl_.js} +3 -2
  201. package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +2 -0
  202. package/dist/owletto/dist/assets/workspace-label-o_QfBuCM.js +2 -0
  203. package/dist/owletto/dist/index.html +46 -4
  204. package/dist/providers.json +1 -1
  205. package/dist/server-main.bundle.mjs +135551 -132880
  206. package/npm-shrinkwrap.json +578 -611
  207. package/package.json +4 -3
  208. package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
  209. package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
  210. package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
  211. package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
  212. package/vendor/connector-sdk/dist/connector-types.d.ts +159 -45
  213. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
  214. package/vendor/connector-sdk/dist/define-connector.js +3 -0
  215. package/vendor/connector-sdk/dist/index.d.ts +5 -2
  216. package/vendor/connector-sdk/dist/index.js +1 -0
  217. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
  218. package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
  219. package/vendor/connector-sdk/package.json +5 -1
  220. package/vendor/core/dist/agent-policy.js +1 -1
  221. package/vendor/core/dist/agent-store.d.ts +2 -0
  222. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  223. package/vendor/core/dist/agent-tooling.js +1 -1
  224. package/vendor/core/dist/capabilities.js +2 -0
  225. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
  226. package/vendor/core/dist/contracts/agent-settings.js +1 -7
  227. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
  228. package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
  229. package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
  230. package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
  231. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
  232. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
  233. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
  234. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
  235. package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
  236. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
  237. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
  238. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
  239. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
  240. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
  241. package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
  242. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
  243. package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
  244. package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
  245. package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
  246. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
  247. package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
  248. package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
  249. package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
  250. package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
  251. package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
  252. package/vendor/core/dist/contracts/worker/protocol.d.ts +122 -28
  253. package/vendor/core/dist/contracts/worker/protocol.js +81 -17
  254. package/vendor/core/dist/index.d.ts +3 -4
  255. package/vendor/core/dist/index.js +3 -6
  256. package/vendor/core/dist/json-template.d.ts +6 -10
  257. package/vendor/core/dist/json-template.js +5 -9
  258. package/vendor/core/dist/logger.js +11 -5
  259. package/vendor/core/dist/shell-safety.d.ts +9 -0
  260. package/vendor/core/dist/shell-safety.js +154 -0
  261. package/vendor/core/dist/suggestions.d.ts +1 -1
  262. package/vendor/core/dist/suggestions.js +1 -1
  263. package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
  264. package/vendor/core/dist/tool-trace-summary.js +1 -1
  265. package/vendor/core/dist/types.d.ts +1 -3
  266. package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
  267. package/vendor/core/dist/utils/{sentry-scrubber.js → diagnostic-scrubber.js} +25 -53
  268. package/vendor/core/dist/worker/auth.d.ts +44 -6
  269. package/vendor/core/dist/worker/auth.js +44 -11
  270. package/vendor/core/package.json +15 -6
  271. package/vendor/views/dist/api.d.ts +39 -29
  272. package/vendor/views/dist/api.js +110 -83
  273. package/vendor/views/dist/bridge.d.ts +4 -0
  274. package/vendor/views/dist/bridge.js +15 -0
  275. package/vendor/views/dist/index.d.ts +1 -0
  276. package/vendor/views/dist/index.js +0 -7
  277. package/vendor/views/package.json +4 -1
  278. package/dist/owletto/dist/assets/_-CLhipgJI.js +0 -1
  279. package/dist/owletto/dist/assets/_-D0ZVGAIA.js +0 -2
  280. package/dist/owletto/dist/assets/_agentId-BLXUf3ot.js +0 -1
  281. package/dist/owletto/dist/assets/_agentId-DnI66MF3.js +0 -1
  282. package/dist/owletto/dist/assets/_automationId-ziwseLb7.js +0 -1
  283. package/dist/owletto/dist/assets/_connectorKey._connectionId-B6V3ySFK.js +0 -1
  284. package/dist/owletto/dist/assets/_connectorKey.index-CR5u_dtt.js +0 -1
  285. package/dist/owletto/dist/assets/_conversationId-FBMYmOl8.js +0 -1
  286. package/dist/owletto/dist/assets/_deploymentId-DNTXbT_m.js +0 -1
  287. package/dist/owletto/dist/assets/_name-B37LKIxH.js +0 -1
  288. package/dist/owletto/dist/assets/_owner-BxYumqC2.js +0 -1
  289. package/dist/owletto/dist/assets/_shape-Bxz-04jR.js +0 -1
  290. package/dist/owletto/dist/assets/_skillKey-D5MFbiw2.js +0 -1
  291. package/dist/owletto/dist/assets/_slug-Dlhit09k.js +0 -1
  292. package/dist/owletto/dist/assets/_viewKey-C6535i-t.js +0 -1
  293. package/dist/owletto/dist/assets/_viewKey-CQCtY3Y8.js +0 -1
  294. package/dist/owletto/dist/assets/_viewKey-CxKfKbRa.js +0 -1
  295. package/dist/owletto/dist/assets/accept-invitation-BQQwec3R.js +0 -1
  296. package/dist/owletto/dist/assets/activity-route-view-BwThvdGs.js +0 -1
  297. package/dist/owletto/dist/assets/agent-card-controls-B3RhzsPz.js +0 -1
  298. package/dist/owletto/dist/assets/agent-connect-pages-BO4wQn4L.js +0 -1
  299. package/dist/owletto/dist/assets/agent-editor-form-BYC4uSNz.js +0 -1
  300. package/dist/owletto/dist/assets/agent-guardrails-route-Dp02G1AQ.js +0 -1
  301. package/dist/owletto/dist/assets/agent-loading-shells-OagauQzV.js +0 -1
  302. package/dist/owletto/dist/assets/agent-permissions-matrix-B9Ho3P1t.js +0 -1
  303. package/dist/owletto/dist/assets/agent-skills-route-B4VUnVi0.js +0 -1
  304. package/dist/owletto/dist/assets/agent-subpage-shell-Dz8I-GUt.js +0 -1
  305. package/dist/owletto/dist/assets/agent-thread-B9-cdkaV.js +0 -8
  306. package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -1
  307. package/dist/owletto/dist/assets/agents-D0CIg4b9.js +0 -1
  308. package/dist/owletto/dist/assets/agents-workbench-C2sr5h82.js +0 -1
  309. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +0 -127
  310. package/dist/owletto/dist/assets/app._appId-DLsJ_QWS.js +0 -1
  311. package/dist/owletto/dist/assets/automation-detail-content-9Rjb_I9j.js +0 -1
  312. package/dist/owletto/dist/assets/automations-D0CIg4b9.js +0 -1
  313. package/dist/owletto/dist/assets/calendar-DAiyi1ZL.js +0 -1
  314. package/dist/owletto/dist/assets/claim-CYHnUF7G.js +0 -1
  315. package/dist/owletto/dist/assets/clients-Cp1BJ28u.js +0 -1
  316. package/dist/owletto/dist/assets/code-editor-CYsR2VBP.js +0 -15
  317. package/dist/owletto/dist/assets/connect-CZip2g_B.js +0 -1
  318. package/dist/owletto/dist/assets/connect._clientId-CEKY8Dnv.js +0 -1
  319. package/dist/owletto/dist/assets/connected._clientId-C5xRjxNO.js +0 -1
  320. package/dist/owletto/dist/assets/connection-C06HZ241.js +0 -1
  321. package/dist/owletto/dist/assets/connection-feed-detail-D1whY5hL.js +0 -1
  322. package/dist/owletto/dist/assets/consent-CfYDldcF.js +0 -1
  323. package/dist/owletto/dist/assets/create-C3P-3_8O.js +0 -1
  324. package/dist/owletto/dist/assets/create-CwnrPUEw.js +0 -1
  325. package/dist/owletto/dist/assets/create-DOScS9Gl.js +0 -1
  326. package/dist/owletto/dist/assets/create-automation-form-CuxiIRCF.js +0 -2
  327. package/dist/owletto/dist/assets/create._connectorKey-Bjv3lCf8.js +0 -1
  328. package/dist/owletto/dist/assets/deployments-ByBv1DW-.js +0 -1
  329. package/dist/owletto/dist/assets/deployments-C-_ECORv.js +0 -1
  330. package/dist/owletto/dist/assets/device-B0i7Xp8y.js +0 -1
  331. package/dist/owletto/dist/assets/device-automation-BIjs7DZJ.js +0 -1
  332. package/dist/owletto/dist/assets/device-pin-tombstone-Bd6vS2zu.js +0 -1
  333. package/dist/owletto/dist/assets/device-rows-Bwf8qDte.js +0 -1
  334. package/dist/owletto/dist/assets/device._deviceId-DJLAesm3.js +0 -1
  335. package/dist/owletto/dist/assets/entity-page-ijZe_1-6.js +0 -1
  336. package/dist/owletto/dist/assets/entity-type-page-onp2Tk_E.js +0 -1
  337. package/dist/owletto/dist/assets/event-page-C0B2UDY-.js +0 -1
  338. package/dist/owletto/dist/assets/events-feed-DK35T4g7.js +0 -1
  339. package/dist/owletto/dist/assets/full-page-spinner-Dd8eEaxq.js +0 -1
  340. package/dist/owletto/dist/assets/guardrails-DKO8_J-G.js +0 -1
  341. package/dist/owletto/dist/assets/identity-CKM54vrM.js +0 -1
  342. package/dist/owletto/dist/assets/index--VmN5WxW.js +0 -1
  343. package/dist/owletto/dist/assets/index-B2AmRqYh.js +0 -7898
  344. package/dist/owletto/dist/assets/index-B_rcEgFX.js +0 -1
  345. package/dist/owletto/dist/assets/index-BmAuAhub.css +0 -1
  346. package/dist/owletto/dist/assets/index-BmhGe6-Z.js +0 -1
  347. package/dist/owletto/dist/assets/index-C1dJSGrL.js +0 -1
  348. package/dist/owletto/dist/assets/index-CAFw4qCb.js +0 -1
  349. package/dist/owletto/dist/assets/index-CCcc_xBw.js +0 -52
  350. package/dist/owletto/dist/assets/index-CLU3gXVm.js +0 -1
  351. package/dist/owletto/dist/assets/index-CqQVnAY-.js +0 -1
  352. package/dist/owletto/dist/assets/index-CxT0uyIe.js +0 -1
  353. package/dist/owletto/dist/assets/index-DR08e6Ec.js +0 -1
  354. package/dist/owletto/dist/assets/index-DYb9L5FC.js +0 -1
  355. package/dist/owletto/dist/assets/index-SUUcQGT-.js +0 -1
  356. package/dist/owletto/dist/assets/index-SdiFOfR1.js +0 -1
  357. package/dist/owletto/dist/assets/index-zcfi5r1l.js +0 -1
  358. package/dist/owletto/dist/assets/json-diff-ClBBYBQD.js +0 -3
  359. package/dist/owletto/dist/assets/login-d3PdO-qV.js +0 -1
  360. package/dist/owletto/dist/assets/logout-DgckxwLn.js +0 -1
  361. package/dist/owletto/dist/assets/member-scope-gate-DXOCfx-v.js +0 -1
  362. package/dist/owletto/dist/assets/memory-browse-page-CeAnKoTR.js +0 -101
  363. package/dist/owletto/dist/assets/missing-view-DrZ8m8yo.js +0 -1
  364. package/dist/owletto/dist/assets/model-selector-CapL1ARf.js +0 -1
  365. package/dist/owletto/dist/assets/models-CB8mhq7j.js +0 -1
  366. package/dist/owletto/dist/assets/new-BBUb-VR4.js +0 -1
  367. package/dist/owletto/dist/assets/new-CBLJ25_w.js +0 -1
  368. package/dist/owletto/dist/assets/new-tTXB4qBW.js +0 -1
  369. package/dist/owletto/dist/assets/oauth-workspace-access-DearynqZ.js +0 -1
  370. package/dist/owletto/dist/assets/organization-BgdBg-PJ.js +0 -1
  371. package/dist/owletto/dist/assets/pending-seed-CPbfgnLX.js +0 -1
  372. package/dist/owletto/dist/assets/proposal-review-shell-D4YNrrye.js +0 -1
  373. package/dist/owletto/dist/assets/reset-password-B8tWPtIj.js +0 -1
  374. package/dist/owletto/dist/assets/runs-oHveuEUB.js +0 -1
  375. package/dist/owletto/dist/assets/runs-panel-C56GDaJm.js +0 -1
  376. package/dist/owletto/dist/assets/runs-table-BUKDjiBc.js +0 -1
  377. package/dist/owletto/dist/assets/schema-value-normalization-3JuM_r1H.js +0 -1
  378. package/dist/owletto/dist/assets/settings-DaKg6U5O.js +0 -1
  379. package/dist/owletto/dist/assets/settings-DhnRi2nq.js +0 -1
  380. package/dist/owletto/dist/assets/skills-BpQncuMC.js +0 -1
  381. package/dist/owletto/dist/assets/switch-BQ40_DMb.js +0 -1
  382. package/dist/owletto/dist/assets/use-applied-views-B-Z-Weji.js +0 -1
  383. package/dist/owletto/dist/assets/view-frame-C7ciEoLo.js +0 -1
  384. package/vendor/core/dist/sentry.d.ts +0 -26
  385. package/vendor/core/dist/sentry.js +0 -133
  386. package/vendor/core/dist/tool-policy.d.ts +0 -74
  387. package/vendor/core/dist/tool-policy.js +0 -305
  388. package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
@@ -1 +0,0 @@
1
- import{r as v,j as e,L as K,dj as De,dE as _e,cy as Me,bZ as Fe,e7 as we,e8 as Le,aj as ze,ac as qe,e9 as Be,o as Ve,Z as Ue,aA as me,am as He,t as Je,ab as Z,z as We,cp as Qe,cq as Ke,B as w,ct as Ze,cM as Ge,cN as Ye,E as ke,cO as Xe,ea as Ce,eb as le,cs as de,ec as et,af as tt,q as ee,D as Se,ed as nt,ee as st,n as X,ef as rt,eg as it,cb as at,eh as ot,bC as lt,cf as dt,dL as ct,ei as ut,ej as mt,aL as pt,ek as xt,X as ht,bM as gt,s as ft,p as yt,d7 as jt,d8 as vt,df as Nt,dg as bt,el as _t,em as wt,S as kt,c7 as Ct,bk as St,I as Rt,c_ as fe,d0 as ye,aT as At,d1 as je,x as Re,en as Ae,eo as Et}from"./index-B2AmRqYh.js";import{u as Ee}from"./use-applied-views-B-Z-Weji.js";import{u as Tt}from"./clients-Cp1BJ28u.js";import{J as $t}from"./renderer-DgPLyEbx.js";function Pt({onIntersect:n,enabled:t,rootMargin:s="400px"}){const r=v.useRef(null),i=v.useRef(n);return i.current=n,v.useEffect(()=>{const d=r.current;if(!d||!t)return;const c=new IntersectionObserver(a=>{a[0]?.isIntersecting&&i.current()},{rootMargin:s});return c.observe(d),()=>c.disconnect()},[t,s]),r}function Ot(n,t){const s=t.parentEntityType&&t.parentEntitySlug?[{entity_type:t.parentEntityType,slug:t.parentEntitySlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}];return _e(n,s)}function It({ownerSlug:n,entity:t,className:s}){const r=Ot(n,t);return e.jsxs(K,{to:r,className:`flex items-center gap-1 text-primary hover:underline group ${s??""}`,children:[e.jsx("span",{className:"font-medium",children:t.entityName}),e.jsx(De,{className:"h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function Te(n,t,s){return{queryKey:["event-view-match",n,t.key,t.content_hash,s],queryFn:async()=>{try{return await Me("open_view",{key:t.key,scope:{event:s}},{slug:n}),!0}catch(r){if(r instanceof Fe&&(r.status===400||r.status===404))return!1;throw r}},staleTime:6e4}}function gn(n,t){const s=Ee(n??{slug:null,organizationId:null}),r=n?.slug??null,i=v.useMemo(()=>r?we(s.data??[]):[],[r,s.data]),d=Le({queries:i.map(c=>Te(r,c,t))});return r?{views:i.filter((c,a)=>d[a]?.data===!0),isLoading:s.data===void 0?!s.isError:d.some(c=>c.isPending),isError:s.isError||d.some(c=>c.isError),refetch:()=>{s.refetch();for(const c of d)c.isError&&c.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function Dt(n,t,s,r){const i=await Promise.all(s.map(d=>n.fetchQuery(Te(t,d,r))));return s.find((d,c)=>i[c])??null}async function Mt(n,t,s,r){const i=await ze(`${qe}/api/${encodeURIComponent(n)}/events/${t}/actions/${encodeURIComponent(s.action)}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:r})});return await Be(i,"Could not record interaction"),i.json()}function C(n){if(typeof n!="string")return;const t=n.trim();return t.length>0?t:void 0}function pe(n){return typeof n=="boolean"?n:void 0}function Ft(n,t,s){const r=(s??"").toLowerCase();return!!(r==="prepare_comment"||r==="verify_staged_comment"||r.includes("prepare_")||r.includes("verify_staged")||t?.prepared===!0||typeof t?.verified=="boolean"||C(t?.reason_preview)&&C(t?.message)||C(n?.body)&&(C(n?.post_url)||C(n?.activity_id)))}function Lt(n,t,s){if(!Ft(n,t,s))return null;const r=(s??"").toLowerCase(),i=C(t?.body)??C(n?.body),d=C(t?.reason_preview)??C(n?.reason),c=C(t?.post_url)??C(n?.post_url)??(C(n?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${C(n?.activity_id)}`:void 0),a=pe(t?.prepared),p=pe(t?.verified),m=pe(t?.banner_shown),g=C(t?.message),x=t?.match&&typeof t.match=="object"?t.match:null,S=C(x?.text_preview),l=C(x?.author);let h="generic";r==="verify_staged_comment"||r.includes("verify")||typeof p=="boolean"?h="verify":(r==="prepare_comment"||r.includes("prepare")||a===!0||i&&c)&&(h="prepare");const f=[];return a===!0&&f.push("Staged — not posted"),a===!1&&f.push("Not staged"),p===!0&&f.push("Verified posted"),p===!1&&f.push("Not verified as posted"),m===!0&&f.push("In-page banner"),m===!1&&f.push("No banner"),{kind:h,message:g,reason:d,body:i,postUrl:c,prepared:a,bannerShown:m,verified:p,matchPreview:S,matchAuthor:l,chips:f}}const zt={};function se(n){return n.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}const qt={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function Bt(n){return n.author_name?n.author_name:n.platform?se(n.platform):n.origin_type?qt[n.origin_type]??se(n.origin_type):null}function ve(n){return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?String(n):Array.isArray(n)?n.length===0?"":n.every(t=>typeof t!="object")?n.map(t=>String(t)).join(", "):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)}):e.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(n,null,2)})}const xe=1e5;function Vt({value:n}){const t=JSON.stringify(n,null,2)??"null",s=t.length>xe;return e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?t.slice(0,xe):t}),s&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",xe.toLocaleString()," of"," ",t.length.toLocaleString()," characters."]})]})}function Ut(n){return Object.entries(n).filter(([,t])=>t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:typeof t=="object"?Object.keys(t).length>0:!0).sort(([t],[s])=>t.localeCompare(s))}function Ht({breakdown:n}){if(!n)return null;const t=[{label:"Engagement",value:n.engagement,max:100},{label:"Criticality",value:n.criticality,max:100},{label:"Depth",value:n.depth,max:100},{label:"Authority",value:n.authority,max:100},{label:"Recency",value:n.recency,max:100},{label:"Quality",value:n.quality,max:100}];return e.jsx("div",{className:"space-y-2 text-sm",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),e.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function Jt({slug:n,value:t,isManual:s}){return e.jsxs(Z,{variant:"secondary",className:"text-xs",children:[n,": ",t,s&&e.jsx(Ce,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Wt(n){if(n&&typeof n=="object"){const t=n;if(Array.isArray(t.values))return{values:t.values.map(s=>String(s)).filter(s=>s.length>0),isManual:t.is_manual===!0};if(t.value!==void 0&&t.value!==null)return{values:[String(t.value)],isManual:t.is_manual===!0};if(typeof t.values=="string"&&t.values.length>0)return{values:[t.values],isManual:t.is_manual===!0}}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="bigint"?{values:[String(n)],isManual:!1}:{values:[],isManual:!1}}function Qt(n,t){if(n)switch(n){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return n}return t||"pending_approval"}function q(n){return!n||typeof n!="object"||Array.isArray(n)?null:n}function Ne(n){return n==null||n===""?"Not set":typeof n=="string"?n:JSON.stringify(n,null,2)}function Kt(n){return n.replace(/\s+[—-]\s+pending approval$/i,"")}function Y(n){return n.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}function $e(n,t,s){return n?.kind==="agent_session"&&n.agent_id?n.client_id?`${n.agent_id} via ${n.client_id}`:n.agent_id:n?.kind==="user"?"a person":t==="agent"?"an agent":s?`Automation ${s}`:"an Automation"}function Zt({initiator:n,clientName:t,fallback:s}){const{org:r}=ee(),i=r?.slug,d=n?.client_id??t,a=Tt(void 0,{enabled:!!(i&&d)}).data?.find(x=>x.id===d)?.title,p=n&&n.kind!=="user"?$e(n,void 0,n.automation_id===void 0?void 0:String(n.automation_id)):s,m="font-medium text-foreground",g=`${m} underline-offset-4 hover:underline`;return i&&n?.kind==="automation"&&n.automation_id?e.jsx(K,{to:"/$owner/automations/$automationId",params:{owner:i,automationId:String(n.automation_id)},search:{view:"definition",run_id:void 0},className:g,children:p}):i&&n?.kind==="agent_session"&&n.agent_id?e.jsx(K,{to:"/$owner/agents/$agentId",params:{owner:i,agentId:String(n.agent_id)},className:g,children:p}):i&&d?e.jsxs(K,{to:"/$owner/agents/connected/$clientId",params:{owner:i,clientId:d},className:`${g} inline-flex items-center gap-1 align-middle`,children:[e.jsx(gt,{name:a??t??d}),a??p]}):e.jsx("span",{className:m,children:p})}function Gt(n){const t=Object.keys(n.fields),s=t.map(Y).join(", ")||"field",r=t.length===1?"field":"fields";return`Update ${n.entityType?Y(n.entityType).toLowerCase():"entity"} ${r}: ${s}`}function Yt(n,t){const s=q(t.fields);if(!s||Object.keys(s).length===0||t.action_key!=="entity_field_change"&&t.tool!=="entity_field_change")return null;const r=q(t.current)??{},i=n;return{fields:s,current:r,reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??i.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function Xt(n){return!n||!Array.isArray(n.evidence)?[]:n.evidence.flatMap(t=>{const s=q(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]})}function be(n){return Array.isArray(n)?n.flatMap(t=>{const s=q(t),r=s?.kind,i=s?.identifier;return typeof r=="string"&&typeof i=="string"?[{kind:r,identifier:i}]:[]}):[]}function en(n){const t=q(n?.evidence_change);if(t&&!(!Array.isArray(t.dropped)||!Array.isArray(t.gained)))return{dropped:be(t.dropped),gained:be(t.gained)}}function z(n){return typeof n=="string"?n:void 0}function tn(n){const t=q(n.current),s=q(n.proposal),r=q(t?.winner),i=q(t?.loser),d=Array.isArray(t?.duplicates)?t.duplicates.map(q):[],a=(d.length>0?d:i?[i]:[]).flatMap(l=>{const h=z(l?.name),f=l?.id;return h&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:h,slug:z(l?.slug),entityType:z(l?.entity_type),parentSlug:z(l?.parent_slug),parentEntityType:z(l?.parent_entity_type)}]:[]}),p=Array.isArray(s?.entity_ids)?s.entity_ids:[],m=Array.isArray(s?.names)?s.names.flatMap((l,h)=>{const f=p[h];return typeof l=="string"&&(typeof f=="string"||typeof f=="number")?[{key:String(f),name:l}]:[]}):[],g=z(s?.name),x=s?.entity_id,S=a.length>0?a:m.length>0?m:g&&(typeof x=="string"||typeof x=="number")?[{key:String(x),name:g}]:[];return{winnerName:z(r?.name)??z(s?.winner_name),winnerSlug:z(r?.slug),winnerEntityType:z(r?.entity_type),winnerParentSlug:z(r?.parent_slug),winnerParentEntityType:z(r?.parent_entity_type),losers:S,matchEvidence:Xt(s),evidenceChange:en(s)}}function nn(n){const t=n.entityType?Y(n.entityType).toLowerCase():"entity";if(n.operation==="merge"){const s=n.merge?.losers??[];return s.length>1?`Merge ${s.length} duplicate ${t}s`:`Merge duplicate ${t}`}return`${Y(n.operation)} ${t}`}function sn(n,t){if(t.action_key!=="entity_change"&&t.tool!=="entity_change")return null;const s=t.action;if(s!=="create"&&s!=="delete"&&s!=="merge")return null;const r=n;return{operation:s,merge:s==="merge"?tn(t):void 0,proposal:q(t.proposal),current:q(t.current),reason:typeof t.reason=="string"?t.reason:void 0,automationId:t.automation_id!=null?String(t.automation_id):void 0,automationName:typeof t.automation_name=="string"?t.automation_name:void 0,automationAgentId:typeof t.automation_agent_id=="string"?t.automation_agent_id:void 0,entityType:typeof t.entity_type=="string"?t.entity_type:void 0,entityName:(typeof t.entity_name=="string"?t.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof t.entity_slug=="string"?t.entity_slug:void 0,parentSlug:typeof t.parent_slug=="string"?t.parent_slug:void 0,parentEntityType:typeof t.parent_entity_type=="string"?t.parent_entity_type:void 0,attribution:typeof t.attribution=="string"?t.attribution:void 0,proposerRationale:typeof t.proposer_rationale=="string"?t.proposer_rationale:void 0,initiator:t.initiator&&typeof t.initiator=="object"?t.initiator:void 0}}function he(n,t){return!n||!t.entityType||!t.entitySlug?null:_e(n,t.parentEntityType&&t.parentSlug?[{entity_type:t.parentEntityType,slug:t.parentSlug},{entity_type:t.entityType,slug:t.entitySlug}]:[{entity_type:t.entityType,slug:t.entitySlug}])}function Pe({runId:n,details:t}){const{org:s}=ee(),i=Se(t.automationId,void 0,s?.id,{includeVersions:!1}).data?.automation,d=$e(t.initiator,t.attribution,t.automationId),c=i?.automation_name??t.automationName??d,a=s?.slug;return e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",a&&t.automationId?e.jsx(K,{to:"/$owner/automations/$automationId",params:{owner:a,automationId:t.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:c}):e.jsx("span",{className:"font-medium text-foreground",children:c}),a&&n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" · "}),e.jsxs(K,{to:"/$owner/events",params:{owner:a},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",n]})]})]})}function Oe({details:n}){const{org:t}=ee(),s=he(t?.slug,n);return n.entityName?e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:s?e.jsx(K,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function Ie({label:n,before:t,after:s}){return e.jsxs("div",{className:"rounded-md border border-border/70 overflow-hidden",children:[e.jsx("div",{className:"border-b border-border/70 px-3 py-2 text-xs font-medium",children:n}),e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Current"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:Ne(t)})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposed"}),e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:Ne(s)})]})]})]})}function rn({runId:n,details:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx(Pe,{runId:n,details:t}),e.jsx(Oe,{details:t}),Object.entries(t.fields).map(([s,r])=>e.jsx(Ie,{label:Y(s),before:t.current[s],after:r},s)),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function an({merge:n,status:t}){const{org:s}=ee(),r=he(s?.slug,{entityType:n.winnerEntityType,entitySlug:n.winnerSlug,parentEntityType:n.winnerParentEntityType,parentSlug:n.winnerParentSlug}),i=n.losers.length,d=t==="rejected"||t==="failed",c=t==="completed";return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-lg border border-border/70 overflow-hidden",children:e.jsxs("div",{className:"grid gap-px bg-border/70 sm:grid-cols-2",children:[e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?"Would have kept":"Kept"}),e.jsx("div",{className:"text-sm font-medium leading-relaxed",children:n.winnerName?r?e.jsx(K,{to:r,className:"underline-offset-4 hover:underline",children:n.winnerName}):n.winnerName:e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]}),e.jsxs("div",{className:"bg-background p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d?i>1?`Kept separate (${i})`:"Kept separate":c?i>1?`Merged away (${i})`:"Merged away":i>1?`To merge away (${i})`:"To merge away"}),e.jsx("div",{className:"space-y-0.5 text-sm leading-relaxed",children:i>0?n.losers.map(a=>{const p=he(s?.slug,{entityType:a.entityType,entitySlug:a.slug,parentEntityType:a.parentEntityType,parentSlug:a.parentSlug}),m=c?"line-through decoration-muted-foreground/60":"";return e.jsx("div",{className:"break-words",children:p?e.jsx(K,{to:p,className:`${m} underline-offset-4 hover:underline`,children:a.name}):e.jsx("span",{className:m,children:a.name})},a.key)}):e.jsx("span",{className:"text-muted-foreground",children:"Unknown"})})]})]})}),n.evidenceChange&&e.jsxs("div",{className:n.evidenceChange.dropped.length>0?"rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2":"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.evidenceChange.dropped.length>0?"What changed since you reviewed this":"Evidence re-checked"}),e.jsxs("div",{className:"mt-1.5 flex flex-col gap-1",children:[n.evidenceChange.dropped.map(a=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-amber-700 dark:text-amber-400",children:"No longer proven"}),Y(a.kind),": ",a.identifier]},`dropped-${a.kind}:${a.identifier}`)),n.evidenceChange.gained.map(a=>e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"mr-1.5 font-medium text-emerald-700 dark:text-emerald-400",children:"Newly proven"}),Y(a.kind),": ",a.identifier]},`gained-${a.kind}:${a.identifier}`)),n.evidenceChange.dropped.length===0&&n.evidenceChange.gained.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"The recorded match evidence did not change."})]})]}),n.matchEvidence.length>0&&e.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Match evidence"}),e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:n.matchEvidence.map(a=>e.jsxs(Z,{variant:"outline",className:"text-[10px] font-normal",children:[Y(a.kind),": ",a.identifier]},`${a.kind}:${a.identifier}`))})]})]})}function on({runId:n,details:t,status:s}){const r=t.operation==="merge";return e.jsxs("div",{className:"space-y-3",children:[e.jsx(Pe,{runId:n,details:t}),r&&t.merge?e.jsx(an,{merge:t.merge,status:s}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{details:t}),e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Change"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.operation==="create"?"Create a new entity after approval.":"Delete this entity after approval."})]})]}),!r&&t.proposal&&e.jsxs("div",{className:"rounded-md border border-border/70 p-3",children:[e.jsx("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Proposal"}),e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(t.proposal,null,2)})]}),t.proposerRationale&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.proposerRationale})]}),t.reason&&e.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:r?"Why this needs approval":"Reasoning"}),e.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:t.reason})]})]})}function ln({summary:n}){return e.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[n.chips.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.chips.map(t=>e.jsx(Z,{variant:"outline",className:"text-[10px] font-normal",children:t},t))}),n.message&&e.jsx("p",{className:"leading-relaxed text-foreground",children:n.message}),n.reason&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),e.jsx("div",{className:"mt-0.5 leading-relaxed",children:n.reason})]}),n.body&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:n.kind==="verify"?"Expected comment":"Draft"}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:n.body})]}),n.matchPreview&&e.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[e.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",n.matchAuthor?` · ${n.matchAuthor}`:""]}),e.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:n.matchPreview})]}),n.postUrl&&e.jsxs("a",{href:n.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",e.jsx(ke,{className:"h-3 w-3"})]})]})}function dn({content:n}){const t=n.metadata||{},s=n.run_id??void 0,r=Yt(n,t),i=sn(n,t),d=(r?Gt(r):i?nn(i):void 0)||t.operation_name||t.action_name||(n.title?Kt(n.title):void 0)||"Action",c=t.connection_name,a=t.operation_key||t.action_key||null,p=n.interaction_input_schema||t.input_schema||null,m=v.useMemo(()=>n.interaction_input||t.action_input||t.operation_input||zt,[n.interaction_input,t.action_input,t.operation_input]),g=n.interaction_output||t.action_output||void 0,x=Lt(m,g??null,a),S=n.interaction_error||t.error_message||void 0,l=Qt(n.interaction_status,t.status),h=t.reviewed_by_name||t.reviewed_by_id||void 0,f=t.reject_reason||void 0,N=t.initiator,E=rt(),R=it(),O=at(n.id,ot(p,m),p),{values:I,setValues:U}=O,[k,H]=v.useState(null),[D,M]=v.useState(!1),[B,u]=v.useState(""),T=l==="pending_approval",J=typeof t.source_run_id=="number";return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lt,{className:"h-4 w-4 text-yellow-500"}),e.jsx("span",{className:"font-medium",children:d}),c&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",c]}),l==="confirmed"&&e.jsxs(Z,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:[e.jsx(X,{size:"xs",className:"mr-1"}),"Executing"]}),l==="completed"&&e.jsx(Z,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),l==="failed"&&e.jsx(Z,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),l==="rejected"&&e.jsx(Z,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!r&&!i&&(n.author_name||h)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&e.jsxs("span",{children:["Requested by"," ",e.jsx(Zt,{initiator:N,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&h&&e.jsx("span",{children:"·"}),h&&e.jsxs("span",{children:[l==="rejected"?"Rejected":"Approved"," by"," ",e.jsx("span",{className:"font-medium text-foreground",children:h})]})]}),r&&e.jsx(rn,{runId:s,details:r}),!r&&i&&e.jsx(on,{runId:s,details:i,status:l}),l==="rejected"&&f&&e.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",f]}),x&&e.jsx(ln,{summary:x}),(T?O.revision:p)&&(T||Object.keys(m).length>0)&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:x?"Full input":"Input"}),T?e.jsxs(e.Fragment,{children:[e.jsx(dt,{visible:O.hasConflict,onReload:O.reset}),e.jsx(ct,{schema:O.revision,values:I,onValuesChange:U,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):x?e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),e.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}):e.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(m,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&!x&&e.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[e.jsx(ut,{className:"h-3.5 w-3.5"}),"Output"]}),e.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(g,null,2)})]}),l==="completed"&&g&&Object.keys(g).length>0&&x&&e.jsxs("details",{className:"text-xs",children:[e.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),e.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(g,null,2)})]}),l==="failed"&&S&&e.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[e.jsx(mt,{className:"h-3.5 w-3.5"}),"Error"]}),e.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:S})]}),k==="confirmed"&&e.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-blue-700 dark:text-blue-400 font-medium",children:[e.jsx(X,{size:"md"}),"Confirmed — executing..."]}),e.jsx("p",{className:"text-xs text-blue-800 dark:text-blue-300 mt-1",children:"The worker will execute this action shortly. Redirecting..."})]}),k==="rejected"&&e.jsx(Z,{variant:"outline",className:"text-muted-foreground text-xs",children:"Rejected — redirecting..."}),T&&!k&&J&&e.jsx("div",{className:"pt-1 text-xs text-muted-foreground",children:"Part of an Automation run — approve or reject it from the run's change-set above."}),T&&s&&!k&&!J&&e.jsx("div",{className:"flex items-center gap-2 pt-1",children:D?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"Reason (optional)",value:B,onChange:te=>u(te.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(w,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>R.mutate({run_id:s,reason:B||void 0},{onSuccess:()=>{H("rejected")}}),disabled:R.isPending,children:[R.isPending&&e.jsx(X,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{M(!1),u("")},children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(w,{size:"sm",className:"h-7 text-xs",onClick:()=>E.mutate({run_id:s,input:xt(I)},{onSuccess:()=>{H("confirmed")}}),disabled:!O.canSubmit||E.isPending||R.isPending,children:[E.isPending?e.jsx(X,{size:"sm",className:"mr-1"}):e.jsx(pt,{className:"h-3 w-3 mr-1"}),"Confirm"]}),e.jsxs(w,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>M(!0),disabled:E.isPending||R.isPending,children:[e.jsx(ht,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function cn({content:n}){const t=n.metadata||{},s=t.kind,r=n.run_id??null,i=typeof t.automation_id=="number"?t.automation_id:null,{org:d}=ee(),c=d?.slug,m=Se(i!=null?String(i):void 0,void 0,d?.id,{includeVersions:!1}).data?.automation?.automation_name??(i!=null?`Automation ${i}`:"An Automation"),g=nt(),x=st(),[S,l]=v.useState(!1),[h,f]=v.useState(""),[N,E]=v.useState(null);if(s==="automation_batch_reject"){const u=t.reason||void 0;return e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),u&&e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:u}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const R=Array.isArray(t.changes)?t.changes:[],O=typeof t.created_count=="number"?t.created_count:R.filter(u=>u.kind==="created").length,I=typeof t.updated_count=="number"?t.updated_count:R.filter(u=>u.kind==="updated").length,U=typeof t.denied_count=="number"?t.denied_count:R.filter(u=>u.kind==="denied").length,k=R.filter(u=>u.kind==="denied"),H=R.filter(u=>u.kind==="updated"&&Object.keys(u.applied||{}).length>0),D=typeof t.pending_proposal_count=="number"?t.pending_proposal_count:null,M=D==null||D>0,B=M?"proposed":"applied";return e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[e.jsxs("div",{className:"text-sm font-medium",children:[B==="proposed"?"Proposed":"Applied"," ",O," ","new + ",I," updated",U>0&&e.jsxs(e.Fragment,{children:[" + ",U," denied"]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[c&&i!=null?e.jsx(K,{to:"/$owner/automations/$automationId",params:{owner:c,automationId:String(i)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:m}):e.jsx("span",{className:"font-medium text-foreground",children:m}),r!=null&&e.jsxs("span",{children:[" · run #",r]}),D!=null&&D>0&&e.jsxs("span",{children:[" · ",D," pending"]})]})]}),H.length>0&&e.jsx("div",{className:"mt-3 space-y-2",children:H.map(u=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:u.name}),Object.entries(u.applied).map(([T,J])=>e.jsx(Ie,{label:T,before:J.old,after:J.new},T))]},u.entityId))}),k.length>0&&e.jsx("div",{className:"mt-3 space-y-1.5",children:k.map(u=>e.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[e.jsxs("div",{className:"text-xs font-medium",children:[u.name," — not written"]}),u.denied&&e.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[u.denied.reason,e.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",u.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${u.entityId}-${u.name}`))}),r!=null&&N==null&&M&&e.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:S?e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("input",{type:"text",placeholder:"What should the agent change?",value:h,onChange:u=>f(u.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),e.jsxs(w,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>x.mutate({run_id:r,reason:h||void 0},{onSuccess:()=>E("rejected")}),disabled:x.isPending,children:[x.isPending&&e.jsx(X,{size:"sm",className:"mr-1"}),"Reject all"]}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{l(!1),f("")},children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(w,{size:"sm",className:"h-7 text-xs",onClick:()=>g.mutate({run_id:r},{onSuccess:()=>E("approved")}),disabled:g.isPending||x.isPending,children:[g.isPending&&e.jsx(X,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),e.jsx(w,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>l(!0),disabled:g.isPending||x.isPending,children:"Reject with feedback"})]})}),N==="approved"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),N==="rejected"&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&N==null&&!M&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function oe({ownerSlug:n,content:t,isReply:s,showParentContext:r,connectorDefinitions:i}){const[d,c]=v.useState(!1),[a,p]=v.useState(!1),m=Ve(),{currentOwner:g,allOrgs:x,isAuthenticated:S}=Ue(),l=n??g,h=l==="me"?null:l,f=v.useCallback(async o=>{if(!h){me.error("Open this event inside a workspace to interact with it.");return}try{await Mt(h,Number(t.id),o,crypto.randomUUID()),me.success("Recorded")}catch(y){me.error(y instanceof Error?y.message:"Could not record that interaction.")}},[t.id,h]),N=t.payload_data??{},E=t.semantic_type==="audit"&&t.origin_type==="tool_invocation",R=E&&(N.request!==void 0||N.request_status==="too_large"),I=E&&N.request_status==="complete"&&l?`/${l}/events?content_ids=${t.id}`:!l||l==="me"?null:t.run_id!=null?`/${l}/events?run_ids=${t.run_id}`:null,U=S?(x??[]).find(o=>o.slug===h):void 0,k=U?{slug:U.slug,organizationId:U.id}:null,H=Ee(k??{slug:null,organizationId:null}),D=k?.slug??null,M=v.useMemo(()=>D&&!E?we(H.data??[],t.semantic_type):[],[D,E,H.data,t.semantic_type]),B=He(),u=!!(m&&k&&M.length>0),T=h&&t.run_id!=null?`/${h}/events?run_ids=${t.run_id}`:null,J=u||!!(m&&I&&Je(I)),te=()=>{!m||!T||m.open({href:T,title:t.title??`Run #${t.run_id}`,runId:t.run_id??void 0})},re=()=>{if(u&&m&&k&&h){const o=Number(t.id);Dt(B,k.slug,M,o).catch(()=>null).then(y=>m.open({href:ft(h,o,y?.key),title:t.title??"Event"}));return}!m||!I||m.open({href:I,title:t.title??(t.run_id!=null?`Run #${t.run_id}`:"Event"),runId:t.run_id??void 0})},ie=o=>{const y=o.target;if(!(y instanceof Element))return!1;const V=y.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return V!==null&&V!==o.currentTarget},ce=o=>{ie(o)||re()},ue=o=>{o.key!=="Enter"&&o.key!==" "||ie(o)||(o.preventDefault(),re())},G=t.metadata||{};if(t.semantic_type==="change_set")return e.jsx(cn,{content:t});if(t.interaction_type==="approval"||t.semantic_type==="operation")return e.jsx(dn,{content:t});const b=Number.isFinite(t.score)?Math.round(t.score):"-",j=t.payload_type||"text",$=t.text_content||"",P=(j==="text"||j==="markdown")&&$.length>500,_=P&&!d?`${$.slice(0,500)}...`:$,W=G.thumbnail_url||G.thumbnail,F=G.media_url,Q=Ut(G),ne=Object.entries(t.classifications||{}).flatMap(([o,y])=>{const V=Wt(y);return V.values.map(L=>({slug:o,value:L,isManual:V.isManual}))}),ae=(()=>{const o=t.metadata??{},y=t.platform||(typeof o.platform=="string"?o.platform:null),V=t.connection_id!=null?t.connection_id:o.source_connection_id!=null?Number(o.source_connection_id):null;return{...t,platform:y,connection_id:V!=null&&Number.isFinite(V)?V:null}})();return e.jsxs("div",{className:tt(s?"border-l-2 border-l-muted pl-4":"",J&&"-mx-2 cursor-pointer rounded-lg px-2 py-1 transition-colors hover:bg-accent/40"),...J?{role:"button",tabIndex:0,onClick:ce,onKeyDown:ue}:{},children:[r&&t.parent_context&&e.jsxs("div",{className:"mb-3 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Replying to:"}),e.jsx("div",{className:"font-medium",children:t.parent_context.author_name}),e.jsx("div",{className:"text-muted-foreground line-clamp-2",children:t.parent_context.text_content})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[t.title&&e.jsx("h4",{className:"font-medium line-clamp-2 mb-1",children:t.title}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:(()=>{const o=Bt(t),y=!!t.platform&&o!==se(t.platform);return e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:"font-medium",children:o}),y&&e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{children:"·"}),e.jsx(Z,{variant:"outline",className:"text-xs",children:t.platform})]})]})})()}),l?e.jsx(We,{owner:l,source:ae,connectorDefinitions:i,className:"mt-0.5 text-xs"}):null]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.score_breakdown?e.jsxs(Qe,{children:[e.jsx(Ke,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"sm",className:"h-7 px-2",children:e.jsx("span",{className:"font-medium",children:b})})}),e.jsx(Ze,{className:"w-64",align:"end",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),e.jsx(Ht,{breakdown:t.score_breakdown})]})})]}):e.jsx(w,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!0,children:e.jsx("span",{className:"font-medium",children:b})}),u&&T&&e.jsx(w,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs","data-testid":"event-card-open-run",onClick:te,children:"Open run"}),t.source_url&&e.jsxs(Ge,{children:[e.jsx(Ye,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-7 w-7",asChild:!0,children:e.jsx("a",{href:t.source_url,target:"_blank",rel:"noopener noreferrer",children:e.jsx(ke,{className:"h-3.5 w-3.5"})})})}),e.jsx(Xe,{children:"View original"})]})]})]}),t.rating&&e.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(o=>e.jsx(Ce,{className:`h-4 w-4 ${o<=Number(t.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},o))}),W&&e.jsx("a",{href:F||t.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:e.jsx("img",{src:W,alt:"",className:`rounded-md object-cover ${j==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(j){case"markdown":if(_)return e.jsx("div",{className:"max-w-none text-sm space-y-2",children:e.jsx(et,{text:_})});break;case"json_template":{const o=t.payload_template;if(o?.root)return e.jsx($t,{template:{root:o.root},data:t.payload_data||{},onAction:f,interactions:o.interactions});if(_)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:_});break}case"media":return e.jsxs("div",{className:"space-y-3",children:[!W&&F&&e.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:F}),_&&e.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:_})]});case"empty":return e.jsxs("div",{className:"space-y-3",children:[R&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(w,{variant:"outline",size:"sm","aria-expanded":a,onClick:()=>p(o=>!o),children:[a?e.jsx(le,{className:"h-3.5 w-3.5"}):e.jsx(de,{className:"h-3.5 w-3.5"}),"Request"]}),a&&(N.request_status==="too_large"?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof N.request_bytes=="number"?` (${N.request_bytes.toLocaleString()} bytes).`:"."]}):e.jsx(Vt,{value:N.request}))]}),Q.length>0?e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:Q.map(([o,y])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(o)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:ve(y)})]},o))}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"})]});default:if(_)return e.jsx("div",{className:"text-sm whitespace-pre-wrap",children:_});break}return e.jsxs("div",{className:"space-y-3",children:[F&&!W&&e.jsx("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:F}),Q.length>0&&e.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:Q.map(([o,y])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:se(o)}),e.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:ve(y)})]},o))})]})})(),P&&e.jsx(w,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>c(!d),children:d?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3 w-3 mr-1"})," Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-3 w-3 mr-1"})," Show more"]})}),ne.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:ne.map(o=>e.jsx(Jt,{slug:o.slug,value:o.value||"",isManual:o.isManual},o.slug))})]})}function un({occurredAt:n,isLast:t,children:s}){return e.jsxs("div",{className:"relative flex gap-4 pb-6",children:[e.jsxs("div",{className:"relative flex w-2.5 shrink-0 justify-center",children:[!t&&e.jsx("div",{className:"absolute top-1 bottom-[-1.5rem] left-1/2 w-px -translate-x-1/2 bg-border","aria-hidden":!0}),e.jsx("div",{className:"relative z-10 mt-1 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground/60"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[n&&e.jsx("time",{dateTime:new Date(n).toISOString(),title:Ae(n),className:"mb-1 block text-xs leading-none text-muted-foreground",children:Re(n)}),s]})]})}function fn({organizationId:n,ownerSlug:t,entityId:s,filters:r,showEntityLinks:i=!1,emptyState:d,dense:c=!1}){const{isAuthenticated:a,isReady:p}=yt(),{isMember:m,isLoading:g}=ee(),x=t==="me",S=!x&&p&&a&&m,l=!x&&p&&(!a||!g&&!m),{data:h=[]}=jt(p&&S?n:null),{data:f=[]}=vt(l?t:null),N=S?h:f,E=Nt(p&&S?n:null,s,r,t),R=bt(l?t:null,s,r),O=l?R:E,{data:I,isLoading:U,error:k,fetchNextPage:H,hasNextPage:D,isFetchingNextPage:M}=O,B=v.useMemo(()=>I?.pages.flatMap(b=>b.content)??[],[I]),u=Pt({onIntersect:()=>H(),enabled:!!D&&!M}),T=v.useMemo(()=>{const b=_t(B),j=b.map(_=>_.head),$=new Map(b.map(_=>[_.head.id,_])),P=wt(j);return Array.from(P.entries()).map(([_,W])=>{const F=W.root||W.replies[0],Q=F?$.get(F.id):void 0;return{rootId:_,group:W,history:Q?.history??[],runId:Q?.runId??null}})},[B]),[J,te]=v.useState(new Set),[re,ie]=v.useState(new Set),[ce,ue]=v.useState(new Set),G=(b,j)=>b($=>{const P=new Set($);return P.has(j)?P.delete(j):P.add(j),P}),ge=!x&&(!p||a&&g||S&&O.isPending);return(U||ge)&&B.length===0&&!k?e.jsx("div",{className:"space-y-4",children:["s1","s2","s3"].map(b=>e.jsx(kt,{className:"h-32 rounded-lg"},b))}):k?e.jsx(Ct,{label:"events"}):B.length===0?d??e.jsx(St,{icon:Rt,title:"Nothing here yet",description:"No events match this view."}):e.jsxs("div",{className:c?"":"pt-1",children:[T.map(({rootId:b,group:j,history:$,runId:P},_,W)=>{const F=j.replies.length>0,Q=J.has(b),ne=ce.has(b),ae=re.has(b),o=j.replies.filter(A=>A.depth<=3),y=j.replies.filter(A=>A.depth>3),V=!j.root&&j.replies.length>0,L=j.root||j.replies[0];return L?e.jsxs(un,{occurredAt:L.occurred_at,isLast:_===W.length-1,children:[i&&t&&L.entity_name&&L.entity_type&&L.entity_slug&&e.jsx("div",{className:"mb-2",children:e.jsx(It,{ownerSlug:t,entity:{entityName:L.entity_name,entityType:L.entity_type,entitySlug:L.entity_slug}})}),e.jsx(oe,{ownerSlug:t,content:L,showParentContext:V&&!!L.parent_context,connectorDefinitions:N}),$.length>0&&e.jsxs(fe,{open:ae,children:[e.jsx(ye,{asChild:!0,children:e.jsxs(w,{variant:"ghost",size:"sm",className:"mt-1 h-7 gap-1 text-xs text-muted-foreground",onClick:()=>G(ie,b),children:[e.jsx(At,{className:"h-3.5 w-3.5"}),ae?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Hide ",P!=null?`run #${P} `:"","history"]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-3.5 w-3.5"}),P!=null?`Run #${P} · ${$.length===1?"1 earlier step":`${$.length} earlier steps`}`:$.length===1?"1 earlier state":`${$.length} earlier states`]})]})}),e.jsx(je,{className:"mt-2 space-y-3 border-l-2 border-l-muted pl-4",children:$.map(A=>e.jsxs("div",{children:[e.jsx("time",{dateTime:new Date(A.occurred_at).toISOString(),title:Ae(A.occurred_at),className:"mb-1 block text-xs text-muted-foreground",children:Re(A.occurred_at)}),e.jsx(oe,{ownerSlug:t,content:A,connectorDefinitions:N})]},A.id))})]}),F&&e.jsxs(fe,{open:Q,children:[e.jsx(ye,{asChild:!0,children:e.jsxs(w,{variant:"ghost",size:"sm",className:"mt-2 ml-6 gap-1",onClick:()=>G(te,b),children:[e.jsx(Et,{className:"h-3.5 w-3.5"}),Q?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-3.5 w-3.5"}),"Hide ",j.replies.length," replies"]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Show ",j.replies.length," replies"]})]})}),e.jsxs(je,{className:"space-y-2 mt-2",children:[o.map(A=>e.jsx(oe,{ownerSlug:t,content:A,isReply:!0,connectorDefinitions:N},A.id)),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(w,{variant:"ghost",size:"sm",className:"ml-12",onClick:()=>G(ue,b),children:ne?e.jsxs(e.Fragment,{children:["Hide ",y.length," nested replies"]}):e.jsxs(e.Fragment,{children:["Show ",y.length," nested replies"]})}),ne&&y.map(A=>e.jsx(oe,{ownerSlug:t,content:A,isReply:!0,connectorDefinitions:N},A.id))]})]})]})]},b):null}),e.jsx("div",{ref:u,className:"h-1"}),M&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(X,{size:"xl",className:"text-muted-foreground"})})]})}export{fn as E,gn as u};
@@ -1 +0,0 @@
1
- import{r,j as t,af as u}from"./index-B2AmRqYh.js";function l({className:i,delayMs:e=500}){const[s,n]=r.useState(e<=0);return r.useEffect(()=>{if(e<=0)return;const a=setTimeout(()=>n(!0),e);return()=>clearTimeout(a)},[e]),s?t.jsx("div",{className:u("flex min-h-[50vh] items-center justify-center",i),role:"status","aria-label":"Loading",children:t.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):null}export{l as F};
@@ -1 +0,0 @@
1
- import{j as t,Y as o}from"./index-B2AmRqYh.js";function n(){return t.jsx(o,{})}export{n as component};
@@ -1 +0,0 @@
1
- import{i7 as t,j as n}from"./index-B2AmRqYh.js";import{a as i}from"./agents-workbench-C2sr5h82.js";import"./agent-editor-form-BYC4uSNz.js";import"./model-selector-CapL1ARf.js";import"./proposal-review-shell-D4YNrrye.js";import"./runs-oHveuEUB.js";function d(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(i,{owner:o,agentId:r,tab:"identity",runId:e.run_id})}export{d as component};
@@ -1 +0,0 @@
1
- import{b3 as z,j as n,aS as H,b4 as J,u as V,b5 as X,b6 as Y,b7 as Z,b8 as ee,b9 as ne,r as _,ba as se,_ as oe,bb as te,bc as ae,bd as ce,be as re,bf as ie,bg as K,bh as le,bi as de,S as O,B as U,bj as ue,bk as q,aQ as G,bl as me,bm as pe,bn as he,bo as fe,bp as xe,bq as ve,ab as be,L as S,br as ge}from"./index-B2AmRqYh.js";import{b as je,c as Ne,d as ye}from"./device-rows-Bwf8qDte.js";function Ie(){const{owner:o}=z.useParams(),{filter:r}=z.useSearch();return n.jsx(H,{owner:o,children:a=>n.jsx(_e,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,isWorkspaceLoading:a.isWorkspaceLoading,requestedFilter:r})})}function _e({ownerSlug:o,organizationId:r,isWorkspaceLoading:a,requestedFilter:d}){const{data:u=[],isLoading:i}=J(r??""),{data:D=[],isLoading:C}=V(r??""),{data:f=[]}=X(r,{}),{data:E=[],isLoading:R}=Y(),{data:w=[]}=Z(),{data:x,isLoading:v}=ee(),{data:l=[]}=ne(),b=a||i||C||R||v,A=x?.sandboxes??[],m=_.useMemo(()=>l.filter(k=>k.organization_slug===o||k.connectors.some(L=>L.organization_slug===o)),[l,o]);return n.jsx(se,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ce,{ownerSlug:o,isContentLoading:b,groups:u,installedDefs:D,authProfiles:f,inferenceProviders:E,inferenceCatalog:w,sandboxes:A,devices:m,requestedFilter:d})})}function Ce({ownerSlug:o,isContentLoading:r,groups:a,installedDefs:d,authProfiles:u,inferenceProviders:i,inferenceCatalog:D,sandboxes:C,devices:f,requestedFilter:E}){const R=oe(),w=E??"all",x=_.useMemo(()=>{const s=new Map(a.map(e=>[e.connector_key,e])),t=new Map;for(const e of d)t.set(e.key,e);for(const e of a)t.has(e.connector_key)||t.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const N=te(i).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0})),p=ae(C).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!e.sandbox.connected,provider:void 0,sandbox:e.sandbox,device:void 0})),P=je(f,a,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device}));return[...Array.from(t.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!Ne(e)).map(e=>{const c=s.get(e.key),F=ce(e.auth_schema),I=u.reduce((j,$)=>($.connector_key!==e.key||(j[$.profile_kind]+=1),j),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),h=re(e,c),y=we(e,c,F,I);return{connector:e,group:c,profileCounts:I,facets:h,needsSetup:y,provider:void 0,sandbox:void 0,device:void 0}}),...N,...p,...P].sort((e,c)=>e.needsSetup&&!c.needsSetup?-1:!e.needsSetup&&c.needsSetup?1:e.connector.name.localeCompare(c.connector.name))},[o,u,f,a,d,i,C]),v=_.useMemo(()=>{const s=ie.filter(t=>t!=="all"&&x.some(N=>K(N,t)));return s.length>1?["all",...s]:[]},[x]),l=v.includes(w)?w:"all",b=_.useMemo(()=>x.filter(s=>K(s,l)),[x,l]),A=b.length,m=_.useMemo(()=>l==="all"?le(o,f,de()):[],[l,o,f]),k=A+m.length,L=n.jsx(U,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(S,{to:"/$owner/connectors/create",params:{owner:o},children:[n.jsx(ge,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:L}),n.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":"Loading connectors",children:Array.from({length:6}).map((s,t)=>n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${t===5?"":"border-b"}`,children:[n.jsx(O,{className:"h-7 w-7 shrink-0 rounded-md"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[n.jsx(O,{className:"h-4 w-40"}),n.jsx(O,{className:"h-3 w-24"})]})]},t))})]});const B=s=>{R({to:"/$owner/connectors",params:{owner:o},search:t=>({...t,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[v.map(s=>n.jsx(U,{type:"button",variant:l===s?"secondary":"ghost","aria-pressed":l===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>B(s),children:ue[s]},s)),v.length===0&&b.length===0&&m.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto shrink-0",children:L})]}),b.length===0?v.length>0?n.jsx(q,{icon:G.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>B("all")}):m.length>0?null:n.jsx(q,{icon:G.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map(({connector:s,group:t,facets:N,profileCounts:p,needsSetup:P,provider:g,sandbox:e,device:c},F)=>{const I=new Map(d.map(M=>[M.key,M])),h=me(s.key,I,{name:s.name,iconUrl:g?D.find(M=>M.slug===g.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??t?.favicon_domain??(e?pe(e.providerKind):void 0)}),y=p.oauth_account+p.browser_session,j=t?.connection_count??0,$=c?ye(c):g?[g.isDefault?"Default":null,g.status].filter(Boolean).join(" · "):e?[e.providerKind,e.connected?"Connected":"No credential"].join(" · "):[`${j} ${j===1?"connection":"connections"}`,y>0?`${y} ${y===1?"account":"accounts"}`:null,p.oauth_app>0?`${p.oauth_app} OAuth app${p.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),T=Q(F,k),W=n.jsxs(n.Fragment,{children:[c?n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(he,{platform:fe(c)})}):n.jsx(xe,{icon:h.icon,iconUrl:h.iconUrl,name:h.name,faviconDomain:h.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:h.name}),n.jsx(ve,{facets:N})]}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$})]}),P?n.jsx(be,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Needs setup"}):null]});return c?n.jsx(S,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:c.id},className:T,children:W},s.key):n.jsx(S,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},className:T,children:W},s.key)})}),m.length>0?n.jsx("div",{className:"overflow-hidden rounded-lg border border-dashed",children:m.map((s,t)=>n.jsxs(S,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},className:Q(t,m.length),children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-dashed",children:s.icon}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:s.name}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.tagline})]}),n.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},s.id))}):null]})}function Q(o,r){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${o===r-1?"":"border-b"}`}function we(o,r,a,d){const u=a.some(i=>i.type==="none");return!!(!u&&a.some(i=>i.type==="oauth")&&d.oauth_app===0||!u&&a.some(i=>i.type==="env_keys")&&d.env===0||!u&&a.some(i=>i.type==="app_installation")&&!r||o.required_capability&&!r)}export{Ie as component};