@lobu/runtime-server 24.5.0 → 24.6.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 (235) hide show
  1. package/dist/catalogs/connectors.json +342 -4
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/linkedin-identity.ts +43 -0
  5. package/dist/connectors/linkedin.ts +154 -3
  6. package/dist/connectors/x-like-follow.ts +329 -0
  7. package/dist/connectors/x.ts +709 -80
  8. package/dist/dependencies.bun.lock +18 -18
  9. package/dist/owletto/dist/assets/_-DT3E3BmS.js +3 -0
  10. package/dist/owletto/dist/assets/_-c1xy7bLu.js +2 -0
  11. package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +2 -0
  12. package/dist/owletto/dist/assets/_agentId-DV8utajn.js +2 -0
  13. package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +2 -0
  14. package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +2 -0
  15. package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +2 -0
  16. package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +2 -0
  17. package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +2 -0
  18. package/dist/owletto/dist/assets/_name-CM1AMywz.js +2 -0
  19. package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +3 -0
  20. package/dist/owletto/dist/assets/_shape-DGAkETDp.js +2 -0
  21. package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +2 -0
  22. package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +2 -0
  23. package/dist/owletto/dist/assets/_view-B5I7mmkl.js +2 -0
  24. package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +2 -0
  26. package/dist/owletto/dist/assets/{accept-invitation-pUl-c1KQ.js → accept-invitation-CQZQ0wwC.js} +2 -2
  27. package/dist/owletto/dist/assets/{activity-route-view-DN0ZEAzr.js → activity-route-view-CZykJXQp.js} +2 -2
  28. package/dist/owletto/dist/assets/{agent-card-controls-C5jNWgfq.js → agent-card-controls-DuQJhtqp.js} +2 -2
  29. package/dist/owletto/dist/assets/{agent-client-setup-list-DbXtJTsO.js → agent-client-setup-list-CpUTAjXf.js} +2 -2
  30. package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-Br_ycC0z.js} +2 -2
  31. package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +2 -0
  32. package/dist/owletto/dist/assets/{agent-guardrails-route-BJyfalBY.js → agent-guardrails-route-CN7vpC0X.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-list-row-rF5LH-3k.js → agent-list-row-BnP6r4pm.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-loading-shells-ClY_O6lb.js → agent-loading-shells-_18OREnx.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-permissions-matrix-bP1Qihv7.js → agent-permissions-matrix-DSjidWHL.js} +2 -2
  36. package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-1DBn7Xc_.js} +2 -2
  37. package/dist/owletto/dist/assets/{agent-skills-route-Bv5luNdw.js → agent-skills-route-d5jh3oBR.js} +2 -2
  38. package/dist/owletto/dist/assets/{agent-tab-intro-ednTs4WF.js → agent-tab-intro-DKrC3SQt.js} +2 -2
  39. package/dist/owletto/dist/assets/{agent-thread-WNk2HapT.js → agent-thread-FyEO-y44.js} +3 -3
  40. package/dist/owletto/dist/assets/agents-kXojozTU.js +2 -0
  41. package/dist/owletto/dist/assets/{agents-workbench-bPTjdVS1.js → agents-workbench-CDpJmUVN.js} +2 -2
  42. package/dist/owletto/dist/assets/{app._appId-DrL5H5lB.js → app._appId-DwNeXRJp.js} +2 -2
  43. package/dist/owletto/dist/assets/{assist-composer-ClfFEVx7.js → assist-composer-Mn9EfX4X.js} +2 -2
  44. package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +2 -0
  45. package/dist/owletto/dist/assets/{automation-row-DCHM--aD.js → automation-row-B5Q1B10y.js} +2 -2
  46. package/dist/owletto/dist/assets/automation-source-list-Dhucq1sI.js +2 -0
  47. package/dist/owletto/dist/assets/automations-kXojozTU.js +2 -0
  48. package/dist/owletto/dist/assets/{callback-DRABUOha.js → callback-9xSHyA12.js} +2 -2
  49. package/dist/owletto/dist/assets/{card-Bdi7VEwo.js → card-g4yxo4Hr.js} +2 -2
  50. package/dist/owletto/dist/assets/{change-summary-PBoM6Asb.js → change-summary-DeuXQEpb.js} +2 -2
  51. package/dist/owletto/dist/assets/{claim-CUIG1Oc-.js → claim-B98IhDra.js} +2 -2
  52. package/dist/owletto/dist/assets/{client-activity-scopes-CXOWB5co.js → client-activity-scopes-BD2HBo-_.js} +2 -2
  53. package/dist/owletto/dist/assets/{client-rows-36VnmgMK.js → client-rows-x_CxeWkP.js} +2 -2
  54. package/dist/owletto/dist/assets/{clients-BJRcMk1A.js → clients-Cmp0LmOp.js} +2 -2
  55. package/dist/owletto/dist/assets/connect-menu-CezOH3s7.js +2 -0
  56. package/dist/owletto/dist/assets/connect-zUot_0kG.js +2 -0
  57. package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +2 -0
  58. package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +2 -0
  59. package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +2 -0
  60. package/dist/owletto/dist/assets/{connected._clientId.index-jSnGvzYs.js → connected._clientId.index-DBNP2mZo.js} +2 -2
  61. package/dist/owletto/dist/assets/{connection-q1bdnxCN.js → connection-B6fM2KHN.js} +2 -2
  62. package/dist/owletto/dist/assets/{connection-feed-detail-BIlkK0Pd.js → connection-feed-detail-Ckq-qEbD.js} +2 -2
  63. package/dist/owletto/dist/assets/{connections-browser-V-3td9DB.js → connections-browser-BXsJqieG.js} +2 -2
  64. package/dist/owletto/dist/assets/{connector-boxes-lFc-WP83.js → connector-boxes-CbqSFeVm.js} +2 -2
  65. package/dist/owletto/dist/assets/{connector-page-shell-Cs1SjrYB.js → connector-page-shell-Di6XzkVo.js} +2 -2
  66. package/dist/owletto/dist/assets/{connector-provenance-aJFeeRIC.js → connector-provenance-BrnasBW4.js} +2 -2
  67. package/dist/owletto/dist/assets/{connector-scope-lists--vNdbOn0.js → connector-scope-lists-dQnZARCD.js} +2 -2
  68. package/dist/owletto/dist/assets/{connectors-BsvDMdsQ.js → connectors-DnOUxX_U.js} +2 -2
  69. package/dist/owletto/dist/assets/{consent-DJV78pnz.js → consent-Byli4yMs.js} +2 -2
  70. package/dist/owletto/dist/assets/{copy-button-DjMWgrBf.js → copy-button-Ddf7lBjZ.js} +2 -2
  71. package/dist/owletto/dist/assets/{core.esm-CQzL3ObT.js → core.esm-BsXtvNoI.js} +2 -2
  72. package/dist/owletto/dist/assets/create-B34eskZ_.js +2 -0
  73. package/dist/owletto/dist/assets/create-DLB9sXgU.js +2 -0
  74. package/dist/owletto/dist/assets/{create-jBEuveV1.js → create-YdAnh3ml.js} +2 -2
  75. package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +3 -0
  76. package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +2 -0
  77. package/dist/owletto/dist/assets/definition-comparison-B5WgZILB.js +2 -0
  78. package/dist/owletto/dist/assets/{device-Ba3RsIgb.js → device-DdCoCj-Q.js} +2 -2
  79. package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +2 -0
  80. package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +2 -0
  81. package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +2 -0
  82. package/dist/owletto/dist/assets/{entity-options-daOOQo7O.js → entity-options-BkU_En_f.js} +2 -2
  83. package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +2 -0
  84. package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +2 -0
  85. package/dist/owletto/dist/assets/entity-type-page-D0ghgRgq.js +2 -0
  86. package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +2 -0
  87. package/dist/owletto/dist/assets/{event-detail-DkY95e5b.js → event-detail-CmC-DVrK.js} +2 -2
  88. package/dist/owletto/dist/assets/{events-feed-B9CZHI_P.js → events-feed-CGzA1w3R.js} +2 -2
  89. package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +2 -0
  90. package/dist/owletto/dist/assets/{full-page-spinner-BqmckkOf.js → full-page-spinner-B5xXnKtV.js} +2 -2
  91. package/dist/owletto/dist/assets/guardrails-DkXatmea.js +2 -0
  92. package/dist/owletto/dist/assets/identity-BwJy3ixB.js +2 -0
  93. package/dist/owletto/dist/assets/{index--ZWegctR.js → index-35ehGReZ.js} +2 -2
  94. package/dist/owletto/dist/assets/index-B9hYiwBw.js +2 -0
  95. package/dist/owletto/dist/assets/{index-C186T2Rw.js → index-BDl1_w6U.js} +2 -2
  96. package/dist/owletto/dist/assets/{index-ijqrJaRB.js → index-BdNR51Ua.js} +2 -2
  97. package/dist/owletto/dist/assets/{index-DdBTTN3y.js → index-BjcZVe7n.js} +52 -52
  98. package/dist/owletto/dist/assets/{index-CsrT07TJ.js → index-BqAVebvY.js} +2 -2
  99. package/dist/owletto/dist/assets/index-BvK1fS1J.js +2 -0
  100. package/dist/owletto/dist/assets/{index-DdYWarql.css → index-CNEpTkgw.css} +1 -1
  101. package/dist/owletto/dist/assets/index-CRc73k1t.js +2 -0
  102. package/dist/owletto/dist/assets/index-CYGaSD3y.js +2 -0
  103. package/dist/owletto/dist/assets/index-CfZGe-zn.js +2 -0
  104. package/dist/owletto/dist/assets/{index-B0kw2lFL.js → index-CkiyxW4w.js} +2 -2
  105. package/dist/owletto/dist/assets/index-CzLDNB2E.js +2 -0
  106. package/dist/owletto/dist/assets/{index-BKrdVwW9.js → index-D-o5iOVd.js} +2 -2
  107. package/dist/owletto/dist/assets/index-DjYVV1Ml.js +2 -0
  108. package/dist/owletto/dist/assets/{index-ikp_mTsf.js → index-TkPy_P_u.js} +2 -2
  109. package/dist/owletto/dist/assets/index-VyAX-asP.js +2 -0
  110. package/dist/owletto/dist/assets/json-diff-DtZtra_g.js +28 -0
  111. package/dist/owletto/dist/assets/{list-skeleton-CXDLkYTg.js → list-skeleton-CIHWCi2a.js} +2 -2
  112. package/dist/owletto/dist/assets/{login-u6LCgDYG.js → login-TWR0vF4_.js} +2 -2
  113. package/dist/owletto/dist/assets/{logout-JhmuWJEH.js → logout-BA5kojS0.js} +2 -2
  114. package/dist/owletto/dist/assets/{manage-gear-D8LMhehh.js → manage-gear-C-0BAMbC.js} +2 -2
  115. package/dist/owletto/dist/assets/{member-scope-gate-4FQ0aanZ.js → member-scope-gate-BQiRAqtx.js} +2 -2
  116. package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +74 -0
  117. package/dist/owletto/dist/assets/{model-jL871x2J.js → model-C2q7WDcS.js} +2 -2
  118. package/dist/owletto/dist/assets/{model-selector-CgU8SJMF.js → model-selector-B2cjCn0V.js} +2 -2
  119. package/dist/owletto/dist/assets/models-CZkH5gtj.js +2 -0
  120. package/dist/owletto/dist/assets/{nav-pill-DrFkuyUQ.js → nav-pill-Bam6s3jj.js} +2 -2
  121. package/dist/owletto/dist/assets/new-BJst6K0b.js +2 -0
  122. package/dist/owletto/dist/assets/{new-DgE1pVV0.js → new-Dc5Bbotb.js} +2 -2
  123. package/dist/owletto/dist/assets/new-DgbivfDe.js +2 -0
  124. package/dist/owletto/dist/assets/{organization-CKM_oFX3.js → organization-B9U1L-56.js} +2 -2
  125. package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +2 -0
  126. package/dist/owletto/dist/assets/{pending-seed-sml8Uf6e.js → pending-seed-BP3xHM2d.js} +2 -2
  127. package/dist/owletto/dist/assets/{permissions-BvA9SATv.js → permissions-BVlbeY4u.js} +2 -2
  128. package/dist/owletto/dist/assets/proposal-review-shell-BED-DO9C.js +2 -0
  129. package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +2 -0
  130. package/dist/owletto/dist/assets/{record-activity-C9gVBbF0.js → record-activity-CTLwq8s1.js} +2 -2
  131. package/dist/owletto/dist/assets/{record-session-R-uHNuby.js → record-session-DOFgdd43.js} +2 -2
  132. package/dist/owletto/dist/assets/renderer-CHPS-1vD.js +96 -0
  133. package/dist/owletto/dist/assets/{reset-password-Mx3baeNc.js → reset-password-BmNM-apc.js} +2 -2
  134. package/dist/owletto/dist/assets/{run-activity-link-CaIBSRQj.js → run-activity-link-Dh1YyCfk.js} +2 -2
  135. package/dist/owletto/dist/assets/{run-initiator-BvzQJYW9.js → run-initiator-CCxNv0rK.js} +2 -2
  136. package/dist/owletto/dist/assets/{runs-fFJ1lPnw.js → runs-BntGAKQG.js} +2 -2
  137. package/dist/owletto/dist/assets/{runs-panel-DEnZHTa5.js → runs-panel-BwTVaRsE.js} +2 -2
  138. package/dist/owletto/dist/assets/{runs-table-XGnxJl7S.js → runs-table-CYS1jDdL.js} +2 -2
  139. package/dist/owletto/dist/assets/{schema-type-editor-panel-C0_9VcSs.js → schema-type-editor-panel-v3nR2Oa2.js} +2 -2
  140. package/dist/owletto/dist/assets/schema-value-BFb7jCBo.js +3 -0
  141. package/dist/owletto/dist/assets/settings-DBgT60nY.js +2 -0
  142. package/dist/owletto/dist/assets/{settings-CP4PjMQA.js → settings-DubSpJfg.js} +2 -2
  143. package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +2 -0
  144. package/dist/owletto/dist/assets/{source-record-panels-Bh0n4gGw.js → source-record-panels-m8gECt82.js} +2 -2
  145. package/dist/owletto/dist/assets/{status-dot-Cpq63I7p.js → status-dot-BnQPFrcU.js} +2 -2
  146. package/dist/owletto/dist/assets/{table-BUqshjxa.js → table-DALHuXPE.js} +2 -2
  147. package/dist/owletto/dist/assets/{use-automations-BLNjxq2K.js → use-automations-D9hKpufo.js} +2 -2
  148. package/dist/owletto/dist/assets/{use-login-redirect-CmyQW7GT.js → use-login-redirect-ciwfc-7A.js} +2 -2
  149. package/dist/owletto/dist/assets/{use-mention-search-dn3ws1WB.js → use-mention-search-CJGCatFS.js} +2 -2
  150. package/dist/owletto/dist/assets/{use-scroll-sentinel-DRyBMueA.js → use-scroll-sentinel-BWCrmNIB.js} +2 -2
  151. package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +2 -0
  152. package/dist/owletto/dist/assets/views-access-required-CZ1fvAks.js +2 -0
  153. package/dist/owletto/dist/index.html +2 -2
  154. package/dist/server-main.bundle.mjs +5596 -4000
  155. package/npm-shrinkwrap.json +99 -99
  156. package/package.json +1 -1
  157. package/vendor/connector-sdk/package.json +1 -1
  158. package/vendor/core/dist/contracts/tools/view-host.d.ts +7 -0
  159. package/vendor/core/dist/contracts/tools/view-host.js +28 -0
  160. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -4
  161. package/vendor/core/dist/contracts/tools/view-runtime.js +19 -7
  162. package/vendor/core/package.json +11 -1
  163. package/vendor/views/dist/api.d.ts +9 -4
  164. package/vendor/views/dist/api.js +33 -2
  165. package/vendor/views/dist/bridge.d.ts +8 -0
  166. package/vendor/views/dist/bridge.js +12 -2
  167. package/vendor/views/dist/components.d.ts +4 -2
  168. package/vendor/views/dist/components.js +29 -14
  169. package/vendor/views/dist/index.d.ts +1 -1
  170. package/vendor/views/dist/index.js +1 -1
  171. package/vendor/views/dist/native.d.ts +327 -0
  172. package/vendor/views/dist/native.js +57 -0
  173. package/vendor/views/package.json +1 -1
  174. package/dist/owletto/dist/assets/_-CCWuGXtQ.js +0 -2
  175. package/dist/owletto/dist/assets/_-DOJW1D-I.js +0 -3
  176. package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +0 -2
  177. package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +0 -2
  178. package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +0 -2
  179. package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +0 -2
  180. package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +0 -2
  181. package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +0 -2
  182. package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +0 -2
  183. package/dist/owletto/dist/assets/_name-D30_V03t.js +0 -2
  184. package/dist/owletto/dist/assets/_owner-Be8O41u8.js +0 -3
  185. package/dist/owletto/dist/assets/_shape-C6YbloRh.js +0 -2
  186. package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +0 -2
  187. package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +0 -2
  188. package/dist/owletto/dist/assets/_view-aoFDwEld.js +0 -2
  189. package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +0 -2
  190. package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +0 -2
  191. package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +0 -2
  192. package/dist/owletto/dist/assets/agents-DY2S2SGE.js +0 -2
  193. package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +0 -2
  194. package/dist/owletto/dist/assets/automations-DY2S2SGE.js +0 -2
  195. package/dist/owletto/dist/assets/calendar-Ck0yOLYu.js +0 -2
  196. package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +0 -16
  197. package/dist/owletto/dist/assets/connect-CMcEQWls.js +0 -2
  198. package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +0 -2
  199. package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +0 -2
  200. package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +0 -2
  201. package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +0 -2
  202. package/dist/owletto/dist/assets/create-BmKx5vq3.js +0 -2
  203. package/dist/owletto/dist/assets/create-Rt0RbiD4.js +0 -2
  204. package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +0 -3
  205. package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +0 -2
  206. package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +0 -2
  207. package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +0 -2
  208. package/dist/owletto/dist/assets/entity-avatar-TVKjZxWQ.js +0 -2
  209. package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +0 -2
  210. package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +0 -2
  211. package/dist/owletto/dist/assets/event-card-DVUB8my6.js +0 -2
  212. package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +0 -2
  213. package/dist/owletto/dist/assets/guardrails-Csusrok2.js +0 -2
  214. package/dist/owletto/dist/assets/identity-Dmg3STO8.js +0 -2
  215. package/dist/owletto/dist/assets/index-BUBcNNUY.js +0 -2
  216. package/dist/owletto/dist/assets/index-BUDr4-Yv.js +0 -2
  217. package/dist/owletto/dist/assets/index-BYPQWVwD.js +0 -2
  218. package/dist/owletto/dist/assets/index-BfpaPJPj.js +0 -2
  219. package/dist/owletto/dist/assets/index-BicNFLBW.js +0 -2
  220. package/dist/owletto/dist/assets/index-Bsdv5aks.js +0 -2
  221. package/dist/owletto/dist/assets/index-CX0pJ9j9.js +0 -2
  222. package/dist/owletto/dist/assets/index-JYEIN8nM.js +0 -2
  223. package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +0 -14
  224. package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +0 -74
  225. package/dist/owletto/dist/assets/models-jdemgIZk.js +0 -2
  226. package/dist/owletto/dist/assets/new-CcJOd5aH.js +0 -2
  227. package/dist/owletto/dist/assets/new-OWwrYckd.js +0 -2
  228. package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +0 -2
  229. package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +0 -2
  230. package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +0 -2
  231. package/dist/owletto/dist/assets/renderer-DXfJaCCa.js +0 -97
  232. package/dist/owletto/dist/assets/settings-CgaUJMHH.js +0 -2
  233. package/dist/owletto/dist/assets/skills-D-e_h3a9.js +0 -2
  234. package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +0 -2
  235. package/dist/owletto/dist/assets/views-access-required-C_b9itZ2.js +0 -2
@@ -1,2 +0,0 @@
1
- import{cQ as de,bN as ue,k as Ct,r as y,er as Rt,es as xn,a3 as hn,Q as yn,dQ as gn,u as At,et as vn,j as t,i as Z,eu as jt,ev as Ze,ew as St,ex as jn,ey as _n,bu as qe,ez as bn,eA as Je,eB as Nn,eC as wn,eD as kn,eE as Cn,eF as It,bx as Rn,B as T,q as ot,eG as lt,cP as ze,L as ee,eH as An,x as Sn,dT as In,cL as Tt,eI as Tn,eJ as En,d0 as $n,eK as Et,cg as et,eL as Pn,eM as On,dZ as Fn,eN as Mn,dV as tt,cI as nt,V as le,cy as $t,dW as Pt,dX as Dn,dE as Ln,dG as Bn,dF as zn,a$ as Vn,b0 as Un,a0 as Ot,b1 as qn,eO as Kn,c as Qn,w as Hn,v as Jn,bt as Pe,eP as Gn,a6 as Wn,eQ as _t,eR as Yn,I as Xn,eS as Zn,bP as es,ab as ce,cM as ts,cC as ns,eT as ss,eU as rs,eV as as,eW as is,c2 as os,eX as ls,c7 as ds,eY as cs,Y as us,eZ as ms,X as ps,e_ as fs,bc as xs,e$ as hs,f0 as ys,dR as gs}from"./index-DdBTTN3y.js";import{R as vs,p as js}from"./run-initiator-BvzQJYW9.js";import{b as Ft}from"./use-automations-BLNjxq2K.js";import{l as _s,s as bs,S as Ns,J as ws}from"./renderer-DXfJaCCa.js";import{C as ks}from"./change-summary-PBoM6Asb.js";import{J as Le}from"./json-diff-BaLL4Fsu.js";import{C as bt}from"./copy-button-DjMWgrBf.js";import{A as Cs}from"./agent-list-row-rF5LH-3k.js";import{A as Rs}from"./automation-row-DCHM--aD.js";import{d as As}from"./model-jL871x2J.js";import{c as Ss}from"./connection-label-BobuYiAG.js";function Is(e,n){if(!e||typeof e!="object"||Array.isArray(e))return null;const s=e.title;if(typeof s!="string")return null;const a=s.trim();return a&&a!==n?a:null}function Mt(e){const n=Array.isArray(e?.records)?e.records:Array.isArray(e?.current)?e.current:[];return[e?.from_entity_id??e?.entity_id,e?.to_entity_id].map(s=>{const r=n.find(o=>o&&typeof o=="object"&&"id"in o&&o.id===s);return{id:String(s??"unknown"),name:typeof r?.name=="string"?r.name:`Record ${String(s??"unknown")}`}})}function Dt(e,n){return n==="rejected"?"The proposed relationship change was rejected. Both records remain available.":n==="failed"?"The relationship change failed. Both records remain available.":n==="completed"?e==="link"?"The records were linked. Both records remain available.":"The relationship was removed. Both records remain available.":n==="approved"||n==="confirmed"?"The relationship change was approved. Both records remain available.":e==="link"?"If approved, these records will be linked. Both records remain available.":"If approved, this relationship will be removed. Both records remain available."}function na(e){const n=Mt(e.proposal);return{title:e.action==="link"?"Link records":"Unlink records",icon:"entity",impact:{level:"normal"},tone:"default",blocks:[...n.map((s,a)=>({type:"text",label:a===0?"From":"To",value:s.name})),{type:"text",label:"Relationship",value:String(e.proposal?.relationship_type??e.proposal?.relationship_type_slug??"Relationship")},{type:"text",value:Dt(e.action,typeof e.status=="string"?e.status:void 0),muted:!0},...typeof e.reason=="string"&&e.reason?[{type:"text",label:"Why this needs approval",value:e.reason}]:[]],actions:[{id:"approve",label:"Approve",variant:"primary",icon:"check",confirm:e.action==="unlink",confirmPrompt:"Remove this relationship? Both records will remain available.",tool:"manage_operations",args:{action:"approve"},resolvedLabel:"Approval submitted."},{id:"reject",label:"Reject",variant:"outline",icon:"x",confirm:!0,confirmPrompt:"Reject this relationship change?",tool:"manage_operations",args:{action:"reject"},resolvedLabel:"Relationship change rejected."}]}}function Lt(e,n,s){return{queryKey:["event-view-match",e,n.key,n.content_hash,s],queryFn:async()=>{try{const r=(await de("open_view",{key:n.key,scope:{event:s}},{slug:e})).scope?.event;if(!Number.isSafeInteger(r)||(r??0)<1)throw new Error("The view did not resolve its event subject");return r}catch(a){if(a instanceof ue&&(a.status===400||a.status===404))return null;throw a}},staleTime:6e4}}function sa(e,n){const s=Ct(e??{slug:null,organizationId:null}),a=e?.slug??null,r=y.useMemo(()=>a?Rt(s.data??[]):[],[a,s.data]),o=xn({queries:r.map(l=>Lt(a,l,n))});return a?{views:r.flatMap((l,c)=>{const i=o[c]?.data;return i?[{...l,eventId:i}]:[]}),isLoading:s.data===void 0?!s.isError:o.some(l=>l.isPending),isError:s.isError||o.some(l=>l.isError),refetch:()=>{s.refetch();for(const l of o)l.isError&&l.refetch()}}:{views:[],isLoading:!1,isError:!1,refetch:()=>{}}}async function Ts(e,n,s,a){const r=await Promise.all(s.map(o=>e.fetchQuery(Lt(n,o,a))));return s.find((o,l)=>r[l])??null}async function Es(e,n,s,a){const r=await hn(`${yn}/api/${encodeURIComponent(e)}/events/${n}/actions/${encodeURIComponent(s.action)}`,{method:"POST",timeoutMs:9e4,credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:s.value,interaction_id:a})});return await gn(r,"Could not record interaction"),r.json()}function O(e){if(typeof e!="string")return;const n=e.trim();return n.length>0?n:void 0}function Ge(e){return typeof e=="boolean"?e:void 0}function $s(e,n,s){const a=(s??"").toLowerCase();return!!(a==="prepare_comment"||a==="verify_staged_comment"||a.includes("prepare_")||a.includes("verify_staged")||n?.prepared===!0||typeof n?.verified=="boolean"||O(n?.reason_preview)&&O(n?.message)||O(e?.body)&&(O(e?.post_url)||O(e?.activity_id)))}function Ps(e,n,s){if(!$s(e,n,s))return null;const a=(s??"").toLowerCase(),r=O(n?.body)??O(e?.body),o=O(n?.reason_preview)??O(e?.reason),l=O(n?.post_url)??O(e?.post_url)??(O(e?.activity_id)?`https://www.linkedin.com/feed/update/urn:li:activity:${O(e?.activity_id)}`:void 0),c=Ge(n?.prepared),i=Ge(n?.verified),d=Ge(n?.banner_shown),p=O(n?.message),u=n?.match&&typeof n.match=="object"?n.match:null,x=O(u?.text_preview),h=O(u?.author);let S="generic";a==="verify_staged_comment"||a.includes("verify")||typeof i=="boolean"?S="verify":(a==="prepare_comment"||a.includes("prepare")||c===!0||r&&l)&&(S="prepare");const _=[];return c===!0&&_.push("Staged — not posted"),c===!1&&_.push("Not staged"),i===!0&&_.push("Verified posted"),i===!1&&_.push("Not verified as posted"),d===!0&&_.push("In-page banner"),d===!1&&_.push("No banner"),{kind:S,message:p,reason:o,body:r,postUrl:l,prepared:c,bannerShown:d,verified:i,matchPreview:x,matchAuthor:h,chips:_}}const Oe="inline-flex max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs";function st({peer:e,ownerSlug:n,orgContext:s}){const a=At();if(e.url&&!e.self&&e.type){const o=vn(e.url);return o?t.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:Z(Oe,"hover:bg-muted"),title:e.type,onClick:l=>l.stopPropagation(),children:t.jsx("span",{className:"truncate",children:e.name})}):t.jsx("span",{className:Z(Oe,"text-muted-foreground"),children:e.name})}if(e.self||!e.type||!a)return t.jsx("span",{className:Z(Oe,"text-muted-foreground"),children:e.name});const r=a.item?.recordPeer?.entityId===e.id;return t.jsx("button",{type:"button","aria-pressed":r,title:e.type,className:Z(Oe,"hover:bg-muted",r&&"ring-1 ring-primary"),onClick:o=>{o.stopPropagation(),a.open(_s({...typeof e.id=="number"?{entityId:e.id}:{record:{type:e.type,key:e.id}},ownerSlug:n,orgContext:s,name:e.name}))},children:t.jsx("span",{className:"truncate",children:e.name})})}function ra(e,n=e.relationship_type_name){const s=e.from_entity_name??`Record #${e.from_entity_id}`,a=e.to_entity_name??`Record #${e.to_entity_id}`;return e.is_symmetric?`${s} ${n} ${a}`:`${s} → ${n} → ${a}`}function aa({row:e,entityId:n,entityType:s,ownerSlug:a,orgContext:r,label:o=e.relationship_type_name}){const l=(c,i,d,p)=>t.jsx(st,{peer:{id:c,name:i??`Record #${c}`,type:d,url:p,self:!p&&c===n&&(typeof c=="number"||d===s)},ownerSlug:a,orgContext:r});return t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-xs",children:[l(e.from_entity_id,e.from_entity_name,e.from_entity_type,e.from_entity_url),!e.is_symmetric&&t.jsx(jt,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground",children:o}),!e.is_symmetric&&t.jsx(jt,{"aria-hidden":"true",className:"size-3 shrink-0 text-muted-foreground"}),l(e.to_entity_id,e.to_entity_name,e.to_entity_type,e.to_entity_url)]})}function ia({count:e,onRetry:n}){return e?t.jsxs("p",{role:"status",className:"text-xs text-muted-foreground",children:["Some linked records could not be read."," ",t.jsx("button",{type:"button",className:"underline",onClick:n,children:"Retry"})]}):null}const Bt={name:"Name",slug:"URL slug",parent_id:"Parent",content:"Content changed"};function ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Fe(e){return e==null||e===""}function Os(e,n){return Ze(e??null)===Ze(n??null)}function Fs(e){return!!(e?.type==="array"&&(e.items?.type==="object"||e.items?.properties))}function Ms(e){return!!(e&&(e.type==="object"||e.properties)&&e.type!=="array")}function dt(e,n){return bs({key:e,prop:n??{}})}function Ds(e,n){return e?.properties?.[n]}function rt(e,n,s,a,r){if(Os(n,s))return;const o=i=>Array.isArray(i)?i:[];if((Array.isArray(n)||Fe(n))&&(Array.isArray(s)||Fe(s))&&(Array.isArray(n)||Array.isArray(s)||a?.type==="array")){const i=o(n),d=o(s);if(Fs(a)||[...i,...d].some(g=>ie(g))){const g=Math.min(i.length,d.length);for(let C=0;C<g;C++)rt([...e,`item ${C+1}`],i[C],d[C],a?.items,r);const R=Math.max(0,d.length-i.length),q=Math.max(0,i.length-d.length);(R||q)&&r.push({kind:"items",path:e,added:R,removed:q});return}const u=g=>Ze(g),x=new Set(i.map(u)),h=new Set(d.map(u)),S=d.filter(g=>!x.has(u(g))),_=i.filter(g=>!h.has(u(g)));r.push(S.length||_.length?{kind:"values",path:e,added:S,removed:_,prop:a?.items}:{kind:"reordered",path:e});return}if((ie(n)||Fe(n))&&(ie(s)||Fe(s))&&(ie(n)||ie(s)||Ms(a))){const i=ie(n)?n:{},d=ie(s)?s:{},p=[...new Set([...Object.keys(a?.properties??{}),...Object.keys(i),...Object.keys(d)])];for(const u of p){const x=Ds(a,u);rt([...e,dt(u,x)],i[u],d[u],x,r)}return}r.push({kind:"set",path:e,old:n,new:s,prop:a})}function Ls(e,n){const s=Bt[e.field];if(s)return e.field==="content"?[{kind:"note",path:[s]}]:e.field==="parent_id"?[{kind:"parent",path:[s],old:e.old,new:e.new}]:[{kind:"set",path:[s],old:e.old,new:e.new}];const a=n?.properties?.[e.field],r=[];return rt([dt(e.field,a)],e.old,e.new,a,r),r}function Bs(e,n){const s=n?.properties;return e.map(a=>a.field==="content"?"Content":Bt[a.field]??dt(a.field,s?.[a.field]))}const zs="entity.updated",Vs=new Set(["link","unlink","update_link"]);function Nt(e){const n=typeof e=="string"||typeof e=="number"?Number(e):Number.NaN;return Number.isSafeInteger(n)&&n>0?n:null}function Us(e){const n=e.split("_").join(" ").trim();return n?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:e}function qs(e){const n=e.metadata;if(e.semantic_type!=="change"||!n||n._lobu_relationship_change!==!0||typeof n.op!="string"||!Vs.has(n.op))return null;const s=Nt(n.fromEntityId),a=Nt(n.toEntityId);if(s==null||a==null)return null;const r=typeof n.relationshipTypeSlug=="string"?n.relationshipTypeSlug:null,o=Array.isArray(n.changes)?n.changes:[];return{op:n.op,fromId:s,toId:a,typeLabel:r?Us(r):"relationship",changedFields:o.flatMap(l=>l&&typeof l=="object"&&typeof l.field=="string"?[l.field]:[])}}function Be({id:e,recordId:n,ownerSlug:s}){const a=e===n,r={slug:s},{data:o,isLoading:l,isError:c}=St(a?void 0:e,r);return a?t.jsx(st,{peer:{id:e,name:"this record",type:null,self:!0},ownerSlug:s,orgContext:r}):l?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Record #",e]}):c||!o?t.jsx("span",{className:"text-xs text-muted-foreground",title:"Deleted, or you do not have access to it",children:"Unavailable record"}):t.jsx(st,{peer:{id:e,name:o.name,type:o.entity_type},ownerSlug:s,orgContext:r})}function Ks({change:e,recordId:n,ownerSlug:s}){const a=e.op==="link"?`Linked as ${e.typeLabel}`:e.op==="unlink"?`Unlinked ${e.typeLabel}`:`Updated ${e.typeLabel} link`,r=n===e.toId&&n!==e.fromId,o=n===e.fromId;return t.jsxs("span",{"data-testid":"relationship-change",className:"inline-flex flex-wrap items-center gap-1.5",children:[!o&&!r?t.jsx(Be,{id:e.fromId,ownerSlug:s}):null,t.jsx("span",{children:r?`${a} from`:a}),r?t.jsx(Be,{id:e.fromId,recordId:n,ownerSlug:s}):t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:"→"}),t.jsx(Be,{id:e.toId,recordId:n,ownerSlug:s})]}),e.op==="update_link"&&e.changedFields.length>0?t.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",e.changedFields.join(", ")]}):null]})}function Qs(e){if(!Array.isArray(e)||e.length===0)return null;const n=[];for(const s of e){if(!s||typeof s!="object"||typeof s.field!="string")return null;const{field:a,old:r,new:o}=s;n.push({field:a,old:r??null,new:o??null})}return n}function Hs(e){const n=qs(e);if(n)return{kind:"relationship",change:n};const s=e.metadata;if(e.semantic_type!=="change"||!s)return null;const a=s._lobu_event_type;if(a!==zs&&(a!==void 0||s.category))return null;const r=Qs(s.changes);if(!r)return null;const o=e.entity_ids?.[0];return{kind:"fields",entityId:typeof o=="number"?o:null,changes:r}}function zt(e,n){const s={slug:n},{data:a}=St(e.entityType?void 0:e.entityId??void 0,s),{data:r}=jn(e.entityType??a?.entity_type??"",s);return r?.metadata_schema}const Js=4;function Me({value:e,prop:n}){return t.jsx("span",{className:"inline-block max-w-[18rem] truncate align-bottom",title:typeof e=="string"?e:void 0,children:t.jsx(Ns,{value:e,prop:n,empty:t.jsx("span",{className:"italic",children:"empty"})})})}function wt({id:e,ownerSlug:n}){const s=typeof e=="number"||typeof e=="string"?Number(e):Number.NaN;return Number.isSafeInteger(s)&&s>0?t.jsx(Be,{id:s,ownerSlug:n}):t.jsx("span",{className:"italic text-muted-foreground",children:"empty"})}function at(e,n){return`${e} ${n}${e===1?"":"s"}`}function Gs({line:e,ownerSlug:n}){const s=t.jsx("span",{className:"text-muted-foreground",children:e.path.join(" · ")});switch(e.kind){case"note":return s;case"set":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(Me,{value:e.old,prop:e.prop})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(Me,{value:e.new,prop:e.prop})]});case"parent":return t.jsxs(t.Fragment,{children:[s,": ",t.jsx(wt,{id:e.old,ownerSlug:n})," ",t.jsx("span",{"aria-hidden":"true",children:"→"})," ",t.jsx(wt,{id:e.new,ownerSlug:n})]});case"items":return t.jsxs(t.Fragment,{children:[s,":"," ",[e.added?`${at(e.added,"item")} added`:null,e.removed?`${at(e.removed,"item")} removed`:null].filter(Boolean).join(", ")]});case"values":return t.jsxs(t.Fragment,{children:[s,":",e.added.map((a,r)=>t.jsxs("span",{className:"ml-1.5",children:["+",t.jsx(Me,{value:a,prop:e.prop})]},`+${r}`)),e.removed.map((a,r)=>t.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["−",t.jsx(Me,{value:a,prop:e.prop})]},`-${r}`))]});case"reordered":return t.jsxs(t.Fragment,{children:[s,": reordered"]})}}function Ws({change:e,ownerSlug:n}){const s=zt(e,n);return t.jsxs(t.Fragment,{children:["Updated ",Bs(e.changes,s).join(", ")]})}function ct({changes:e,entityId:n,entityType:s,ownerSlug:a,showAll:r=!1}){const o=zt({entityId:n,entityType:s},a),[l,c]=y.useState(r),i=e.flatMap(u=>Ls(u,o)),d=l?i:i.slice(0,Js),p=i.length-d.length;return t.jsxs("ul",{"data-testid":"field-changes",className:"space-y-0.5 text-sm",children:[d.map((u,x)=>t.jsx("li",{className:"min-w-0 truncate",children:t.jsx(Gs,{line:u,ownerSlug:a})},x)),p>0?t.jsx("li",{children:t.jsxs("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:u=>{u.stopPropagation(),c(!0)},children:["+",at(p,"more change")]})}):null]})}function Ys({event:e,recordId:n,ownerSlug:s}){return e.kind==="relationship"?t.jsx(Ks,{change:e.change,recordId:n,ownerSlug:s}):t.jsx(Ws,{change:e,ownerSlug:s})}function Xs({event:e,ownerSlug:n}){return e.kind==="fields"?t.jsx(ct,{changes:e.changes,entityId:e.entityId,ownerSlug:n}):null}function Zs(e){return e.semantic_type==="change"&&(e.metadata?.category==="config"||e.metadata?.category==="deployment")}function oe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function er({content:e,detail:n=!1}){const s=e.metadata??{},a=e.payload_data??{},r=s.category==="deployment",o=typeof s.apply_id=="string"?s.apply_id:null,l=oe(a.manifest),c=o&&/^apl_[A-Za-z0-9-]{1,48}$/.test(o)&&e.origin_type==="deployment"&&e.origin_id===`deployment_${o}`&&(s.status==="succeeded"||s.status==="partial_failure")&&oe(l?.state);return t.jsxs("div",{className:"space-y-3","data-testid":"config-change-event",children:[t.jsx(ks,{showAttribution:n,operation:r?String(s.status??"Apply"):typeof s.op=="string"?s.op:null,actor:e.author_name??(typeof s.actor_source=="string"?s.actor_source:null),createdAt:e.occurred_at??e.created_at,resource:r?"Configuration apply":`${s.resource_kind??"Configuration"} · ${s.resource_id??""}`,changedFields:Array.isArray(s.changed_fields)?s.changed_fields.filter(i=>typeof i=="string"):void 0}),o?t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{className:"break-all",children:["Apply ",o]}),t.jsx(bt,{text:o,label:"Copy apply ID"})]}):null,n?r?t.jsxs(t.Fragment,{children:[typeof s.rollback_of=="string"?t.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["Restores apply ",s.rollback_of]}):null,oe(s.counts)?t.jsx("dl",{className:"flex flex-wrap gap-4 text-xs",children:Object.entries(oe(s.counts)??{}).map(([i,d])=>t.jsxs("div",{children:[t.jsx("dt",{className:"text-muted-foreground",children:i}),t.jsx("dd",{children:String(d)})]},i))}):null,typeof a.error=="string"?t.jsx("p",{className:"text-sm text-destructive",children:a.error}):null,c?t.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Restore this deployment"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Preview restoring this saved configuration with the CLI. Secret values stay unchanged."}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("code",{className:"break-all text-xs",children:["lobu rollback ",o]}),t.jsx(bt,{text:`lobu rollback ${o}`,label:"restore command",iconOnly:!0})]})]}):null,t.jsx(Le,{before:null,after:l})]}):Object.hasOwn(a,"before")?t.jsx(Le,{before:oe(a.before),after:oe(a.state)}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"The earlier state was not recorded for this change."}),t.jsx(Le,{before:null,after:oe(a.state)})]}):null]})}var Ke="Tabs",[tr]=Rn(Ke,[It]),Vt=It(),[nr,ut]=tr(Ke),Ut=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,onValueChange:r,defaultValue:o,orientation:l="horizontal",dir:c,activationMode:i="automatic",...d}=e,p=wn(c),[u,x]=kn({prop:a,onChange:r,defaultProp:o??"",caller:Ke});return t.jsx(nr,{scope:s,baseId:Cn(),value:u,onValueChange:x,orientation:l,dir:p,activationMode:i,children:t.jsx(qe.div,{dir:p,"data-orientation":l,...d,ref:n})})});Ut.displayName=Ke;var qt="TabsList",Kt=y.forwardRef((e,n)=>{const{__scopeTabs:s,loop:a=!0,...r}=e,o=ut(qt,s),l=Vt(s);return t.jsx(Nn,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:a,children:t.jsx(qe.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:n})})});Kt.displayName=qt;var Qt="TabsTrigger",Ht=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,disabled:r=!1,...o}=e,l=ut(Qt,s),c=Vt(s),i=Wt(l.baseId,a),d=Yt(l.baseId,a),p=a===l.value;return t.jsx(bn,{asChild:!0,...c,focusable:!r,active:p,children:t.jsx(qe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:i,...o,ref:n,onMouseDown:Je(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?l.onValueChange(a):u.preventDefault()}),onKeyDown:Je(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&l.onValueChange(a)}),onFocus:Je(e.onFocus,()=>{const u=l.activationMode!=="manual";!p&&!r&&u&&l.onValueChange(a)})})})});Ht.displayName=Qt;var Jt="TabsContent",Gt=y.forwardRef((e,n)=>{const{__scopeTabs:s,value:a,forceMount:r,children:o,...l}=e,c=ut(Jt,s),i=Wt(c.baseId,a),d=Yt(c.baseId,a),p=a===c.value,u=y.useRef(p);return y.useEffect(()=>{const x=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(x)},[]),t.jsx(_n,{present:r||p,children:({present:x})=>t.jsx(qe.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":i,hidden:!x,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:u.current?"0s":void 0},children:x&&o})})});Gt.displayName=Jt;function Wt(e,n){return`${e}-trigger-${n}`}function Yt(e,n){return`${e}-content-${n}`}var sr=Ut,rr=Kt,ar=Ht,ir=Gt;function or({defaultValue:e,children:n}){return t.jsx(sr,{defaultValue:e,className:"space-y-4",children:n})}function lr({label:e="Views",children:n}){return t.jsx(rr,{"aria-label":e,className:"flex flex-wrap gap-1 border-b pb-2",children:n})}function dr({value:e,children:n}){return t.jsx(ar,{value:e,asChild:!0,children:t.jsx(T,{type:"button",variant:"ghost",size:"sm",className:"data-[state=active]:bg-secondary data-[state=active]:text-secondary-foreground",children:n})})}function cr({value:e,children:n}){return t.jsx(ir,{value:e,children:n})}function De(e,n){return typeof e=="string"&&e.trim().length>0&&e.length<=n}function mt(e,n){if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n;if(s.mode!=="live"||!De(s.workspace,128)||!/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/.test(s.workspace)||s.appearance!==void 0&&s.appearance!=="inline"&&s.appearance!=="row")return null;const a={mode:"live",workspace:s.workspace,appearance:s.appearance??"row"};return e==="automation-ref"?!De(s.automationId,128)||!/^[1-9][0-9]*$/.test(s.automationId)||!Number.isSafeInteger(Number(s.automationId))?null:{...a,automationId:s.automationId}:e==="connector-ref"?!De(s.connectorKey,128)||s.connectionId!==void 0&&(typeof s.connectionId!="number"||!Number.isSafeInteger(s.connectionId)||s.connectionId<=0)?null:{...a,connectorKey:s.connectorKey,...s.connectionId!==void 0?{connectionId:s.connectionId}:{}}:De(s.agentId,128)?{...a,agentId:s.agentId}:null}const ur=4,mr=128;let We=0;const we=[];async function pr(e,n){if(e.aborted)throw e.reason;await new Promise((s,a)=>{const r=()=>{const l=we.indexOf(o);l>=0&&we.splice(l,1),a(e.reason)},o=()=>{e.removeEventListener("abort",r),We++,s()};We<ur?o():we.length>=mr?a(new Error("Reference read capacity exceeded")):(we.push(o),e.addEventListener("abort",r,{once:!0}))});try{if(e.aborted)throw e.reason;return await n()}finally{We--,we.shift()?.()}}const Ve={retry:!1,staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:"always",refetchOnReconnect:"always"};function me({error:e}){const n=e instanceof ue&&(e.status===401||e.status===403)?"Access required to view this reference.":e instanceof ue&&e.status===404?"Reference not found.":"Reference unavailable.";return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:n})}function pt(){return t.jsx("span",{role:"status",className:"text-sm text-muted-foreground",children:"Loading reference…"})}function fr({workspace:e,automationId:n,appearance:s}){const{session:a,isReady:r}=ot(),o=lt(),l=ze({...Ve,enabled:r&&!o,queryKey:["automations-list",e,"native-reference",a?.user.id??null,n],queryFn:({signal:i})=>pr(i,async()=>{let d;for(const u of["active","archived"])if(d=(await de("manage_automations",{action:"list",automation_id:n,status:u,include_details:!1,limit:1},{slug:e},{signal:i})).automations?.find(h=>h.automation_id===n),d)break;if(!d)throw new ue("Reference not found",404);const p=d.execution_config?.executor;return d={automation_id:d.automation_id,name:d.name,status:d.status,triggers:d.triggers,next_run_at:d.next_run_at,last_fired_at:d.last_fired_at,last_run_completed_at:d.last_run_completed_at,managed_agent_id:d.managed_agent_id,device_worker_id:d.device_worker_id,health:d.health,health_reasons:d.health_reasons,processing_client_count:d.processing_client_count,execution_config:p&&typeof p=="object"?{executor:{kind:p.kind}}:void 0},d})});if(o)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(l.isPending||l.isFetching)return t.jsx(pt,{});if(l.error||!l.data)return t.jsx(me,{error:l.error});const c=l.data;return t.jsx(Rs,{automation:As(c),owner:e,agentName:c.managed_agent_id??null,deviceLabel:c.device_worker_id?"Device-pinned":null,connectorDisplay:null,appearance:s,rowClass:"flex items-center gap-3 rounded-lg border px-3 py-2.5"})}function xr({workspace:e,connectorKey:n,connectionId:s,appearance:a}){const{session:r,isReady:o}=ot(),l=lt(),c=ze({...Ve,enabled:o&&!l,queryKey:["connector-definitions",e,"native-reference",r?.user.id??null],queryFn:async({signal:x})=>(await Sn({slug:e},{signal:x})).map(h=>({key:h.key,name:h.name,description:h.description,icon:h.icon}))}),i=ze({...Ve,enabled:o&&!l&&s!==void 0,queryKey:["connections",e,"native-reference",r?.user.id??null,n,s??null],queryFn:async({signal:x})=>{const h=s===void 0?void 0:(await de("manage_connections",{action:"list",connection_ids:[s],connector_key:n,limit:1},{slug:e},{signal:x})).connections?.find(S=>S.id===s);if(s!==void 0&&(!h||h.id!==s||h.connector_key!==n))throw new ue("Reference not found",404);return{connection:h?{id:h.id,connector_key:h.connector_key,display_name:h.display_name,connector_name:h.connector_name,auth_profile_name:h.auth_profile_name,auth_profile_slug:h.auth_profile_slug}:void 0}}});if(l)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(c.isPending||c.isFetching||s!==void 0&&(i.isPending||i.isFetching))return t.jsx(pt,{});if(c.error||s!==void 0&&(i.error||!i.data))return t.jsx(me,{error:c.error||i.error});const d=c.data?.find(x=>x.key===n);if(!d)return t.jsx(me,{error:new ue("Reference not found",404)});const p=i.data?.connection,u=t.jsx(An,{connector:d,showDescription:a!=="inline"});return t.jsx("div",{className:a==="inline"?"inline-flex items-center gap-2":"rounded-lg border p-3",children:p?t.jsxs(ee,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:e,connectorKey:n,connectionId:String(p.id)},search:{},children:[u,t.jsx("span",{className:"text-xs text-muted-foreground",children:Ss(p)})]}):t.jsx(ee,{to:"/$owner/connectors/$connectorKey",params:{owner:e,connectorKey:n},children:u})})}function hr({workspace:e,agentId:n,appearance:s}){const{session:a,isReady:r}=ot(),o=lt(),l=ze({...Ve,enabled:r&&!o,queryKey:["agents",e,"native-reference",a?.user.id??null,n],queryFn:async({signal:i})=>{const d=await de("manage_agents",{action:"get",agent_id:n},{slug:e},{signal:i});if(d.agent?.id!==n)throw new ue("Reference not found",404);return{id:d.agent.id,name:d.agent.name,description:d.agent.description}}});if(o)return t.jsx("span",{role:"status",children:"Unavailable in visitor preview."});if(l.isPending||l.isFetching)return t.jsx(pt,{});if(l.error||!l.data)return t.jsx(me,{error:l.error});const c=l.data;return t.jsx(Cs,{owner:e,appearance:s,last:!0,item:{kind:"managed",key:c.id,agent:{agentId:c.id,name:c.name,description:c.description??void 0}}})}function yr(e){const n=mt("automation-ref",e);return n?t.jsx(fr,{...n}):t.jsx(me,{})}function gr(e){const n=mt("connector-ref",e);return n?t.jsx(xr,{...n}):t.jsx(me,{})}function vr(e){const n=mt("agent-ref",e);return n?t.jsx(hr,{...n}):t.jsx(me,{})}const Ye=e=>typeof e=="string"&&e.trim().length>0&&e.length<=128,jr={tabs:({defaultValue:e,children:n})=>Ye(e)?t.jsx(or,{defaultValue:e,children:n}):null,"tabs-list":({label:e,children:n})=>t.jsx(lr,{label:typeof e=="string"&&e.length<=200?e:void 0,children:n}),"tabs-trigger":({value:e,children:n})=>Ye(e)?t.jsx(dr,{value:e,children:n}):null,"tabs-content":({value:e,children:n})=>Ye(e)?t.jsx(cr,{value:e,children:n}):null,"automation-ref":yr,"connector-ref":gr,"agent-ref":vr,"json-diff":(({before:e,after:n})=>{const s=a=>a!==null&&typeof a=="object"&&!Array.isArray(a)?a:null;return t.jsx(Le,{before:s(e),after:s(n)})})};function ke(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _r({template:e,data:n,onAction:s}){const[a,r]=y.useState(null),[o,l]=y.useState(!1),[c,i]=y.useState(null),[d,p]=y.useState(!1),u=y.useRef(!1),x=y.useRef(!0);y.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const h=async S=>{if(!(!s||u.current)){u.current=!0,l(!0),i(null),p(!1);try{const _=await s(S);if(!x.current)return;if(ke(_)&&_.kind==="sdk"){const g=_.result;if(!ke(g)||g.success!==!0){const R=ke(g)&&ke(g.error)?g.error.message:null;throw new Error(typeof R=="string"?R:"Could not update this event.")}if(g.return_truncated||!ke(g.return_value))throw new Error("The update did not return a complete data object.");r(g.return_value),p(!0)}}catch(_){x.current&&i(_ instanceof Error?_.message:"Could not update this event.")}finally{u.current=!1,x.current&&l(!1)}}};return t.jsxs("div",{className:"space-y-2",children:[o?t.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Updating…"}):null,d?t.jsx("p",{role:"status",className:"sr-only",children:"Updated"}):null,c?t.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:[c," Previous data is still shown."]}):null,t.jsx("div",{"aria-busy":o,className:"min-w-0",children:t.jsx(ws,{template:{root:e.root},data:a??n,onAction:s?h:void 0,interactions:e.interactions,components:jr,actionsDisabled:!s||o})})]})}function Xt(e){return{audit:e.semantic_type==="audit"&&e.origin_type==="tool_invocation",operation:e.interaction_type==="approval"||e.semantic_type==="operation",changeSet:e.semantic_type==="change_set"}}const br={};function ve(e){return e.replace(/_/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}const Nr={notification:"Notification",tool_invocation:"Action",deployment:"Deployment",config_change:"Config change",message:"Message",msg:"Note",summary:"Summary"};function wr(e){return e.author_name?e.author_name:e.platform?ve(e.platform):e.origin_type?Nr[e.origin_type]??ve(e.origin_type):null}function kr(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):Array.isArray(e)?e.length===0?"":e.every(n=>typeof n!="object")?e.map(n=>String(n)).join(", "):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)}):t.jsx("pre",{className:"overflow-x-auto rounded bg-muted/40 p-2 text-[11px] leading-relaxed whitespace-pre-wrap",children:JSON.stringify(e,null,2)})}const Xe=1e5;function kt({value:e}){const n=JSON.stringify(e,null,2)??"null",s=n.length>Xe;return t.jsxs(t.Fragment,{children:[t.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 font-mono text-xs",children:s?n.slice(0,Xe):n}),s&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing the first ",Xe.toLocaleString()," of"," ",n.length.toLocaleString()," characters."]})]})}function Cr(e){return Object.entries(e).filter(([,n])=>n==null?!1:typeof n=="string"?n.trim().length>0:Array.isArray(n)?n.length>0:typeof n=="object"?Object.keys(n).length>0:!0).sort(([n],[s])=>n.localeCompare(s))}function Rr({breakdown:e}){if(!e)return null;const n=[{label:"Engagement",value:e.engagement,max:100},{label:"Criticality",value:e.criticality,max:100},{label:"Depth",value:e.depth,max:100},{label:"Authority",value:e.authority,max:100},{label:"Recency",value:e.recency,max:100},{label:"Quality",value:e.quality,max:100}];return t.jsx("div",{className:"space-y-2 text-sm",children:n.map(s=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"w-20 text-muted-foreground",children:s.label}),t.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary",style:{width:`${s.value/s.max*100}%`}})}),t.jsx("span",{className:"w-8 text-right",children:s.value})]},s.label))})}function Ar({slug:e,value:n,isManual:s}){return t.jsxs(le,{variant:"secondary",className:"text-xs",children:[e,": ",n,s&&t.jsx(Et,{className:"ml-1 h-2.5 w-2.5 fill-current"})]})}function Sr(e){if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.values))return{values:n.values.map(s=>String(s)).filter(s=>s.length>0),isManual:n.is_manual===!0};if(n.value!==void 0&&n.value!==null)return{values:[String(n.value)],isManual:n.is_manual===!0};if(typeof n.values=="string"&&n.values.length>0)return{values:[n.values],isManual:n.is_manual===!0}}return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?{values:[String(e)],isManual:!1}:{values:[],isManual:!1}}function Zt(e,n){if(e)switch(e){case"pending":return"pending_approval";case"approved":return"confirmed";case"rejected":return"rejected";case"completed":return"completed";case"failed":return"failed";default:return e}return n||"pending_approval"}function it(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Ir(e){return e.replace(/\s+[—-]\s+pending approval$/i,"")}function Ue(e){return e.replace(/^\$/,"").replace(/[_-]/g," ").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase())}function Tr(e){const n=Object.keys(e.fields),s=n.map(Ue).join(", ")||"field",a=n.length===1?"field":"fields";return`Update ${e.entityType?Ue(e.entityType).toLowerCase():"entity"} ${a}: ${s}`}function Er(e,n){const s=it(n.fields);if(!s||Object.keys(s).length===0||n.action_key!=="entity_field_change"&&n.tool!=="entity_field_change")return null;const a=it(n.current)??{},r=e;return{fields:s,current:a,reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??r.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function $r(e){const n=e.entityType?Ue(e.entityType).toLowerCase():"entity";return`${Ue(e.operation)} ${n}`}function Pr(e,n){if(n.action_key!=="entity_change"&&n.tool!=="entity_change")return null;const s=n.action;if(s!=="create"&&s!=="delete"&&s!=="link"&&s!=="unlink")return null;const a=e;return{operation:s,proposal:it(n.proposal),reason:typeof n.reason=="string"?n.reason:void 0,automationId:n.automation_id!=null?String(n.automation_id):void 0,automationName:typeof n.automation_name=="string"?n.automation_name:void 0,automationAgentId:typeof n.automation_agent_id=="string"?n.automation_agent_id:void 0,entityType:typeof n.entity_type=="string"?n.entity_type:void 0,entityName:(typeof n.entity_name=="string"?n.entity_name:void 0)??a.entity_name??void 0,entitySlug:typeof n.entity_slug=="string"?n.entity_slug:void 0,parentSlug:typeof n.parent_slug=="string"?n.parent_slug:void 0,parentEntityType:typeof n.parent_entity_type=="string"?n.parent_entity_type:void 0,attribution:typeof n.attribution=="string"?n.attribution:void 0,proposerRationale:typeof n.proposer_rationale=="string"?n.proposer_rationale:void 0,initiator:n.initiator&&typeof n.initiator=="object"?n.initiator:void 0}}function Or(e,n){return!n.entityType||!n.entitySlug?null:gs(e,n.parentEntityType&&n.parentSlug?[{entity_type:n.parentEntityType,slug:n.parentSlug},{entity_type:n.entityType,slug:n.entitySlug}]:[{entity_type:n.entityType,slug:n.entitySlug}])}function en({ownerSlug:e,runId:n,details:s}){const r=Ft(s.automationId,void 0,void 0,{ownerSlug:e,includeVersions:!1}).data?.automation,o=js(s.initiator,s.attribution,s.automationId),l=r?.automation_name??s.automationName??o;return t.jsxs("div",{className:"text-sm text-muted-foreground",children:["Requested by"," ",s.automationId?t.jsx(ee,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:s.automationId},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:l}):t.jsx("span",{className:"font-medium text-foreground",children:l}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:" · "}),t.jsxs(ee,{to:"/$owner/events",params:{owner:e},search:{run_ids:String(n)},className:"font-medium text-foreground underline-offset-4 hover:underline",children:["Run #",n]})]})]})}function tn({ownerSlug:e,details:n}){const s=Or(e,n);return n.entityName?t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Entity"}),t.jsx("div",{className:"mt-1 text-sm font-medium",children:s?t.jsx(ee,{to:s,className:"underline-offset-4 hover:underline",children:n.entityName}):n.entityName})]}):null}function Fr({ownerSlug:e,runId:n,details:s}){return t.jsxs("div",{className:"space-y-3",children:[t.jsx(en,{ownerSlug:e,runId:n,details:s}),t.jsx(tn,{ownerSlug:e,details:s}),t.jsx("div",{className:"rounded-md border border-border/70 px-3 py-2",children:t.jsx(ct,{changes:Object.entries(s.fields).map(([a,r])=>({field:a,old:s.current[a]??null,new:r??null})),entityType:s.entityType,ownerSlug:e,showAll:!0})}),s.reason&&t.jsxs("div",{className:"rounded-md bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function Mr({ownerSlug:e,runId:n,details:s,status:a}){const{operation:r}=s,o=r==="link"||r==="unlink";return t.jsxs("div",{className:"space-y-3",children:[t.jsx(en,{ownerSlug:e,runId:n,details:s}),!o&&t.jsx(tn,{ownerSlug:e,details:s}),t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Change"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:o?Dt(r,a):r==="create"?"Create a new entity after approval.":"Delete this entity after approval."}),o&&t.jsxs("div",{className:"mt-2 space-y-1 text-sm",children:[Mt(s.proposal).map((l,c)=>t.jsxs("div",{children:[t.jsx("span",{className:"text-muted-foreground",children:c===0?"From: ":"To: "}),l.name]},l.id)),t.jsxs("div",{className:"text-muted-foreground",children:["Relationship:"," ",String(s.proposal?.relationship_type??s.proposal?.relationship_type_slug??"Relationship")]})]})]}),!o&&s.proposal&&t.jsxs("div",{className:"rounded-lg border border-border/70 p-3",children:[t.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Proposal"}),t.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed",children:JSON.stringify(s.proposal,null,2)})]}),s.proposerRationale&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.attribution==="agent"?"The agent's reasoning":"The Automation's reasoning"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.proposerRationale})]}),s.reason&&t.jsxs("div",{className:"rounded-lg bg-muted/40 px-3 py-2",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Why this needs approval"}),t.jsx("div",{className:"mt-1 text-sm leading-relaxed",children:s.reason})]})]})}function Dr({summary:e}){return t.jsxs("div",{className:"space-y-2 rounded-md border border-border/70 bg-muted/30 p-3 text-sm",children:[e.chips.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.chips.map(n=>t.jsx(le,{variant:"outline",className:"text-[10px] font-normal",children:n},n))}),e.message&&t.jsx("p",{className:"leading-relaxed text-foreground",children:e.message}),e.reason&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Why"}),t.jsx("div",{className:"mt-0.5 leading-relaxed",children:e.reason})]}),e.body&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e.kind==="verify"?"Expected comment":"Draft"}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed",children:e.body})]}),e.matchPreview&&t.jsxs("div",{className:"rounded-md bg-background/80 px-2.5 py-2",children:[t.jsxs("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:["Matched comment",e.matchAuthor?` · ${e.matchAuthor}`:""]}),t.jsx("div",{className:"mt-0.5 whitespace-pre-wrap leading-relaxed text-muted-foreground",children:e.matchPreview})]}),e.postUrl&&t.jsxs("a",{href:e.postUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:["Open post",t.jsx(Ot,{className:"h-3 w-3"})]})]})}function Lr({ownerSlug:e,content:n,batchReview:s}){const a=n.metadata||{},r=n.run_id??void 0,o=Er(n,a),l=Pr(n,a),c=(o?Tr(o):l?$r(l):void 0)||a.operation_name||a.action_name||(n.title?Ir(n.title):void 0)||"Action",i=a.connection_name,d=a.operation_key||a.action_key||null,p=n.interaction_input_schema||a.input_schema||null,u=y.useMemo(()=>n.interaction_input||a.action_input||a.operation_input||br,[n.interaction_input,a.action_input,a.operation_input]),x=n.interaction_output||a.action_output||void 0,h=Ps(u,x??null,d),S=n.interaction_error||a.error_message||void 0,_=Zt(n.interaction_status,a.status),g=a.reviewed_by_name||a.reviewed_by_id||void 0,R=a.reject_reason||void 0,q=a.initiator,C=as({slug:e}),M=is({slug:e}),D=os(n.id,ls(p,u),p),{values:F,setValues:$}=D,[N,B]=y.useState(null),[f,z]=y.useState(!1),[E,H]=y.useState(""),w=_==="pending_approval"&&N?N:_,A=w==="pending_approval",te=typeof a.source_run_id=="number";return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"h-4 w-4 text-yellow-500"}),t.jsx("span",{className:"font-medium",children:c}),i&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["on ",i]}),w==="confirmed"&&t.jsx(le,{variant:"outline",className:"text-blue-700 border-blue-300 bg-blue-50 dark:bg-blue-950/30 text-[10px]",children:"Approved"}),w==="completed"&&t.jsx(le,{variant:"outline",className:"text-green-700 border-green-300 bg-green-50 dark:bg-green-950/30 text-[10px]",children:"Completed"}),w==="failed"&&t.jsx(le,{variant:"outline",className:"text-red-700 border-red-300 bg-red-50 dark:bg-red-950/30 text-[10px]",children:"Failed"}),w==="rejected"&&t.jsx(le,{variant:"outline",className:"text-muted-foreground text-[10px]",children:"Rejected"})]}),!o&&!l&&(n.author_name||g)&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[n.author_name&&t.jsxs("span",{children:["Requested by"," ",t.jsx(vs,{ownerSlug:e,initiator:q,clientName:n.author_name,fallback:n.author_name})]}),n.author_name&&g&&t.jsx("span",{children:"·"}),g&&t.jsxs("span",{children:[w==="rejected"?"Rejected":"Approved"," by"," ",t.jsx("span",{className:"font-medium text-foreground",children:g})]})]}),o&&t.jsx(Fr,{ownerSlug:e,runId:r,details:o}),!o&&l&&t.jsx(Mr,{ownerSlug:e,runId:r,details:l,status:w}),w==="rejected"&&R&&t.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-xs text-muted-foreground",children:[t.jsx("span",{className:"font-medium text-foreground",children:"Reason:"})," ",R]}),h&&t.jsx(Dr,{summary:h}),(A?D.revision:p)&&(A||Object.keys(u).length>0)&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:h?"Full input":"Input"}),A?t.jsxs(t.Fragment,{children:[t.jsx(ds,{visible:D.hasConflict,onReload:D.reset}),t.jsx(cs,{schema:D.revision,values:F,onValuesChange:$,fieldIdPrefix:`action-${n.id}-`},`action-${n.id}`)]}):h?t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw input"}),t.jsx("pre",{className:"mt-1 bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(u,null,2)})]}):t.jsx("pre",{className:"text-xs bg-muted/50 rounded p-2 font-mono overflow-auto max-h-32",children:JSON.stringify(u,null,2)})]}),w==="completed"&&x&&Object.keys(x).length>0&&!h&&t.jsxs("div",{className:"rounded-md bg-green-50 dark:bg-green-950/30 p-3 text-sm space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-green-700 dark:text-green-400 font-medium",children:[t.jsx(Pt,{className:"h-3.5 w-3.5"}),"Output"]}),t.jsx("pre",{className:"text-xs text-green-800 dark:text-green-300 font-mono whitespace-pre-wrap",children:JSON.stringify(x,null,2)})]}),w==="completed"&&x&&Object.keys(x).length>0&&h&&t.jsxs("details",{className:"text-xs",children:[t.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"Raw output"}),t.jsx("pre",{className:"mt-1 rounded bg-green-50 p-2 font-mono dark:bg-green-950/30 overflow-auto max-h-32",children:JSON.stringify(x,null,2)})]}),w==="failed"&&S&&t.jsxs("div",{className:"rounded-md bg-red-50 dark:bg-red-950/30 p-3 text-sm",children:[t.jsxs("div",{className:"flex items-center gap-1.5 text-red-700 dark:text-red-400 font-medium",children:[t.jsx($t,{className:"h-3.5 w-3.5"}),"Error"]}),t.jsx("p",{className:"text-xs text-red-800 dark:text-red-300 font-mono mt-1",children:S})]}),A&&!N&&te&&t.jsxs("div",{className:"pt-1 text-xs text-muted-foreground",children:["Review this proposal with the other changes in its Automation run.",s]}),A&&r&&!N&&!te&&t.jsx("div",{className:"flex items-center gap-2 pt-1",children:f?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"Reason (optional)",value:E,onChange:I=>H(I.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(T,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>M.mutate({run_id:r,reason:E||void 0},{onSuccess:()=>{B("rejected")}}),disabled:M.isPending,children:[M.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Confirm Reject"]}),t.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{z(!1),H("")},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[t.jsxs(T,{size:"sm",className:"h-7 text-xs",onClick:()=>C.mutate({run_id:r,input:ms(F)},{onSuccess:()=>{B("confirmed")}}),disabled:!D.canSubmit||C.isPending||M.isPending,children:[C.isPending?t.jsx(ce,{size:"sm",className:"mr-1"}):t.jsx(us,{className:"h-3 w-3 mr-1"}),"Confirm"]}),t.jsxs(T,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>z(!0),disabled:C.isPending||M.isPending,children:[t.jsx(ps,{className:"h-3 w-3 mr-1"}),"Reject"]})]})})]})}function Br({content:e,ownerSlug:n}){const s=e.metadata||{},a=s.kind,r=e.run_id??null,o=typeof s.automation_id=="number"?s.automation_id:null,i=Ft(o!=null?String(o):void 0,void 0,void 0,{includeVersions:!1,ownerSlug:n}).data?.automation?.automation_name??(o!=null?`Automation ${o}`:"An Automation"),d=ss({slug:n}),p=rs({slug:n}),[u,x]=y.useState(!1),[h,S]=y.useState(""),[_,g]=y.useState(null);if(a==="automation_batch_reject"){const f=s.reason||void 0;return t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("div",{className:"text-sm font-medium",children:"Proposals rejected"}),f&&t.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:f}),t.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Ask the agent to revise its proposals with this feedback."})]})}const R=Array.isArray(s.changes)?s.changes:[],q=typeof s.created_count=="number"?s.created_count:R.filter(f=>f.kind==="created").length,C=typeof s.updated_count=="number"?s.updated_count:R.filter(f=>f.kind==="updated").length,M=typeof s.denied_count=="number"?s.denied_count:R.filter(f=>f.kind==="denied").length,D=R.filter(f=>f.kind==="denied"),F=R.filter(f=>f.kind==="updated"&&Object.keys(f.applied||{}).length>0),$=typeof s.pending_proposal_count=="number"?s.pending_proposal_count:null,N=$==null||$>0,B=N?"proposed":"applied";return t.jsxs("div",{className:"rounded-md border p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[t.jsxs("div",{className:"text-sm font-medium",children:[B==="proposed"?"Proposed":"Applied"," ",q," ","new + ",C," updated",M>0&&t.jsxs(t.Fragment,{children:[" + ",M," denied"]})]}),t.jsxs("div",{className:"text-xs text-muted-foreground",children:[o!=null?t.jsx(ee,{to:"/$owner/automations/$automationId",params:{owner:n,automationId:String(o)},search:{view:"definition",run_id:void 0},className:"font-medium text-foreground underline-offset-4 hover:underline",children:i}):t.jsx("span",{className:"font-medium text-foreground",children:i}),r!=null&&t.jsxs("span",{children:[" · run #",r]}),$!=null&&$>0&&t.jsxs("span",{children:[" · ",$," pending"]})]})]}),F.length>0&&t.jsx("div",{className:"mt-3 space-y-2",children:F.map(f=>t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:f.name}),t.jsx(ct,{changes:Object.entries(f.applied).map(([z,E])=>({field:z,old:E.old??null,new:E.new??null})),entityId:f.entityId,ownerSlug:n,showAll:!0})]},f.entityId))}),D.length>0&&t.jsx("div",{className:"mt-3 space-y-1.5",children:D.map(f=>t.jsxs("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-2.5 py-2",children:[t.jsxs("div",{className:"text-xs font-medium",children:[f.name," — not written"]}),f.denied&&t.jsxs("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[f.denied.reason,t.jsxs("span",{className:"ml-1 opacity-70",children:["(refused by"," ",f.denied.source==="rule"?"a write rule":"org policy",")"]})]})]},`denied-${f.entityId}-${f.name}`))}),r!=null&&_==null&&N&&t.jsx("div",{className:"mt-3 border-t border-border/70 pt-3",children:u?t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsx("input",{type:"text",placeholder:"What should the agent change?",value:h,onChange:f=>S(f.target.value),className:"h-7 text-xs border rounded px-2 flex-1 bg-background"}),t.jsxs(T,{size:"sm",variant:"destructive",className:"h-7 text-xs",onClick:()=>p.mutate({run_id:r,reason:h||void 0},{onSuccess:()=>g("rejected")}),disabled:p.isPending,children:[p.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Reject all"]}),t.jsx(T,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:()=>{x(!1),S("")},children:"Cancel"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(T,{size:"sm",className:"h-7 text-xs",onClick:()=>d.mutate({run_id:r},{onSuccess:()=>g("approved")}),disabled:d.isPending||p.isPending,children:[d.isPending&&t.jsx(ce,{size:"sm",className:"mr-1"}),"Approve all proposals"]}),t.jsx(T,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>x(!0),disabled:d.isPending||p.isPending,children:"Reject with feedback"})]})}),_==="approved"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals approved."}),_==="rejected"&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Proposals rejected — ask the agent to revise them."}),r!=null&&_==null&&!N&&t.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"All proposals reviewed."})]})}function zr(e){if(!e)return;const n={};for(const[s,a]of Object.entries(e))s==="_lobu_idempotency_key"||s==="agent_id"||(n[s]=a);return Object.keys(n).length>0?n:void 0}function oa({presentation:e="summary",renderDetail:n,onFiltersChange:s,ownerSlug:a,content:r,isReply:o,showParentContext:l,connectorDefinitions:c,hideOriginator:i=!1,hideRunAction:d=!1,hideAttribution:p=!1,hideDetails:u=!1,recordId:x}){const[h,S]=y.useState(null),[_,g]=y.useState(!1),[R,q]=y.useState(!1),[C,M]=y.useState(!1),[D,F]=y.useState(!1),[$,N]=y.useState(!1),[B,f]=y.useState(null),[z,E]=y.useState(r.title??""),[H,w]=y.useState(r.text_content??""),A=Qn(),te=Hn(),I=e==="detail",V=At(),{currentOwner:Ce,allOrgs:pe,isAuthenticated:Re}=Jn(),G=a??Ce,v=G==="me"?null:G,Ae=y.useCallback(async m=>{if(!v){Pe.error("Open this event inside a workspace to interact with it.");return}const b=await Es(v,Number(r.id),m,crypto.randomUUID());return"event_id"in b&&Pe.success("Recorded"),b},[r.id,v]),U=r.payload_data??{},{audit:L,operation:ne,changeSet:W}=Xt(r),se=L&&(U.request!==void 0||U.request_status==="too_large"),fe=L&&Array.isArray(U.sdk_call_trace)&&U.sdk_call_trace.length>0,Y=G?et(G,Number(r.id)):null,K=Re&&v?(pe??[]).find(m=>m.slug===v):void 0,xe=I?void 0:K,je=r.semantic_type==="guidance",{isAdmin:Se,isLoading:_e}=Gn(je?K?.id:void 0),Q=xe?{slug:xe.slug,organizationId:xe.id}:null,Ie=Ct(Q??{slug:null,organizationId:null}),J=Q?.slug??null,Te=y.useMemo(()=>J&&!L?Rt(Ie.data??[],r.semantic_type):[],[J,L,Ie.data,r.semantic_type]),re=Wn(),X=Zs(r),ae=!!(!(ne||W||X)&&Q&&Te.length>0),ye=!I&&!_&&!!Y,j=_t(V?.item?.href.split(/[?#]/)[0]??""),k=j?.owner===G&&j?.eventId===Number(r.id),ge=(m,b,P)=>{V?V.open({href:m,title:b,...P==null?{}:{runId:P}}):A({to:m})},Ee=(m,b)=>{if(!v)return null;const P=`/${v}/events?run_ids=${m}`;return V?.item?.href===P?null:t.jsxs(T,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>s?s({runIds:[m]}):ge(P,"Run activity",m),title:s?"Filter by this run":"Open run activity",children:[t.jsx(ns,{className:"h-3.5 w-3.5"}),b]})},nn=r.run_id!=null&&(s||!(V&&v&&r.automation_id!=null))?Ee(r.run_id,s?"Run":"Open run"):null,be=Yn(r),Qe=r.automation_id,sn=V&&v&&be!=null&&Qe!=null?()=>V.open({href:`/${v}/automations/${Qe}?view=activity&run_id=${be}`,title:`${r.automation_name??`Automation ${Qe}`} · Run #${be}`,runId:be}):void 0,ft=()=>{if(ae&&Q&&v){const m=Number(r.id);Ts(re,Q.slug,Te,m).catch(()=>null).then(b=>ge(et(v,m,b?.key),r.title??"Event"));return}Y&&ge(Y,r.title??"Event")},xt=m=>{const b=m.target;if(!(b instanceof Element))return!1;const P=b.closest('a,button,input,select,textarea,[role="button"],[role="radio"]');return P!==null&&P!==m.currentTarget},rn=m=>{xt(m)||ft()},an=m=>{m.key!=="Enter"&&m.key!==" "||xt(m)||(m.preventDefault(),ft())},ht=r.metadata?.source_run_id,Ne=Hs(r),on=(!r.platform||r.platform==="lobu")&&r.connection_id==null&&r.feed_id==null&&r.origin_type==null&&r.automation_id==null&&!L&&!ne&&!W&&!X&&Ne==null&&r.semantic_type!=="tombstone"&&r.semantic_type!=="notification"&&r.metadata?.tombstone!==!0&&r.interaction_type!=="approval"&&r.interaction_status==null&&!r.is_superseded&&r.superseded_by==null,yt=!!(v&&K&&on&&(!je||!_e&&Se)),gt=yt&&r.payload_type!=="json_template"&&r.payload_type!=="media",vt=()=>{re.invalidateQueries({queryKey:[hs]}),re.invalidateQueries({queryKey:[ys]}),re.invalidateQueries({queryKey:["search-memory"]})},ln=async()=>{if(!(!v||!gt)){if(F(!1),f(null),r.payload_truncated){q(!0);try{const b=(await de("read_knowledge",{content_ids:[Number(r.id)]},{slug:v})).content?.find(P=>Number(P.id)===Number(r.id));E(b?.title??r.title??""),w(b?.text_content??b?.payload_text??r.text_content??""),g(!0)}catch(m){f(m instanceof Error?m.message:"Failed to load full memory.")}finally{q(!1)}return}E(r.title??""),w(r.text_content??""),g(!0)}},dn=async()=>{if(!v||C)return;if(!H.trim()){f("Memory content cannot be empty.");return}M(!0),f(null);try{const b=r.payload_type==="markdown"||r.payload_type==="text"?r.payload_type:"text",P=zr(r.metadata);await de("save_memory",{supersedes_event_id:Number(r.id),semantic_type:r.semantic_type||"note",payload_type:b,title:z.trim()||void 0,content:H,...Array.isArray(r.entity_ids)&&r.entity_ids.length>0?{entity_ids:r.entity_ids}:{},...r.source_url?{source_url:r.source_url}:{},...r.author_name?{author:r.author_name}:{},...r.occurred_at?{occurred_at:r.occurred_at}:{},...r.payload_data&&Object.keys(r.payload_data).length>0?{payload_data:r.payload_data}:{},...P?{metadata:P}:{}},{slug:v}),g(!1),vt(),Pe.success("Memory updated")}catch(b){f(b instanceof Error?b.message:"Failed to update memory.")}finally{M(!1)}},cn=async()=>{if(!(!v||$)){N(!0),f(null);try{const m=Number(r.id),b=await de("run_sdk",{title:"Delete memory",script:`export default async (_ctx, client) => client.knowledge.delete(${JSON.stringify({content_id:m,reason:"Deleted from web UI"})});`},{slug:v});if(b?.success===!1){const fn=typeof b.error=="string"?b.error:b.error?.message||"Failed to delete memory.";throw new Error(fn)}F(!1),k&&V?.close();const P=_t(te.pathname);P?.owner===v&&P.eventId===m&&A({to:"/$owner/events",params:{owner:v}}),vt(),Pe.success("Memory deleted")}catch(m){f(m instanceof Error?m.message:"Failed to delete memory.")}finally{N(!1)}}},un=yt&&!_?D?t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsxs(T,{type:"button",variant:"destructive",size:"sm",className:"h-7 px-2.5 text-xs",disabled:$,onClick:()=>void cn(),children:[$&&t.jsx(ce,{size:"xs",className:"mr-1.5"}),$?"Deleting...":"Delete"]}),t.jsx(T,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",disabled:$,onClick:()=>{F(!1),f(null)},children:"Cancel"})]}):t.jsxs(t.Fragment,{children:[gt&&t.jsxs(T,{type:"button",variant:"ghost",size:"sm","aria-label":"Edit memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground",disabled:R||$,onClick:()=>void ln(),children:[R?t.jsx(ce,{size:"xs"}):t.jsx(fs,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:R?"Loading...":"Edit"})]}),t.jsxs(T,{type:"button",variant:"ghost",size:"sm","aria-label":"Delete memory",className:"h-7 gap-1 px-2 text-xs text-muted-foreground hover:text-destructive",disabled:R,onClick:()=>{f(null),F(!0)},children:[t.jsx(xs,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"Delete"})]})]}):null,mn=_?t.jsxs("form",{className:"mt-2 space-y-3 rounded-lg border bg-background p-3 text-foreground",onSubmit:m=>{m.preventDefault(),dn()},children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{htmlFor:`memory-title-${r.id}`,className:"block text-xs font-medium text-muted-foreground",children:"Title"}),t.jsx(Xn,{id:`memory-title-${r.id}`,"aria-label":"Memory title",value:z,onChange:m=>E(m.target.value),placeholder:"Optional short summary",disabled:C})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("label",{htmlFor:`memory-content-${r.id}`,className:"block text-xs font-medium text-muted-foreground",children:["Content",t.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),t.jsx(Zn,{id:`memory-content-${r.id}`,"aria-label":"Memory content",value:H,onChange:m=>w(m.target.value),rows:5,disabled:C})]}),B&&t.jsx("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:B}),t.jsx(es,{onCancel:()=>{g(!1),f(null)},cancelDisabled:C,children:t.jsxs(T,{type:"submit",disabled:C||H.trim().length===0,children:[C&&t.jsx(ce,{size:"xs",className:"mr-1.5"}),C?"Saving...":"Save"]})})]}):null,pn=!_&&B?t.jsx("div",{role:"alert",className:"mt-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:B}):null,He=X?t.jsx(er,{content:r,detail:I}):I&&v?W?t.jsx(Br,{content:r,ownerSlug:v}):ne?t.jsx(Lr,{ownerSlug:v,content:r,batchReview:typeof ht=="number"?Ee(ht,"Review run"):null}):void 0:void 0,$e=I&&n?n(He):{content:He,nativeHeading:He!=null};return t.jsx("div",{className:Z(o?"border-l-2 border-l-muted pl-4":"",ye&&"cursor-pointer rounded-lg p-3 transition-colors hover:bg-accent/40",ye&&k&&"bg-accent ring-1 ring-inset ring-primary/20"),...ye?{role:"button","aria-current":k?"true":void 0,tabIndex:0,onClick:rn,onKeyDown:an}:{},children:t.jsx(qr,{primaryContent:$e.content,nativeHeading:$e.nativeHeading,heading:Ne&&v?t.jsx(Ys,{event:Ne,recordId:x,ownerSlug:v}):void 0,body:mn??(Ne&&v?t.jsx(Xs,{event:Ne,ownerSlug:v}):void 0),detailLinks:$e.links,headingAside:$e.headingAside,hideDetails:u,onFiltersChange:s,presentation:e,content:r,ownerSlug:G??void 0,showParentContext:l,connectorDefinitions:c,onRenderedAction:v?Ae:void 0,runAction:d?null:nn,memoryActions:un,memoryFeedback:pn,hideOriginator:i,hideAttribution:p,runId:be??r.run_id??null,onRunSelect:sn,auditDetails:I&&(se||fe)&&t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"request",label:"Request",available:se},{key:"calls",label:"SDK calls",available:fe}].map(m=>m.available?t.jsxs(T,{variant:"outline",size:"sm","aria-expanded":h===m.key,onClick:()=>S(b=>b===m.key?null:m.key),children:[h===m.key?t.jsx(tt,{className:"h-3.5 w-3.5"}):t.jsx(nt,{className:"h-3.5 w-3.5"}),m.label]},m.key):null)}),h==="request"&&(U.request_status==="too_large"?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["The request was too large to retain",typeof U.request_bytes=="number"?` (${U.request_bytes.toLocaleString()} bytes).`:"."]}):t.jsx(kt,{value:U.request})),h==="calls"&&t.jsx(kt,{value:U.sdk_call_trace})]})})})}function Vr(e,n){const s=e.payload_data??{},a=e.metadata??{};if(n.audit&&typeof s.success=="boolean")return s.success?"completed":"failed";if(n.changeSet)return a.kind==="automation_batch_reject"?"rejected":typeof a.pending_proposal_count!="number"?void 0:a.pending_proposal_count>0?"pending_approval":"completed";if(n.operation)return Zt(e.interaction_status,typeof a.status=="string"?a.status:void 0)}function Ur(e){return e==="pending_approval"?"Needs approval":e==="confirmed"?"Approved":e?ve(e):null}function qr({presentation:e,primaryContent:n,nativeHeading:s=!1,heading:a,body:r,detailLinks:o,headingAside:l,onFiltersChange:c,content:i,ownerSlug:d,showParentContext:p,connectorDefinitions:u,onRenderedAction:x,runAction:h,memoryActions:S,memoryFeedback:_,auditDetails:g,hideOriginator:R=!1,hideAttribution:q=!1,runId:C,onRunSelect:M,hideDetails:D=!1}){const[F,$]=y.useState(!1),N=i.metadata??{},B=typeof i.score=="number"&&Number.isFinite(i.score)?Math.round(i.score):"-",f=i.payload_type||"text",z=i.text_content||"",E=e==="summary",H=e==null&&(f==="text"||f==="markdown")&&z.length>500,w=H&&!F?`${z.slice(0,500)}...`:z,A=i.payload_data??{},te=Xt(i),{audit:I,operation:V,changeSet:Ce}=te,pe=Vr(i,te),Re=Ur(pe),G=(I?Is(A,A.tool_name):null)??(E&&I&&typeof A.tool_name=="string"?ve(A.tool_name):i.title),v=I&&A.error&&typeof A.error=="object"?A.error.message:void 0,Ae=(typeof v=="string"?v:void 0)??i.interaction_error??(typeof N.error_message=="string"?N.error_message:void 0),U=Ae||(I?"":z),[L,ne]=y.useState(e!=="summary"&&I&&n==null&&o==null),W=I?A.duration_ms:N.duration_ms,se=typeof W=="number"&&Number.isFinite(W)&&W>=0?W:null,fe=I&&typeof A.sdk_call_count=="number"&&Number.isSafeInteger(A.sdk_call_count)&&A.sdk_call_count>=0?A.sdk_call_count:null,Y=N.thumbnail_url||N.thumbnail,K=N.media_url,xe=E?[]:Cr(N),je=Object.entries(i.classifications||{}).flatMap(([j,k])=>{const ge=Sr(k);return ge.values.map(Ee=>({slug:j,value:Ee,isManual:ge.isManual}))}),Se=(()=>{const j=i.platform||(typeof N.platform=="string"?N.platform:null),k=i.connection_id!=null?i.connection_id:N.source_connection_id!=null?Number(N.source_connection_id):null;return{...i,platform:j,connection_id:k!=null&&Number.isFinite(k)?k:null}})(),_e=(()=>{const j=i.source_url??N.browser_url;if(typeof j!="string"||!URL.canParse(j))return null;const k=new URL(j);return k.protocol==="https:"||k.protocol==="http:"?k:null})(),Q=i.occurred_at?new Date(i.occurred_at):null,Ie=I?In:V?Tt:Ce?Tn:i.semantic_type==="notification"?En:$n,J=I?"SDK call":ve(i.semantic_type||i.origin_type||"Event"),Te=t.jsx(ts,{source:Se,connectorDefinitions:u,sourceUrl:_e,label:J,fallback:t.jsx(Ie,{className:"h-4 w-4"})}),re=xe.length>0?t.jsx("dl",{className:"grid gap-x-3 gap-y-2 text-sm sm:grid-cols-[minmax(140px,180px)_1fr]",children:xe.map(([j,k])=>t.jsxs("div",{className:"contents",children:[t.jsx("dt",{className:"text-muted-foreground",children:ve(j)}),t.jsx("dd",{className:"min-w-0 break-words font-mono text-xs sm:text-sm",children:kr(k)})]},j))}):null,X=r?t.jsx("div",{className:"mt-1",children:r}):E?U?t.jsx("p",{className:Z("line-clamp-2 text-sm whitespace-pre-wrap",Ae&&"text-destructive"),children:U.slice(0,320)}):null:t.jsxs(t.Fragment,{children:[i.rating&&t.jsx("div",{className:"flex items-center gap-1 mb-2",children:[1,2,3,4,5].map(j=>t.jsx(Et,{className:`h-4 w-4 ${j<=Number(i.rating)?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},j))}),Y&&t.jsx("a",{href:K||i.source_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block mb-2",children:t.jsx("img",{src:Y,alt:"",className:`rounded-md object-cover ${f==="media"?"max-h-96 w-full":"max-h-48"}`,loading:"lazy"})}),(()=>{switch(f){case"markdown":if(w)return t.jsx("div",{className:"max-w-none text-sm space-y-2",children:t.jsx(Pn,{text:w})});break;case"json_template":{const j=i.payload_data;if(j?._truncated===!0&&typeof j.bytes=="number")return t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsx("p",{role:"status",children:"This report is too large for the feed preview. Open the full event to view its complete data."}),d?t.jsx(ee,{to:et(d,Number(i.id)),className:"underline underline-offset-4",children:"Open full report"}):null]});const k=i.payload_template;if(k?.root)return t.jsx(_r,{template:k,data:i.payload_data||{},onAction:n?void 0:x},`${d}:${i.id}`);if(w)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:w});break}case"media":return t.jsxs("div",{className:"space-y-3",children:[!Y&&K&&t.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate block",children:K}),w&&t.jsx("div",{className:"text-sm whitespace-pre-wrap text-muted-foreground",children:w})]});case"empty":return t.jsxs("div",{className:"space-y-3",children:[g,re??(g?null:t.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No content"}))]});default:if(w)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:w});break}return t.jsxs("div",{className:"space-y-3",children:[K&&!Y&&t.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground truncate block",children:K}),re]})})()]}),he=n!=null||e==="detail"&&I,ae=l!==void 0,ye=he||o!=null;return y.useEffect(()=>{if(!ae||!L)return;const j=k=>{k.key==="Escape"&&(k.preventDefault(),ne(!1))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[ae,L]),t.jsxs(t.Fragment,{children:[p&&i.parent_context&&t.jsxs("div",{className:"mb-3 p-2 bg-muted/50 rounded-md text-sm",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Replying to:"}),t.jsx("div",{className:"font-medium",children:i.parent_context.author_name}),t.jsx("div",{className:"text-muted-foreground line-clamp-2",children:i.parent_context.text_content})]}),t.jsxs("div",{className:Z("flex gap-3",e==="detail"&&"mb-5",ae&&"relative"),children:[t.jsx(On,{children:Te}),t.jsxs("div",{className:"min-w-0 flex-1",children:[e==="detail"&&(()=>{const j={semanticTypes:[i.semantic_type],...typeof i.automation_id=="number"?{producedByAutomationId:i.automation_id}:{},...typeof i.run_id=="number"?{runIds:[i.run_id]}:{}},k={semantic_types:i.semantic_type,...typeof i.automation_id=="number"?{produced_by:String(i.automation_id)}:{},...typeof i.run_id=="number"?{run_ids:String(i.run_id)}:{}};return t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.semantic_type?c?t.jsx("button",{type:"button",className:"hover:underline",title:`Show all ${J} events`,onClick:()=>c(j),children:J}):d?t.jsx(ee,{to:"/$owner/events",params:{owner:d},search:k,className:"hover:underline",title:`Show all ${J} events`,children:J}):t.jsx("span",{children:J}):t.jsx("span",{children:J}),Q&&t.jsx("time",{dateTime:Q.toISOString(),children:Fn(Q)})]})})(),t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[(a??G)&&!s&&t.jsx("h4",{className:Z("min-w-0 font-medium",e==="detail"?"text-xl leading-snug":"line-clamp-2 text-sm"),children:a??G}),e!=="detail"&&Q&&t.jsx(Mn,{at:Q}),ae&&t.jsxs("div",{className:"flex shrink-0 items-center gap-1 pt-0.5",children:[l,ye&&t.jsxs(T,{type:"button",variant:"ghost",size:"sm",className:"h-7 gap-1 px-2 text-muted-foreground hover:text-foreground","aria-expanded":L,onClick:()=>ne(j=>!j),children:["Details",L?t.jsx(tt,{className:"h-3.5 w-3.5"}):t.jsx(nt,{className:"h-3.5 w-3.5"})]})]})]}),E&&t.jsx("div",{className:"mt-1 text-muted-foreground",children:X}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[Re&&!s&&t.jsxs(le,{variant:pe==="failed"?"destructive":"secondary",className:"gap-1 text-xs",children:[pe==="failed"?t.jsx($t,{className:"h-3 w-3"}):pe==="completed"?t.jsx(Pt,{className:"h-3 w-3"}):null,Re]}),fe!=null&&t.jsxs("span",{children:[fe," SDK ",fe===1?"call":"calls"]}),se!=null&&t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(Dn,{className:"h-3 w-3"}),se<1e3?`${Math.round(se)}ms`:`${Number((se/1e3).toFixed(2))}s`]}),h,B==="-"||E&&(I||V||Ce)?null:i.score_breakdown?t.jsxs(Ln,{children:[t.jsx(Bn,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"sm",className:"h-7 px-2",children:t.jsx("span",{className:"font-medium",children:B})})}),t.jsx(zn,{className:"w-64",align:"end",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"font-medium",children:"Score Breakdown"}),t.jsx(Rr,{breakdown:i.score_breakdown})]})})]}):null,_e&&t.jsxs(Vn,{children:[t.jsx(Un,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"sm",className:"h-7 gap-1 px-1",asChild:!0,children:t.jsxs("a",{href:_e.href,target:"_blank",rel:"noopener noreferrer",children:[t.jsx(Ot,{className:"h-3.5 w-3.5"}),t.jsx("span",{className:E?"sr-only":void 0,children:"View original"})]})})}),t.jsx(qn,{children:"View original"})]}),S]}),_,d&&!q&&t.jsx(Kn,{owner:d,source:Se,connectorDefinitions:u,onFiltersChange:c,variant:"chips",className:"mt-2 text-xs",hideOriginator:R,runId:C,onRunSelect:M}),(i.author_name||!d)&&!(e==="detail"&&V)&&t.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:i.author_name||wr(i)})]}),ae&&L&&ye&&t.jsxs("div",{className:"absolute inset-x-0 top-full z-20 mt-2 max-h-[65vh] space-y-3 overflow-y-auto rounded-lg border bg-background p-3 shadow-lg",children:[o,he&&X]})]}),!E&&typeof v=="string"&&t.jsx("p",{className:"mb-2 text-sm whitespace-pre-wrap text-destructive",children:v}),n,!E&&!he&&X,(he||o!=null)&&l===void 0&&!(D&&n!=null)&&t.jsxs("details",{className:"mt-5 border-t pt-3",open:L,onToggle:j=>ne(j.currentTarget.open),children:[t.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground",children:"Details"}),L&&t.jsxs("div",{className:"mt-3 space-y-3",children:[o,he&&X]})]}),H&&t.jsx(T,{variant:"link",size:"sm",className:"px-0 h-6 mt-1",onClick:()=>$(!F),children:F?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"h-3 w-3 mr-1"})," Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(nt,{className:"h-3 w-3 mr-1"})," Show more"]})}),je.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:je.map(j=>t.jsx(Ar,{slug:j.slug,value:j.value||"",isManual:j.isManual},j.slug))})]})}export{oa as E,ia as R,qr as a,aa as b,na as c,ra as r,ve as s,Is as t,sa as u};
2
- //# sourceMappingURL=event-card-DVUB8my6.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,cU as C,$ as P,Y as O,i as g,di as j,r as m,B as h,dC as N,dD as b,I as y,dE as k,X as z,dF as S,dG as D,dH as B,m as I,dI as F,dJ as E,dK as L,dL as $,cT as R}from"./index-DdBTTN3y.js";import{a as _,C as H,s as Q}from"./calendar-Ck0yOLYu.js";function w(s,t,n){return _(s,-t,n)}function U({selected:s}){return e.jsx(O,{className:g("h-4 w-4 shrink-0",s?"opacity-100":"opacity-0")})}function Y({searchPlaceholder:s,emptyText:t="No options",options:n,selected:o,multiple:l=!1,onSelect:a}){return{kind:"list",searchPlaceholder:s,emptyText:t,items:u=>n.map(r=>{const i=o.includes(r.value);return e.jsxs(C,{value:`${r.label} ${r.keywords??r.value}`,onSelect:()=>{a(r.value),l||u()},"aria-label":r.label,className:"group gap-2",children:[l?e.jsx(P,{checked:i,className:"mr-1"}):e.jsx(U,{selected:i}),r.icon,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.count!=null?e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r.count.toLocaleString()}):null,r.action]},r.value)})}}function Z([s,t],n,o){return s<=n?`≤ ${t}`:t>=o?`≥ ${s}`:`${s}–${t}`}function A({value:s,min:t,max:n,onApply:o,close:l}){const[a,u]=m.useState(String(s?.[0]??t)),[r,i]=m.useState(String(s?.[1]??n)),[c,f]=m.useState(),d=x=>{x.preventDefault();const p=Number(a),v=Number(r);if(!Number.isFinite(p)||!Number.isFinite(v)){f("Enter a number.");return}if(p<t||v>n){f(`Use values between ${t} and ${n}.`);return}if(p>v){f("The lower bound must not exceed the upper bound.");return}o([p,v]),l()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:d,children:[e.jsxs("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2",children:[e.jsx(y,{"aria-label":"From",type:"number",min:t,max:n,value:a,onChange:x=>u(x.target.value)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"to"}),e.jsx(y,{"aria-label":"To",type:"number",min:t,max:n,value:r,onChange:x=>i(x.target.value)})]}),c?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:c}):null,e.jsx(h,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function ee(s){return{kind:"custom",render:t=>e.jsx(A,{...s,close:t})}}const G=[{label:"Today",range:()=>[N(new Date),b(new Date)]},{label:"Last 7 days",range:()=>[N(w(new Date,6)),b(new Date)]},{label:"Last 30 days",range:()=>[N(w(new Date,29)),b(new Date)]},{label:"This month",range:()=>[Q(new Date),b(new Date)]}];function se([s,t]){return j(s,"yyyy-MM-dd")===j(t,"yyyy-MM-dd")?j(s,"LLL d, y"):`${j(s,"LLL d")} – ${j(t,"LLL d, y")}`}function V({value:s,onApply:t,close:n}){const[o,l]=m.useState(s?{from:s[0],to:s[1]}:void 0);return e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"flex flex-col gap-0.5 border-b p-2 sm:w-36 sm:border-b-0 sm:border-r",children:G.map(a=>e.jsx(h,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>{t(a.range()),n()},children:a.label},a.label))}),e.jsx(H,{mode:"range",defaultMonth:o?.from,selected:o,onSelect:a=>{l(a),a?.from&&a.to&&a.from!==a.to&&(t([N(a.from),b(a.to)]),n())},numberOfMonths:1})]})}function te(s){return{kind:"custom",className:"w-auto",render:t=>e.jsx(V,{...s,close:t})}}function q({type:s,label:t,value:n,onApply:o,close:l}){const[a,u]=m.useState(n==null?"":String(n)),[r,i]=m.useState(),c=f=>{if(f.preventDefault(),s==="number"){const d=Number(a);if(a.trim()===""||!Number.isFinite(d)){i("Enter a number.");return}o(d)}else o(a);l()};return e.jsxs("form",{className:"space-y-3 p-3",onSubmit:c,children:[e.jsx(y,{autoFocus:!0,"aria-label":t,type:s,step:s==="number"?"any":void 0,value:a,onChange:f=>u(f.target.value),placeholder:"Enter a value…"}),r?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:r}):null,e.jsx(h,{type:"submit",size:"sm",className:"w-full",children:"Apply"})]})}function ae(s){return{kind:"custom",render:t=>e.jsx(q,{...s,close:t})}}const T="w-72";function M({editor:s,close:t,header:n,footer:o}){const[l,a]=m.useState("");return e.jsxs(e.Fragment,{children:[n,s.kind==="list"?e.jsxs(F,{shouldFilter:!s.onQueryChange,children:[e.jsx(E,{autoFocus:!0,placeholder:s.searchPlaceholder,value:l,onValueChange:u=>{a(u),s.onQueryChange?.(u)}}),e.jsxs(L,{children:[e.jsx($,{children:s.emptyText}),e.jsx(R,{children:s.items(t,l)})]})]}):s.render(t),o]})}function J({chip:s,editor:t}){const[n,o]=m.useState(!1),l=s.onRemove!=null,a=[s.label,s.op,s.value].filter(Boolean).join(" "),u=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground",children:s.label}),s.op?e.jsx("span",{className:"text-muted-foreground",children:s.op}):null,e.jsx("span",{className:"min-w-0 truncate font-medium",children:s.value})]}),r=t?e.jsx(D,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Edit filter: ${a}`,className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1 focus-visible:outline-none",children:u})}):e.jsx("span",{className:"flex min-w-0 items-center gap-1.5 pl-2.5 pr-1",children:u});return e.jsxs(k,{open:n,onOpenChange:o,children:[e.jsxs("div",{"data-filter-chip":s.id,title:s.title,className:g("inline-flex h-8 max-w-full items-stretch rounded-md border text-sm",s.tone==="warning"?"border-amber-500/60 bg-amber-500/10":l?"bg-muted":"border-dashed bg-transparent",n&&"ring-1 ring-ring",!l&&"pr-1.5"),children:[r,l?e.jsx("button",{type:"button","aria-label":`Remove filter: ${a}`,onClick:s.onRemove,className:"flex w-7 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:e.jsx(z,{className:"h-3.5 w-3.5"})}):null]}),t?e.jsx(S,{align:"start",className:g("p-0",T,t.className),children:e.jsx(M,{editor:t,close:()=>o(!1),footer:l?e.jsx("div",{className:"border-t p-1",children:e.jsx(h,{variant:"ghost",size:"sm",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{o(!1),s.onRemove?.()},children:"Remove filter"})}):null})}):null]})}function K({fields:s}){const[t,n]=m.useState(!1),[o,l]=m.useState(),a=s.find(i=>i.key===o),u=[...new Set(s.map(i=>i.group??""))],r=()=>{n(!1),l(void 0)};return e.jsxs(k,{open:t,onOpenChange:i=>{n(i),i||l(void 0)},children:[e.jsx(D,{asChild:!0,children:e.jsxs(h,{variant:"outline",size:"sm",className:"h-8 gap-1.5 font-normal text-muted-foreground",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"Filter"]})}),e.jsx(S,{align:"start",className:g("p-0",T,a?.editor.className),children:a?e.jsx(M,{editor:a.editor,close:r,header:e.jsxs("div",{className:"flex items-center gap-1 border-b px-1 py-1 text-sm font-medium",children:[e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":"Back to filters",onClick:()=>l(void 0),children:e.jsx(I,{className:"h-4 w-4"})}),a.label]})},a.key):e.jsxs(F,{children:[e.jsx(E,{autoFocus:!0,placeholder:"Filter by…"}),e.jsxs(L,{children:[e.jsx($,{children:"No matching filter"}),u.map(i=>e.jsx(R,{heading:i||void 0,children:s.filter(c=>(c.group??"")===i).map(c=>e.jsxs(C,{value:`${c.label} ${c.key}`,onSelect:()=>l(c.key),className:"gap-2",children:[c.icon?e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",children:c.icon}):null,c.label]},c.key))},i))]})]})})]})}function ne({fields:s,chips:t,meta:n,actions:o,trailing:l,onClearAll:a,hasClearableState:u=!1,className:r,label:i="Filters"}){const c=s.filter(d=>d.inMenu!==!1),f=t.filter(d=>d.onRemove).length;return e.jsxs("div",{role:"search","aria-label":i,className:g("flex min-w-0 flex-wrap items-center gap-2",r),children:[t.map(d=>e.jsx(J,{chip:d,editor:d.editor??s.find(x=>x.key===(d.field??d.id))?.editor},d.id)),c.length>0?e.jsx(K,{fields:c}):null,o,e.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[n?e.jsx("span",{className:"text-sm text-muted-foreground",children:n}):null,a&&(f>0||u)?e.jsx(h,{variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",onClick:a,children:"Clear all"}):null,l]})]})}export{ne as F,U as S,Z as a,te as d,se as f,Y as o,ee as r,ae as v};
2
- //# sourceMappingURL=filter-bar-wPaR12SS.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as o}from"./index-DdBTTN3y.js";function n(){return t.jsx(o,{})}export{n as component};
2
- //# sourceMappingURL=guardrails-Csusrok2.js.map
@@ -1,2 +0,0 @@
1
- import{j4 as t,j as n}from"./index-DdBTTN3y.js";import{a as i}from"./agents-workbench-bPTjdVS1.js";import"./agent-editor-form-CdA5vLr8.js";import"./model-selector-CgU8SJMF.js";import"./proposal-review-shell-D6KABxah.js";import"./runs-fFJ1lPnw.js";import"./nav-pill-DrFkuyUQ.js";function g(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(i,{owner:o,agentId:r,tab:"identity",runId:e.run_id})}export{g as component};
2
- //# sourceMappingURL=identity-Dmg3STO8.js.map
@@ -1,2 +0,0 @@
1
- import{av as m,aw as s,j as t,ak as p,al as a}from"./index-DdBTTN3y.js";import{A as n}from"./activity-route-view-DN0ZEAzr.js";import{E as c}from"./events-feed-B9CZHI_P.js";import"./record-activity-C9gVBbF0.js";import"./filter-bar-wPaR12SS.js";import"./calendar-Ck0yOLYu.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-D8LMhehh.js";import"./runs-fFJ1lPnw.js";import"./source-record-panels-Bh0n4gGw.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./client-activity-scopes-CXOWB5co.js";import"./agent-loading-shells-ClY_O6lb.js";import"./member-scope-gate-4FQ0aanZ.js";import"./runs-panel-DEnZHTa5.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./runs-table-XGnxJl7S.js";import"./nav-pill-DrFkuyUQ.js";import"./public-shell-ready-BIVCHQHe.js";function J(){const{owner:r}=m.useParams(),i=m.useSearch();if(r==="me"){const o=s(i),e={sortBy:"date",sortOrder:"desc",...o.contentIds?.length?{contentIds:o.contentIds}:{clientIds:o.clientIds,mcpActivityId:o.mcpActivityId}};return t.jsx(p,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(a,{className:"flex flex-col gap-6",children:[t.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),t.jsx(c,{organizationId:null,ownerSlug:"me",filters:e})]})})}return t.jsx(n,{owner:r,search:i})}export{J as component};
2
- //# sourceMappingURL=index-BUBcNNUY.js.map
@@ -1,2 +0,0 @@
1
- import{r as i,j as e,B as d,bc as M,bb as E,aG as O,aB as P,aH as D,b2 as A,bd as F,b3 as I,b4 as z,L as B,be as W,bf as U,ak as G,az as K,al as $}from"./index-DdBTTN3y.js";import{A as H}from"./automation-row-DCHM--aD.js";import{o as S,F as Q}from"./filter-bar-wPaR12SS.js";import{D as h,m as q,f as J,e as V}from"./model-jL871x2J.js";import{R as X}from"./run-activity-link-CaIBSRQj.js";import{L as Y}from"./list-skeleton-CXDLkYTg.js";import{u as Z,a as ee}from"./use-automations-BLNjxq2K.js";import"./calendar-Ck0yOLYu.js";const te=[{value:"all",label:"All"},{value:"event",label:"Event"},{value:"schedule",label:"Schedule"},{value:"manual",label:"Manual"}];function ae({pending:a,onConfirm:s}){const[u,l]=i.useState(!1);return u?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(d,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:s,children:"Delete"}),e.jsx(d,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"})]}):e.jsx(d,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete",onClick:()=>l(!0),children:e.jsx(M,{className:"h-4 w-4"})})}const C=[{value:"reply",label:"Reply to source"},{value:"silent",label:"Runs silently"}],_=[{value:"active",label:"Active"},{value:"failing",label:"Failing"}];function se({facets:a,onChange:s,trailing:u}){const l=[{key:"output",label:"Output",editor:S({searchPlaceholder:"Search outputs...",options:C,selected:a.output==="any"?[]:[a.output],onSelect:n=>s({output:n})})},{key:"state",label:"State",editor:S({searchPlaceholder:"Search states...",options:_,selected:a.state==="any"?[]:[a.state],onSelect:n=>s({state:n})})}],c=[];return a.output!=="any"&&c.push({id:"output",label:"Output",op:"is",value:C.find(n=>n.value===a.output)?.label??a.output,onRemove:()=>s({output:"any"})}),a.state!=="any"&&c.push({id:"state",label:"State",op:"is",value:_.find(n=>n.value===a.state)?.label??a.state,onRemove:()=>s({state:"any"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:te.map(n=>e.jsx(d,{type:"button",variant:a.kind===n.value?"secondary":"ghost","aria-pressed":a.kind===n.value,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>s({kind:n.value}),children:n.label},n.value))}),e.jsx(Q,{label:"Automation filters",className:"min-w-0 flex-1",fields:l,chips:c,trailing:u,onClearAll:()=>s(h),hasClearableState:a.kind!=="all"})]})}function ne(a,s){return`flex items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-accent/50 ${a===s-1?"":"border-b"}`}function oe({owner:a,organizationId:s,isWorkspaceLoading:u}){const[l,c]=i.useState(h),n=t=>c(o=>({...o,...t})),m=Z(s??void 0),{data:v=[]}=E({enabled:!!s}),{data:f=[]}=O(),{data:p=[]}=P(s),b=ee(),L=i.useMemo(()=>{const t=new Map;for(const o of v)t.set(o.agentId,o.name);return t},[v]),R=i.useMemo(()=>{const t=new Map;for(const o of f)t.set(o.id,o.label||o.platform||o.id);return t},[f]),y=i.useMemo(()=>new Map(p.map(t=>[t.key,t.name])),[p]),j=i.useMemo(()=>{const t=new Set;for(const o of m.data??[])for(const r of o.triggers??[])typeof r?.connection_id=="number"&&t.add(r.connection_id);return[...t].sort((o,r)=>o-r)},[m.data]),{data:w}=D(s,{connectionIds:j,enabled:j.length>0}),N=i.useMemo(()=>new Map((w??[]).map(t=>[t.id,t])),[w]),x=i.useMemo(()=>q(m.data??[],y,N),[m.data,y,N]),g=i.useMemo(()=>J(x,l),[x,l]),T=u||m.isLoading,k=e.jsx(d,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:e.jsxs(B,{to:"/$owner/automations/new",params:{owner:a},children:[e.jsx(W,{className:"mr-1.5 h-3.5 w-3.5"}),"New automation"]})});return T?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:k}),e.jsx(Y,{label:"Loading automations",actions:!0})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"What runs on its own — on a schedule, on an event, or when you ask."}),e.jsx(se,{facets:l,onChange:n,trailing:k}),x.length===0?e.jsx(A,{icon:F,title:"No automations yet",description:"Automations act on their own — reply to a message, run a nightly summary, react to a ticket. Use New automation to create one."}):g.length===0?e.jsx(A,{icon:I.automations.icon,title:"No automations match this filter",description:"Try another filter.",secondaryActionLabel:"Show all",secondaryOnAction:()=>c(h)}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:g.map((t,o)=>e.jsx(H,{automation:t,agentName:t.automation.managed_agent_id?L.get(t.automation.managed_agent_id)??t.automation.managed_agent_id:null,deviceLabel:t.automation.device_worker_id?R.get(t.automation.device_worker_id)??t.automation.device_worker_id:null,connectorDisplay:(()=>{const r=V(t.automation);return r?z(r,p):null})(),owner:a,rowClass:ne(o,g.length),actions:e.jsxs(e.Fragment,{children:[e.jsx(X,{owner:a,filters:{automationIds:[Number(t.automation.automation_id)],bucket:"automation"},name:t.does}),e.jsx(ae,{pending:b.isPending,onConfirm:()=>b.mutate(t.automation.automation_id)})]})},t.key))})]})}function xe(){const{owner:a}=U.useParams();return e.jsx(G,{className:"gap-3 pt-2.5 pb-8",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(K,{owner:a,children:s=>e.jsx($,{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(oe,{owner:s.ownerSlug,organizationId:s.organizationId,isWorkspaceLoading:s.isWorkspaceLoading})})})})})}export{xe as component};
2
- //# sourceMappingURL=index-BUDr4-Yv.js.map
@@ -1,2 +0,0 @@
1
- import{j9 as o,j as e}from"./index-DdBTTN3y.js";import{A as n}from"./agent-guardrails-route-BJyfalBY.js";import"./model-selector-CgU8SJMF.js";import"./agent-tab-intro-ednTs4WF.js";import"./table-BUqshjxa.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function d(){const{owner:r,agentId:t}=o.useParams();return e.jsx(n,{owner:r,agentId:t})}export{d as component};
2
- //# sourceMappingURL=index-BYPQWVwD.js.map
@@ -1,2 +0,0 @@
1
- import{j7 as r,j as e}from"./index-DdBTTN3y.js";import{A as m}from"./agent-skills-route-Bv5luNdw.js";import"./agent-skill-context-BAaGpvfS.js";import"./core.esm-CQzL3ObT.js";import"./skill-editor-D_W3QlRz.js";import"./agent-tab-intro-ednTs4WF.js";import"./agent-loading-shells-ClY_O6lb.js";import"./agent-card-controls-C5jNWgfq.js";function j(){const{owner:t,agentId:o}=r.useParams();return e.jsx(m,{owner:t,agentId:o})}export{j as component};
2
- //# sourceMappingURL=index-BfpaPJPj.js.map
@@ -1,2 +0,0 @@
1
- import{ax as r,j as m}from"./index-DdBTTN3y.js";import{M as p}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function v(){const{owner:t}=r.useParams(),o=r.useSearch();return m.jsx(p,{ownerSlug:t,create:!1,createType:o.create_type==="true"})}export{v as component};
2
- //# sourceMappingURL=index-BicNFLBW.js.map
@@ -1,2 +0,0 @@
1
- import{iv as e,j as o,az as n}from"./index-DdBTTN3y.js";import{A as a}from"./agent-connect-pages-DcTuiSt9.js";import"./agent-client-setup-list-DbXtJTsO.js";import"./connector-page-shell-Cs1SjrYB.js";import"./copy-button-DjMWgrBf.js";import"./clients-BJRcMk1A.js";import"./client-rows-36VnmgMK.js";function x(){const{owner:t}=e.useParams();return o.jsx(n,{owner:t,children:({ownerSlug:r})=>o.jsx(a,{owner:r})})}export{x as component};
2
- //# sourceMappingURL=index-Bsdv5aks.js.map
@@ -1,2 +0,0 @@
1
- import{bi as t,j as i,bj as m}from"./index-DdBTTN3y.js";import{M as e}from"./memory-browse-page-CNZJbCJC.js";import"./public-shell-ready-BIVCHQHe.js";import"./connector-boxes-lFc-WP83.js";import"./connection-label-BobuYiAG.js";import"./connections-browser-V-3td9DB.js";import"./status-dot-Cpq63I7p.js";import"./connector-scope-lists--vNdbOn0.js";import"./use-automations-BLNjxq2K.js";import"./model-jL871x2J.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C0_9VcSs.js";import"./entity-type-page-BLwH6qa7.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./code-editor-DNuRKde1.js";import"./renderer-DXfJaCCa.js";import"./calendar-Ck0yOLYu.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./entity-avatar-TVKjZxWQ.js";import"./filter-bar-wPaR12SS.js";import"./core.esm-CQzL3ObT.js";import"./view-param-filters-CER47Tlz.js";import"./app-bridge-C4nPtae3.js";import"./nav-pill-DrFkuyUQ.js";import"./member-scope-gate-4FQ0aanZ.js";function C(){const{owner:o,entityType:r}=t.useParams(),{create:p}=t.useSearch();return i.jsx(e,{ownerSlug:o,typeScope:m(r),create:p??!1})}export{C as component};
2
- //# sourceMappingURL=index-CX0pJ9j9.js.map
@@ -1,2 +0,0 @@
1
- import{z as t,j as i}from"./index-DdBTTN3y.js";import{A as m}from"./activity-route-view-DN0ZEAzr.js";import"./record-activity-C9gVBbF0.js";import"./filter-bar-wPaR12SS.js";import"./calendar-Ck0yOLYu.js";import"./connection-label-BobuYiAG.js";import"./manage-gear-D8LMhehh.js";import"./runs-fFJ1lPnw.js";import"./source-record-panels-Bh0n4gGw.js";import"./event-card-DVUB8my6.js";import"./run-initiator-BvzQJYW9.js";import"./use-automations-BLNjxq2K.js";import"./clients-BJRcMk1A.js";import"./renderer-DXfJaCCa.js";import"./table-BUqshjxa.js";import"./card-Bdi7VEwo.js";import"./change-summary-PBoM6Asb.js";import"./json-diff-BaLL4Fsu.js";import"./index-Vcq4gwWv.js";import"./copy-button-DjMWgrBf.js";import"./agent-list-row-rF5LH-3k.js";import"./client-rows-36VnmgMK.js";import"./automation-row-DCHM--aD.js";import"./model-jL871x2J.js";import"./events-feed-B9CZHI_P.js";import"./client-activity-scopes-CXOWB5co.js";import"./use-scroll-sentinel-DRyBMueA.js";import"./agent-loading-shells-ClY_O6lb.js";import"./member-scope-gate-4FQ0aanZ.js";import"./runs-panel-DEnZHTa5.js";import"./runs-table-XGnxJl7S.js";import"./nav-pill-DrFkuyUQ.js";import"./public-shell-ready-BIVCHQHe.js";function I(){const{owner:o}=t.useParams(),r=t.useSearch();return i.jsx(m,{owner:o,search:r,home:!0})}export{I as component};
2
- //# sourceMappingURL=index-JYEIN8nM.js.map