@lobu/runtime-server 21.2.1 → 22.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 (388) hide show
  1. package/dist/catalogs/automations.json +40 -13
  2. package/dist/catalogs/connectors.json +16601 -597
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/README.md +7 -5
  5. package/dist/connectors/_google/actions.ts +270 -0
  6. package/dist/connectors/_google/discovery/calendar_v3.json +1 -0
  7. package/dist/connectors/_google/discovery/chat_v1.json +1 -0
  8. package/dist/connectors/_google/discovery/docs_v1.json +1 -0
  9. package/dist/connectors/_google/discovery/drive_v3.json +1 -0
  10. package/dist/connectors/_google/discovery/gmail_v1.json +1 -0
  11. package/dist/connectors/_google/discovery/people_v1.json +1 -0
  12. package/dist/connectors/_google/discovery/sheets_v4.json +1 -0
  13. package/dist/connectors/_google/discovery/tasks_v1.json +1 -0
  14. package/dist/connectors/_google/discovery/youtube_v3.json +1 -0
  15. package/dist/connectors/_google/discovery.ts +442 -0
  16. package/dist/connectors/_google/errors.ts +91 -0
  17. package/dist/connectors/_google/list-feed.ts +223 -0
  18. package/dist/connectors/_google/policies.ts +127 -0
  19. package/dist/connectors/agentid.ts +43 -0
  20. package/dist/connectors/chat-user-identity.ts +2 -1
  21. package/dist/connectors/github-automation-events.ts +9 -0
  22. package/dist/connectors/github-identity.ts +28 -3
  23. package/dist/connectors/github.ts +101 -59
  24. package/dist/connectors/google_calendar.ts +207 -719
  25. package/dist/connectors/google_drive.ts +16 -2
  26. package/dist/connectors/google_gmail.ts +51 -33
  27. package/dist/connectors/herdr.ts +406 -0
  28. package/dist/connectors/jira.ts +6 -6
  29. package/dist/connectors/linear.ts +7 -4
  30. package/dist/connectors/postgres.ts +27 -2
  31. package/dist/connectors/tiktok-inbox-page.js +230 -0
  32. package/dist/connectors/tiktok-web-page.js +211 -0
  33. package/dist/connectors/tiktok_web.ts +286 -0
  34. package/dist/connectors/whatsapp-web-adapter.js +228 -10
  35. package/dist/connectors/whatsapp-web-helpers.ts +47 -14
  36. package/dist/connectors/whatsapp-web-identity.ts +121 -0
  37. package/dist/connectors/whatsapp_web.ts +170 -29
  38. package/dist/connectors/x.ts +276 -136
  39. package/dist/db/migrations/20261005150000_retire_agent_tool_config.sql +31 -0
  40. package/dist/db/migrations/20261005173700_drop_retired_agent_tool_config.sql +29 -0
  41. package/dist/db/migrations/20261007010000_identity_association_guards.sql +242 -0
  42. package/dist/db/migrations/20261007010001_identity_association_indexes.sql +35 -0
  43. package/dist/db/migrations/20261007012000_connector_browser_requirement.sql +7 -0
  44. package/dist/db/migrations/20261009010000_identity_member_decision_indexes.sql +22 -0
  45. package/dist/db/migrations/20261009015900_retire_remaining_physical_merges.sql +196 -0
  46. package/dist/db/migrations/20261009020000_retire_physical_entity_merge.sql +82 -0
  47. package/dist/db/migrations/20261009030000_retire_physical_merge_indexes.sql +39 -0
  48. package/dist/db/migrations/20261009030001_drop_physical_entity_redirect.sql +62 -0
  49. package/dist/db/migrations/20261009040000_normalize_identity_decisions.sql +60 -0
  50. package/dist/db/migrations/20261010220000_notification_targets_user_event_order.sql +53 -0
  51. package/dist/db/migrations/20261010223000_device_workers_user_fresh_cover.sql +39 -0
  52. package/dist/db/migrations/20261010223001_runs_org_default_view.sql +41 -0
  53. package/dist/db/migrations/20261010223002_events_org_guidance.sql +42 -0
  54. package/dist/db/migrations/20261011002000_finish_product_eval_retirement.sql +37 -0
  55. package/dist/db/migrations/20261011160000_mcp_conversation_workspaces.sql +97 -0
  56. package/dist/db/migrations/20261013120000_events_live_org_effective_date.sql +42 -0
  57. package/dist/db/migrations/20261013150000_events_live_linked_org_ids_gin.sql +41 -0
  58. package/dist/db/migrations/20261014120000_clear_team_device_auto_pause.sql +34 -0
  59. package/dist/db/migrations/20261014150000_connector_webhook_event_type_backfill.sql +30 -0
  60. package/dist/db/migrations/20261014170000_retire_atlassian_mcp_webhook_refresh.sql +51 -0
  61. package/dist/db/migrations/20261015010000_connection_auth_profile_fk_set_null_column.sql +53 -0
  62. package/dist/db/migrations/20261015120000_personal_org_connector_auto_policy.sql +38 -0
  63. package/dist/db/migrations/preconditions/20261005150000_retire_agent_tool_config.sql +22 -0
  64. package/dist/db/migrations/preconditions/20261005173700_drop_retired_agent_tool_config.sql +13 -0
  65. package/dist/db/migrations/preconditions/20261009020000_retire_physical_entity_merge.sql +26 -0
  66. package/dist/db/migrations/preconditions/20261011002000_finish_product_eval_retirement.sql +14 -0
  67. package/dist/dependencies.bun.lock +135 -128
  68. package/dist/guest.bundle.js +131 -185
  69. package/dist/owletto/dist/assets/_-CEPl6gU4.js +3 -0
  70. package/dist/owletto/dist/assets/_-C_zNZben.js +2 -0
  71. package/dist/owletto/dist/assets/_-DtqBFgK5.js +1 -0
  72. package/dist/owletto/dist/assets/_agentId-CBC_SadO.js +2 -0
  73. package/dist/owletto/dist/assets/_agentId-QQW91cHX.js +2 -0
  74. package/dist/owletto/dist/assets/_automationId-YTTNksw6.js +2 -0
  75. package/dist/owletto/dist/assets/_connectorKey._connectionId-fK0h7RAp.js +2 -0
  76. package/dist/owletto/dist/assets/_connectorKey.index-C7TPS598.js +2 -0
  77. package/dist/owletto/dist/assets/_conversationId-CEhxlTIo.js +2 -0
  78. package/dist/owletto/dist/assets/_deploymentId-BQfYN1U2.js +2 -0
  79. package/dist/owletto/dist/assets/_eventId-Cl8GSdjg.js +2 -0
  80. package/dist/owletto/dist/assets/_name-t3oBJ6Zf.js +2 -0
  81. package/dist/owletto/dist/assets/_owner-cUtGHqSw.js +3 -0
  82. package/dist/owletto/dist/assets/_shape-bo2lMVCu.js +2 -0
  83. package/dist/owletto/dist/assets/_skillKey-Dwm4Q4wI.js +2 -0
  84. package/dist/owletto/dist/assets/_slug-CU1PuHB9.js +2 -0
  85. package/dist/owletto/dist/assets/_threadId-DtqBFgK5.js +1 -0
  86. package/dist/owletto/dist/assets/_viewKey-Bh6E_NxA.js +2 -0
  87. package/dist/owletto/dist/assets/_viewKey-D4jKl-Zf.js +2 -0
  88. package/dist/owletto/dist/assets/accept-invitation-D3OgJG4i.js +2 -0
  89. package/dist/owletto/dist/assets/activity-route-view-DQglkhXU.js +2 -0
  90. package/dist/owletto/dist/assets/agent-card-controls-DzRs4Ix9.js +2 -0
  91. package/dist/owletto/dist/assets/{agent-client-setup-list-BFtgRwe8.js → agent-client-setup-list-B2SvH7xD.js} +4 -3
  92. package/dist/owletto/dist/assets/agent-connect-pages-B6uKvT_X.js +2 -0
  93. package/dist/owletto/dist/assets/agent-editor-form-oUnIYHd7.js +2 -0
  94. package/dist/owletto/dist/assets/agent-guardrails-route-BaV1VpDh.js +2 -0
  95. package/dist/owletto/dist/assets/agent-loading-shells-CtZJM2Gc.js +2 -0
  96. package/dist/owletto/dist/assets/agent-permissions-matrix-Ds48KFK9.js +2 -0
  97. package/dist/owletto/dist/assets/{agent-skill-context-BAr2Dw3F.js → agent-skill-context-DPk5r08w.js} +2 -1
  98. package/dist/owletto/dist/assets/agent-skills-route-DYpB5H1J.js +2 -0
  99. package/dist/owletto/dist/assets/agent-subpage-shell-B3K_jPYR.js +2 -0
  100. package/dist/owletto/dist/assets/agent-thread-C8UaUTWc.js +6 -0
  101. package/dist/owletto/dist/assets/agents-F4mGI2oF.js +2 -0
  102. package/dist/owletto/dist/assets/agents-workbench-CMyk4PI7.js +2 -0
  103. package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +128 -0
  104. package/dist/owletto/dist/assets/app._appId-DH1Qutz6.js +2 -0
  105. package/dist/owletto/dist/assets/automation-detail-content-CEDNboId.js +2 -0
  106. package/dist/owletto/dist/assets/automations-F4mGI2oF.js +2 -0
  107. package/dist/owletto/dist/assets/{callback-CaRe2TOT.js → callback-CU-hb8JB.js} +2 -1
  108. package/dist/owletto/dist/assets/{card-CMmh2mzo.js → card-DIF8SF9b.js} +2 -1
  109. package/dist/owletto/dist/assets/claim-DELEa-gH.js +2 -0
  110. package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +1 -0
  111. package/dist/owletto/dist/assets/clients-CpG676mg.js +2 -0
  112. package/dist/owletto/dist/assets/code-editor-V27Z4o3P.js +16 -0
  113. package/dist/owletto/dist/assets/connect-B2YL6qIK.js +2 -0
  114. package/dist/owletto/dist/assets/connect._clientId-B6LDmDRV.js +2 -0
  115. package/dist/owletto/dist/assets/connected._clientId-D_HaKoI1.js +2 -0
  116. package/dist/owletto/dist/assets/connected._clientId.activity-DQWcUqKM.js +2 -0
  117. package/dist/owletto/dist/assets/connected._clientId.index-BC3R303A.js +2 -0
  118. package/dist/owletto/dist/assets/connection-DySpRE9x.js +2 -0
  119. package/dist/owletto/dist/assets/connection-feed-detail-C_D68j6d.js +2 -0
  120. package/dist/owletto/dist/assets/connection-label-BobuYiAG.js +1 -0
  121. package/dist/owletto/dist/assets/connections-browser-Cnv2iBbZ.js +2 -0
  122. package/dist/owletto/dist/assets/{connector-provenance-BjKiUhYE.js → connector-provenance-CNXtzYg5.js} +2 -1
  123. package/dist/owletto/dist/assets/connector-scope-lists-BKDetNDc.js +2 -0
  124. package/dist/owletto/dist/assets/{connectors-Baejya0T.js → connectors-BJnk1z_2.js} +2 -1
  125. package/dist/owletto/dist/assets/consent-BVzxrAO9.js +2 -0
  126. package/dist/owletto/dist/assets/conversations-table-DfZGICl7.js +2 -0
  127. package/dist/owletto/dist/assets/{core.esm-QA7BQgiK.js → core.esm-DiTpULFl.js} +2 -1
  128. package/dist/owletto/dist/assets/create-CUqO6Kfk.js +2 -0
  129. package/dist/owletto/dist/assets/create-JRFM8mMf.js +2 -0
  130. package/dist/owletto/dist/assets/create-automation-form-_4vUkrls.js +3 -0
  131. package/dist/owletto/dist/assets/create-iHcxV0xd.js +2 -0
  132. package/dist/owletto/dist/assets/create._connectorKey-CCYLEicg.js +2 -0
  133. package/dist/owletto/dist/assets/{cronstrue-2GHCtD7h.js → cronstrue-DPXl0qA2.js} +2 -1
  134. package/dist/owletto/dist/assets/deployments-DCQdFdwG.js +2 -0
  135. package/dist/owletto/dist/assets/{deployments-body-Bm2upStd.js → deployments-body-D6TAWs_6.js} +2 -1
  136. package/dist/owletto/dist/assets/deployments-ihkhK1zV.js +2 -0
  137. package/dist/owletto/dist/assets/device-CntqYW65.js +2 -0
  138. package/dist/owletto/dist/assets/device-pin-tombstone-Bz4JHHMK.js +2 -0
  139. package/dist/owletto/dist/assets/device._deviceId-D4plO3GM.js +2 -0
  140. package/dist/owletto/dist/assets/{entity-options-CrbS6K-i.js → entity-options-UJs64GdQ.js} +2 -1
  141. package/dist/owletto/dist/assets/entity-page-Djz6T50J.js +2 -0
  142. package/dist/owletto/dist/assets/entity-type-page-OznRag6A.js +2 -0
  143. package/dist/owletto/dist/assets/event-detail-04qOUGIP.js +2 -0
  144. package/dist/owletto/dist/assets/events-feed-fucGZSJR.js +2 -0
  145. package/dist/owletto/dist/assets/filter-editors-DCQgGLyR.js +2 -0
  146. package/dist/owletto/dist/assets/full-page-spinner-KpV2FS2u.js +2 -0
  147. package/dist/owletto/dist/assets/guardrails-molekzAF.js +2 -0
  148. package/dist/owletto/dist/assets/identity-BJcaG66g.js +2 -0
  149. package/dist/owletto/dist/assets/index-B04ON9Jv.js +2 -0
  150. package/dist/owletto/dist/assets/index-BEvyBdOU.js +2 -0
  151. package/dist/owletto/dist/assets/{index-Cf0GJoiG.js → index-BJXkc60S.js} +2 -1
  152. package/dist/owletto/dist/assets/index-BLEcy9-T.css +1 -0
  153. package/dist/owletto/dist/assets/index-BNh2cidi.js +2 -0
  154. package/dist/owletto/dist/assets/index-BOsK-K-2.js +2 -0
  155. package/dist/owletto/dist/assets/{index-DlepU3cY.js → index-BOzuAbvi.js} +2 -1
  156. package/dist/owletto/dist/assets/index-Bk1x7A67.js +2 -0
  157. package/dist/owletto/dist/assets/index-CDz3-ieP.js +1 -0
  158. package/dist/owletto/dist/assets/index-CFnx5huL.js +2 -0
  159. package/dist/owletto/dist/assets/index-D3s8rhG9.js +2 -0
  160. package/dist/owletto/dist/assets/index-DCdkwg9H.js +2 -0
  161. package/dist/owletto/dist/assets/index-Dbd1jusf.js +2 -0
  162. package/dist/owletto/dist/assets/index-DqZuqC08.js +2 -0
  163. package/dist/owletto/dist/assets/index-Dr-Xg_xO.js +2 -0
  164. package/dist/owletto/dist/assets/index-DtqBFgK5.js +1 -0
  165. package/dist/owletto/dist/assets/index-KPOvMVa-.js +2 -0
  166. package/dist/owletto/dist/assets/index-Vcq4gwWv.js +1 -0
  167. package/dist/owletto/dist/assets/index-_oPeVpL_.js +7950 -0
  168. package/dist/owletto/dist/assets/index-rrnUF981.js +1 -0
  169. package/dist/owletto/dist/assets/json-diff-D_Ym3Uku.js +4 -0
  170. package/dist/owletto/dist/assets/{list-skeleton-BtWn2eo2.js → list-skeleton-Bl0OS39L.js} +2 -1
  171. package/dist/owletto/dist/assets/login-QHdxqX-4.js +2 -0
  172. package/dist/owletto/dist/assets/logout-DUccApuZ.js +2 -0
  173. package/dist/owletto/dist/assets/member-scope-gate-CFbrq1by.js +2 -0
  174. package/dist/owletto/dist/assets/memory-browse-page-IrIXuZTF.js +103 -0
  175. package/dist/owletto/dist/assets/model-selector-CB1BDvlW.js +2 -0
  176. package/dist/owletto/dist/assets/models-DnMb3n-Z.js +2 -0
  177. package/dist/owletto/dist/assets/new-B5UsLiy6.js +2 -0
  178. package/dist/owletto/dist/assets/new-BWo8_Pms.js +2 -0
  179. package/dist/owletto/dist/assets/new-DpmDXmFI.js +2 -0
  180. package/dist/owletto/dist/assets/oauth-workspace-access-PGyTnW2K.js +2 -0
  181. package/dist/owletto/dist/assets/organization-BH8PYlVu.js +2 -0
  182. package/dist/owletto/dist/assets/peek-pane-content-B2AFNTzP.js +2 -0
  183. package/dist/owletto/dist/assets/{permissions-h_qSft1A.js → permissions-CwN_YP3u.js} +2 -1
  184. package/dist/owletto/dist/assets/proposal-review-shell-DKKGu4Ww.js +2 -0
  185. package/dist/owletto/dist/assets/public-shell-ready-7KYnww6e.js +2 -0
  186. package/dist/owletto/dist/assets/{recent-JiBNvZzD.js → recent-DqdZE_TI.js} +2 -1
  187. package/dist/owletto/dist/assets/record-activity-CvgZyCmw.js +2 -0
  188. package/dist/owletto/dist/assets/{renderer-DgPLyEbx.js → renderer-BL6VcwQH.js} +28 -27
  189. package/dist/owletto/dist/assets/reset-password-DAvBYkiI.js +2 -0
  190. package/dist/owletto/dist/assets/runs-BWtc5rmc.js +2 -0
  191. package/dist/owletto/dist/assets/runs-panel-BO3h5RkS.js +2 -0
  192. package/dist/owletto/dist/assets/runs-table-DxIiqrSk.js +2 -0
  193. package/dist/owletto/dist/assets/settings-4Ev-0iNL.js +2 -0
  194. package/dist/owletto/dist/assets/settings-Crxlwps-.js +2 -0
  195. package/dist/owletto/dist/assets/skill-editor-D_W3QlRz.js +1 -0
  196. package/dist/owletto/dist/assets/skills-D0X430X8.js +2 -0
  197. package/dist/owletto/dist/assets/source-record-panels-CRIPMWfN.js +2 -0
  198. package/dist/owletto/dist/assets/status-dot-C5KDvvm9.js +2 -0
  199. package/dist/owletto/dist/assets/tabs-B4Er9hJj.js +2 -0
  200. package/dist/owletto/dist/assets/{use-mention-search-B4DfZFm5.js → use-mention-search-DqEykWl_.js} +3 -2
  201. package/dist/owletto/dist/assets/view-param-filters-Cylutoy1.js +2 -0
  202. package/dist/owletto/dist/assets/workspace-label-o_QfBuCM.js +2 -0
  203. package/dist/owletto/dist/index.html +46 -4
  204. package/dist/providers.json +1 -1
  205. package/dist/server-main.bundle.mjs +135551 -132880
  206. package/npm-shrinkwrap.json +578 -611
  207. package/package.json +4 -3
  208. package/vendor/connector-sdk/dist/browser-requirement.d.ts +36 -0
  209. package/vendor/connector-sdk/dist/browser-requirement.js +60 -0
  210. package/vendor/connector-sdk/dist/connector-runtime.d.ts +3 -1
  211. package/vendor/connector-sdk/dist/connector-runtime.js +10 -0
  212. package/vendor/connector-sdk/dist/connector-types.d.ts +159 -45
  213. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -2
  214. package/vendor/connector-sdk/dist/define-connector.js +3 -0
  215. package/vendor/connector-sdk/dist/index.d.ts +5 -2
  216. package/vendor/connector-sdk/dist/index.js +1 -0
  217. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +16 -21
  218. package/vendor/connector-sdk/dist/reaction-client-types.typecheck.d.ts +5 -0
  219. package/vendor/connector-sdk/package.json +5 -1
  220. package/vendor/core/dist/agent-policy.js +1 -1
  221. package/vendor/core/dist/agent-store.d.ts +2 -0
  222. package/vendor/core/dist/agent-tooling.d.ts +1 -1
  223. package/vendor/core/dist/agent-tooling.js +1 -1
  224. package/vendor/core/dist/capabilities.js +2 -0
  225. package/vendor/core/dist/contracts/agent-settings.d.ts +0 -11
  226. package/vendor/core/dist/contracts/agent-settings.js +1 -7
  227. package/vendor/core/dist/contracts/tools/collection-presentation.d.ts +93 -0
  228. package/vendor/core/dist/contracts/tools/collection-presentation.js +88 -0
  229. package/vendor/core/dist/contracts/tools/collection-selection.d.ts +47 -0
  230. package/vendor/core/dist/contracts/tools/collection-selection.js +74 -0
  231. package/vendor/core/dist/contracts/tools/manage-agents.d.ts +10 -4
  232. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +1 -1
  233. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +5 -1
  234. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +19 -4
  235. package/vendor/core/dist/contracts/tools/manage-automations.js +25 -8
  236. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +1 -0
  237. package/vendor/core/dist/contracts/tools/manage-connections.js +3 -0
  238. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +11 -0
  239. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +42 -3
  240. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +181 -152
  241. package/vendor/core/dist/contracts/tools/manage-entity.js +118 -162
  242. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +41 -3
  243. package/vendor/core/dist/contracts/tools/manage-operations.js +40 -2
  244. package/vendor/core/dist/contracts/tools/manage-views.d.ts +182 -7
  245. package/vendor/core/dist/contracts/tools/manage-views.js +49 -13
  246. package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +11 -2
  247. package/vendor/core/dist/contracts/tools/read-knowledge.js +23 -3
  248. package/vendor/core/dist/contracts/tools/save-memory.d.ts +3 -6
  249. package/vendor/core/dist/contracts/tools/save-memory.js +2 -6
  250. package/vendor/core/dist/contracts/tools/view-attach.d.ts +2 -1
  251. package/vendor/core/dist/contracts/tools/view-attach.js +7 -2
  252. package/vendor/core/dist/contracts/worker/protocol.d.ts +122 -28
  253. package/vendor/core/dist/contracts/worker/protocol.js +81 -17
  254. package/vendor/core/dist/index.d.ts +3 -4
  255. package/vendor/core/dist/index.js +3 -6
  256. package/vendor/core/dist/json-template.d.ts +6 -10
  257. package/vendor/core/dist/json-template.js +5 -9
  258. package/vendor/core/dist/logger.js +11 -5
  259. package/vendor/core/dist/shell-safety.d.ts +9 -0
  260. package/vendor/core/dist/shell-safety.js +154 -0
  261. package/vendor/core/dist/suggestions.d.ts +1 -1
  262. package/vendor/core/dist/suggestions.js +1 -1
  263. package/vendor/core/dist/tool-trace-summary.d.ts +1 -1
  264. package/vendor/core/dist/tool-trace-summary.js +1 -1
  265. package/vendor/core/dist/types.d.ts +1 -3
  266. package/vendor/core/dist/utils/diagnostic-scrubber.d.ts +7 -0
  267. package/vendor/core/dist/utils/{sentry-scrubber.js → diagnostic-scrubber.js} +25 -53
  268. package/vendor/core/dist/worker/auth.d.ts +44 -6
  269. package/vendor/core/dist/worker/auth.js +44 -11
  270. package/vendor/core/package.json +15 -6
  271. package/vendor/views/dist/api.d.ts +39 -29
  272. package/vendor/views/dist/api.js +110 -83
  273. package/vendor/views/dist/bridge.d.ts +4 -0
  274. package/vendor/views/dist/bridge.js +15 -0
  275. package/vendor/views/dist/index.d.ts +1 -0
  276. package/vendor/views/dist/index.js +0 -7
  277. package/vendor/views/package.json +4 -1
  278. package/dist/owletto/dist/assets/_-CLhipgJI.js +0 -1
  279. package/dist/owletto/dist/assets/_-D0ZVGAIA.js +0 -2
  280. package/dist/owletto/dist/assets/_agentId-BLXUf3ot.js +0 -1
  281. package/dist/owletto/dist/assets/_agentId-DnI66MF3.js +0 -1
  282. package/dist/owletto/dist/assets/_automationId-ziwseLb7.js +0 -1
  283. package/dist/owletto/dist/assets/_connectorKey._connectionId-B6V3ySFK.js +0 -1
  284. package/dist/owletto/dist/assets/_connectorKey.index-CR5u_dtt.js +0 -1
  285. package/dist/owletto/dist/assets/_conversationId-FBMYmOl8.js +0 -1
  286. package/dist/owletto/dist/assets/_deploymentId-DNTXbT_m.js +0 -1
  287. package/dist/owletto/dist/assets/_name-B37LKIxH.js +0 -1
  288. package/dist/owletto/dist/assets/_owner-BxYumqC2.js +0 -1
  289. package/dist/owletto/dist/assets/_shape-Bxz-04jR.js +0 -1
  290. package/dist/owletto/dist/assets/_skillKey-D5MFbiw2.js +0 -1
  291. package/dist/owletto/dist/assets/_slug-Dlhit09k.js +0 -1
  292. package/dist/owletto/dist/assets/_viewKey-C6535i-t.js +0 -1
  293. package/dist/owletto/dist/assets/_viewKey-CQCtY3Y8.js +0 -1
  294. package/dist/owletto/dist/assets/_viewKey-CxKfKbRa.js +0 -1
  295. package/dist/owletto/dist/assets/accept-invitation-BQQwec3R.js +0 -1
  296. package/dist/owletto/dist/assets/activity-route-view-BwThvdGs.js +0 -1
  297. package/dist/owletto/dist/assets/agent-card-controls-B3RhzsPz.js +0 -1
  298. package/dist/owletto/dist/assets/agent-connect-pages-BO4wQn4L.js +0 -1
  299. package/dist/owletto/dist/assets/agent-editor-form-BYC4uSNz.js +0 -1
  300. package/dist/owletto/dist/assets/agent-guardrails-route-Dp02G1AQ.js +0 -1
  301. package/dist/owletto/dist/assets/agent-loading-shells-OagauQzV.js +0 -1
  302. package/dist/owletto/dist/assets/agent-permissions-matrix-B9Ho3P1t.js +0 -1
  303. package/dist/owletto/dist/assets/agent-skills-route-B4VUnVi0.js +0 -1
  304. package/dist/owletto/dist/assets/agent-subpage-shell-Dz8I-GUt.js +0 -1
  305. package/dist/owletto/dist/assets/agent-thread-B9-cdkaV.js +0 -8
  306. package/dist/owletto/dist/assets/agent-thread-storage-U6htL3ad.js +0 -1
  307. package/dist/owletto/dist/assets/agents-D0CIg4b9.js +0 -1
  308. package/dist/owletto/dist/assets/agents-workbench-C2sr5h82.js +0 -1
  309. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +0 -127
  310. package/dist/owletto/dist/assets/app._appId-DLsJ_QWS.js +0 -1
  311. package/dist/owletto/dist/assets/automation-detail-content-9Rjb_I9j.js +0 -1
  312. package/dist/owletto/dist/assets/automations-D0CIg4b9.js +0 -1
  313. package/dist/owletto/dist/assets/calendar-DAiyi1ZL.js +0 -1
  314. package/dist/owletto/dist/assets/claim-CYHnUF7G.js +0 -1
  315. package/dist/owletto/dist/assets/clients-Cp1BJ28u.js +0 -1
  316. package/dist/owletto/dist/assets/code-editor-CYsR2VBP.js +0 -15
  317. package/dist/owletto/dist/assets/connect-CZip2g_B.js +0 -1
  318. package/dist/owletto/dist/assets/connect._clientId-CEKY8Dnv.js +0 -1
  319. package/dist/owletto/dist/assets/connected._clientId-C5xRjxNO.js +0 -1
  320. package/dist/owletto/dist/assets/connection-C06HZ241.js +0 -1
  321. package/dist/owletto/dist/assets/connection-feed-detail-D1whY5hL.js +0 -1
  322. package/dist/owletto/dist/assets/consent-CfYDldcF.js +0 -1
  323. package/dist/owletto/dist/assets/create-C3P-3_8O.js +0 -1
  324. package/dist/owletto/dist/assets/create-CwnrPUEw.js +0 -1
  325. package/dist/owletto/dist/assets/create-DOScS9Gl.js +0 -1
  326. package/dist/owletto/dist/assets/create-automation-form-CuxiIRCF.js +0 -2
  327. package/dist/owletto/dist/assets/create._connectorKey-Bjv3lCf8.js +0 -1
  328. package/dist/owletto/dist/assets/deployments-ByBv1DW-.js +0 -1
  329. package/dist/owletto/dist/assets/deployments-C-_ECORv.js +0 -1
  330. package/dist/owletto/dist/assets/device-B0i7Xp8y.js +0 -1
  331. package/dist/owletto/dist/assets/device-automation-BIjs7DZJ.js +0 -1
  332. package/dist/owletto/dist/assets/device-pin-tombstone-Bd6vS2zu.js +0 -1
  333. package/dist/owletto/dist/assets/device-rows-Bwf8qDte.js +0 -1
  334. package/dist/owletto/dist/assets/device._deviceId-DJLAesm3.js +0 -1
  335. package/dist/owletto/dist/assets/entity-page-ijZe_1-6.js +0 -1
  336. package/dist/owletto/dist/assets/entity-type-page-onp2Tk_E.js +0 -1
  337. package/dist/owletto/dist/assets/event-page-C0B2UDY-.js +0 -1
  338. package/dist/owletto/dist/assets/events-feed-DK35T4g7.js +0 -1
  339. package/dist/owletto/dist/assets/full-page-spinner-Dd8eEaxq.js +0 -1
  340. package/dist/owletto/dist/assets/guardrails-DKO8_J-G.js +0 -1
  341. package/dist/owletto/dist/assets/identity-CKM54vrM.js +0 -1
  342. package/dist/owletto/dist/assets/index--VmN5WxW.js +0 -1
  343. package/dist/owletto/dist/assets/index-B2AmRqYh.js +0 -7898
  344. package/dist/owletto/dist/assets/index-B_rcEgFX.js +0 -1
  345. package/dist/owletto/dist/assets/index-BmAuAhub.css +0 -1
  346. package/dist/owletto/dist/assets/index-BmhGe6-Z.js +0 -1
  347. package/dist/owletto/dist/assets/index-C1dJSGrL.js +0 -1
  348. package/dist/owletto/dist/assets/index-CAFw4qCb.js +0 -1
  349. package/dist/owletto/dist/assets/index-CCcc_xBw.js +0 -52
  350. package/dist/owletto/dist/assets/index-CLU3gXVm.js +0 -1
  351. package/dist/owletto/dist/assets/index-CqQVnAY-.js +0 -1
  352. package/dist/owletto/dist/assets/index-CxT0uyIe.js +0 -1
  353. package/dist/owletto/dist/assets/index-DR08e6Ec.js +0 -1
  354. package/dist/owletto/dist/assets/index-DYb9L5FC.js +0 -1
  355. package/dist/owletto/dist/assets/index-SUUcQGT-.js +0 -1
  356. package/dist/owletto/dist/assets/index-SdiFOfR1.js +0 -1
  357. package/dist/owletto/dist/assets/index-zcfi5r1l.js +0 -1
  358. package/dist/owletto/dist/assets/json-diff-ClBBYBQD.js +0 -3
  359. package/dist/owletto/dist/assets/login-d3PdO-qV.js +0 -1
  360. package/dist/owletto/dist/assets/logout-DgckxwLn.js +0 -1
  361. package/dist/owletto/dist/assets/member-scope-gate-DXOCfx-v.js +0 -1
  362. package/dist/owletto/dist/assets/memory-browse-page-CeAnKoTR.js +0 -101
  363. package/dist/owletto/dist/assets/missing-view-DrZ8m8yo.js +0 -1
  364. package/dist/owletto/dist/assets/model-selector-CapL1ARf.js +0 -1
  365. package/dist/owletto/dist/assets/models-CB8mhq7j.js +0 -1
  366. package/dist/owletto/dist/assets/new-BBUb-VR4.js +0 -1
  367. package/dist/owletto/dist/assets/new-CBLJ25_w.js +0 -1
  368. package/dist/owletto/dist/assets/new-tTXB4qBW.js +0 -1
  369. package/dist/owletto/dist/assets/oauth-workspace-access-DearynqZ.js +0 -1
  370. package/dist/owletto/dist/assets/organization-BgdBg-PJ.js +0 -1
  371. package/dist/owletto/dist/assets/pending-seed-CPbfgnLX.js +0 -1
  372. package/dist/owletto/dist/assets/proposal-review-shell-D4YNrrye.js +0 -1
  373. package/dist/owletto/dist/assets/reset-password-B8tWPtIj.js +0 -1
  374. package/dist/owletto/dist/assets/runs-oHveuEUB.js +0 -1
  375. package/dist/owletto/dist/assets/runs-panel-C56GDaJm.js +0 -1
  376. package/dist/owletto/dist/assets/runs-table-BUKDjiBc.js +0 -1
  377. package/dist/owletto/dist/assets/schema-value-normalization-3JuM_r1H.js +0 -1
  378. package/dist/owletto/dist/assets/settings-DaKg6U5O.js +0 -1
  379. package/dist/owletto/dist/assets/settings-DhnRi2nq.js +0 -1
  380. package/dist/owletto/dist/assets/skills-BpQncuMC.js +0 -1
  381. package/dist/owletto/dist/assets/switch-BQ40_DMb.js +0 -1
  382. package/dist/owletto/dist/assets/use-applied-views-B-Z-Weji.js +0 -1
  383. package/dist/owletto/dist/assets/view-frame-C7ciEoLo.js +0 -1
  384. package/vendor/core/dist/sentry.d.ts +0 -26
  385. package/vendor/core/dist/sentry.js +0 -133
  386. package/vendor/core/dist/tool-policy.d.ts +0 -74
  387. package/vendor/core/dist/tool-policy.js +0 -305
  388. package/vendor/core/dist/utils/sentry-scrubber.d.ts +0 -29
@@ -4,16 +4,15 @@
4
4
  * Supports two auth modes:
5
5
  * - OAuth 2.0 user context against the X API v2 (preferred when a token is
6
6
  * available — the ToS-compliant path).
7
- * - The paired Owletto Chrome extension (fallback). Mirrors the LinkedIn
8
- * connector: we attach the CDP Network domain in the user's signed-in
9
- * x.com tab via the extension's `chrome.*` action dispatcher, drive scroll
10
- * pagination, and parse the GraphQL responses the page emits. No Playwright,
11
- * no cookie cache, no `--remote-debugging-port` plumbing.
7
+ * - A separate, verified browser connection through the paired Owletto Chrome
8
+ * extension. Mirrors the LinkedIn connector: we attach the CDP Network domain
9
+ * in the user's signed-in x.com tab via the extension's `chrome.*` action
10
+ * dispatcher, drive scroll pagination, and parse the GraphQL responses the
11
+ * page emits. No Playwright, cookie cache, or `--remote-debugging-port` plumbing.
12
12
  *
13
- * Auth is implicit on the extension path: the user is already signed into
14
- * x.com in the paired Chrome. There is no fallback path — if no online
15
- * Owletto extension is reachable in the connection's org, the sync fails fast
16
- * with a clear "no paired Owletto extension" error.
13
+ * Browser access requires a verified browser-authenticated connection.
14
+ * An OAuth connection does not gain browser access from a device pin; API
15
+ * failures stay on the OAuth path when no browser grant is available.
17
16
  *
18
17
  * Feeds:
19
18
  * - tweets: search by query or track a handle (API v2 or extension search)
@@ -21,29 +20,34 @@
21
20
  * - liked_tweets: posts the user has liked (API v2 or signed-in extension backfill)
22
21
  * - bookmarks: posts the user has bookmarked (API v2 or extension)
23
22
  * - direct_messages: 1:1 and group DMs (OAuth API; extension fallback on /messages)
24
- * - home_feed: personalized x.com home timeline (extension only — there
25
- * is no public API for the "For you" / "Following" timeline;
23
+ * - following_timeline: live chronological Following timeline (OAuth API,
24
+ * source reads only; does not import tweet events)
25
+ * - home_feed: personalized x.com home timeline (extension only — the
26
+ * API does not expose the algorithmic "For you" timeline;
26
27
  * read via content-script scrape because CDP network capture
27
28
  * blocks the feed from rendering, same as LinkedIn home_feed)
28
29
  */
29
30
 
30
31
  import {
32
+ requireBrowser,
31
33
  type ActionContext,
32
34
  type ActionResult,
33
35
  type ChromeActionDispatcher,
34
- type RuntimeConnectorDefinition,
35
- type EventAttributionRule,
36
- type EventAttributionTargetSpec,
37
- type EntityTraitSpec,
38
36
  ConnectorRuntime,
39
37
  calculateEngagementScore,
40
38
  createHttpClient,
39
+ type EntityTraitSpec,
40
+ type EventAttributionRule,
41
+ type EventAttributionTargetSpec,
41
42
  type EventEnvelope,
42
43
  extensionDomScrape,
43
44
  extensionNetworkSync,
44
- HttpStatusError,
45
+ type FeedReadContext,
46
+ type FeedReadResult,
45
47
  type HttpClient,
48
+ HttpStatusError,
46
49
  paginateByCursor,
50
+ type RuntimeConnectorDefinition,
47
51
  type SyncContext,
48
52
  type SyncResult,
49
53
  } from "@lobu/connector-sdk";
@@ -54,7 +58,8 @@ type XSyncPage = {
54
58
  checkpoint: Record<string, unknown>;
55
59
  metadata?: SyncResult["metadata"];
56
60
  };
57
- import { X_IDENTITY, normalizeXHandle } from "./x-identity.js";
61
+
62
+ import { normalizeXHandle, X_IDENTITY } from "./x-identity.js";
58
63
 
59
64
  /** OAuth scopes needed per feed for the API path (not used to pause browser-capable feeds). */
60
65
  const X_OAUTH_FEED_SCOPES: Record<string, readonly string[]> = {
@@ -353,12 +358,23 @@ const X_DM_COUNTERPARTY_ATTRIBUTIONS: EventAttributionRule[] = [
353
358
  entityType: "person",
354
359
  titlePath: "metadata.sender_name",
355
360
  identities: [
356
- { namespace: X_IDENTITY.USER_ID, eventPath: "metadata.sender_id", primary: true },
357
- { namespace: X_IDENTITY.HANDLE, eventPath: "metadata.sender_handle", matchOnly: true },
361
+ {
362
+ namespace: X_IDENTITY.USER_ID,
363
+ eventPath: "metadata.sender_id",
364
+ primary: true,
365
+ },
366
+ {
367
+ namespace: X_IDENTITY.HANDLE,
368
+ eventPath: "metadata.sender_handle",
369
+ matchOnly: true,
370
+ },
358
371
  ],
359
372
  },
360
373
  traits: {
361
- x_handle: { eventPath: "metadata.sender_handle", mergeStrategy: "prefer_non_empty" },
374
+ x_handle: {
375
+ eventPath: "metadata.sender_handle",
376
+ mergeStrategy: "prefer_non_empty",
377
+ },
362
378
  // Same trait key as X_PERSON_AUTHOR_TRAITS / DM counterparty — keep
363
379
  // person metadata vocabulary consistent across X attribution paths.
364
380
  x_display_name: {
@@ -526,8 +542,7 @@ function buildApiTweet(
526
542
  )?.id;
527
543
 
528
544
  const authorId = tweet.author_id;
529
- const username =
530
- usernameById.get(authorId ?? "") ?? defaultUsername ?? "";
545
+ const username = usernameById.get(authorId ?? "") ?? defaultUsername ?? "";
531
546
 
532
547
  return {
533
548
  id: tweet.id,
@@ -1230,28 +1245,11 @@ export function finalizeLikedTweetsResult(
1230
1245
 
1231
1246
  // ── Extension dispatcher ───────────────────────────────────────
1232
1247
  //
1233
- // Pulled from sessionState — the connector-worker host splices a live
1234
- // `chrome_dispatcher` onto the sessionState of every sync AND every action run;
1235
- // the dispatcher's `dispatch()` rides a host capability up to the gateway's
1236
- // /api/workers/dispatch-chrome-action bridge and out to the paired Owletto
1237
- // extension. When no extension is online in the connection's org, the bridge
1248
+ // Granted as ctx.browser only for the declared browser authentication mode.
1249
+ // The dispatcher's dispatch() rides a host capability up to the gateway's
1250
+ // /api/workers/dispatch-chrome-action bridge and out to the connection's
1251
+ // selected Owletto extension. When that browser is offline, the bridge
1238
1252
  // returns `failed` and the dispatcher throws — we surface that verbatim.
1239
- //
1240
- // Structurally typed rather than taking SyncContext, so `execute()` can pass an
1241
- // ActionContext without either context type having to know about the other.
1242
- function requireExtensionDispatcher(ctx: {
1243
- sessionState?: Record<string, unknown> | null;
1244
- }): ChromeActionDispatcher {
1245
- const handle = ctx.sessionState?.chrome_dispatcher as
1246
- | ChromeActionDispatcher
1247
- | undefined;
1248
- if (!handle || typeof handle.dispatch !== "function") {
1249
- throw new Error(
1250
- "X connector requires a paired Owletto Chrome extension. No chrome_dispatcher was injected into sessionState — re-run on a connector-worker that has the dispatcher bridge.",
1251
- );
1252
- }
1253
- return handle;
1254
- }
1255
1253
 
1256
1254
  // ── Sync paths ─────────────────────────────────────────────────
1257
1255
 
@@ -1430,6 +1428,17 @@ class XLikesPageTracker {
1430
1428
 
1431
1429
  type XSyncBackend = "oauth_api" | "extension";
1432
1430
 
1431
+ function requireXBrowser(
1432
+ ctx: Pick<SyncContext, "browser">,
1433
+ ): ChromeActionDispatcher {
1434
+ if (!ctx.browser) {
1435
+ throw new Error(
1436
+ "Use a separate X connection authenticated through your paired Chrome browser for browser-only feeds and actions.",
1437
+ );
1438
+ }
1439
+ return requireBrowser(ctx);
1440
+ }
1441
+
1433
1442
  function parseGrantedScopes(scope: string | null | undefined): Set<string> {
1434
1443
  if (!scope) return new Set();
1435
1444
  return new Set(
@@ -1461,8 +1470,7 @@ function readSyncBackendPreference(
1461
1470
  }
1462
1471
 
1463
1472
  /**
1464
- * Browser-first: when OAuth exists but the token lacks feed scopes, use the
1465
- * paired extension instead of failing against the API.
1473
+ * Use browser fallback only when this connection has an authorized browser grant.
1466
1474
  */
1467
1475
  function resolveSyncBackend(
1468
1476
  ctx: SyncContext,
@@ -1470,13 +1478,12 @@ function resolveSyncBackend(
1470
1478
  requiredScopes: readonly string[] | undefined,
1471
1479
  ): XSyncBackend {
1472
1480
  const preference = readSyncBackendPreference(config);
1473
- if (preference === "extension") return "extension";
1474
- if (preference === "oauth_api" && ctx.credentials?.accessToken) {
1475
- return "oauth_api";
1476
- }
1477
-
1478
1481
  const accessToken = ctx.credentials?.accessToken;
1479
- if (!accessToken) return "extension";
1482
+ if (preference === "extension" || !accessToken) {
1483
+ requireXBrowser(ctx);
1484
+ return "extension";
1485
+ }
1486
+ if (preference === "oauth_api" || !ctx.browser) return "oauth_api";
1480
1487
 
1481
1488
  const granted = parseGrantedScopes(ctx.credentials?.scope);
1482
1489
  if (!hasGrantedScopes(granted, requiredScopes)) return "extension";
@@ -1517,13 +1524,14 @@ async function syncWithOAuthFallback<T extends XSyncPage>(
1517
1524
  }
1518
1525
  }
1519
1526
 
1520
- /** Browser-first feeds fall back to the extension unless `use_oauth` is set. */
1527
+ /** Fall back only when the connection has a browser grant and OAuth is not forced. */
1521
1528
  async function syncOAuthWithOptionalFallback<T extends XSyncPage>(
1529
+ ctx: SyncContext,
1522
1530
  config: Record<string, unknown>,
1523
1531
  oauthFn: () => Promise<T>,
1524
1532
  extensionFn: () => Promise<T>,
1525
1533
  ): Promise<T> {
1526
- if (isTruthyConfigFlag(config.use_oauth)) return oauthFn();
1534
+ if (!ctx.browser || isTruthyConfigFlag(config.use_oauth)) return oauthFn();
1527
1535
  return syncWithOAuthFallback(oauthFn, extensionFn);
1528
1536
  }
1529
1537
 
@@ -1535,8 +1543,9 @@ function extractViewerUserId(json: unknown): string | undefined {
1535
1543
  (data?.data as Record<string, unknown> | undefined)?.user_result,
1536
1544
  ];
1537
1545
  for (const node of candidates) {
1538
- const result = (node as { user_results?: { result?: { rest_id?: string } } })
1539
- ?.user_results?.result;
1546
+ const result = (
1547
+ node as { user_results?: { result?: { rest_id?: string } } }
1548
+ )?.user_results?.result;
1540
1549
  if (result?.rest_id) return String(result.rest_id);
1541
1550
  }
1542
1551
  return undefined;
@@ -1562,9 +1571,7 @@ function buildBrowserDmMessage(
1562
1571
  const createdAt = String(
1563
1572
  messageData.time ?? messageData.created_at ?? messageData.timestamp ?? "",
1564
1573
  );
1565
- const senderId = String(
1566
- messageData.sender_id ?? messageNode.sender_id ?? "",
1567
- );
1574
+ const senderId = String(messageData.sender_id ?? messageNode.sender_id ?? "");
1568
1575
  const conversationId = String(
1569
1576
  messageNode.conversation_id ??
1570
1577
  messageNode.conversationId ??
@@ -1641,17 +1648,13 @@ function extractDmMessagesFromNode(
1641
1648
 
1642
1649
  const content = record.content;
1643
1650
  if (content && typeof content === "object") {
1644
- messages.push(
1645
- ...extractDmMessagesFromNode(content, authUserId, seen),
1646
- );
1651
+ messages.push(...extractDmMessagesFromNode(content, authUserId, seen));
1647
1652
  }
1648
1653
 
1649
1654
  const entries = record.entries;
1650
1655
  if (Array.isArray(entries)) {
1651
1656
  for (const entry of entries) {
1652
- messages.push(
1653
- ...extractDmMessagesFromNode(entry, authUserId, seen),
1654
- );
1657
+ messages.push(...extractDmMessagesFromNode(entry, authUserId, seen));
1655
1658
  }
1656
1659
  }
1657
1660
 
@@ -1681,9 +1684,7 @@ function extractDmMessagesFromNode(
1681
1684
  record.user_events,
1682
1685
  ];
1683
1686
  for (const candidate of nestedCandidates) {
1684
- messages.push(
1685
- ...extractDmMessagesFromNode(candidate, authUserId, seen),
1686
- );
1687
+ messages.push(...extractDmMessagesFromNode(candidate, authUserId, seen));
1687
1688
  }
1688
1689
 
1689
1690
  return messages;
@@ -1729,6 +1730,99 @@ async function resolveAuthenticatedUser(
1729
1730
  return { id, username };
1730
1731
  }
1731
1732
 
1733
+ /** Read one source-owned page. No sync/commit path or browser fallback exists. */
1734
+ async function readFollowingTimeline(
1735
+ ctx: FeedReadContext,
1736
+ ): Promise<FeedReadResult> {
1737
+ if (!ctx.credentials?.accessToken) {
1738
+ throw new Error("X Following source reads require OAuth credentials.");
1739
+ }
1740
+ if (ctx.query?.trim() || ctx.offset || ctx.match || ctx.window) {
1741
+ throw new Error(
1742
+ "X Following source reads support cursor pagination, not queries, offsets, matches, or window coverage.",
1743
+ );
1744
+ }
1745
+ if (
1746
+ ctx.sort &&
1747
+ !(ctx.sort.column === "occurred_at" && ctx.sort.order === "desc")
1748
+ ) {
1749
+ throw new Error(
1750
+ "X Following source reads only support occurred_at descending.",
1751
+ );
1752
+ }
1753
+ const limit = ctx.limit ?? 50;
1754
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
1755
+ throw new Error(
1756
+ "X Following source read limit must be an integer from 1 to 100.",
1757
+ );
1758
+ }
1759
+ const http = createOAuthHttpClient(ctx.credentials.accessToken);
1760
+ const user = await resolveAuthenticatedUser(http);
1761
+ const expected = ctx.config.expected_account_handle;
1762
+ if (
1763
+ typeof expected === "string" &&
1764
+ normalizeXHandle(expected) !== normalizeXHandle(user.username)
1765
+ ) {
1766
+ throw new Error(
1767
+ `Authenticated X account @${user.username} does not match expected account ${expected}.`,
1768
+ );
1769
+ }
1770
+ const url = new URL(
1771
+ `https://api.x.com/2/users/${encodeURIComponent(user.id)}/timelines/reverse_chronological`,
1772
+ );
1773
+ url.searchParams.set("max_results", String(limit));
1774
+ url.searchParams.set("tweet.fields", `${TWEET_FIELDS},entities`);
1775
+ url.searchParams.set("expansions", "author_id");
1776
+ url.searchParams.set("user.fields", "username,name,protected");
1777
+ if (ctx.cursor) url.searchParams.set("pagination_token", ctx.cursor);
1778
+ const page = await http.get<
1779
+ Omit<XApiListResponse, "data" | "includes"> & {
1780
+ data?: Array<XApiTweetRecord & { entities?: { urls?: XExpandedUrl[] } }>;
1781
+ includes?: { users?: Array<XApiUserRecord & { protected?: boolean }> };
1782
+ }
1783
+ >(url.toString());
1784
+ if (
1785
+ page.errors?.length ||
1786
+ (!Array.isArray(page.data) && page.meta?.result_count !== 0)
1787
+ ) {
1788
+ throw new Error("X Following API returned an incomplete or invalid page.");
1789
+ }
1790
+ const authors = new Map(
1791
+ (page.includes?.users ?? []).map((author) => [author.id, author]),
1792
+ );
1793
+ const handles = new Map(
1794
+ [...authors].map(([id, author]) => [id, author.username ?? ""]),
1795
+ );
1796
+ const rows: Record<string, unknown>[] = [];
1797
+ for (const record of page.data ?? []) {
1798
+ const tweet = buildApiTweet(record, handles);
1799
+ if (!tweet || !Number.isFinite(tweet.publishedAt.getTime())) {
1800
+ throw new Error(
1801
+ "X Following API returned a post without valid identity, content, or timestamp.",
1802
+ );
1803
+ }
1804
+ const author = authors.get(record.author_id ?? "");
1805
+ // A missing author/protection flag cannot establish public visibility.
1806
+ if (ctx.config.public_only === true && author?.protected !== false)
1807
+ continue;
1808
+ tweet.authorDisplayName = author?.name;
1809
+ tweet.urls = record.entities?.urls;
1810
+ const event = tweetToEvent(tweet);
1811
+ rows.push({
1812
+ ...event,
1813
+ metadata: {
1814
+ ...event.metadata,
1815
+ author_protected: author?.protected ?? null,
1816
+ },
1817
+ });
1818
+ }
1819
+ return {
1820
+ rows,
1821
+ nextCursor: page.meta?.next_token,
1822
+ hasMore: Boolean(page.meta?.next_token),
1823
+ };
1824
+ }
1825
+
1732
1826
  async function resolveAccountHandle(
1733
1827
  config: Record<string, unknown>,
1734
1828
  http?: HttpClient,
@@ -1887,7 +1981,7 @@ async function syncViaExtension(args: {
1887
1981
  const { ctx, url, interceptPatterns, parseResponse, maxScrolls, checkpoint } =
1888
1982
  args;
1889
1983
  const result = await extensionNetworkSync<XTweet>({
1890
- dispatcher: requireExtensionDispatcher(ctx),
1984
+ dispatcher: requireXBrowser(ctx),
1891
1985
  config: {
1892
1986
  interceptPatterns,
1893
1987
  allowedOrigins: X_ALLOWED_ORIGINS,
@@ -2007,7 +2101,7 @@ async function syncLikedTweetsViaExtension(
2007
2101
  ): Promise<XSyncPage> {
2008
2102
  const accountHandle = await resolveAccountHandle(config);
2009
2103
  const likesUrl = `https://x.com/${encodeURIComponent(accountHandle)}/likes`;
2010
- const dispatcher = requireExtensionDispatcher(ctx);
2104
+ const dispatcher = requireXBrowser(ctx);
2011
2105
  const previouslyComplete = checkpoint.likes_backfill_status === "complete";
2012
2106
  const pageBudget = previouslyComplete
2013
2107
  ? readLikesIncrementalPageBudget(config)
@@ -2061,15 +2155,15 @@ async function syncLikedTweetsViaExtension(
2061
2155
  url: likesUrl,
2062
2156
  parseResponse,
2063
2157
  checkAuth: (currentUrl) => !isXAuthWall(currentUrl),
2064
- triggerNextPage: async (_tabId, browserDispatcher, sessionId) => {
2065
- let requestUrl: string | undefined;
2066
- try {
2067
- requestUrl = pages.prepareReplay();
2068
- } catch {
2069
- parserErrors.push("X likes cursor rewrite failed");
2070
- return;
2071
- }
2072
- if (!requestUrl) return;
2158
+ triggerNextPage: async (_tabId, browserDispatcher, sessionId) => {
2159
+ let requestUrl: string | undefined;
2160
+ try {
2161
+ requestUrl = pages.prepareReplay();
2162
+ } catch {
2163
+ parserErrors.push("X likes cursor rewrite failed");
2164
+ return;
2165
+ }
2166
+ if (!requestUrl) return;
2073
2167
  let observation: { ok?: boolean; status?: number };
2074
2168
  try {
2075
2169
  observation = await browserDispatcher.dispatch<{
@@ -2236,11 +2330,16 @@ async function syncBookmarksViaOAuthApi(
2236
2330
  maxPages,
2237
2331
  );
2238
2332
 
2239
- return finalizeSyncResult(tweets, checkpoint, {
2240
- backend: "oauth_api",
2241
- api_calls: pageCount,
2242
- feed: "bookmarks",
2243
- }, { originType: "bookmark" });
2333
+ return finalizeSyncResult(
2334
+ tweets,
2335
+ checkpoint,
2336
+ {
2337
+ backend: "oauth_api",
2338
+ api_calls: pageCount,
2339
+ feed: "bookmarks",
2340
+ },
2341
+ { originType: "bookmark" },
2342
+ );
2244
2343
  }
2245
2344
 
2246
2345
  async function syncBookmarksViaExtension(
@@ -2270,14 +2369,10 @@ function parseApiDmListResponse(
2270
2369
  const usernameById = new Map(
2271
2370
  users.map((user) => [user.id, user.username ?? ""]),
2272
2371
  );
2273
- const nameById = new Map(
2274
- users.map((user) => [user.id, user.name ?? ""]),
2275
- );
2372
+ const nameById = new Map(users.map((user) => [user.id, user.name ?? ""]));
2276
2373
 
2277
2374
  return (json.data ?? [])
2278
- .map((event) =>
2279
- buildDmMessage(event, authUserId, usernameById, nameById),
2280
- )
2375
+ .map((event) => buildDmMessage(event, authUserId, usernameById, nameById))
2281
2376
  .filter((message): message is XDmMessage => message !== null);
2282
2377
  }
2283
2378
 
@@ -2347,7 +2442,7 @@ async function syncDirectMessagesViaExtension(
2347
2442
  : "";
2348
2443
 
2349
2444
  const result = await extensionNetworkSync<XDmMessage>({
2350
- dispatcher: requireExtensionDispatcher(ctx),
2445
+ dispatcher: requireXBrowser(ctx),
2351
2446
  config: {
2352
2447
  interceptPatterns: [
2353
2448
  { regex: "/i/api/graphql/\\w+/.*DM" },
@@ -2388,7 +2483,7 @@ async function syncHomeFeedViaDomScrape(
2388
2483
  ): Promise<XSyncPage> {
2389
2484
  const maxScrolls = readScrollBudget(config, { defaultMax: 10, cap: 30 });
2390
2485
  const { items: rows, loggedIn } = await extensionDomScrape<HomeFeedRow>({
2391
- dispatcher: requireExtensionDispatcher(ctx),
2486
+ dispatcher: requireXBrowser(ctx),
2392
2487
  url: "https://x.com/home",
2393
2488
  config: {
2394
2489
  ...HOME_FEED_SCRAPE_CONFIG,
@@ -2420,7 +2515,7 @@ const backendPreferenceProperties = {
2420
2515
  type: "boolean",
2421
2516
  default: false,
2422
2517
  description:
2423
- "Force the paired Chrome extension even when OAuth is available.",
2518
+ "Use the paired Chrome browser. Requires a separate X connection authenticated with the browser method.",
2424
2519
  },
2425
2520
  use_oauth: {
2426
2521
  type: "boolean",
@@ -3092,9 +3187,28 @@ export default class XConnector extends ConnectorRuntime {
3092
3187
  key: "x",
3093
3188
  name: "X (Twitter)",
3094
3189
  description:
3095
- "Fetches tweets, browser-visible like history, bookmarks, and DMs through the X API v2 or the paired Owletto Chrome extension. Links social actors into the person graph.",
3096
- version: "3.13.7",
3190
+ "Fetches tweets, browser-visible like history, bookmarks, and DMs through the X API v2 or the paired Owletto Chrome extension, and reads the chronological Following timeline live through the X API. Links social actors into the person graph.",
3191
+ version: "3.14.2",
3097
3192
  faviconDomain: "x.com",
3193
+ browser: {
3194
+ origins: ["https://x.com", "https://twitter.com"],
3195
+ authMethods: ["browser"],
3196
+ accountProbe: {
3197
+ url: "https://x.com/home",
3198
+ // twid is the signed-in user id, not a bearer credential or mutable handle.
3199
+ expression: `(async () => {
3200
+ for (let i = 0; i < 40; i++) {
3201
+ const profile = document.querySelector('[data-testid=AppTabBar_Profile_Link]');
3202
+ const raw = document.cookie.split('; ').find(cookie => cookie.startsWith('twid='));
3203
+ const identity = raw ? decodeURIComponent(raw.slice(5)) : '';
3204
+ if (profile && /^u=[0-9]+$/.test(identity)) return { accountId: identity.slice(2) };
3205
+ if (/login|signup|account\\/access/.test(location.pathname)) return null;
3206
+ await new Promise(resolve => setTimeout(resolve, 250));
3207
+ }
3208
+ return null;
3209
+ })()`,
3210
+ },
3211
+ },
3098
3212
  authSchema: {
3099
3213
  methods: [
3100
3214
  {
@@ -3108,18 +3222,13 @@ export default class XConnector extends ConnectorRuntime {
3108
3222
  "bookmark.read",
3109
3223
  "dm.read",
3110
3224
  ],
3111
- loginScopes: [
3112
- "users.read",
3113
- "tweet.read",
3114
- "like.read",
3115
- "bookmark.read",
3116
- "dm.read",
3117
- "offline.access",
3118
- "users.email",
3119
- ],
3225
+ // X requires tweet.read for /2/users/me, even for identity-only login.
3226
+ loginScopes: ["users.read", "tweet.read", "users.email"],
3120
3227
  authorizationUrl: "https://x.com/i/oauth2/authorize",
3121
3228
  tokenUrl: "https://api.x.com/2/oauth2/token",
3122
- userinfoUrl: "https://api.x.com/2/users/me?user.fields=username",
3229
+ // No userinfoUrl: declaring one routes sign-in through generic OIDC,
3230
+ // which cannot read X's nested profile. Connect gets it from the
3231
+ // server's built-in twitter provider config instead.
3123
3232
  tokenEndpointAuthMethod: "client_secret_basic",
3124
3233
  usePkce: true,
3125
3234
  clientIdKey: "TWITTER_CLIENT_ID",
@@ -3129,16 +3238,49 @@ export default class XConnector extends ConnectorRuntime {
3129
3238
  setupInstructions:
3130
3239
  "Create an X OAuth 2.0 app, add {{redirect_uri}} as the callback URL, then paste the client ID and client secret below.",
3131
3240
  loginProvisioning: {
3132
- autoCreateConnection: true,
3241
+ autoCreateConnection: false,
3133
3242
  },
3134
3243
  },
3135
3244
  {
3136
- type: "none",
3137
- label: "Paired Chrome extension",
3245
+ type: "browser",
3246
+ mode: "live",
3138
3247
  },
3139
3248
  ],
3140
3249
  },
3141
3250
  feeds: {
3251
+ following_timeline: {
3252
+ key: "following_timeline",
3253
+ name: "Following Timeline (live)",
3254
+ description:
3255
+ "Read the authenticated account's chronological Following timeline through the X API without importing tweet events. Bounded by X's available recent history; does not provide window coverage or the algorithmic For You feed.",
3256
+ read: readFollowingTimeline,
3257
+ configSchema: {
3258
+ type: "object",
3259
+ additionalProperties: false,
3260
+ properties: {
3261
+ expected_account_handle: {
3262
+ type: "string",
3263
+ pattern: "^@?[A-Za-z0-9_]{1,15}$",
3264
+ description:
3265
+ "Optional account identity check. Reject reads when the authorized account has a different handle.",
3266
+ },
3267
+ public_only: {
3268
+ type: "boolean",
3269
+ default: false,
3270
+ description:
3271
+ "Return only posts whose expanded author is explicitly public. Protected or unknown authors are excluded; pagination is preserved.",
3272
+ },
3273
+ },
3274
+ },
3275
+ eventKinds: {
3276
+ tweet: {
3277
+ description: "A source-owned post from the Following timeline",
3278
+ },
3279
+ reply: {
3280
+ description: "A source-owned reply from the Following timeline",
3281
+ },
3282
+ },
3283
+ },
3142
3284
  tweets: {
3143
3285
  key: "tweets",
3144
3286
  name: "Tweets",
@@ -3164,7 +3306,7 @@ export default class XConnector extends ConnectorRuntime {
3164
3306
  name: "My Posts",
3165
3307
  sync: (ctx) => this.syncFeed(ctx),
3166
3308
  description:
3167
- "Posts and replies authored by the connected account. Uses the X API when OAuth is available, otherwise the paired Chrome extension.",
3309
+ "Posts and replies authored by the connected account. OAuth connections use the X API; browser-authenticated connections use the paired Chrome extension.",
3168
3310
  configSchema: accountTimelineConfigSchema,
3169
3311
  eventKinds: {
3170
3312
  tweet: {
@@ -3184,7 +3326,7 @@ export default class XConnector extends ConnectorRuntime {
3184
3326
  name: "Liked Posts",
3185
3327
  sync: (ctx) => this.syncFeed(ctx),
3186
3328
  description:
3187
- "Posts the connected account has liked. OAuth remains available for API-backed feeds; the paired signed-in Chrome extension performs resumable cursor backfill and incremental collection.",
3329
+ "Posts the connected account has liked. OAuth connections use the X API; browser-authenticated connections use the paired Chrome extension for resumable cursor backfill and incremental collection.",
3188
3330
  configSchema: likedTweetsConfigSchema,
3189
3331
  eventKinds: {
3190
3332
  liked_tweet: {
@@ -3199,7 +3341,7 @@ export default class XConnector extends ConnectorRuntime {
3199
3341
  name: "Bookmarks",
3200
3342
  sync: (ctx) => this.syncFeed(ctx),
3201
3343
  description:
3202
- "Posts bookmarked by the connected account. Uses the X API when OAuth is available, otherwise the paired Chrome extension.",
3344
+ "Posts bookmarked by the connected account. OAuth connections use the X API; browser-authenticated connections use the paired Chrome extension.",
3203
3345
  configSchema: bookmarksConfigSchema,
3204
3346
  eventKinds: {
3205
3347
  bookmark: {
@@ -3214,7 +3356,7 @@ export default class XConnector extends ConnectorRuntime {
3214
3356
  name: "Direct Messages",
3215
3357
  sync: (ctx) => this.syncFeed(ctx),
3216
3358
  description:
3217
- "Direct message events across all conversations. Uses the X API when dm.read is granted, otherwise the paired Chrome extension on /messages. Auto-creates person entities for 1:1 counterparts.",
3359
+ "Direct message events across all conversations. OAuth connections use the X API and require dm.read; browser-authenticated connections use the paired Chrome extension on /messages. Auto-creates person entities for 1:1 counterparts.",
3218
3360
  configSchema: bookmarksConfigSchema,
3219
3361
  eventKinds: {
3220
3362
  dm_message: {
@@ -3229,7 +3371,7 @@ export default class XConnector extends ConnectorRuntime {
3229
3371
  name: "Home Timeline",
3230
3372
  sync: (ctx) => this.syncFeed(ctx),
3231
3373
  description:
3232
- "Your personalized x.com home timeline (For you + Following). Extension-only via content-script scrape — there is no public API for the home timeline.",
3374
+ "Your personalized x.com home timeline (For you + Following). Requires a separate X connection authenticated through your paired Chrome browser. Use following_timeline for source-only chronological reads through the official API.",
3233
3375
  configSchema: homeFeedConfigSchema,
3234
3376
  eventKinds: {
3235
3377
  tweet: {
@@ -3246,7 +3388,7 @@ export default class XConnector extends ConnectorRuntime {
3246
3388
  kind: "write",
3247
3389
  name: "Prepare reply",
3248
3390
  description:
3249
- "Stage a reply draft after the user opens the exact X post (fill the reply composer). NEVER opens a tab or submits — the human must click Reply. No auto-post path exists.",
3391
+ "Requires an X connection authenticated through your paired Chrome browser. Stage a reply draft after the user opens the exact X post (fill the reply composer). NEVER opens a tab or submits — the human must click Reply. No auto-post path exists.",
3250
3392
  annotations: {
3251
3393
  destructiveHint: false,
3252
3394
  idempotentHint: false,
@@ -3326,7 +3468,7 @@ export default class XConnector extends ConnectorRuntime {
3326
3468
  if (!tweetRef) {
3327
3469
  return { success: false, error: "tweet_url or tweet_id is required" };
3328
3470
  }
3329
- const output = await prepareXReply(requireExtensionDispatcher(ctx), {
3471
+ const output = await prepareXReply(requireXBrowser(ctx), {
3330
3472
  tweetUrl: tweetRef,
3331
3473
  body,
3332
3474
  banner: ctx.input.banner !== false,
@@ -3344,11 +3486,14 @@ export default class XConnector extends ConnectorRuntime {
3344
3486
  }
3345
3487
 
3346
3488
  private async syncFeed(ctx: SyncContext): Promise<SyncResult> {
3347
- // Collected whole, then committed once: an OAuth attempt that fails part
3348
- // way falls back to the extension, and nothing it gathered may land first.
3489
+ // Collect before committing so an authorized browser fallback cannot
3490
+ // duplicate events gathered by a partially failed OAuth attempt.
3349
3491
  const page = await this.collectFeed(ctx);
3350
3492
  await ctx.commit(page.events, page.checkpoint);
3351
- return { status: "complete", ...(page.metadata ? { metadata: page.metadata } : {}) };
3493
+ return {
3494
+ status: "complete",
3495
+ ...(page.metadata ? { metadata: page.metadata } : {}),
3496
+ };
3352
3497
  }
3353
3498
 
3354
3499
  private async collectFeed(ctx: SyncContext): Promise<XSyncPage> {
@@ -3357,17 +3502,16 @@ export default class XConnector extends ConnectorRuntime {
3357
3502
  const feedKey = ctx.feedKey ?? "tweets";
3358
3503
  const oauthScopes = X_OAUTH_FEED_SCOPES[feedKey];
3359
3504
 
3360
- // The home timeline has no public API — it is always served by the
3361
- // extension, regardless of whether an OAuth token is present.
3505
+ // This feed reads the home page through the browser, regardless of
3506
+ // whether an OAuth token is present.
3362
3507
  if (feedKey === "home_feed") {
3363
3508
  return syncHomeFeedViaDomScrape(ctx, config, checkpoint);
3364
3509
  }
3365
3510
 
3366
3511
  if (feedKey === "my_tweets") {
3367
- if (
3368
- resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api"
3369
- ) {
3512
+ if (resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api") {
3370
3513
  return syncOAuthWithOptionalFallback(
3514
+ ctx,
3371
3515
  config,
3372
3516
  () => syncMyTweetsViaOAuthApi(ctx, config, checkpoint),
3373
3517
  () => syncMyTweetsViaExtension(ctx, config, checkpoint),
@@ -3377,10 +3521,9 @@ export default class XConnector extends ConnectorRuntime {
3377
3521
  }
3378
3522
 
3379
3523
  if (feedKey === "liked_tweets") {
3380
- if (
3381
- resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api"
3382
- ) {
3524
+ if (resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api") {
3383
3525
  return syncOAuthWithOptionalFallback(
3526
+ ctx,
3384
3527
  config,
3385
3528
  () => syncLikedTweetsViaOAuthApi(ctx, config, checkpoint),
3386
3529
  () => syncLikedTweetsViaExtension(ctx, config, checkpoint),
@@ -3390,10 +3533,9 @@ export default class XConnector extends ConnectorRuntime {
3390
3533
  }
3391
3534
 
3392
3535
  if (feedKey === "bookmarks") {
3393
- if (
3394
- resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api"
3395
- ) {
3536
+ if (resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api") {
3396
3537
  return syncOAuthWithOptionalFallback(
3538
+ ctx,
3397
3539
  config,
3398
3540
  () => syncBookmarksViaOAuthApi(ctx, config, checkpoint),
3399
3541
  () => syncBookmarksViaExtension(ctx, config, checkpoint),
@@ -3403,10 +3545,9 @@ export default class XConnector extends ConnectorRuntime {
3403
3545
  }
3404
3546
 
3405
3547
  if (feedKey === "direct_messages") {
3406
- if (
3407
- resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api"
3408
- ) {
3548
+ if (resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api") {
3409
3549
  return syncOAuthWithOptionalFallback(
3550
+ ctx,
3410
3551
  config,
3411
3552
  () => syncDirectMessagesViaOAuthApi(ctx, config, checkpoint),
3412
3553
  () => syncDirectMessagesViaExtension(ctx, config, checkpoint),
@@ -3415,12 +3556,11 @@ export default class XConnector extends ConnectorRuntime {
3415
3556
  return syncDirectMessagesViaExtension(ctx, config, checkpoint);
3416
3557
  }
3417
3558
 
3418
- // `tweets` feed: prefer the official API when scopes are sufficient,
3419
- // otherwise the extension's signed-in search.
3420
- if (
3421
- resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api"
3422
- ) {
3559
+ // OAuth connections stay on the API even when scopes are missing; browser
3560
+ // search requires this connection's browser grant.
3561
+ if (resolveSyncBackend(ctx, config, oauthScopes) === "oauth_api") {
3423
3562
  return syncOAuthWithOptionalFallback(
3563
+ ctx,
3424
3564
  config,
3425
3565
  () => syncViaOAuthApi(ctx, config, checkpoint),
3426
3566
  () => syncSearchViaExtension(ctx, config, checkpoint),