@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
@@ -21,6 +21,7 @@ import {
21
21
  type SyncContext,
22
22
  type SyncResult,
23
23
  } from '@lobu/connector-sdk';
24
+ import { type SourceFileAttachment, sourceFileAttachment } from './source-file-attachment';
24
25
 
25
26
  // ---------------------------------------------------------------------------
26
27
  // Microsoft Graph API types
@@ -57,6 +58,8 @@ interface GraphMessage {
57
58
  isRead: boolean;
58
59
  webLink: string;
59
60
  parentFolderId: string;
61
+ /** Expanded on the feed's list call, metadata only (never `contentBytes`). */
62
+ attachments?: GraphAttachment[];
60
63
  }
61
64
 
62
65
  interface GraphEvent {
@@ -119,6 +122,33 @@ function formatRecipients(
119
122
  return recipients.map((r) => r.emailAddress.name || r.emailAddress.address).join(', ');
120
123
  }
121
124
 
125
+ const FILE_ATTACHMENT_TYPE = '#microsoft.graph.fileAttachment';
126
+
127
+ /**
128
+ * The files a message carries, kept in Outlook: each entry names the message
129
+ * and attachment that download_attachment fetches when someone opens it.
130
+ * Inline parts (a signature image the body draws) are not files, and only a
131
+ * file attachment has bytes to fetch; a reference attachment is a cloud link
132
+ * and an item attachment is an embedded message.
133
+ */
134
+ function messageFileAttachments(message: GraphMessage): SourceFileAttachment[] {
135
+ return (message.attachments ?? [])
136
+ .filter(
137
+ (attachment) =>
138
+ !attachment.isInline &&
139
+ (attachment['@odata.type'] ?? FILE_ATTACHMENT_TYPE) === FILE_ATTACHMENT_TYPE
140
+ )
141
+ .map((attachment) =>
142
+ sourceFileAttachment({
143
+ filename: attachment.name ?? attachment.id,
144
+ mimeType: attachment.contentType ?? 'application/octet-stream',
145
+ sizeBytes: attachment.size,
146
+ operation: 'download_attachment',
147
+ input: { message_id: message.id, attachment_id: attachment.id },
148
+ })
149
+ );
150
+ }
151
+
122
152
  // ---------------------------------------------------------------------------
123
153
  // Connector
124
154
  // ---------------------------------------------------------------------------
@@ -262,7 +292,7 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
262
292
  kind: 'read',
263
293
  name: 'List Attachments',
264
294
  description:
265
- "List a message's attachments with their IDs, names, types and sizes. The feed only reports `has_attachments`, so this is how an agent learns what to download.",
295
+ "List a message's attachments with their IDs, names, types and sizes, including inline images and cloud links the feed's file list leaves out. Use it to learn what to download.",
266
296
  requiredScopes: ['Mail.Read'],
267
297
  inputSchema: {
268
298
  type: 'object',
@@ -278,6 +308,7 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
278
308
  download_attachment: {
279
309
  key: 'download_attachment',
280
310
  kind: 'read',
311
+ outputFiles: 'source-copy',
281
312
  name: 'Download Attachment',
282
313
  description:
283
314
  'Download one attachment from an Outlook message. The bytes are published as an attachment with a `download_url` a device can fetch, and small text files are ALSO returned inline as `content`. Get `attachment_id` from `list_attachments`.',
@@ -484,29 +515,36 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
484
515
  `?$top=${this.PAGE_SIZE}` +
485
516
  '&$orderby=receivedDateTime desc' +
486
517
  `&$filter=receivedDateTime ge ${window.start} and receivedDateTime lt ${window.end}` +
487
- '&$select=id,conversationId,subject,bodyPreview,from,toRecipients,ccRecipients,receivedDateTime,sentDateTime,hasAttachments,importance,isRead,webLink';
518
+ '&$select=id,conversationId,subject,bodyPreview,from,toRecipients,ccRecipients,receivedDateTime,sentDateTime,hasAttachments,importance,isRead,webLink' +
519
+ // Attachment names ride on the page itself: one request per page, not
520
+ // one per message, and the selected fields leave the bytes behind.
521
+ '&$expand=attachments($select=id,name,contentType,size,isInline)';
488
522
 
489
523
  return this.walkPages<GraphMessage>(ctx, http, {
490
524
  window,
491
525
  firstUrl,
492
526
  maxResults: (config.max_results as number) ?? 50,
493
- toEvent: (msg) => ({
494
- origin_id: `outlook_msg_${msg.id}`,
495
- title: msg.subject,
496
- payload_text: msg.bodyPreview || msg.subject,
497
- author_name: msg.from?.emailAddress?.name || msg.from?.emailAddress?.address,
498
- source_url: msg.webLink,
499
- occurred_at: new Date(msg.receivedDateTime),
500
- origin_type: 'email',
501
- metadata: {
502
- from: msg.from?.emailAddress?.address,
503
- to: formatRecipients(msg.toRecipients ?? []),
504
- cc: formatRecipients(msg.ccRecipients ?? []),
505
- importance: msg.importance,
506
- has_attachments: msg.hasAttachments,
507
- is_read: msg.isRead,
508
- },
509
- }),
527
+ toEvent: (msg) => {
528
+ const attachments = messageFileAttachments(msg);
529
+ return {
530
+ origin_id: `outlook_msg_${msg.id}`,
531
+ title: msg.subject,
532
+ payload_text: msg.bodyPreview || msg.subject,
533
+ ...(attachments.length > 0 ? { attachments } : {}),
534
+ author_name: msg.from?.emailAddress?.name || msg.from?.emailAddress?.address,
535
+ source_url: msg.webLink,
536
+ occurred_at: new Date(msg.receivedDateTime),
537
+ origin_type: 'email',
538
+ metadata: {
539
+ from: msg.from?.emailAddress?.address,
540
+ to: formatRecipients(msg.toRecipients ?? []),
541
+ cc: formatRecipients(msg.ccRecipients ?? []),
542
+ importance: msg.importance,
543
+ has_attachments: msg.hasAttachments,
544
+ is_read: msg.isRead,
545
+ },
546
+ };
547
+ },
510
548
  // The next window starts where this one ended.
511
549
  completed: { last_sync_at: window.end },
512
550
  });
@@ -2,14 +2,25 @@
2
2
  * RSS / Atom Connector (V1 runtime)
3
3
  *
4
4
  * Fetches and parses RSS 2.0 and Atom feeds. Supports multiple feed URLs,
5
- * deduplication via checkpoint, and HTML entity decoding.
5
+ * deduplication via checkpoint, and HTML entity decoding. Sync stores only
6
+ * items it has not seen before; a source read returns the feed's current items
7
+ * in document order, which is the only way to see what a ranking-style feed
8
+ * (trending lists, charts) lists right now.
6
9
  * No external XML parsing dependencies — uses regex-based parsing.
7
10
  */
8
11
 
9
12
  import {
13
+ assertNoMatch,
14
+ assertNoOffsetPaging,
15
+ assertNoQuery,
16
+ assertNoSort,
17
+ assertNoWindow,
18
+ assertPositiveReadLimit,
10
19
  type RuntimeConnectorDefinition,
11
20
  ConnectorRuntime,
12
21
  type EventEnvelope,
22
+ type FeedReadContext,
23
+ type FeedReadResult,
13
24
  type SyncContext,
14
25
  type SyncResult,
15
26
  validatePublicUrl,
@@ -25,8 +36,18 @@ interface RSSFeedItem {
25
36
  link: string;
26
37
  content: string;
27
38
  author: string;
28
- publishedAt: Date;
39
+ /** Null when the source states no (parseable) publication time. */
40
+ publishedAt: Date | null;
29
41
  feedUrl: string;
42
+ /** 1-based position of the item in its feed document. */
43
+ position: number;
44
+ /** Channel-level pubDate/lastBuildDate (RSS) or feed `updated` (Atom). */
45
+ feedPublishedAt: Date | null;
46
+ }
47
+
48
+ interface FeedFetchError {
49
+ url: string;
50
+ error: string;
30
51
  }
31
52
 
32
53
  interface RSSCheckpoint {
@@ -48,7 +69,7 @@ export default class RSSConnector extends ConnectorRuntime {
48
69
  key: 'rss',
49
70
  name: 'RSS / Atom',
50
71
  description: 'Fetches and parses RSS 2.0 and Atom feeds to collect articles.',
51
- version: '1.0.1',
72
+ version: '1.1.0',
52
73
  faviconDomain: 'rss.com',
53
74
  authSchema: {
54
75
  methods: [{ type: 'none' }],
@@ -58,7 +79,9 @@ export default class RSSConnector extends ConnectorRuntime {
58
79
  key: 'articles',
59
80
  name: 'Feed Articles',
60
81
  sync: (ctx) => this.syncFeed(ctx),
61
- description: 'Articles from RSS/Atom feeds.',
82
+ read: (ctx) => this.readFeed(ctx),
83
+ description:
84
+ 'Articles from RSS/Atom feeds. Sync stores items not seen before; a source read returns every item the feed lists right now, in document order.',
62
85
  configSchema: {
63
86
  type: 'object',
64
87
  required: ['feed_urls'],
@@ -107,43 +130,31 @@ export default class RSSConnector extends ConnectorRuntime {
107
130
 
108
131
  private async syncFeed(ctx: SyncContext): Promise<SyncResult> {
109
132
  const config = ctx.config as unknown as RSSConfig;
110
- const feedUrls = config.feed_urls;
111
- if (!feedUrls || !Array.isArray(feedUrls) || feedUrls.length === 0) {
112
- throw new Error('feed_urls is required and must be a non-empty array.');
113
- }
114
-
115
- const maxItemsPerFeed = config.max_items_per_feed ?? 100;
133
+ const feedUrls = this.requireFeedUrls(config);
116
134
  const checkpoint = (ctx.checkpoint as RSSCheckpoint | null) ?? {
117
135
  last_item_ids: [],
118
136
  };
119
137
  const seenIds = new Set<string>(checkpoint.last_item_ids ?? []);
120
138
 
121
- const allItems: RSSFeedItem[] = [];
122
- const fetchErrors: Array<{ url: string; error: string }> = [];
123
-
124
- for (const feedUrl of feedUrls) {
125
- try {
126
- const items = await this.fetchAndParseFeed(feedUrl, maxItemsPerFeed);
127
- allItems.push(...items);
128
- } catch (err) {
129
- fetchErrors.push({
130
- url: feedUrl,
131
- error: err instanceof Error ? err.message : String(err),
132
- });
133
- }
134
- }
139
+ const { items: allItems, fetchErrors } = await this.fetchFeeds(
140
+ feedUrls,
141
+ config.max_items_per_feed ?? 100
142
+ );
135
143
 
136
144
  // A run where every configured feed failed must fail — a "completed" run
137
145
  // with 0 items is indistinguishable from a genuinely empty feed.
138
146
  if (fetchErrors.length === feedUrls.length) {
139
147
  throw new Error(
140
- `All ${feedUrls.length} feed URL(s) failed to fetch: ` +
141
- fetchErrors.map((e) => `${e.url} (${e.error})`).join('; ')
148
+ `All ${feedUrls.length} feed URL(s) failed to fetch: ${this.describeErrors(fetchErrors)}`
142
149
  );
143
150
  }
144
151
 
152
+ // Items without a stated publication time are stamped with the fetch time.
153
+ const fetchedAt = new Date();
154
+ const occurredAt = (item: RSSFeedItem) => item.publishedAt ?? fetchedAt;
155
+
145
156
  // Sort by occurred_at descending
146
- allItems.sort((a, b) => b.publishedAt.getTime() - a.publishedAt.getTime());
157
+ allItems.sort((a, b) => occurredAt(b).getTime() - occurredAt(a).getTime());
147
158
 
148
159
  // Deduplicate against checkpoint
149
160
  const events: EventEnvelope[] = [];
@@ -161,7 +172,7 @@ export default class RSSConnector extends ConnectorRuntime {
161
172
  payload_text: item.content,
162
173
  author_name: item.author || undefined,
163
174
  source_url: item.link || undefined,
164
- occurred_at: item.publishedAt,
175
+ occurred_at: occurredAt(item),
165
176
  origin_type: 'article',
166
177
  metadata: {
167
178
  feed_url: item.feedUrl,
@@ -197,6 +208,125 @@ export default class RSSConnector extends ConnectorRuntime {
197
208
  };
198
209
  }
199
210
 
211
+ // -------------------------------------------------------------------------
212
+ // read
213
+ // -------------------------------------------------------------------------
214
+
215
+ /**
216
+ * Live snapshot of what the configured feeds list right now. Unlike sync,
217
+ * nothing is dropped for having been seen before and no sync item cap
218
+ * applies, so an item that stays on a ranking feed for days appears in every
219
+ * read. Fails closed when any feed URL fails: a snapshot missing one feed is
220
+ * not the current contents.
221
+ *
222
+ * Pages continue with a connector cursor carrying the next position and a
223
+ * SHA-256 of every returned row. Every page refetches the feed, so a feed that
224
+ * changed between pages fails the read instead of mixing two editions.
225
+ */
226
+ private async readFeed(ctx: FeedReadContext): Promise<FeedReadResult> {
227
+ const unsupported =
228
+ 'RSS source reads return the whole current feed in document order; they do not support';
229
+ assertNoQuery(ctx, `${unsupported} queries`);
230
+ assertNoSort(ctx, `${unsupported} sorting`);
231
+ assertNoWindow(ctx, `${unsupported} time windows`);
232
+ assertNoMatch(ctx, `${unsupported} exact-match filters`);
233
+ assertNoOffsetPaging(ctx, `${unsupported} offsets; continue with the returned cursor`);
234
+ assertPositiveReadLimit(ctx);
235
+
236
+ const config = ctx.config as unknown as RSSConfig;
237
+ const feedUrls = this.requireFeedUrls(config);
238
+ const { items, fetchErrors } = await this.fetchFeeds(feedUrls, Number.POSITIVE_INFINITY);
239
+ if (fetchErrors.length > 0) {
240
+ throw new Error(
241
+ `${fetchErrors.length} of ${feedUrls.length} feed URL(s) failed to fetch: ${this.describeErrors(fetchErrors)}`
242
+ );
243
+ }
244
+
245
+ const allRows = items.map((item) => ({
246
+ id: item.id,
247
+ title: item.title,
248
+ link: item.link || null,
249
+ content: item.content,
250
+ author: item.author || null,
251
+ published_at: item.publishedAt?.toISOString() ?? null,
252
+ feed_url: item.feedUrl,
253
+ position: item.position,
254
+ feed_published_at: item.feedPublishedAt?.toISOString() ?? null,
255
+ }));
256
+ // Covers every returned field, so an edition that keeps item ids but
257
+ // changes content or dates still invalidates an earlier page's cursor.
258
+ const fingerprint = await this.sha256Hex(JSON.stringify(allRows));
259
+ const start = ctx.cursor ? this.decodeReadCursor(ctx.cursor, fingerprint) : 0;
260
+ const end = Math.min(allRows.length, start + (ctx.limit ?? allRows.length));
261
+ const rows = allRows.slice(start, end);
262
+
263
+ return {
264
+ rows,
265
+ columns: [
266
+ { name: 'id', type: 'string' },
267
+ { name: 'title', type: 'string' },
268
+ { name: 'link', type: 'string' },
269
+ { name: 'content', type: 'string' },
270
+ { name: 'author', type: 'string' },
271
+ { name: 'published_at', type: 'timestamp' },
272
+ { name: 'feed_url', type: 'string' },
273
+ { name: 'position', type: 'integer' },
274
+ { name: 'feed_published_at', type: 'timestamp' },
275
+ ],
276
+ total: allRows.length,
277
+ ...(end < allRows.length ? { nextCursor: `${end}.${fingerprint}` } : { hasMore: false }),
278
+ };
279
+ }
280
+
281
+ private async sha256Hex(value: string): Promise<string> {
282
+ const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(value));
283
+ return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, '0')).join('');
284
+ }
285
+
286
+ /** Resume position from a read cursor; rejects a cursor from another edition. */
287
+ private decodeReadCursor(cursor: string, fingerprint: string): number {
288
+ const separator = cursor.indexOf('.');
289
+ const position = Number(cursor.slice(0, separator));
290
+ if (separator < 1 || !Number.isSafeInteger(position) || position < 1) {
291
+ throw new Error('Invalid RSS read cursor');
292
+ }
293
+ if (cursor.slice(separator + 1) !== fingerprint) {
294
+ throw new Error('The feed changed since the previous page; restart the read from the first page');
295
+ }
296
+ return position;
297
+ }
298
+
299
+ private requireFeedUrls(config: RSSConfig): string[] {
300
+ const feedUrls = config.feed_urls;
301
+ if (!feedUrls || !Array.isArray(feedUrls) || feedUrls.length === 0) {
302
+ throw new Error('feed_urls is required and must be a non-empty array.');
303
+ }
304
+ return feedUrls;
305
+ }
306
+
307
+ private async fetchFeeds(
308
+ feedUrls: string[],
309
+ maxItemsPerFeed: number
310
+ ): Promise<{ items: RSSFeedItem[]; fetchErrors: FeedFetchError[] }> {
311
+ const items: RSSFeedItem[] = [];
312
+ const fetchErrors: FeedFetchError[] = [];
313
+ for (const feedUrl of feedUrls) {
314
+ try {
315
+ items.push(...(await this.fetchAndParseFeed(feedUrl, maxItemsPerFeed)));
316
+ } catch (err) {
317
+ fetchErrors.push({
318
+ url: feedUrl,
319
+ error: err instanceof Error ? err.message : String(err),
320
+ });
321
+ }
322
+ }
323
+ return { items, fetchErrors };
324
+ }
325
+
326
+ private describeErrors(fetchErrors: FeedFetchError[]): string {
327
+ return fetchErrors.map((e) => `${e.url} (${e.error})`).join('; ');
328
+ }
329
+
200
330
  // -------------------------------------------------------------------------
201
331
  // execute
202
332
  // -------------------------------------------------------------------------
@@ -250,6 +380,10 @@ export default class RSSConnector extends ConnectorRuntime {
250
380
 
251
381
  private parseRSS(xml: string, feedUrl: string, maxItems: number): RSSFeedItem[] {
252
382
  const items: RSSFeedItem[] = [];
383
+ const channelHeader = this.headerBefore(xml, 'item');
384
+ const channelDate =
385
+ this.extractTag(channelHeader, 'pubDate') ?? this.extractTag(channelHeader, 'lastBuildDate');
386
+ const feedPublishedAt = channelDate ? this.parseDate(channelDate) : null;
253
387
  const itemRegex = /<item[\s>]([\s\S]*?)<\/item>/gi;
254
388
  let match: RegExpExecArray | null;
255
389
 
@@ -268,7 +402,7 @@ export default class RSSConnector extends ConnectorRuntime {
268
402
  const id = guid || this.hashString(`${title ?? ''}|${link ?? ''}`);
269
403
  const content = contentEncoded || description || '';
270
404
 
271
- const publishedAt = pubDate ? this.parseDate(pubDate) : new Date();
405
+ const publishedAt = pubDate ? this.parseDate(pubDate) : null;
272
406
 
273
407
  items.push({
274
408
  id,
@@ -278,6 +412,8 @@ export default class RSSConnector extends ConnectorRuntime {
278
412
  author: this.decodeEntities(this.stripHtml(author)),
279
413
  publishedAt,
280
414
  feedUrl,
415
+ position: items.length + 1,
416
+ feedPublishedAt,
281
417
  });
282
418
  }
283
419
 
@@ -290,6 +426,8 @@ export default class RSSConnector extends ConnectorRuntime {
290
426
 
291
427
  private parseAtom(xml: string, feedUrl: string, maxItems: number): RSSFeedItem[] {
292
428
  const items: RSSFeedItem[] = [];
429
+ const feedUpdated = this.extractTag(this.headerBefore(xml, 'entry'), 'updated');
430
+ const feedPublishedAt = feedUpdated ? this.parseDate(feedUpdated) : null;
293
431
  const entryRegex = /<entry[\s>]([\s\S]*?)<\/entry>/gi;
294
432
  let match: RegExpExecArray | null;
295
433
 
@@ -305,7 +443,7 @@ export default class RSSConnector extends ConnectorRuntime {
305
443
  const author = this.extractAtomAuthor(block);
306
444
 
307
445
  const externalId = id || this.hashString(`${title ?? ''}|${link ?? ''}`);
308
- const publishedAt = published ? this.parseDate(published) : new Date();
446
+ const publishedAt = published ? this.parseDate(published) : null;
309
447
 
310
448
  items.push({
311
449
  id: externalId,
@@ -315,6 +453,8 @@ export default class RSSConnector extends ConnectorRuntime {
315
453
  author: this.decodeEntities(this.stripHtml(author)),
316
454
  publishedAt,
317
455
  feedUrl,
456
+ position: items.length + 1,
457
+ feedPublishedAt,
318
458
  });
319
459
  }
320
460
 
@@ -325,6 +465,12 @@ export default class RSSConnector extends ConnectorRuntime {
325
465
  // XML extraction helpers
326
466
  // -------------------------------------------------------------------------
327
467
 
468
+ /** The document up to its first `<tagName>` element: the channel/feed header. */
469
+ private headerBefore(xml: string, tagName: string): string {
470
+ const match = new RegExp(`<${tagName}[\\s>]`, 'i').exec(xml);
471
+ return match ? xml.slice(0, match.index) : xml;
472
+ }
473
+
328
474
  /** Extract text content from an XML tag. Handles CDATA and regular text. */
329
475
  private extractTag(block: string, tagName: string): string | null {
330
476
  // Try CDATA first
@@ -447,10 +593,10 @@ export default class RSSConnector extends ConnectorRuntime {
447
593
  .trim();
448
594
  }
449
595
 
450
- /** Parse a date string, falling back to current time. */
451
- private parseDate(dateStr: string): Date {
596
+ /** Parse a date string; null when it is not a valid date. */
597
+ private parseDate(dateStr: string): Date | null {
452
598
  const parsed = new Date(dateStr);
453
- return Number.isNaN(parsed.getTime()) ? new Date() : parsed;
599
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
454
600
  }
455
601
 
456
602
  /** Simple hash of a string, returned as a hex string. */
@@ -31,6 +31,7 @@ import {
31
31
  IntegrationConnector,
32
32
  } from "@lobu/connector-sdk";
33
33
  import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
34
+ import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
34
35
 
35
36
  /**
36
37
  * Bot scopes requested by `/slack/install`. The Slack manifest does not drive
@@ -84,6 +85,7 @@ export default class SlackConnector extends IntegrationConnector {
84
85
  "Connect a Slack workspace to Lobu. Mention the bot, DM it, or run /lobu in any channel to drive a sandboxed agent.",
85
86
  version: "1.0.0",
86
87
  automationEvents: CHAT_AUTOMATION_EVENTS,
88
+ actions: CHAT_TRANSPORT_ACTIONS,
87
89
  faviconDomain: "slack.com",
88
90
  webhook: {
89
91
  // App-level delivery: one webhook is configured ONCE on the Slack app, and
@@ -0,0 +1,46 @@
1
+ /**
2
+ * An event attachment that stays in its source.
3
+ *
4
+ * A feed that sees a file (a mail attachment, a Drive file) records it on the
5
+ * event as metadata only: no bytes, no artifact, no download URL. `open` names
6
+ * the connection's own read operation and the input that fetches this one
7
+ * file, so the app can run it on demand through `operations.execute` (normal
8
+ * connector policy applies) and show the short-lived file it publishes.
9
+ *
10
+ * Every value in `open.input` must be a string or a number, because the event
11
+ * row stores it verbatim and the app passes it back unchanged.
12
+ */
13
+ export interface SourceFileAttachment {
14
+ kind: 'image' | 'audio' | 'video' | 'file';
15
+ filename: string;
16
+ mime_type: string;
17
+ size_bytes?: number;
18
+ open: { operation: string; input: Record<string, string | number> };
19
+ }
20
+
21
+ export function sourceFileAttachment(file: {
22
+ filename: string;
23
+ mimeType: string;
24
+ sizeBytes?: number;
25
+ operation: string;
26
+ input: Record<string, string | number>;
27
+ }): SourceFileAttachment {
28
+ const mimeType = file.mimeType.toLowerCase();
29
+ return {
30
+ kind: attachmentKind(mimeType),
31
+ filename: file.filename,
32
+ mime_type: mimeType,
33
+ ...(typeof file.sizeBytes === 'number' && Number.isFinite(file.sizeBytes)
34
+ ? { size_bytes: file.sizeBytes }
35
+ : {}),
36
+ open: { operation: file.operation, input: file.input },
37
+ };
38
+ }
39
+
40
+ // Same media-type split the gateway applies when it publishes a file.
41
+ function attachmentKind(mimeType: string): SourceFileAttachment['kind'] {
42
+ if (mimeType.startsWith('image/')) return 'image';
43
+ if (mimeType.startsWith('audio/')) return 'audio';
44
+ if (mimeType.startsWith('video/')) return 'video';
45
+ return 'file';
46
+ }
@@ -3,12 +3,14 @@ import {
3
3
  IntegrationConnector,
4
4
  } from "@lobu/connector-sdk";
5
5
  import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
6
+ import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
6
7
 
7
8
  export default class TeamsConnector extends IntegrationConnector {
8
9
  readonly definition: ConnectorDefinition = {
9
10
  key: "teams",
10
11
  kind: "integration",
11
12
  automationEvents: CHAT_AUTOMATION_EVENTS,
13
+ actions: CHAT_TRANSPORT_ACTIONS,
12
14
  name: "Microsoft Teams",
13
15
  description: "Connect a Microsoft Teams bot to Lobu.",
14
16
  version: "1.0.0",
@@ -3,12 +3,14 @@ import {
3
3
  IntegrationConnector,
4
4
  } from "@lobu/connector-sdk";
5
5
  import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
6
+ import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
6
7
 
7
8
  export default class TelegramConnector extends IntegrationConnector {
8
9
  readonly definition: ConnectorDefinition = {
9
10
  key: "telegram",
10
11
  kind: "integration",
11
12
  automationEvents: CHAT_AUTOMATION_EVENTS,
13
+ actions: CHAT_TRANSPORT_ACTIONS,
12
14
  name: "Telegram",
13
15
  description: "Connect a Telegram bot and route chats to Lobu agents.",
14
16
  version: "1.0.0",
@@ -252,7 +252,7 @@ export default class TikTokConnector extends ConnectorRuntime {
252
252
  actions: {
253
253
  set_like: { key: "set_like", name: "Set like", kind: "write", description: "Set a post's liked state and verify it after reload. Already-matching posts are left unchanged. May focus a scratch tab to load the post. Selection and budgets belong in Automations.", annotations: { idempotentHint: true, destructiveHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "liked"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, liked: { type: "boolean" } } } },
254
254
  inspect_post: { key: "inspect_post", name: "Inspect post visuals", kind: "read", description: "Return post metadata and real screenshots at requested video times or photo indices. Images are visual samples, not full video or audio understanding. May focus a scratch tab to load media.", annotations: { readOnlyHint: true, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, frame_times: { type: "array", minItems: 1, maxItems: 6, items: { type: "number", minimum: 0 }, default: [0] }, photo_indices: { type: "array", minItems: 1, maxItems: 10, items: { type: "integer", minimum: 0 }, description: "Zero-based photos to capture; defaults to the first photo." } } } },
255
- prepare_comment: { key: "prepare_comment", name: "Prepare comment", kind: "write", description: "Prepare a video comment for human submission. Call operations.execute with activation: { kind: 'page_visit', urls: [post_url] }. After the user opens that exact post, fills its empty composer. The user must click Post. Fails without page activation; never submits or overwrites a draft. Photo comments are not supported.", annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "body"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, body: { type: "string", minLength: 1 } } } },
255
+ prepare_comment: { key: "prepare_comment", name: "Prepare comment", kind: "write", description: "Prepare a video comment for human submission. Call operations.execute with activation: { kind: 'page_visit', urls: [post_url] }. After the user opens that exact post, fills its empty composer. The user must click Post. Fails without page activation; never submits or overwrites a draft. Photo comments are not supported.", annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "body"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, body: { type: "string", minLength: 1, "x-multiline": true } } } },
256
256
  },
257
257
  };
258
258
 
@@ -3,12 +3,14 @@ import {
3
3
  IntegrationConnector,
4
4
  } from "@lobu/connector-sdk";
5
5
  import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
6
+ import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
6
7
 
7
8
  export default class WhatsAppConnector extends IntegrationConnector {
8
9
  readonly definition: ConnectorDefinition = {
9
10
  key: "whatsapp",
10
11
  kind: "integration",
11
12
  automationEvents: CHAT_AUTOMATION_EVENTS,
13
+ actions: CHAT_TRANSPORT_ACTIONS,
12
14
  name: "WhatsApp Cloud",
13
15
  description: "Connect a WhatsApp Cloud API phone number to Lobu.",
14
16
  version: "1.0.0",
@@ -498,7 +498,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
498
498
  chat_jid: { type: "string" },
499
499
  chat_name: { type: "string" },
500
500
  self_chat: { type: "boolean", const: true },
501
- text: { type: "string", minLength: 1, maxLength: 65536 },
501
+ text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
502
502
  },
503
503
  anyOf: [
504
504
  { required: ["chat_jid"] },
@@ -529,7 +529,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
529
529
  chat_jid: { type: "string" },
530
530
  chat_name: { type: "string" },
531
531
  self_chat: { type: "boolean", const: true },
532
- text: { type: "string", minLength: 1, maxLength: 65536 },
532
+ text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
533
533
  },
534
534
  anyOf: [
535
535
  { required: ["chat_jid"] },
@@ -560,7 +560,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
560
560
  type: "string",
561
561
  description: "Raw WhatsApp message key.id.",
562
562
  },
563
- text: { type: "string", minLength: 1, maxLength: 65536 },
563
+ text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
564
564
  },
565
565
  },
566
566
  outputSchema: {
@@ -307,12 +307,11 @@ export function xDirectMessagesProgram() {
307
307
  .map((byte) => byte.toString(16).padStart(2, "0"))
308
308
  .join("");
309
309
  }
310
- // X's client request id, derived from the caller's idempotency key so a
311
- // retried send carries the same id and can recognise its earlier attempt.
312
- async function requestIdOf(self, conversationId, idempotencyKey) {
313
- const hex = await digest(
314
- JSON.stringify([self, conversationId, idempotencyKey]),
315
- );
310
+ // X's client request id, derived from the operation run so a retry or
311
+ // re-claim of the same run carries the same id and can recognise its
312
+ // earlier attempt.
313
+ async function requestIdOf(self, conversationId, runId) {
314
+ const hex = await digest(JSON.stringify([self, conversationId, runId]));
316
315
  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-${((Number.parseInt(hex[16], 16) & 3) | 8).toString(16)}${hex.slice(17, 20)}-${hex.slice(20, 32)}`;
317
316
  }
318
317
  // An outgoing message on the latest page that is this send's earlier attempt.
@@ -351,10 +350,9 @@ export function xDirectMessagesProgram() {
351
350
  fail("The conversation does not belong to the signed-in account");
352
351
  const text = typeof input.text === "string" ? input.text : "";
353
352
  if (!text.trim()) fail("text is required");
354
- const idempotencyKey =
355
- typeof input.idempotency_key === "string" ? input.idempotency_key : "";
356
- if (!idempotencyKey) fail("idempotency_key is required");
357
- const requestId = await requestIdOf(self, conversationId, idempotencyKey);
353
+ const runId = typeof input.run_id === "string" ? input.run_id : "";
354
+ if (!runId) fail("run_id is required");
355
+ const requestId = await requestIdOf(self, conversationId, runId);
358
356
  const delivered = (prior) => ({
359
357
  sent: true,
360
358
  deduplicated: true,