@lobu/runtime-server 23.0.0 → 24.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.
- package/dist/catalogs/connectors.json +70 -6
- package/dist/catalogs/skills.json +1 -1
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +1 -1
- package/dist/connectors/linkedin-inbox-adapter.js +4 -7
- package/dist/connectors/linkedin.ts +53 -34
- package/dist/connectors/reddit.ts +92 -20
- package/dist/connectors/slack.ts +1 -0
- package/dist/connectors/whatsapp-web-adapter.js +41 -11
- package/dist/connectors/whatsapp-web-helpers.ts +1 -1
- package/dist/connectors/whatsapp_web.ts +2 -2
- package/dist/connectors/x-identity.ts +5 -3
- package/dist/db/migrations/20261019120000_retire_identities_of_deleted_entities.sql +21 -0
- package/dist/db/migrations/20261020120000_entities_live_metadata_domain.sql +66 -0
- package/dist/db/migrations/20261020130000_agents_starters.sql +14 -0
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +71 -0
- package/dist/dependencies.bun.lock +63 -60
- package/dist/guest.bundle.js +362 -300
- package/dist/owletto/dist/assets/_-CC8cTmRg.js +3 -0
- package/dist/owletto/dist/assets/_-ksFp4zVf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DWUFSrVp.js +2 -0
- package/dist/owletto/dist/assets/_agentId-MENLoohA.js +2 -0
- package/dist/owletto/dist/assets/_automationId-BnHqdXOC.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CefXIqy2.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-C1QPGf9E.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-DinuPCUp.js +2 -0
- package/dist/owletto/dist/assets/{_deploymentId-BuUzGtVL.js → _deploymentId-BeyzVjRm.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-3L_qeL_l.js +2 -0
- package/dist/owletto/dist/assets/_name-Dgedji78.js +2 -0
- package/dist/owletto/dist/assets/_owner-DbrKma4e.js +3 -0
- package/dist/owletto/dist/assets/_shape-DtVfRFz_.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-CqLHzm7L.js +2 -0
- package/dist/owletto/dist/assets/_slug-ndDr_CUg.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-3CH5w8mr.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DHQY9A8u.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-w17IFTtf.js → accept-invitation-CRKbM2Xy.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-CFLNukhD.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-mnTN2AZt.js → agent-card-controls-Be1Okb2C.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-Bg3hBfUV.js → agent-client-setup-list-BA8dU_C6.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-CAV-yXus.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-Bi6WvYX-.js +2 -0
- package/dist/owletto/dist/assets/{agent-guardrails-route-BOrCXcAl.js → agent-guardrails-route-DMOjG1D4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-Dqcvky-k.js → agent-loading-shells-De_2d8Lr.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-BOo_4r_4.js → agent-permissions-matrix-gZWl6mAe.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-CCdvtlmH.js → agent-skill-context-JLaTamGR.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BUxIswuq.js → agent-skills-route-DcK41PWj.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-BBJoyTuC.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-Buz3naVF.js +6 -0
- package/dist/owletto/dist/assets/agents-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CqaKGggb.js +2 -0
- package/dist/owletto/dist/assets/app._appId-Cl1fTuIt.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-BMLL4lxO.js +2 -0
- package/dist/owletto/dist/assets/automations-C-ReckCa.js +2 -0
- package/dist/owletto/dist/assets/callback-DTKKsfkz.js +2 -0
- package/dist/owletto/dist/assets/{card-Djgp00r_.js → card-yU0TmNRH.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BYUZnyMp.js → claim-DJfTvlT2.js} +2 -2
- package/dist/owletto/dist/assets/client-rows--FrZfJol.js +2 -0
- package/dist/owletto/dist/assets/{clients-D3Zbjxin.js → clients-L4K1UT8c.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-DHeyRGZI.js → code-editor-U54Gwjit.js} +2 -2
- package/dist/owletto/dist/assets/connect-4zqtnDHb.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-Dj0SqgbE.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-sgtocSvf.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-DTpSW1Xy.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-h9X5H1x8.js +2 -0
- package/dist/owletto/dist/assets/{connection-C3XXFEqh.js → connection-ByvKkyFm.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CIJJLDP8.js → connection-feed-detail-DWM9lTao.js} +2 -2
- package/dist/owletto/dist/assets/connections-browser-CEwYrYqt.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-8-d8hl10.js → connector-provenance-BocTm__v.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-OYDOydtz.js +2 -0
- package/dist/owletto/dist/assets/connectors-CyZpcE5f.js +2 -0
- package/dist/owletto/dist/assets/{consent-CdSvVCgx.js → consent-DdfINrVp.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BdXoZAfc.js → conversations-table-BSznfdYt.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CYvgWCuv.js → core.esm-Dr7tcIB-.js} +2 -2
- package/dist/owletto/dist/assets/create-CBGwASon.js +2 -0
- package/dist/owletto/dist/assets/create-Cf5hp6Z8.js +2 -0
- package/dist/owletto/dist/assets/create-CwThQtd3.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-CtSSeYj3.js → create-automation-form-9T5WnoUs.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-sNHQHNpg.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-n4qGUraE.js → cronstrue-BWFEyy_P.js} +2 -2
- package/dist/owletto/dist/assets/deployments-DHh9dyzv.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-BMp7UsMo.js → deployments-body-2xKS8gRo.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-RvUdVkj3.js → deployments-wG_8QzOF.js} +2 -2
- package/dist/owletto/dist/assets/{device-CPU6CjkJ.js → device-6z-xgsoW.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-Cwq88RMU.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-BDerBfD9.js +2 -0
- package/dist/owletto/dist/assets/entity-avatar-Cc1CuI-0.js +2 -0
- package/dist/owletto/dist/assets/entity-options-DHdMC1Lx.js +2 -0
- package/dist/owletto/dist/assets/entity-page--OkXmlNP.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-89RoK_-P.js +2 -0
- package/dist/owletto/dist/assets/event-detail-D4YZRtrA.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DsrkV2ix.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-B1_QUpg_.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DqpH99np.js → full-page-spinner-Cqih-8IW.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-B8Rs1be3.js +2 -0
- package/dist/owletto/dist/assets/identity-B0nH4yiC.js +2 -0
- package/dist/owletto/dist/assets/index-4TSkcsth.js +2 -0
- package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
- package/dist/owletto/dist/assets/index-BgkhXElB.js +2 -0
- package/dist/owletto/dist/assets/index-CoW4Bz3w.js +2 -0
- package/dist/owletto/dist/assets/index-Codw-Qqi.js +2 -0
- package/dist/owletto/dist/assets/{index-BQVliQW1.js → index-DAOyXG1X.js} +2 -2
- package/dist/owletto/dist/assets/{index-B9uPN6FC.js → index-DKPwCasf.js} +2 -2
- package/dist/owletto/dist/assets/index-DMyXd3bJ.js +2 -0
- package/dist/owletto/dist/assets/index-DYCqXaMf.js +7950 -0
- package/dist/owletto/dist/assets/index-DYYZLcJ0.js +2 -0
- package/dist/owletto/dist/assets/index-DYzWV5_z.js +2 -0
- package/dist/owletto/dist/assets/index-Da6CrGEu.js +2 -0
- package/dist/owletto/dist/assets/{index-Hio-HRfo.js → index-DfyDUpuI.js} +2 -2
- package/dist/owletto/dist/assets/index-DneshLbf.js +2 -0
- package/dist/owletto/dist/assets/index-TgRS2v_F.js +2 -0
- package/dist/owletto/dist/assets/{index-ICgKp3YK.js → index-ZNlrDc_f.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DBoag_OS.js → json-diff-DFvYINBT.js} +3 -3
- package/dist/owletto/dist/assets/{list-skeleton-C_GuoxAH.js → list-skeleton-DFsEqLU1.js} +2 -2
- package/dist/owletto/dist/assets/login-DO0j-AYr.js +2 -0
- package/dist/owletto/dist/assets/{logout-CLGgeZB7.js → logout-BmNwoAf7.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-B2LrMWBU.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-Cjpl8EbB.js +103 -0
- package/dist/owletto/dist/assets/{model-selector-dAbDgJvx.js → model-selector-TQcA93xm.js} +2 -2
- package/dist/owletto/dist/assets/models-D7aED5Sa.js +2 -0
- package/dist/owletto/dist/assets/new-BMrFy5Qa.js +2 -0
- package/dist/owletto/dist/assets/{new-BkdULx2r.js → new-ByBhteWA.js} +2 -2
- package/dist/owletto/dist/assets/new-DWp3deoW.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-BxsjwgdH.js → oauth-workspace-access-D_5uESuz.js} +2 -2
- package/dist/owletto/dist/assets/{organization-gxGeDjIV.js → organization-DTFoYP4V.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-DF5iGC3c.js +2 -0
- package/dist/owletto/dist/assets/{permissions-aPHaKLec.js → permissions-C_auqxfP.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-DsNiavG_.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-B2NUI89V.js +2 -0
- package/dist/owletto/dist/assets/{recent-D-65Pgu-.js → recent-3d99S2IE.js} +2 -2
- package/dist/owletto/dist/assets/record-activity-C9KfBkXb.js +2 -0
- package/dist/owletto/dist/assets/record-field-peek-BBZcRuGT.js +2 -0
- package/dist/owletto/dist/assets/record-session-BizRugWs.js +2 -0
- package/dist/owletto/dist/assets/{reset-password-uX_V6bip.js → reset-password-DqfcSn8M.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-T1ZxTVz6.js +2 -0
- package/dist/owletto/dist/assets/runs-table-D_8QlCCN.js +2 -0
- package/dist/owletto/dist/assets/schema-value-normalization-CylKX3PK.js +97 -0
- package/dist/owletto/dist/assets/settings-B_ClYztB.js +2 -0
- package/dist/owletto/dist/assets/settings-DgX1-xo7.js +2 -0
- package/dist/owletto/dist/assets/skills-Drw5tcZw.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CPyzlfD1.js → source-record-panels-Cg249m1S.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-By8RZyKW.js → use-mention-search-BYbFvHbJ.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-DMSqkN2J.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +3881 -3215
- package/npm-shrinkwrap.json +277 -261
- package/package.json +6 -5
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/agent-policy.js +0 -3
- package/vendor/core/dist/agent-tooling.d.ts +1 -1
- package/vendor/core/dist/agent-tooling.js +3 -1
- package/vendor/core/dist/contracts/agent-settings.d.ts +6 -2
- package/vendor/core/dist/contracts/agent-settings.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +53 -234
- package/vendor/core/dist/contracts/tools/manage-views.js +50 -76
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +5 -8
- package/vendor/core/dist/contracts/tools/view-attach.js +14 -31
- package/vendor/core/dist/contracts/tools/view-definition.d.ts +21 -0
- package/vendor/core/dist/contracts/tools/view-definition.js +165 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +39 -2
- package/vendor/core/dist/contracts/worker/protocol.js +24 -1
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/index.js +2 -1
- package/vendor/core/dist/suggestions.d.ts +15 -2
- package/vendor/core/dist/suggestions.js +48 -3
- package/vendor/core/dist/types.d.ts +26 -0
- package/vendor/core/dist/types.js +5 -0
- package/vendor/core/package.json +11 -5
- package/vendor/postgres/cf/src/connection.js +18 -0
- package/vendor/postgres/cjs/src/connection.js +18 -0
- package/vendor/postgres/src/connection.js +18 -0
- package/vendor/views/dist/api.d.ts +71 -17
- package/vendor/views/dist/api.js +200 -35
- package/vendor/views/dist/bridge.d.ts +3 -0
- package/vendor/views/dist/bridge.js +9 -1
- package/vendor/views/dist/components.d.ts +170 -0
- package/vendor/views/dist/components.js +361 -0
- package/vendor/views/dist/index.d.ts +1 -1
- package/vendor/views/package.json +11 -1
- package/dist/owletto/dist/assets/_-3J-IrxWk.js +0 -2
- package/dist/owletto/dist/assets/_-DYUE3ix4.js +0 -3
- package/dist/owletto/dist/assets/_agentId-Bn2IAjIy.js +0 -2
- package/dist/owletto/dist/assets/_agentId-Cam7Z0N7.js +0 -2
- package/dist/owletto/dist/assets/_automationId-CXEiKVZJ.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CS85l61t.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-clVDIyW0.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-Ci2k-BuN.js +0 -2
- package/dist/owletto/dist/assets/_eventId-B0662F8h.js +0 -2
- package/dist/owletto/dist/assets/_name-CwWePlOl.js +0 -2
- package/dist/owletto/dist/assets/_owner-dTWkrKsK.js +0 -3
- package/dist/owletto/dist/assets/_shape-BtS3y4M9.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-Dc9m-nlR.js +0 -2
- package/dist/owletto/dist/assets/_slug-DQHutM41.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-B30ik8ma.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-CUHypQnF.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-CMqYiiKM.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-B_vrqLVc.js +0 -2
- package/dist/owletto/dist/assets/agent-editor-form-hTs7eO_U.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-D92imvSt.js +0 -2
- package/dist/owletto/dist/assets/agent-thread-BJOijbT0.js +0 -6
- package/dist/owletto/dist/assets/agents-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-Bt5QCYQ7.js +0 -2
- package/dist/owletto/dist/assets/app._appId-CKv7_squ.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-vUwVumXf.js +0 -2
- package/dist/owletto/dist/assets/automations-9XjpDj_S.js +0 -2
- package/dist/owletto/dist/assets/callback-BRgcL8gz.js +0 -2
- package/dist/owletto/dist/assets/client-rows-EJSKR6z1.js +0 -2
- package/dist/owletto/dist/assets/connect-CfsFsy9P.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-DkiC8xos.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CIXrGOsT.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-Ckdz6I0y.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-CNxafNeo.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CKZjzRz6.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CadPVsI3.js +0 -2
- package/dist/owletto/dist/assets/connectors-lvLJ30lo.js +0 -2
- package/dist/owletto/dist/assets/create-0xW9eXxG.js +0 -2
- package/dist/owletto/dist/assets/create-B0qhrrX4.js +0 -2
- package/dist/owletto/dist/assets/create-CAfF-yI1.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-i6xxkWKV.js +0 -2
- package/dist/owletto/dist/assets/deployments-4Itm35Xc.js +0 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-CrjG7gPo.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Cs3ZmXWo.js +0 -2
- package/dist/owletto/dist/assets/entity-options-uXjgT7y9.js +0 -2
- package/dist/owletto/dist/assets/entity-page-Dc0LGr5U.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CwZxa0BR.js +0 -2
- package/dist/owletto/dist/assets/event-detail-ve2d6Gbb.js +0 -2
- package/dist/owletto/dist/assets/events-feed-BtvhZF1f.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Cj-v6NtH.js +0 -2
- package/dist/owletto/dist/assets/guardrails-HFo2Ut8B.js +0 -2
- package/dist/owletto/dist/assets/identity-BigVSBCl.js +0 -2
- package/dist/owletto/dist/assets/index-BLEcy9-T.css +0 -1
- package/dist/owletto/dist/assets/index-BfedB4Rc.js +0 -2
- package/dist/owletto/dist/assets/index-CUw3aKBI.js +0 -2
- package/dist/owletto/dist/assets/index-CXhxUkv3.js +0 -2
- package/dist/owletto/dist/assets/index-Cr5hwh-C.js +0 -7950
- package/dist/owletto/dist/assets/index-CzkTV4ZQ.js +0 -2
- package/dist/owletto/dist/assets/index-DKSx8JN_.js +0 -2
- package/dist/owletto/dist/assets/index-DVk7Ug0d.js +0 -2
- package/dist/owletto/dist/assets/index-DmZuKGf8.js +0 -2
- package/dist/owletto/dist/assets/index-cPcroOH0.js +0 -2
- package/dist/owletto/dist/assets/index-n7sTbNv4.js +0 -2
- package/dist/owletto/dist/assets/index-xiFpcWKv.js +0 -2
- package/dist/owletto/dist/assets/login-Ci6ixHuL.js +0 -2
- package/dist/owletto/dist/assets/member-scope-gate-B44INDPY.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-DyQiRvzl.js +0 -103
- package/dist/owletto/dist/assets/models-DpVP7ZwX.js +0 -2
- package/dist/owletto/dist/assets/new-BUb7AnEW.js +0 -2
- package/dist/owletto/dist/assets/new-CHOr-EcI.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-CHoQHe2H.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-UcZr87_Q.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DcnlADmj.js +0 -2
- package/dist/owletto/dist/assets/record-activity-CBXH6v1d.js +0 -2
- package/dist/owletto/dist/assets/renderer-mEDnVW0O.js +0 -97
- package/dist/owletto/dist/assets/runs-C0rCgGwX.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-Du1JMjg5.js +0 -2
- package/dist/owletto/dist/assets/runs-table-syPJ6r6T.js +0 -2
- package/dist/owletto/dist/assets/settings-9NkNA1G1.js +0 -2
- package/dist/owletto/dist/assets/settings-E-10sLQX.js +0 -2
- package/dist/owletto/dist/assets/skills-D2Ri9b4f.js +0 -2
- package/dist/owletto/dist/assets/status-dot-B-EWMgq6.js +0 -2
- package/dist/owletto/dist/assets/tabs-DqIIkCX-.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-CqLZQrnO.js +0 -2
- /package/vendor/postgres/{.bun-tag-f39dafdb2305d504 → .bun-tag-2f292c6554a8475e} +0 -0
|
@@ -487,9 +487,10 @@ const HOME_FEED_POST_IDENTITY_SELECTOR =
|
|
|
487
487
|
':is([id*="shareId="], [id*="ugcPostId="], [id*="urn:li:activity:"], [id*="-replaceableCommentTools"]):not([id^="replaceableComment_"]):not([id^="replaceableComment_"] *)';
|
|
488
488
|
|
|
489
489
|
/** Current comment-tool ids encode a typed post URN, followed by the recycled
|
|
490
|
-
* card key. Decode only the typed prefix: field 1 is activity, field 2 ugcPost
|
|
491
|
-
*
|
|
492
|
-
* the
|
|
490
|
+
* card key. Decode only the typed prefix: field 1 is activity, field 2 ugcPost,
|
|
491
|
+
* and field 3 groupPost. Each contains field 1 as a protobuf sint64 (ZigZag);
|
|
492
|
+
* groupPost contains the group id in field 1 and the post id in field 2.
|
|
493
|
+
* Native comment URNs and live post URLs confirm those namespaces. */
|
|
493
494
|
function decodeHomeFeedPostIdentity(
|
|
494
495
|
raw: string | undefined
|
|
495
496
|
): string | undefined {
|
|
@@ -509,25 +510,38 @@ function decodeHomeFeedPostIdentity(
|
|
|
509
510
|
}
|
|
510
511
|
const tag = bytes.charCodeAt(0);
|
|
511
512
|
if (
|
|
512
|
-
(tag !== 10 && tag !== 18) ||
|
|
513
|
+
(tag !== 10 && tag !== 18 && tag !== 26) ||
|
|
513
514
|
bytes.length < 4 ||
|
|
514
|
-
bytes.length > 13 ||
|
|
515
|
+
bytes.length > (tag === 26 ? 24 : 13) ||
|
|
515
516
|
bytes.charCodeAt(1) !== bytes.length - 2 ||
|
|
516
517
|
bytes.charCodeAt(2) !== 8
|
|
517
518
|
) {
|
|
518
519
|
throw invalid();
|
|
519
520
|
}
|
|
520
|
-
let
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
521
|
+
let offset = 3;
|
|
522
|
+
const readId = (minimum: bigint) => {
|
|
523
|
+
let encoded = 0n;
|
|
524
|
+
for (let shift = 0; shift < 70 && offset < bytes.length; shift += 7) {
|
|
525
|
+
const byte = bytes.charCodeAt(offset++);
|
|
526
|
+
encoded |= BigInt(byte & 127) << BigInt(shift);
|
|
527
|
+
if (byte & 128) continue;
|
|
528
|
+
if ((encoded & 1n) !== 0n || encoded >= 1n << 64n || encoded < minimum) {
|
|
529
|
+
throw invalid();
|
|
530
|
+
}
|
|
531
|
+
return encoded >> 1n;
|
|
532
|
+
}
|
|
528
533
|
throw invalid();
|
|
534
|
+
};
|
|
535
|
+
// Group ids can be smaller than post ids, but must still be positive.
|
|
536
|
+
const firstId = readId(tag === 26 ? 2n : 200_000n);
|
|
537
|
+
if (tag === 26) {
|
|
538
|
+
if (bytes.charCodeAt(offset++) !== 16) throw invalid();
|
|
539
|
+
const postId = readId(200_000n);
|
|
540
|
+
if (offset !== bytes.length) throw invalid();
|
|
541
|
+
return `urn:li:groupPost:${firstId}-${postId}`;
|
|
529
542
|
}
|
|
530
|
-
|
|
543
|
+
if (offset !== bytes.length) throw invalid();
|
|
544
|
+
return `urn:li:${tag === 10 ? "activity" : "ugcPost"}:${firstId}`;
|
|
531
545
|
}
|
|
532
546
|
|
|
533
547
|
// A fenced dispatch discards every row it collected, so an oversized scrape
|
|
@@ -1227,7 +1241,7 @@ interface HomeFeedEngagement {
|
|
|
1227
1241
|
|
|
1228
1242
|
interface HomeFeedCommentIdentity {
|
|
1229
1243
|
urn: string;
|
|
1230
|
-
parentNamespace:
|
|
1244
|
+
parentNamespace: ReturnType<typeof linkedInUrnNamespace>;
|
|
1231
1245
|
parentId: string;
|
|
1232
1246
|
commentId: string;
|
|
1233
1247
|
}
|
|
@@ -1246,10 +1260,10 @@ function homeFeedPostIdentityKey(
|
|
|
1246
1260
|
for (const raw of [context.postUrl, row.post_identity]) {
|
|
1247
1261
|
if (!raw) continue;
|
|
1248
1262
|
const match = raw.match(
|
|
1249
|
-
/(?:(shareId|ugcPostId)=|urn:li:(activity|share|ugcPost):)(\d{6,})/i
|
|
1263
|
+
/(?:(shareId|ugcPostId)=|urn:li:(activity|share|ugcPost):)(\d{6,})|urn:li:(groupPost):(\d+-\d{6,})/i
|
|
1250
1264
|
);
|
|
1251
1265
|
if (!match) continue;
|
|
1252
|
-
return `${linkedInUrnNamespace(match[1] ?? match[2] ?? "")}:${match[3]}`;
|
|
1266
|
+
return `${linkedInUrnNamespace(match[1] ?? match[2] ?? match[4] ?? "")}:${match[3] ?? match[5]}`;
|
|
1253
1267
|
}
|
|
1254
1268
|
return undefined;
|
|
1255
1269
|
}
|
|
@@ -1517,11 +1531,11 @@ function buildHomeFeedRowContext(row: HomeFeedRow): HomeFeedRowContext {
|
|
|
1517
1531
|
}
|
|
1518
1532
|
|
|
1519
1533
|
const embeddedUrn = row.post_identity?.match(
|
|
1520
|
-
/(?:(shareId|ugcPostId)=|urn:li:(activity|share|ugcPost):)(\d{6,})/i
|
|
1534
|
+
/(?:(shareId|ugcPostId)=|urn:li:(activity|share|ugcPost):)(\d{6,})|urn:li:(groupPost):(\d+-\d{6,})/i
|
|
1521
1535
|
);
|
|
1522
|
-
const embeddedId = embeddedUrn?.[3];
|
|
1536
|
+
const embeddedId = embeddedUrn?.[3] ?? embeddedUrn?.[5];
|
|
1523
1537
|
const embeddedNamespace = linkedInUrnNamespace(
|
|
1524
|
-
embeddedUrn?.[1] ?? embeddedUrn?.[2] ?? ""
|
|
1538
|
+
embeddedUrn?.[1] ?? embeddedUrn?.[2] ?? embeddedUrn?.[4] ?? ""
|
|
1525
1539
|
);
|
|
1526
1540
|
const postUrl = normalizeLinkedInPostUrl(
|
|
1527
1541
|
row.post_url ??
|
|
@@ -1548,7 +1562,7 @@ function isHomeFeedRowNoise(
|
|
|
1548
1562
|
/**
|
|
1549
1563
|
* Map cs_scrape home-feed rows to event envelopes. A scraped permalink still
|
|
1550
1564
|
* wins when a row carries one, but current cards expose none, so the canonical
|
|
1551
|
-
* post identity is normally the activity/share/ugcPost id embedded in
|
|
1565
|
+
* post identity is normally the activity/share/ugcPost/groupPost id embedded in
|
|
1552
1566
|
* `post_identity`. The scrape-only componentkey never becomes an event origin,
|
|
1553
1567
|
* and a post without either durable identity is not emitted. Native comments
|
|
1554
1568
|
* carry their own durable id and point at the stable parent-post origin.
|
|
@@ -1721,20 +1735,24 @@ type PrepareCommentResult = {
|
|
|
1721
1735
|
|
|
1722
1736
|
/**
|
|
1723
1737
|
* Canonical casing for the LinkedIn URN namespace an id came from. share and
|
|
1724
|
-
* ugcPost ids live in different id spaces than activity ids, so
|
|
1725
|
-
* has to survive normalization; /feed/update/ resolves all
|
|
1738
|
+
* ugcPost and groupPost ids live in different id spaces than activity ids, so
|
|
1739
|
+
* the namespace has to survive normalization; /feed/update/ resolves them all.
|
|
1726
1740
|
*/
|
|
1727
|
-
function linkedInUrnNamespace(
|
|
1741
|
+
function linkedInUrnNamespace(
|
|
1742
|
+
token: string
|
|
1743
|
+
): "activity" | "share" | "ugcPost" | "groupPost" {
|
|
1728
1744
|
const normalized = token.toLowerCase();
|
|
1729
1745
|
if (normalized === "shareid" || normalized === "share") return "share";
|
|
1730
1746
|
if (normalized === "ugcpostid" || normalized === "ugcpost") return "ugcPost";
|
|
1747
|
+
if (normalized === "grouppost") return "groupPost";
|
|
1731
1748
|
return "activity";
|
|
1732
1749
|
}
|
|
1733
1750
|
|
|
1734
1751
|
/**
|
|
1735
1752
|
* Normalize a post URL or activity id into a linkedin.com update URL.
|
|
1736
1753
|
* Accepts full URLs, `urn:li:activity:…` / `urn:li:share:…` /
|
|
1737
|
-
* `urn:li:ugcPost
|
|
1754
|
+
* `urn:li:ugcPost:…` / `urn:li:groupPost:<group>-<post>`, bare activity digits,
|
|
1755
|
+
* or `/feed/update/…` paths.
|
|
1738
1756
|
*/
|
|
1739
1757
|
export function normalizeLinkedInPostUrl(input: string): string | null {
|
|
1740
1758
|
const raw = input.trim();
|
|
@@ -1746,12 +1764,13 @@ export function normalizeLinkedInPostUrl(input: string): string | null {
|
|
|
1746
1764
|
return `https://www.linkedin.com/feed/update/urn:li:activity:${bareId}`;
|
|
1747
1765
|
}
|
|
1748
1766
|
|
|
1749
|
-
//
|
|
1750
|
-
|
|
1751
|
-
|
|
1767
|
+
// Post URNs or shorthand, with a compound id only for groupPost.
|
|
1768
|
+
const urnMatch = raw.match(
|
|
1769
|
+
/(?:urn:li:)?(?:(activity|share|ugcPost):(\d{6,})|(groupPost):(\d+-\d{6,}))/i
|
|
1770
|
+
);
|
|
1752
1771
|
if (urnMatch && !raw.includes("://") && !raw.startsWith("/")) {
|
|
1753
|
-
const ns = linkedInUrnNamespace(urnMatch[1] ?? "");
|
|
1754
|
-
return `https://www.linkedin.com/feed/update/urn:li:${ns}:${urnMatch[2] ?? ""}`;
|
|
1772
|
+
const ns = linkedInUrnNamespace(urnMatch[1] ?? urnMatch[3] ?? "");
|
|
1773
|
+
return `https://www.linkedin.com/feed/update/urn:li:${ns}:${urnMatch[2] ?? urnMatch[4] ?? ""}`;
|
|
1755
1774
|
}
|
|
1756
1775
|
|
|
1757
1776
|
try {
|
|
@@ -1772,11 +1791,11 @@ export function normalizeLinkedInPostUrl(input: string): string | null {
|
|
|
1772
1791
|
// Prefer canonical feed/update URLs when we can extract a post id, keeping
|
|
1773
1792
|
// whichever URN namespace the source URL used.
|
|
1774
1793
|
const urnInUrl = `${u.pathname}${u.search}`.match(
|
|
1775
|
-
/(?:urn(?::|%3A)li(?::|%3A))?(activity|share|ugcPost)(?::|%3A|-)(\d{6,})/i
|
|
1794
|
+
/(?:urn(?::|%3A)li(?::|%3A))?(?:(activity|share|ugcPost)(?::|%3A|-)(\d{6,})|(groupPost)(?::|%3A|-)(\d+-\d{6,}))/i
|
|
1776
1795
|
);
|
|
1777
1796
|
if (urnInUrl) {
|
|
1778
|
-
const ns = linkedInUrnNamespace(urnInUrl[1] ?? "");
|
|
1779
|
-
return `https://www.linkedin.com/feed/update/urn:li:${ns}:${urnInUrl[2] ?? ""}`;
|
|
1797
|
+
const ns = linkedInUrnNamespace(urnInUrl[1] ?? urnInUrl[3] ?? "");
|
|
1798
|
+
return `https://www.linkedin.com/feed/update/urn:li:${ns}:${urnInUrl[2] ?? urnInUrl[4] ?? ""}`;
|
|
1780
1799
|
}
|
|
1781
1800
|
return null;
|
|
1782
1801
|
} catch {
|
|
@@ -2914,7 +2933,7 @@ export default class LinkedInConnector extends ConnectorRuntime<
|
|
|
2914
2933
|
name: "LinkedIn",
|
|
2915
2934
|
description:
|
|
2916
2935
|
"Read LinkedIn feeds, notifications, and recent inbox messages through paired Chrome. Subscribe to source changes, answer direct messages, and prepare message, post, or comment drafts for human submission. Also supports local LinkedIn Data Export CSV files.",
|
|
2917
|
-
version: "3.20.
|
|
2936
|
+
version: "3.20.1",
|
|
2918
2937
|
faviconDomain: "linkedin.com",
|
|
2919
2938
|
// Live feeds bind a signed-in Chrome account. Local takeout imports need no browser.
|
|
2920
2939
|
browser: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reddit Connector (V1 runtime)
|
|
3
3
|
*
|
|
4
|
-
* Fetches posts and comments from Reddit subreddits or search queries
|
|
5
|
-
* Supports both authenticated (OAuth) and
|
|
4
|
+
* Fetches posts and comments from Reddit subreddits or search queries, and the
|
|
5
|
+
* connected user's home feed. Supports both authenticated (OAuth) and
|
|
6
|
+
* unauthenticated (public JSON API) modes.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
type SyncContext,
|
|
17
18
|
type SyncResult,
|
|
18
19
|
} from '@lobu/connector-sdk';
|
|
20
|
+
import addFormats from 'ajv-formats';
|
|
19
21
|
|
|
20
22
|
// ---------------------------------------------------------------------------
|
|
21
23
|
// Reddit API types
|
|
@@ -71,6 +73,16 @@ interface RedditCheckpoint {
|
|
|
71
73
|
pagination_cutoff?: string;
|
|
72
74
|
}
|
|
73
75
|
|
|
76
|
+
// Use the gateway's URI format check: WHATWG URL parsing also accepts non-URI characters.
|
|
77
|
+
const isUri = addFormats.get('uri') as (value: string) => boolean;
|
|
78
|
+
|
|
79
|
+
/** Metadata declares these fields `format: uri`; one bad value rejects the whole batch. */
|
|
80
|
+
function httpUrl(value: string | undefined): string | undefined {
|
|
81
|
+
if (!value || !isUri(value) || !URL.canParse(value)) return undefined;
|
|
82
|
+
const { protocol } = new URL(value);
|
|
83
|
+
return protocol === 'http:' || protocol === 'https:' ? value : undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
74
86
|
// ---------------------------------------------------------------------------
|
|
75
87
|
// Connector
|
|
76
88
|
// ---------------------------------------------------------------------------
|
|
@@ -79,8 +91,9 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
79
91
|
readonly definition: RuntimeConnectorDefinition = {
|
|
80
92
|
key: 'reddit',
|
|
81
93
|
name: 'Reddit',
|
|
82
|
-
description:
|
|
83
|
-
|
|
94
|
+
description:
|
|
95
|
+
"Fetches posts and comments from Reddit subreddits or search queries, and the connected user's home feed.",
|
|
96
|
+
version: '1.2.1',
|
|
84
97
|
faviconDomain: 'reddit.com',
|
|
85
98
|
authSchema: {
|
|
86
99
|
methods: [
|
|
@@ -88,6 +101,7 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
88
101
|
type: 'oauth',
|
|
89
102
|
provider: 'reddit',
|
|
90
103
|
requiredScopes: ['identity', 'read', 'history'],
|
|
104
|
+
loginScopes: ['identity'],
|
|
91
105
|
setupInstructions:
|
|
92
106
|
'Create a Reddit app at https://www.reddit.com/prefs/apps — choose "web app" as the type. Set the redirect URI to {{redirect_uri}}, then copy the client ID and secret below.',
|
|
93
107
|
},
|
|
@@ -238,6 +252,48 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
238
252
|
},
|
|
239
253
|
},
|
|
240
254
|
},
|
|
255
|
+
home_feed: {
|
|
256
|
+
key: 'home_feed',
|
|
257
|
+
name: 'Home feed',
|
|
258
|
+
sync: (ctx) => this.syncFeed(ctx),
|
|
259
|
+
description:
|
|
260
|
+
"Fetch the connected user's personalized home feed (Best). Requires user OAuth.",
|
|
261
|
+
displayNameTemplate: 'Reddit home feed',
|
|
262
|
+
configSchema: {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
lookback_days: {
|
|
266
|
+
type: 'integer',
|
|
267
|
+
minimum: 1,
|
|
268
|
+
maximum: 30,
|
|
269
|
+
default: 7,
|
|
270
|
+
description: 'Skip home feed posts older than this many days.',
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
eventKinds: {
|
|
275
|
+
post: {
|
|
276
|
+
description: "A Reddit post from the connected user's home feed",
|
|
277
|
+
metadataSchema: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
subreddit: { type: 'string' },
|
|
281
|
+
score: { type: 'number', description: 'Reddit score (upvotes - downvotes)' },
|
|
282
|
+
num_comments: { type: 'number' },
|
|
283
|
+
upvote_ratio: { type: 'number' },
|
|
284
|
+
is_self: { type: 'boolean' },
|
|
285
|
+
domain: { type: 'string' },
|
|
286
|
+
thumbnail: { type: 'string', format: 'uri', description: 'Preview thumbnail URL' },
|
|
287
|
+
media_url: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
format: 'uri',
|
|
290
|
+
description: 'Linked content URL for non-self posts (image, video, article)',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
241
297
|
},
|
|
242
298
|
};
|
|
243
299
|
|
|
@@ -253,17 +309,20 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
253
309
|
const subreddit = ctx.config.subreddit as string | undefined;
|
|
254
310
|
const searchTerms = ctx.config.search_terms as string | undefined;
|
|
255
311
|
const isUserFeed = ctx.feedKey === 'user_activity';
|
|
256
|
-
|
|
257
|
-
|
|
312
|
+
// Best is ranked, not chronological: old posts interleave with new ones and
|
|
313
|
+
// a saved `after` anchor is meaningless once the ranking moves.
|
|
314
|
+
const isHomeFeed = ctx.feedKey === 'home_feed';
|
|
315
|
+
const contentType = isUserFeed
|
|
316
|
+
? 'overview'
|
|
317
|
+
: isHomeFeed
|
|
318
|
+
? 'home'
|
|
319
|
+
: ctx.feedKey === 'comments'
|
|
320
|
+
? 'comment'
|
|
321
|
+
: 'post';
|
|
322
|
+
const lookbackDays = (ctx.config.lookback_days as number) ?? (isHomeFeed ? 7 : 365);
|
|
258
323
|
|
|
259
324
|
// Resolve access token: user OAuth > app-only OAuth > unauthenticated
|
|
260
325
|
const userAccessToken = ctx.credentials?.accessToken ?? null;
|
|
261
|
-
let accessToken: string | undefined = userAccessToken ?? undefined;
|
|
262
|
-
if (!accessToken) {
|
|
263
|
-
accessToken = await this.getAppOnlyToken(ctx);
|
|
264
|
-
}
|
|
265
|
-
const baseUrl = accessToken ? 'https://oauth.reddit.com' : 'https://www.reddit.com';
|
|
266
|
-
|
|
267
326
|
let username: string | undefined;
|
|
268
327
|
if (isUserFeed) {
|
|
269
328
|
if (!userAccessToken) {
|
|
@@ -273,9 +332,18 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
273
332
|
}
|
|
274
333
|
username = await this.resolveUsername(ctx, userAccessToken);
|
|
275
334
|
}
|
|
335
|
+
if (isHomeFeed && !userAccessToken) {
|
|
336
|
+
throw new Error('home_feed requires user OAuth. Connect Reddit with the read scope.');
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
let accessToken: string | undefined = userAccessToken ?? undefined;
|
|
340
|
+
if (!accessToken) {
|
|
341
|
+
accessToken = await this.getAppOnlyToken(ctx);
|
|
342
|
+
}
|
|
343
|
+
const baseUrl = accessToken ? 'https://oauth.reddit.com' : 'https://www.reddit.com';
|
|
276
344
|
|
|
277
345
|
const previous = (ctx.checkpoint ?? {}) as RedditCheckpoint;
|
|
278
|
-
const resumeAfter = previous.pagination_token ?? null;
|
|
346
|
+
const resumeAfter = isHomeFeed ? null : (previous.pagination_token ?? null);
|
|
279
347
|
let cutoffDate = new Date();
|
|
280
348
|
cutoffDate.setDate(cutoffDate.getDate() - lookbackDays);
|
|
281
349
|
// Keep items eligible for the whole bounded sweep, even across sync runs.
|
|
@@ -355,6 +423,7 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
355
423
|
const itemDate = new Date(itemData.created_utc * 1000);
|
|
356
424
|
|
|
357
425
|
if (itemDate < cutoffDate) {
|
|
426
|
+
if (isHomeFeed) continue;
|
|
358
427
|
reachedCutoff = true;
|
|
359
428
|
break;
|
|
360
429
|
}
|
|
@@ -388,8 +457,9 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
388
457
|
|
|
389
458
|
const checkpoint: RedditCheckpoint = {
|
|
390
459
|
last_timestamp: new Date().toISOString(),
|
|
391
|
-
pagination_token: !reachedCutoff ? (after ?? undefined) : undefined,
|
|
392
|
-
pagination_cutoff:
|
|
460
|
+
pagination_token: !reachedCutoff && !isHomeFeed ? (after ?? undefined) : undefined,
|
|
461
|
+
pagination_cutoff:
|
|
462
|
+
!reachedCutoff && !isHomeFeed && after ? cutoffDate.toISOString() : undefined,
|
|
393
463
|
};
|
|
394
464
|
|
|
395
465
|
await ctx.commit(events, checkpoint as Record<string, unknown>);
|
|
@@ -498,6 +568,10 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
498
568
|
return `${baseUrl}/user/${encodeURIComponent(username)}/overview${jsonSuffix}?limit=100&sort=new${afterParam}`;
|
|
499
569
|
}
|
|
500
570
|
|
|
571
|
+
if (contentType === 'home') {
|
|
572
|
+
return `${baseUrl}/best${jsonSuffix}?limit=100${afterParam}`;
|
|
573
|
+
}
|
|
574
|
+
|
|
501
575
|
if (contentType === 'comment') {
|
|
502
576
|
// Comments from a subreddit
|
|
503
577
|
if (subredditPath) {
|
|
@@ -541,11 +615,9 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
541
615
|
});
|
|
542
616
|
|
|
543
617
|
// For non-self posts, the Reddit `url` field points to the linked content (image, article, etc.)
|
|
544
|
-
const mediaUrl = !post.is_self ? post.url : undefined;
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
? post.thumbnail
|
|
548
|
-
: undefined;
|
|
618
|
+
const mediaUrl = !post.is_self ? httpUrl(post.url) : undefined;
|
|
619
|
+
// `thumbnail` also carries placeholder words ("self", "image", "nsfw", ...).
|
|
620
|
+
const thumbnail = httpUrl(post.thumbnail);
|
|
549
621
|
|
|
550
622
|
return {
|
|
551
623
|
origin_id: `reddit_post_${post.name}`,
|
package/dist/connectors/slack.ts
CHANGED
|
@@ -33,8 +33,11 @@ export function whatsAppWebAdapterProgram() {
|
|
|
33
33
|
// when this number moves: shipping a fix under the old number leaves every
|
|
34
34
|
// already-open tab running the previous code with nothing to show for it.
|
|
35
35
|
// Keep in lockstep with WHATSAPP_ADAPTER_VERSION in whatsapp-web-helpers.ts.
|
|
36
|
-
const ADAPTER_VERSION =
|
|
36
|
+
const ADAPTER_VERSION = 26;
|
|
37
37
|
const SOURCE_ERROR_ID = "whatsapp-web:source-observation-error";
|
|
38
|
+
// Storage rows one `chat:` read examines; a whole personal history is
|
|
39
|
+
// usually under this, so one read answers.
|
|
40
|
+
const CHAT_SCAN_ROWS = 20_000;
|
|
38
41
|
const MAX_RECORD_BYTES = 128 * 1024;
|
|
39
42
|
const MAX_BUFFER_BYTES = 16 * 1024 * 1024;
|
|
40
43
|
const MAX_BUFFER_ENTRIES = 10_000;
|
|
@@ -945,6 +948,11 @@ export function whatsAppWebAdapterProgram() {
|
|
|
945
948
|
}
|
|
946
949
|
const keyModule = requireFirst(["WAWebMsgKey"]);
|
|
947
950
|
const exactId = query.startsWith("id:") ? query.slice(3) : null;
|
|
951
|
+
let chatJid = null;
|
|
952
|
+
if (query.startsWith("chat:")) {
|
|
953
|
+
const chat = await resolveChat(requireFirst(["WAWebCollections"]), { chat_jid: query.slice(5) });
|
|
954
|
+
chatJid = (await canonicalJid(modelData(chat).id ?? chat?.id)).jid;
|
|
955
|
+
}
|
|
948
956
|
const database = await new Promise((resolve, reject) => {
|
|
949
957
|
const request = indexedDB.open("model-storage");
|
|
950
958
|
// Never create an empty replacement database when WhatsApp changes its
|
|
@@ -980,24 +988,46 @@ export function whatsAppWebAdapterProgram() {
|
|
|
980
988
|
return;
|
|
981
989
|
}
|
|
982
990
|
rows.push({ position: cursor.key, id: cursor.value.id });
|
|
983
|
-
if (rows.length > limit) resolve(rows);
|
|
991
|
+
if (rows.length > (chatJid === null ? limit : CHAT_SCAN_ROWS)) resolve(rows);
|
|
984
992
|
else cursor.continue();
|
|
985
993
|
};
|
|
986
994
|
});
|
|
987
995
|
} finally {
|
|
988
996
|
database.close();
|
|
989
997
|
}
|
|
990
|
-
|
|
991
|
-
|
|
998
|
+
let hasMore = sourceRows.length > limit;
|
|
999
|
+
let page = sourceRows.slice(0, limit);
|
|
1000
|
+
let last = page[page.length - 1];
|
|
1001
|
+
if (chatJid !== null) {
|
|
1002
|
+
// A chat read scans one large storage page, then keeps that chat's rows.
|
|
1003
|
+
// Matching happens after the transaction closes because LID conversion
|
|
1004
|
+
// awaits, and history can key a chat by phone or by LID.
|
|
1005
|
+
const examined = sourceRows.slice(0, CHAT_SCAN_ROWS);
|
|
1006
|
+
const canonical = new Map();
|
|
1007
|
+
const matches = [];
|
|
1008
|
+
for (const row of examined) {
|
|
1009
|
+
const remote = keyModule.fromString(row.id).remote;
|
|
1010
|
+
const raw = widString(remote);
|
|
1011
|
+
if (!canonical.has(raw)) canonical.set(raw, (await canonicalJid(remote)).jid);
|
|
1012
|
+
if (canonical.get(raw) !== chatJid) continue;
|
|
1013
|
+
matches.push(row);
|
|
1014
|
+
if (matches.length > limit) break;
|
|
1015
|
+
}
|
|
1016
|
+
page = matches.slice(0, limit);
|
|
1017
|
+
hasMore = matches.length > limit || sourceRows.length > CHAT_SCAN_ROWS;
|
|
1018
|
+
last = matches.length > limit ? page[page.length - 1] : examined[examined.length - 1];
|
|
1019
|
+
}
|
|
992
1020
|
const collections = requireFirst(["WAWebCollections"]);
|
|
993
|
-
const selected =
|
|
1021
|
+
const selected = [];
|
|
1022
|
+
for (const row of page) {
|
|
994
1023
|
const key = keyModule.fromString(row.id);
|
|
995
|
-
if (exactId !== null && key.id !== exactId)
|
|
1024
|
+
if (exactId !== null && key.id !== exactId) continue;
|
|
996
1025
|
const remote = widString(key.remote);
|
|
997
|
-
if (remote === "status@broadcast" || remote.endsWith("@newsletter"))
|
|
1026
|
+
if (remote === "status@broadcast" || remote.endsWith("@newsletter")) continue;
|
|
998
1027
|
const isGroup = remote.endsWith("@g.us");
|
|
999
|
-
|
|
1000
|
-
|
|
1028
|
+
if ((chatFilter === "group" && !isGroup) || (chatFilter === "individual" && isGroup)) continue;
|
|
1029
|
+
selected.push(row);
|
|
1030
|
+
}
|
|
1001
1031
|
const results = [];
|
|
1002
1032
|
if (selected.length) {
|
|
1003
1033
|
const loaded = await collections.Msg.getMessagesById(selected.map((row) => row.id));
|
|
@@ -1014,14 +1044,14 @@ export function whatsAppWebAdapterProgram() {
|
|
|
1014
1044
|
// Skip them like search does; throwing would pin every later read to
|
|
1015
1045
|
// the same cursor.
|
|
1016
1046
|
if (!message || message.timestamp <= 0) continue;
|
|
1017
|
-
if (exactId === null && query && !`${message.body}\n${message.caption}`.toLowerCase().includes(query.toLowerCase())) continue;
|
|
1047
|
+
if (exactId === null && chatJid === null && query && !`${message.body}\n${message.caption}`.toLowerCase().includes(query.toLowerCase())) continue;
|
|
1018
1048
|
results.push(message);
|
|
1019
1049
|
}
|
|
1020
1050
|
}
|
|
1021
1051
|
return {
|
|
1022
1052
|
results,
|
|
1023
1053
|
hasMore,
|
|
1024
|
-
...(hasMore ? { nextCursor: JSON.stringify({ v: 1, before:
|
|
1054
|
+
...(hasMore ? { nextCursor: JSON.stringify({ v: 1, before: last.position, query, chat_filter: chatFilter }) } : {}),
|
|
1025
1055
|
};
|
|
1026
1056
|
}
|
|
1027
1057
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
WHATSAPP_PHONE_SERVER,
|
|
15
15
|
} from "./whatsapp-web-identity.js";
|
|
16
16
|
|
|
17
|
-
export const WHATSAPP_ADAPTER_VERSION =
|
|
17
|
+
export const WHATSAPP_ADAPTER_VERSION = 26;
|
|
18
18
|
export const WHATSAPP_ORIGIN = "https://web.whatsapp.com";
|
|
19
19
|
|
|
20
20
|
export type ChatFilter = "all" | "individual" | "group";
|
|
@@ -354,7 +354,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
354
354
|
name: "WhatsApp",
|
|
355
355
|
description:
|
|
356
356
|
"Personal WhatsApp messages read live from WhatsApp Web in the paired Owletto Chrome without importing message history. Automations react to new-message references and read content on demand. Search, draft, send, edit, react to, and revoke messages.",
|
|
357
|
-
version: "2.
|
|
357
|
+
version: "2.2.0",
|
|
358
358
|
faviconDomain: "whatsapp.com",
|
|
359
359
|
authSchema: { methods: [{ type: "browser", mode: "live" }] },
|
|
360
360
|
browser: {
|
|
@@ -392,7 +392,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
392
392
|
key: "live_messages",
|
|
393
393
|
name: "Live messages",
|
|
394
394
|
description:
|
|
395
|
-
"Read messages directly from WhatsApp Web without importing history, using literal text search
|
|
395
|
+
"Read messages directly from WhatsApp Web without importing history, using literal text search, id:<message ID>, or chat:<chat JID> for one chat's messages in reverse storage order. Follow cursors even after an empty filtered page. Active Automations can subscribe to new-message references. Requires the paired browser to be online and signed in; reconnects replay messages still available in WhatsApp's local history.",
|
|
396
396
|
read: (ctx) => this.readMessages(ctx),
|
|
397
397
|
observe: (ctx) => this.observeMessages(ctx),
|
|
398
398
|
webhook: { mode: "trigger", events: ["message.created"] },
|
|
@@ -75,12 +75,14 @@ export const xIdentityModule: ConnectorIdentityModule = {
|
|
|
75
75
|
* X's direct-message sender model. Numeric user ids are unique across X, so
|
|
76
76
|
* there is no tenant axis: `teamId` is ignored and the scope is global.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
78
|
+
* Signing in with X proves it: Better Auth's X provider is `twitter`, and the
|
|
79
|
+
* account id it stores is the same numeric user id a direct message carries.
|
|
80
|
+
* The chat link offered in a direct message proves it too, within the
|
|
81
|
+
* workspace that issued it.
|
|
80
82
|
*/
|
|
81
83
|
export const xChatUserIdentity: ChatUserIdentity = {
|
|
82
84
|
platform: 'x',
|
|
83
|
-
providerId: '
|
|
85
|
+
providerId: 'twitter',
|
|
84
86
|
namespace: X_IDENTITY.CHAT_USER_ID,
|
|
85
87
|
buildUserKey(_teamId, platformUserId) {
|
|
86
88
|
return normalizeXUserId(platformUserId);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- migrate:up
|
|
2
|
+
-- lobu:no-quiesce -- old replicas during the roll can only leave a rare delete's identities live; provisioning now refuses that state loudly instead of hiding a member.
|
|
3
|
+
-- Deleting an entity left its identity rows live, so the live unique key
|
|
4
|
+
-- (organization, namespace, identifier, scope) kept a tombstoned record claiming an
|
|
5
|
+
-- email, login or chat id and blocked any live entity from holding it again.
|
|
6
|
+
-- A re-created $member then lacked its auth_user_id and member lookups missed
|
|
7
|
+
-- it. Entity soft-delete now retires identities in the same transaction; this
|
|
8
|
+
-- retires the rows earlier deletes left behind. Rows are soft-deleted, not
|
|
9
|
+
-- removed, and retain their entity_id for provenance.
|
|
10
|
+
UPDATE public.entity_identities ei
|
|
11
|
+
SET deleted_at = e.deleted_at,
|
|
12
|
+
updated_at = current_timestamp
|
|
13
|
+
FROM public.entities e
|
|
14
|
+
WHERE e.id = ei.entity_id
|
|
15
|
+
AND e.deleted_at IS NOT NULL
|
|
16
|
+
AND ei.deleted_at IS NULL;
|
|
17
|
+
|
|
18
|
+
-- migrate:down
|
|
19
|
+
-- Irreversible by design: re-activating these rows would collide with any
|
|
20
|
+
-- live entity that has since claimed the same identifier.
|
|
21
|
+
SELECT 1;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
-- Domain uniqueness covers live entities only.
|
|
2
|
+
--
|
|
3
|
+
-- idx_entities_metadata_domain had no deleted_at predicate, so a tombstoned
|
|
4
|
+
-- entity kept reserving its metadata.domain and every later create with that
|
|
5
|
+
-- domain failed as a duplicate. The replacement keeps the same key, adding
|
|
6
|
+
-- deleted_at IS NULL so a tombstone releases its domain while two live
|
|
7
|
+
-- entities in one organization still cannot share one. No ON CONFLICT targets
|
|
8
|
+
-- this index; it only rejects duplicates.
|
|
9
|
+
--
|
|
10
|
+
-- Build the replacement CONCURRENTLY before dropping the old index so live
|
|
11
|
+
-- uniqueness stays enforced. The normal path allows writes; repairing an
|
|
12
|
+
-- invalid index uses a regular DROP and needs an exclusive table lock.
|
|
13
|
+
-- transaction:false permits CONCURRENTLY and rerunning either section after
|
|
14
|
+
-- a partial failure.
|
|
15
|
+
|
|
16
|
+
-- migrate:up transaction:false
|
|
17
|
+
-- lobu:no-quiesce
|
|
18
|
+
|
|
19
|
+
DO $heal$
|
|
20
|
+
BEGIN
|
|
21
|
+
IF EXISTS (
|
|
22
|
+
SELECT 1
|
|
23
|
+
FROM pg_index i
|
|
24
|
+
JOIN pg_class c ON c.oid = i.indexrelid
|
|
25
|
+
JOIN pg_namespace n ON n.oid = c.relnamespace
|
|
26
|
+
WHERE n.nspname = 'public'
|
|
27
|
+
AND c.relname = 'idx_entities_live_metadata_domain'
|
|
28
|
+
AND NOT i.indisvalid
|
|
29
|
+
) THEN
|
|
30
|
+
EXECUTE 'DROP INDEX public.idx_entities_live_metadata_domain';
|
|
31
|
+
END IF;
|
|
32
|
+
END
|
|
33
|
+
$heal$;
|
|
34
|
+
|
|
35
|
+
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS idx_entities_live_metadata_domain
|
|
36
|
+
ON public.entities ((metadata ->> 'domain'), organization_id)
|
|
37
|
+
WHERE metadata ->> 'domain' IS NOT NULL AND deleted_at IS NULL;
|
|
38
|
+
|
|
39
|
+
DROP INDEX CONCURRENTLY IF EXISTS public.idx_entities_metadata_domain;
|
|
40
|
+
|
|
41
|
+
-- migrate:down transaction:false
|
|
42
|
+
|
|
43
|
+
-- Fails if a live entity has since claimed a tombstone's domain; resolve those
|
|
44
|
+
-- duplicates before rolling back. A failed concurrent build leaves an invalid
|
|
45
|
+
-- index that IF NOT EXISTS would skip on retry, so heal it before rebuilding.
|
|
46
|
+
DO $heal$
|
|
47
|
+
BEGIN
|
|
48
|
+
IF EXISTS (
|
|
49
|
+
SELECT 1
|
|
50
|
+
FROM pg_index i
|
|
51
|
+
JOIN pg_class c ON c.oid = i.indexrelid
|
|
52
|
+
JOIN pg_namespace n ON n.oid = c.relnamespace
|
|
53
|
+
WHERE n.nspname = 'public'
|
|
54
|
+
AND c.relname = 'idx_entities_metadata_domain'
|
|
55
|
+
AND NOT i.indisvalid
|
|
56
|
+
) THEN
|
|
57
|
+
EXECUTE 'DROP INDEX public.idx_entities_metadata_domain';
|
|
58
|
+
END IF;
|
|
59
|
+
END
|
|
60
|
+
$heal$;
|
|
61
|
+
|
|
62
|
+
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS idx_entities_metadata_domain
|
|
63
|
+
ON public.entities ((metadata ->> 'domain'), organization_id)
|
|
64
|
+
WHERE metadata ->> 'domain' IS NOT NULL;
|
|
65
|
+
|
|
66
|
+
DROP INDEX CONCURRENTLY IF EXISTS public.idx_entities_live_metadata_domain;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- migrate:up
|
|
2
|
+
-- lobu:no-quiesce -- additive column with a constant default; old code never reads or writes it.
|
|
3
|
+
-- Per-agent conversation starters: up to three {title,message} prompts shown
|
|
4
|
+
-- on an empty web chat and as Slack assistant thread-start prompts. Constant
|
|
5
|
+
-- default, so no table rewrite.
|
|
6
|
+
ALTER TABLE public.agents
|
|
7
|
+
ADD COLUMN IF NOT EXISTS starters jsonb DEFAULT '[]'::jsonb;
|
|
8
|
+
|
|
9
|
+
COMMENT ON COLUMN public.agents.starters IS
|
|
10
|
+
'Conversation starters ({title,message}[], max 3) offered on an empty chat and as Slack assistant thread-start prompts.';
|
|
11
|
+
|
|
12
|
+
-- migrate:down
|
|
13
|
+
|
|
14
|
+
ALTER TABLE public.agents DROP COLUMN IF EXISTS starters;
|