@lobu/runtime-server 22.0.0 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/catalogs/connectors.json +1353 -181
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +14 -1
  5. package/dist/connectors/google_gmail.ts +1 -0
  6. package/dist/connectors/jira-helpers.ts +313 -0
  7. package/dist/connectors/jira.ts +29 -221
  8. package/dist/connectors/linkedin-browser-script.ts +13 -0
  9. package/dist/connectors/linkedin-draft-page.js +104 -0
  10. package/dist/connectors/linkedin-drafts.ts +73 -0
  11. package/dist/connectors/linkedin-identity.ts +32 -0
  12. package/dist/connectors/linkedin-inbox-adapter.js +1185 -0
  13. package/dist/connectors/linkedin-inbox.ts +156 -0
  14. package/dist/connectors/linkedin-like.ts +114 -0
  15. package/dist/connectors/linkedin-takeout.ts +577 -0
  16. package/dist/connectors/linkedin.ts +3998 -0
  17. package/dist/connectors/takeout-utils.ts +240 -0
  18. package/dist/connectors/tiktok-inbox-page.js +9 -9
  19. package/dist/connectors/tiktok-web-page.js +21 -15
  20. package/dist/connectors/tiktok_web.ts +63 -30
  21. package/dist/connectors/whatsapp-web-adapter.js +64 -564
  22. package/dist/connectors/whatsapp-web-helpers.ts +30 -444
  23. package/dist/connectors/whatsapp-web-identity.ts +20 -6
  24. package/dist/connectors/whatsapp_web.ts +45 -645
  25. package/dist/connectors/x-dm-adapter.js +556 -0
  26. package/dist/connectors/x-identity.ts +31 -2
  27. package/dist/connectors/x.ts +266 -120
  28. package/dist/db/migrations/20261017120000_drop_feeds_kind_virtual.sql +26 -0
  29. package/dist/db/migrations/20261017130000_drop_retired_dead_code_columns.sql +46 -0
  30. package/dist/dependencies.bun.lock +41 -41
  31. package/dist/guest.bundle.js +288 -148
  32. package/dist/owletto/dist/assets/_-3J-IrxWk.js +2 -0
  33. package/dist/owletto/dist/assets/{_-CEPl6gU4.js → _-DYUE3ix4.js} +3 -3
  34. package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +2 -0
  35. package/dist/owletto/dist/assets/{_agentId-CBC_SadO.js → _agentId-Cam7Z0N7.js} +2 -2
  36. package/dist/owletto/dist/assets/{_automationId-YTTNksw6.js → _automationId-CXEiKVZJ.js} +2 -2
  37. package/dist/owletto/dist/assets/{_connectorKey._connectionId-fK0h7RAp.js → _connectorKey._connectionId-CS85l61t.js} +2 -2
  38. package/dist/owletto/dist/assets/{_connectorKey.index-C7TPS598.js → _connectorKey.index-clVDIyW0.js} +2 -2
  39. package/dist/owletto/dist/assets/{_conversationId-CEhxlTIo.js → _conversationId-Ci2k-BuN.js} +2 -2
  40. package/dist/owletto/dist/assets/{_deploymentId-BQfYN1U2.js → _deploymentId-BuUzGtVL.js} +2 -2
  41. package/dist/owletto/dist/assets/{_eventId-Cl8GSdjg.js → _eventId-B0662F8h.js} +2 -2
  42. package/dist/owletto/dist/assets/_name-CwWePlOl.js +2 -0
  43. package/dist/owletto/dist/assets/{_owner-cUtGHqSw.js → _owner-dTWkrKsK.js} +3 -3
  44. package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +2 -0
  45. package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +2 -0
  46. package/dist/owletto/dist/assets/{_slug-CU1PuHB9.js → _slug-DQHutM41.js} +2 -2
  47. package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +2 -0
  48. package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +2 -0
  49. package/dist/owletto/dist/assets/{accept-invitation-D3OgJG4i.js → accept-invitation-w17IFTtf.js} +2 -2
  50. package/dist/owletto/dist/assets/{activity-route-view-DQglkhXU.js → activity-route-view-CMqYiiKM.js} +2 -2
  51. package/dist/owletto/dist/assets/{agent-card-controls-DzRs4Ix9.js → agent-card-controls-mnTN2AZt.js} +2 -2
  52. package/dist/owletto/dist/assets/{agent-client-setup-list-B2SvH7xD.js → agent-client-setup-list-Bg3hBfUV.js} +2 -2
  53. package/dist/owletto/dist/assets/{agent-connect-pages-B6uKvT_X.js → agent-connect-pages-B_vrqLVc.js} +2 -2
  54. package/dist/owletto/dist/assets/{agent-editor-form-oUnIYHd7.js → agent-editor-form-hTs7eO_U.js} +2 -2
  55. package/dist/owletto/dist/assets/{agent-guardrails-route-BaV1VpDh.js → agent-guardrails-route-BOrCXcAl.js} +2 -2
  56. package/dist/owletto/dist/assets/{agent-loading-shells-CtZJM2Gc.js → agent-loading-shells-Dqcvky-k.js} +2 -2
  57. package/dist/owletto/dist/assets/{agent-permissions-matrix-Ds48KFK9.js → agent-permissions-matrix-BOo_4r_4.js} +2 -2
  58. package/dist/owletto/dist/assets/{agent-skill-context-DPk5r08w.js → agent-skill-context-CCdvtlmH.js} +2 -2
  59. package/dist/owletto/dist/assets/{agent-skills-route-DYpB5H1J.js → agent-skills-route-BUxIswuq.js} +2 -2
  60. package/dist/owletto/dist/assets/{agent-subpage-shell-B3K_jPYR.js → agent-subpage-shell-D92imvSt.js} +2 -2
  61. package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +6 -0
  62. package/dist/owletto/dist/assets/agents-9XjpDj_S.js +2 -0
  63. package/dist/owletto/dist/assets/{agents-workbench-CMyk4PI7.js → agents-workbench-Bt5QCYQ7.js} +2 -2
  64. package/dist/owletto/dist/assets/{app._appId-DH1Qutz6.js → app._appId-CKv7_squ.js} +2 -2
  65. package/dist/owletto/dist/assets/{automation-detail-content-CEDNboId.js → automation-detail-content-vUwVumXf.js} +2 -2
  66. package/dist/owletto/dist/assets/automations-9XjpDj_S.js +2 -0
  67. package/dist/owletto/dist/assets/{callback-CU-hb8JB.js → callback-BRgcL8gz.js} +2 -2
  68. package/dist/owletto/dist/assets/{card-DIF8SF9b.js → card-Djgp00r_.js} +2 -2
  69. package/dist/owletto/dist/assets/{claim-DELEa-gH.js → claim-BYUZnyMp.js} +2 -2
  70. package/dist/owletto/dist/assets/{clients-CpG676mg.js → clients-D3Zbjxin.js} +2 -2
  71. package/dist/owletto/dist/assets/{code-editor-V27Z4o3P.js → code-editor-DHeyRGZI.js} +2 -2
  72. package/dist/owletto/dist/assets/connect-CfsFsy9P.js +2 -0
  73. package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +2 -0
  74. package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +2 -0
  75. package/dist/owletto/dist/assets/{connected._clientId.activity-DQWcUqKM.js → connected._clientId.activity-Ckdz6I0y.js} +2 -2
  76. package/dist/owletto/dist/assets/{connected._clientId.index-BC3R303A.js → connected._clientId.index-CNxafNeo.js} +2 -2
  77. package/dist/owletto/dist/assets/{connection-DySpRE9x.js → connection-C3XXFEqh.js} +2 -2
  78. package/dist/owletto/dist/assets/{connection-feed-detail-C_D68j6d.js → connection-feed-detail-CIJJLDP8.js} +2 -2
  79. package/dist/owletto/dist/assets/{connections-browser-Cnv2iBbZ.js → connections-browser-CKZjzRz6.js} +2 -2
  80. package/dist/owletto/dist/assets/{connector-provenance-CNXtzYg5.js → connector-provenance-8-d8hl10.js} +2 -2
  81. package/dist/owletto/dist/assets/{connector-scope-lists-BKDetNDc.js → connector-scope-lists-CadPVsI3.js} +2 -2
  82. package/dist/owletto/dist/assets/{connectors-BJnk1z_2.js → connectors-lvLJ30lo.js} +2 -2
  83. package/dist/owletto/dist/assets/{consent-BVzxrAO9.js → consent-CdSvVCgx.js} +2 -2
  84. package/dist/owletto/dist/assets/{conversations-table-DfZGICl7.js → conversations-table-BdXoZAfc.js} +2 -2
  85. package/dist/owletto/dist/assets/{core.esm-DiTpULFl.js → core.esm-CYvgWCuv.js} +2 -2
  86. package/dist/owletto/dist/assets/create-0xW9eXxG.js +2 -0
  87. package/dist/owletto/dist/assets/{create-JRFM8mMf.js → create-B0qhrrX4.js} +2 -2
  88. package/dist/owletto/dist/assets/create-CAfF-yI1.js +2 -0
  89. package/dist/owletto/dist/assets/create-automation-form-CtSSeYj3.js +3 -0
  90. package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +2 -0
  91. package/dist/owletto/dist/assets/{cronstrue-DPXl0qA2.js → cronstrue-n4qGUraE.js} +2 -2
  92. package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +2 -0
  93. package/dist/owletto/dist/assets/{deployments-DCQdFdwG.js → deployments-RvUdVkj3.js} +2 -2
  94. package/dist/owletto/dist/assets/{deployments-body-D6TAWs_6.js → deployments-body-BMp7UsMo.js} +2 -2
  95. package/dist/owletto/dist/assets/{device-CntqYW65.js → device-CPU6CjkJ.js} +2 -2
  96. package/dist/owletto/dist/assets/{device-pin-tombstone-Bz4JHHMK.js → device-pin-tombstone-CrjG7gPo.js} +2 -2
  97. package/dist/owletto/dist/assets/{device._deviceId-D4plO3GM.js → device._deviceId-Cs3ZmXWo.js} +2 -2
  98. package/dist/owletto/dist/assets/{entity-options-UJs64GdQ.js → entity-options-uXjgT7y9.js} +2 -2
  99. package/dist/owletto/dist/assets/{entity-page-Djz6T50J.js → entity-page-Dc0LGr5U.js} +2 -2
  100. package/dist/owletto/dist/assets/{entity-type-page-OznRag6A.js → entity-type-page-CwZxa0BR.js} +2 -2
  101. package/dist/owletto/dist/assets/{event-detail-04qOUGIP.js → event-detail-ve2d6Gbb.js} +2 -2
  102. package/dist/owletto/dist/assets/{events-feed-fucGZSJR.js → events-feed-BtvhZF1f.js} +2 -2
  103. package/dist/owletto/dist/assets/{filter-editors-DCQgGLyR.js → filter-editors-Cj-v6NtH.js} +2 -2
  104. package/dist/owletto/dist/assets/{full-page-spinner-KpV2FS2u.js → full-page-spinner-DqpH99np.js} +2 -2
  105. package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +2 -0
  106. package/dist/owletto/dist/assets/identity-BigVSBCl.js +2 -0
  107. package/dist/owletto/dist/assets/{index-BEvyBdOU.js → index-B9uPN6FC.js} +2 -2
  108. package/dist/owletto/dist/assets/{index-BNh2cidi.js → index-BQVliQW1.js} +2 -2
  109. package/dist/owletto/dist/assets/index-BfedB4Rc.js +2 -0
  110. package/dist/owletto/dist/assets/index-CUw3aKBI.js +2 -0
  111. package/dist/owletto/dist/assets/index-CXhxUkv3.js +2 -0
  112. package/dist/owletto/dist/assets/{index-_oPeVpL_.js → index-Cr5hwh-C.js} +66 -66
  113. package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +2 -0
  114. package/dist/owletto/dist/assets/index-DKSx8JN_.js +2 -0
  115. package/dist/owletto/dist/assets/{index-D3s8rhG9.js → index-DVk7Ug0d.js} +2 -2
  116. package/dist/owletto/dist/assets/index-DmZuKGf8.js +2 -0
  117. package/dist/owletto/dist/assets/{index-DCdkwg9H.js → index-Hio-HRfo.js} +2 -2
  118. package/dist/owletto/dist/assets/{index-BJXkc60S.js → index-ICgKp3YK.js} +2 -2
  119. package/dist/owletto/dist/assets/index-cPcroOH0.js +2 -0
  120. package/dist/owletto/dist/assets/{index-BOzuAbvi.js → index-n7sTbNv4.js} +2 -2
  121. package/dist/owletto/dist/assets/index-xiFpcWKv.js +2 -0
  122. package/dist/owletto/dist/assets/{json-diff-D_Ym3Uku.js → json-diff-DBoag_OS.js} +2 -2
  123. package/dist/owletto/dist/assets/{list-skeleton-Bl0OS39L.js → list-skeleton-C_GuoxAH.js} +2 -2
  124. package/dist/owletto/dist/assets/{login-QHdxqX-4.js → login-Ci6ixHuL.js} +2 -2
  125. package/dist/owletto/dist/assets/{logout-DUccApuZ.js → logout-CLGgeZB7.js} +2 -2
  126. package/dist/owletto/dist/assets/{member-scope-gate-CFbrq1by.js → member-scope-gate-B44INDPY.js} +2 -2
  127. package/dist/owletto/dist/assets/{memory-browse-page-IrIXuZTF.js → memory-browse-page-DyQiRvzl.js} +2 -2
  128. package/dist/owletto/dist/assets/{model-selector-CB1BDvlW.js → model-selector-dAbDgJvx.js} +2 -2
  129. package/dist/owletto/dist/assets/models-DpVP7ZwX.js +2 -0
  130. package/dist/owletto/dist/assets/{new-BWo8_Pms.js → new-BUb7AnEW.js} +2 -2
  131. package/dist/owletto/dist/assets/{new-B5UsLiy6.js → new-BkdULx2r.js} +2 -2
  132. package/dist/owletto/dist/assets/{new-DpmDXmFI.js → new-CHOr-EcI.js} +2 -2
  133. package/dist/owletto/dist/assets/{oauth-workspace-access-PGyTnW2K.js → oauth-workspace-access-BxsjwgdH.js} +2 -2
  134. package/dist/owletto/dist/assets/{organization-BH8PYlVu.js → organization-gxGeDjIV.js} +2 -2
  135. package/dist/owletto/dist/assets/{peek-pane-content-B2AFNTzP.js → peek-pane-content-CHoQHe2H.js} +2 -2
  136. package/dist/owletto/dist/assets/{permissions-CwN_YP3u.js → permissions-aPHaKLec.js} +2 -2
  137. package/dist/owletto/dist/assets/{proposal-review-shell-DKKGu4Ww.js → proposal-review-shell-UcZr87_Q.js} +2 -2
  138. package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +2 -0
  139. package/dist/owletto/dist/assets/{recent-DqdZE_TI.js → recent-D-65Pgu-.js} +2 -2
  140. package/dist/owletto/dist/assets/{record-activity-CvgZyCmw.js → record-activity-CBXH6v1d.js} +2 -2
  141. package/dist/owletto/dist/assets/{renderer-BL6VcwQH.js → renderer-mEDnVW0O.js} +2 -2
  142. package/dist/owletto/dist/assets/{reset-password-DAvBYkiI.js → reset-password-uX_V6bip.js} +2 -2
  143. package/dist/owletto/dist/assets/{runs-BWtc5rmc.js → runs-C0rCgGwX.js} +2 -2
  144. package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +2 -0
  145. package/dist/owletto/dist/assets/{runs-table-DxIiqrSk.js → runs-table-syPJ6r6T.js} +2 -2
  146. package/dist/owletto/dist/assets/{settings-Crxlwps-.js → settings-9NkNA1G1.js} +2 -2
  147. package/dist/owletto/dist/assets/settings-E-10sLQX.js +2 -0
  148. package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +2 -0
  149. package/dist/owletto/dist/assets/{source-record-panels-CRIPMWfN.js → source-record-panels-CPyzlfD1.js} +2 -2
  150. package/dist/owletto/dist/assets/{status-dot-C5KDvvm9.js → status-dot-B-EWMgq6.js} +2 -2
  151. package/dist/owletto/dist/assets/{tabs-B4Er9hJj.js → tabs-DqIIkCX-.js} +2 -2
  152. package/dist/owletto/dist/assets/{use-mention-search-DqEykWl_.js → use-mention-search-By8RZyKW.js} +2 -2
  153. package/dist/owletto/dist/assets/{view-param-filters-Cylutoy1.js → view-param-filters-CqLZQrnO.js} +2 -2
  154. package/dist/owletto/dist/index.html +1 -1
  155. package/dist/server-main.bundle.mjs +11447 -10762
  156. package/npm-shrinkwrap.json +160 -160
  157. package/package.json +1 -1
  158. package/vendor/connector-sdk/dist/browser-handoff-banner.d.ts +39 -0
  159. package/vendor/connector-sdk/dist/browser-handoff-banner.js +175 -0
  160. package/vendor/connector-sdk/dist/browser-source-read.d.ts +52 -0
  161. package/vendor/connector-sdk/dist/browser-source-read.js +107 -0
  162. package/vendor/connector-sdk/dist/connector-types.d.ts +10 -0
  163. package/vendor/connector-sdk/dist/index.d.ts +3 -0
  164. package/vendor/connector-sdk/dist/index.js +2 -0
  165. package/vendor/connector-sdk/package.json +9 -1
  166. package/vendor/core/dist/capabilities.d.ts +1 -1
  167. package/vendor/core/dist/capabilities.js +0 -1
  168. package/vendor/core/dist/connector-query-errors.d.ts +32 -0
  169. package/vendor/core/dist/connector-query-errors.js +41 -1
  170. package/vendor/core/dist/contracts/tools/manage-conversations.js +2 -2
  171. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +14 -0
  172. package/vendor/core/dist/contracts/tools/manage-feeds.js +17 -0
  173. package/vendor/core/dist/contracts/worker/protocol.d.ts +8 -131
  174. package/vendor/core/dist/contracts/worker/protocol.js +9 -61
  175. package/vendor/core/dist/device-pin-tombstones.d.ts +44 -0
  176. package/vendor/core/dist/device-pin-tombstones.js +57 -0
  177. package/vendor/core/dist/index.d.ts +2 -1
  178. package/vendor/core/dist/index.js +1 -0
  179. package/vendor/core/dist/logger.js +10 -25
  180. package/vendor/core/dist/utils/diagnostic-scrubber.js +258 -21
  181. package/vendor/core/dist/worker/wire.d.ts +0 -10
  182. package/vendor/core/package.json +6 -6
  183. package/vendor/views/package.json +1 -1
  184. package/dist/owletto/dist/assets/_-C_zNZben.js +0 -2
  185. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +0 -2
  186. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +0 -2
  187. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +0 -2
  188. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +0 -2
  189. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +0 -2
  190. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +0 -2
  191. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +0 -6
  192. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +0 -2
  193. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +0 -2
  194. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +0 -2
  195. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +0 -2
  196. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +0 -2
  197. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +0 -2
  198. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +0 -3
  199. package/dist/owletto/dist/assets/create-iHcxV0xd.js +0 -2
  200. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +0 -2
  201. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +0 -2
  202. package/dist/owletto/dist/assets/guardrails-molekzAF.js +0 -2
  203. package/dist/owletto/dist/assets/identity-BJcaG66g.js +0 -2
  204. package/dist/owletto/dist/assets/index-B04ON9Jv.js +0 -2
  205. package/dist/owletto/dist/assets/index-BOsK-K-2.js +0 -2
  206. package/dist/owletto/dist/assets/index-Bk1x7A67.js +0 -2
  207. package/dist/owletto/dist/assets/index-CFnx5huL.js +0 -2
  208. package/dist/owletto/dist/assets/index-Dbd1jusf.js +0 -2
  209. package/dist/owletto/dist/assets/index-DqZuqC08.js +0 -2
  210. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +0 -2
  211. package/dist/owletto/dist/assets/index-KPOvMVa-.js +0 -2
  212. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +0 -2
  213. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +0 -2
  214. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +0 -2
  215. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +0 -2
  216. package/dist/owletto/dist/assets/skills-D0X430X8.js +0 -2
  217. package/vendor/core/dist/contracts/worker/device-chat.d.ts +0 -4
  218. package/vendor/core/dist/contracts/worker/device-chat.js +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/runtime-server",
3
- "version": "22.0.0",
3
+ "version": "23.0.0",
4
4
  "type": "module",
5
5
  "license": "BUSL-1.1",
6
6
  "repository": {
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Shared in-page handoff banner for browser-staged drafts.
3
+ *
4
+ * Two connectors stage text in the user's own signed-in page and stop before
5
+ * submit (`x.prepare_reply`, `linkedin.prepare_comment`). Without a banner the
6
+ * staged page is context-free — a draft in a box with no record of why the
7
+ * agent thought the post mattered. Both banners are the same DOM shape (a
8
+ * fixed `#lobu-handoff-banner` status node, anchored above the composer when
9
+ * one is found, dismissible, never auto-submitted); only the title,
10
+ * instruction line, optional footer, and composer/host selectors differ per
11
+ * site. Callers pass those; this module owns the injection script.
12
+ *
13
+ * Pure (no `node:`, no `@lobu/core`): the root must stay loadable inside a V8
14
+ * isolate.
15
+ */
16
+ export declare function truncateHandoffReason(reason: string | undefined | null, maxLen?: number): string | undefined;
17
+ export interface HandoffBannerOptions {
18
+ reason?: string;
19
+ /** Banner heading. Defaults to a neutral staged-draft title. */
20
+ title?: string;
21
+ /** Instruction line under the heading. Defaults to a never-submits line. */
22
+ instruction?: string;
23
+ /** Optional third line (e.g. where to record the outcome). Omit for none. */
24
+ footer?: string;
25
+ /** Composer selectors tried in order. Defaults to a generic textbox. */
26
+ composerSelectors?: string[];
27
+ /** `closest()` hosts tried in order before falling back to `parentElement`. */
28
+ hostSelectors?: string[];
29
+ }
30
+ /**
31
+ * JS expression: inject the Lobu handoff banner on the page.
32
+ *
33
+ * Best-effort; the host page re-renders aggressively and may drop the node.
34
+ * Never fatal — the draft is already staged by the time this runs. No
35
+ * auto-dismiss: the draft lives in the user's page, so its context should
36
+ * still be present when the user returns later.
37
+ */
38
+ export declare function buildInjectHandoffBannerExpression(opts: HandoffBannerOptions): string;
39
+ //# sourceMappingURL=browser-handoff-banner.d.ts.map
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Shared in-page handoff banner for browser-staged drafts.
3
+ *
4
+ * Two connectors stage text in the user's own signed-in page and stop before
5
+ * submit (`x.prepare_reply`, `linkedin.prepare_comment`). Without a banner the
6
+ * staged page is context-free — a draft in a box with no record of why the
7
+ * agent thought the post mattered. Both banners are the same DOM shape (a
8
+ * fixed `#lobu-handoff-banner` status node, anchored above the composer when
9
+ * one is found, dismissible, never auto-submitted); only the title,
10
+ * instruction line, optional footer, and composer/host selectors differ per
11
+ * site. Callers pass those; this module owns the injection script.
12
+ *
13
+ * Pure (no `node:`, no `@lobu/core`): the root must stay loadable inside a V8
14
+ * isolate.
15
+ */
16
+ export function truncateHandoffReason(reason, maxLen = 120) {
17
+ if (reason == null)
18
+ return undefined;
19
+ const t = reason.replace(/\s+/g, " ").trim();
20
+ if (!t)
21
+ return undefined;
22
+ if (t.length <= maxLen)
23
+ return t;
24
+ return `${t.slice(0, Math.max(0, maxLen - 1)).trimEnd()}…`;
25
+ }
26
+ /**
27
+ * JS expression: inject the Lobu handoff banner on the page.
28
+ *
29
+ * Best-effort; the host page re-renders aggressively and may drop the node.
30
+ * Never fatal — the draft is already staged by the time this runs. No
31
+ * auto-dismiss: the draft lives in the user's page, so its context should
32
+ * still be present when the user returns later.
33
+ */
34
+ export function buildInjectHandoffBannerExpression(opts) {
35
+ const reason = truncateHandoffReason(opts.reason);
36
+ const title = opts.title ?? "Lobu staged this draft";
37
+ const instruction = opts.instruction ?? "Review the draft yourself — Lobu did not submit.";
38
+ const titleLit = JSON.stringify(title);
39
+ const instructionLit = JSON.stringify(instruction);
40
+ const reasonLit = JSON.stringify(reason ?? null);
41
+ const footerLit = JSON.stringify(opts.footer ?? null);
42
+ const composerSelectorsLit = JSON.stringify(opts.composerSelectors ?? ['div[role="textbox"][contenteditable="true"]']);
43
+ const hostSelectorsLit = JSON.stringify(opts.hostSelectors ?? ["form"]);
44
+ return `(async()=>{
45
+ const TITLE = ${titleLit};
46
+ const INSTRUCTION = ${instructionLit};
47
+ const REASON = ${reasonLit};
48
+ const FOOTER = ${footerLit};
49
+ const COMPOSER_SELECTORS = ${composerSelectorsLit};
50
+ const HOST_SELECTORS = ${hostSelectorsLit};
51
+ const ID = 'lobu-handoff-banner';
52
+ try {
53
+ const prev = document.getElementById(ID);
54
+ if (prev) prev.remove();
55
+ } catch (_) {}
56
+
57
+ const root = document.createElement('div');
58
+ root.id = ID;
59
+ root.setAttribute('role', 'status');
60
+ root.setAttribute('data-lobu', 'handoff-banner');
61
+ root.style.cssText = [
62
+ 'position:fixed',
63
+ 'top:12px',
64
+ 'left:50%',
65
+ 'transform:translateX(-50%)',
66
+ 'z-index:2147483646',
67
+ 'max-width:min(520px,calc(100vw - 24px))',
68
+ 'font:13px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif',
69
+ 'color:#0f172a',
70
+ 'background:#fff',
71
+ 'border:1px solid #cbd5e1',
72
+ 'border-left:4px solid #0ea5e9',
73
+ 'border-radius:10px',
74
+ 'box-shadow:0 8px 28px rgba(15,23,42,.18)',
75
+ 'padding:10px 12px',
76
+ 'display:flex',
77
+ 'gap:10px',
78
+ 'align-items:flex-start',
79
+ 'pointer-events:auto',
80
+ ].join(';');
81
+
82
+ const body = document.createElement('div');
83
+ body.style.cssText = 'flex:1;min-width:0';
84
+
85
+ const head = document.createElement('div');
86
+ head.style.cssText = 'font-weight:600;margin:0 0 2px;color:#0c4a6e';
87
+ head.textContent = TITLE;
88
+
89
+ const line = document.createElement('div');
90
+ line.style.cssText = 'color:#334155;margin:0 0 2px';
91
+ line.textContent = INSTRUCTION;
92
+
93
+ body.appendChild(head);
94
+ body.appendChild(line);
95
+
96
+ if (REASON) {
97
+ const why = document.createElement('div');
98
+ why.style.cssText = 'color:#64748b;margin:4px 0 0;font-size:12px';
99
+ why.textContent = 'Why: ' + REASON;
100
+ body.appendChild(why);
101
+ }
102
+
103
+ if (FOOTER) {
104
+ const foot = document.createElement('div');
105
+ foot.style.cssText = 'color:#64748b;margin:4px 0 0;font-size:12px';
106
+ foot.textContent = FOOTER;
107
+ body.appendChild(foot);
108
+ }
109
+
110
+ const close = document.createElement('button');
111
+ close.type = 'button';
112
+ close.setAttribute('aria-label', 'Dismiss');
113
+ close.textContent = '\\u00d7';
114
+ close.style.cssText = [
115
+ 'flex:none',
116
+ 'border:0',
117
+ 'background:transparent',
118
+ 'color:#64748b',
119
+ 'font:20px/1 sans-serif',
120
+ 'cursor:pointer',
121
+ 'padding:0 2px',
122
+ ].join(';');
123
+ close.onclick = function () { try { root.remove(); } catch (_) {} };
124
+
125
+ root.appendChild(body);
126
+ root.appendChild(close);
127
+
128
+ // Anchor above the composer when we can find it, so the reason sits
129
+ // next to the draft instead of floating over unrelated content.
130
+ let anchored = false;
131
+ try {
132
+ let composer = null;
133
+ for (const selector of COMPOSER_SELECTORS) {
134
+ try {
135
+ composer = document.querySelector(selector);
136
+ } catch (_) {
137
+ composer = null;
138
+ }
139
+ if (composer) break;
140
+ }
141
+ if (composer) {
142
+ let host = null;
143
+ for (const selector of HOST_SELECTORS) {
144
+ try {
145
+ host = composer.closest(selector);
146
+ } catch (_) {
147
+ host = null;
148
+ }
149
+ if (host) break;
150
+ }
151
+ host = host || composer.parentElement;
152
+ if (host && host.parentElement) {
153
+ root.style.position = 'relative';
154
+ root.style.top = '0';
155
+ root.style.left = '0';
156
+ root.style.transform = 'none';
157
+ root.style.margin = '8px 0 12px';
158
+ root.style.maxWidth = '100%';
159
+ host.parentElement.insertBefore(root, host);
160
+ anchored = true;
161
+ }
162
+ }
163
+ } catch (_) {}
164
+
165
+ if (!anchored) {
166
+ (document.body || document.documentElement).appendChild(root);
167
+ }
168
+
169
+ // No auto-dismiss: the draft lives in the user's page, so its context should
170
+ // still be present when the user returns later. The dismiss button remains.
171
+
172
+ return { ok: true, anchored: anchored, has_reason: !!REASON };
173
+ })()`;
174
+ }
175
+ //# sourceMappingURL=browser-handoff-banner.js.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Shared guards and reference-batch splitting for browser-source reads.
3
+ *
4
+ * Browser connectors observe references only (WhatsApp, TikTok inbox,
5
+ * LinkedIn inbox) or take bounded snapshots (TikTok timeline/search): the
6
+ * source owns order and pagination, so offsets, sorts, time windows, and
7
+ * exact-match filters are rejected before touching the page. Each durable
8
+ * browser record is limited to 128 KiB including its checkpoint, so reference
9
+ * batches are capped at 500 events and halved until they fit; only the final
10
+ * batch carries the checkpoint, so an interruption replays instead of
11
+ * skipping.
12
+ *
13
+ * Pure (no `node:`, no `@lobu/core`): the root must stay loadable inside a V8
14
+ * isolate.
15
+ */
16
+ import type { FeedReadContext } from "./connector-types.js";
17
+ /** Max references per durable browser record. */
18
+ export declare const SOURCE_REFERENCE_BATCH_MAX_EVENTS = 500;
19
+ /** Max serialized bytes per durable browser record, checkpoint included. */
20
+ export declare const SOURCE_RECORD_MAX_BYTES: number;
21
+ export declare function jsonByteLength(value: unknown): number;
22
+ /**
23
+ * Split references into ordered batches of at most `maxEvents` references and
24
+ * `maxBytes` serialized bytes. `buildBatch` shapes each record (id,
25
+ * checkpoint on the final batch, `more`); it receives the slice, whether it
26
+ * is the last batch, and the running offset. Throws when a single reference
27
+ * cannot fit even alone.
28
+ */
29
+ export declare function splitReferenceBatches<E>(events: E[], buildBatch: (slice: E[], isLast: boolean, offset: number) => Record<string, unknown>, opts?: {
30
+ maxEvents?: number;
31
+ maxBytes?: number;
32
+ }): Record<string, unknown>[];
33
+ type ReadShape = Pick<FeedReadContext, "offset" | "sort" | "window" | "match" | "query" | "cursor" | "limit">;
34
+ export declare function assertNoOffsetPaging(ctx: Pick<ReadShape, "offset">, message: string): void;
35
+ export declare function assertNoSort(ctx: Pick<ReadShape, "sort">, message: string): void;
36
+ export declare function assertNoWindow(ctx: Pick<ReadShape, "window">, message: string): void;
37
+ export declare function assertNoMatch(ctx: Pick<ReadShape, "match">, message: string): void;
38
+ export declare function assertNoQuery(ctx: Pick<ReadShape, "query">, message: string): void;
39
+ export declare function assertNoCursor(ctx: Pick<ReadShape, "cursor">, message: string): void;
40
+ export declare function assertPositiveReadLimit(ctx: Pick<ReadShape, "limit">, message?: string): void;
41
+ /**
42
+ * Inbox reads follow source order and the returned cursor; search, offsets,
43
+ * sorting, matching, and time windows are unsupported.
44
+ */
45
+ export declare function assertInboxSourceRead(ctx: ReadShape, sourceLabel: string): void;
46
+ /**
47
+ * Bounded snapshot reads support no pagination, sorting, time windows, or
48
+ * exact-match filters.
49
+ */
50
+ export declare function assertSnapshotSourceRead(ctx: ReadShape, sourceLabel: string): void;
51
+ export {};
52
+ //# sourceMappingURL=browser-source-read.d.ts.map
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Shared guards and reference-batch splitting for browser-source reads.
3
+ *
4
+ * Browser connectors observe references only (WhatsApp, TikTok inbox,
5
+ * LinkedIn inbox) or take bounded snapshots (TikTok timeline/search): the
6
+ * source owns order and pagination, so offsets, sorts, time windows, and
7
+ * exact-match filters are rejected before touching the page. Each durable
8
+ * browser record is limited to 128 KiB including its checkpoint, so reference
9
+ * batches are capped at 500 events and halved until they fit; only the final
10
+ * batch carries the checkpoint, so an interruption replays instead of
11
+ * skipping.
12
+ *
13
+ * Pure (no `node:`, no `@lobu/core`): the root must stay loadable inside a V8
14
+ * isolate.
15
+ */
16
+ /** Max references per durable browser record. */
17
+ export const SOURCE_REFERENCE_BATCH_MAX_EVENTS = 500;
18
+ /** Max serialized bytes per durable browser record, checkpoint included. */
19
+ export const SOURCE_RECORD_MAX_BYTES = 128 * 1024;
20
+ export function jsonByteLength(value) {
21
+ return new TextEncoder().encode(JSON.stringify(value)).length;
22
+ }
23
+ /**
24
+ * Split references into ordered batches of at most `maxEvents` references and
25
+ * `maxBytes` serialized bytes. `buildBatch` shapes each record (id,
26
+ * checkpoint on the final batch, `more`); it receives the slice, whether it
27
+ * is the last batch, and the running offset. Throws when a single reference
28
+ * cannot fit even alone.
29
+ */
30
+ export function splitReferenceBatches(events, buildBatch, opts) {
31
+ const maxEvents = opts?.maxEvents ?? SOURCE_REFERENCE_BATCH_MAX_EVENTS;
32
+ const maxBytes = opts?.maxBytes ?? SOURCE_RECORD_MAX_BYTES;
33
+ const batches = [];
34
+ for (let offset = 0;;) {
35
+ const through = (end) => buildBatch(events.slice(offset, end), end === events.length, offset);
36
+ let end = Math.min(offset + maxEvents, events.length);
37
+ let batch = through(end);
38
+ while (jsonByteLength(batch) > maxBytes && end - offset > 1) {
39
+ end = offset + Math.floor((end - offset) / 2);
40
+ batch = through(end);
41
+ }
42
+ if (jsonByteLength(batch) > maxBytes) {
43
+ throw new Error("Source reference or checkpoint exceeds the browser record limit");
44
+ }
45
+ batches.push(batch);
46
+ if (end === events.length)
47
+ return batches;
48
+ offset = end;
49
+ }
50
+ }
51
+ export function assertNoOffsetPaging(ctx, message) {
52
+ if (ctx.offset)
53
+ throw new Error(message);
54
+ }
55
+ export function assertNoSort(ctx, message) {
56
+ if (ctx.sort)
57
+ throw new Error(message);
58
+ }
59
+ export function assertNoWindow(ctx, message) {
60
+ if (ctx.window)
61
+ throw new Error(message);
62
+ }
63
+ export function assertNoMatch(ctx, message) {
64
+ if (ctx.match)
65
+ throw new Error(message);
66
+ }
67
+ export function assertNoQuery(ctx, message) {
68
+ if (ctx.query)
69
+ throw new Error(message);
70
+ }
71
+ export function assertNoCursor(ctx, message) {
72
+ if (ctx.cursor)
73
+ throw new Error(message);
74
+ }
75
+ export function assertPositiveReadLimit(ctx, message = "limit must be a positive integer") {
76
+ if (ctx.limit !== undefined &&
77
+ (!Number.isInteger(ctx.limit) || ctx.limit < 1)) {
78
+ throw new Error(message);
79
+ }
80
+ }
81
+ /**
82
+ * Inbox reads follow source order and the returned cursor; search, offsets,
83
+ * sorting, matching, and time windows are unsupported.
84
+ */
85
+ export function assertInboxSourceRead(ctx, sourceLabel) {
86
+ const message = `${sourceLabel} inbox reads use source order and the returned cursor; ` +
87
+ `search, offsets, sorting, matching, and time windows are unsupported`;
88
+ assertNoOffsetPaging(ctx, message);
89
+ assertNoSort(ctx, message);
90
+ assertNoWindow(ctx, message);
91
+ assertNoMatch(ctx, message);
92
+ assertNoQuery(ctx, message);
93
+ }
94
+ /**
95
+ * Bounded snapshot reads support no pagination, sorting, time windows, or
96
+ * exact-match filters.
97
+ */
98
+ export function assertSnapshotSourceRead(ctx, sourceLabel) {
99
+ const message = `${sourceLabel} snapshot feeds do not support pagination, sorting, ` +
100
+ `time windows, or exact-match filters`;
101
+ assertNoCursor(ctx, message);
102
+ assertNoOffsetPaging(ctx, message);
103
+ assertNoSort(ctx, message);
104
+ assertNoWindow(ctx, message);
105
+ assertNoMatch(ctx, message);
106
+ }
107
+ //# sourceMappingURL=browser-source-read.js.map
@@ -569,6 +569,16 @@ export interface FeedDefinition {
569
569
  eventKinds?: Record<string, {
570
570
  description?: string;
571
571
  metadataSchema?: Record<string, unknown>;
572
+ /**
573
+ * Opt in to a separate `<kind>.updated` Automation trigger when a sync
574
+ * supersedes this source item with changed durable content and strictly
575
+ * newer `occurred_at` activity. The original kind remains insert-only.
576
+ * Unchanged rows, volatile-only updates and cold-start backfills stay
577
+ * quiet. Use activity time for `occurred_at`, not a scheduled start time.
578
+ * A declared literal kind wins a collision; composite keys over 100
579
+ * characters are not derived. Persisted unchanged in feeds_schema.
580
+ */
581
+ updatedEvent?: boolean;
572
582
  /**
573
583
  * Generic event attribution declarations. New connector work should model
574
584
  * "who authored / what resource this event belongs to / what it is about"
@@ -34,6 +34,9 @@ export { calculateEngagementScore } from './scoring.js';
34
34
  export { ConnectorAutomationEventSchema, ConnectorAutomationSignalDraftSchema, SubscriptionCandidateSchema, } from './automation-triggers.js';
35
35
  export type { AutomationEventTrigger, AutomationScheduleTrigger, AutomationTrigger, AutomationWorkspaceEventTrigger, ConnectorAutomationEvent, ConnectorAutomationSignalDraft, ConnectorTriggerSignal, SubscriptionCandidate, } from './automation-triggers.js';
36
36
  export { applyLookbackCutoff } from './checkpoint/lookback.js';
37
+ export { buildInjectHandoffBannerExpression, truncateHandoffReason, } from './browser-handoff-banner.js';
38
+ export type { HandoffBannerOptions } from './browser-handoff-banner.js';
39
+ export { assertInboxSourceRead, assertNoCursor, assertNoMatch, assertNoOffsetPaging, assertNoQuery, assertNoSort, assertNoWindow, assertPositiveReadLimit, assertSnapshotSourceRead, jsonByteLength, SOURCE_RECORD_MAX_BYTES, SOURCE_REFERENCE_BATCH_MAX_EVENTS, splitReferenceBatches, } from './browser-source-read.js';
37
40
  export { buildTimestampCheckpoint, filterByCheckpoint, finalizeTimestampSync, } from './checkpoint/timestamp-watermark.js';
38
41
  export { validatePublicUrl, validateUrlDomain } from './url-guards.js';
39
42
  export { sleep } from './sleep.js';
@@ -33,6 +33,8 @@ export { ConnectorAutomationEventSchema, ConnectorAutomationSignalDraftSchema, S
33
33
  // The root must stay loadable inside a V8 isolate.
34
34
  // =============================================================================
35
35
  export { applyLookbackCutoff } from './checkpoint/lookback.js';
36
+ export { buildInjectHandoffBannerExpression, truncateHandoffReason, } from './browser-handoff-banner.js';
37
+ export { assertInboxSourceRead, assertNoCursor, assertNoMatch, assertNoOffsetPaging, assertNoQuery, assertNoSort, assertNoWindow, assertPositiveReadLimit, assertSnapshotSourceRead, jsonByteLength, SOURCE_RECORD_MAX_BYTES, SOURCE_REFERENCE_BATCH_MAX_EVENTS, splitReferenceBatches, } from './browser-source-read.js';
36
38
  export { buildTimestampCheckpoint, filterByCheckpoint, finalizeTimestampSync, } from './checkpoint/timestamp-watermark.js';
37
39
  export { validatePublicUrl, validateUrlDomain } from './url-guards.js';
38
40
  export { sleep } from './sleep.js';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobu/connector-sdk",
3
- "version": "22.0.0",
3
+ "version": "23.0.0",
4
4
  "description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,6 +20,14 @@
20
20
  "types": "./dist/browser-requirement.d.ts",
21
21
  "import": "./dist/browser-requirement.js"
22
22
  },
23
+ "./browser-handoff-banner": {
24
+ "types": "./dist/browser-handoff-banner.d.ts",
25
+ "import": "./dist/browser-handoff-banner.js"
26
+ },
27
+ "./browser-source-read": {
28
+ "types": "./dist/browser-source-read.d.ts",
29
+ "import": "./dist/browser-source-read.js"
30
+ },
23
31
  "./define-connector": {
24
32
  "import": {
25
33
  "types": "./dist/define-connector.d.ts",
@@ -1,7 +1,7 @@
1
1
  export declare const BROWSER_CAPABILITIES: readonly ["browser.tabs", "browser.scripting", "browser.history", "browser.bookmarks", "browser.downloads", "browser.notifications", "browser.debugger"];
2
2
  export declare const OS_CAPABILITIES: readonly ["os.shell", "os.files", "os.notifications"];
3
3
  export declare const IOS_CAPABILITIES: readonly ["ios.notifications", "ios.share-sheet", "ios.files"];
4
- export declare const MAC_DEVICE_CAPABILITIES: readonly ["automations.execute", "screentime", "local_directory", "healthkit", "photos", "calendar", "reminders", "system_audio", "computer_use"];
4
+ export declare const MAC_DEVICE_CAPABILITIES: readonly ["automations.execute", "screentime", "local_directory", "healthkit", "photos", "calendar", "reminders", "computer_use"];
5
5
  export declare const HEADLESS_CAPABILITIES: readonly ["os.shell", "os.files", "automations.execute"];
6
6
  export interface CapabilityAuthorizationResult {
7
7
  authorized: string[];
@@ -55,7 +55,6 @@ exports.MAC_DEVICE_CAPABILITIES = [
55
55
  "photos",
56
56
  "calendar",
57
57
  "reminders",
58
- "system_audio",
59
58
  "computer_use",
60
59
  ];
61
60
  // A server/VM with no UI or browser (the herdr box, a CI node, a k8s pod).
@@ -20,6 +20,8 @@
20
20
  export type ToolErrorCode =
21
21
  /** No auth profile configured for a connector that requires one. */
22
22
  "AUTH_MISSING"
23
+ /** Browser work stopped; an explicit bounded recovery or human handoff is required. */
24
+ | "BROWSER_INTERRUPTED"
23
25
  /** Credentials were rejected by the upstream (HTTP 401/403). */
24
26
  | "AUTH_INVALID"
25
27
  /** Connector / feed / connection / resource does not exist (HTTP 404). */
@@ -104,4 +106,34 @@ export interface ToolErrorSignal {
104
106
  * should source their retry decision from `isRetryable(classifyToolError(...))`.
105
107
  */
106
108
  export declare function classifyToolError(signal: ToolErrorSignal): ToolErrorCode;
109
+ /** Produced at the connector's page boundary, never inferred from error prose. */
110
+ declare const PAGE_INTERRUPTION_REASON_VALUES: readonly ["challenge_required", "login_required", "account_mismatch", "loading_failure"];
111
+ export type BrowserInterruptionReason = (typeof PAGE_INTERRUPTION_REASON_VALUES)[number] | "timeout" | "recovery_unavailable";
112
+ export interface BrowserRecovery {
113
+ recovery_id: string;
114
+ expires_at: string;
115
+ tab_id: number;
116
+ target_id: string;
117
+ window_id: number;
118
+ device_worker_id: string;
119
+ chrome_connection_id: number;
120
+ }
121
+ export declare class BrowserInterruptionError extends ToolError {
122
+ readonly reason: BrowserInterruptionReason;
123
+ readonly recovery?: BrowserRecovery | undefined;
124
+ constructor(reason: BrowserInterruptionReason, message: string, recovery?: BrowserRecovery | undefined);
125
+ toJSON(): {
126
+ recovery?: BrowserRecovery | undefined;
127
+ reason: BrowserInterruptionReason;
128
+ code: ToolErrorCode;
129
+ retryable: boolean;
130
+ message: string;
131
+ call_id?: string;
132
+ };
133
+ }
134
+ export declare function browserPageInterruption(value: unknown): {
135
+ reason: BrowserInterruptionReason;
136
+ message: string;
137
+ } | undefined;
138
+ export {};
107
139
  //# sourceMappingURL=connector-query-errors.d.ts.map
@@ -19,16 +19,21 @@
19
19
  * pick the right code; the catalog is the single source of truth for retryability.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.ToolError = exports.TOOL_ERRORS = void 0;
22
+ exports.BrowserInterruptionError = exports.ToolError = exports.TOOL_ERRORS = void 0;
23
23
  exports.isRetryable = isRetryable;
24
24
  exports.toToolErrorCode = toToolErrorCode;
25
25
  exports.isToolError = isToolError;
26
26
  exports.classifyToolError = classifyToolError;
27
+ exports.browserPageInterruption = browserPageInterruption;
27
28
  exports.TOOL_ERRORS = {
28
29
  AUTH_MISSING: {
29
30
  retryable: false,
30
31
  message: "No auth profile is configured for this connector.",
31
32
  },
33
+ BROWSER_INTERRUPTED: {
34
+ retryable: false,
35
+ message: "Browser reading was interrupted; see interruption.reason for the next step.",
36
+ },
32
37
  AUTH_INVALID: {
33
38
  retryable: false,
34
39
  message: "The connector's credentials were rejected.",
@@ -189,4 +194,39 @@ function classifyToolError(signal) {
189
194
  }
190
195
  return "INTERNAL";
191
196
  }
197
+ /** Produced at the connector's page boundary, never inferred from error prose. */
198
+ const PAGE_INTERRUPTION_REASON_VALUES = [
199
+ "challenge_required",
200
+ "login_required",
201
+ "account_mismatch",
202
+ "loading_failure",
203
+ ];
204
+ const PAGE_INTERRUPTION_REASONS = new Set(PAGE_INTERRUPTION_REASON_VALUES);
205
+ class BrowserInterruptionError extends ToolError {
206
+ constructor(reason, message, recovery) {
207
+ super("BROWSER_INTERRUPTED", message);
208
+ this.reason = reason;
209
+ this.recovery = recovery;
210
+ }
211
+ toJSON() {
212
+ return {
213
+ ...super.toJSON(),
214
+ reason: this.reason,
215
+ ...(this.recovery ? { recovery: this.recovery } : {}),
216
+ };
217
+ }
218
+ }
219
+ exports.BrowserInterruptionError = BrowserInterruptionError;
220
+ function browserPageInterruption(value) {
221
+ const marker = value?.__lobu_browser_interruption;
222
+ if (!marker ||
223
+ typeof marker.reason !== "string" ||
224
+ !PAGE_INTERRUPTION_REASONS.has(marker.reason) ||
225
+ typeof marker.message !== "string")
226
+ return undefined;
227
+ return {
228
+ reason: marker.reason,
229
+ message: marker.message.slice(0, 1000),
230
+ };
231
+ }
192
232
  //# sourceMappingURL=connector-query-errors.js.map
@@ -24,11 +24,11 @@ exports.ListConversationsAction = typebox_1.Type.Object({
24
24
  });
25
25
  exports.GetConversationAction = typebox_1.Type.Object({
26
26
  action: typebox_1.Type.Literal("get", {
27
- description: "Fetch one conversation by its (platform, conversation_id).",
27
+ description: "Fetch one conversation by id, optionally scoped to a platform.",
28
28
  }),
29
29
  agent_id: AgentId,
30
30
  platform: typebox_1.Type.Optional(typebox_1.Type.String({
31
- description: 'Conversation platform ("web" for app-owned conversations, or a channel platform like "slack"). Defaults to "web".',
31
+ description: 'Conversation platform ("web" for app-owned conversations, or a channel platform like "slack"). When omitted, resolves a unique active match for this agent across platforms; ambiguous ids return not found.',
32
32
  })),
33
33
  conversation_id: ConversationId,
34
34
  });
@@ -17,6 +17,7 @@ export declare const ReadFeedAction: import("@sinclair/typebox").TObject<{
17
17
  export declare const ReadFeedsAction: import("@sinclair/typebox").TObject<{
18
18
  action: import("@sinclair/typebox").TLiteral<"read_feeds">;
19
19
  reads: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
20
+ recovery_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
20
21
  feed_id: import("@sinclair/typebox").TInteger;
21
22
  query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
22
23
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
@@ -104,6 +105,18 @@ export declare const ManageFeedsResultSchema: import("@sinclair/typebox").TUnion
104
105
  error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
105
106
  error_code: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
106
107
  retryable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
108
+ interruption: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
109
+ reason: import("@sinclair/typebox").TString;
110
+ recovery: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
111
+ recovery_id: import("@sinclair/typebox").TString;
112
+ expires_at: import("@sinclair/typebox").TString;
113
+ tab_id: import("@sinclair/typebox").TInteger;
114
+ target_id: import("@sinclair/typebox").TString;
115
+ window_id: import("@sinclair/typebox").TInteger;
116
+ device_worker_id: import("@sinclair/typebox").TString;
117
+ chrome_connection_id: import("@sinclair/typebox").TInteger;
118
+ }>>;
119
+ }>>;
107
120
  }>>;
108
121
  failures: import("@sinclair/typebox").TInteger;
109
122
  timeout_ms: import("@sinclair/typebox").TInteger;
@@ -148,6 +161,7 @@ export declare const ManageFeedsSchema: import("@sinclair/typebox").TUnion<[impo
148
161
  }>, import("@sinclair/typebox").TObject<{
149
162
  action: import("@sinclair/typebox").TLiteral<"read_feeds">;
150
163
  reads: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
164
+ recovery_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
151
165
  feed_id: import("@sinclair/typebox").TInteger;
152
166
  query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
153
167
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
@@ -33,6 +33,11 @@ exports.ReadFeedAction = typebox_1.Type.Object({
33
33
  feed_id: typebox_1.Type.Number({ description: "Feed ID" }),
34
34
  });
35
35
  const FeedSourceRead = typebox_1.Type.Object({
36
+ recovery_id: typebox_1.Type.Optional(typebox_1.Type.String({
37
+ minLength: 1,
38
+ maxLength: 128,
39
+ description: "Consume a recovery handoff once for the identical source request, on its retained tab. The expected account is verified again.",
40
+ })),
36
41
  feed_id: typebox_1.Type.Integer({
37
42
  minimum: 1,
38
43
  description: "Feed ID to query at its source.",
@@ -183,6 +188,18 @@ exports.ManageFeedsResultSchema = typebox_1.Type.Union([
183
188
  error: typebox_1.Type.Optional(typebox_1.Type.String()),
184
189
  error_code: typebox_1.Type.Optional(typebox_1.Type.String()),
185
190
  retryable: typebox_1.Type.Optional(typebox_1.Type.Boolean()),
191
+ interruption: typebox_1.Type.Optional(typebox_1.Type.Object({
192
+ reason: typebox_1.Type.String(),
193
+ recovery: typebox_1.Type.Optional(typebox_1.Type.Object({
194
+ recovery_id: typebox_1.Type.String(),
195
+ expires_at: typebox_1.Type.String(),
196
+ tab_id: typebox_1.Type.Integer(),
197
+ target_id: typebox_1.Type.String(),
198
+ window_id: typebox_1.Type.Integer(),
199
+ device_worker_id: typebox_1.Type.String(),
200
+ chrome_connection_id: typebox_1.Type.Integer(),
201
+ })),
202
+ })),
186
203
  })),
187
204
  failures: typebox_1.Type.Integer(),
188
205
  timeout_ms: typebox_1.Type.Integer(),