@lobu/runtime-server 24.3.0 → 24.5.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 (290) hide show
  1. package/dist/catalogs/skills.json +2 -2
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/postgres.ts +77 -48
  4. package/dist/db/migrations/20261101010000_public_source_type_references.sql +157 -0
  5. package/dist/dependencies.bun.lock +115 -144
  6. package/dist/owletto/dist/assets/_-CCWuGXtQ.js +2 -0
  7. package/dist/owletto/dist/assets/_-DOJW1D-I.js +3 -0
  8. package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +2 -0
  9. package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +2 -0
  10. package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +2 -0
  11. package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +2 -0
  12. package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +2 -0
  13. package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +2 -0
  14. package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +2 -0
  15. package/dist/owletto/dist/assets/_name-D30_V03t.js +2 -0
  16. package/dist/owletto/dist/assets/_owner-Be8O41u8.js +3 -0
  17. package/dist/owletto/dist/assets/_shape-C6YbloRh.js +2 -0
  18. package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +2 -0
  19. package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +2 -0
  20. package/dist/owletto/dist/assets/_view-aoFDwEld.js +2 -0
  21. package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +2 -0
  22. package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +2 -0
  23. package/dist/owletto/dist/assets/accept-invitation-pUl-c1KQ.js +2 -0
  24. package/dist/owletto/dist/assets/activity-route-view-DN0ZEAzr.js +2 -0
  25. package/dist/owletto/dist/assets/{agent-card-controls-DiU7Un5w.js → agent-card-controls-C5jNWgfq.js} +2 -2
  26. package/dist/owletto/dist/assets/agent-client-setup-list-DbXtJTsO.js +4 -0
  27. package/dist/owletto/dist/assets/agent-connect-pages-DcTuiSt9.js +2 -0
  28. package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +2 -0
  29. package/dist/owletto/dist/assets/agent-guardrails-route-BJyfalBY.js +2 -0
  30. package/dist/owletto/dist/assets/agent-list-row-rF5LH-3k.js +2 -0
  31. package/dist/owletto/dist/assets/{agent-loading-shells-CamDtzHY.js → agent-loading-shells-ClY_O6lb.js} +2 -2
  32. package/dist/owletto/dist/assets/{agent-permissions-matrix-CgsQ8BK_.js → agent-permissions-matrix-bP1Qihv7.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-skill-context-lWbXKEm1.js → agent-skill-context-BAaGpvfS.js} +2 -2
  34. package/dist/owletto/dist/assets/agent-skills-route-Bv5luNdw.js +2 -0
  35. package/dist/owletto/dist/assets/agent-tab-intro-ednTs4WF.js +2 -0
  36. package/dist/owletto/dist/assets/agent-thread-WNk2HapT.js +6 -0
  37. package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +2 -0
  38. package/dist/owletto/dist/assets/agents-DY2S2SGE.js +2 -0
  39. package/dist/owletto/dist/assets/agents-workbench-bPTjdVS1.js +2 -0
  40. package/dist/owletto/dist/assets/app._appId-DrL5H5lB.js +2 -0
  41. package/dist/owletto/dist/assets/assist-composer-ClfFEVx7.js +2 -0
  42. package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +2 -0
  43. package/dist/owletto/dist/assets/automation-row-DCHM--aD.js +2 -0
  44. package/dist/owletto/dist/assets/automations-DY2S2SGE.js +2 -0
  45. package/dist/owletto/dist/assets/{calendar-DDCCSPW6.js → calendar-Ck0yOLYu.js} +2 -2
  46. package/dist/owletto/dist/assets/{callback-DFciMR8u.js → callback-DRABUOha.js} +2 -2
  47. package/dist/owletto/dist/assets/{card-BCsbrdGs.js → card-Bdi7VEwo.js} +2 -2
  48. package/dist/owletto/dist/assets/change-summary-PBoM6Asb.js +2 -0
  49. package/dist/owletto/dist/assets/{claim-BRua2b_7.js → claim-CUIG1Oc-.js} +2 -2
  50. package/dist/owletto/dist/assets/client-activity-scopes-CXOWB5co.js +2 -0
  51. package/dist/owletto/dist/assets/{client-rows-DiJQ5D1z.js → client-rows-36VnmgMK.js} +2 -2
  52. package/dist/owletto/dist/assets/clients-BJRcMk1A.js +2 -0
  53. package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +16 -0
  54. package/dist/owletto/dist/assets/connect-CMcEQWls.js +2 -0
  55. package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +2 -0
  56. package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +2 -0
  57. package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +2 -0
  58. package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +2 -0
  59. package/dist/owletto/dist/assets/connected._clientId.index-jSnGvzYs.js +2 -0
  60. package/dist/owletto/dist/assets/connection-feed-detail-BIlkK0Pd.js +2 -0
  61. package/dist/owletto/dist/assets/connection-q1bdnxCN.js +2 -0
  62. package/dist/owletto/dist/assets/{connections-browser-BMV8bf54.js → connections-browser-V-3td9DB.js} +2 -2
  63. package/dist/owletto/dist/assets/{connector-boxes-DqZA-FdG.js → connector-boxes-lFc-WP83.js} +2 -2
  64. package/dist/owletto/dist/assets/connector-page-shell-Cs1SjrYB.js +2 -0
  65. package/dist/owletto/dist/assets/{connector-provenance-BIg8P8WY.js → connector-provenance-aJFeeRIC.js} +2 -2
  66. package/dist/owletto/dist/assets/{connector-scope-lists-CJYz53YF.js → connector-scope-lists--vNdbOn0.js} +2 -2
  67. package/dist/owletto/dist/assets/connectors-BsvDMdsQ.js +2 -0
  68. package/dist/owletto/dist/assets/consent-DJV78pnz.js +2 -0
  69. package/dist/owletto/dist/assets/copy-button-DjMWgrBf.js +2 -0
  70. package/dist/owletto/dist/assets/{core.esm-A1UnFbGs.js → core.esm-CQzL3ObT.js} +3 -3
  71. package/dist/owletto/dist/assets/create-BmKx5vq3.js +2 -0
  72. package/dist/owletto/dist/assets/create-Rt0RbiD4.js +2 -0
  73. package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +3 -0
  74. package/dist/owletto/dist/assets/create-jBEuveV1.js +2 -0
  75. package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +2 -0
  76. package/dist/owletto/dist/assets/device-Ba3RsIgb.js +2 -0
  77. package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +2 -0
  78. package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +2 -0
  79. package/dist/owletto/dist/assets/{entity-avatar-CEV4ttUQ.js → entity-avatar-TVKjZxWQ.js} +2 -2
  80. package/dist/owletto/dist/assets/entity-options-daOOQo7O.js +2 -0
  81. package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +2 -0
  82. package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +2 -0
  83. package/dist/owletto/dist/assets/event-card-DVUB8my6.js +2 -0
  84. package/dist/owletto/dist/assets/event-detail-DkY95e5b.js +2 -0
  85. package/dist/owletto/dist/assets/{events-feed-VfU4csn2.js → events-feed-B9CZHI_P.js} +2 -2
  86. package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +2 -0
  87. package/dist/owletto/dist/assets/{full-page-spinner-C1Q_jEzD.js → full-page-spinner-BqmckkOf.js} +2 -2
  88. package/dist/owletto/dist/assets/guardrails-Csusrok2.js +2 -0
  89. package/dist/owletto/dist/assets/identity-Dmg3STO8.js +2 -0
  90. package/dist/owletto/dist/assets/index--ZWegctR.js +2 -0
  91. package/dist/owletto/dist/assets/{index-DFyBbp7b.js → index-B0kw2lFL.js} +2 -2
  92. package/dist/owletto/dist/assets/index-BKrdVwW9.js +2 -0
  93. package/dist/owletto/dist/assets/index-BUBcNNUY.js +2 -0
  94. package/dist/owletto/dist/assets/index-BUDr4-Yv.js +2 -0
  95. package/dist/owletto/dist/assets/index-BYPQWVwD.js +2 -0
  96. package/dist/owletto/dist/assets/index-BfpaPJPj.js +2 -0
  97. package/dist/owletto/dist/assets/index-BicNFLBW.js +2 -0
  98. package/dist/owletto/dist/assets/index-Bsdv5aks.js +2 -0
  99. package/dist/owletto/dist/assets/index-C186T2Rw.js +53 -0
  100. package/dist/owletto/dist/assets/index-CX0pJ9j9.js +2 -0
  101. package/dist/owletto/dist/assets/{index-DQxzeM37.js → index-CsrT07TJ.js} +2 -2
  102. package/dist/owletto/dist/assets/index-DdBTTN3y.js +7899 -0
  103. package/dist/owletto/dist/assets/index-DdYWarql.css +1 -0
  104. package/dist/owletto/dist/assets/index-JYEIN8nM.js +2 -0
  105. package/dist/owletto/dist/assets/index-Vcq4gwWv.js +2 -0
  106. package/dist/owletto/dist/assets/{index-DNtYqkiA.js → index-ijqrJaRB.js} +2 -2
  107. package/dist/owletto/dist/assets/{index-yIub2xUM.js → index-ikp_mTsf.js} +2 -2
  108. package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +14 -0
  109. package/dist/owletto/dist/assets/{list-skeleton-Kzxi2OXB.js → list-skeleton-CXDLkYTg.js} +2 -2
  110. package/dist/owletto/dist/assets/login-u6LCgDYG.js +2 -0
  111. package/dist/owletto/dist/assets/{logout-Dt_VDilG.js → logout-JhmuWJEH.js} +2 -2
  112. package/dist/owletto/dist/assets/manage-gear-D8LMhehh.js +2 -0
  113. package/dist/owletto/dist/assets/{member-scope-gate-De75CR7W.js → member-scope-gate-4FQ0aanZ.js} +2 -2
  114. package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +74 -0
  115. package/dist/owletto/dist/assets/model-jL871x2J.js +2 -0
  116. package/dist/owletto/dist/assets/model-selector-CgU8SJMF.js +2 -0
  117. package/dist/owletto/dist/assets/models-jdemgIZk.js +2 -0
  118. package/dist/owletto/dist/assets/nav-pill-DrFkuyUQ.js +2 -0
  119. package/dist/owletto/dist/assets/new-CcJOd5aH.js +2 -0
  120. package/dist/owletto/dist/assets/{new-BbdwuJPm.js → new-DgE1pVV0.js} +2 -2
  121. package/dist/owletto/dist/assets/new-OWwrYckd.js +2 -0
  122. package/dist/owletto/dist/assets/organization-CKM_oFX3.js +2 -0
  123. package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +2 -0
  124. package/dist/owletto/dist/assets/pending-seed-sml8Uf6e.js +2 -0
  125. package/dist/owletto/dist/assets/permissions-BvA9SATv.js +2 -0
  126. package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +2 -0
  127. package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +2 -0
  128. package/dist/owletto/dist/assets/record-activity-C9gVBbF0.js +2 -0
  129. package/dist/owletto/dist/assets/{record-session-D07szzqN.js → record-session-R-uHNuby.js} +2 -2
  130. package/dist/owletto/dist/assets/{renderer-AJxSmE3-.js → renderer-DXfJaCCa.js} +23 -23
  131. package/dist/owletto/dist/assets/reset-password-Mx3baeNc.js +2 -0
  132. package/dist/owletto/dist/assets/run-activity-link-CaIBSRQj.js +2 -0
  133. package/dist/owletto/dist/assets/run-initiator-BvzQJYW9.js +2 -0
  134. package/dist/owletto/dist/assets/runs-fFJ1lPnw.js +2 -0
  135. package/dist/owletto/dist/assets/runs-panel-DEnZHTa5.js +2 -0
  136. package/dist/owletto/dist/assets/runs-table-XGnxJl7S.js +2 -0
  137. package/dist/owletto/dist/assets/{schema-type-editor-panel-C_Es0qDf.js → schema-type-editor-panel-C0_9VcSs.js} +2 -2
  138. package/dist/owletto/dist/assets/settings-CP4PjMQA.js +2 -0
  139. package/dist/owletto/dist/assets/settings-CgaUJMHH.js +2 -0
  140. package/dist/owletto/dist/assets/skills-D-e_h3a9.js +2 -0
  141. package/dist/owletto/dist/assets/{source-record-panels-CjFPgKKJ.js → source-record-panels-Bh0n4gGw.js} +2 -2
  142. package/dist/owletto/dist/assets/{status-dot-CSBtKT4g.js → status-dot-Cpq63I7p.js} +2 -2
  143. package/dist/owletto/dist/assets/{table-DHM-vCxP.js → table-BUqshjxa.js} +2 -2
  144. package/dist/owletto/dist/assets/{use-automations-C4TSie1i.js → use-automations-BLNjxq2K.js} +2 -2
  145. package/dist/owletto/dist/assets/use-login-redirect-CmyQW7GT.js +2 -0
  146. package/dist/owletto/dist/assets/{use-mention-search-PfZrNbu_.js → use-mention-search-dn3ws1WB.js} +3 -3
  147. package/dist/owletto/dist/assets/use-scroll-sentinel-DRyBMueA.js +2 -0
  148. package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +2 -0
  149. package/dist/owletto/dist/assets/{views-access-required-2ubIf_3N.js → views-access-required-C_b9itZ2.js} +2 -2
  150. package/dist/owletto/dist/index.html +2 -2
  151. package/dist/server-main.bundle.mjs +54218 -51082
  152. package/dist/server.bundle.mjs +5 -5
  153. package/dist/verify.mjs +1 -1
  154. package/npm-shrinkwrap.json +351 -371
  155. package/package.json +3 -4
  156. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +8 -2
  157. package/vendor/connector-sdk/dist/reaction-sdk.d.ts +5 -1
  158. package/vendor/connector-sdk/package.json +1 -1
  159. package/vendor/core/dist/contracts/agent-settings.d.ts +61 -6
  160. package/vendor/core/dist/contracts/agent-settings.js +10 -7
  161. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +473 -98
  162. package/vendor/core/dist/contracts/tools/manage-agents.js +111 -2
  163. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +21 -18
  164. package/vendor/core/dist/contracts/tools/manage-automations.js +15 -15
  165. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +2 -2
  166. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +45 -20
  167. package/vendor/core/dist/contracts/tools/manage-entity.js +17 -5
  168. package/vendor/core/dist/contracts/tools/manage-inference-providers.d.ts +445 -0
  169. package/vendor/core/dist/contracts/tools/manage-inference-providers.js +133 -0
  170. package/vendor/core/dist/contracts/tools/manage-views.d.ts +4 -4
  171. package/vendor/core/dist/contracts/tools/manage-views.js +5 -3
  172. package/vendor/core/dist/contracts/worker/device-automation.js +4 -2
  173. package/vendor/core/dist/error-report.d.ts +73 -0
  174. package/vendor/core/dist/error-report.js +346 -0
  175. package/vendor/core/dist/index.d.ts +4 -1
  176. package/vendor/core/dist/index.js +7 -1
  177. package/vendor/core/dist/logger.js +15 -6
  178. package/vendor/core/dist/otel-fetch.d.ts +19 -0
  179. package/vendor/core/dist/otel-fetch.js +96 -0
  180. package/vendor/core/dist/otel.d.ts +22 -2
  181. package/vendor/core/dist/otel.js +95 -48
  182. package/vendor/core/dist/reserved.d.ts +1 -1
  183. package/vendor/core/dist/reserved.js +6 -4
  184. package/vendor/core/dist/tool-result.d.ts +8 -0
  185. package/vendor/core/dist/tool-result.js +61 -0
  186. package/vendor/core/dist/trace-context.d.ts +12 -0
  187. package/vendor/core/dist/trace-context.js +50 -0
  188. package/vendor/core/dist/utils/diagnostic-scrubber.js +1 -1
  189. package/vendor/core/dist/worker/auth.js +4 -0
  190. package/vendor/core/package.json +6 -1
  191. package/vendor/views/package.json +1 -1
  192. package/dist/owletto/dist/assets/_-XKF0m81R.js +0 -3
  193. package/dist/owletto/dist/assets/_-e8MbEBtw.js +0 -2
  194. package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +0 -2
  195. package/dist/owletto/dist/assets/_agentId-emObu67X.js +0 -2
  196. package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +0 -2
  197. package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +0 -2
  198. package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +0 -2
  199. package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +0 -2
  200. package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +0 -2
  201. package/dist/owletto/dist/assets/_name-DjtJMop4.js +0 -2
  202. package/dist/owletto/dist/assets/_owner-oBX68rb9.js +0 -3
  203. package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +0 -2
  204. package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +0 -2
  205. package/dist/owletto/dist/assets/_slug-B2g5qzn3.js +0 -2
  206. package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +0 -2
  207. package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +0 -2
  208. package/dist/owletto/dist/assets/accept-invitation-38lHBvjO.js +0 -2
  209. package/dist/owletto/dist/assets/activity-route-view-voRYSM3a.js +0 -2
  210. package/dist/owletto/dist/assets/agent-client-setup-list-Bkyw22GW.js +0 -5
  211. package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +0 -2
  212. package/dist/owletto/dist/assets/agent-editor-form-QrIDroFL.js +0 -2
  213. package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +0 -2
  214. package/dist/owletto/dist/assets/agent-skills-route-D-w3tY_2.js +0 -2
  215. package/dist/owletto/dist/assets/agent-subpage-shell-CLqpn5Tb.js +0 -2
  216. package/dist/owletto/dist/assets/agent-thread-CsRexwTv.js +0 -6
  217. package/dist/owletto/dist/assets/agents-DzH_FFKU.js +0 -2
  218. package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.js +0 -2
  219. package/dist/owletto/dist/assets/app._appId-BO7G38fL.js +0 -2
  220. package/dist/owletto/dist/assets/automation-detail-content-DMYxs6F6.js +0 -2
  221. package/dist/owletto/dist/assets/automations-DzH_FFKU.js +0 -2
  222. package/dist/owletto/dist/assets/client-activity-scopes-BLIy1Zc3.js +0 -2
  223. package/dist/owletto/dist/assets/clients-8-EpRjsm.js +0 -2
  224. package/dist/owletto/dist/assets/code-editor-BFZa4EIt.js +0 -16
  225. package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +0 -2
  226. package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +0 -2
  227. package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +0 -2
  228. package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +0 -2
  229. package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +0 -2
  230. package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +0 -2
  231. package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +0 -2
  232. package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +0 -2
  233. package/dist/owletto/dist/assets/connectors-BroKpwhB.js +0 -2
  234. package/dist/owletto/dist/assets/consent-fzLN-Qy7.js +0 -2
  235. package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +0 -2
  236. package/dist/owletto/dist/assets/create-BjwsYarn.js +0 -2
  237. package/dist/owletto/dist/assets/create-Dzr4mlr0.js +0 -2
  238. package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +0 -3
  239. package/dist/owletto/dist/assets/create-c94SPL21.js +0 -2
  240. package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +0 -2
  241. package/dist/owletto/dist/assets/cronstrue-xxpD1P2-.js +0 -2
  242. package/dist/owletto/dist/assets/device-C3AEoL5c.js +0 -2
  243. package/dist/owletto/dist/assets/device-pin-tombstone-B_te59GE.js +0 -2
  244. package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +0 -2
  245. package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +0 -2
  246. package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +0 -2
  247. package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +0 -2
  248. package/dist/owletto/dist/assets/event-card-CBlsG32u.js +0 -2
  249. package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +0 -2
  250. package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +0 -2
  251. package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +0 -2
  252. package/dist/owletto/dist/assets/identity-BaFLmbSo.js +0 -2
  253. package/dist/owletto/dist/assets/index-008wj-Pz.js +0 -7950
  254. package/dist/owletto/dist/assets/index-BaetvYLa.js +0 -2
  255. package/dist/owletto/dist/assets/index-BiEf5xOE.css +0 -1
  256. package/dist/owletto/dist/assets/index-BrDP4PCs.js +0 -2
  257. package/dist/owletto/dist/assets/index-BuXIeK7D.js +0 -2
  258. package/dist/owletto/dist/assets/index-CAVcR9za.js +0 -2
  259. package/dist/owletto/dist/assets/index-CMLfWGPU.js +0 -2
  260. package/dist/owletto/dist/assets/index-D0YEYP7N.js +0 -2
  261. package/dist/owletto/dist/assets/index-DkO0nPex.js +0 -2
  262. package/dist/owletto/dist/assets/index-KlRId0g6.js +0 -2
  263. package/dist/owletto/dist/assets/index-Ywnqi4A6.js +0 -2
  264. package/dist/owletto/dist/assets/index-wHFQv1aT.js +0 -12
  265. package/dist/owletto/dist/assets/index-xnxhf3Op.js +0 -2
  266. package/dist/owletto/dist/assets/json-diff-LE_vNZrM.js +0 -4
  267. package/dist/owletto/dist/assets/login-DWOT6jtS.js +0 -2
  268. package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +0 -74
  269. package/dist/owletto/dist/assets/model-selector-3l9lY50C.js +0 -2
  270. package/dist/owletto/dist/assets/model-udnQ_S43.js +0 -2
  271. package/dist/owletto/dist/assets/models-CQj7GIOp.js +0 -2
  272. package/dist/owletto/dist/assets/new-BOwIHkre.js +0 -2
  273. package/dist/owletto/dist/assets/new-DTuFCQhV.js +0 -2
  274. package/dist/owletto/dist/assets/oauth-workspace-access-QPo4YwRX.js +0 -2
  275. package/dist/owletto/dist/assets/organization-BDzjnqPf.js +0 -2
  276. package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +0 -2
  277. package/dist/owletto/dist/assets/permissions-CfoY4WFY.js +0 -2
  278. package/dist/owletto/dist/assets/proposal-review-shell-CVkLnnKo.js +0 -2
  279. package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +0 -2
  280. package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +0 -2
  281. package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +0 -2
  282. package/dist/owletto/dist/assets/runs-lG2ChtOt.js +0 -2
  283. package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +0 -2
  284. package/dist/owletto/dist/assets/settings-CEAOg7fr.js +0 -2
  285. package/dist/owletto/dist/assets/settings-gGYXbFfd.js +0 -2
  286. package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +0 -2
  287. package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +0 -2
  288. package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +0 -2
  289. /package/vendor/@better-auth-kysely-adapter/{.bun-tag-abf95749a412716 → .bun-tag-654b3a002b271269} +0 -0
  290. /package/vendor/postgres/{.bun-tag-22d644c2873790db → .bun-tag-c81dacd34e959a7a} +0 -0
@@ -0,0 +1,2 @@
1
+ import{a6 as ge,r as j,bJ as Ie,bK as Be,bL as Ke,bM as Me,bN as be,j as e,bO as J,B as C,bP as Ve,b2 as He,bQ as Ue,bR as Ge,bS as Je,bT as Ye,bU as Ze,bV as Xe,bW as es,bX as ve,bt as ie,bY as ss,bZ as ts,b_ as ns,b$ as me,c0 as is,c1 as as,c as os,a1 as Le,v as rs,c2 as cs,c3 as ne,c4 as ls,H as je,I as Ne,c5 as ds,c6 as us,c7 as ms,ab as Ce,bc as hs,S as z,J as le,c8 as ps,c9 as _e,ca as ke,cb as gs,K as xs,cc as Se,w as fs,cd as ys,ak as bs,al as vs,ce as js,i as Ns,cf as Cs}from"./index-DdBTTN3y.js";import{P as he,a as We,A as _s}from"./agent-permissions-matrix-bP1Qihv7.js";import{C as we,a as Ae,b as Oe,c as ze}from"./card-Bdi7VEwo.js";const Pe=["auto","approval","deny"],ks={matched_rule:"Matching policy rules apply.",default_approval:"No rule matches; approval is required.",unresolved_principal:"The requesting agent or Automation could not be identified.",parent_approval:"Approval is inherited from the parent action.",unavailable_operation:"This action is unavailable on the connection."},De={read:"Reads",write:"Writes",destructive:"Destructive writes",non_destructive:"Non-destructive writes",unknown:"Unclassified writes"};function pe(s){return{operation_key:s.operation_key??null,connector_key:s.connector_key??null,connection_id:s.connection_id??null,operation_category:s.operation_category??null}}const de=s=>JSON.stringify(pe(s)),$e=s=>({...s,effect:s.effects.execute??"approval"});function F({label:s,value:n,onChange:o,children:r,disabled:h}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("select",{"aria-label":s,value:n,onChange:c=>o(c.target.value),disabled:h,className:"h-9 w-full rounded-lg border bg-background px-2 text-foreground",children:r})]})}function Ss(s,n){const o=n.connections?.find(r=>r.id===s.connection_id);return s.connection_id?`Connection: ${o?.display_name||o?.connector_key||"Unavailable"} (#${s.connection_id})`:s.connector_key?`Connector: ${n.connectors?.find(r=>r.key===s.connector_key)?.name||s.connector_key}`:"All connectors"}function ws(s,n){return s.operation_key?n.connector_operations.find(o=>o.operation_key===s.operation_key)?.name||s.operation_key:s.operation_category?De[s.operation_category]:"All actions"}function ue(s,n){return`${Ss(s,n)} · ${ws(s,n)}`}function Ee(s){return s.connection_id?`connection:${s.connection_id}`:s.connector_key?`connector:${s.connector_key}`:"all"}function Te({catalog:s}){return e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All connectors"}),e.jsx("optgroup",{label:"Connectors",children:s.connectors?.map(n=>e.jsx("option",{value:`connector:${n.key}`,children:n.name},n.key))}),e.jsx("optgroup",{label:"Connections",children:s.connections?.map(n=>e.jsxs("option",{value:`connection:${n.id}`,children:[n.display_name||n.connector_key," (#",n.id,")"]},n.id))})]})}function As({label:s,ariaLabel:n,disabled:o,onRemove:r}){const[h,c]=j.useState(!1);return h?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(C,{type:"button",variant:"destructive",size:"sm",disabled:o,"aria-label":"Confirm removal",onClick:async()=>{await r()&&c(!1)},children:"Confirm"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>c(!1),children:"Cancel"})]}):e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":n,onClick:()=>c(!0),children:s})}function Os({owner:s,connector:n,connection:o,agent:r}){const h=ge(),[c,b]=j.useState(r??""),y=Ie(s),l=y.data,u=l?.agents.some(t=>t.id===c)?c:"",m=Be(s,u),i=Ke(s,!u),[P,_]=j.useState(o?`connection:${o}`:n?`connector:${n}`:"all"),[M,Y]=j.useState(P),[I,L]=j.useState(!1),[k,W]=j.useState(""),[A,V]=j.useState("all"),[Z,E]=j.useState("approval"),[g,S]=j.useState(!1),[D,T]=j.useState(null),[H,X]=j.useState(o?String(o):""),[U,Q]=j.useState(""),R=l?.connections?.some(t=>String(t.id)===H)?H:"",w=Me(s,R?Number(R):void 0,U,u||void 0);async function G(t,f){S(!0),T(null);try{if(u){const d={resource_class:"connector_action",...pe(t)};f?await Je(s,u,{...d,effects:{execute:f}}):await Ye(s,u,d)||T("This rule was already removed. The list has been refreshed.")}else{const d=i.data;if(!d)return;const K=d.rules.filter(qe=>de(qe)!==de(t));f&&K.push({...pe(t),effect:f});const ce=await Ze(s,{revision:d.revision,rules:K});h.setQueryData(Xe(s),ce)}return await Promise.all(["write-permissions","agent-permissions","available-operations","connector-operations","policy-explanation"].map(d=>h.invalidateQueries({queryKey:[d]}))),t}catch(d){d instanceof be&&d.status===409?(T("Policies changed in another session. Review the refreshed rules before saving again."),await i.refetch()):T(d instanceof Error?d.message:"Could not save policy.")}finally{S(!1)}}const q=y.error||(u?m.error:i.error);if(q instanceof be&&q.status===403)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Only organization owners and admins can manage policies."});if(q)return e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load policies. ",String(q)]});if(!l||(u?!m.data:!i.data))return e.jsx(J,{label:"policies",rows:2});const v=t=>t==="all"||l.connectors?.some(f=>`connector:${f.key}`===t)||l.connections?.some(f=>`connection:${f.id}`===t)?t:"all",a=v(P),p=v(M),N=l.connections?.find(t=>`connection:${t.id}`===p),$=N?.connector_key??(p.startsWith("connector:")?p.slice(10):void 0),x=t=>p==="all"||Ee(t)==="all"?!0:t.connection_id?N?t.connection_id===N.id:l.connections?.some(f=>f.id===t.connection_id&&f.connector_key===$):t.connector_key===$;function B(t){return u?t.principal_kind==="agent"&&t.principal_id===u:!t.principal_kind}const ee=a.startsWith("connector:")?a.slice(10):a.startsWith("connection:")?l.connections?.find(t=>t.id===Number(a.slice(11)))?.connector_key:void 0,O=l.connector_operations.filter(t=>!ee||t.connector_key===ee),se=l.connections?.find(t=>t.id===Number(R))?.connector_key,ae=l.connector_operations.filter(t=>t.connector_key===se),oe=u?(m.data?.agent??[]).filter(t=>t.resource_class==="connector_action").map($e):i.data?.rules??[],te=(m.data?.floor??[]).filter(t=>t.resource_class==="connector_action"&&x(t)).map($e),Qe={connector_key:a.startsWith("connector:")?a.slice(10):a==="all"&&A==="specific"?O.find(t=>t.operation_key===k)?.connector_key??null:null,connection_id:a.startsWith("connection:")?Number(a.slice(11)):null,operation_key:A==="specific"?k:null,operation_category:A.startsWith("category:")?A.slice(9):null},re=oe.filter(x);function fe(){_(p),V("all"),W(""),E("approval"),L(!0)}const ye=(t,f=!1)=>e.jsx("div",{className:"divide-y rounded-lg border",children:t.map(d=>{const K=!f&&B(d);return e.jsxs(We,{controls:e.jsxs(e.Fragment,{children:[e.jsx(he,{options:Pe,value:d.effect,floor:"auto",compact:!0,disabled:g||!K,ariaLabel:`Policy for ${ue(d,l)}`,onChange:ce=>void G(d,ce)}),K&&e.jsx(As,{label:"Remove",disabled:g,ariaLabel:`Remove rule: ${ue(d,l)}`,onRemove:()=>G(d)})]}),children:[e.jsx("p",{className:"text-sm break-words",children:ue(d,l)}),!K&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.principal_kind==="agent"&&!d.principal_id?"All agents":"Inherited restriction"})]},JSON.stringify([d.principal_kind,d.principal_id,de(d)]))})});return e.jsxs("div",{className:"space-y-4",children:[(p!==M||u!==c)&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"The requested scope is unavailable. Showing organization rules; install the connector or choose an available scope."}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Auto runs immediately. Ask waits for human approval. Block prevents execution and hides the action from agents. Authentication and guardrails still apply."}),e.jsxs("details",{className:"space-y-2",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-foreground",children:"How rules combine"}),e.jsx("p",{children:"A rule overrides another when it is narrower in target or actions and at least as narrow in the other. When rules are narrower in different ways, or use different categories, the stricter choice wins: Block, then Ask, then Auto. With no matching rule, the result is Ask. Impact categories apply only to writes."}),e.jsx("p",{children:"A connection-wide Auto does not override an organization-wide destructive Block. Add a destructive rule for that connection to make an exception."}),e.jsx("p",{children:"Agents and their Automations can only tighten organization policy. Internal browser steps inherit the parent approval; an explicit browser Block still wins."})]})]}),e.jsxs(F,{label:"Policy owner",value:u,onChange:b,disabled:g,children:[e.jsx("option",{value:"",children:"Organization"}),l.agents.map(t=>e.jsxs("option",{value:t.id,children:["Agent: ",t.name]},t.id))]}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto adds no restriction for this agent. It inherits organization policy and cannot bypass Ask or Block."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Without a matching restriction, this agent inherits organization policy.":"Without a matching rule, actions require approval (Ask)."}),e.jsx(F,{label:"Show rules for",value:p,onChange:Y,disabled:g,children:e.jsx(Te,{catalog:l})}),u&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Inherited organization rules"}),ye(te,!0)]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:u?"Saved restrictions":"Saved rules"}),!I&&re.length>0&&e.jsx(C,{variant:"outline",size:"sm",disabled:g,onClick:fe,children:"Add rule"})]}),I&&e.jsxs("form",{className:"space-y-3 border-t pt-4",onSubmit:t=>{t.preventDefault(),!g&&(A!=="specific"||k)&&G(Qe,Z).then(f=>{f&&(L(!1),Y(Ee(f)))})},children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add rule"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(F,{label:"Applies to",value:a,onChange:t=>{_(t),V("all"),W("")},disabled:g,children:e.jsx(Te,{catalog:l})}),e.jsxs(F,{label:"Actions",value:A,onChange:V,disabled:g,children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("optgroup",{label:"Categories",children:l.operation_categories?.map(t=>e.jsx("option",{value:`category:${t}`,children:De[t]},t))}),e.jsx("option",{value:"specific",children:"Specific action"})]})]}),A==="specific"&&e.jsxs(F,{label:"Specific action",value:k,onChange:W,disabled:g,children:[e.jsx("option",{value:"",children:"Choose action"}),O.map(t=>e.jsxs("option",{value:t.operation_key,children:[t.connector_name,": ",t.name]},t.operation_key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(he,{options:Pe,value:Z,floor:"auto",compact:!0,disabled:g,ariaLabel:"New rule decision",onChange:E}),e.jsx(Ve,{onCancel:()=>L(!1),cancelDisabled:g,children:e.jsx(C,{type:"submit",disabled:g||A==="specific"&&!k,children:g?"Saving…":"Save rule"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving an existing scope replaces its decision. Removing a rule reveals the next matching rule."})]}),re.length?ye(re):!I&&e.jsx(He,{icon:Ue,title:"No saved rules in this scope",description:"Add a rule for all actions, a category, or a specific action.",actionLabel:"Add rule",onAction:fe})]}),D&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:D}),e.jsxs("details",{className:"space-y-3 border-t pt-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Check an action"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(F,{label:"Check connection",value:R,onChange:t=>{X(t),Q("")},children:[e.jsx("option",{value:"",children:"Choose connection"}),l.connections?.map(t=>e.jsxs("option",{value:String(t.id),children:[t.display_name||t.connector_key," (#",t.id,")"]},t.id))]}),e.jsxs(F,{label:"Check action",value:U,onChange:Q,disabled:!R,children:[e.jsx("option",{value:"",children:"Choose action"}),ae.map(t=>e.jsx("option",{value:t.operation_key.slice(t.connector_key.length+2),children:t.name},t.operation_key))]})]}),w.error?e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not check policy. ",String(w.error)]}):e.jsx("p",{"aria-live":"polite",className:"text-sm",children:U?w.isPending?"Checking…":w.data?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:Ge[w.data.effect]})," ·"," ",ks[w.data.reason]??"The server evaluated this action.",w.data.rule_ids.length>0?` · Rules ${w.data.rule_ids.map(t=>`#${t}`).join(", ")}`:""]}):"":""})]})]})}const zs=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],Ps=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function xe(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function $s(s){return s.agent.find(xe)}function Es(s,n){return{...s,agent:[...s.agent.filter(o=>!xe(o)),n]}}function Ts(s){return{...s,agent:s.agent.filter(n=>!xe(n))}}function Rs({label:s,description:n,action:o,value:r,pending:h,onChange:c}){return e.jsxs(We,{controls:e.jsx(he,{options:as("entity_schema",o),value:r,floor:"auto",disabled:h,compact:!0,ariaLabel:s,onChange:c}),children:[e.jsx("p",{children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n})]})}function Re({title:s,actions:n,effects:o,pending:r,onChange:h}){return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:n.map(({action:c,label:b,description:y})=>e.jsx(Rs,{action:c,label:b,description:y,value:o[c]??me.entity_schema[c]??"deny",pending:r,onChange:l=>h(c,l)},c))})]})}function Fs({owner:s}){const n=ge(),o=es(s),r=Ie(s),h=ve({mutationFn:m=>ss(s,{resource_class:"entity_schema",effects:m}),onSuccess:m=>{n.setQueryData(o,i=>i&&Es(i,m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to save schema policy")}}),c=ve({mutationFn:()=>ts(s,{resource_class:"entity_schema"}),onSuccess:()=>{n.setQueryData(o,m=>m&&Ts(m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to reset schema policy")}});if(r.isLoading)return e.jsx(J,{label:"schema policy",variant:"cards",cards:1});if(r.isError||!r.data)return e.jsx(ns,{label:"schema policy"});const b=$s(r.data),y=b?.effects??me.entity_schema,l=h.isPending||c.isPending,u=(m,i)=>{h.mutate({...b?.effects??me.entity_schema,[m]:i})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:b?"Custom policy":"Workspace defaults"}),b?e.jsxs(C,{type:"button",variant:"outline",size:"sm",disabled:l,onClick:()=>c.mutate(),children:[e.jsx(is,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{title:"Entity types",actions:zs,effects:y,pending:l,onChange:u}),e.jsx(Re,{title:"Relationship types",actions:Ps,effects:y,pending:l,onChange:u})]})]})}function Fe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Is(s,n,o){const r=s.split("/");return r[1]===n?(r[1]=o,r.join("/")||"/"):`/${o}`}function Ls({section:s}){return s==="policies"?e.jsx(J,{label:"policies",rows:2}):s==="governance"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx(J,{label:"agent write defaults",variant:"table",rows:3})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx(J,{label:"schema governance",rows:3})]})]}):e.jsxs("div",{role:"status","aria-label":"Loading general settings","aria-busy":"true",className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{"aria-hidden":"true",className:"space-y-4",children:[["name","slug"].map(n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(z,{className:"h-3.5 w-12 rounded-none"}),e.jsx("div",{className:"flex h-9 items-center border border-input bg-background px-3",children:e.jsx(z,{className:"h-4 w-32 rounded-none"})})]},n)),e.jsx(z,{className:"h-3 w-4/5 rounded-none"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-2 sm:grid-cols-2",children:["private","public"].map(n=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(z,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(z,{className:"h-4 w-16 rounded-none"}),e.jsx(z,{className:"h-3 w-full rounded-none"}),e.jsx(z,{className:"h-3 w-2/3 rounded-none"})]})]},n))})]}),e.jsxs("div",{"aria-hidden":"true",className:"flex justify-end gap-2",children:[e.jsx(z,{className:"h-9 w-20 rounded-none"}),e.jsx(z,{className:"h-9 w-28 rounded-none"})]})]})}function Ws({owner:s,section:n="general",connector:o,connection:r,agent:h}){const c=os(),b=ge(),{data:y,error:l}=Le(),{activeOrg:u,urlOrgSlug:m}=rs(),i=(y??[]).find(a=>a.slug===s&&a.is_member)??null,P=i?.id??s,_=cs(P,{name:i?.name??"",slug:i?.slug??"",visibility:i?.visibility??"private"}),[M,Y]=_.field("name"),[I,L]=_.field("slug"),[k,W]=_.field("visibility"),[A,V]=ne(P,!!i),[Z,E]=ne(P,!1),[g,S]=ne(P,null),[D,T]=j.useState(!1),[H,X]=j.useState(!1),[U,Q]=ne(P,!1);if(ls(l)&&y===void 0)return e.jsxs(we,{role:"alert",children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Couldn't load organizations"})}),e.jsx(ze,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(y===void 0)return e.jsx(Ls,{section:n});if(!i)return e.jsxs(we,{children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Organization not found"})}),e.jsx(ze,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});if(n==="policies")return e.jsx("div",{className:"space-y-6",children:e.jsxs("section",{id:"policies",className:"scroll-mt-6 space-y-4",children:[e.jsx("div",{className:"space-y-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control connector actions across the organization. Changes to existing rules save automatically."})}),e.jsx(Os,{owner:s,connector:o,connection:r,agent:h},`${s}:${h??""}:${o??""}:${r??""}`)]})});if(n==="governance")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the defaults agents inherit for entities and agents. Changes save automatically; agents can only tighten them."})]}),e.jsx(_s,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control structural changes by agents and connected AI clients. Changes save automatically."})]}),e.jsx(Fs,{owner:s})]})]});const R=a=>{const p=xs(a);if(p.kind==="cross-host"){window.location.assign(p.href);return}c({to:p.to})},w=a=>{if(a==="public"&&i.visibility!=="public"){E(!0);return}W(a),E(!1)},G=async()=>{if(!_.canSubmit)return;const a=M.trim();if(!a){S("Name is required");return}const p=I.trim()||Fe(a);if(!p){S("Slug is required");return}T(!0),S(null);try{const N=a!==i.name||p!==i.slug,$=k!==i.visibility;let x=i.slug;if(N){const O=await le.update({organizationId:i.id,data:{name:a,slug:p}});if(O.error){S(O.error.message||"Failed to update organization");return}x=O.data?.slug??p}$&&(x=(await ps(x,k)).slug),(N||$)&&(_.accept(_.values,{name:a,slug:x,visibility:k}),await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization updated"));const B=u?.id===i.id||m===i.slug,ee=x!==i.slug;if(B&&ee){const O=_e(),se=ke();if(O===i.slug&&se){const oe=gs(window.location.pathname,i.slug)||"/",te=`${window.location.protocol}//${x}.${se}${oe}${window.location.search}${window.location.hash}`;window.location.assign(te);return}const ae=Is(window.location.pathname,i.slug,x);c({to:`${ae}${window.location.search}${window.location.hash}`});return}}catch(N){S(N instanceof Error?N.message:"Failed to update organization")}finally{T(!1)}},q=async()=>{X(!0),S(null);try{const a=await le.delete({organizationId:i.id});if(a.error){S(a.error.message||"Failed to delete organization");return}await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization deleted");const N=(y??[]).filter(x=>x.is_member).find(x=>x.id!==i.id)??null,$=u?.id===i.id||m===i.slug;if($&&N){await le.setActive({organizationId:N.id}),R(N.slug);return}if($){const x=_e(),B=ke();if(x===i.slug&&B){window.location.assign(`${window.location.protocol}//app.${B}/`);return}c({to:"/"});return}c({to:"/"})}catch(a){S(a instanceof Error?a.message:"Failed to delete organization")}finally{X(!1),Q(!1)}},v=D||H;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-name",children:"Name"}),e.jsx(Ne,{id:"org-name",value:M,onChange:a=>{Y(a.target.value),A||L(Fe(a.target.value))},placeholder:"e.g. My Team",disabled:v})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-slug",children:"Slug"}),e.jsx(Ne,{id:"org-slug",value:I,onChange:a=>{V(!0),L(a.target.value)},placeholder:"e.g. my-team",disabled:v}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",i.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("private"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>w("public"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(us,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),Z&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(C,{type:"button",size:"sm",onClick:()=>{W("public"),E(!1)},disabled:v,children:"Confirm public"}),e.jsx(C,{type:"button",size:"sm",variant:"ghost",onClick:()=>E(!1),disabled:v,children:"Cancel"})]})]})]}),g&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),e.jsx(ms,{visible:_.hasConflict,onReload:_.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>void c({to:`/${s}`}),disabled:v,children:"Cancel"}),e.jsxs(C,{onClick:G,disabled:v||!_.canSubmit,children:[D?e.jsx(Ce,{size:"lg",className:"mr-1.5"}):null,D?"Saving...":"Save changes"]})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:i.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!i.is_personal&&e.jsx("div",{className:"mt-3",children:U?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"destructive",size:"sm",onClick:q,disabled:v,children:[H?e.jsx(Ce,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>Q(!1),disabled:v,children:"Cancel"})]}):e.jsxs(C,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>Q(!0),disabled:v,children:[e.jsx(hs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Bs(){const{owner:s}=Se.useParams(),n=Se.useSearch(),{hash:o}=fs(),r=ys(n,o),h={general:"General",policies:"Policies",governance:"Governance"}[r],{data:c}=Le(),b=(c??[]).find(y=>y.slug===s&&y.is_member)?.name;return e.jsx(bs,{className:"pt-2.5 pb-8",children:e.jsxs(vs,{className:Ns("flex flex-1 flex-col gap-6",Cs(r)),children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(js,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:h})]}),b?e.jsx("p",{className:"text-base font-medium text-foreground",children:b}):null]}),e.jsx(Ws,{owner:s,...n,section:r})]})})}export{Bs as component};
2
+ //# sourceMappingURL=organization-CKM_oFX3.js.map
@@ -0,0 +1,2 @@
1
+ import{jr as H,js as q,r as f,hz as V,u as A,j as e,dw as U,aB as G,aH as W,S as b,iL as Q,B as N,jt as Y,ju as C,jv as Z,jw as R,jx as z,jy as J,d3 as X,o as S,aq as D,cm as B,ab as I,eP as ee,v as te,l as se,g1 as ne,w as re,L as $,jz as ie,fI as oe,g4 as ae,fY as ce,jA as le,ga as E,cz as de,az as ue,jB as me,at as pe,k as xe,jC as he,cP as fe,dZ as ye,cQ as ge,p as je,gx as ve,eJ as Ne,jD as we,e5 as be,jE as ke,eO as Ae,a0 as Ce,jF as Se}from"./index-DdBTTN3y.js";import{u as Ie,A as Pe}from"./automation-detail-content-dFy1Huas.js";import{A as Le}from"./agent-loading-shells-ClY_O6lb.js";import{s as _e,h as Re,R as Te,A as $e}from"./agent-thread-WNk2HapT.js";import{C as Ee,b as Oe,A as ze}from"./connection-feed-detail-BIlkK0Pd.js";import{O as De}from"./connect-menu-C-B-1xGR.js";import{a as Be}from"./connections-browser-V-3td9DB.js";import{f as Fe}from"./connector-scope-lists--vNdbOn0.js";import{S as Me}from"./source-record-panels-Bh0n4gGw.js";import{E as T}from"./events-feed-B9CZHI_P.js";import{S as Ke}from"./schema-type-editor-panel-C0_9VcSs.js";import{h as He,s as qe,i as Ve}from"./renderer-DXfJaCCa.js";import{E as Ue}from"./event-detail-DkY95e5b.js";import{V as Ge,R as We}from"./views-access-required-C_b9itZ2.js";import{R as Qe,b as Ye}from"./event-card-DVUB8my6.js";import{V as Ze,a as Je}from"./view-param-filters-CER47Tlz.js";import{S as Xe,g as et}from"./runs-table-XGnxJl7S.js";import{R as tt}from"./runs-panel-DEnZHTa5.js";import{b as st}from"./use-automations-BLNjxq2K.js";import{b as nt}from"./model-jL871x2J.js";import"./create-automation-form-PEmSLMD6.js";import"./entity-options-daOOQo7O.js";import"./connection-label-BobuYiAG.js";import"./model-selector-CgU8SJMF.js";import"./skill-editor-D_W3QlRz.js";import"./code-editor-DNuRKde1.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-dn3ws1WB.js";import"./proposal-review-shell-D6KABxah.js";import"./runs-fFJ1lPnw.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-sml8Uf6e.js";import"./feed-event-kinds-BYuZCoU4.js";import"./status-dot-Cpq63I7p.js";import"./client-activity-scopes-CXOWB5co.js";import"./client-rows-36VnmgMK.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./record-session-R-uHNuby.js";import"./run-initiator-BvzQJYW9.js";import"./clients-BJRcMk1A.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./automation-row-DCHM--aD.js";import"./filter-bar-wPaR12SS.js";import"./manage-gear-D8LMhehh.js";function rt(t){const n=[];return t.forEach((s,r)=>{n.push({id:`sep:${s.runId}`,role:"system",parts:[{type:"text",text:it(s,r)}],createdAt:s.completedAt?new Date(s.completedAt).getTime():void 0});for(const i of s.messages)n.push({...i,id:`r${s.runId}:${i.id}`})}),n}function it(t,n){const s=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",r=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",i=t.completedAt?new Date(t.completedAt).toLocaleString():null;return i?`Run ${n+1} · ${s}${r} · ${i}`:`Run ${n+1} · ${s}${r}`}const F=Symbol("trusted-automation-interaction");function ot(t){return Object.defineProperty(t,F,{value:!0}),t}function at(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const ct=new Set(["automation-approval-batch"]);function lt(t){return new Promise(n=>{t({onSettled:(s,r)=>n(!!r)})})}function dt(){const t=H(),n=q();return f.useMemo(()=>({toolNames:ct,resolve:(s,r)=>{if(!r||typeof r!="object"||r[F]!==!0)return null;const i=r;if(s==="automation-approval-batch"){const o=typeof i.runId=="number"&&Number.isSafeInteger(i.runId)&&i.runId>0?i.runId:null,c=typeof i.count=="number"&&Number.isSafeInteger(i.count)&&i.count>1?i.count:null,a=Array.isArray(i.runIds)?i.runIds.filter(l=>typeof l=="number"&&Number.isSafeInteger(l)&&l>0):[];return o===null||c===null||a.length!==c||new Set(a).size!==c?null:{view:at(c),handlers:{manage_operations:l=>l.action!=="approve"&&l.action!=="reject"?Promise.resolve(!0):lt(p=>l.action==="approve"?t.mutate({run_id:o,run_ids:a},p):n.mutate({run_id:o,run_ids:a},p))}}}return null}}),[t,n])}const ut=/(?:^|\n)Run this Automation now/;function mt(t){return t.role==="user"&&t.parts.some(n=>n.type==="text"&&ut.test(n.text))}function pt(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function xt({agentId:t,automationId:n,ownerSlug:s,runId:r}){const{data:i,isLoading:o}=V(t,n,{orgSlug:s,...r!=null?{runId:r}:{}}),c=dt(),a=A(),l=f.useCallback(d=>{a?.open({href:`/${s}/automations/${n}?view=activity&run_id=${d}`,title:`Automation run #${d}`,runId:d})},[a,s,n]),p=f.useMemo(()=>{const d=i?.runs??[],j=(r!=null?d.filter(m=>m.runId===r):d).slice().reverse();return rt(j.map(m=>{const g=m.messages.map(u=>_e(u,{showToolCalls:!0})).filter(u=>u!==null&&!mt(u));m.task?.trim()&&g.unshift({id:"task",role:"user",parts:[{type:"text",text:m.task.trim()}]});const v=m.actions??[],h=v.filter(u=>u.status==="pending");if(h.length>1){const u=h.map(x=>x.runId).sort((x,k)=>x-k);g.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${m.runId}`,toolName:"automation-approval-batch",args:ot({runId:m.runId,count:h.length,runIds:u})}]})}for(const u of v){const x=Re([u],{workspaceSlug:s,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});x&&g.push({...x,id:pt(u)})}return{runId:m.runId,completedAt:m.completedAt,status:m.status,pendingActionCount:m.pendingActionCount,autoAppliedCount:m.autoAppliedCount,messages:g}}))},[t,i,s,r]);return o?e.jsx(Le,{readOnly:!0}):p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(Te,{messages:p,workspaceSlug:s,children:e.jsx($e,{readOnly:!0,readerPositionMode:"runs",interactionExtension:c,onRunSelect:r==null&&a?l:void 0})})})}function ht(t){if(!t||typeof t!="object")return[];const n=t.properties;if(!n)return[];const s=Array.isArray(t.required)?new Set(t.required.map(String)):new Set;return Object.entries(n).map(([r,i])=>({name:r,type:String(i.type??"any"),required:s.has(r),description:typeof i.description=="string"?i.description:void 0}))}function ft({fields:t}){return t.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):e.jsx("ul",{className:"space-y-2",children:t.map(n=>e.jsxs("li",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("code",{className:"text-xs font-medium text-foreground",children:n.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:n.type}),n.required?e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),n.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}):null]},n.name))})}function P({item:t,hideHeading:n=!1}){const s=t.schemaSections;return s?e.jsxs("article",{className:n?"space-y-4":"space-y-4 px-5 py-5",children:[!n&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(U,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("h2",{className:"text-base font-medium text-foreground",children:t.title}),s.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}):null]})]}),s.sections.map(r=>{const i=ht(r.schema);return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r.title}),r.description?e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.description}):null]}),e.jsx(ft,{fields:i})]},r.title)})]}):null}function yt({panel:t}){const n=G(t.organizationId),s=t.section==="connections"||!!t.connectionId,r=W(t.organizationId,{connectorKey:t.connectorKey,connectionIds:t.connectionId?[t.connectionId]:void 0,enabled:s}),i=n.data?.find(c=>c.key===t.connectorKey),o=r.data?.find(c=>c.id===t.connectionId&&c.connector_key===t.connectorKey);return n.isLoading||s&&r.isLoading?e.jsx("div",{className:"p-5",children:e.jsx(b,{className:"h-28 w-full"})}):n.isError||s&&r.isError?e.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):t.connectionId&&!o||!i&&!o&&t.section!=="connections"?e.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):e.jsx("div",{className:"p-5",children:t.section==="connections"?e.jsx(Be,{connections:r.data??[],connector:i,connectorKey:t.connectorKey,ownerSlug:t.ownerSlug}):o?e.jsx(vt,{connection:o,connector:i,panel:t}):i?t.section==="oauth-apps"?e.jsx(De,{connector:i,organizationId:t.organizationId,newApp:!!t.newApp}):t.section==="feeds"?e.jsx(gt,{connector:i}):i.installed===!1?e.jsx(jt,{connector:i,ownerSlug:t.ownerSlug}):e.jsx(wt,{connector:i,ownerSlug:t.ownerSlug}):null},`${t.connectorKey}:${t.connectionId??"connector"}:${t.section}`)}function gt({connector:t}){const n=Object.entries(t.feeds_schema??{}).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,feed:i}});return e.jsx(C,{entries:n,label:"feed types",renderDetail:({name:s,feed:r})=>e.jsx(P,{item:{href:"",title:s,schemaSections:Z(r)},hideHeading:!0})})}function jt({connector:t,ownerSlug:n}){const s=Object.entries(t.actions_schema??{}).map(([r,i])=>{const o=i;return{id:r,name:o.name??r,description:o.description,action:o}});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(C,{entries:s,label:"actions",renderDetail:({name:r,action:i})=>e.jsx(P,{hideHeading:!0,item:{href:"",title:r,schemaSections:z(i)}})})]})}function vt({connection:t,connector:n,panel:s}){const[r,i]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:r,children:s.section==="feeds"?e.jsx(Nt,{connection:t,connector:n,ownerSlug:s.ownerSlug}):e.jsx(Q,{connection:t,ownerSlug:s.ownerSlug,inPeek:!0,onReviewPermissions:n?()=>i(!0):void 0})}),r&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Back to actions"}),e.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),e.jsx(Y,{connection:t,connectorDef:n})]})]})}function Nt({connection:t,connector:n,ownerSlug:s}){const{data:r=[],isLoading:i,isError:o}=X(t.id),[c,a]=f.useState(!1),l=t.facets?.chat??!1;if(i)return e.jsx(b,{className:"h-28 w-full"});if(o)return e.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const p=r.map(d=>({id:String(d.id),name:d.display_name||d.feed_key,status:Fe(d)??(d.operations.includes("sync")?"Sync enabled":"Live access"),feed:d}));return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:c,children:e.jsx(C,{entries:p,label:l?"channels":"feeds",action:Object.keys(n?.feeds_schema??{}).length>0?e.jsx(N,{size:"sm",variant:"outline",onClick:()=>a(!0),children:l?"Add channel":"Add feed"}):void 0,renderDetail:({feed:d})=>d.store==="channel_messages"?e.jsx(Ee,{feed:d,hideHeader:!0}):e.jsx(Oe,{feed:d,connectorDef:n,ownerSlug:s})})}),c&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:l?"Add channel":"Add feed"}),e.jsx(ze,{organizationId:t.organization_id,connections:[t],connectorDefinitions:[n],onClose:()=>a(!1)})]})]})}function wt({connector:t,ownerSlug:n}){const{data:s=[],isLoading:r,isError:i}=J(t.key);if(r)return e.jsx(b,{className:"h-28 w-full"});if(i)return e.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const o=t.actions_schema??{},c=s.map(a=>({id:a.operation_key,name:a.name??a.operation_key,description:a.description,operation:a}));return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(C,{entries:c,label:"actions",renderControl:()=>e.jsx(R,{ownerSlug:n,connectorKey:t.key}),renderDetail:({operation:a,name:l})=>o[a.operation_key]?e.jsx(P,{hideHeading:!0,item:{href:"",title:l,schemaSections:z(o[a.operation_key])}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function bt({owner:t,path:n}){const{data:s,isLoading:r}=S(t,{slug:t}),i=s?.workspace,o=i?.type==="organization"?i.id:null,c=o?{slug:t}:void 0,{data:a,isLoading:l}=D(`/${t}/${B(n)}`,c),p=a?.entity,d=p?.id;return r||l?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):o?d==null?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):p?.is_derived?e.jsx(Me,{record:{type:p.entity_type,key:p.slug},orgContext:c}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:o,ownerSlug:t,entityId:typeof d=="number"?d:void 0,filters:{sortBy:"date",sortOrder:"desc"},emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function kt(t){if(Array.isArray(t.enum))return`One of ${t.enum.length}`;if(t.format==="date"||t.format==="date-time")return"Date";if(t.format==="uri")return"Link";if(t.format==="email")return"Email";const n=Array.isArray(t.type)?t.type[0]:t.type;return n==="array"?"List":n==="object"?"Group":n==="integer"||n==="number"?"Number":n==="boolean"?"Yes / no":"Text"}function At({owner:t,typeSlug:n,view:s}){const{data:r,isLoading:i}=S(t,{slug:t}),o=r?.workspace,c=o?.type==="organization"?o.id:null,{isAdmin:a}=ee(c??void 0),{orgContext:l}=te(),{data:p,isSuccess:d}=se(l),y=(p??[]).find(w=>w.slug===n),j=d&&!y,m=`/${t}/${ne(n)}`,{pathname:g}=re(),v=g===m||g===`${m}/`||g.startsWith(`${m}/-/`),h=f.useMemo(()=>He(y?.metadata_schema),[y?.metadata_schema]),u=A(),x=u?.close;f.useEffect(()=>{j&&x?.()},[j,x]);const k=f.useMemo(()=>({entityTypes:[n],sortBy:"date",sortOrder:"desc"}),[n]);if(i)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(j)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This entity type no longer exists."});if(!c)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."});const K=y?.name??n;return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[v?null:e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{...oe(t,n),children:[e.jsx(ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Browse records"]})}),y&&!v&&!ae(y)&&y.entity_count!==0?e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{to:"/$owner/$entityType/-/$shape",params:{owner:t,entityType:n,shape:"graph"},search:le(E(t,n)),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Graph"]})}):null,s!=="activity"&&u?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>u.open({href:E(t,n,"activity"),title:`${K} activity`}),children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Activity"]}):null]}),s==="activity"?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:c,ownerSlug:t,filters:k,showEntityLinks:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to these records yet."})})}):a?e.jsx("div",{className:"p-4",children:e.jsx(Ke,{slug:n,onClose:()=>x?.()})}):h.length>0?e.jsxs("section",{"aria-labelledby":"entity-type-peek-fields",className:"px-4 py-4",children:[e.jsx("h3",{id:"entity-type-peek-fields",className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Fields"}),e.jsx("dl",{className:"divide-y divide-border/60 text-sm",children:h.map(w=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",title:w.prop.description,children:[e.jsx("dt",{className:"min-w-0 truncate",children:qe(w)}),e.jsx("dd",{className:"shrink-0 text-xs text-muted-foreground",children:kt(w.prop)})]},w.key))})]}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This type has no fields yet."})]})}function Ct({owner:t,eventId:n,viewKey:s}){const r=A(),i=(o,c)=>e.jsx(Ue,{owner:c,organizationId:o,eventId:n,viewKey:s,dense:!0,onSelectView:r?a=>r.retarget(a):void 0},`${c}/${n}/${s??""}`);return e.jsx("div",{className:"px-4 py-4",children:t==="me"?i(null,t):e.jsx(ue,{owner:t,children:({organizationId:o,ownerSlug:c})=>o?i(o,c):e.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function L({owner:t,runId:n,runIds:s,contentIds:r}){const{data:i,isLoading:o}=S(t==="me"?null:t,{slug:t}),c=i?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,l=f.useMemo(()=>{if(t==="me")return r?.length?{contentIds:r,sortBy:"date",sortOrder:"desc"}:void 0;const d=s??(n!=null?[n]:void 0);if(!(!d?.length&&!r?.length))return{...d?.length?{runIds:d}:{},...r?.length?{contentIds:r}:{}}},[t,r,n,s]),p=l!=null;return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):t!=="me"&&a==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):p?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{presentation:"detail",organizationId:a,ownerSlug:t,filters:l,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:n!=null||s?.length?"No matching events from this run yet.":"No matching events yet."})})}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}const _=25;function St({target:t}){const[n,s]=f.useState(0),{data:r,isLoading:i,isError:o,refetch:c}=me(t.entityId,t.orgContext,{relationshipType:t.relationshipType,limit:_,offset:n}),a=r?.total;return e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.label," · ",t.entityName,a!==void 0?` · ${a} current ${a===1?"link":"links"}`:r?` · ${r.rows.length} shown`:""]}),e.jsx(Qe,{count:r?.failures?.length??0,onRetry:()=>void c()}),i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"h-6 w-full"}),e.jsx(b,{className:"h-6 w-full"})]}):o||!r?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load these links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void c(),children:"Retry"})]}):r.rows.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No links on this page."}):e.jsx("ul",{className:"divide-y divide-border",children:r.rows.map(l=>e.jsx("li",{className:"flex items-center justify-between gap-3 py-1.5",children:e.jsx(Ye,{row:l,entityId:t.entityId,ownerSlug:t.ownerSlug,orgContext:t.orgContext})},l.id))}),r&&(n>0||r.hasMore)?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:n===0,onClick:()=>s(Math.max(0,n-_)),children:"Previous"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[r.rows.length," shown",a===void 0?"":` of ${a}`]}),e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:!r.hasMore,onClick:()=>s(n+_),children:"Next"})]}):null]})}function It({owner:t,path:n,viewKey:s}){const[r,i]=f.useState({}),{data:o,isLoading:c}=S(t,{slug:t}),a=o?.workspace,l=a?.type==="organization"?a.id:null,p=l?{slug:t,organizationId:l}:void 0,{data:d,isLoading:y}=D(`/${t}/${B(n)}`,p),{isMember:j,isPublic:m,isLoading:g}=pe(t),v=j||m,h=xe({slug:t,organizationId:j?l:null}),u=d?.entity;if(c||y||g||v&&h.isLoading)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(!v)return e.jsx(Ge,{});if(h.isError)return e.jsx(Ze,{onRetry:()=>void h.refetch()});const x=u?he(h.data??[],{type:u.entity_type,id:u.id??u.slug}).find(k=>k.key===s):void 0;return!l||!u||!x?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This view isn't attached to this record any more."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(Je,{orgSlug:t,viewKey:x.key,scope:{type:u.entity_type,entity:u.is_derived?u.slug:u.id??u.slug},params:r,onParamsChange:i,contentHash:x.content_hash,title:x.name,minHeight:320})})}function M({owner:t,runId:n}){const s=fe({queryKey:["run-outcome",t,n],queryFn:async()=>{const i=await ge("manage_operations",{action:"get_run",run_id:n},{slug:t});if(!i.run)throw new Error(i.error||"Run not found");return i.run},enabled:t!=="me",staleTime:15e3,refetchInterval:i=>["pending","claimed","running"].includes(i.state.data?.status??"")?5e3:!1});if(t==="me")return null;if(s.isLoading)return e.jsx("p",{role:"status",className:"px-4 pt-4 text-xs text-muted-foreground",children:"Loading run…"});if(!s.data)return e.jsx("p",{role:"alert",className:"px-4 pt-4 text-sm text-destructive",children:"Could not load this run."});const r=s.data;return e.jsxs("section",{"aria-label":"Run outcome",className:"space-y-2 border-b px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Xe,{status:et(r.status),children:r.status}),e.jsx("time",{dateTime:r.created_at,className:"text-xs text-muted-foreground",children:ye(r.created_at)})]}),r.connection_display_name?e.jsx("p",{className:"text-sm",children:r.connection_display_name}):null,r.error_message?e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-destructive",children:r.error_message}):null,s.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not refresh this run. Showing its last known outcome."}):null]})}function Is({item:t}){const n=A();if(t.connectorPanel)return e.jsx(yt,{panel:t.connectorPanel});if(t.schemaSections)return e.jsx(P,{item:t});if(t.recordField)return e.jsx(We,{target:t.recordField});if(t.recordPeer)return e.jsx(Ve,{target:t.recordPeer});if(t.recordLinks)return e.jsx(St,{target:t.recordLinks});if(typeof t.browserUrl=="string"&&t.browserUrl.length>0)return e.jsx(O,{item:t});const s=t.href?je(t.href):null;return s?s.kind==="runs"?e.jsx("section",{"aria-label":"Runs history",className:"p-4",children:e.jsx(tt,{scope:{workspace:!0},ownerSlug:s.owner,filterState:s.filters,onFilterChange:r=>n?.retarget(ve(s.owner,r))})}):s.kind==="memory"?"runId"in s?e.jsxs(e.Fragment,{children:[e.jsx(M,{owner:s.owner,runId:s.runId}),e.jsx(L,{owner:s.owner,runId:s.runId})]}):"runIds"in s?e.jsx(L,{owner:s.owner,runIds:s.runIds}):e.jsx(L,{owner:s.owner,contentIds:s.contentIds}):s.kind==="entity"?e.jsx(bt,{owner:s.owner,path:s.path}):s.kind==="entity-type"?e.jsx(At,{owner:s.owner,typeSlug:s.typeSlug,view:s.view}):s.kind==="record-view"?e.jsx(It,{owner:s.owner,path:s.path,viewKey:s.viewKey}):s.kind==="event"?e.jsx(Ct,{owner:s.owner,eventId:s.eventId,viewKey:s.viewKey}):t.runId?e.jsx(Pt,{owner:s.owner,automationId:s.automationId,runId:t.runId}):e.jsx(Lt,{owner:s.owner,automationId:s.automationId}):e.jsx(O,{item:t})}function O({item:t}){const n=t.body,s=t.notificationType??"generic",r=t.createdAt,i=t.browserUrl??null,o=t.browserHandoff??null;return e.jsxs("article",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ne,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:we(s)}),r?e.jsx("span",{children:be(r)}):null]})]}),n?e.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:e.jsx(ke,{text:n,linkPolicy:s==="action_approval_needed"?"app-links":"strip"})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),t.owner&&t.sourceAttribution?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),e.jsx(Ae,{owner:t.owner,source:t.sourceAttribution,className:"text-xs"})]}):null,i?e.jsx("div",{className:"space-y-2",children:o?.state==="expired"?e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:o.error_message??"This draft expired before the page was opened."}):o?.state==="completed"||o?.state==="preparing"?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):e.jsxs(N,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{Se(i)},children:[e.jsx(Ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function Pt({owner:t,automationId:n,runId:s}){const{organizationId:r}=Ie(t),i=st(n,void 0,r),o=nt(i.data?.automation);return o?e.jsx(xt,{agentId:o,automationId:n,ownerSlug:t,runId:s}):i.isLoading?e.jsx(b,{className:"h-24 w-full rounded-lg"}):e.jsx(M,{owner:t,runId:s})}function Lt({owner:t,automationId:n}){return e.jsx(Pe,{owner:t,agentId:null,automationId:n,view:"activity",onDone:()=>{}})}export{Is as PeekPaneContent};
2
+ //# sourceMappingURL=peek-pane-content-D68BjguQ.js.map
@@ -0,0 +1,2 @@
1
+ import{j as a,B as l,i as u}from"./index-DdBTTN3y.js";const c=({prompts:e,onPick:s,className:n})=>e.length===0?null:a.jsx("div",{className:u("flex flex-wrap gap-2",n),children:e.map(t=>a.jsx(l,{type:"button",variant:"outline",size:"sm",className:"h-auto rounded-full whitespace-normal px-3.5 py-1.5 text-left",title:t.message,"aria-label":`${t.title}: ${t.message}`,onClick:()=>s(t.message),children:t.title},`${t.title}\0${t.message}`))}),i=new Map;function d(e,s){const n=s.trim();n&&i.set(e,n)}function o(e){const s=i.get(e);return s===void 0?null:(i.delete(e),s)}export{c as P,d as s,o as t};
2
+ //# sourceMappingURL=pending-seed-sml8Uf6e.js.map
@@ -0,0 +1,2 @@
1
+ import{v as i,eP as r,j as e,j2 as c}from"./index-DdBTTN3y.js";import{A as m}from"./agent-permissions-matrix-bP1Qihv7.js";import{A as g,a as l}from"./agent-tab-intro-ednTs4WF.js";function x({owner:n,agentId:s}){const{orgContext:t}=i(),{isAdmin:a,isLoading:o}=r(t.organizationId);return e.jsx(g,{children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(l,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(m,{owner:n,agentId:s})})]}):o?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function h(){const{owner:n,agentId:s}=c.useParams();return e.jsx(x,{owner:n,agentId:s})}export{h as component};
2
+ //# sourceMappingURL=permissions-BvA9SATv.js.map
@@ -0,0 +1,2 @@
1
+ import{hA as w,h8 as f,h9 as y,r as N,j as e,W as k,B as d,H as A,eS as C}from"./index-DdBTTN3y.js";import{a as P}from"./runs-fFJ1lPnw.js";function B({resource:g,runId:t,children:h,onDone:l}){const c=!!t,{data:a,isLoading:S,isError:u,refetch:v}=P(g,c?t:void 0),s=w({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=f(),i=y(),[p,x]=N.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{t&&n.mutate({run_id:t},{onSuccess:()=>l?.()})},R=()=>{if(!t)return;const r=p.trim();i.mutate({run_id:t,...r?{reason:r}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. The values below show the proposed change — ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(A,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(C,{id:"review-reject-reason",rows:2,value:p,onChange:r=>x(r.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{B as P};
2
+ //# sourceMappingURL=proposal-review-shell-D6KABxah.js.map
@@ -0,0 +1,2 @@
1
+ import{r as e,dA as l}from"./index-DdBTTN3y.js";function a(){return e.useEffect(()=>{l()},[]),null}export{a as P};
2
+ //# sourceMappingURL=public-shell-ready-BIVCHQHe.js.map
@@ -0,0 +1,2 @@
1
+ import{aA as fs,j as e,r as b,c as V,w as ie,cO as ps,cP as hs,cQ as vs,L as Ge,a0 as ys,cR as gs,cS as xs,cG as bs,cT as It,cU as A,bj as ft,cV as js,cW as ks,ao as Cs,cX as Ss,an as Ns,cY as _s,cZ as ae,cn as Is,c_ as At,c$ as As,aq as Es,d0 as Ts,bb as Fs,d1 as Rs,aw as Ce,d2 as ws,d3 as Os,at as Et,aI as Tt,d4 as Ms,cB as Ps,d5 as Ls,d6 as Ft,d7 as $s,d8 as Ds,ct as Bs,b8 as Ks,bl as Gs,bm as Us,d9 as Vs,bn as Qs,bo as zs,bp as Ws,S as Hs,da as Ys,I as qs,i as Ne,X as Zs,B as W,db as Xs,dc as Js,dd as en,bQ as tn,de as sn,df as nn,dg as on,dh as Rt,di as pt,q as an,dj as cn,dk as Pe,dl as ht,cD as rn,dm as ln,l as dn,aH as un,dn as mn,dp as fn,dq as pn,dr as hn,ds as vn,dt as yn,du as gn,b_ as xn,dv as bn,aY as jn,b2 as vt,dw as yt,dx as wt,cp as Le,cN as Ot,dy as kn,dz as $e}from"./index-DdBTTN3y.js";import{S as B,F as Cn,d as Sn,o as ke,r as Nn,f as _n,a as In}from"./filter-bar-wPaR12SS.js";import{c as gt}from"./connection-label-BobuYiAG.js";import{u as An,M as oe,a as En,c as Tn,f as Fn,b as Rn,s as wn}from"./manage-gear-D8LMhehh.js";import{u as On}from"./runs-fFJ1lPnw.js";import{S as Mn}from"./source-record-panels-Bh0n4gGw.js";import{u as Pn}from"./clients-BJRcMk1A.js";import{u as Ln}from"./client-activity-scopes-CXOWB5co.js";import{g as $n}from"./client-rows-36VnmgMK.js";import{a as Dn,E as Bn}from"./events-feed-B9CZHI_P.js";import{L as Kn,u as Gn}from"./renderer-DXfJaCCa.js";import{E as Un}from"./agent-loading-shells-ClY_O6lb.js";import{M as Vn}from"./member-scope-gate-4FQ0aanZ.js";const Ue=b.createContext(null);function Qn({organizationId:t,isWorkspaceLoading:s,children:o}){const{data:n=[],isLoading:a}=fs(t);return e.jsx(Ue.Provider,{value:{groups:n,isLoading:!!s||a},children:o})}function zn(){const t=b.useContext(Ue);if(!t)throw new Error("useMemoryConnectorGroups must be used within MemoryConnectorGroupsProvider");return t}function Wn(){return b.useContext(Ue)}function Mt(t){const{parse:s,serialize:o,filterKeys:n,clearClassifications:a=!0,replace:i=!0,merge:m}=t,u=V(),d=ie(),r=b.useMemo(()=>{const g=new URLSearchParams;for(const[l,h]of Object.entries(d.search||{}))h!=null&&g.set(l,typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h):String(h));return s(g)},[d.search,s]),c=b.useCallback((g,l)=>{const h=m?m(r,g):{...r,...g},y=o(h),C={};for(const[S,x]of Object.entries(d.search||{}))x!=null&&(C[S]=x);for(const S of n)delete C[S];if(a)for(const S of Object.keys(C))S.startsWith("clf_")&&delete C[S];for(const[S,x]of Object.entries(y))x!==void 0&&(C[S]=x);u({to:d.pathname,search:C,replace:l?.replace??i})},[r,o,n,a,m,u,d,i]),f=b.useCallback(()=>{const g={};for(const[l,h]of Object.entries(d.search||{}))h!=null&&(n.includes(l)||a&&l.startsWith("clf_")||(g[l]=h));u({to:d.pathname,search:g,replace:i})},[u,d.pathname,d.search,n,a,i]);return{filters:r,updateFilters:c,clearFilters:f}}function Hn(t){const{slug:s}=ps();return hs({queryKey:["schedules",s,t],queryFn:async()=>((await vs("manage_schedules",{action:"list",action_type:"wake_agent",include_paused:!0})).schedules??[]).filter(n=>n.action_args?.agent_id===t),enabled:!!s&&!!t,staleTime:3e4})}function ye({id:t,label:s,value:o,sourceLink:n,details:a,onRemove:i}){return{id:t,label:s,op:"is",value:o,onRemove:i,editor:n||a?{kind:"custom",className:"w-80",render:()=>e.jsxs("div",{className:"flex flex-col gap-2 p-3 text-sm",children:[n?e.jsxs(Ge,{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:o}),e.jsx(ys,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}):e.jsx("span",{className:"font-medium",children:o}),a]})}:void 0}}function Yn({ownerSlug:t,clientIds:s,linkedUser:o,linkedUserEntitySlug:n}){const a=t&&n?gs(t,[{entity_type:"$member",slug:n}]):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:s.length===1?"Client ID":"Client IDs"}),s.map(i=>e.jsx("code",{className:"break-all text-foreground",children:i},i))]}),o?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:["Granted by",a?e.jsx(Ge,{to:a,className:"font-medium text-foreground hover:underline",children:o}):e.jsx("span",{className:"font-medium text-foreground",children:o})]}):null]})}function ee(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function ge(t,s,o){const n=new Set;for(const[a,i]of Object.entries(t.feeds_schema??{})){if(o&&!o.has(a))continue;const m=ee(ee(i)?.eventKinds);if(m)for(const[u,d]of Object.entries(m)){if(!s){n.add(u);continue}const r=ee(d)?.attributions;Array.isArray(r)&&r.some(c=>{const f=ee(ee(c)?.target);return typeof f?.entityType=="string"&&s.has(f.entityType)})&&n.add(u)}}return n}function qn({connectors:t,entityTypes:s,selectedPlatforms:o=[],selectedFeeds:n=[],selectedEntityTypes:a=[]}){const i=new Set,m=new Set(o),u=new Set(a),d=new Map;for(const r of n){const c=d.get(r.connectorKey)??new Set;c.add(r.feedKey),d.set(r.connectorKey,c)}if(d.size>0)for(const r of t){const c=d.get(r.key);if(c)for(const f of ge(r,void 0,c))i.add(f)}else if(m.size>0){for(const r of t)if(m.has(r.key))for(const c of ge(r))i.add(c)}else if(u.size>0){for(const r of s)if(u.has(r.slug))for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r,u))i.add(c)}else{for(const r of s)for(const c of Object.keys(r.event_kinds??{}))i.add(c);for(const r of t)for(const c of ge(r))i.add(c)}return[...i].sort((r,c)=>r.localeCompare(c))}const De=["produced","analyzed"],Se=t=>t==="produced"?"Produced by":"Analyzed by";function Zn({enabled:t,...s}){const o=Xn(s,t);if(!t)return{fields:[],chips:[]};const n=Jn(s);return{fields:[o.field,n.field],chips:[...o.chips,...n.chips]}}function Xn({ownerSlug:t,filters:s,onFiltersChange:o},n){const a=An(t,n),i=a.data??[],m=c=>c==="produced"?s.producedByAutomationId:s.automationId,u=c=>i.find(f=>Number(f.automation_id)===c)?.name??`#${c}`,d=De.flatMap(c=>{const f=m(c);return f==null?[]:[{id:`automation-${c}`,field:"automation",label:Se(c),value:u(f),onRemove:()=>o(c==="produced"?{producedByAutomationId:null}:{automationId:null})}]}),r={kind:"list",className:"w-80",searchPlaceholder:"Search Automations...",emptyText:a.isLoading?"Loading Automations...":"No Automations found",items:c=>e.jsxs(e.Fragment,{children:[De.map(f=>{const g=m(f),l=i.map(y=>({id:Number(y.automation_id),label:`${y.name}${y.status==="archived"?" (archived)":""}`}));g!=null&&!l.some(y=>y.id===g)&&l.unshift({id:g,label:`Automation #${g} (selected)`});const h=y=>{o(f==="produced"?{producedByAutomationId:y}:{automationId:y}),c()};return e.jsx(It,{heading:Se(f),children:l.map(y=>e.jsxs(A,{"aria-label":y.label,value:`${f} ${y.label} ${y.id}`,onSelect:()=>h(y.id),className:"group",children:[e.jsx(B,{selected:g===y.id}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.label}),e.jsx(oe,{...En(t,String(y.id)),label:y.label})]},y.id))},f)}),a.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void a.refetch(),children:"Could not load Automations. Retry"}):null]})};return{chips:d,field:{key:"automation",label:"Automation",group:"Scope",icon:e.jsx(xs,{className:"h-4 w-4"}),editor:r}}}function Jn(t){const{filters:s,onFiltersChange:o}=t,n=[];s.runIds?.length&&n.push({id:"run-produced",field:"run",label:"Produced by run",value:s.runIds.map(i=>`#${i}`).join(", "),onRemove:()=>o({runIds:null})}),s.runId!=null&&n.push({id:"run-analyzed",field:"run",label:"Analyzed by run",value:`#${s.runId}`,onRemove:()=>o({runId:null})});const a={kind:"list",className:"w-96",searchPlaceholder:"Search runs or enter a run ID...",emptyText:"No matching runs. Enter an exact run ID or load more.",items:(i,m)=>De.map(u=>e.jsx(eo,{...t,mode:u,query:m,close:i},u))};return{chips:n,field:{key:"run",label:"Run",group:"Scope",icon:e.jsx(bs,{className:"h-4 w-4"}),editor:a}}}function eo({ownerSlug:t,filters:s,onFiltersChange:o,mode:n,query:a,close:i}){const m=n==="produced"?s.producedByAutomationId:s.automationId,u=On({workspace:!0},{automationIds:m==null?void 0:[m],runTypes:n==="analyzed"?["automation"]:void 0,connectionIds:n==="produced"?s.connectionIds??void 0:void 0,feedIds:n==="produced"?s.feedIds??void 0:void 0},t),d=n==="produced"?s.runIds??[]:s.runId==null?[]:[s.runId],r=u.data?.pages.flatMap(l=>l.runs)??[],c=[...new Map(r.map(l=>[l.id,{id:l.id,label:`Run #${l.id} · ${l.feed_display_name??l.operation_key??l.run_type} · ${l.status}`}])).values()];for(const l of d)c.some(h=>h.id===l)||c.unshift({id:l,label:`Run #${l} (selected)`});const f=l=>{if(n==="produced"){const h=d.includes(l)?d.filter(y=>y!==l):[...d,l];o({runIds:h.length?h:null})}else o({runId:l}),i()},g=/^\d+$/.test(a.trim())?Number(a.trim()):0;return e.jsxs(It,{heading:Se(n),children:[c.map(l=>e.jsxs(A,{value:`${n} ${l.label}`,onSelect:()=>f(l.id),children:[e.jsx(B,{selected:d.includes(l.id)}),e.jsx("span",{className:"truncate",children:l.label})]},l.id)),Number.isSafeInteger(g)&&g>0&&!c.some(l=>l.id===g)?e.jsxs(A,{value:`${n} ${g}`,onSelect:()=>f(g),children:[Se(n)," run #",g]}):null,u.isLoading?e.jsx(A,{disabled:!0,forceMount:!0,children:"Loading runs..."}):null,u.isError?e.jsx(A,{forceMount:!0,onSelect:()=>void(u.isFetchNextPageError?u.fetchNextPage():u.refetch()),children:"Could not load runs. Retry"}):null,!u.isLoading&&!u.isError&&!c.length?e.jsx(A,{disabled:!0,forceMount:!0,children:"No runs found"}):null,u.hasNextPage?e.jsx(A,{forceMount:!0,disabled:u.isFetching,onSelect:()=>void u.fetchNextPage(),children:u.isFetchingNextPage?"Loading more runs...":"Load more runs"}):null]})}const Ve="Scope",Me="Source",z="h-4 w-4";function ce(){return ie().search??{}}function Pt(t){const{pathname:s}=ie(),o=s.startsWith(`/${t}/events/`),n=Cs(s,o?1:0),a=!!(n&&!o&&!Ss(n.split("/")[0]));return{pathname:s,embedded:a,recordPath:a?Ns(n)?.entityPath:o?n:void 0}}function Lt(t){const s=ce(),{recordPath:o,pathname:n,embedded:a}=Pt(t);return i=>{const m=ae(t,s,i,o);return a?{to:n,search:m.search}:m}}const xt=t=>new Set((t??"").split(",").map(s=>s.trim()).filter(Boolean));function to({ownerSlug:t,sourceRead:s=!1,filters:o,onFiltersChange:n}){const a=ce(),{recordPath:i,embedded:m}=Pt(t),u=i?i.split("/").at(-2):void 0,d=typeof a.type=="string"&&a.type.trim()?a.type.trim():void 0,r=(u?ft(u):void 0)??(d?ft(d):void 0),c=js(a),f=ks(a),g=typeof a.feed_ids=="string"?a.feed_ids:typeof a.feed_ids=="number"?String(a.feed_ids):void 0,l=so(t,r,!m),h=no(t,r,i,m),y=oo(t,c,!s),C=Zn({ownerSlug:t,filters:o,onFiltersChange:n,enabled:!s}),S=ao(t,f,g);return[l,h,y,C,S].reduce((x,F)=>({fields:[...x.fields,...F.fields],chips:[...x.chips,...F.chips]}),{fields:[],chips:[]})}function so(t,s,o){const n=V(),a=ce(),{visible:i}=_s(t);if(!o)return{fields:[],chips:[]};const m=i.find(d=>d.slug===s),u={kind:"list",searchPlaceholder:"Search types...",emptyText:"No entity types",items:d=>e.jsxs(e.Fragment,{children:[i.map(r=>e.jsxs(A,{onSelect:()=>{n(ae(t,a,{entity:void 0,create:void 0,type:r.slug})),d()},className:"group gap-2",children:[e.jsx(B,{selected:r.slug===s}),e.jsx(Ls,{icon:r.icon,className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),typeof r.entity_count=="number"?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.entity_count}):null,e.jsx(oe,{to:"/$owner/entity-types/$slug",params:{owner:t,slug:r.slug},label:r.name})]},r.id)),e.jsxs(A,{onSelect:()=>{n($s(t)),d()},className:"text-muted-foreground",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add entity type"]})]})};return{fields:[{key:"type",label:"Entity type",group:Ve,icon:e.jsx(Is,{className:z}),editor:u}],chips:s?[{id:"type",label:"Entity type",op:"is",value:m?.name??s,onRemove:()=>void n(ae(t,a,{type:void 0}))}]:[]}}function no(t,s,o,n){const a=V(),i=ce(),[m,u]=b.useState(""),[d,r]=b.useState(0),c=At(m,250),f={slug:t},{data:g,isLoading:l,isError:h,refetch:y}=As(s??"",f,{search:c,offset:d,limit:30,enabled:!n&&!!s}),{data:C}=Es(o?`/${t}/${o}`:"",f),S=o?C?.entity:void 0,x=S?.name??(o?o.split("/").at(-1):void 0);if(n)return{fields:[],chips:x?[{id:"entity",label:"Entity",op:"is",value:x}]:[]};if(!s)return{fields:[],chips:[]};const F={kind:"list",searchPlaceholder:"Search entities...",emptyText:l?"Loading entities...":"No matching entities",className:"w-80",onQueryChange:O=>{u(O),r(0)},items:O=>e.jsxs(e.Fragment,{children:[h?e.jsx(A,{onSelect:()=>void y(),children:"Could not load entities. Retry"}):g?.entities.map(I=>e.jsxs(A,{value:I.slug,onSelect:()=>{const M=Ds([...I.parent_slug&&I.parent_entity_type?[{entity_type:I.parent_entity_type,slug:I.parent_slug}]:[],{entity_type:I.entity_type,slug:I.slug}]);a(ae(t,i,{type:s},M)),O()},children:[e.jsx(B,{selected:S?.slug===I.slug}),I.name]},I.slug)),d>0&&e.jsx(A,{onSelect:()=>r(Math.max(0,d-30)),children:"Previous entities"}),g?.metadata.has_more&&e.jsx(A,{disabled:l,onSelect:()=>r(d+30),children:"More entities"})]})};return{fields:[{key:"entity",label:"Entity",group:Ve,icon:e.jsx(Ts,{className:z}),editor:F}],chips:x?[{id:"entity",label:"Entity",op:"is",value:x,onRemove:()=>void a(ae(t,i,{type:s}))}]:[]}}function oo(t,s,o){const n=V(),a=Lt(t),{data:i=[]}=Fs(),m=b.useMemo(()=>[...i].sort((r,c)=>r.name.localeCompare(c.name)),[i]);if(!o)return{fields:[],chips:[]};const u=m.find(r=>r.agentId===s),d={kind:"list",searchPlaceholder:"Search agents...",emptyText:"No agents",items:r=>m.map(c=>e.jsxs(A,{onSelect:()=>{n(a({agent:c.agentId,schedule:void 0})),r()},className:"gap-2",children:[e.jsx(B,{selected:c.agentId===s}),e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-md bg-muted text-[10px] font-medium",children:c.name.trim().charAt(0).toUpperCase()||"?"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:c.name})]},c.agentId))};return{fields:[{key:"agent",label:"Agent",group:Ve,icon:e.jsx(Rs,{className:z}),editor:d}],chips:s?[{id:"agent",label:"Agent",op:"is",value:u?.name??s,onRemove:()=>void n(a({agent:void 0,schedule:void 0}))}]:[]}}function ao(t,s,o){const n=V(),a=Lt(t),{groups:i}=zn(),m=ce(),u=Ce({platforms:String(m.platforms??m.platform??"")}).platforms??[],d=b.useMemo(()=>xt(s),[s]),r=b.useMemo(()=>xt(o),[o]),c=u.length===1?u[0]:ws(i,d),f=i.find(_=>_.connector_key===c),g=d.size===1?Number([...d][0]):void 0,l=Os(g),{org:h}=Et(),y=Tt(h?.id,{feedIds:[...r].map(Number),enabled:g==null&&r.size>0}),C=g==null?y:l,S=C.data??[],x={platforms:void 0,platform:void 0,connection_ids:void 0,feed_ids:void 0},F={kind:"list",searchPlaceholder:"Search connectors...",emptyText:"No connectors",items:_=>e.jsxs(e.Fragment,{children:[i.map(k=>{const E=k.connector_name??k.connector_key;return e.jsxs(A,{disabled:k.connections.length===0,onSelect:()=>{n(a({...x,platforms:k.connector_key})),_()},className:"group gap-2",children:[e.jsx(B,{selected:k.connector_key===f?.connector_key}),e.jsx(Ks,{plain:!0,name:E,faviconDomain:k.favicon_domain,className:"h-5 w-5 shrink-0 rounded-md text-[10px]"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:E}),k.connection_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:k.connection_count}):null,e.jsx(oe,{to:"/$owner/connectors/$connectorKey",params:{owner:t,connectorKey:k.connector_key},label:E})]},k.connector_key)}),e.jsx(A,{asChild:!0,onSelect:_,className:"text-muted-foreground",children:e.jsxs(Ge,{to:"/$owner/connectors/create",params:{owner:t},className:"flex items-center gap-2",children:[e.jsx(Ft,{className:"h-4 w-4 shrink-0"}),"Add connector"]})})]})},O=[{key:"connector",label:"Connector",group:Me,icon:e.jsx(Bs,{className:z}),editor:F}],I=[],M=f?.connector_name??f?.connector_key??(u.join(", ")||(d.size?`Connections ${[...d].join(", ")}`:void 0));if(M&&I.push({id:"connector",label:"Connector",op:"is",value:M,onRemove:()=>void n(a(x))}),f){O.push({key:"connection",label:"Connection",group:Me,icon:e.jsx(Ms,{className:z}),editor:Q(f)});const _=d.size===1?f.connections.find(k=>d.has(String(k.id))):void 0;_&&I.push({id:"connection",label:"Connection",op:"is",value:gt({display_name:_.display_name,connector_name:f.connector_name,connector_key:f.connector_key}),onRemove:()=>void n(a({...x,platforms:f.connector_key}))})}if((g||o)&&O.push({key:"feed",label:"Feed",group:Me,icon:e.jsx(Ps,{className:z}),editor:H()}),r.size>0){const _=r.size===1?S.find(k=>r.has(String(k.id))):void 0;I.push({id:"feed",label:"Feed",op:"is",value:_?xe(_):`#${o}`,onRemove:()=>void n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:void 0}))})}return{fields:O,chips:I};function Q(_){return{kind:"list",searchPlaceholder:"Search connections...",emptyText:"No connections",items:k=>_.connections.map(E=>{const L=gt({display_name:E.display_name,connector_name:_.connector_name,connector_key:_.connector_key});return e.jsxs(A,{onSelect:()=>{n(a({connection_ids:String(E.id),feed_ids:void 0})),k()},className:"group gap-2",children:[e.jsx(B,{selected:d.has(String(E.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:L}),E.feed_count>0?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:E.feed_count}):null,e.jsx(oe,{...Tn(t,{id:E.id,connector_key:_.connector_key}),label:L})]},E.id)})}}function H(){return{kind:"list",searchPlaceholder:"Search feeds...",emptyText:C.isLoading?"Loading feeds...":"No feeds",items:_=>S.map(k=>e.jsxs(A,{"aria-label":xe(k),onSelect:()=>{n(a({...g!=null?{connection_ids:String(g)}:{},feed_ids:String(k.id)})),_()},className:"group gap-2",children:[e.jsx(B,{selected:r.has(String(k.id))}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:xe(k)}),e.jsx(oe,{...Fn(t,k),label:xe(k)})]},k.id))}}}function xe(t){return t.display_name?.trim()||t.feed_key}const io=["notification"],co=["note","summary","decision","observation","fact","change","preference","identity"],ro=[...io,...co],bt=[{value:"date-desc",label:"Newest first"},{value:"date-asc",label:"Oldest first"},{value:"score-desc",label:"Highest score"},{value:"score-asc",label:"Lowest score"}],$t={value:"notifications",label:"Notifications"};function lo({value:t,onChange:s,withNotifications:o=!1}){const n=o?[$t,...bt]:bt,a=n.find(i=>i.value===t)?.label??"Newest first";return e.jsxs(Gs,{value:t,onValueChange:s,children:[e.jsxs(Us,{"aria-label":"Sort",className:"h-9 w-auto shrink-0 gap-2 bg-background px-2.5",children:[e.jsx(Vs,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Qs,{children:a})]}),e.jsx(zs,{align:"end",className:"min-w-40",children:n.map(i=>e.jsx(Ws,{value:i.value,children:i.label},i.value))})]})}const jt=[{value:"user",label:"Manual review"},{value:"system",label:"Auto-classified"},{value:"llm",label:"LLM-classified"}],kt=[{value:"pending",label:"Pending approval"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}],be=0,je=100,te="Event",se="h-4 w-4";function ne(t){const s=t.replace(/[_-]+/g," ").trim();return s.length>0?`${s.charAt(0).toUpperCase()}${s.slice(1)}`:t}function uo(t,s,o){const n=t.semanticTypes??[],a=o.length>0?o:ro,i=[...new Set([...a,...n])].sort((f,g)=>ne(f).localeCompare(ne(g))).map(f=>({value:f,label:ne(f)})),m=t.engagementRange??[be,je],u=t.reviewStatus,d=t.interactionStatus,r=[{key:"date",label:"Date",group:te,icon:e.jsx(Js,{className:se}),editor:Sn({value:t.dateRange??void 0,onApply:f=>s({dateRange:f})})},{key:"kind",label:"Event kind",group:te,icon:e.jsx(en,{className:se}),editor:ke({searchPlaceholder:"Search event kinds...",emptyText:"No event kinds found",options:i,selected:n,multiple:!0,onSelect:f=>{const g=n.includes(f)?n.filter(l=>l!==f):[...n,f];s({semanticTypes:g.length>0?g:void 0})}})},{key:"approval",label:"Approval",group:te,icon:e.jsx(tn,{className:se}),editor:ke({searchPlaceholder:"Search statuses...",options:[...kt],selected:d?[d]:[],onSelect:f=>s({interactionStatus:f})})},{key:"review",label:"Reviewed by",group:te,icon:e.jsx(sn,{className:se}),editor:ke({searchPlaceholder:"Search reviewers...",options:[...jt],selected:u&&u!=="all"?[u]:[],onSelect:f=>s({reviewStatus:f})})},{key:"score",label:"Engagement score",group:te,icon:e.jsx(nn,{className:se}),editor:Nn({value:m,min:be,max:je,onApply:f=>s({engagementRange:f})})}],c=[];return t.dateRange&&c.push({id:"date",label:"Date",op:"is",value:_n(t.dateRange),onRemove:()=>s({dateRange:null})}),n.length&&c.push({id:"kind",label:"Event kind",op:n.length>1?"is any of":"is",value:n.length<=2?n.map(ne).join(", "):`${n.length} kinds`,title:n.map(ne).join(", "),onRemove:()=>s({semanticTypes:void 0})}),d&&c.push({id:"approval",label:"Approval",op:"is",value:kt.find(f=>f.value===d)?.label??d,onRemove:()=>s({interactionStatus:null})}),u&&u!=="all"&&c.push({id:"review",label:"Reviewed by",op:"is",value:jt.find(f=>f.value===u)?.label??u,onRemove:()=>s({reviewStatus:void 0})}),(m[0]!==be||m[1]!==je)&&c.push({id:"score",label:"Engagement score",value:In(m,be,je),onRemove:()=>s({engagementRange:void 0})}),{fields:r,chips:c}}function Dt({filters:t,onFiltersChange:s,eventKinds:o=[],searchQuery:n,onSearchChange:a,scope:i,extraFields:m=[],drillChips:u=[],total:d,isListLoading:r=!1,isTotalLoading:c=!1,hasCursorInUrl:f=!1,onGoToLatest:g,onShowNotifications:l,sourceRead:h=!1,filterTrailing:y,filterActions:C,onClearFilters:S}){const x=n.trim().length>0,F=h?{fields:[],chips:[]}:uo(t,s,o),O=[...i?.fields??[],...F.fields,...m],I=[...i?.chips??[],...u,...F.chips],M=I.length>0||x,Q=`${t.sortBy??"date"}-${t.sortOrder??"desc"}`,H=r||c?e.jsx(Hs,{className:"h-4 w-20"}):d==null?null:M?`${d.toLocaleString()} ${d===1?"match":"matches"}`:`${d.toLocaleString()} ${d===1?"item":"items"}`;return e.jsxs("div",{className:"w-full space-y-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!h&&e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx(Ys,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(qs,{type:"search","aria-label":"Search events",placeholder:"Search events...",value:n,onChange:_=>a(_.target.value),className:Ne("bg-background pl-9",x&&"pr-9")}),x&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>a(""),className:"absolute right-0.5 top-1/2 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:e.jsx(Zs,{className:"h-3.5 w-3.5"})})]}),!h&&e.jsx(lo,{value:Q,withNotifications:l!=null,onChange:_=>{if(_===$t.value){l?.();return}const[k,E]=_.split("-");s({sortBy:k,sortOrder:E})}})]}),e.jsx(Cn,{label:"Event filters",fields:O,chips:I,meta:H,actions:C,trailing:e.jsxs(e.Fragment,{children:[y,!r&&f&&g&&e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",onClick:g,children:[e.jsx(Xs,{className:"h-3.5 w-3.5"}),"Back to latest"]})]}),onClearAll:S,hasClearableState:x})]})}function Bt({ownerSlug:t,...s}){const o=to({ownerSlug:t,sourceRead:s.sourceRead,filters:s.filters,onFiltersChange:s.onFiltersChange});return e.jsx(Dt,{...s,scope:o})}const Be=3600*1e3,Ct=24*Be;function St(t){const s=t instanceof Date?t:new Date(String(t));return Number.isNaN(s.getTime())?null:s}function Nt(t){return t.toISOString().split("T")[0]}function Ke(t){return t.toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric"})}function mo(t){const o=t[t.length-1].date.getTime()-t[0].date.getTime()>180*Ct,n=new Map;for(const a of t){const i=new Date(a.date);o&&i.setUTCDate(i.getUTCDate()-i.getUTCDay()),n.set(i.getTime(),(n.get(i.getTime())??0)+a.count)}return[...n.entries()].sort(([a],[i])=>a-i).map(([a,i])=>{const m=new Date(a);return{start:m,end:new Date(a+(o?7:1)*Ct),count:i,label:`${m.getUTCMonth()+1}/${m.getUTCDate()}`,tooltip:o?`Week of ${Ke(m)}`:Ke(m)}})}function fo(t){const s=m=>{const u=new Date(m);return u.setMinutes(0,0,0),u.getTime()},o=new Map;for(const m of t)o.set(s(m),(o.get(s(m))??0)+1);const n=Math.min(...o.keys()),a=Math.max(...o.keys()),i=[];for(let m=n;m<=a;m+=Be){const u=new Date(m);i.push({start:u,end:new Date(m+Be),count:o.get(m)??0,label:pt(u,"HH:mm"),tooltip:pt(u,"MMM d, HH:mm")})}return i}function po({entityId:t,organizationId:s,ownerSlug:o,eventTimes:n,selectedRange:a,onSelectRange:i}){const{data:m,isLoading:u,error:d}=on(s,{entityId:t},{slug:o}),r=b.useMemo(()=>(m??[]).map(h=>{const y=St(h.date);return y?{date:y,count:h.count}:null}).filter(h=>h!==null).sort((h,y)=>h.date.getTime()-y.date.getTime()),[m]),c=b.useMemo(()=>{if(r.length===0)return[];if(r.length>1)return mo(r);const[h]=r,y=Nt(h.date),C=(n??[]).map(St).filter(S=>S!==null&&Nt(S)===y);return C.length===h.count?fo(C):[]},[r,n]),f=b.useCallback(h=>{const y=c[h.dataIndex];y&&i&&i(y.start,y.end)},[c,i]),g=b.useCallback(h=>{if(i&&h.startValue!==void 0&&h.endValue!==void 0){const y=new Date(h.startValue),C=new Date(h.endValue);i(y,C)}},[i]),l=b.useMemo(()=>{if(c.length<2)return null;let h;if(a){const[y,C]=a,S=c.filter(x=>x.start<C&&x.end>y);S.length>0&&(h=[[{xAxis:S[0].label},{xAxis:S[S.length-1].label}]])}return{tooltip:{trigger:"axis",axisPointer:{type:"line"},formatter:y=>{const C=y[0];return`${c[C.dataIndex]?.tooltip}: ${C.value} items`}},grid:{left:50,right:20,top:20,bottom:60},xAxis:{type:"category",boundaryGap:!1,data:c.map(y=>y.label)},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 Kn(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:c.map(y=>y.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:h?{silent:!0,itemStyle:{color:"rgba(99, 102, 241, 0.1)"},data:h}:void 0}]}},[c,a]);if(u||d)return e.jsx("div",{className:Ne(Rt,"p-4"),children:e.jsx("div",{className:"flex h-48 w-full items-center justify-center",children:u?e.jsx(Un,{}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load timeline"})})});if(r.length===0)return null;if(!l){const[h]=r;return e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.count===1?"1 event":`All ${h.count} events`," on"," ",Ke(h.date),"."]})}return e.jsx(ho,{option:l,onClick:f,onDataZoom:g})}function ho({option:t,onClick:s,onDataZoom:o}){const{chartRef:n,setOption:a}=Gn({onClick:s,onDataZoom:o});return b.useEffect(()=>{a(t,!0)},[t,a]),e.jsx("div",{"data-testid":"events-timeline",className:Ne(Rt,"p-4 relative"),children:e.jsx("div",{ref:n,className:"h-48 w-full"})})}const _t="change";function vo({kinds:t,onFiltersChange:s}){const o=!t?.length,n=t?.length===1&&t[0]===_t,a=i=>Ne("h-7 px-2.5 text-xs",i?"bg-muted text-foreground":"text-muted-foreground");return e.jsxs("fieldset",{"aria-label":"Show",className:"m-0 inline-flex min-w-0 items-center rounded-md border border-border p-0.5",children:[e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(o),"aria-pressed":o,onClick:()=>s({semanticTypes:void 0}),children:"All"}),e.jsx(W,{type:"button",variant:"ghost",size:"sm",className:a(n),"aria-pressed":n,onClick:()=>s({semanticTypes:[_t]}),children:"Changes"})]})}function yo({organizationId:t,ownerSlug:s,entityId:o,hideSourceFilter:n=!1,scopedEntityTypes:a,pinned:i,onShowNotifications:m,emptyState:u,changesShortcut:d=!1}){const{isAuthenticated:r,isReady:c}=an(),{isMember:f,isLoading:g}=Et(),l=c&&r&&f,h=c&&(!r||!g&&!f),y=V(),C=ie(),S=cn(),{filters:x,updateFilters:F,clearFilters:O}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),[I,M]=b.useState(x.searchQuery||""),[Q,H]=b.useState(Pe(x)||n&&(o!=null||!!a?.length)),_=I.trim(),k=_.length>=3?_:void 0,E=At(k,1e3),L=b.useRef(!1);b.useEffect(()=>S.history.subscribe(({location:p,action:v})=>{const N=Ce(new URLSearchParams(p.search)).searchQuery??"";!(v.type==="BACK"||v.type==="FORWARD"||v.type==="GO")&&L.current&&(N===(x.searchQuery??"")||N===(k??""))||(L.current=!1,M(N))}),[S.history,k,x.searchQuery]);const j=b.useMemo(()=>ht({...x,...a?.length?{entityTypes:a}:{}}),[x,a]),R=F;b.useEffect(()=>{L.current&&(x.searchQuery||void 0)!==E&&F({searchQuery:E})},[E,F,x.searchQuery]);const Qe=()=>{L.current=!1,M(""),n&&s?y({...$e(s,C.search??{}),...o!==void 0&&!C.pathname.startsWith(`/${s}/events/`)?{to:C.pathname}:{}}):O()},re=Pe(ht(x)),_e=o===void 0,{data:Kt=[]}=rn(c&&l?t:null),{data:Gt=[]}=ln(h?s:null),ze=l?Kt:Gt,{data:We=[]}=dn(l&&t?{organizationId:t}:void 0),le=Wn(),de=j.connectionIds,Ie=(de?.length??0)>0,{data:He=[]}=un(c&&l?t??"":"",{connectionIds:de??void 0,enabled:!le&&c&&l&&Ie}),Ye=j.feedIds,Ae=(Ye?.length??0)>0,{data:qe=[]}=Tt(c&&l?t:null,{feedIds:Ye??void 0,enabled:c&&l&&Ae}),Ze=b.useMemo(()=>le?le.groups.flatMap(p=>p.connections.map(v=>({id:v.id,display_name:v.display_name,connector_name:p.connector_name,connector_key:p.connector_key}))):He,[He,le]),Ee=b.useMemo(()=>{const p=new Set(de??[]);return[...new Set([...j.platforms??[],...Ze.filter(v=>p.has(v.id)).map(v=>v.connector_key)])]},[de,Ze,j.platforms]),Te=b.useMemo(()=>qe.map(p=>({connectorKey:p.connector_key,feedKey:p.feed_key})),[qe]),Ut=b.useMemo(()=>Ie&&Ee.length===0||Ae&&Te.length===0?[]:qn({connectors:ze,entityTypes:We,selectedPlatforms:Ee,selectedFeeds:Te,selectedEntityTypes:j.entityTypes}),[ze,j.entityTypes,Ie,Ae,Ee,Te,We]),w=j.clientIds,ue=(w?.length??0)>0,{data:Xe=[]}=Pn(null,{enabled:c&&l&&ue}),me=b.useMemo(()=>{if(!w)return[];const p=new Set(w);return $n(Xe).filter(v=>v.clientIds.some(N=>p.has(N)))},[w,Xe]),Je=b.useMemo(()=>{if(!ue||!w)return null;const p=me.map(v=>v.title);return p.length>0?p.join(", "):w.length>1?`${w.length} client registrations`:"Client registration"},[me,w,ue]),fe=me.length===1?me[0]:null,Vt=s&&fe?Rn(s,fe.clientId):void 0,pe=j.mcpActivityId??null,{data:et=[]}=Ln({enabled:c&&l&&ue&&!!pe,clientIds:w??[],limit:100}),tt=b.useMemo(()=>{if(!pe)return null;const p=et.find(N=>N.activityId===pe);if(!p)return"Selected conversation";const v=p.title?.trim();return v||(p.activityKind==="session"?"MCP session":p.clientId)},[pe,et]),Y=j.agentId,q=j.schedule,{data:st=[]}=Hn(Y??void 0),nt=b.useMemo(()=>!q||!Y?null:st.find(v=>v.id===q)?.description?.trim()||"Scheduled task",[Y,q,st]),{data:Qt}=mn(c&&l?t:null,o),{data:zt}=fn(h&&!_e?s:null,o),ot=l?Qt:zt,Fe=b.useMemo(()=>{const p=new Map;for(const v of ot||[]){const N=v.automation_name??"__global__";p.has(N)||p.set(N,{automationName:v.automation_name??null,classifiers:[]});const T=p.get(N),$=v.attribute_values||{},P=Object.keys($);let ve=null;const Z={};for(const[X,U]of Object.entries($))if(U.parent)for(const[Oe,J]of Object.entries(U.parent))ve=Oe,Z[J]||(Z[J]=[]),Z[J].push(X);const D=T.classifiers.find(X=>X.slug===v.slug);if(D){const X=new Set([...D.values,...P]);D.values=[...X];for(const[U,Oe]of Object.entries(Z)){D.valuesByParentValue[U]||(D.valuesByParentValue[U]=[]);const J=new Set([...D.valuesByParentValue[U],...Oe]);D.valuesByParentValue[U]=[...J]}ve&&(D.parentSlug=ve)}else T.classifiers.push({slug:v.slug,name:v.name,values:P,parentSlug:ve,valuesByParentValue:Z})}for(const v of p.values())v.classifiers.sort((N,T)=>N.parentSlug===null&&T.parentSlug!==null?-1:N.parentSlug!==null&&T.parentSlug===null?1:0);return[...p.values()]},[ot]),Wt=pn(c&&l?t:null,o,j,s),Ht=hn(h?s:null,o,j),Yt=h?Ht:Wt,{data:K,isLoading:qt,error:Zt}=Yt,Xt=b.useMemo(()=>K?.pages.flatMap(p=>p.content.map(v=>v.occurred_at)),[K]),at=K?.pages[0],it=(at?.content.length??0)>0,Jt=vn(c&&l?t:null,o,j,s),es=yn(h?s:null,o,j),Re=h?es:Jt,ts=Re.data?.total??void 0,ss=Re.data?.classification_stats,ns=Re.isLoading,os=!!(j.beforeOccurredAt||j.afterOccurredAt),ct=gn(j),rt=K?.pages[K.pages.length-1],G=rt?.content[rt.content.length-1];b.useEffect(()=>{!ct||!G||K?.pages.length===1||x.beforeOccurredAt===G.occurred_at&&x.beforeId===G.id||F({beforeOccurredAt:G.occurred_at,beforeId:G.id},{replace:!0})},[G?.id,ct,F,K?.pages.length,G,x.beforeOccurredAt,x.beforeId]);const as=b.useCallback(()=>{R({beforeOccurredAt:void 0,beforeId:void 0,afterOccurredAt:void 0,afterId:void 0}),window.scrollTo({top:0,behavior:"smooth"})},[R]),is=(p,v)=>{R({dateRange:[p,v]})},lt=(p,v)=>{const N={...j.classificationFilters||{}};if(v.length>0)N[p]=v;else{delete N[p];for(const T of Fe)for(const $ of T.classifiers)$.parentSlug===p&&delete N[$.slug]}R({classificationFilters:N})},cs=(p,v)=>{const N=j.classificationFilters?.[p]||[];lt(p,N.includes(v)?N.filter(T=>T!==v):[...N,v])},rs=p=>lt(p,[]);if(Zt)return e.jsx(xn,{label:"knowledge"});const we=!c||r&&g||l&&!t||qt,he={fields:[],chips:[]};for(const p of Fe)for(const v of p.classifiers){const N=j.classificationFilters?.[v.slug]??[],T=v.parentSlug?j.classificationFilters?.[v.parentSlug]??[]:void 0,$=T?[...new Set(T.flatMap(P=>v.valuesByParentValue[P]??[]))]:v.values;$.length>0&&he.fields.push({key:`clf:${v.slug}`,label:v.name,group:p.automationName??"Classifiers",icon:e.jsx(bn,{className:"h-4 w-4"}),editor:ke({searchPlaceholder:`Search ${v.name.toLowerCase()}...`,options:$.map(P=>({value:P,label:P,count:ss?.[v.slug]?.[P]})),selected:N,multiple:!0,onSelect:P=>cs(v.slug,P)})})}for(const[p,v]of Object.entries(j.classificationFilters??{})){if(v.length===0)continue;const N=Fe.flatMap(T=>T.classifiers).find(T=>T.slug===p);he.chips.push({id:`clf:${p}`,field:`clf:${p}`,label:N?.name??p,op:v.length>1?"is any of":"is",value:v.join(", "),onRemove:()=>rs(p)})}const ls=[j.contentIds?.length?ye({id:"contentIds",label:j.contentIds.length>1?"Events":"Event",value:`#${j.contentIds.join(", #")}`,onRemove:()=>R({contentIds:void 0})}):null,tt?ye({id:"mcpActivityId",label:"Conversation",value:tt,onRemove:()=>R({mcpActivityId:void 0})}):null,Je?ye({id:"clientIds",label:"Connected app",value:Je,sourceLink:Vt,details:w&&w.length>0?e.jsx(Yn,{ownerSlug:s,clientIds:w,linkedUser:fe?.linkedUser,linkedUserEntitySlug:fe?.linkedUserEntitySlug}):void 0,onRemove:()=>R({clientIds:void 0})}):null,nt?ye({id:"schedule",label:"Schedule",value:nt,sourceLink:s&&Y&&q?wn(s,Y,q):void 0,onRemove:()=>R({schedule:void 0,runIds:void 0})}):null,...j.eventCategory?[{id:"event-category",label:"Category",op:"is",value:j.eventCategory,onRemove:()=>R({eventCategory:void 0})}]:[],...j.resourceKind||j.resourceId?[{id:"resource",label:"Resource",op:"is",value:`${j.resourceKind}: ${j.resourceId}`,onRemove:()=>R({resourceKind:void 0,resourceId:void 0})}]:[],...he.chips].filter(p=>p!=null),ds=!!(l&&o&&t),dt=i&&!re?i:void 0,ut={filterActions:d?e.jsx(vo,{kinds:x.semanticTypes,onFiltersChange:R}):_e&&l?e.jsx("div",{className:"flex items-center gap-1",children:[["config","Configuration"],["deployment","Applies"]].map(([p,v])=>e.jsx(W,{type:"button",variant:x.eventCategory===p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs","aria-pressed":x.eventCategory===p,onClick:()=>R({eventCategory:x.eventCategory===p?void 0:p,semanticTypes:x.eventCategory===p?void 0:["change"],resourceKind:void 0,resourceId:void 0}),children:v},p))}):void 0,filterTrailing:ds?e.jsxs(W,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground","aria-pressed":Q,onClick:()=>H(p=>!p),children:[e.jsx(kn,{className:"mr-1.5 h-3.5 w-3.5"}),"Timeline"]}):void 0,onClearFilters:Qe,onShowNotifications:m,filters:j,onFiltersChange:R,eventKinds:Ut,searchQuery:I,onSearchChange:p=>{L.current=!0,M(p)},extraFields:he.fields,drillChips:ls,total:ts,isListLoading:we,isTotalLoading:ns,hasCursorInUrl:os&&it,onGoToLatest:as},us=!we&&!!at&&!it&&!re,ms=r?l?"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",mt=!!(l&&s);return e.jsx(jn,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:n?"sticky top-0 z-10 -mx-4 bg-background px-4 pb-2 lg:-mx-6 lg:px-6":void 0,children:n&&s?e.jsx(Bt,{...ut,ownerSlug:s}):e.jsx(Dt,{...ut})}),Q&&l&&o&&t&&e.jsx(po,{entityId:o,organizationId:t,ownerSlug:s||"",eventTimes:Xt,selectedRange:j.dateRange||void 0,onSelectRange:is}),dt?.rows,we?e.jsx(Dn,{}):us?u??e.jsx(vt,{icon:yt,title:"No activity yet",description:ms,actionLabel:mt?"Add a connector":void 0,onAction:mt&&s?()=>void y({to:"/$owner/connectors/create",params:{owner:s}}):void 0}):e.jsx(Bn,{onFiltersChange:R,organizationId:t,ownerSlug:s,entityId:o,filters:j,showEntityLinks:_e,foldConsecutiveCalls:!0,groupByConversation:!0,hiddenApprovalRunIds:dt?.hiddenApprovalRunIds,emptyState:e.jsx(vt,{icon:yt,title:"No results found",description:"Try adjusting your filters to find what you are looking for",actionLabel:re?"Clear filters":void 0,onAction:re?Qe:void 0})})]})})}function go({record:t,ownerSlug:s}){const o=ie(),n=V(),{filters:a,updateFilters:i}=Mt({parse:Ce,serialize:Le,filterKeys:Ot,replace:!1,merge:wt}),m=Pe({...a,platforms:void 0,connectionIds:void 0,feedIds:void 0})||a.sortBy!=null&&a.sortBy!=="date"||a.sortOrder!=null&&a.sortOrder!=="desc",u=()=>{n({...$e(s,o.search??{}),...o.pathname.startsWith(`/${s}/events/`)?{}:{to:o.pathname}})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Bt,{ownerSlug:s,sourceRead:!0,filters:a,onFiltersChange:i,searchQuery:a.searchQuery??"",onSearchChange:d=>i({searchQuery:d}),onClearFilters:u}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Live activity supports connector, connection and feed filters. Search and other event filters are available for saved activity."}),m?e.jsxs("div",{role:"alert",className:"space-y-2 rounded-md border p-3 text-sm",children:[e.jsx("p",{children:"Some selected filters aren't supported for live activity. Clear them to see results."}),e.jsx(W,{variant:"outline",size:"sm",onClick:()=>{const d=Le({platforms:a.platforms,connectionIds:a.connectionIds,feedIds:a.feedIds}),r={...$e(s,o.search??{}).search,...d};n({to:o.pathname,search:r})},children:"Clear unsupported filters"})]}):e.jsx(Mn,{record:t,orgContext:{slug:s},filters:a})]})}function wo({entity:t,organizationId:s,ownerSlug:o}){const n=t.is_derived?e.jsx(go,{ownerSlug:o,record:{type:t.entity_type,key:t.slug}}):e.jsx(yo,{organizationId:s,ownerSlug:o,entityId:typeof t.id=="number"?t.id:void 0,hideSourceFilter:!0,changesShortcut:!0});return e.jsx(Qn,{organizationId:s,children:t.entity_type==="$member"?e.jsx(Vn,{children:n}):n})}export{yo as E,Qn as M,$t as N,wo as R,lo as S};
2
+ //# sourceMappingURL=record-activity-C9gVBbF0.js.map
@@ -1,2 +1,2 @@
1
- import{r as s,j as c}from"./index-008wj-Pz.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
2
- //# sourceMappingURL=record-session-D07szzqN.js.map
1
+ import{r as s,j as c}from"./index-DdBTTN3y.js";function u(){const o=new Map,e=new Set,n=()=>{for(const t of e)t()};return{get:t=>o.get(t),set:t=>{o.get(t.entity.id)!==t&&(o.set(t.entity.id,t),n())},remove:t=>{o.delete(t)&&n()},subscribe:t=>(e.add(t),()=>e.delete(t))}}const r=s.createContext(null);function d({children:o}){const[e]=s.useState(u);return c.jsx(r.Provider,{value:e,children:o})}function f(o){const e=s.useContext(r);s.useLayoutEffect(()=>{e?.set(o)});const n=o.entity.id;s.useEffect(()=>()=>e?.remove(n),[e,n])}const i=()=>()=>{};function S(o){const e=s.useContext(r);return s.useSyncExternalStore(e?.subscribe??i,()=>e?.get(o),()=>e?.get(o))}export{d as R,f as a,S as u};
2
+ //# sourceMappingURL=record-session-R-uHNuby.js.map