@lobu/runtime-server 24.11.1 → 24.12.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 (272) hide show
  1. package/dist/catalogs/connectors.json +1113 -107
  2. package/dist/catalogs/skills.json +2 -2
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +2 -2
  5. package/dist/connectors/chat-transport-actions.ts +50 -0
  6. package/dist/connectors/discord.ts +2 -0
  7. package/dist/connectors/gchat.ts +2 -0
  8. package/dist/connectors/github.ts +4 -4
  9. package/dist/connectors/google_drive.ts +20 -0
  10. package/dist/connectors/google_gmail.ts +49 -8
  11. package/dist/connectors/herdr.ts +1 -1
  12. package/dist/connectors/imessage.ts +1 -0
  13. package/dist/connectors/linkedin-browser-script.ts +11 -0
  14. package/dist/connectors/linkedin-draft-page.js +24 -8
  15. package/dist/connectors/linkedin-inbox-adapter.js +209 -19
  16. package/dist/connectors/linkedin-inbox.ts +152 -4
  17. package/dist/connectors/linkedin-network.ts +788 -0
  18. package/dist/connectors/linkedin-search.ts +1284 -0
  19. package/dist/connectors/linkedin.ts +892 -27
  20. package/dist/connectors/microsoft_outlook.ts +57 -19
  21. package/dist/connectors/rss.ts +179 -33
  22. package/dist/connectors/slack.ts +2 -0
  23. package/dist/connectors/source-file-attachment.ts +46 -0
  24. package/dist/connectors/teams.ts +2 -0
  25. package/dist/connectors/telegram.ts +2 -0
  26. package/dist/connectors/tiktok_web.ts +1 -1
  27. package/dist/connectors/whatsapp.ts +2 -0
  28. package/dist/connectors/whatsapp_web.ts +3 -3
  29. package/dist/connectors/x-dm-adapter.js +8 -10
  30. package/dist/connectors/x.ts +8 -9
  31. package/dist/db/migrations/20261115040000_account_two_factor.sql +20 -0
  32. package/dist/db/migrations/20261115130000_entities_retired_type_idx.sql +34 -0
  33. package/dist/db/migrations/20261115140000_entity_identities_personal_owner_idx.sql +34 -0
  34. package/dist/db/migrations/20261117090000_write_policy_kind_note.sql +65 -0
  35. package/dist/db/migrations/20261117120000_app_policy_principal.sql +48 -0
  36. package/dist/db/migrations/20261117170000_personal_org_connector_auto_policy_backfill.sql +57 -0
  37. package/dist/db/migrations/20261117190000_org_slug_reserved_paths.sql +29 -0
  38. package/dist/db/migrations/20261118120000_workspace_view_top_level_paths.sql +69 -0
  39. package/dist/db/migrations/preconditions/20261117190000_org_slug_reserved_paths.sql +14 -0
  40. package/dist/db/migrations/preconditions/20261118120000_workspace_view_top_level_paths.sql +21 -0
  41. package/dist/dependencies.bun.lock +51 -46
  42. package/dist/guest.bundle.js +11 -2
  43. package/dist/owletto/dist/assets/_-BC9j6MkU.js +2 -0
  44. package/dist/owletto/dist/assets/_-Z1u1cIe6.js +3 -0
  45. package/dist/owletto/dist/assets/_agentId-B-TFq9TP.js +2 -0
  46. package/dist/owletto/dist/assets/{_agentId-CGScf8z_.js → _agentId-BGatZWsd.js} +2 -2
  47. package/dist/owletto/dist/assets/_automationId-CMUrWPvr.js +2 -0
  48. package/dist/owletto/dist/assets/_connectorKey._connectionId-CUoAoP0_.js +2 -0
  49. package/dist/owletto/dist/assets/_connectorKey.index-Bs49QGGH.js +2 -0
  50. package/dist/owletto/dist/assets/_conversationId-CszP1den.js +2 -0
  51. package/dist/owletto/dist/assets/_eventId-C0AZUBnD.js +2 -0
  52. package/dist/owletto/dist/assets/_owner-B4ydA75k.js +3 -0
  53. package/dist/owletto/dist/assets/_shape-C4-ikE70.js +2 -0
  54. package/dist/owletto/dist/assets/_slug-DE5J3KVu.js +2 -0
  55. package/dist/owletto/dist/assets/_viewKey-Dkcd8JQC.js +2 -0
  56. package/dist/owletto/dist/assets/{accept-invitation-BKeIzZXE.js → accept-invitation-DmrQQu_W.js} +2 -2
  57. package/dist/owletto/dist/assets/{activity-route-location-sLvKaSCa.js → activity-route-location-Bec6fW-t.js} +2 -2
  58. package/dist/owletto/dist/assets/activity-route-view-DCSNBKZU.js +2 -0
  59. package/dist/owletto/dist/assets/agent-client-connections-xvabPpi6.js +4 -0
  60. package/dist/owletto/dist/assets/agent-connect-pages-DDPtkcmq.js +6 -0
  61. package/dist/owletto/dist/assets/{agent-editor-form-DVFyyMyd.js → agent-editor-form-BrhQbHZg.js} +2 -2
  62. package/dist/owletto/dist/assets/{agent-loading-shells-BLNHIy-r.js → agent-loading-shells-D3y98xuO.js} +2 -2
  63. package/dist/owletto/dist/assets/{agent-permissions-matrix-UBKRR5vs.js → agent-permissions-matrix-jQJjSa9i.js} +2 -2
  64. package/dist/owletto/dist/assets/{agent-skill-context-fqedKd0D.js → agent-skill-context-CCcknBYE.js} +2 -2
  65. package/dist/owletto/dist/assets/{agent-subpage-shell-BUCoY2Nf.js → agent-subpage-shell-6f_53cSf.js} +2 -2
  66. package/dist/owletto/dist/assets/agent-thread-v_lSSnJi.js +6 -0
  67. package/dist/owletto/dist/assets/{app._appId-ByIypCL9.js → app._appId-CKWzZ2ic.js} +2 -2
  68. package/dist/owletto/dist/assets/assist-composer-Q9ZJjAta.js +2 -0
  69. package/dist/owletto/dist/assets/automation-run-now-Dl0MKx3N.js +2 -0
  70. package/dist/owletto/dist/assets/{callback-Pz5uS-k7.js → callback-Bentv78L.js} +2 -2
  71. package/dist/owletto/dist/assets/{card-CAPpY9P5.js → card-C4oPCVh6.js} +2 -2
  72. package/dist/owletto/dist/assets/{claim-DgWWK0KI.js → claim-B3C4qIi2.js} +2 -2
  73. package/dist/owletto/dist/assets/client-activity-scopes-DqaFEyir.js +2 -0
  74. package/dist/owletto/dist/assets/{client-rows-Dd5YV8vn.js → client-rows-rse9thnk.js} +2 -2
  75. package/dist/owletto/dist/assets/{clients-Bf7ZgGro.js → clients-BhPMbxHi.js} +2 -2
  76. package/dist/owletto/dist/assets/{code-editor-z1Sy_hiX.js → code-editor-CTdKUDPY.js} +2 -2
  77. package/dist/owletto/dist/assets/connect-D8o7HBlo.js +2 -0
  78. package/dist/owletto/dist/assets/connect-menu-D5EZvSHb.js +2 -0
  79. package/dist/owletto/dist/assets/connect._clientId-Dbagcg9L.js +2 -0
  80. package/dist/owletto/dist/assets/connected._clientId-DALW9S2K.js +2 -0
  81. package/dist/owletto/dist/assets/connection-DyxzSqVE.js +2 -0
  82. package/dist/owletto/dist/assets/connection-feed-detail-LqpxUCdy.js +2 -0
  83. package/dist/owletto/dist/assets/{connector-page-shell-an3SYLim.js → connector-page-shell-DZjKv9zQ.js} +2 -2
  84. package/dist/owletto/dist/assets/{connector-provenance-mSZCOud-.js → connector-provenance-DtTJn1Nk.js} +2 -2
  85. package/dist/owletto/dist/assets/connectors-BVl-AR33.js +2 -0
  86. package/dist/owletto/dist/assets/{consent-1ulwyJ3k.js → consent-XCqsHLxS.js} +2 -2
  87. package/dist/owletto/dist/assets/{core.esm-Ctg_pXLe.js → core.esm-B1du4Zwy.js} +3 -3
  88. package/dist/owletto/dist/assets/create-BYKCtGL4.js +2 -0
  89. package/dist/owletto/dist/assets/create-D6Mmuxcq.js +2 -0
  90. package/dist/owletto/dist/assets/{create-CGuoqPh8.js → create-GHTb6wKX.js} +2 -2
  91. package/dist/owletto/dist/assets/{create-automation-form-CD6jSlWL.js → create-automation-form-CTiy_S9G.js} +3 -3
  92. package/dist/owletto/dist/assets/create._connectorKey-DMH97KkK.js +2 -0
  93. package/dist/owletto/dist/assets/custom-guardrail-edits-DZy66ucV.js +2 -0
  94. package/dist/owletto/dist/assets/definition-comparison-C2mPfIMD.js +2 -0
  95. package/dist/owletto/dist/assets/detail-page-skeleton-DNBL7nyk.js +2 -0
  96. package/dist/owletto/dist/assets/device-CwP1PY8q.js +2 -0
  97. package/dist/owletto/dist/assets/{device-pin-tombstone-Dkj7hrBE.js → device-pin-tombstone-DYTt7kU5.js} +2 -2
  98. package/dist/owletto/dist/assets/device._deviceId-DZ2kqI4Y.js +2 -0
  99. package/dist/owletto/dist/assets/{entity-options-D4t-NAcg.js → entity-options-D9K_5Lcs.js} +2 -2
  100. package/dist/owletto/dist/assets/entity-page-DggKXrcE.js +2 -0
  101. package/dist/owletto/dist/assets/entity-pages-C6M6yKFf.js +2 -0
  102. package/dist/owletto/dist/assets/{entity-schema-graph-Cq96SJ3c.js → entity-schema-graph-B255NKjF.js} +2 -2
  103. package/dist/owletto/dist/assets/entity-type-page-CGBAP2wt.js +2 -0
  104. package/dist/owletto/dist/assets/event-attachments-D8Z8uwv9.js +2 -0
  105. package/dist/owletto/dist/assets/event-detail-CgG3pDLA.js +2 -0
  106. package/dist/owletto/dist/assets/events-feed-ClhEywwV.js +2 -0
  107. package/dist/owletto/dist/assets/{filter-editors-DGVl9U4D.js → filter-editors-D_Sfn0dv.js} +3 -3
  108. package/dist/owletto/dist/assets/{full-page-spinner-CtVlF8GQ.js → full-page-spinner-C1clibUY.js} +2 -2
  109. package/dist/owletto/dist/assets/{index-CK5GDX4B.js → index-04B26s6E.js} +2 -2
  110. package/dist/owletto/dist/assets/index-2HrEO-nl.js +2 -0
  111. package/dist/owletto/dist/assets/index-BU3k9wpw.js +2 -0
  112. package/dist/owletto/dist/assets/{index-DvuJ_S_o.js → index-BXHqp23o.js} +2 -2
  113. package/dist/owletto/dist/assets/index-BdLRUDIR.js +2 -0
  114. package/dist/owletto/dist/assets/index-C2FrGwYN.js +2 -0
  115. package/dist/owletto/dist/assets/index-CB9wGfUm.js +2 -0
  116. package/dist/owletto/dist/assets/index-Caihaftb.js +2 -0
  117. package/dist/owletto/dist/assets/index-CwH59DJV.js +2 -0
  118. package/dist/owletto/dist/assets/index-DB2lVKuV.js +7908 -0
  119. package/dist/owletto/dist/assets/{index-DbjbHlDe.js → index-DTvJRjrM.js} +2 -2
  120. package/dist/owletto/dist/assets/index-SF2ni1Rs.css +1 -0
  121. package/dist/owletto/dist/assets/{index-BifR-LE9.js → index-mSrdbx3C.js} +9 -9
  122. package/dist/owletto/dist/assets/index-uFn-Ilrx.js +2 -0
  123. package/dist/owletto/dist/assets/{json-diff-OjtREegr.js → json-diff-Ce6YAXzY.js} +2 -2
  124. package/dist/owletto/dist/assets/{list-skeleton-CH0qQBYk.js → list-skeleton-DLPBTnbR.js} +2 -2
  125. package/dist/owletto/dist/assets/login-DeWlvogD.js +2 -0
  126. package/dist/owletto/dist/assets/{logout-DfdgOLoM.js → logout-CJY0ceN9.js} +2 -2
  127. package/dist/owletto/dist/assets/{member-scope-gate-Cxg2zGQT.js → member-scope-gate-CBPMprXu.js} +2 -2
  128. package/dist/owletto/dist/assets/memory-browse-page-D5kj1RaR.js +74 -0
  129. package/dist/owletto/dist/assets/{model-selector-D2OpDkwH.js → model-selector-CjkBPpjN.js} +2 -2
  130. package/dist/owletto/dist/assets/new-BKrNkOQD.js +2 -0
  131. package/dist/owletto/dist/assets/new-BetiMuDq.js +2 -0
  132. package/dist/owletto/dist/assets/new-dk_-eXqU.js +2 -0
  133. package/dist/owletto/dist/assets/new-efN--4Wx.js +2 -0
  134. package/dist/owletto/dist/assets/organization-C3rpwx_d.js +2 -0
  135. package/dist/owletto/dist/assets/pdf-document--AN-oCKj.css +1 -0
  136. package/dist/owletto/dist/assets/pdf-document-2W1q0sRA.js +56 -0
  137. package/dist/owletto/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
  138. package/dist/owletto/dist/assets/peek-pane-content-ChsBWO0P.js +3 -0
  139. package/dist/owletto/dist/assets/{pending-seed-BBACroge.js → pending-seed-CTKYdA4X.js} +2 -2
  140. package/dist/owletto/dist/assets/proposal-review-shell-EyGWEYwQ.js +2 -0
  141. package/dist/owletto/dist/assets/public-shell-ready-_KWdfzEM.js +2 -0
  142. package/dist/owletto/dist/assets/record-session-D27VNxP_.js +2 -0
  143. package/dist/owletto/dist/assets/{renderer-CTKNMcXP.js → renderer-B8yZ5lql.js} +34 -33
  144. package/dist/owletto/dist/assets/{reset-password-DKBEneyR.js → reset-password-BGVJIh2I.js} +2 -2
  145. package/dist/owletto/dist/assets/run-initiator-C0sur8lU.js +2 -0
  146. package/dist/owletto/dist/assets/runs-list-CJOFMgpk.js +2 -0
  147. package/dist/owletto/dist/assets/schema-value-DDNHANGs.js +3 -0
  148. package/dist/owletto/dist/assets/{scoped-feed-bar-DNFL0sYX.js → scoped-feed-bar-BTv9mPcR.js} +2 -2
  149. package/dist/owletto/dist/assets/settings-Ponr5XbS.js +3 -0
  150. package/dist/owletto/dist/assets/{status-variants-SzXYYedJ.js → status-variants-mLqVhg5O.js} +2 -2
  151. package/dist/owletto/dist/assets/subDays-BGA_fkig.js +2 -0
  152. package/dist/owletto/dist/assets/two-factor-pqoxGSgL.js +2 -0
  153. package/dist/owletto/dist/assets/{use-automations-DfBtVzGa.js → use-automations-DcdlmVuX.js} +2 -2
  154. package/dist/owletto/dist/assets/{use-login-redirect-BDiS3eyl.js → use-login-redirect-D7HW5Ed6.js} +2 -2
  155. package/dist/owletto/dist/assets/{use-mention-search-khySpz_V.js → use-mention-search-BniE-K2d.js} +3 -3
  156. package/dist/owletto/dist/assets/view-card-Cg6PeEiV.js +2 -0
  157. package/dist/owletto/dist/assets/view-param-filters-CvrKw0mZ.js +2 -0
  158. package/dist/owletto/dist/index.html +2 -2
  159. package/dist/server-main.bundle.mjs +5718 -2991
  160. package/npm-shrinkwrap.json +195 -172
  161. package/package.json +2 -1
  162. package/vendor/connector-sdk/dist/connector-types.d.ts +20 -0
  163. package/vendor/connector-sdk/dist/define-connector.js +2 -0
  164. package/vendor/connector-sdk/dist/extension-dom-scrape.d.ts +2 -0
  165. package/vendor/connector-sdk/dist/extension-dom-scrape.js +5 -0
  166. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +20 -0
  167. package/vendor/connector-sdk/package.json +1 -1
  168. package/vendor/core/dist/contracts/entity-reference.d.ts +2 -0
  169. package/vendor/core/dist/contracts/entity-reference.js +4 -3
  170. package/vendor/core/dist/contracts/tools/entity-list-sort.d.ts +18 -0
  171. package/vendor/core/dist/contracts/tools/entity-list-sort.js +64 -0
  172. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +1 -1
  173. package/vendor/core/dist/contracts/tools/manage-agents.js +3 -3
  174. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +4 -0
  175. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +4 -0
  176. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
  177. package/vendor/core/dist/contracts/tools/manage-entity.js +11 -1
  178. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +29 -3
  179. package/vendor/core/dist/contracts/tools/manage-operations.js +24 -2
  180. package/vendor/core/dist/contracts/tools/manage-views.d.ts +36 -0
  181. package/vendor/core/dist/contracts/tools/manage-views.js +15 -2
  182. package/vendor/core/dist/contracts/tools/view-definition.js +7 -2
  183. package/vendor/core/dist/contracts/tools/view-host.js +5 -0
  184. package/vendor/core/dist/contracts/tools/view-path.d.ts +8 -1
  185. package/vendor/core/dist/contracts/tools/view-path.js +11 -1
  186. package/vendor/core/dist/reserved.d.ts +7 -1
  187. package/vendor/core/dist/reserved.js +17 -0
  188. package/vendor/core/package.json +6 -1
  189. package/vendor/views/dist/api.d.ts +19 -3
  190. package/vendor/views/dist/api.js +53 -5
  191. package/vendor/views/dist/components.d.ts +7 -0
  192. package/vendor/views/dist/components.js +223 -2
  193. package/vendor/views/dist/embed.js +13 -2
  194. package/vendor/views/dist/live-gate.d.ts +34 -0
  195. package/vendor/views/dist/live-gate.js +100 -0
  196. package/vendor/views/dist/native.d.ts +43 -1
  197. package/vendor/views/dist/native.js +1 -0
  198. package/vendor/views/package.json +1 -1
  199. package/dist/owletto/dist/assets/_-BDMUN9XZ.js +0 -2
  200. package/dist/owletto/dist/assets/_-CF5X4ANe.js +0 -3
  201. package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +0 -2
  202. package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +0 -2
  203. package/dist/owletto/dist/assets/_connectorKey._connectionId-DcI29kGy.js +0 -2
  204. package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +0 -2
  205. package/dist/owletto/dist/assets/_conversationId-CnmLYlVS.js +0 -2
  206. package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +0 -2
  207. package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +0 -3
  208. package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +0 -2
  209. package/dist/owletto/dist/assets/_slug-COPpRXLt.js +0 -2
  210. package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +0 -2
  211. package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +0 -2
  212. package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +0 -2
  213. package/dist/owletto/dist/assets/agent-connect-pages-DVq9nAR7.js +0 -4
  214. package/dist/owletto/dist/assets/agent-thread-Cqf9ITrT.js +0 -6
  215. package/dist/owletto/dist/assets/assist-composer-kG_heHXo.js +0 -2
  216. package/dist/owletto/dist/assets/automation-run-now-C5XTS00o.js +0 -2
  217. package/dist/owletto/dist/assets/client-activity-scopes-Aqdo6Pdr.js +0 -2
  218. package/dist/owletto/dist/assets/connect-BFNp1y_s.js +0 -2
  219. package/dist/owletto/dist/assets/connect-menu-BWrAhMqO.js +0 -2
  220. package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +0 -2
  221. package/dist/owletto/dist/assets/connected._clientId-CuOeHafK.js +0 -2
  222. package/dist/owletto/dist/assets/connection-CVeHmDLs.js +0 -2
  223. package/dist/owletto/dist/assets/connection-feed-detail-BYo7zdVD.js +0 -2
  224. package/dist/owletto/dist/assets/connectors-DBEM9QQz.js +0 -2
  225. package/dist/owletto/dist/assets/copy-button-Xhh7ZnjO.js +0 -2
  226. package/dist/owletto/dist/assets/create-Ccb5R-S4.js +0 -2
  227. package/dist/owletto/dist/assets/create-DmhbacIa.js +0 -2
  228. package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +0 -2
  229. package/dist/owletto/dist/assets/custom-guardrail-edits-Ce_BwiwD.js +0 -2
  230. package/dist/owletto/dist/assets/definition-comparison-D_qP25jR.js +0 -2
  231. package/dist/owletto/dist/assets/detail-page-skeleton-CPAfZLG0.js +0 -2
  232. package/dist/owletto/dist/assets/device-DDl5XKvt.js +0 -2
  233. package/dist/owletto/dist/assets/device._deviceId-bNhTcops.js +0 -2
  234. package/dist/owletto/dist/assets/dynamic-schema-form-CRyUchXo.js +0 -2
  235. package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +0 -2
  236. package/dist/owletto/dist/assets/entity-pages-_nuesgnp.js +0 -2
  237. package/dist/owletto/dist/assets/entity-type-page-CkCSbkBx.js +0 -2
  238. package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +0 -2
  239. package/dist/owletto/dist/assets/events-feed-DcKTkJVe.js +0 -2
  240. package/dist/owletto/dist/assets/index-BUlkNJzX.js +0 -2
  241. package/dist/owletto/dist/assets/index-BoqrvLHQ.js +0 -7906
  242. package/dist/owletto/dist/assets/index-CA9mW_ZM.js +0 -2
  243. package/dist/owletto/dist/assets/index-CH0GzG4i.js +0 -2
  244. package/dist/owletto/dist/assets/index-CtI5Eomq.js +0 -2
  245. package/dist/owletto/dist/assets/index-DmtQ0bds.js +0 -2
  246. package/dist/owletto/dist/assets/index-Du_J8hnx.js +0 -2
  247. package/dist/owletto/dist/assets/index-Pae_f9LM.css +0 -1
  248. package/dist/owletto/dist/assets/index-XETZnN7L.js +0 -2
  249. package/dist/owletto/dist/assets/login-DG0b9uSC.js +0 -2
  250. package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +0 -74
  251. package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +0 -2
  252. package/dist/owletto/dist/assets/needs-you-list-3uMsWcDv.js +0 -2
  253. package/dist/owletto/dist/assets/new-AdGV6a8R.js +0 -2
  254. package/dist/owletto/dist/assets/new-BdtIhBpo.js +0 -2
  255. package/dist/owletto/dist/assets/new-BjGwX6s6.js +0 -2
  256. package/dist/owletto/dist/assets/new-D-iMjV74.js +0 -2
  257. package/dist/owletto/dist/assets/organization-qaIpEiQg.js +0 -2
  258. package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +0 -2
  259. package/dist/owletto/dist/assets/proposal-review-shell-C8ZfIAYn.js +0 -2
  260. package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +0 -2
  261. package/dist/owletto/dist/assets/record-session-BrM9cdXu.js +0 -2
  262. package/dist/owletto/dist/assets/run-initiator-BKSgI1o0.js +0 -2
  263. package/dist/owletto/dist/assets/runs-k2NpbZm8.js +0 -2
  264. package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +0 -2
  265. package/dist/owletto/dist/assets/schema-value-wjqGxXhv.js +0 -3
  266. package/dist/owletto/dist/assets/settings-V0m5Om5j.js +0 -2
  267. package/dist/owletto/dist/assets/source-record-panels-BMut9YIA.js +0 -2
  268. package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +0 -2
  269. package/dist/owletto/dist/assets/table-ZuYMOjVR.js +0 -2
  270. package/dist/owletto/dist/assets/view-card-DiHWlypr.js +0 -2
  271. package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +0 -2
  272. package/dist/owletto/dist/assets/views-access-required-HA-PiOwA.js +0 -2
@@ -3876,7 +3876,7 @@ export default class XConnector extends ConnectorRuntime {
3876
3876
  name: "X (Twitter)",
3877
3877
  description:
3878
3878
  "Fetches tweets, browser-visible like history, bookmarks, and DMs through the X API v2 or the paired Owletto Chrome extension, reads the chronological Following timeline live through the X API, captures notification references and the accounts you follow, reads and answers DMs live in the paired browser, and likes posts or follows accounts there. Links social actors into the person and company graph.",
3879
- version: "3.17.2",
3879
+ version: "3.18.0",
3880
3880
  faviconDomain: "x.com",
3881
3881
  browser: {
3882
3882
  origins: ["https://x.com", "https://twitter.com"],
@@ -4229,7 +4229,7 @@ export default class XConnector extends ConnectorRuntime {
4229
4229
  kind: "write",
4230
4230
  name: "Send DM reply",
4231
4231
  description:
4232
- "Requires an X connection authenticated through your paired Chrome browser. Send a text reply into an exact existing X direct message conversation and confirm it appears there. This direct send is approved only for answering DMs on bot accounts the owner operates; public replies and posts stay draft-only through prepare_reply. On retry, reuse both this input's idempotency_key and the enclosing operations.execute idempotency_key. The browser can recognise an earlier send only while its request ID is on the latest conversation page; matching recent text without a request ID is refused.",
4232
+ "Requires an X connection authenticated through your paired Chrome browser. Send a text reply into an exact existing X direct message conversation and confirm it appears there. This direct send is approved only for answering DMs on bot accounts the owner operates; public replies and posts stay draft-only through prepare_reply. Sends at most once per operation run: repeating operations.execute with the same idempotency_key returns that run's result instead of sending again. A run that fails because delivery is uncertain is not retried; check the conversation before starting a new send. The browser can recognise an earlier send only while its request ID is on the latest conversation page; matching recent text without a request ID is refused.",
4233
4233
  annotations: {
4234
4234
  destructiveHint: false,
4235
4235
  idempotentHint: false,
@@ -4237,7 +4237,7 @@ export default class XConnector extends ConnectorRuntime {
4237
4237
  },
4238
4238
  inputSchema: {
4239
4239
  type: "object",
4240
- required: ["conversation_id", "text", "idempotency_key"],
4240
+ required: ["conversation_id", "text"],
4241
4241
  additionalProperties: false,
4242
4242
  properties: {
4243
4243
  conversation_id: {
@@ -4246,13 +4246,11 @@ export default class XConnector extends ConnectorRuntime {
4246
4246
  description:
4247
4247
  "Exact X DM conversation ID, the conversation_id of a live_messages row.",
4248
4248
  },
4249
- text: { type: "string", minLength: 1, maxLength: 10000 },
4250
- idempotency_key: {
4249
+ text: {
4251
4250
  type: "string",
4252
4251
  minLength: 1,
4253
- maxLength: 200,
4254
- description:
4255
- "Stable key used to derive X's client request ID. Reuse it and the enclosing operation's idempotency_key on retry; browser deduplication only checks the latest conversation page.",
4252
+ maxLength: 10000,
4253
+ "x-multiline": true,
4256
4254
  },
4257
4255
  },
4258
4256
  },
@@ -4287,6 +4285,7 @@ export default class XConnector extends ConnectorRuntime {
4287
4285
  body: {
4288
4286
  type: "string",
4289
4287
  minLength: 1,
4288
+ "x-multiline": true,
4290
4289
  description:
4291
4290
  "Draft reply text, left in the composer for the user to edit/send. Deliberately uncapped: X counts URLs as 23 and CJK/emoji as 2, so a code-unit cap here would reject drafts X accepts. The action reports X's own verdict as submit_blocked.",
4292
4291
  },
@@ -4392,7 +4391,7 @@ export default class XConnector extends ConnectorRuntime {
4392
4391
  {
4393
4392
  conversation_id: ctx.input.conversation_id,
4394
4393
  text: ctx.input.text,
4395
- idempotency_key: ctx.input.idempotency_key,
4394
+ run_id: ctx.run.id,
4396
4395
  },
4397
4396
  accountId,
4398
4397
  );
@@ -0,0 +1,20 @@
1
+ -- migrate:up
2
+ -- lobu:no-quiesce — additive opt-in fields; existing authentication remains compatible.
3
+
4
+ ALTER TABLE public."user"
5
+ ADD COLUMN IF NOT EXISTS "twoFactorEnabled" boolean NOT NULL DEFAULT false;
6
+
7
+ CREATE TABLE IF NOT EXISTS public."twoFactor" (
8
+ id text PRIMARY KEY,
9
+ "userId" text NOT NULL UNIQUE REFERENCES public."user"(id) ON DELETE CASCADE,
10
+ secret text NOT NULL,
11
+ "backupCodes" text NOT NULL,
12
+ verified boolean NOT NULL DEFAULT false,
13
+ -- squawk-ignore prefer-bigint-over-int -- Better Auth counter is bounded by the ten-attempt lockout and resets after verification.
14
+ "failedVerificationCount" integer NOT NULL DEFAULT 0,
15
+ "lockedUntil" timestamptz NULL
16
+ );
17
+
18
+ -- migrate:down
19
+
20
+ -- Retain enrolled factors on rollback. Removing them would silently disable MFA.
@@ -0,0 +1,34 @@
1
+ -- migrate:up transaction:false
2
+ -- lobu:no-quiesce (additive index; old replicas keep using the live partial index)
3
+ --
4
+ -- Resource retirement preserves event access requirements. The read gate unions
5
+ -- live and retired resources, using a type index for each arm instead of scanning
6
+ -- every entity in the workspace. No row backfill is needed.
7
+ -- OPERATIONAL COST: two concurrent index-build scans of entities, without blocking
8
+ -- ordinary reads or writes. Only soft-deleted rows enter the new index.
9
+
10
+ -- Heal an invalid index left by an interrupted concurrent build before retrying.
11
+ DO $heal$
12
+ BEGIN
13
+ IF EXISTS (
14
+ SELECT 1
15
+ FROM pg_index i
16
+ JOIN pg_class c ON c.oid = i.indexrelid
17
+ JOIN pg_namespace n ON n.oid = c.relnamespace
18
+ WHERE n.nspname = 'public'
19
+ AND c.relname = 'idx_entities_retired_type_id'
20
+ AND NOT i.indisvalid
21
+ ) THEN
22
+ EXECUTE 'DROP INDEX public.idx_entities_retired_type_id';
23
+ END IF;
24
+ END
25
+ $heal$;
26
+
27
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_entities_retired_type_id
28
+ ON public.entities (entity_type_id)
29
+ WHERE deleted_at IS NOT NULL;
30
+
31
+ -- migrate:down transaction:false
32
+ -- lobu:no-quiesce (removes only the additive lookup index)
33
+
34
+ DROP INDEX CONCURRENTLY IF EXISTS public.idx_entities_retired_type_id;
@@ -0,0 +1,34 @@
1
+ -- migrate:up transaction:false
2
+ -- lobu:no-quiesce (additive index; existing replicas remain compatible)
3
+ --
4
+ -- Personal-memory classification must recognize retired owner identities too:
5
+ -- retirement revokes access instead of turning the resource into ordinary data.
6
+ -- Index only this reserved namespace, with no row backfill or API change.
7
+ -- OPERATIONAL COST: two concurrent index-build scans of entity_identities,
8
+ -- without blocking ordinary reads or writes. Only personal-owner rows enter it.
9
+
10
+ -- Heal an invalid index left by an interrupted concurrent build before retrying.
11
+ DO $heal$
12
+ BEGIN
13
+ IF EXISTS (
14
+ SELECT 1
15
+ FROM pg_index i
16
+ JOIN pg_class c ON c.oid = i.indexrelid
17
+ JOIN pg_namespace n ON n.oid = c.relnamespace
18
+ WHERE n.nspname = 'public'
19
+ AND c.relname = 'idx_entity_identities_personal_owner'
20
+ AND NOT i.indisvalid
21
+ ) THEN
22
+ EXECUTE 'DROP INDEX public.idx_entity_identities_personal_owner';
23
+ END IF;
24
+ END
25
+ $heal$;
26
+
27
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_entity_identities_personal_owner
28
+ ON public.entity_identities (organization_id, entity_id)
29
+ WHERE namespace = 'lobu_personal_memory_owner';
30
+
31
+ -- migrate:down transaction:false
32
+ -- lobu:no-quiesce (removes only the additive lookup index)
33
+
34
+ DROP INDEX CONCURRENTLY IF EXISTS public.idx_entity_identities_personal_owner;
@@ -0,0 +1,65 @@
1
+ -- migrate:up
2
+ -- lobu:no-quiesce (additive: old code never selects kind/note, its inserts default to 'grant', and its ON CONFLICT DO NOTHING has no index target)
3
+
4
+ -- A policy row is either a grant (narrowest matching grant decides, as before)
5
+ -- or a guardrail (every matching guardrail applies after the grant fold and can
6
+ -- only make the result stricter). Existing rows are grants; no backfill.
7
+ -- `note` is the human reason shown when the rule decides a held or blocked run.
8
+ ALTER TABLE write_approval_policies
9
+ ADD COLUMN IF NOT EXISTS kind text NOT NULL DEFAULT 'grant',
10
+ ADD COLUMN IF NOT EXISTS note text;
11
+
12
+ ALTER TABLE write_approval_policies
13
+ DROP CONSTRAINT IF EXISTS write_approval_policies_kind_check;
14
+ ALTER TABLE write_approval_policies
15
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
16
+ ADD CONSTRAINT write_approval_policies_kind_check
17
+ CHECK (kind IN ('grant', 'guardrail')) NOT VALID;
18
+ ALTER TABLE write_approval_policies
19
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
20
+ VALIDATE CONSTRAINT write_approval_policies_kind_check;
21
+
22
+ ALTER TABLE write_approval_policies
23
+ DROP CONSTRAINT IF EXISTS write_approval_policies_note_length;
24
+ ALTER TABLE write_approval_policies
25
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
26
+ ADD CONSTRAINT write_approval_policies_note_length
27
+ CHECK (note IS NULL OR char_length(note) BETWEEN 1 AND 280) NOT VALID;
28
+ ALTER TABLE write_approval_policies
29
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
30
+ VALIDATE CONSTRAINT write_approval_policies_note_length;
31
+
32
+ -- A grant and a guardrail may share one scope, so kind joins the identity.
33
+ -- squawk-ignore require-concurrent-index-deletion -- bounded policy configuration; replaced in the same transaction
34
+ DROP INDEX IF EXISTS write_approval_policies_scoped_identity;
35
+ -- squawk-ignore require-concurrent-index-creation -- bounded policy configuration; replaced in the same transaction
36
+ CREATE UNIQUE INDEX IF NOT EXISTS write_approval_policies_scoped_identity
37
+ ON write_approval_policies (
38
+ organization_id, resource_class, COALESCE(principal_kind, ''), COALESCE(principal_id, ''),
39
+ COALESCE(operation_key, ''), COALESCE(entity_type_slug, ''), COALESCE(field_path, ''),
40
+ COALESCE(entity_id, 0), COALESCE(target_agent_id, ''),
41
+ COALESCE(connector_key, ''), COALESCE(connection_id, 0), COALESCE(operation_category, ''),
42
+ kind
43
+ );
44
+
45
+ -- migrate:down
46
+ -- Rollback must not silently turn a guardrail into a grant or drop a note.
47
+ DO $$ BEGIN
48
+ IF EXISTS (SELECT 1 FROM write_approval_policies WHERE kind <> 'grant' OR note IS NOT NULL)
49
+ THEN RAISE EXCEPTION 'Remove guardrail policies and policy notes explicitly before rolling back';
50
+ END IF;
51
+ END $$;
52
+ -- squawk-ignore require-concurrent-index-deletion -- quiesced rollback, policy configuration only
53
+ DROP INDEX IF EXISTS write_approval_policies_scoped_identity;
54
+ -- squawk-ignore require-concurrent-index-creation -- quiesced rollback, policy configuration only
55
+ CREATE UNIQUE INDEX IF NOT EXISTS write_approval_policies_scoped_identity
56
+ ON write_approval_policies (
57
+ organization_id, resource_class, COALESCE(principal_kind, ''), COALESCE(principal_id, ''),
58
+ COALESCE(operation_key, ''), COALESCE(entity_type_slug, ''), COALESCE(field_path, ''),
59
+ COALESCE(entity_id, 0), COALESCE(target_agent_id, ''),
60
+ COALESCE(connector_key, ''), COALESCE(connection_id, 0), COALESCE(operation_category, '')
61
+ );
62
+ ALTER TABLE write_approval_policies DROP CONSTRAINT IF EXISTS write_approval_policies_note_length;
63
+ ALTER TABLE write_approval_policies DROP CONSTRAINT IF EXISTS write_approval_policies_kind_check;
64
+ -- squawk-ignore ban-drop-column -- rollback refuses while any guardrail or note exists
65
+ ALTER TABLE write_approval_policies DROP COLUMN IF EXISTS note, DROP COLUMN IF EXISTS kind;
@@ -0,0 +1,48 @@
1
+ -- migrate:up
2
+ -- lobu:no-quiesce (widens a CHECK only: old code never writes 'app', and an app rule stored mid-rollout reads as an org rule on an old pod, which can only tighten)
3
+
4
+ -- A connected app (an OAuth client or a PAT acting with no agent and no
5
+ -- Automation) is its own policy principal. Its key comes only from
6
+ -- deriveAppPrincipalId at the token boundary. Existing runs keep 'user'; no backfill.
7
+ ALTER TABLE runs
8
+ DROP CONSTRAINT IF EXISTS runs_policy_principal_kind_check;
9
+ ALTER TABLE runs
10
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
11
+ ADD CONSTRAINT runs_policy_principal_kind_check CHECK (
12
+ policy_principal_kind IS NULL
13
+ OR policy_principal_kind IN ('agent', 'automation', 'user', 'app')
14
+ ) NOT VALID;
15
+ ALTER TABLE runs
16
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
17
+ VALIDATE CONSTRAINT runs_policy_principal_kind_check;
18
+
19
+ -- write_approval_policies.principal_kind has no CHECK; its accepted values are
20
+ -- enforced by the policy writers.
21
+ COMMENT ON COLUMN write_approval_policies.principal_kind IS
22
+ 'NULL is the organization default; agent, automation or app selects a principal kind.';
23
+ COMMENT ON COLUMN write_approval_policies.principal_id IS
24
+ 'NULL with kind set means any principal of that kind; otherwise the specific agent id, Automation id, or app key (web:<domain>, client:<id>, local:<name>, pat:<id>).';
25
+
26
+ -- migrate:down
27
+ -- Rollback must not reinterpret app rules as organization rules or drop app runs.
28
+ DO $$ BEGIN
29
+ IF EXISTS (SELECT 1 FROM write_approval_policies WHERE principal_kind = 'app')
30
+ OR EXISTS (SELECT 1 FROM runs WHERE policy_principal_kind = 'app')
31
+ THEN RAISE EXCEPTION 'Remove app policies and app-requested runs explicitly before rolling back';
32
+ END IF;
33
+ END $$;
34
+ ALTER TABLE runs
35
+ DROP CONSTRAINT IF EXISTS runs_policy_principal_kind_check;
36
+ ALTER TABLE runs
37
+ -- squawk-ignore prefer-robust-stmts -- quiesced rollback
38
+ ADD CONSTRAINT runs_policy_principal_kind_check CHECK (
39
+ policy_principal_kind IS NULL
40
+ OR policy_principal_kind IN ('agent', 'automation', 'user')
41
+ ) NOT VALID;
42
+ ALTER TABLE runs
43
+ -- squawk-ignore prefer-robust-stmts -- quiesced rollback
44
+ VALIDATE CONSTRAINT runs_policy_principal_kind_check;
45
+ COMMENT ON COLUMN write_approval_policies.principal_kind IS
46
+ 'NULL is the organization default; agent or automation selects a principal kind.';
47
+ COMMENT ON COLUMN write_approval_policies.principal_id IS
48
+ 'NULL with kind set means any principal of that kind; otherwise the specific agent or Automation id.';
@@ -0,0 +1,57 @@
1
+ -- migrate:up
2
+ -- lobu:no-quiesce (data-only: rewrites existing policy values that running code already evaluates)
3
+
4
+ -- 20261015120000 seeds personal orgs with "All actions: Auto" at creation, but
5
+ -- personal orgs created before it still carry the old "Reads: Auto" seed, so
6
+ -- every non-read connector action (e.g. a browser navigate) waits for approval.
7
+ -- Move those orgs to the current default only when the seed is untouched: the
8
+ -- org's single connector rule is the unscoped read grant with no note, never
9
+ -- edited since creation, whose only effect is execute=auto. Any other connector
10
+ -- rule, scope, guardrail, note, edit, or effect means the owner customized the
11
+ -- policy, and it is left as is. Team orgs keep "Reads: Auto".
12
+ -- Cost: bounded configuration tables (hundreds of rows in prod); milliseconds.
13
+ WITH personal_org AS (
14
+ SELECT o.id
15
+ FROM organization o
16
+ WHERE pg_input_is_valid(o.metadata, 'jsonb')
17
+ -- Match readPersonalOrgOwnerId: only a nonempty string identifies a personal org.
18
+ AND jsonb_typeof(o.metadata::jsonb -> 'personal_org_for_user_id') = 'string'
19
+ AND o.metadata::jsonb ->> 'personal_org_for_user_id' <> ''
20
+ ),
21
+ untouched_seed AS (
22
+ SELECT min(p.id) AS policy_id
23
+ FROM write_approval_policies p
24
+ JOIN personal_org po ON po.id = p.organization_id
25
+ WHERE p.resource_class = 'connector_action'
26
+ GROUP BY p.organization_id
27
+ HAVING count(*) = 1
28
+ AND bool_and(
29
+ p.operation_category = 'read'
30
+ AND p.kind = 'grant'
31
+ AND p.note IS NULL
32
+ AND p.connector_key IS NULL
33
+ AND p.connection_id IS NULL
34
+ AND p.operation_key IS NULL
35
+ AND p.principal_kind IS NULL
36
+ AND p.principal_id IS NULL
37
+ AND p.target_agent_id IS NULL
38
+ AND p.entity_type_slug IS NULL
39
+ AND p.field_path IS NULL
40
+ AND p.entity_id IS NULL
41
+ AND p.updated_at <= p.created_at + interval '1 second'
42
+ )
43
+ )
44
+ UPDATE write_approval_policies w
45
+ SET operation_category = NULL, updated_at = now()
46
+ FROM untouched_seed s
47
+ WHERE w.id = s.policy_id
48
+ AND (SELECT count(*) FROM write_policy_action_effects e WHERE e.policy_id = w.id) = 1
49
+ AND EXISTS (
50
+ SELECT 1 FROM write_policy_action_effects e
51
+ WHERE e.policy_id = w.id AND e.action = 'execute' AND e.effect = 'auto'
52
+ );
53
+
54
+ -- migrate:down
55
+ -- No-op: after the backfill an org's "All actions: Auto" rule cannot be told
56
+ -- apart from one its owner chose, so reverting would silently narrow it.
57
+ SELECT 1;
@@ -0,0 +1,29 @@
1
+ -- migrate:up
2
+ -- lobu:no-quiesce (tightens a CHECK only: the precondition proves no stored slug violates it, and old code that tries to claim a newly reserved slug is refused, which is the intent)
3
+
4
+ -- Workspace slugs must avoid every name in RESERVED_PATHS (packages/core/src/reserved.ts).
5
+ -- The CHECK had drifted to a 19-name subset, so workspaces could take owner-route and
6
+ -- server-route names, and a workspace slugged after a top-level server route has its pages
7
+ -- shadowed by the server's response. integration/workspace/reserved-workspace-slugs.test.ts keeps the two in sync.
8
+ ALTER TABLE "organization"
9
+ DROP CONSTRAINT IF EXISTS org_slug_not_reserved;
10
+ ALTER TABLE "organization"
11
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
12
+ ADD CONSTRAINT org_slug_not_reserved CHECK (slug <> ALL (ARRAY[
13
+ 'activity', 'agents', 'connectors', 'data', 'memory', 'members', 'settings', 'events', 'automations', 'connections', 'sources', 'environments', 'infrastructure', 'inference-providers', 'devices', 'auth', 'api', 'inbox', 'templates', 'help', 'account', 'me', 'admin', 'health', 'login', 'logout', 'signup', 'register', 'contents', 'entity-types', 'www', 'mcp', 'static', 'assets', 'cdn', 'docs', 'mail', 'connector', 'oauth', 'orgs', 'slack', 'dashboard', 'connect', 'catalog', 'internal', 'mcp-apps'
14
+ ]::text[])) NOT VALID;
15
+ ALTER TABLE "organization"
16
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
17
+ VALIDATE CONSTRAINT org_slug_not_reserved;
18
+
19
+ -- migrate:down
20
+ ALTER TABLE "organization"
21
+ DROP CONSTRAINT IF EXISTS org_slug_not_reserved;
22
+ ALTER TABLE "organization"
23
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
24
+ ADD CONSTRAINT org_slug_not_reserved CHECK (slug <> ALL (ARRAY[
25
+ 'settings', 'auth', 'api', 'templates', 'help', 'account', 'admin', 'health', 'login', 'logout', 'signup', 'register', 'www', 'mcp', 'static', 'assets', 'cdn', 'docs', 'mail'
26
+ ]::text[])) NOT VALID;
27
+ ALTER TABLE "organization"
28
+ -- squawk-ignore prefer-robust-stmts -- the migration runner owns the transaction
29
+ VALIDATE CONSTRAINT org_slug_not_reserved;
@@ -0,0 +1,69 @@
1
+ -- migrate:up
2
+ -- lobu:quiesce old view writers accept a workspace view key that is a reserved app route or a live entity type slug, and the new /<key> route cannot serve either
3
+
4
+ -- A workspace view (one whose attach list holds {"workspace": true}) is served at
5
+ -- /<org>/<key>, the same path as an entity type's list page. So within one
6
+ -- organization a workspace view key must never equal a live entity type slug.
7
+ -- Both sides are guarded here rather than in app code because entity types have
8
+ -- several writers (schema tool, restores, system types, migrations).
9
+ --
10
+ -- Each guard takes one per-organization advisory lock before it checks the other
11
+ -- table, so a view write and an entity type write racing on the same name
12
+ -- serialize and the second one sees the first. The guard raises unique_violation
13
+ -- with a named constraint so callers map it by structure (isUniqueViolation).
14
+ CREATE OR REPLACE FUNCTION lobu_workspace_path_lock(org text) RETURNS void
15
+ LANGUAGE sql AS $$ SELECT pg_advisory_xact_lock(hashtextextended('workspace_path:' || org, 0)) $$;
16
+
17
+ CREATE OR REPLACE FUNCTION lobu_guard_workspace_view_path() RETURNS trigger LANGUAGE plpgsql AS $$
18
+ BEGIN
19
+ IF NOT (NEW.attach @> '[{"workspace": true}]'::jsonb) THEN
20
+ RETURN NEW;
21
+ END IF;
22
+ IF TG_OP = 'UPDATE' AND OLD.attach @> '[{"workspace": true}]'::jsonb
23
+ AND OLD.key = NEW.key AND OLD.organization_id = NEW.organization_id THEN
24
+ RETURN NEW;
25
+ END IF;
26
+ PERFORM lobu_workspace_path_lock(NEW.organization_id);
27
+ IF EXISTS (SELECT 1 FROM entity_types
28
+ WHERE organization_id = NEW.organization_id AND slug = NEW.key AND deleted_at IS NULL) THEN
29
+ RAISE EXCEPTION 'Workspace view "%" would share /%, the path of the entity type with that slug; rename the view or the type', NEW.key, NEW.key
30
+ USING ERRCODE = 'unique_violation', CONSTRAINT = 'workspace_path_unique';
31
+ END IF;
32
+ RETURN NEW;
33
+ END $$;
34
+
35
+ CREATE OR REPLACE FUNCTION lobu_guard_entity_type_workspace_path() RETURNS trigger LANGUAGE plpgsql AS $$
36
+ BEGIN
37
+ IF NEW.organization_id IS NULL OR NEW.deleted_at IS NOT NULL THEN
38
+ RETURN NEW;
39
+ END IF;
40
+ IF TG_OP = 'UPDATE' AND OLD.deleted_at IS NULL
41
+ AND OLD.slug = NEW.slug AND OLD.organization_id IS NOT DISTINCT FROM NEW.organization_id THEN
42
+ RETURN NEW;
43
+ END IF;
44
+ PERFORM lobu_workspace_path_lock(NEW.organization_id);
45
+ IF EXISTS (SELECT 1 FROM views
46
+ WHERE organization_id = NEW.organization_id AND key = NEW.slug
47
+ AND attach @> '[{"workspace": true}]'::jsonb) THEN
48
+ RAISE EXCEPTION 'Entity type "%" would share /%, the path of the workspace view with that key; rename the view or the type', NEW.slug, NEW.slug
49
+ USING ERRCODE = 'unique_violation', CONSTRAINT = 'workspace_path_unique';
50
+ END IF;
51
+ RETURN NEW;
52
+ END $$;
53
+
54
+ DROP TRIGGER IF EXISTS views_workspace_path_guard ON views;
55
+ CREATE TRIGGER views_workspace_path_guard
56
+ BEFORE INSERT OR UPDATE OF key, attach, organization_id ON views
57
+ FOR EACH ROW EXECUTE FUNCTION lobu_guard_workspace_view_path();
58
+
59
+ DROP TRIGGER IF EXISTS entity_types_workspace_path_guard ON entity_types;
60
+ CREATE TRIGGER entity_types_workspace_path_guard
61
+ BEFORE INSERT OR UPDATE OF slug, deleted_at, organization_id ON entity_types
62
+ FOR EACH ROW EXECUTE FUNCTION lobu_guard_entity_type_workspace_path();
63
+
64
+ -- migrate:down
65
+ DROP TRIGGER IF EXISTS views_workspace_path_guard ON views;
66
+ DROP TRIGGER IF EXISTS entity_types_workspace_path_guard ON entity_types;
67
+ DROP FUNCTION IF EXISTS lobu_guard_workspace_view_path();
68
+ DROP FUNCTION IF EXISTS lobu_guard_entity_type_workspace_path();
69
+ DROP FUNCTION IF EXISTS lobu_workspace_path_lock(text);
@@ -0,0 +1,14 @@
1
+ -- A workspace already holding a newly reserved slug must be renamed by its owner
2
+ -- (Workspace settings) before this deploy; the migration's VALIDATE would fail on it.
3
+ -- Fresh installs run preconditions before their baseline tables exist.
4
+ DO $reserved_slugs$
5
+ BEGIN
6
+ IF to_regclass('public.organization') IS NOT NULL THEN
7
+ IF EXISTS (SELECT 1 FROM public.organization WHERE slug = ANY (ARRAY[
8
+ 'activity', 'agents', 'connectors', 'data', 'memory', 'members', 'settings', 'events', 'automations', 'connections', 'sources', 'environments', 'infrastructure', 'inference-providers', 'devices', 'auth', 'api', 'inbox', 'templates', 'help', 'account', 'me', 'admin', 'health', 'login', 'logout', 'signup', 'register', 'contents', 'entity-types', 'www', 'mcp', 'static', 'assets', 'cdn', 'docs', 'mail', 'connector', 'oauth', 'orgs', 'slack', 'dashboard', 'connect', 'catalog', 'internal', 'mcp-apps'
9
+ ]::text[])) THEN
10
+ RAISE EXCEPTION 'A workspace uses a reserved slug; its owner must rename it in workspace settings before upgrading (docs/MIGRATIONS.md). List them with: SELECT id, slug, name FROM organization WHERE slug = ANY (ARRAY[''activity'', ''agents'', ''connectors'', ''data'', ''memory'', ''members'', ''settings'', ''events'', ''automations'', ''connections'', ''sources'', ''environments'', ''infrastructure'', ''inference-providers'', ''devices'', ''auth'', ''api'', ''inbox'', ''templates'', ''help'', ''account'', ''me'', ''admin'', ''health'', ''login'', ''logout'', ''signup'', ''register'', ''contents'', ''entity-types'', ''www'', ''mcp'', ''static'', ''assets'', ''cdn'', ''docs'', ''mail'', ''connector'', ''oauth'', ''orgs'', ''slack'', ''dashboard'', ''connect'', ''catalog'', ''internal'', ''mcp-apps'']::text[])';
11
+ END IF;
12
+ END IF;
13
+ END
14
+ $reserved_slugs$;
@@ -0,0 +1,21 @@
1
+ -- Workspace views move to /<org>/<key>, the path an entity type's list page
2
+ -- uses. A workspace view whose key equals a live entity type slug, or a name
3
+ -- reserved for app routes (RESERVED_ENTITY_TYPE_SLUGS in
4
+ -- packages/core/src/reserved.ts), would be unreachable there. Rename the view
5
+ -- (manage_views set with a new key, then delete the old one) before upgrading.
6
+ -- Fresh installs run preconditions before their baseline tables exist.
7
+ DO $workspace_view_paths$
8
+ BEGIN
9
+ IF to_regclass('public.views') IS NOT NULL AND to_regclass('public.entity_types') IS NOT NULL THEN
10
+ IF EXISTS (
11
+ SELECT 1 FROM public.views v
12
+ WHERE v.attach @> '[{"workspace": true}]'::jsonb
13
+ AND (v.key = ANY (ARRAY['activity', 'agents', 'connectors', 'data', 'memory', 'members', 'settings', 'events', 'automations', 'connections', 'sources', 'environments', 'infrastructure', 'inference-providers', 'devices', 'entity-types', 'recent', 'chat', 'views', 'organization', 'user', 'automation', 'content', 'source', 'connector']::text[])
14
+ OR EXISTS (SELECT 1 FROM public.entity_types et
15
+ WHERE et.organization_id = v.organization_id AND et.slug = v.key AND et.deleted_at IS NULL))
16
+ ) THEN
17
+ RAISE EXCEPTION 'A workspace view key clashes with an entity type slug or a reserved app route; rename the view before upgrading (docs/MIGRATIONS.md). List them with: SELECT v.organization_id, v.key FROM views v WHERE v.attach @> ''[{"workspace": true}]''::jsonb AND (v.key = ANY (ARRAY[''activity'', ''agents'', ''connectors'', ''data'', ''memory'', ''members'', ''settings'', ''events'', ''automations'', ''connections'', ''sources'', ''environments'', ''infrastructure'', ''inference-providers'', ''devices'', ''entity-types'', ''recent'', ''chat'', ''views'', ''organization'', ''user'', ''automation'', ''content'', ''source'', ''connector'']::text[]) OR EXISTS (SELECT 1 FROM entity_types et WHERE et.organization_id = v.organization_id AND et.slug = v.key AND et.deleted_at IS NULL))';
18
+ END IF;
19
+ END IF;
20
+ END
21
+ $workspace_view_paths$;