@lobu/runtime-server 24.8.0 → 24.9.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 (218) hide show
  1. package/dist/catalogs/connectors.json +83 -6
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +6 -2
  5. package/dist/connectors/github.ts +16 -3
  6. package/dist/connectors/market_quotes.ts +388 -91
  7. package/dist/connectors/postgres.ts +21 -14
  8. package/dist/connectors/x-dm-adapter.js +55 -21
  9. package/dist/connectors/x.ts +1 -1
  10. package/dist/db/migrations/20261109010000_workspace_navigation.sql +14 -0
  11. package/dist/db/migrations/20261110010000_view_resources.sql +11 -0
  12. package/dist/dependencies.bun.lock +61 -61
  13. package/dist/owletto/dist/assets/_-B2C9B2RM.js +2 -0
  14. package/dist/owletto/dist/assets/_-CjyiGzwB.js +3 -0
  15. package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +2 -0
  16. package/dist/owletto/dist/assets/_agentId-bna2tPsW.js +2 -0
  17. package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +2 -0
  18. package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +2 -0
  19. package/dist/owletto/dist/assets/{_connectorKey.index-DM5MTO8c.js → _connectorKey.index-DqwSv8Zs.js} +2 -2
  20. package/dist/owletto/dist/assets/{_conversationId-OJrZjd0o.js → _conversationId-zcs-S3dY.js} +2 -2
  21. package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +2 -0
  22. package/dist/owletto/dist/assets/_owner-DsvIC94q.js +3 -0
  23. package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +2 -0
  24. package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +2 -0
  26. package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +2 -0
  27. package/dist/owletto/dist/assets/{accept-invitation-BC-ZIsrf.js → accept-invitation-k1u3zBcn.js} +2 -2
  28. package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +2 -0
  29. package/dist/owletto/dist/assets/{agent-connect-pages-CdDjrHjn.js → agent-connect-pages-D3mVM_q4.js} +4 -4
  30. package/dist/owletto/dist/assets/{agent-editor-form-CDAHRNWl.js → agent-editor-form-Bnc_q5WD.js} +2 -2
  31. package/dist/owletto/dist/assets/{agent-loading-shells-BupiSjR-.js → agent-loading-shells-xteN-pyK.js} +2 -2
  32. package/dist/owletto/dist/assets/{agent-permissions-matrix-ju7L2M0l.js → agent-permissions-matrix-C_ayr0pd.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-skill-context-B0ZYVE3n.js → agent-skill-context-r0O0BVOu.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-subpage-shell-ByU0xhXn.js → agent-subpage-shell-C2KpYdu3.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-thread-DiVKn1WX.js → agent-thread-Bv_chdPy.js} +3 -3
  36. package/dist/owletto/dist/assets/{app._appId-BQWElSoP.js → app._appId-BUcNaSMS.js} +2 -2
  37. package/dist/owletto/dist/assets/{assist-composer-igTXq3DL.js → assist-composer-B1LykXpD.js} +2 -2
  38. package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +2 -0
  39. package/dist/owletto/dist/assets/{callback-Dmaio9CX.js → callback-kSLa4n5s.js} +2 -2
  40. package/dist/owletto/dist/assets/{card-rE4Ctuy6.js → card-C01y1O-W.js} +2 -2
  41. package/dist/owletto/dist/assets/{claim-BN17CPYh.js → claim-Dnux9Lqf.js} +2 -2
  42. package/dist/owletto/dist/assets/{client-activity-scopes-B7xVaUA-.js → client-activity-scopes-BBIq16tG.js} +2 -2
  43. package/dist/owletto/dist/assets/{client-rows-B3LULJxW.js → client-rows-DGh1O-Fu.js} +2 -2
  44. package/dist/owletto/dist/assets/{clients-CydgUHrc.js → clients-BCvjAJDT.js} +2 -2
  45. package/dist/owletto/dist/assets/{code-editor-UppEMWpt.js → code-editor-BdRMYojw.js} +2 -2
  46. package/dist/owletto/dist/assets/connect-DZeFSGIH.js +2 -0
  47. package/dist/owletto/dist/assets/connect-menu-D4w-JhJW.js +2 -0
  48. package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +2 -0
  49. package/dist/owletto/dist/assets/{connected._clientId-CaF-ZWlZ.js → connected._clientId-BsDzltNz.js} +2 -2
  50. package/dist/owletto/dist/assets/{connection-D8ZAMHBT.js → connection-C7glVpPE.js} +2 -2
  51. package/dist/owletto/dist/assets/{connection-feed-detail-CJYqryAV.js → connection-feed-detail-CJju0qiw.js} +2 -2
  52. package/dist/owletto/dist/assets/{connector-page-shell-C23dWdKz.js → connector-page-shell-BeuyjiB2.js} +2 -2
  53. package/dist/owletto/dist/assets/{connector-provenance-CW4CXtCz.js → connector-provenance-B2C2cjBg.js} +2 -2
  54. package/dist/owletto/dist/assets/{connectors-Bp08_KPq.js → connectors-DSQ5AWPf.js} +2 -2
  55. package/dist/owletto/dist/assets/{consent-_PpYI1cT.js → consent-B6Aw_89N.js} +2 -2
  56. package/dist/owletto/dist/assets/{copy-button-1ALlvZU1.js → copy-button-BhXeXLIm.js} +2 -2
  57. package/dist/owletto/dist/assets/{core.esm-6koO33th.js → core.esm-CJUp2aNZ.js} +3 -3
  58. package/dist/owletto/dist/assets/create-CWcza8NT.js +2 -0
  59. package/dist/owletto/dist/assets/{create-kUevP9Xx.js → create-DUlRsFNn.js} +2 -2
  60. package/dist/owletto/dist/assets/{create-automation-form-BhujNbRr.js → create-automation-form-D141prEG.js} +3 -3
  61. package/dist/owletto/dist/assets/{create-Drx9tcnG.js → create-bGOYifof.js} +2 -2
  62. package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +2 -0
  63. package/dist/owletto/dist/assets/{custom-guardrail-edits-B_aCgvoZ.js → custom-guardrail-edits-DuQ28xv3.js} +2 -2
  64. package/dist/owletto/dist/assets/{definition-comparison-3zKUSTt8.js → definition-comparison-BUDNuAN_.js} +2 -2
  65. package/dist/owletto/dist/assets/{detail-page-skeleton-BmxqqIsH.js → detail-page-skeleton-BRHaq5Sj.js} +2 -2
  66. package/dist/owletto/dist/assets/{device-D2eUt_nr.js → device-D3fzoIrM.js} +2 -2
  67. package/dist/owletto/dist/assets/{device-pin-tombstone-BFPbTM_o.js → device-pin-tombstone-BIM-ziCH.js} +2 -2
  68. package/dist/owletto/dist/assets/{device._deviceId-Dqtmb1Xp.js → device._deviceId-BnPqTgK1.js} +2 -2
  69. package/dist/owletto/dist/assets/{dynamic-schema-form-D3KnzCsW.js → dynamic-schema-form-OkIZImgp.js} +2 -2
  70. package/dist/owletto/dist/assets/entity-options-CpeX7iiX.js +2 -0
  71. package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +2 -0
  72. package/dist/owletto/dist/assets/{entity-pages-DJNSQrfB.js → entity-pages-18xSANrS.js} +2 -2
  73. package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +2 -0
  74. package/dist/owletto/dist/assets/{entity-type-page-CouHZbc9.js → entity-type-page-MgZ7_0oh.js} +2 -2
  75. package/dist/owletto/dist/assets/event-detail-D6AH6a2C.js +2 -0
  76. package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +2 -0
  77. package/dist/owletto/dist/assets/filter-editors-DDTwyYt0.js +3 -0
  78. package/dist/owletto/dist/assets/{full-page-spinner-B7A6Ycyi.js → full-page-spinner-DWo519BU.js} +2 -2
  79. package/dist/owletto/dist/assets/index-9tTjJo_J.css +1 -0
  80. package/dist/owletto/dist/assets/{index-B-dZruj6.js → index-BW7IFKXC.js} +2 -2
  81. package/dist/owletto/dist/assets/{index-C7QM3aqU.js → index-BYcFrinP.js} +2 -2
  82. package/dist/owletto/dist/assets/index-BhJsTy-C.js +2 -0
  83. package/dist/owletto/dist/assets/index-CEcsgXDj.js +2 -0
  84. package/dist/owletto/dist/assets/index-CPscKk2u.js +2 -0
  85. package/dist/owletto/dist/assets/{index-DXfYVs5m.js → index-Cd8jMsz8.js} +2 -2
  86. package/dist/owletto/dist/assets/index-CdDNNAx2.js +7906 -0
  87. package/dist/owletto/dist/assets/index-CfJ2-EpK.js +2 -0
  88. package/dist/owletto/dist/assets/{index-BztXeLBN.js → index-D1UCJQl1.js} +2 -2
  89. package/dist/owletto/dist/assets/index-D5DM4g2w.js +2 -0
  90. package/dist/owletto/dist/assets/index-DmqnKGqW.js +2 -0
  91. package/dist/owletto/dist/assets/index-DznAbTOF.js +2 -0
  92. package/dist/owletto/dist/assets/{json-diff-CJK-gzCt.js → json-diff-C-WQqyIf.js} +2 -2
  93. package/dist/owletto/dist/assets/{list-skeleton-bQAZ0hQp.js → list-skeleton-0B1bTrAK.js} +2 -2
  94. package/dist/owletto/dist/assets/{login-DLqL54Rk.js → login-CH7P2AyR.js} +2 -2
  95. package/dist/owletto/dist/assets/{logout-H0F3IfiO.js → logout-D474YsYQ.js} +2 -2
  96. package/dist/owletto/dist/assets/{member-scope-gate-Doic_6qX.js → member-scope-gate-CH_0jHiM.js} +2 -2
  97. package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +74 -0
  98. package/dist/owletto/dist/assets/{model-selector-BrfaDwIg.js → model-selector-XYmk7Iru.js} +2 -2
  99. package/dist/owletto/dist/assets/needs-you-list-Bd4iiiqm.js +2 -0
  100. package/dist/owletto/dist/assets/new-BOsrRqp8.js +2 -0
  101. package/dist/owletto/dist/assets/{new-5GkxlOuQ.js → new-CJ6TF3Vc.js} +2 -2
  102. package/dist/owletto/dist/assets/{new-BiA4DGoN.js → new-DGPOjak2.js} +2 -2
  103. package/dist/owletto/dist/assets/new-Q0XqiZq2.js +2 -0
  104. package/dist/owletto/dist/assets/{organization-CLrcmgNK.js → organization-hD_Z6TSd.js} +2 -2
  105. package/dist/owletto/dist/assets/peek-pane-content-Cc8YX1oy.js +2 -0
  106. package/dist/owletto/dist/assets/{pending-seed-DYYOoCvj.js → pending-seed-D7-ld7as.js} +2 -2
  107. package/dist/owletto/dist/assets/{proposal-review-shell-BVwOMoq9.js → proposal-review-shell-BWRJidwb.js} +2 -2
  108. package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +2 -0
  109. package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +2 -0
  110. package/dist/owletto/dist/assets/{record-session-KuEDuF3S.js → record-session-ClKBr1_C.js} +2 -2
  111. package/dist/owletto/dist/assets/{renderer-ucwCQmBk.js → renderer-DZ0w2k2r.js} +2 -2
  112. package/dist/owletto/dist/assets/{reset-password-BkiAmXZW.js → reset-password-D2RfrEVZ.js} +2 -2
  113. package/dist/owletto/dist/assets/{run-initiator-8vdkq-3o.js → run-initiator-B8IRlRd-.js} +2 -2
  114. package/dist/owletto/dist/assets/runs-CuC7WMtd.js +2 -0
  115. package/dist/owletto/dist/assets/runs-list-8gUPWjP4.js +2 -0
  116. package/dist/owletto/dist/assets/{schema-value-CefbtPIY.js → schema-value-k19Ata7u.js} +3 -3
  117. package/dist/owletto/dist/assets/scoped-feed-bar-L7h-Ca4u.js +2 -0
  118. package/dist/owletto/dist/assets/{settings-DvzkRYQy.js → settings-BZqntV3E.js} +2 -2
  119. package/dist/owletto/dist/assets/{source-record-panels-LJIWGtHb.js → source-record-panels-C4UItfdk.js} +2 -2
  120. package/dist/owletto/dist/assets/{status-variants-BxHtpMOj.js → status-variants-BR_iGWN5.js} +2 -2
  121. package/dist/owletto/dist/assets/subDays-hOwerOLo.js +2 -0
  122. package/dist/owletto/dist/assets/{table-1O-ik4_O.js → table-C3DMoL4K.js} +2 -2
  123. package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +2 -0
  124. package/dist/owletto/dist/assets/{use-login-redirect-CfCbEeJR.js → use-login-redirect-CYlVkAhE.js} +2 -2
  125. package/dist/owletto/dist/assets/{use-mention-search-CA-evCDf.js → use-mention-search-CtbixPEE.js} +2 -2
  126. package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +2 -0
  127. package/dist/owletto/dist/assets/{views-access-required-BerT4Z1d.js → views-access-required-CvIIxdS_.js} +2 -2
  128. package/dist/owletto/dist/index.html +19 -12
  129. package/dist/server-main.bundle.mjs +4245 -2432
  130. package/npm-shrinkwrap.json +328 -328
  131. package/package.json +1 -1
  132. package/vendor/connector-sdk/dist/connector-types.d.ts +23 -2
  133. package/vendor/connector-sdk/package.json +1 -1
  134. package/vendor/core/dist/classify-error.d.ts +3 -4
  135. package/vendor/core/dist/classify-error.js +8 -8
  136. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +17 -1
  137. package/vendor/core/dist/contracts/tools/collection-presentation.js +27 -3
  138. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +39 -0
  139. package/vendor/core/dist/contracts/tools/manage-automations.js +11 -1
  140. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
  141. package/vendor/core/dist/contracts/tools/manage-views.d.ts +249 -7
  142. package/vendor/core/dist/contracts/tools/manage-views.js +83 -21
  143. package/vendor/core/dist/contracts/tools/navigation.d.ts +248 -0
  144. package/vendor/core/dist/contracts/tools/navigation.js +284 -0
  145. package/vendor/core/dist/contracts/tools/view-attach.d.ts +7 -0
  146. package/vendor/core/dist/contracts/tools/view-attach.js +15 -0
  147. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +4 -1
  148. package/vendor/core/dist/contracts/tools/view-content-hash.js +4 -2
  149. package/vendor/core/dist/contracts/tools/view-definition.d.ts +2 -0
  150. package/vendor/core/dist/contracts/tools/view-definition.js +52 -0
  151. package/vendor/core/dist/contracts/tools/view-host.d.ts +68 -0
  152. package/vendor/core/dist/contracts/tools/view-host.js +28 -1
  153. package/vendor/core/dist/contracts/tools/view-scope.d.ts +31 -0
  154. package/vendor/core/dist/contracts/tools/view-scope.js +45 -0
  155. package/vendor/core/dist/errors.d.ts +17 -24
  156. package/vendor/core/dist/errors.js +17 -24
  157. package/vendor/core/dist/types.d.ts +0 -6
  158. package/vendor/core/package.json +11 -1
  159. package/vendor/views/dist/api.d.ts +30 -5
  160. package/vendor/views/dist/api.js +22 -8
  161. package/vendor/views/dist/bridge.d.ts +17 -0
  162. package/vendor/views/dist/bridge.js +49 -1
  163. package/vendor/views/dist/components.d.ts +27 -5
  164. package/vendor/views/dist/components.js +57 -7
  165. package/vendor/views/dist/embed.d.ts +98 -0
  166. package/vendor/views/dist/embed.js +418 -0
  167. package/vendor/views/dist/index.d.ts +3 -1
  168. package/vendor/views/dist/index.js +1 -0
  169. package/vendor/views/package.json +1 -1
  170. package/dist/owletto/dist/assets/_-B0tmXZ86.js +0 -2
  171. package/dist/owletto/dist/assets/_-DwXULq4r.js +0 -3
  172. package/dist/owletto/dist/assets/_agentId-B1dNkhnr.js +0 -2
  173. package/dist/owletto/dist/assets/_agentId-sYjvnBaB.js +0 -2
  174. package/dist/owletto/dist/assets/_automationId-Bnw_CnT_.js +0 -2
  175. package/dist/owletto/dist/assets/_connectorKey._connectionId-D7Z8DQ-B.js +0 -2
  176. package/dist/owletto/dist/assets/_eventId-CfB0_2zK.js +0 -2
  177. package/dist/owletto/dist/assets/_owner-BDvTUY0a.js +0 -3
  178. package/dist/owletto/dist/assets/_shape-BZidoJMB.js +0 -2
  179. package/dist/owletto/dist/assets/_slug-R989vOiM.js +0 -2
  180. package/dist/owletto/dist/assets/_viewKey-BDUSrpe5.js +0 -2
  181. package/dist/owletto/dist/assets/_viewKey-BnFqh5-t.js +0 -2
  182. package/dist/owletto/dist/assets/activity-route-view-CN2dOiCD.js +0 -2
  183. package/dist/owletto/dist/assets/automation-detail-content-BJwRU6qT.js +0 -2
  184. package/dist/owletto/dist/assets/connect-OdHpIVV9.js +0 -2
  185. package/dist/owletto/dist/assets/connect-menu-B9u86bb2.js +0 -2
  186. package/dist/owletto/dist/assets/connect._clientId-EI1tcdSE.js +0 -2
  187. package/dist/owletto/dist/assets/connector-boxes-BWPXijAk.js +0 -2
  188. package/dist/owletto/dist/assets/create-DULVO0HS.js +0 -2
  189. package/dist/owletto/dist/assets/create._connectorKey-N6fhcIPy.js +0 -2
  190. package/dist/owletto/dist/assets/entity-options-IUdQ-64R.js +0 -2
  191. package/dist/owletto/dist/assets/entity-page-B3Im65EI.js +0 -2
  192. package/dist/owletto/dist/assets/event-detail-CvaRN1qB.js +0 -2
  193. package/dist/owletto/dist/assets/events-feed-DwOkLk6A.js +0 -2
  194. package/dist/owletto/dist/assets/filter-editors-DQ5V4Cvh.js +0 -2
  195. package/dist/owletto/dist/assets/home-stream-Bg97PUBJ.js +0 -2
  196. package/dist/owletto/dist/assets/home-toolbar-CpCcHA6z.js +0 -2
  197. package/dist/owletto/dist/assets/index-9PGnv4-5.js +0 -2
  198. package/dist/owletto/dist/assets/index-C2TCKJDP.js +0 -7901
  199. package/dist/owletto/dist/assets/index-CWn46a4y.js +0 -2
  200. package/dist/owletto/dist/assets/index-CxJONizf.js +0 -2
  201. package/dist/owletto/dist/assets/index-DJhb3li3.js +0 -2
  202. package/dist/owletto/dist/assets/index-DY-YGnCe.js +0 -2
  203. package/dist/owletto/dist/assets/index-j3v7ITPb.js +0 -2
  204. package/dist/owletto/dist/assets/index-oiy6ygaI.js +0 -2
  205. package/dist/owletto/dist/assets/index-pEgtAY1t.js +0 -2
  206. package/dist/owletto/dist/assets/index-xAvK3IyQ.css +0 -1
  207. package/dist/owletto/dist/assets/memory-browse-page-CUea2Llz.js +0 -74
  208. package/dist/owletto/dist/assets/new-M-MX_T5C.js +0 -2
  209. package/dist/owletto/dist/assets/peek-pane-content-B29OcHwm.js +0 -2
  210. package/dist/owletto/dist/assets/public-shell-ready-BbjPgh3k.js +0 -2
  211. package/dist/owletto/dist/assets/record-activity-BCpNKaUo.js +0 -2
  212. package/dist/owletto/dist/assets/runs-B_iywKWb.js +0 -2
  213. package/dist/owletto/dist/assets/runs-list-CJJFRhTl.js +0 -2
  214. package/dist/owletto/dist/assets/schema-type-editor-panel-C4e8pq1A.js +0 -2
  215. package/dist/owletto/dist/assets/scoped-feed-bar-CapleZvS.js +0 -2
  216. package/dist/owletto/dist/assets/subDays-DwIOMzYC.js +0 -2
  217. package/dist/owletto/dist/assets/use-automations-lV8PuE8L.js +0 -2
  218. package/dist/owletto/dist/assets/view-param-filters-Bp84PUMd.js +0 -2
@@ -0,0 +1,418 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * `<EmbeddedView>` — place another registered view inside this one.
4
+ *
5
+ * The child is never rendered by this frame. The slot reports its position
6
+ * to the host (`lobu/embeds/sync`), and the Lobu web host mounts the child as
7
+ * its own sandboxed frame over the slot: its own bundle, its own view key and
8
+ * actions, the visitor's own session. This frame cannot reach into the child,
9
+ * and the child's param changes stay with that one instance — they never
10
+ * reach this view's params, a sibling, or the address bar.
11
+ *
12
+ * Hosts that do not mount embedded views (other MCP Apps hosts) answer
13
+ * -32601, and the slot says so instead of rendering nothing.
14
+ */
15
+ import { VIEW_EMBED_MAX_PARAMS, } from "@lobu/core/contracts/tools/view-host";
16
+ import { createContext, useContext, useEffect, useId, useMemo, useRef, useSyncExternalStore, } from "react";
17
+ import { ViewBridgeError } from "./bridge.js";
18
+ const PENDING = { kind: "pending" };
19
+ /** `Node.DOCUMENT_POSITION_FOLLOWING`, without needing the `Node` global. */
20
+ const DOCUMENT_POSITION_FOLLOWING = 4;
21
+ /** Layers laid over the page: while one covers a slot, its child hides so
22
+ * the parent's own dialog or menu stays on top and takes the clicks. */
23
+ const OVERLAYS = 'dialog[open],[role="dialog"],[role="alertdialog"],[role="menu"],[role="listbox"],[data-lobu-overlay]';
24
+ function intersect(a, b) {
25
+ const x = Math.max(a.x, b.x);
26
+ const y = Math.max(a.y, b.y);
27
+ const right = Math.min(a.x + a.width, b.x + b.width);
28
+ const bottom = Math.min(a.y + a.height, b.y + b.height);
29
+ return {
30
+ x,
31
+ y,
32
+ width: Math.max(0, right - x),
33
+ height: Math.max(0, bottom - y),
34
+ };
35
+ }
36
+ const EMPTY = { x: 0, y: 0, width: 0, height: 0 };
37
+ /** The part of `element` the page actually shows: inside the viewport and
38
+ * every ancestor that clips or scrolls, and none of it under an overlay. */
39
+ function shownPart(element, box) {
40
+ let shown = intersect(box, {
41
+ x: 0,
42
+ y: 0,
43
+ width: window.innerWidth,
44
+ height: window.innerHeight,
45
+ });
46
+ for (let el = element.parentElement; el && el !== document.documentElement; el = el.parentElement) {
47
+ const style = window.getComputedStyle(el);
48
+ if (style.overflowX === "visible" && style.overflowY === "visible")
49
+ continue;
50
+ const r = el.getBoundingClientRect();
51
+ // The padding box: clientWidth/Height exclude borders and scrollbars.
52
+ shown = intersect(shown, {
53
+ x: r.left + el.clientLeft,
54
+ y: r.top + el.clientTop,
55
+ width: el.clientWidth,
56
+ height: el.clientHeight,
57
+ });
58
+ }
59
+ if (shown.width === 0 || shown.height === 0)
60
+ return EMPTY;
61
+ for (const layer of document.querySelectorAll(OVERLAYS)) {
62
+ if (layer.contains(element))
63
+ continue;
64
+ const r = layer.getBoundingClientRect();
65
+ if (r.width === 0 || r.height === 0)
66
+ continue;
67
+ const over = intersect(shown, {
68
+ x: r.left,
69
+ y: r.top,
70
+ width: r.width,
71
+ height: r.height,
72
+ });
73
+ if (over.width > 0 && over.height > 0)
74
+ return EMPTY;
75
+ }
76
+ return shown;
77
+ }
78
+ /** Longest a transition or animation keeps the per-frame sync running. */
79
+ const MOTION_LIMIT_MS = 5_000;
80
+ /**
81
+ * The slots of one frame. A change that can move a slot — the page's DOM, a
82
+ * resize, any scroll, an image load, a transition or animation — schedules
83
+ * one measurement on the next animation frame; only a changed picture is
84
+ * sent, carrying all slots (the host's answer is the whole picture, never a
85
+ * diff). Nothing polls: with no change there is no work, and motion keeps
86
+ * measuring each frame only until it ends (bounded by `MOTION_LIMIT_MS`).
87
+ */
88
+ export class EmbedRegistry {
89
+ bridge;
90
+ slots = new Map();
91
+ states = new Map();
92
+ listeners = new Set();
93
+ frame = 0;
94
+ unsupported = false;
95
+ connected = false;
96
+ returning = new Set();
97
+ /** Set while focus is being placed on entry from the host, so a slot that
98
+ * is itself the first or last stop passes the same direction on. */
99
+ arrival = null;
100
+ constructor(bridge) {
101
+ this.bridge = bridge;
102
+ }
103
+ /** Wire the host's notifications; returns the teardown. */
104
+ attach(bridge) {
105
+ const offSize = bridge.onEmbedSize((id, height) => {
106
+ const state = this.states.get(id);
107
+ if (state?.kind !== "mounted" || !Number.isFinite(height))
108
+ return;
109
+ this.setState(id, { kind: "mounted", height: Math.max(0, height) });
110
+ });
111
+ const offFocus = bridge.onEmbedFocus((id, direction) => {
112
+ const slot = this.slots.get(id);
113
+ if (!slot)
114
+ return;
115
+ if (direction === "forward") {
116
+ slot.after.current?.focus();
117
+ }
118
+ else {
119
+ // Land on the slot's own entry point without re-entering the child,
120
+ // so the next Shift+Tab continues before the slot.
121
+ this.returning.add(id);
122
+ slot.enter.current?.focus();
123
+ }
124
+ });
125
+ // This view is itself a slot's child: land on its first or last control.
126
+ const offEnter = bridge.onFocusEnter((direction) => {
127
+ const stops = tabStops(document);
128
+ this.arrival = direction;
129
+ try {
130
+ (direction === "forward" ? stops[0] : stops[stops.length - 1])?.focus();
131
+ }
132
+ finally {
133
+ this.arrival = null;
134
+ }
135
+ });
136
+ const reflow = () => this.schedule();
137
+ const motionStart = () => {
138
+ this.motionUntil = window.performance.now() + MOTION_LIMIT_MS;
139
+ this.moving += 1;
140
+ this.schedule();
141
+ };
142
+ const motionEnd = () => {
143
+ this.moving = Math.max(0, this.moving - 1);
144
+ this.schedule();
145
+ };
146
+ window.addEventListener("resize", reflow);
147
+ window.addEventListener("scroll", reflow, true);
148
+ window.addEventListener("load", reflow, true);
149
+ window.addEventListener("transitionrun", motionStart, true);
150
+ window.addEventListener("animationstart", motionStart, true);
151
+ for (const end of [
152
+ "transitionend",
153
+ "transitioncancel",
154
+ "animationend",
155
+ "animationcancel",
156
+ ])
157
+ window.addEventListener(end, motionEnd, true);
158
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(reflow);
159
+ if (observer && document.body)
160
+ observer.observe(document.body);
161
+ this.observer = observer;
162
+ // A slot moves without resizing when content above it changes, it is
163
+ // reordered, or a class or style shifts it: the DOM says so.
164
+ const mutations = typeof window.MutationObserver === "undefined"
165
+ ? null
166
+ : new window.MutationObserver(reflow);
167
+ mutations?.observe(document.documentElement, {
168
+ subtree: true,
169
+ childList: true,
170
+ characterData: true,
171
+ attributes: true,
172
+ attributeFilter: ["class", "style", "hidden", "open", "role"],
173
+ });
174
+ return () => {
175
+ offSize();
176
+ offFocus();
177
+ offEnter();
178
+ window.removeEventListener("resize", reflow);
179
+ window.removeEventListener("scroll", reflow, true);
180
+ window.removeEventListener("load", reflow, true);
181
+ window.removeEventListener("transitionrun", motionStart, true);
182
+ window.removeEventListener("animationstart", motionStart, true);
183
+ for (const end of [
184
+ "transitionend",
185
+ "transitioncancel",
186
+ "animationend",
187
+ "animationcancel",
188
+ ])
189
+ window.removeEventListener(end, motionEnd, true);
190
+ observer?.disconnect();
191
+ mutations?.disconnect();
192
+ this.observer = null;
193
+ if (this.frame)
194
+ cancelAnimationFrame(this.frame);
195
+ this.frame = 0;
196
+ };
197
+ }
198
+ observer = null;
199
+ /** Transitions/animations running now, and when to stop trusting the count. */
200
+ moving = 0;
201
+ motionUntil = 0;
202
+ /** The last picture sent; an identical one is not sent again. */
203
+ sent = null;
204
+ setConnected(connected) {
205
+ this.connected = connected;
206
+ this.sent = null;
207
+ if (connected)
208
+ this.schedule();
209
+ }
210
+ register(id, entry) {
211
+ this.slots.set(id, entry);
212
+ const element = entry.element.current;
213
+ if (element)
214
+ this.observer?.observe(element);
215
+ if (!this.states.has(id))
216
+ this.setState(id, this.unsupported ? { kind: "unsupported" } : PENDING);
217
+ this.schedule();
218
+ return () => {
219
+ if (this.slots.get(id) !== entry)
220
+ return;
221
+ if (element)
222
+ this.observer?.unobserve(element);
223
+ this.slots.delete(id);
224
+ this.states.delete(id);
225
+ this.schedule();
226
+ };
227
+ }
228
+ /** Keyboard focus reached the slot: hand it to the child, unless it is
229
+ * coming back out of the child the other way. */
230
+ enter(id, direction) {
231
+ if (this.returning.delete(id))
232
+ return;
233
+ if (this.states.get(id)?.kind !== "mounted")
234
+ return;
235
+ void this.bridge()
236
+ ?.focusEmbed(id, direction)
237
+ .catch(() => {
238
+ /* host declined: focus stays on the slot */
239
+ });
240
+ }
241
+ state(id) {
242
+ return this.states.get(id) ?? PENDING;
243
+ }
244
+ subscribe = (listener) => {
245
+ this.listeners.add(listener);
246
+ return () => this.listeners.delete(listener);
247
+ };
248
+ setState(id, state) {
249
+ this.states.set(id, state);
250
+ for (const listener of [...this.listeners])
251
+ listener();
252
+ }
253
+ schedule() {
254
+ if (this.frame || this.unsupported || !this.connected)
255
+ return;
256
+ this.frame = requestAnimationFrame(() => {
257
+ this.frame = 0;
258
+ void this.sync();
259
+ // Mid-motion a slot moves every frame without any other signal.
260
+ if (this.moving > 0 && window.performance.now() < this.motionUntil)
261
+ this.schedule();
262
+ else
263
+ this.moving = 0;
264
+ });
265
+ }
266
+ async sync() {
267
+ const bridge = this.bridge();
268
+ if (!bridge?.isConnected())
269
+ return;
270
+ const embeds = [];
271
+ // Document order, so the host's limit keeps the first slots on the page.
272
+ const ordered = [...this.slots].sort(([, a], [, b]) => {
273
+ const x = a.element.current;
274
+ const y = b.element.current;
275
+ if (!x || !y)
276
+ return 0;
277
+ return x.compareDocumentPosition(y) & DOCUMENT_POSITION_FOLLOWING
278
+ ? -1
279
+ : 1;
280
+ });
281
+ for (const [id, slot] of ordered) {
282
+ const element = slot.element.current;
283
+ const r = element?.getBoundingClientRect();
284
+ const box = {
285
+ x: r?.left ?? 0,
286
+ y: r?.top ?? 0,
287
+ width: r?.width ?? 0,
288
+ height: r?.height ?? 0,
289
+ };
290
+ const shown = element ? shownPart(element, box) : EMPTY;
291
+ const whole = shown.x === box.x &&
292
+ shown.y === box.y &&
293
+ shown.width === box.width &&
294
+ shown.height === box.height;
295
+ embeds.push({
296
+ id,
297
+ view: slot.view,
298
+ scope: slot.scope,
299
+ params: slot.params,
300
+ rect: whole ? box : { ...box, clip: shown },
301
+ });
302
+ }
303
+ const picture = JSON.stringify(embeds);
304
+ if (picture === this.sent)
305
+ return;
306
+ this.sent = picture;
307
+ let answer;
308
+ try {
309
+ answer = await bridge.syncEmbeds(embeds);
310
+ }
311
+ catch (error) {
312
+ // Not delivered: the same picture must be sent again next time.
313
+ this.sent = null;
314
+ if (error instanceof ViewBridgeError && error.code === -32601) {
315
+ this.unsupported = true;
316
+ for (const id of this.slots.keys())
317
+ this.setState(id, { kind: "unsupported" });
318
+ }
319
+ return;
320
+ }
321
+ for (const status of answer.embeds ?? []) {
322
+ if (!this.slots.has(status.id))
323
+ continue;
324
+ const previous = this.states.get(status.id);
325
+ if (status.status === "mounted") {
326
+ if (previous?.kind !== "mounted")
327
+ this.setState(status.id, { kind: "mounted", height: null });
328
+ }
329
+ else if (previous?.kind !== "refused" ||
330
+ previous.reason !== status.reason) {
331
+ this.setState(status.id, { kind: "refused", reason: status.reason });
332
+ }
333
+ }
334
+ }
335
+ }
336
+ const EmbedCtx = createContext(null);
337
+ /** Installed by the view runtime's provider. */
338
+ export function EmbedProvider({ registry, children, }) {
339
+ return _jsx(EmbedCtx.Provider, { value: registry, children: children });
340
+ }
341
+ const REFUSALS = {
342
+ cycle: "This view already contains it, so it is not shown again here.",
343
+ depth: "Views nest at most two levels deep.",
344
+ limit: "This view shows too many embedded views at once.",
345
+ invalid: "This embedded view's settings are not valid.",
346
+ };
347
+ const TABBABLE = 'a[href],area[href],button,input,select,textarea,iframe,summary,[tabindex],[contenteditable="true"]';
348
+ /** The document's Tab stops in order (positive `tabIndex` is not used by
349
+ * views, so document order is Tab order). */
350
+ function tabStops(root) {
351
+ return [...root.querySelectorAll(TABBABLE)].filter((el) => el.tabIndex >= 0 &&
352
+ !el.disabled &&
353
+ !el.closest("[inert],[hidden]") &&
354
+ el.getClientRects().length > 0);
355
+ }
356
+ /** Which way the visitor was tabbing when focus reached the slot: from a
357
+ * control after it means backward. From outside this frame, forward. */
358
+ function focusDirection(event) {
359
+ const from = event.relatedTarget;
360
+ return from &&
361
+ event.currentTarget.compareDocumentPosition(from) &
362
+ window.Node.DOCUMENT_POSITION_FOLLOWING
363
+ ? "backward"
364
+ : "forward";
365
+ }
366
+ const HIDDEN = {
367
+ position: "absolute",
368
+ width: 1,
369
+ height: 1,
370
+ overflow: "hidden",
371
+ clip: "rect(0 0 0 0)",
372
+ whiteSpace: "nowrap",
373
+ };
374
+ function scalarParams(params) {
375
+ const out = {};
376
+ for (const [key, value] of Object.entries(params ?? {})) {
377
+ if (Object.keys(out).length >= VIEW_EMBED_MAX_PARAMS)
378
+ break;
379
+ if (typeof value === "string" ||
380
+ typeof value === "boolean" ||
381
+ (typeof value === "number" && Number.isFinite(value)))
382
+ out[key] = value;
383
+ }
384
+ return out;
385
+ }
386
+ export function EmbeddedView({ view, scope, params, id: explicitId, title, minHeight = 120, }) {
387
+ const registry = useContext(EmbedCtx);
388
+ if (!registry)
389
+ throw new Error("<EmbeddedView> must render inside mountView()");
390
+ const autoId = useId();
391
+ const id = explicitId ?? `embed${autoId.replace(/[^A-Za-z0-9_-]/g, "")}`;
392
+ const slotRef = useRef(null);
393
+ const enterRef = useRef(null);
394
+ const afterRef = useRef(null);
395
+ const scopeKey = JSON.stringify(scope ?? {});
396
+ const paramsKey = JSON.stringify(scalarParams(params));
397
+ const entryScope = useMemo(() => JSON.parse(scopeKey), [scopeKey]);
398
+ const entryParams = useMemo(() => JSON.parse(paramsKey), [paramsKey]);
399
+ useEffect(() => registry.register(id, {
400
+ view,
401
+ scope: entryScope,
402
+ params: entryParams,
403
+ element: slotRef,
404
+ enter: enterRef,
405
+ after: afterRef,
406
+ }), [registry, id, view, entryScope, entryParams]);
407
+ const state = useSyncExternalStore(registry.subscribe, () => registry.state(id), () => registry.state(id));
408
+ const label = title ?? view;
409
+ const height = state.kind === "mounted"
410
+ ? (state.height ?? minHeight)
411
+ : state.kind === "pending"
412
+ ? minHeight
413
+ : undefined;
414
+ return (_jsxs("div", { ref: slotRef, "data-lobu-embed": id, "data-state": state.kind, style: { position: "relative", height }, children: [state.kind === "mounted" || state.kind === "pending" ? (
415
+ // Where Tab meets the slot: focus moves on into the child's frame.
416
+ _jsx("button", { ref: enterRef, type: "button", style: HIDDEN, onFocus: (event) => registry.enter(id, registry.arrival ?? focusDirection(event)), onClick: () => registry.enter(id, "forward"), children: label })) : null, state.kind === "unsupported" ? (_jsxs("p", { role: "note", children: ["\u201C", label, "\u201D is an embedded view. Open this page in the Lobu app to see it."] })) : state.kind === "refused" ? (_jsx("p", { role: "note", children: REFUSALS[state.reason] ?? REFUSALS.invalid })) : null, _jsx("span", { ref: afterRef, tabIndex: -1, style: HIDDEN })] }));
417
+ }
418
+ //# sourceMappingURL=embed.js.map
@@ -7,7 +7,9 @@
7
7
  */
8
8
  export type { AttributeFilter, CollectionSelection, } from "@lobu/core/contracts/tools/collection-selection";
9
9
  export { ViewBridge } from "./bridge.js";
10
+ export { EmbeddedView } from "./embed.js";
11
+ export type { EmbeddedViewProps } from "./embed.js";
10
12
  export type { BridgeOptions, HostContext, ToolResult, ViewHandoff, } from "./bridge.js";
11
13
  export { coerceParams, defaultsFor, defineView, escapeLiteral, mintInteractionId, mountView, resolveViewHref, Provider, sql, tool, useAction, useHost, useParams, useQuery, useScope, } from "./api.js";
12
- export type { ActionResult, Attachment, Container, DisplayMode, MountOptions, ParamDef, Params, ParamValue, QueryOptions, QueryState, Scope, SqlQuery, ToolQuery, ViewDefinition, } from "./api.js";
14
+ export type { ActionDef, ActionOptions, ActionResult, Attachment, Container, DisplayMode, MountOptions, ParamDef, Params, ParamValue, QueryOptions, QueryState, Scope, SqlQuery, ToolQuery, ViewDefinition, } from "./api.js";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,4 @@
1
1
  export { ViewBridge } from "./bridge.js";
2
+ export { EmbeddedView } from "./embed.js";
2
3
  export { coerceParams, defaultsFor, defineView, escapeLiteral, mintInteractionId, mountView, resolveViewHref, Provider, sql, tool, useAction, useHost, useParams, useQuery, useScope, } from "./api.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/views",
3
- "version": "24.8.0",
3
+ "version": "24.9.0",
4
4
  "description": "Authoring runtime for Lobu views — React modules rendered in the sandboxed MCP Apps frame",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import{cc as t,H as p,j as a,cd as e,av as s}from"./index-C2TCKJDP.js";import{A as n}from"./activity-route-view-CN2dOiCD.js";import"./record-activity-BCpNKaUo.js";import"./home-toolbar-CpCcHA6z.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./runs-B_iywKWb.js";import"./event-kind-options-fHAIXu24.js";import"./source-record-panels-LJIWGtHb.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";import"./client-activity-scopes-B7xVaUA-.js";import"./client-rows-B3LULJxW.js";import"./agent-loading-shells-BupiSjR-.js";import"./member-scope-gate-Doic_6qX.js";import"./home-stream-Bg97PUBJ.js";import"./public-shell-ready-BbjPgh3k.js";function I(){const{owner:o}=t.useParams(),r=p({select:m=>m.pathname}),i=t.useSearch();return a.jsx(n,{owner:o,search:i,entityScope:e(s(r,1)).path})}export{I as component};
2
- //# sourceMappingURL=_-B0tmXZ86.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/entity-page-B3Im65EI.js","assets/index-C2TCKJDP.js","assets/index-xAvK3IyQ.css","assets/entity-pages-DJNSQrfB.js","assets/renderer-ucwCQmBk.js","assets/schema-value-CefbtPIY.js","assets/card-rE4Ctuy6.js","assets/table-1O-ik4_O.js","assets/record-activity-BCpNKaUo.js","assets/home-toolbar-CpCcHA6z.js","assets/filter-editors-DQ5V4Cvh.js","assets/subDays-DwIOMzYC.js","assets/runs-B_iywKWb.js","assets/event-kind-options-fHAIXu24.js","assets/source-record-panels-LJIWGtHb.js","assets/events-feed-DwOkLk6A.js","assets/definition-comparison-3zKUSTt8.js","assets/json-diff-CJK-gzCt.js","assets/code-editor-UppEMWpt.js","assets/index-Vcq4gwWv.js","assets/run-initiator-8vdkq-3o.js","assets/list-skeleton-bQAZ0hQp.js","assets/use-automations-lV8PuE8L.js","assets/clients-CydgUHrc.js","assets/copy-button-1ALlvZU1.js","assets/device-automation-Dp3faMvp.js","assets/client-activity-scopes-B7xVaUA-.js","assets/client-rows-B3LULJxW.js","assets/agent-loading-shells-BupiSjR-.js","assets/member-scope-gate-Doic_6qX.js","assets/dynamic-schema-form-D3KnzCsW.js","assets/views-access-required-BerT4Z1d.js","assets/record-session-KuEDuF3S.js","assets/view-param-filters-Bp84PUMd.js","assets/app-bridge-C4nPtae3.js"])))=>i.map(i=>d[i]);
2
- import{at as x,H as y,au as p,av as j,aw as P,ax as g,z as R,E as v,F as f,j as e,r as E,ay as w,l as S,_}from"./index-C2TCKJDP.js";import{P as r}from"./public-shell-ready-BbjPgh3k.js";const F=S(async()=>({default:(await _(async()=>{const{EntityPage:a}=await import("./entity-page-B3Im65EI.js");return{EntityPage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))).EntityPage}));function c(){return e.jsx("div",{"data-public-loading":"true",children:e.jsx(w,{})})}function L(){const{owner:a}=x.useParams(),l=y({select:m=>m.pathname}),s=p(j(l)),d=s?.viewKey,{path:u}=P(a,s?.entityPath),{data:t,isLoading:n,error:o}=g(u,{slug:a}),{session:h,isReady:i}=R();return v({active:f({settled:!n,authReady:i,session:h,resolved:!!t,error:o}),owner:a}),n||!i&&!t?e.jsx(c,{}):o||!t||!t.entity?e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not Found"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"We couldn't resolve this path."})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{}),e.jsx(E.Suspense,{fallback:e.jsx(c,{}),children:e.jsx(F,{namespace:t.workspace,path:t.path,entity:t.entity,viewKey:d})})]})}export{L as component};
3
- //# sourceMappingURL=_-DwXULq4r.js.map
@@ -1,2 +0,0 @@
1
- import{c as b,H as j,z as N,n as k,s as v,r as S,j as s,ar as L,as as $,O as w,i as C,cw as E,L as l,cx as u,hW as P}from"./index-C2TCKJDP.js";import{A as W}from"./agent-skill-context-B0ZYVE3n.js";import"./core.esm-6koO33th.js";import"./skill-editor-D_W3QlRz.js";const y={skills:{label:"Skills",create:"Add a skill"},guardrails:{label:"Guardrails",create:"New custom guardrail"}};function B({owner:e,agentId:a,agentName:o,subpath:r}){const[n]=r.split("/"),t=n==="skills"||n==="guardrails"?{key:n,...y[n]}:null;return s.jsx(E,{crumbs:[s.jsx(l,{to:"/$owner",params:{owner:e},search:{section:"agent"},className:u,children:"Agents"},"agents"),s.jsx(l,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},className:u,children:o},"agent"),...t?[s.jsx(l,{to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},hash:t.key,className:u,children:t.label},"section")]:[]],current:t?t.create:"Conversation"})}function R({owner:e,agentId:a}){const o=b(),{pathname:r}=j(),{isAuthenticated:n}=N(),{isMember:t}=k(),g=n&&t,{data:p=[],isLoading:x}=v({enabled:g}),d=p.find(f=>f.agentId===a)??null,m=!d&&!x&&g;S.useEffect(()=>{m&&o({to:"/$owner",params:{owner:e},replace:!0})},[m,o,e]);const h=`/${e}/agents/${a}`,c=r.startsWith(`${h}/`)?r.slice(h.length+1):"",i=c.endsWith("/")?c.slice(0,-1):c,A=i.startsWith("conversations/");return s.jsx(W,{agentId:a,children:s.jsxs(L,{className:"gap-3 overflow-hidden pt-2.5 pb-8",children:[i?s.jsx($,{children:s.jsx(B,{owner:e,agentId:a,agentName:d?.name??"Agent",subpath:i})}):null,s.jsx("div",{className:C("flex min-h-0 min-w-0 flex-1 flex-col",A?"overflow-hidden":"overflow-y-auto"),children:s.jsx(w,{})})]})})}function I(){const{owner:e,agentId:a}=P.useParams();return s.jsx(R,{owner:e,agentId:a})}export{I as component};
2
- //# sourceMappingURL=_agentId-B1dNkhnr.js.map
@@ -1,2 +0,0 @@
1
- import{c as L,cA as D,r as u,j as n,i as w,z as E,n as M,s as P,b0 as N,cB as R,cC as O,cD as B,cE as $,bf as z,M as Q}from"./index-C2TCKJDP.js";import{L as F,A as H}from"./agent-thread-DiVKn1WX.js";import{n as b,c as S}from"./agent-thread-storage-Bx2-WBHQ.js";import{A as U,C as W}from"./agent-loading-shells-BupiSjR-.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-DYYOoCvj.js";import"./use-mention-search-CA-evCDf.js";import"./index-Vcq4gwWv.js";import"./use-automations-lV8PuE8L.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./subDays-DwIOMzYC.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";function _({owner:e,agent:s,threadId:t,afterMessagesContent:d,className:r,initialDraft:g,newChatRequested:f=!1,preventAutoNavigate:p}){const o=L(),i=s.agentId,{data:a=[]}=D(i,{orgSlug:e}),[c,x]=u.useState(()=>b()),[h,A]=u.useState(null);u.useEffect(()=>{!f||t||(x(b()),A(null),o({to:".",search:(m=>{const{new:C,...y}=m;return y}),replace:!0}))},[f,t,o]);const v=u.useMemo(()=>!h||a.some(m=>m.id===h.id)?a:[h,...a],[a,h]),l=t??c,T=!t||!v.some(m=>m.id===t),j=u.useCallback(()=>{if(v.some(C=>C.id===l))return;A({id:l,title:`Conversation ${v.length+1}`,createdAt:Date.now(),updatedAt:Date.now()});const m=S(e,i,l);o({...m,replace:!0})},[v,l,o,e,i]),k=u.useCallback(()=>{T&&!p&&j()},[T,j,p]);return n.jsx("div",{className:w("flex min-h-0 flex-1 flex-col",r),children:n.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.jsx(F,{agentId:i,workspaceSlug:e,thread:l,loadHistory:!!t,onFirstUserMessage:k,initialDraft:g,children:n.jsx(H,{afterMessagesContent:d})},`${i}:${l}`)})})}function q({owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:g,preventAutoNavigate:f}){const{isAuthenticated:p}=E(),{isMember:o,isLoading:i}=M(),a=p&&o,{data:c=[],isLoading:x}=P({enabled:a}),h=s??null,A=c.find(l=>l.agentId===h)??null;return a&&x||i?n.jsx(U,{}):A?n.jsx(_,{owner:e,agent:A,threadId:t,initialDraft:d,newChatRequested:r,afterMessagesContent:g,preventAutoNavigate:f,className:"min-h-0 flex-1 overflow-hidden"}):n.jsx(N,{icon:R,title:"Agent not found",description:"This agent may have been removed."})}function G(e){return[...e].sort((s,t)=>t.updatedAt-s.updatedAt)[0]}function J({owner:e,agentId:s,threadId:t,initialDraft:d,forceComposer:r=!1,newChatRequested:g=!1,afterMessagesContent:f,preventAutoNavigate:p}){const o=L(),{data:i=[],isLoading:a}=O(B(e,s,{strict:!1})),c=u.useMemo(()=>G(i),[i]);return u.useEffect(()=>{if(t||r||a||!c)return;const x=S(e,s,c.id);o({...x,replace:!0})},[s,a,c,o,e,t,r]),!t&&!r&&(a||c)?n.jsx(W,{}):n.jsx(q,{owner:e,agentId:s,threadId:t,initialDraft:d,newChatRequested:g,afterMessagesContent:f,preventAutoNavigate:p})}function xt(){const{owner:e,agentId:s}=$.useParams(),{threadId:t}=z({strict:!1}),{new:d,prompt:r}=Q({strict:!1});return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-4 pt-2.5 pb-4 lg:px-6 lg:pb-6",children:n.jsx("div",{className:"mx-auto flex min-h-0 w-full max-w-3xl flex-1 flex-col",children:n.jsx(J,{owner:e,agentId:s,threadId:t,initialDraft:r,forceComposer:!t,newChatRequested:!!d})})})}export{xt as component};
2
- //# sourceMappingURL=_agentId-sYjvnBaB.js.map
@@ -1,2 +0,0 @@
1
- import{u as b,d as L,j as t,cG as P,cH as $,cI as R,B as r,L as d,cJ as z,cK as S,c as _,G as B,ax as T,z as K,n as O,r as E,ar as H,as as G,cw as W,cx as v,cB as F,m as M,c1 as U,cL as V,cM as N,aF as J}from"./index-C2TCKJDP.js";import{A as q}from"./automation-detail-content-BJwRU6qT.js";import{a as Q,b as X}from"./use-automations-lV8PuE8L.js";import"./event-detail-CvaRN1qB.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./subDays-DwIOMzYC.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./filter-editors-DQ5V4Cvh.js";import"./home-stream-Bg97PUBJ.js";import"./client-activity-scopes-B7xVaUA-.js";import"./client-rows-B3LULJxW.js";import"./home-toolbar-CpCcHA6z.js";import"./scoped-feed-bar-CapleZvS.js";import"./event-kind-options-fHAIXu24.js";import"./create-automation-form-BhujNbRr.js";import"./entity-options-IUdQ-64R.js";import"./model-selector-BrfaDwIg.js";import"./skill-editor-D_W3QlRz.js";import"./use-mention-search-CA-evCDf.js";import"./proposal-review-shell-BVwOMoq9.js";import"./runs-B_iywKWb.js";import"./runs-list-CJJFRhTl.js";function Y({owner:e,automationId:s,name:a}){const i=b(),n=`/${e}/automations/${encodeURIComponent(String(s))}?view=activity`,{pathname:u,search:p}=L(n);return t.jsx(P,{delayDuration:200,children:t.jsxs($,{children:[t.jsx(R,{asChild:!0,children:t.jsx(r,{asChild:!0,variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-foreground",children:t.jsxs(d,{to:u,search:p??{},onClick:o=>{!i||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||(o.preventDefault(),i.open({href:n,title:a,owner:e}))},children:[t.jsx(z,{className:"h-4 w-4","aria-hidden":"true"}),t.jsx("span",{className:"sr-only",children:"View activity"})]})})}),t.jsxs(S,{children:["View activity for ",a]})]})})}function Z({owner:e,automationId:s,view:a,runId:i}){const n=_(),{orgContext:u,hasOrgContext:p}=B(),{data:o,isLoading:x}=T(`/${e}`,u),{isAuthenticated:w}=K(),{isLoading:g}=O(),C=o?.workspace?.id??"",y=w?!p||x||g:x||g,c=Q(s,void 0,C).data?.automation,h=c?.automation_name??"Automation",f=()=>void n({to:"/$owner",params:{owner:e},search:{section:"automation"}}),m=X(),k=()=>void n({to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"activity",run_id:void 0}}),A=()=>void n({to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"definition",run_id:void 0},replace:!0}),l=!i&&a==="definition",[D,j]=E.useState(!1);return t.jsx(H,{className:"gap-6 pt-2.5 pb-8",children:t.jsxs(G,{className:"flex min-w-0 flex-col gap-4",children:[t.jsx(W,{crumbs:[l||i?t.jsx(d,{to:"/$owner",params:{owner:e},search:{section:"automation"},className:v,children:"Automations"},"automations"):t.jsx(d,{to:"/$owner",params:{owner:e},className:v,children:"Home"},"home")],current:i?"Review change":h}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"flex min-w-0 items-center gap-2",children:t.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[t.jsx(F,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),y&&!c?t.jsx(M,{className:"h-5 w-40"}):i?"Review change":h]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[l?t.jsx(Y,{owner:e,automationId:s,name:h}):null,l&&c?D?t.jsxs(t.Fragment,{children:[t.jsx(r,{type:"button",variant:"destructive",size:"sm",className:"h-8",disabled:m.isPending,onClick:()=>m.mutate(s,{onSuccess:f}),children:m.isPending?"Deleting...":"Delete"}),t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"h-8",disabled:m.isPending,onClick:()=>j(!1),children:"Cancel"})]}):t.jsxs(r,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:()=>j(!0),children:[t.jsx(U,{className:"h-3.5 w-3.5"}),"Delete"]}):null,i?null:l?t.jsx(r,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground hover:text-foreground",onClick:k,children:"Done"}):t.jsx(r,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:t.jsxs(d,{to:"/$owner/automations/$automationId",params:{owner:e,automationId:s},search:{view:"definition",run_id:void 0},children:[t.jsx(V,{className:"h-3.5 w-3.5"}),"Edit"]})})]})]}),t.jsx(q,{owner:e,agentId:c?.managed_agent_id??null,automationId:s,view:a,runId:i,onDone:i?f:A})]})})}function Tt(){const{owner:e,automationId:s}=N.useParams(),a=N.useSearch();return t.jsx(J,{owner:e,children:()=>t.jsx(Z,{owner:e,automationId:s,view:a.view,runId:a.run_id})})}export{Tt as component};
2
- //# sourceMappingURL=_automationId-Bnw_CnT_.js.map
@@ -1,2 +0,0 @@
1
- import{jh as P,j as e,aF as Q,c as Y,aM as Z,ct as K,d5 as ee,dA as ne,B as M,L as c,dC as te,aN as se,j0 as oe,j1 as ae,a_ as ie,cx as u,iX as re,b9 as ce,it as de,cu as R,cw as y,aU as me,P as pe,S as le}from"./index-C2TCKJDP.js";import{f as ue,C as he,a as xe,F as je,b as fe,c as ve,A as Ce,d as De}from"./connection-feed-detail-CJYqryAV.js";import{c as Ne,C as $e}from"./device-pin-tombstone-BFPbTM_o.js";import{C as b}from"./connector-page-shell-C23dWdKz.js";import{a as ge}from"./connector-provenance-CW4CXtCz.js";import{D as be}from"./detail-page-skeleton-BmxqqIsH.js";import{S as T,g as W}from"./status-variants-BxHtpMOj.js";import"./scoped-feed-bar-CapleZvS.js";import"./event-kind-options-fHAIXu24.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./home-toolbar-CpCcHA6z.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";import"./entity-options-IUdQ-64R.js";import"./runs-list-CJJFRhTl.js";import"./feed-event-kinds-BYuZCoU4.js";import"./runs-B_iywKWb.js";function sn(){const{owner:l,connectorKey:n,connectionId:f}=P.useParams(),{addFeed:o,feedId:i,settings:x,auth_result:a}=P.useSearch();return e.jsx(Q,{owner:l,children:d=>e.jsx(we,{organizationId:d.organizationId,ownerSlug:d.ownerSlug,isWorkspaceLoading:d.isWorkspaceLoading,connectorKey:n,connectionId:Number(f),showAddFeed:o===!0,feedId:i,settingsView:x===!0,authResult:a})})}function we({organizationId:l,ownerSlug:n,isWorkspaceLoading:f,connectorKey:o,connectionId:i,showAddFeed:x,feedId:a,settingsView:d,authResult:w}){const H=Y(),{data:O=[]}=Z(),{data:S=[],isLoading:U,isError:v,refetch:V}=K(l??"",{connectorKey:o,connectionIds:[i]}),{data:F=[]}=ee(l??""),{data:z=[],isLoading:G,isError:X,refetch:q}=ne(a?i:null,{eventCounts:!0}),t=S.find(r=>r.id===i),s=F.find(r=>r.key===o),m=a?z.find(r=>r.id===a):null;if(f||U||a&&G||!l)return e.jsx(be,{label:a?"Loading feed":"Loading connection"});if(v||a&&X)return e.jsxs("div",{role:"alert",className:"space-y-2",children:[e.jsxs("p",{children:["Could not load this ",v?"connection":"feed","."]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>void(v?V():q()),children:"Retry"})]});if(!t)return e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found."}),e.jsxs(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},className:"mt-2 inline-block text-sm text-primary hover:underline",children:["Back to ",s?.name??o]})]});const C=te({...t,connector_name:t.connector_name??s?.name??null}),D=!a&&!x,J=()=>void H({to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},replace:!0});let h,j=C,_,k,N;a?m?(j=ue(m,s),m.store==="channel_messages"?(h=e.jsx(xe,{feed:m,hideHeader:!0}),N="chat channel"):(_=e.jsx(je,{feed:m,ownerSlug:n}),k=e.jsx(fe,{feed:m}),h=e.jsx(ve,{feed:m,connectorDef:s,ownerSlug:n}))):(h=e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed not found."}),j="Feed"):x&&(h=e.jsx(Ce,{onClose:J,organizationId:l,connections:[t],connectorDefinitions:F}),j="Add feed",N=De);const p=O.find(r=>r.id===t.device_worker_id&&se(r,n)),L=p?oe(p):void 0,$=L?ae(n,L,ie()):void 0,I=[e.jsx(c,{to:"/$owner/connectors",params:{owner:n},className:u,children:"Connectors"},"connectors"),...p&&$?[e.jsx(c,{to:"/$owner/connectors/app/$appId",params:{owner:n,appId:$.id},className:u,children:$.name},"app"),e.jsx(c,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:p.id},className:u,children:re(p)},"device")]:[e.jsx(c,{to:"/$owner/connectors/$connectorKey",params:{owner:n,connectorKey:o},search:{},className:u,children:s?.name??o},"connector")]];D||I.push(e.jsx(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{},className:u,children:C},"connection"));const g=D?Ne(t):null,A=N??g??void 0,E=s?e.jsx(ce,{icon:s.icon,name:s.name,faviconDomain:s.favicon_domain??de(s.auth_schema)}):null,B=e.jsx(R,{breadcrumb:e.jsx(y,{crumbs:I}),icon:E,title:j,status:_??e.jsx(T,{status:W(t.status),showDot:!0,children:t.status}),meta:k,caption:A,captionTone:g?"error":"muted"});return D?p&&s&&me(s)?e.jsx(pe,{to:"/$owner/connectors/device/$deviceId",params:{owner:n,deviceId:p.id},search:{connection:t.id,settings:d||void 0},hash:`connection-${t.id}`,replace:!0}):!d&&!w?e.jsx(b,{header:e.jsx(R,{breadcrumb:e.jsx(y,{crumbs:[e.jsx(c,{to:"/$owner",params:{owner:n},className:u,children:"Home"},"home")]}),icon:E,title:C,status:e.jsx(T,{status:W(t.status),showDot:!0,children:t.status}),meta:e.jsx(M,{asChild:!0,variant:"ghost",size:"sm",className:"h-8 gap-1.5",children:e.jsxs(c,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:n,connectorKey:o,connectionId:String(i)},search:{settings:!0},children:[e.jsx(le,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"Settings"]})}),caption:A,captionTone:g?"error":"muted"}),children:e.jsx(he,{connection:t,ownerSlug:n})}):e.jsxs(b,{header:B,children:[e.jsx(ge,{connectorDef:s,connectorKey:o,ownerSlug:n,deviceWorkerId:t.device_worker_id,deviceLabel:t.device_label}),e.jsx($e,{embedded:!0,connection:t,connectorDef:s,ownerSlug:n,openSettings:d,authResult:w},t.id)]}):e.jsx(b,{header:B,children:e.jsx("div",{className:"mt-0",children:h})})}export{sn as component};
2
- //# sourceMappingURL=_connectorKey._connectionId-D7Z8DQ-B.js.map
@@ -1,2 +0,0 @@
1
- import{M as u,c as v,j as r,ar as d,aF as f,c8 as x,c9 as h,ca as w,bf as P,cb as j}from"./index-C2TCKJDP.js";import{E as g}from"./event-detail-CvaRN1qB.js";import"./events-feed-DwOkLk6A.js";import"./definition-comparison-3zKUSTt8.js";import"./json-diff-CJK-gzCt.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./schema-value-CefbtPIY.js";import"./run-initiator-8vdkq-3o.js";import"./list-skeleton-bQAZ0hQp.js";import"./subDays-DwIOMzYC.js";import"./use-automations-lV8PuE8L.js";import"./clients-CydgUHrc.js";import"./renderer-ucwCQmBk.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./copy-button-1ALlvZU1.js";import"./device-automation-Dp3faMvp.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./filter-editors-DQ5V4Cvh.js";function E({owner:e,eventId:t,viewKey:s}){const o=u({strict:!1}),p=v(),m=(i,a)=>r.jsx(g,{owner:a,organizationId:i,eventId:t,viewKey:s,params:s?h(o):{},onParamsChange:(n,c,l)=>void p({to:x(a,t,n),search:c,replace:l?.replace??!0}),fullBleed:!0},`${a}/${t}`);return r.jsx(d,{className:"gap-6 pt-2.5 pb-8",children:e==="me"?m(null,e):r.jsx(f,{owner:e,children:({organizationId:i,ownerSlug:a})=>i?m(i,a):r.jsx("div",{className:"mx-auto h-40 w-full max-w-3xl animate-pulse rounded-md bg-muted/40"})})})}function J(){const{owner:e,eventId:t}=w.useParams(),s=P({from:"/$owner/events/$eventId/-/views/$viewKey",shouldThrow:!1}),o=j(t);return o===null?null:r.jsx(E,{owner:e,eventId:o,viewKey:s?.viewKey})}export{J as component};
2
- //# sourceMappingURL=_eventId-CfB0_2zK.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peek-pane-content-B29OcHwm.js","assets/index-C2TCKJDP.js","assets/index-xAvK3IyQ.css","assets/automation-detail-content-BJwRU6qT.js","assets/event-detail-CvaRN1qB.js","assets/events-feed-DwOkLk6A.js","assets/definition-comparison-3zKUSTt8.js","assets/json-diff-CJK-gzCt.js","assets/code-editor-UppEMWpt.js","assets/index-Vcq4gwWv.js","assets/schema-value-CefbtPIY.js","assets/run-initiator-8vdkq-3o.js","assets/list-skeleton-bQAZ0hQp.js","assets/subDays-DwIOMzYC.js","assets/use-automations-lV8PuE8L.js","assets/clients-CydgUHrc.js","assets/renderer-ucwCQmBk.js","assets/card-rE4Ctuy6.js","assets/table-1O-ik4_O.js","assets/copy-button-1ALlvZU1.js","assets/device-automation-Dp3faMvp.js","assets/view-param-filters-Bp84PUMd.js","assets/app-bridge-C4nPtae3.js","assets/filter-editors-DQ5V4Cvh.js","assets/home-stream-Bg97PUBJ.js","assets/client-activity-scopes-B7xVaUA-.js","assets/client-rows-B3LULJxW.js","assets/home-toolbar-CpCcHA6z.js","assets/scoped-feed-bar-CapleZvS.js","assets/event-kind-options-fHAIXu24.js","assets/create-automation-form-BhujNbRr.js","assets/entity-options-IUdQ-64R.js","assets/model-selector-BrfaDwIg.js","assets/skill-editor-D_W3QlRz.js","assets/use-mention-search-CA-evCDf.js","assets/proposal-review-shell-BVwOMoq9.js","assets/runs-B_iywKWb.js","assets/runs-list-CJJFRhTl.js","assets/agent-loading-shells-BupiSjR-.js","assets/agent-thread-DiVKn1WX.js","assets/pending-seed-DYYOoCvj.js","assets/connection-feed-detail-CJYqryAV.js","assets/status-variants-BxHtpMOj.js","assets/feed-event-kinds-BYuZCoU4.js","assets/connect-menu-B9u86bb2.js","assets/source-record-panels-LJIWGtHb.js","assets/schema-type-editor-panel-C4e8pq1A.js","assets/entity-type-page-CouHZbc9.js","assets/views-access-required-BerT4Z1d.js","assets/dynamic-schema-form-D3KnzCsW.js","assets/record-session-KuEDuF3S.js"])))=>i.map(i=>d[i]);
2
- import{p as h,j as t,r as p,C as P,L as k,u as v,a as I,b as R,c as S,d as C,D as A,e as _,f as D,g as E,h as $,i as y,B as x,k as L,S as K,A as z,X as T,l as O,_ as B,m as g,n as N,o as W,q as U,s as H,t as F,v as V,w as q,x as G,R as M,y as Q,z as X,E as J,F as Y,N as Z,O as ee}from"./index-C2TCKJDP.js";import{R as ne}from"./record-session-KuEDuF3S.js";import{u as te}from"./use-automations-lV8PuE8L.js";import{u as ae}from"./clients-CydgUHrc.js";function j({item:e}){const n=e.href?h(e.href):null;if(!n||n.kind==="event"||n.kind==="automation"&&!("runId"in n&&n.runId!=null))return null;const a=n.owner,o=n.kind==="automation"?n.automationId:e.sourceAttribution?.automation_id??null,i=e.sourceAttribution,s=[{label:a,to:"/$owner",params:{owner:a}}];return i?.agent_id&&i.agent_name&&s.push({label:i.agent_name,to:"/$owner/agents/$agentId",params:{owner:a,agentId:i.agent_id}}),o!=null&&s.push({label:i?.automation_name??"Automation",to:"/$owner/automations/$automationId",params:{owner:a,automationId:String(o)}}),(n.kind==="memory"||n.kind==="automation")&&"runId"in n&&n.runId!=null?s.push({label:"Run details"}):n.kind==="memory"&&"contentIds"in n&&s.push({label:"Details"}),s.length<2?null:t.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 shrink-0 items-center gap-1 overflow-x-auto border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:s.map((r,u)=>{const c=u===s.length-1,f=t.jsx("span",{className:c?"truncate font-medium text-foreground":"whitespace-nowrap",children:r.label});return t.jsxs(p.Fragment,{children:[u>0?t.jsx(P,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}):null,r.to&&!c?t.jsx(k,{to:r.to,params:r.params,className:"whitespace-nowrap transition-colors hover:text-foreground",children:r.label}):f]},r.to??r.label)})})}const se=O(async()=>({default:(await B(async()=>{const{PeekPaneContent:e}=await import("./peek-pane-content-B29OcHwm.js");return{PeekPaneContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))).PeekPaneContent}));function oe(){return t.jsxs("div",{"data-testid":"peek-pane-body-loading",className:"space-y-3 p-4",children:[t.jsx(g,{className:"h-5 w-2/3"}),t.jsx(g,{className:"h-4 w-full"}),t.jsx(g,{className:"h-24 w-full rounded-lg"})]})}const re=460,ie=480;function le({children:e}){const n=p.useRef(null),a=v(),o=I(),i=R(n,re+ie),s=!o&&i&&a?.item!=null;return t.jsxs("div",{ref:n,className:"relative flex min-h-0 flex-1 flex-row",children:[t.jsx("div",{inert:s,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto",children:e}),t.jsx(ue,{covers:s})]})}function ue({covers:e=!1}){const n=v(),a=I();return n?.item?t.jsx(xe,{item:n.item,onClose:n.close,onBack:n.back,isNarrow:a,covers:e}):null}function w({item:e,children:n}){const a=e.href?h(e.href):null;return a?.kind==="automation"&&a.runId==null&&!e.runId?t.jsx(fe,{owner:a.owner,automationId:a.automationId,fallback:e.title,children:n}):a?.kind==="agent"?t.jsx(he,{agentId:a.agentId,clientIds:a.clientIds,fallback:e.title,children:n}):a?.kind==="event"?t.jsx(ce,{owner:a.owner,eventId:a.eventId,fallback:e.title,children:n}):t.jsx(de,{item:e,children:n})}function ce({owner:e,eventId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=F(i?.id??null,void 0,{contentIds:[n]},e),r=s?.pages[0]?.content.find(u=>Number(u.id)===n);return o({title:r?V(r):a,status:null})}function de({item:e,children:n}){const a=e.href?h(e.href):null,o=a?.kind==="record-view"?a.viewKey:null,i=a?.kind==="entity-type"?a:null,s=i?.typeSlug??null,r=q({slug:o?a?.owner:void 0}),{data:u}=G(s?a?.owner??null:null),c=s?u?.find(f=>f.slug===s)?.name:void 0;return n({title:o&&r.data?.find(f=>f.key===o)?.name||c&&(i?.view==="activity"?`${c} activity`:c)||e.title,status:null})}function fe({owner:e,automationId:n,fallback:a,children:o}){const{org:i}=N(e),{data:s}=te(i?.id,void 0,{includeDetails:!1}),r=s?.find(u=>u.automation_id===n);return o({title:r?.name?.trim()||a,status:r?W(U(r),Date.now()):null})}function he({agentId:e,clientIds:n,fallback:a,children:o}){const i=H({enabled:!!e}),s=ae(null,{enabled:!e&&!!n?.length}),r=e?i.data?.find(u=>u.agentId===e)?.name:s.data?.find(u=>n?.includes(u.id))?.title;return o({title:r?.trim()||a,status:null})}function me(e){const n=e.connectorPanel;if(n?.connectionId!=null)return{label:"Settings",pathname:`/${n.ownerSlug}/connectors/${encodeURIComponent(n.connectorKey)}/${n.connectionId}`,search:{settings:!0}};const a=e.href?h(e.href):null;if(a?.kind==="automation"&&a.runId==null&&!e.runId)return{label:"Edit",pathname:`/${a.owner}/automations/${encodeURIComponent(a.automationId)}`,search:{view:"definition"}};if(a?.kind==="agent"&&a.owner!=="me"){if(a.agentId)return{label:"Agent settings",pathname:`/${a.owner}/agents/${encodeURIComponent(a.agentId)}`};const o=a.clientIds?.[0];if(o)return{label:"Agent settings",pathname:`/${a.owner}/agents/connected/${encodeURIComponent(o)}`}}return null}function xe({item:e,onClose:n,onBack:a,isNarrow:o,covers:i}){const s=S(),r=e.href?h(e.href):null,u=e.runId&&r?.kind==="automation"&&r.view==="activity"?{pathname:`/${r.owner}/events`,search:{run_ids:String(e.runId)}}:e.href?C(e.href):null,c=me(e);p.useEffect(()=>{if(o)return;const d=l=>{l.defaultPrevented||l.key!=="Escape"||(l.preventDefault(),n())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n,o]);const f=d=>t.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-1 border-b border-border px-3 py-1.5",children:[a||d?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Back",onClick:a??n,children:t.jsx(L,{className:"h-4 w-4"})}):null,t.jsx(w,{item:e,children:({title:l,status:m})=>t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:l}),m?t.jsx("p",{title:m.text,className:y("truncate text-xs",m.problem?"text-destructive":"text-muted-foreground"),children:m.text}):null]})}),c?t.jsx(x,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",children:t.jsxs(k,{to:c.pathname,search:c.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:c.pathname,search:c.search??{}})))())},children:[t.jsx(K,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),c.label]})}):null,u?t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Open full page",asChild:!0,children:t.jsx(k,{to:u.pathname,search:u.search??{},onClick:l=>{l.button!==0||l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||(l.preventDefault(),(async()=>(await n(),await s({to:u.pathname,search:u.search??{}})))())},children:t.jsx(z,{className:"h-4 w-4"})})}):null,t.jsx(x,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-foreground","aria-label":"Close preview",onClick:n,children:t.jsx(T,{className:"h-4 w-4"})})]}),b=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t.jsx(p.Suspense,{fallback:t.jsx(oe,{}),children:t.jsx(w,{item:e,children:({title:d})=>t.jsx(se,{item:d===e.title?e:{...e,title:d}})})})});return o?t.jsx(A,{open:!0,onOpenChange:d=>{d||n()},children:t.jsxs(_,{children:[t.jsx(D,{className:"fixed inset-0 z-40 bg-black/60 data-[state=open]:animate-in data-[state=open]:fade-in-0"}),t.jsxs(E,{"aria-describedby":void 0,className:"fixed inset-y-0 right-0 z-50 flex w-full max-w-[460px] flex-col border-l border-border bg-background outline-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right",children:[t.jsx($,{className:"sr-only",children:t.jsx(w,{item:e,children:({title:d})=>d})}),f(!0),t.jsx(j,{item:e}),b]})]})}):t.jsxs("aside",{className:y("flex flex-col border-l border-border bg-background",i?"absolute inset-0 z-30 w-full":"w-[460px] max-w-[45vw] shrink-0"),children:[f(!1),t.jsx(j,{item:e}),b]})}function be(){const{owner:e}=M.useParams(),{data:n,isLoading:a,error:o}=Q(e==="me"?null:e,{slug:e}),{session:i,isReady:s}=X();return J({active:Y({settled:!a,authReady:s,session:i,resolved:!!n?.workspace,error:o}),owner:e})?null:t.jsx(Z,{children:t.jsx(ne,{children:t.jsx(le,{children:t.jsx(ee,{})})})})}export{be as component};
3
- //# sourceMappingURL=_owner-BDvTUY0a.js.map
@@ -1,2 +0,0 @@
1
- import{jt as p,j as m,be as i}from"./index-C2TCKJDP.js";import{M as e}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function q(){const{owner:t,entityType:o,shape:r}=p.useParams();return m.jsx(e,{ownerSlug:t,typeScope:i(o),create:!1,shape:r})}export{q as component};
2
- //# sourceMappingURL=_shape-BZidoJMB.js.map
@@ -1,2 +0,0 @@
1
- import{cq as l,G as y,c,cr as d,cs as g,j as t,ar as u,as as x,bH as E}from"./index-C2TCKJDP.js";import{E as f}from"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";function b(){const{owner:a,slug:n}=l.useParams(),{orgContext:s}=y(),o=c(),{data:i=[],isLoading:r}=d(s),e=i.find(m=>m.slug===n)??null,p=e?g(e):!1;return t.jsx(u,{className:"gap-4 pt-2.5 pb-8",children:t.jsx(x,{children:r?t.jsx(E,{label:"entity type",variant:"panel"}):e?t.jsx(f,{entityType:e,orgContext:s,hideDelete:p,onClose:()=>{o({to:"/$owner/data",params:{owner:a}})}}):t.jsx("div",{className:"text-sm text-muted-foreground",children:"Entity type not found."})})})}export{b as component};
2
- //# sourceMappingURL=_slug-R989vOiM.js.map
@@ -1,2 +0,0 @@
1
- import{ju as t,j as m}from"./index-C2TCKJDP.js";import{M as i}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function V(){const{owner:o,viewKey:r}=t.useParams();return m.jsx(i,{ownerSlug:o,create:!1,viewKey:r})}export{V as component};
2
- //# sourceMappingURL=_viewKey-BDUSrpe5.js.map
@@ -1,2 +0,0 @@
1
- import{jD as p,j as i,be as m}from"./index-C2TCKJDP.js";import{M as e}from"./memory-browse-page-CUea2Llz.js";import"./public-shell-ready-BbjPgh3k.js";import"./connector-boxes-BWPXijAk.js";import"./use-automations-lV8PuE8L.js";import"./feed-event-kinds-BYuZCoU4.js";import"./schema-type-editor-panel-C4e8pq1A.js";import"./entity-type-page-CouHZbc9.js";import"./event-kind-options-fHAIXu24.js";import"./code-editor-UppEMWpt.js";import"./index-Vcq4gwWv.js";import"./dynamic-schema-form-D3KnzCsW.js";import"./renderer-ucwCQmBk.js";import"./schema-value-CefbtPIY.js";import"./card-rE4Ctuy6.js";import"./table-1O-ik4_O.js";import"./entity-pages-DJNSQrfB.js";import"./filter-editors-DQ5V4Cvh.js";import"./subDays-DwIOMzYC.js";import"./core.esm-6koO33th.js";import"./view-param-filters-Bp84PUMd.js";import"./app-bridge-C4nPtae3.js";import"./member-scope-gate-Doic_6qX.js";function K(){const{owner:t,entityType:o,viewKey:r}=p.useParams();return i.jsx(e,{ownerSlug:t,typeScope:m(o),create:!1,viewKey:r})}export{K as component};
2
- //# sourceMappingURL=_viewKey-BnFqh5-t.js.map
@@ -1,2 +0,0 @@
1
- import{G as B,n as H,ce as I,be as y,cf as _,r as z,c as N,ax as G,cg as V,j as t,bH as Y,b0 as b,ch as K,ci as U,cj as q,ck as P,B as m,L as w,cl as D,cm as J,cn as Q,co as X,cp as Z,H as tt,ar as et,aF as nt,as as st}from"./index-C2TCKJDP.js";import{R as ot,E as at,S as it,N as R,M as rt}from"./record-activity-BCpNKaUo.js";import{M as ct}from"./member-scope-gate-Doic_6qX.js";import{H as lt}from"./home-toolbar-CpCcHA6z.js";import{H as dt}from"./home-stream-Bg97PUBJ.js";import{P as ut}from"./public-shell-ready-BbjPgh3k.js";function mt({organizationId:n,ownerSlug:e,typeScope:a,entityScope:s,attentionOnly:r=!1}){const{orgContext:c}=B(),{isMember:l,isLoading:x}=H(),h=l&&!!n,{attentionItems:p,isError:g}=I(e),o=a?y(a):void 0,i=!s&&!o,{feeds:k,rows:A,pageRows:d}=_(n,p),L=z.useMemo(()=>new Set(d.flatMap(({item:C})=>C.approvalRunId!=null?[C.approvalRunId]:[])),[d]),O=N(),M=()=>void O({to:"/$owner",params:{owner:e},search:{attention:"1"}}),{data:f,isLoading:v,error:T}=G(s?`/${e}/${V(s)}`:`/${e}`,c),j=s?f?.entity:void 0,$=(s?j?.entity_type??y(s.split("/").at(-2)??""):o)==="$member",W=s!=null&&!v&&(T!=null||f?.entity==null),u=s?void 0:f?.counts,F=u?u.connections>0||u.agents>0:!1,S=h&&!x&&!v&&u!=null&&!F,E=s&&v?t.jsx(Y,{label:"Loading record…"}):W?t.jsx(b,{icon:K,title:"Record not found",description:"It may have been deleted, or it may live in a workspace you can't access."}):r&&i?t.jsx(xt,{owner:e,items:A,isError:g}):j?t.jsx(ot,{ownerSlug:e,entity:j,organizationId:n}):t.jsx(at,{organizationId:n,ownerSlug:e,hideSourceFilter:!0,scopedEntityTypes:o?[o]:void 0,pinned:i&&(d.length>0||k.length>0)?{rows:t.jsx(U,{owner:e,organizationId:n,feeds:k,rows:d}),hiddenApprovalRunIds:L}:void 0,onShowNotifications:i?M:void 0,toolbar:{leading:null,trailing:t.jsx(lt,{owner:e,mode:"activity"})},emptyState:S?t.jsx(pt,{ownerSlug:e}):void 0});return t.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4",children:$?t.jsx(ct,{children:E}):E})}function xt({owner:n,items:e,isError:a}){const s=N();return t.jsxs("section",{"aria-label":"Notifications",className:"space-y-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2.5",children:[t.jsx("span",{className:"mr-auto text-sm text-muted-foreground tabular-nums",children:e.length>0?`${e.length} ${e.length===1?"notification":"notifications"}`:null}),t.jsx(ht,{owner:n}),t.jsx(it,{value:R.value,withNotifications:!0,onChange:r=>{if(r===R.value)return;const[c,l]=r.split("-");s({to:"/$owner",params:{owner:n},search:q({sortBy:c,sortOrder:l})})}})]}),a?t.jsx("p",{className:"px-3 text-sm text-destructive",children:"Could not load notifications."}):e.length===0?t.jsx(b,{icon:P,title:"All caught up",description:"Nothing needs you right now.",children:t.jsx(m,{asChild:!0,variant:"outline",className:"mt-4",children:t.jsx(w,{to:"/$owner",params:{owner:n},children:"See all activity"})})}):t.jsx(D,{owner:n,rows:e})]})}function ht({owner:n}){const{visibleUnreadIds:e,markVisibleRead:a,bulkPending:s}=I(n);return e.length===0?null:t.jsxs(m,{type:"button",variant:"ghost",size:"sm",className:"h-8 text-muted-foreground",disabled:s,onClick:()=>void a(),children:[t.jsx(P,{className:"mr-1.5 h-3.5 w-3.5"}),"Mark all as read"]})}function pt({ownerSlug:n}){return t.jsx("div",{className:"px-6",children:t.jsx(b,{icon:J,title:"Nothing to catch up on — yet",description:"No notifications here. Add a connector to bring in data, or bring your agent to Lobu and give it something to work with.",children:t.jsxs("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:[t.jsx(m,{asChild:!0,children:t.jsxs(w,{to:"/$owner/connectors/create",params:{owner:n},children:[t.jsx(Q,{className:"mr-2 h-4 w-4"}),"Add a connector"]})}),t.jsx(m,{asChild:!0,variant:"outline",children:t.jsxs(w,{to:"/$owner/agents/connect",params:{owner:n},children:[t.jsx(X,{className:"mr-2 h-4 w-4"}),"Connect agent"]})})]})})})}function bt({owner:n,search:e,entityScope:a,home:s=!1}){const r=typeof e.type=="string"&&e.type.trim()?y(e.type.trim()):void 0,c=String(e.attention)==="1",l=e.section==="automation"||e.section==="connection"||e.section==="agent"?e.section:void 0,x=Object.entries(e).some(([o,i])=>(Z.includes(o)||o.startsWith("clf_"))&&i!=null&&i!==""),h=N(),{pathname:p}=tt(),g=o=>{h({to:p,search:(i=>({...i,attention:o?"1":void 0})),replace:!0})};return t.jsxs(et,{className:"gap-6 pt-2.5 pb-8",children:[t.jsx(ut,{}),t.jsx(nt,{owner:n,children:o=>t.jsx(rt,{organizationId:o.organizationId,isWorkspaceLoading:o.isWorkspaceLoading,children:t.jsx(st,{wide:s,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:s&&!x&&!r&&!a?t.jsx(dt,{owner:o.ownerSlug,organizationId:o.organizationId,needsYou:c,onNeedsYouChange:g,section:l}):t.jsx(mt,{organizationId:o.organizationId,ownerSlug:o.ownerSlug,typeScope:r,entityScope:a,attentionOnly:c})})})})]})}export{bt as A};
2
- //# sourceMappingURL=activity-route-view-CN2dOiCD.js.map
@@ -1,2 +0,0 @@
1
- import{G as k,j as e,L as D,cj as L,r as h,ai as F,B as M,fa as C,d3 as I,eA as $,ax as K,z as B,n as H,cC as J,m as q,ce as G,d9 as S,hH as W,d7 as z,eI as V,cP as Y,bG as Q}from"./index-C2TCKJDP.js";import{E as U}from"./event-detail-CvaRN1qB.js";import{N as X,M as Z}from"./home-stream-Bg97PUBJ.js";import{S as ee}from"./scoped-feed-bar-CapleZvS.js";import{C as te,A as se}from"./create-automation-form-BhujNbRr.js";import{P as ne}from"./proposal-review-shell-BVwOMoq9.js";import{u as b}from"./runs-B_iywKWb.js";import{E as ie}from"./events-feed-DwOkLk6A.js";import{D as re,a as ae}from"./definition-comparison-3zKUSTt8.js";import{R as oe}from"./runs-list-CJJFRhTl.js";import{a as P}from"./use-automations-lV8PuE8L.js";function R({automationId:t}){const{currentOwner:s}=k();return s?e.jsx(D,{to:"/$owner/events",params:{owner:s},search:L({semanticTypes:["change"],eventCategory:"config",resourceKind:"automation",resourceId:t}),className:"text-sm text-primary underline underline-offset-4",children:"View definition history in Events"}):null}const ce={workspace:!0},de=6,le=["name","title"],E=10;function j(t){return t==null?!1:typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.some(j):typeof t=="object"?Object.values(t).some(j):!0}function ue(t){const s=t.split("_").join(" ").trim();return s.charAt(0).toUpperCase()+s.slice(1)}function _({value:t,depth:s=0}){if(!j(t))return null;if(typeof t!="object"||t==null)return e.jsx("span",{className:"break-words",children:String(t)});if(s>=de)return e.jsx("span",{className:"break-words text-muted-foreground",children:JSON.stringify(t).slice(0,200)});if(Array.isArray(t))return e.jsx("ul",{className:"space-y-1.5",children:t.filter(j).map((o,d)=>e.jsx("li",{className:"border-l-2 border-border pl-2",children:e.jsx(_,{value:o,depth:s+1})},d))});const r=t,a=le.find(o=>typeof r[o]=="string"&&j(r[o])),i=Object.entries(r).filter(([o,d])=>o!==a&&j(d));return e.jsxs("div",{className:"space-y-1",children:[a?e.jsx("p",{className:"font-medium text-foreground",children:String(r[a])}):null,i.length>0?e.jsx("dl",{className:"space-y-1",children:i.map(([o,d])=>e.jsxs("div",{children:[e.jsxs("dt",{className:"inline text-muted-foreground",children:[ue(o),":"," "]}),e.jsx("dd",{className:"inline",children:typeof d=="object"?e.jsx("div",{className:"mt-1",children:e.jsx(_,{value:d,depth:s+1})}):e.jsx(_,{value:d,depth:s+1})})]},o))}):null]})}function w({run:t}){const s=t.completed_at??t.created_at;return e.jsx("time",{dateTime:new Date(s).toISOString(),title:$(s),className:"text-xs text-muted-foreground",children:I(s)})}function v({rows:t}){return t.length===0?null:e.jsx("ul",{className:"divide-y overflow-hidden rounded-lg border",children:t.map(s=>e.jsx("li",{children:s.content},s.key))})}function me({owner:t,automationId:s,failedRows:r}){const a=h.useId(),i=b(ce,{runTypes:["automation"],automationIds:[s],status:"completed"},t),o=i.data?.pages.flatMap(m=>m.runs)??[],d=o.filter(m=>j(m.output)),u=o.length-d.length,[n,...l]=d,f=i.data?.pages.length??0,{hasNextPage:g,isFetching:c,fetchNextPage:p}=i;h.useEffect(()=>{!n&&g&&!c&&f<E&&p()},[n,g,c,f,p]);const y=i.hasNextPage?e.jsx("div",{className:"flex justify-center",children:i.isFetchingNextPage?e.jsx(F,{role:"status","aria-label":"Loading earlier runs",className:"text-muted-foreground"}):e.jsx(M,{variant:"link",size:"sm",className:"h-auto p-0 text-xs font-normal text-muted-foreground",disabled:i.isFetching,onClick:()=>void i.fetchNextPage(),children:"Show earlier runs"})}):null,N=n?[...l.map(m=>({key:String(m.id),occurredAt:m.completed_at??m.created_at,content:e.jsxs("div",{className:"space-y-1 px-3 py-2 text-xs",children:[e.jsx(w,{run:m}),e.jsx(_,{value:m.output})]})})),...r].sort((m,x)=>(C(x.occurredAt)??0)-(C(m.occurredAt)??0)):[];return i.isError?e.jsxs("div",{className:"space-y-6 py-6",children:[e.jsx("p",{role:"alert",className:"text-sm text-muted-foreground",children:"Couldn't load this Automation's runs."}),e.jsx(v,{rows:r})]}):i.isLoading||!n&&g&&f<E?null:n?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{"aria-label":"Latest result",className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Latest result"}),e.jsx(w,{run:n})]}),e.jsx("div",{className:"text-sm",children:e.jsx(_,{value:n.output})})]}),N.length>0?e.jsxs("section",{"aria-labelledby":a,className:"space-y-2",children:[e.jsx("h2",{id:a,className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Earlier results"}),e.jsx(v,{rows:N})]}):null,u>0?e.jsxs("p",{className:"text-xs text-muted-foreground",children:[u," other ",u===1?"run":"runs"," found nothing new."]}):null,y]}):e.jsxs("div",{className:"space-y-6 py-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:o.length===0?"This Automation hasn't run yet. Its results appear here, newest first.":`It ran ${o.length}${i.hasNextPage?"+":""} times without returning a result.`}),e.jsx(v,{rows:r}),y]})}function T(t){const{orgContext:s,hasOrgContext:r}=k(),{data:a,isLoading:i}=K(`/${t}`,s),{isAuthenticated:o}=B(),{isMember:d,isLoading:u}=H(),n=o&&d,l=a?.workspace,f=n?!r||i||u:i||u;return{organizationId:l?.id??"",isLoading:f}}function Re(t){return T(t)}const O={workspace:!0};function fe(t,s){const r=b(O,{runTypes:["automation"],automationIds:[s],status:"failed"},t),a=b(O,{runTypes:["automation"],automationIds:[s],status:"timeout"},t);return h.useMemo(()=>[...r.data?.pages[0]?.runs??[],...a.data?.pages[0]?.runs??[]].sort((i,o)=>Date.parse(o.created_at)-Date.parse(i.created_at)||o.id-i.id),[r.data,a.data])}function ge(t,s){const r=G(t),{decisions:a,notices:i}=h.useMemo(()=>{const u=r.attentionCards.filter(n=>n.automation_id===s);return{decisions:W(u.filter(S).map(n=>{const l=z(n);return{card:n,item:l,repeats:1,unreadIds:l.unread&&l.notificationId!=null?[l.notificationId]:[]}}).sort((n,l)=>l.item.at-n.item.at)),notices:u.filter(n=>!S(n)&&n.unread&&n.notification_id!=null)}},[r.attentionCards,s]);return{attention:r,decisions:a,notices:i,markRead:u=>{u.length>0&&r.markManyRead.mutateAsync(u)},unreadFor:u=>i.flatMap(n=>n.run_id!=null&&n.run_id===u.run_id||V(n.href?.split(/[?#]/)[0]??"")?.eventId===Number(u.id)?[n.notification_id]:[])}}function xe({owner:t,automationId:s,organizationId:r}){const a=Number(s),i=h.useMemo(()=>({producedByAutomationId:a}),[a]),{attention:o,decisions:d,notices:u,markRead:n,unreadFor:l}=ge(t,a),f=fe(t,a);if(!Number.isFinite(a))return null;const g=f.map(c=>({key:`run:${c.id}`,occurredAt:c.completed_at??c.created_at,content:e.jsx(oe,{run:c,ownerSlug:t})}));return e.jsxs(e.Fragment,{children:[o.isError?e.jsx("p",{role:"alert",className:"mb-6 text-sm text-destructive",children:"Could not load notifications. Refresh to try again."}):d.length>0?e.jsxs("section",{"aria-label":"Needs you",className:"mb-6 space-y-2",children:[e.jsx("h2",{className:"px-1 text-sm font-semibold",children:"Needs you"}),e.jsx(X,{owner:t,entries:d})]}):null,e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(ee,{owner:t,organizationId:r||null,activitySearch:{produced_by:String(a)}}),e.jsx(Z,{entries:u.map(c=>({unreadIds:[c.notification_id]})),disabled:o.markManyRead.isPending,onMarkRead:n})]}),e.jsx(ie,{organizationId:r,ownerSlug:t,filters:i,foldRunSatellites:!1,unreadNotices:l,onMarkRead:n,extraRows:g,renderLead:(c,{hasEarlier:p})=>e.jsxs("div",{className:"mb-4 space-y-6",children:[e.jsxs("section",{"aria-label":"Latest result",className:"space-y-2",children:[e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Latest result"}),e.jsx(U,{owner:t,organizationId:r,eventId:c.id})]}),p?e.jsx("h2",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Earlier results"}):null]}),emptyState:e.jsx(me,{owner:t,automationId:a,failedRows:g})})]})}function pe({agentId:t,automationId:s,runId:r,organizationId:a,onDone:i}){const[o,d]=h.useState({ready:!1,triggers:[]}),u=h.useCallback(m=>{d(x=>JSON.stringify(x)===JSON.stringify(m)?x:m)},[]),n=P(s,void 0,a,{includeVersions:!0}),l=n.data?.automation,{currentOwner:f}=k(),g=J({queryKey:["automations-list",f,"editor",s,l?.status],enabled:!!f&&!!a&&!!l,queryFn:async()=>{const x=(await Y("manage_automations",{action:"list",automation_id:s,status:l?.status,include_details:!0,limit:1},{slug:f})).automations.find(A=>A.automation_id===s);if(!x)throw new Q("Automation not found",404);return x},staleTime:3e4}),c=g.data,p=h.useMemo(()=>l&&c?{automation_id:l.automation_id,name:c.name,slug:c.slug,description:c.description,prompt:c.prompt,sources:c.sources,reaction_script:l.reaction_script,managed_agent_id:c.managed_agent_id,device_worker_id:c.device_worker_id,agent_kind:c.agent_kind,delivery_target:c.delivery_target??void 0,execution_config:c.execution_config??void 0,model_config:c.model_config,tags:c.tags,keying_config:l.keying_config,reactions_guidance:c.reactions_guidance,triggers:c.triggers}:void 0,[l,c]),y=e.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2].map(m=>e.jsx(q,{className:"h-16 w-full rounded-lg"},m))}),N=g.isError?e.jsxs("div",{role:"alert",className:"space-y-2 text-sm",children:[e.jsx("p",{children:"Could not load the saved Automation definition."}),e.jsx("button",{type:"button",className:"text-primary underline underline-offset-4",onClick:()=>void g.refetch(),children:"Retry"})]}):n.isLoading||l&&g.isPending?y:p?e.jsx(te,{organizationId:a,prefillAgentId:t??void 0,editingAutomation:p,createFields:{triggers:o.triggers},triggerFields:e.jsx(se,{organizationId:a,initialTriggers:p.triggers??[],onChange:u},JSON.stringify(p.triggers??[])),hideHeader:!0,hideCancel:!0,submitDisabled:!o.ready,onClose:i}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automation not found. It may have been removed."});return t?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ne,{resource:{kind:"automation",agentId:t,automationId:s},runId:r,onDone:i,children:({reviewMode:m,proposal:x})=>m==="active"?e.jsx(re,{current:x?.current??null,proposed:{...x?.current??{},...x?.proposedAfter??{}},render:A=>e.jsx(ae,{value:A})}):m==="loading"?y:m==="error"?null:N}),e.jsx(R,{automationId:s})]}):e.jsxs("div",{className:"space-y-6",children:[N,e.jsx(R,{automationId:s})]})}function Ee({owner:t,agentId:s,automationId:r,view:a,runId:i,onDone:o}){const{organizationId:d}=T(t),u=P(r,void 0,d),n=s??u.data?.automation?.managed_agent_id??null;return i||a==="definition"?e.jsx(pe,{agentId:n,automationId:r,runId:i,organizationId:d,onDone:o},`${t}/${r}`):e.jsx(xe,{owner:t,automationId:r,organizationId:d})}export{Ee as A,Re as u};
2
- //# sourceMappingURL=automation-detail-content-BJwRU6qT.js.map
@@ -1,2 +0,0 @@
1
- import{j as t,O as o}from"./index-C2TCKJDP.js";const n=()=>t.jsx(o,{});export{n as component};
2
- //# sourceMappingURL=connect-OdHpIVV9.js.map