@lobu/runtime-server 24.1.1 → 24.3.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 +175 -39
- package/dist/catalogs/skills.json +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/gchat.ts +31 -1
- package/dist/connectors/google_gmail.ts +70 -41
- package/dist/connectors/google_gmail_references.ts +406 -0
- package/dist/connectors/linkedin-inbox-adapter.js +107 -36
- package/dist/connectors/linkedin-inbox.ts +13 -0
- package/dist/connectors/linkedin.ts +1 -1
- package/dist/connectors/postgres.ts +14 -8
- package/dist/connectors/reddit.ts +171 -5
- package/dist/connectors/whatsapp-web-adapter.js +147 -61
- package/dist/connectors/whatsapp-web-helpers.ts +6 -2
- package/dist/connectors/whatsapp_web.ts +48 -17
- package/dist/connectors/x-dm-adapter.js +252 -35
- package/dist/connectors/x.ts +189 -13
- package/dist/db/migrations/20261020140000_view_attachments_by_page.sql +3 -1
- package/dist/db/migrations/20261024050000_events_source_reference_arrival.sql +27 -0
- package/dist/db/migrations/20261026000000_turn_write_receipts.sql +36 -0
- package/dist/db/migrations/20261026190000_federated_relationship_endpoints.sql +143 -0
- package/dist/dependencies.bun.lock +137 -202
- package/dist/embeddings-server.mjs +81 -11
- package/dist/guest.bundle.js +62 -25
- package/dist/owletto/dist/assets/_-XKF0m81R.js +3 -0
- package/dist/owletto/dist/assets/_-e8MbEBtw.js +2 -0
- package/dist/owletto/dist/assets/_agentId-Cv9goIFf.js +2 -0
- package/dist/owletto/dist/assets/_agentId-emObu67X.js +2 -0
- package/dist/owletto/dist/assets/_automationId-CfFFAYK1.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-D6NKXSOE.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-DFrkLLTU.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-D3vuAQPe.js +2 -0
- package/dist/owletto/dist/assets/_eventId-BV5SQaUA.js +2 -0
- package/dist/owletto/dist/assets/_name-DjtJMop4.js +2 -0
- package/dist/owletto/dist/assets/_owner-oBX68rb9.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4lLPAwI.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-Cw-7q6hI.js +2 -0
- package/dist/owletto/dist/assets/_slug-B2g5qzn3.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-CIKGCtdK.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dx4kJo7o.js +2 -0
- package/dist/owletto/dist/assets/accept-invitation-38lHBvjO.js +2 -0
- package/dist/owletto/dist/assets/activity-route-view-voRYSM3a.js +2 -0
- package/dist/owletto/dist/assets/agent-card-controls-DiU7Un5w.js +2 -0
- package/dist/owletto/dist/assets/{agent-client-setup-list-BlXB4SE5.js → agent-client-setup-list-Bkyw22GW.js} +4 -4
- package/dist/owletto/dist/assets/agent-connect-pages-CpBxQCpx.js +2 -0
- package/dist/owletto/dist/assets/{agent-editor-form-DsSoeQeF.js → agent-editor-form-QrIDroFL.js} +2 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-CyoGSxcZ.js +2 -0
- package/dist/owletto/dist/assets/{agent-loading-shells-B7v6Cffw.js → agent-loading-shells-CamDtzHY.js} +2 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-CgsQ8BK_.js +2 -0
- package/dist/owletto/dist/assets/{agent-skill-context-DFucg4c4.js → agent-skill-context-lWbXKEm1.js} +2 -2
- package/dist/owletto/dist/assets/agent-skills-route-D-w3tY_2.js +2 -0
- package/dist/owletto/dist/assets/agent-subpage-shell-CLqpn5Tb.js +2 -0
- package/dist/owletto/dist/assets/{agent-thread-D38STyeu.js → agent-thread-CsRexwTv.js} +4 -4
- package/dist/owletto/dist/assets/agents-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-CmGrMvPC.js +2 -0
- package/dist/owletto/dist/assets/app-bridge-C4nPtae3.js +121 -0
- package/dist/owletto/dist/assets/app._appId-BO7G38fL.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-DMYxs6F6.js +2 -0
- package/dist/owletto/dist/assets/automations-DzH_FFKU.js +2 -0
- package/dist/owletto/dist/assets/calendar-DDCCSPW6.js +2 -0
- package/dist/owletto/dist/assets/callback-DFciMR8u.js +2 -0
- package/dist/owletto/dist/assets/{card-jzhQrMDP.js → card-BCsbrdGs.js} +2 -2
- package/dist/owletto/dist/assets/{claim-B-wq745Q.js → claim-BRua2b_7.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-BLIy1Zc3.js +2 -0
- package/dist/owletto/dist/assets/client-rows-DiJQ5D1z.js +2 -0
- package/dist/owletto/dist/assets/clients-8-EpRjsm.js +2 -0
- package/dist/owletto/dist/assets/{code-editor-CEqoCky-.js → code-editor-BFZa4EIt.js} +3 -3
- package/dist/owletto/dist/assets/connect-C0cHE9Xl.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D2K4tmvW.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-D4EG5a0v.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DhoCT6sT.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-Dn4qw2Us.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-BTI5JXA3.js +2 -0
- package/dist/owletto/dist/assets/connection-X9VU9Ijm.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-B6ydKasK.js +2 -0
- package/dist/owletto/dist/assets/connections-browser-BMV8bf54.js +2 -0
- package/dist/owletto/dist/assets/connector-boxes-DqZA-FdG.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-D-ECOlMJ.js → connector-provenance-BIg8P8WY.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CJYz53YF.js +2 -0
- package/dist/owletto/dist/assets/{connectors-CH4KBZyT.js → connectors-BroKpwhB.js} +2 -2
- package/dist/owletto/dist/assets/{consent-C9ZpHb7V.js → consent-fzLN-Qy7.js} +2 -2
- package/dist/owletto/dist/assets/copy-button-Df7QXE0w.js +2 -0
- package/dist/owletto/dist/assets/{core.esm-BupT3V0i.js → core.esm-A1UnFbGs.js} +2 -2
- package/dist/owletto/dist/assets/create-BjwsYarn.js +2 -0
- package/dist/owletto/dist/assets/create-Dzr4mlr0.js +2 -0
- package/dist/owletto/dist/assets/create-automation-form-DHW6OUoS.js +3 -0
- package/dist/owletto/dist/assets/create-c94SPL21.js +2 -0
- package/dist/owletto/dist/assets/create._connectorKey-DLLn2nej.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-CWImw-kf.js → cronstrue-xxpD1P2-.js} +2 -2
- package/dist/owletto/dist/assets/{device-D-7WBe9E.js → device-C3AEoL5c.js} +2 -2
- package/dist/owletto/dist/assets/{device-pin-tombstone-2U0UMu3_.js → device-pin-tombstone-B_te59GE.js} +2 -2
- package/dist/owletto/dist/assets/device._deviceId-ZU09qrot.js +2 -0
- package/dist/owletto/dist/assets/elk-worker.min-BENGc9gn.js +23 -0
- package/dist/owletto/dist/assets/{entity-avatar-mdh7Kq5D.js → entity-avatar-CEV4ttUQ.js} +2 -2
- package/dist/owletto/dist/assets/entity-options-DJv2EhVV.js +2 -0
- package/dist/owletto/dist/assets/entity-page-BUghWZ1s.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-Lf6ONdpf.js +2 -0
- package/dist/owletto/dist/assets/event-card-CBlsG32u.js +2 -0
- package/dist/owletto/dist/assets/event-detail-BKSGEOdW.js +2 -0
- package/dist/owletto/dist/assets/events-feed-VfU4csn2.js +2 -0
- package/dist/owletto/dist/assets/feed-event-kinds-BYuZCoU4.js +2 -0
- package/dist/owletto/dist/assets/filter-bar-COU0sBFQ.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-BVbcpW3R.js → full-page-spinner-C1Q_jEzD.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-6ZJv1uzM.js +2 -0
- package/dist/owletto/dist/assets/identity-BaFLmbSo.js +2 -0
- package/dist/owletto/dist/assets/index-008wj-Pz.js +7950 -0
- package/dist/owletto/dist/assets/index-BaetvYLa.js +2 -0
- package/dist/owletto/dist/assets/index-BiEf5xOE.css +1 -0
- package/dist/owletto/dist/assets/{index-CxF2XXzl.js → index-BrDP4PCs.js} +2 -2
- package/dist/owletto/dist/assets/index-BuXIeK7D.js +2 -0
- package/dist/owletto/dist/assets/index-CAVcR9za.js +2 -0
- package/dist/owletto/dist/assets/index-CMLfWGPU.js +2 -0
- package/dist/owletto/dist/assets/index-D0YEYP7N.js +2 -0
- package/dist/owletto/dist/assets/index-DFyBbp7b.js +2 -0
- package/dist/owletto/dist/assets/{index-D7gHOpfg.js → index-DNtYqkiA.js} +2 -2
- package/dist/owletto/dist/assets/index-DQxzeM37.js +2 -0
- package/dist/owletto/dist/assets/index-DkO0nPex.js +2 -0
- package/dist/owletto/dist/assets/index-KlRId0g6.js +2 -0
- package/dist/owletto/dist/assets/index-Ywnqi4A6.js +2 -0
- package/dist/owletto/dist/assets/index-wHFQv1aT.js +12 -0
- package/dist/owletto/dist/assets/index-xnxhf3Op.js +2 -0
- package/dist/owletto/dist/assets/{index-BTlx9K_t.js → index-yIub2xUM.js} +2 -2
- package/dist/owletto/dist/assets/json-diff-LE_vNZrM.js +4 -0
- package/dist/owletto/dist/assets/{list-skeleton-CepswBka.js → list-skeleton-Kzxi2OXB.js} +2 -2
- package/dist/owletto/dist/assets/login-DWOT6jtS.js +2 -0
- package/dist/owletto/dist/assets/logout-Dt_VDilG.js +2 -0
- package/dist/owletto/dist/assets/{member-scope-gate-DD4YBFn-.js → member-scope-gate-De75CR7W.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-p2vIbfkC.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-CDrAjH31.js → model-selector-3l9lY50C.js} +2 -2
- package/dist/owletto/dist/assets/model-udnQ_S43.js +2 -0
- package/dist/owletto/dist/assets/models-CQj7GIOp.js +2 -0
- package/dist/owletto/dist/assets/new-BOwIHkre.js +2 -0
- package/dist/owletto/dist/assets/{new-ktz9Cs_P.js → new-BbdwuJPm.js} +2 -2
- package/dist/owletto/dist/assets/new-DTuFCQhV.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-lZNZ9gul.js → oauth-workspace-access-QPo4YwRX.js} +2 -2
- package/dist/owletto/dist/assets/organization-BDzjnqPf.js +2 -0
- package/dist/owletto/dist/assets/peek-pane-content-D7yt0PrA.js +2 -0
- package/dist/owletto/dist/assets/permissions-CfoY4WFY.js +2 -0
- package/dist/owletto/dist/assets/proposal-review-shell-CVkLnnKo.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-DXUTTGGp.js +2 -0
- package/dist/owletto/dist/assets/record-activity-BXhvJbd9.js +2 -0
- package/dist/owletto/dist/assets/{record-session-Pbr5czGw.js → record-session-D07szzqN.js} +2 -2
- package/dist/owletto/dist/assets/renderer-AJxSmE3-.js +97 -0
- package/dist/owletto/dist/assets/reset-password-kRYyQuTY.js +2 -0
- package/dist/owletto/dist/assets/runs-lG2ChtOt.js +2 -0
- package/dist/owletto/dist/assets/runs-panel-LnGpHCAQ.js +2 -0
- package/dist/owletto/dist/assets/schema-type-editor-panel-C_Es0qDf.js +2 -0
- package/dist/owletto/dist/assets/settings-CEAOg7fr.js +2 -0
- package/dist/owletto/dist/assets/settings-gGYXbFfd.js +2 -0
- package/dist/owletto/dist/assets/skills-BOL5c_Tk.js +2 -0
- package/dist/owletto/dist/assets/source-record-panels-CjFPgKKJ.js +2 -0
- package/dist/owletto/dist/assets/status-dot-CSBtKT4g.js +2 -0
- package/dist/owletto/dist/assets/table-DHM-vCxP.js +2 -0
- package/dist/owletto/dist/assets/use-automations-C4TSie1i.js +2 -0
- package/dist/owletto/dist/assets/{use-mention-search-Dcunv4L0.js → use-mention-search-PfZrNbu_.js} +4 -4
- package/dist/owletto/dist/assets/use-scroll-sentinel-D-fJx_Md.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-DkX4YdDT.js +2 -0
- package/dist/owletto/dist/assets/views-access-required-2ubIf_3N.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +137007 -132255
- package/npm-shrinkwrap.json +723 -1095
- package/package.json +7 -10
- package/vendor/@better-auth-kysely-adapter/LICENSE.md +20 -0
- package/vendor/@better-auth-kysely-adapter/README.md +17 -0
- package/vendor/@better-auth-kysely-adapter/dist/bun-sqlite-dialect-DoOVo4ja.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/d1-sqlite-dialect-Cru74LbR.mjs +133 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.d.mts +116 -0
- package/vendor/@better-auth-kysely-adapter/dist/index.mjs +719 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.d.mts +27 -0
- package/vendor/@better-auth-kysely-adapter/dist/node-sqlite-dialect.mjs +123 -0
- package/vendor/@better-auth-kysely-adapter/dist/sqlite-introspector-DSCAP82F.mjs +90 -0
- package/vendor/@better-auth-kysely-adapter/package.json +52 -0
- package/vendor/connector-sdk/dist/browser-requirement.js +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +34 -1
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/connector-sdk/dist/redact.js +130 -0
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/core/dist/agent-tooling.d.ts +8 -0
- package/vendor/core/dist/agent-tooling.js +9 -1
- package/vendor/core/dist/capabilities.d.ts +1 -1
- package/vendor/core/dist/capabilities.js +5 -0
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/entity-reference.d.ts +3 -0
- package/vendor/core/dist/contracts/entity-reference.js +31 -0
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +3 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +4 -1
- package/vendor/core/dist/contracts/tools/manage-connections.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +2 -2
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +117 -34
- package/vendor/core/dist/contracts/tools/manage-entity.js +47 -14
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +13 -4
- package/vendor/core/dist/contracts/tools/manage-operations.js +19 -7
- package/vendor/core/dist/contracts/tools/read-knowledge.d.ts +6 -1
- package/vendor/core/dist/contracts/tools/read-knowledge.js +20 -1
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +3 -1
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +4 -9
- package/vendor/core/dist/contracts/worker/device-automation.js +10 -15
- package/vendor/core/dist/contracts/worker/protocol.d.ts +20 -0
- package/vendor/core/dist/contracts/worker/protocol.js +20 -0
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/otel.js +38 -10
- package/vendor/core/dist/reserved.d.ts +6 -3
- package/vendor/core/dist/reserved.js +6 -3
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/dist/worker/auth.d.ts +3 -2
- package/vendor/core/package.json +31 -5
- package/vendor/postgres/.bun-tag-22d644c2873790db +0 -0
- package/vendor/postgres/cf/src/query.js +3 -1
- package/vendor/postgres/cjs/src/query.js +3 -1
- package/vendor/postgres/src/query.js +3 -1
- package/vendor/views/dist/api.js +31 -7
- package/vendor/views/dist/bridge.d.ts +2 -1
- package/vendor/views/dist/bridge.js +10 -1
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-BorucF19.js +0 -3
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +0 -2
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +0 -2
- package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +0 -2
- package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +0 -2
- package/dist/owletto/dist/assets/_deploymentId-B1UWPY0i.js +0 -2
- package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +0 -2
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +0 -2
- package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +0 -3
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +0 -2
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +0 -2
- package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +0 -2
- package/dist/owletto/dist/assets/accept-invitation-UXU5Fx2G.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +0 -2
- package/dist/owletto/dist/assets/agent-card-controls-CplnPhbv.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +0 -2
- package/dist/owletto/dist/assets/agent-guardrails-route-TdvvIc_J.js +0 -2
- package/dist/owletto/dist/assets/agent-permissions-matrix-BkZu1LYE.js +0 -2
- package/dist/owletto/dist/assets/agent-skills-route-B3vvvZZe.js +0 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +0 -2
- package/dist/owletto/dist/assets/agents-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +0 -2
- package/dist/owletto/dist/assets/app-bridge-BCm4muqj.js +0 -128
- package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +0 -2
- package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +0 -2
- package/dist/owletto/dist/assets/automations-DAOln24A.js +0 -2
- package/dist/owletto/dist/assets/callback-CBexCo3F.js +0 -2
- package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +0 -2
- package/dist/owletto/dist/assets/clients-BhNl1tVq.js +0 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +0 -2
- package/dist/owletto/dist/assets/connection-CNm2ukrI.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-WcGCA6qY.js +0 -2
- package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +0 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +0 -2
- package/dist/owletto/dist/assets/conversations-table-D_HOe1jN.js +0 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +0 -2
- package/dist/owletto/dist/assets/create-CCjZxIkK.js +0 -2
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +0 -2
- package/dist/owletto/dist/assets/create-automation-form-Bpy92SM5.js +0 -3
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +0 -2
- package/dist/owletto/dist/assets/deployments-C5hvipQh.js +0 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +0 -2
- package/dist/owletto/dist/assets/deployments-body-DGII20dQ.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +0 -2
- package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +0 -2
- package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +0 -2
- package/dist/owletto/dist/assets/event-detail-DV_zfWnC.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +0 -2
- package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +0 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +0 -2
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +0 -2
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +0 -2
- package/dist/owletto/dist/assets/index-9YuSRymd.js +0 -7950
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +0 -2
- package/dist/owletto/dist/assets/index-B64PGxQm.js +0 -2
- package/dist/owletto/dist/assets/index-BSH07yVD.css +0 -1
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +0 -2
- package/dist/owletto/dist/assets/index-CDz3-ieP.js +0 -12
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +0 -2
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +0 -2
- package/dist/owletto/dist/assets/index-D3WHeGql.js +0 -2
- package/dist/owletto/dist/assets/index-DB1iWI_a.js +0 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +0 -2
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +0 -2
- package/dist/owletto/dist/assets/index-Vcq4gwWv.js +0 -2
- package/dist/owletto/dist/assets/index-fgAJydgX.js +0 -2
- package/dist/owletto/dist/assets/json-diff-DIN5Jhfx.js +0 -4
- package/dist/owletto/dist/assets/login-DxGYyE4n.js +0 -2
- package/dist/owletto/dist/assets/logout-Bkzc7J44.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-BnuhLJ6X.css +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +0 -103
- package/dist/owletto/dist/assets/models-BAVeysNq.js +0 -2
- package/dist/owletto/dist/assets/new-C2av0diq.js +0 -2
- package/dist/owletto/dist/assets/new-snm1ctHn.js +0 -2
- package/dist/owletto/dist/assets/organization-Cb0W823y.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +0 -2
- package/dist/owletto/dist/assets/permissions-Dv39zWKt.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +0 -2
- package/dist/owletto/dist/assets/recent-QhnLDU1_.js +0 -2
- package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +0 -2
- package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +0 -2
- package/dist/owletto/dist/assets/reset-password-CzZw6RcC.js +0 -2
- package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +0 -2
- package/dist/owletto/dist/assets/runs-table-B1APZv7d.js +0 -2
- package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +0 -97
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +0 -2
- package/dist/owletto/dist/assets/settings-VDNiffKU.js +0 -2
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BdfOVPWn.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +0 -2
- /package/vendor/{postgres/.bun-tag-2f292c6554a8475e → @better-auth-kysely-adapter/.bun-tag-abf95749a412716} +0 -0
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Serialized into the signed-in x.com page. All bindings must remain inside
|
|
3
3
|
* this function: the connector ships it with Function.prototype.toString().
|
|
4
4
|
*
|
|
5
|
-
* It reads and sends direct messages
|
|
6
|
-
* the x.com web client calls, with the
|
|
7
|
-
* opens /messages
|
|
5
|
+
* It reads and sends direct messages, and reads the notifications timeline,
|
|
6
|
+
* through the same-origin endpoints the x.com web client calls, with the
|
|
7
|
+
* page's own session cookies. It never opens /messages or /notifications,
|
|
8
|
+
* which mark conversations and notifications read.
|
|
8
9
|
*/
|
|
9
10
|
export function xDirectMessagesProgram() {
|
|
10
11
|
const key = "__lobuXDirectMessagesV1";
|
|
@@ -49,14 +50,26 @@ export function xDirectMessagesProgram() {
|
|
|
49
50
|
return raw ? decodeURIComponent(raw.slice(name.length + 1)) : "";
|
|
50
51
|
}
|
|
51
52
|
// `twid` carries the signed-in numeric user id; it is not a credential.
|
|
52
|
-
function account() {
|
|
53
|
+
function account(expected) {
|
|
53
54
|
const match = /^u=([0-9]+)$/.exec(cookie("twid"));
|
|
54
55
|
if (!match) fail("Sign in to X in the paired browser");
|
|
56
|
+
if (expected !== undefined && match[1] !== expected)
|
|
57
|
+
fail(
|
|
58
|
+
"X account changed or belongs to another account; reconnect this source",
|
|
59
|
+
);
|
|
55
60
|
return match[1];
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
function savedAccount(input) {
|
|
63
|
+
if (
|
|
64
|
+
typeof input.account_id !== "string" ||
|
|
65
|
+
!/^[0-9]{1,20}$/.test(input.account_id)
|
|
66
|
+
)
|
|
67
|
+
fail("Saved X account identity is unavailable; reconnect this source");
|
|
68
|
+
return account(input.account_id);
|
|
69
|
+
}
|
|
70
|
+
async function request(path, init = {}, expected) {
|
|
58
71
|
init.signal?.throwIfAborted();
|
|
59
|
-
const self = account();
|
|
72
|
+
const self = account(expected);
|
|
60
73
|
const csrf = cookie("ct0");
|
|
61
74
|
if (!csrf) fail("Sign in to X in the paired browser");
|
|
62
75
|
const response = await fetch(path, {
|
|
@@ -73,6 +86,7 @@ export function xDirectMessagesProgram() {
|
|
|
73
86
|
...init.headers,
|
|
74
87
|
},
|
|
75
88
|
});
|
|
89
|
+
account(self);
|
|
76
90
|
if (!response.ok) {
|
|
77
91
|
let code = null;
|
|
78
92
|
try {
|
|
@@ -80,6 +94,7 @@ export function xDirectMessagesProgram() {
|
|
|
80
94
|
} catch {
|
|
81
95
|
code = null;
|
|
82
96
|
}
|
|
97
|
+
account(self);
|
|
83
98
|
fail(
|
|
84
99
|
`request failed (HTTP ${response.status}${code === null ? "" : `, X error ${code}`})`,
|
|
85
100
|
response.status,
|
|
@@ -89,23 +104,28 @@ export function xDirectMessagesProgram() {
|
|
|
89
104
|
if (account() !== self) fail("X account changed during the request");
|
|
90
105
|
return body;
|
|
91
106
|
}
|
|
92
|
-
async function inbox() {
|
|
107
|
+
async function inbox(self) {
|
|
93
108
|
const body = await request(
|
|
94
109
|
`${DM_API}/inbox_initial_state.json?${DM_PARAMS}`,
|
|
110
|
+
{},
|
|
111
|
+
self,
|
|
95
112
|
);
|
|
96
113
|
return body?.inbox_initial_state ?? fail("Inbox state is unavailable");
|
|
97
114
|
}
|
|
98
|
-
async function conversation(conversationId, maxId, signal) {
|
|
115
|
+
async function conversation(conversationId, maxId, signal, self) {
|
|
99
116
|
const page = maxId ? `&max_id=${encodeURIComponent(maxId)}` : "";
|
|
100
117
|
const body = await request(
|
|
101
118
|
`${DM_API}/conversation/${conversationId}.json?context=FETCH_DM_CONVERSATION&${DM_PARAMS}${page}`,
|
|
102
119
|
signal ? { signal } : {},
|
|
120
|
+
self,
|
|
103
121
|
);
|
|
104
122
|
return body?.conversation_timeline ?? fail("Conversation is unavailable");
|
|
105
123
|
}
|
|
106
|
-
async function updates(cursor) {
|
|
124
|
+
async function updates(cursor, self) {
|
|
107
125
|
const body = await request(
|
|
108
126
|
`${DM_API}/user_updates.json?cursor=${encodeURIComponent(cursor)}&${DM_PARAMS}`,
|
|
127
|
+
{},
|
|
128
|
+
self,
|
|
109
129
|
);
|
|
110
130
|
const events = body?.user_events ?? fail("Inbox updates are unavailable");
|
|
111
131
|
// A quiet inbox answers with only its cursor and last-seen ids: no
|
|
@@ -210,7 +230,12 @@ export function xDirectMessagesProgram() {
|
|
|
210
230
|
async function readMessage(self, conversationId, messageId) {
|
|
211
231
|
let maxId;
|
|
212
232
|
for (let page = 0; page < LOOKUP_PAGES; page++) {
|
|
213
|
-
const timeline = await conversation(
|
|
233
|
+
const timeline = await conversation(
|
|
234
|
+
conversationId,
|
|
235
|
+
maxId,
|
|
236
|
+
undefined,
|
|
237
|
+
self,
|
|
238
|
+
);
|
|
214
239
|
const row = rowsOf(timeline, self).find(
|
|
215
240
|
(candidate) => candidate.message_id === messageId,
|
|
216
241
|
);
|
|
@@ -225,7 +250,7 @@ export function xDirectMessagesProgram() {
|
|
|
225
250
|
fail("Message lookup is incomplete: conversation page limit reached");
|
|
226
251
|
}
|
|
227
252
|
async function read(input) {
|
|
228
|
-
const self =
|
|
253
|
+
const self = savedAccount(input);
|
|
229
254
|
const limit = Math.max(1, Math.min(100, Number(input.limit) || 20));
|
|
230
255
|
const query = typeof input.query === "string" ? input.query.trim() : "";
|
|
231
256
|
if (query) {
|
|
@@ -235,7 +260,7 @@ export function xDirectMessagesProgram() {
|
|
|
235
260
|
return { rows: row ? [row] : [], hasMore: false };
|
|
236
261
|
}
|
|
237
262
|
// The inbox's recent state across conversations, not a history export.
|
|
238
|
-
const all = rowsOf(await inbox(), self);
|
|
263
|
+
const all = rowsOf(await inbox(self), self);
|
|
239
264
|
let start = 0;
|
|
240
265
|
if (input.cursor) {
|
|
241
266
|
if (typeof input.cursor !== "string" || input.cursor.length > 1000)
|
|
@@ -304,7 +329,7 @@ export function xDirectMessagesProgram() {
|
|
|
304
329
|
);
|
|
305
330
|
}
|
|
306
331
|
async function send(input) {
|
|
307
|
-
const self =
|
|
332
|
+
const self = savedAccount(input);
|
|
308
333
|
const signal = AbortSignal.timeout(SEND_TIMEOUT_MS);
|
|
309
334
|
const conversationId = String(input.conversation_id ?? "");
|
|
310
335
|
if (!CONVERSATION_ID.test(conversationId))
|
|
@@ -330,7 +355,7 @@ export function xDirectMessagesProgram() {
|
|
|
330
355
|
});
|
|
331
356
|
const readConversation = () => {
|
|
332
357
|
if (account() !== self) fail("X account changed before the send read");
|
|
333
|
-
return conversation(conversationId, undefined, signal);
|
|
358
|
+
return conversation(conversationId, undefined, signal, self);
|
|
334
359
|
};
|
|
335
360
|
// Only an existing conversation the account can read is a send target.
|
|
336
361
|
const before = await readConversation();
|
|
@@ -340,21 +365,25 @@ export function xDirectMessagesProgram() {
|
|
|
340
365
|
for (const delay of [...UNAVAILABLE_SEND_RETRY_DELAYS_MS, null]) {
|
|
341
366
|
if (account() !== self) fail("X account changed before the send");
|
|
342
367
|
try {
|
|
343
|
-
response = await request(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
368
|
+
response = await request(
|
|
369
|
+
`${DM_API}/new2.json`,
|
|
370
|
+
{
|
|
371
|
+
method: "POST",
|
|
372
|
+
signal,
|
|
373
|
+
headers: { "content-type": "application/json" },
|
|
374
|
+
body: JSON.stringify({
|
|
375
|
+
conversation_id: conversationId,
|
|
376
|
+
recipient_ids: false,
|
|
377
|
+
request_id: requestId,
|
|
378
|
+
text,
|
|
379
|
+
cards_platform: "Web-12",
|
|
380
|
+
include_cards: 1,
|
|
381
|
+
include_quote_count: true,
|
|
382
|
+
dm_users: false,
|
|
383
|
+
}),
|
|
384
|
+
},
|
|
385
|
+
self,
|
|
386
|
+
);
|
|
358
387
|
break;
|
|
359
388
|
} catch (error) {
|
|
360
389
|
if (error?.status !== 503) throw error;
|
|
@@ -398,7 +427,7 @@ export function xDirectMessagesProgram() {
|
|
|
398
427
|
// inbox stands now, and each later pass reports what arrived after it.
|
|
399
428
|
async function snapshot(previous, self) {
|
|
400
429
|
if (!previous) {
|
|
401
|
-
const state = await inbox();
|
|
430
|
+
const state = await inbox(self);
|
|
402
431
|
messagesOf(state);
|
|
403
432
|
if (typeof state.cursor !== "string" || !state.cursor)
|
|
404
433
|
fail("Inbox cursor is unavailable");
|
|
@@ -417,7 +446,7 @@ export function xDirectMessagesProgram() {
|
|
|
417
446
|
let cursor = previous.cursor;
|
|
418
447
|
let more = false;
|
|
419
448
|
for (let page = 1; ; page++) {
|
|
420
|
-
const batch = await updates(cursor);
|
|
449
|
+
const batch = await updates(cursor, self);
|
|
421
450
|
for (const row of rowsOf(batch, self).reverse()) {
|
|
422
451
|
if (observed.has(row.id)) continue;
|
|
423
452
|
observed.add(row.id);
|
|
@@ -515,13 +544,13 @@ export function xDirectMessagesProgram() {
|
|
|
515
544
|
async function poll(listener) {
|
|
516
545
|
if (!active(listener)) return;
|
|
517
546
|
try {
|
|
547
|
+
account(listener.account);
|
|
518
548
|
if (!listener.batches.length) {
|
|
519
|
-
if (account() !== listener.account)
|
|
520
|
-
fail("X account changed; reconnect this source");
|
|
521
549
|
const { checkpoint } = listener;
|
|
522
550
|
const result = await snapshot(checkpoint?.x_dm, listener.account);
|
|
523
551
|
listener.batches = await batchesOf(checkpoint, result);
|
|
524
552
|
}
|
|
553
|
+
account(listener.account);
|
|
525
554
|
if (active(listener)) post(listener, listener.batches[0]);
|
|
526
555
|
} catch {
|
|
527
556
|
stop(
|
|
@@ -545,6 +574,11 @@ export function xDirectMessagesProgram() {
|
|
|
545
574
|
event.data.sequence !== listener.sequence
|
|
546
575
|
)
|
|
547
576
|
return;
|
|
577
|
+
try {
|
|
578
|
+
account(listener.account);
|
|
579
|
+
} catch {
|
|
580
|
+
return stop(listener, "X account changed; reconnect this source");
|
|
581
|
+
}
|
|
548
582
|
if (event.data.ok === false)
|
|
549
583
|
return stop(
|
|
550
584
|
listener,
|
|
@@ -561,7 +595,7 @@ export function xDirectMessagesProgram() {
|
|
|
561
595
|
async function listen(input) {
|
|
562
596
|
if (!input.bridge_id || !input.token)
|
|
563
597
|
fail("Source subscription binding is required");
|
|
564
|
-
const self =
|
|
598
|
+
const self = savedAccount(input);
|
|
565
599
|
const previous = input.checkpoint?.x_dm;
|
|
566
600
|
if (previous && previous.account !== self)
|
|
567
601
|
fail("Source checkpoint belongs to another account");
|
|
@@ -587,5 +621,188 @@ export function xDirectMessagesProgram() {
|
|
|
587
621
|
fail("Unable to attach source subscription");
|
|
588
622
|
return { listening: true };
|
|
589
623
|
}
|
|
590
|
-
|
|
624
|
+
// The notification API is read from this same neutral page. In particular,
|
|
625
|
+
// never render /notifications or call its seen/read-state endpoints here.
|
|
626
|
+
async function readNotifications(input) {
|
|
627
|
+
const self = savedAccount(input);
|
|
628
|
+
const limit = Math.max(
|
|
629
|
+
1,
|
|
630
|
+
Math.min(100, Math.trunc(Number(input.limit) || 25)),
|
|
631
|
+
);
|
|
632
|
+
let cursor = null;
|
|
633
|
+
if (input.cursor) {
|
|
634
|
+
if (typeof input.cursor !== "string" || input.cursor.length > 10000)
|
|
635
|
+
fail("Invalid notification cursor");
|
|
636
|
+
cursor = JSON.parse(input.cursor);
|
|
637
|
+
if (
|
|
638
|
+
cursor.v !== 1 ||
|
|
639
|
+
cursor.kind !== "notifications" ||
|
|
640
|
+
cursor.account !== self ||
|
|
641
|
+
!(cursor.source === null || typeof cursor.source === "string") ||
|
|
642
|
+
!(cursor.after === null || typeof cursor.after === "string")
|
|
643
|
+
)
|
|
644
|
+
fail("Notification cursor belongs to another account or source");
|
|
645
|
+
}
|
|
646
|
+
const path =
|
|
647
|
+
"/i/api/2/notifications/all.json?count=50" +
|
|
648
|
+
(cursor?.source ? `&cursor=${encodeURIComponent(cursor.source)}` : "");
|
|
649
|
+
let body;
|
|
650
|
+
try {
|
|
651
|
+
body = await request(path, {}, self);
|
|
652
|
+
} catch (error) {
|
|
653
|
+
account(self);
|
|
654
|
+
if (
|
|
655
|
+
input.restartExpired &&
|
|
656
|
+
cursor?.source &&
|
|
657
|
+
[400, 404].includes(error.status)
|
|
658
|
+
)
|
|
659
|
+
return { rows: [], account_id: self, expired: true };
|
|
660
|
+
throw error;
|
|
661
|
+
}
|
|
662
|
+
if (!Array.isArray(body?.timeline?.instructions) || !body.globalObjects)
|
|
663
|
+
fail("Notification timeline is unavailable");
|
|
664
|
+
const entries = [];
|
|
665
|
+
for (const instruction of body.timeline.instructions) {
|
|
666
|
+
for (const entry of instruction.addEntries?.entries ?? []) {
|
|
667
|
+
const index = entries.findIndex(
|
|
668
|
+
(prior) => prior.entryId === entry.entryId,
|
|
669
|
+
);
|
|
670
|
+
if (index < 0) entries.push(entry);
|
|
671
|
+
else entries[index] = entry;
|
|
672
|
+
}
|
|
673
|
+
const replacement = instruction.replaceEntry;
|
|
674
|
+
if (replacement?.entry) {
|
|
675
|
+
const index = entries.findIndex(
|
|
676
|
+
(prior) => prior.entryId === replacement.entryIdToReplace,
|
|
677
|
+
);
|
|
678
|
+
if (index < 0) entries.push(replacement.entry);
|
|
679
|
+
else entries[index] = replacement.entry;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
const all = [];
|
|
683
|
+
const seen = new Set();
|
|
684
|
+
let next;
|
|
685
|
+
for (const entry of entries) {
|
|
686
|
+
const operation = entry.content?.operation;
|
|
687
|
+
if (operation?.cursor) {
|
|
688
|
+
if (operation.cursor.cursorType === "Bottom") {
|
|
689
|
+
if (typeof operation.cursor.value !== "string")
|
|
690
|
+
fail("Notification continuation is invalid");
|
|
691
|
+
next = operation.cursor.value || undefined;
|
|
692
|
+
}
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
if (typeof entry.entryId !== "string" || !entry.entryId)
|
|
696
|
+
fail("Notification entry has no stable identity");
|
|
697
|
+
const content = entry.content?.item?.content;
|
|
698
|
+
const ref = content?.notification;
|
|
699
|
+
const note = ref ? body.globalObjects.notifications?.[ref.id] : null;
|
|
700
|
+
const tweet = content?.tweet
|
|
701
|
+
? body.globalObjects.tweets?.[content.tweet.id]
|
|
702
|
+
: null;
|
|
703
|
+
if (ref ? !note || note.id !== ref.id : !tweet)
|
|
704
|
+
fail("Notification item is unavailable or unsupported");
|
|
705
|
+
const id = `${self}:${entry.entryId}`;
|
|
706
|
+
if (seen.has(id)) continue;
|
|
707
|
+
seen.add(id);
|
|
708
|
+
if (
|
|
709
|
+
note &&
|
|
710
|
+
(typeof note.timestampMs !== "string" ||
|
|
711
|
+
!/^[0-9]+$/.test(note.timestampMs))
|
|
712
|
+
)
|
|
713
|
+
fail("Notification item has no verifiable source date");
|
|
714
|
+
const sourceTime = note
|
|
715
|
+
? Number(note.timestampMs)
|
|
716
|
+
: Date.parse(tweet.created_at);
|
|
717
|
+
if (
|
|
718
|
+
!Number.isFinite(sourceTime) ||
|
|
719
|
+
!Number.isFinite(new Date(sourceTime).getTime())
|
|
720
|
+
)
|
|
721
|
+
fail("Notification item has no verifiable source date");
|
|
722
|
+
const actorIds = [...new Set(ref?.fromUsers ?? [tweet?.user_id_str])]
|
|
723
|
+
.filter((x) => typeof x === "string" && x)
|
|
724
|
+
.sort();
|
|
725
|
+
const tweetIds = [...new Set(ref?.targetTweets ?? [content?.tweet?.id])]
|
|
726
|
+
.filter((x) => typeof x === "string" && x)
|
|
727
|
+
.sort();
|
|
728
|
+
let url = "https://x.com/notifications";
|
|
729
|
+
if (tweet)
|
|
730
|
+
url = `https://x.com/i/status/${encodeURIComponent(content.tweet.id)}`;
|
|
731
|
+
else if (ref.url?.url) {
|
|
732
|
+
try {
|
|
733
|
+
const candidate = new URL(ref.url.url, "https://x.com");
|
|
734
|
+
if (candidate.origin === "https://x.com") url = candidate.href;
|
|
735
|
+
} catch {
|
|
736
|
+
/* Keep the source inbox link. */
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
const row = {
|
|
740
|
+
id,
|
|
741
|
+
account_id: self,
|
|
742
|
+
entry_id: entry.entryId,
|
|
743
|
+
notification_id: ref?.id ?? null,
|
|
744
|
+
kind: note?.icon?.id ?? "post",
|
|
745
|
+
actor_ids: actorIds,
|
|
746
|
+
tweet_ids: tweetIds,
|
|
747
|
+
text: note?.message?.text ?? tweet?.full_text ?? "",
|
|
748
|
+
url,
|
|
749
|
+
occurred_at: new Date(sourceTime).toISOString(),
|
|
750
|
+
timestamp_basis: note ? "notification" : "post_created_at",
|
|
751
|
+
};
|
|
752
|
+
const hash = await crypto.subtle.digest(
|
|
753
|
+
"SHA-256",
|
|
754
|
+
new TextEncoder().encode(JSON.stringify(row)),
|
|
755
|
+
);
|
|
756
|
+
row.revision = Array.from(new Uint8Array(hash), (x) =>
|
|
757
|
+
x.toString(16).padStart(2, "0"),
|
|
758
|
+
).join("");
|
|
759
|
+
// Keep the content-sensitive revision, but never persist sync bodies in child action output.
|
|
760
|
+
if (input.metadataOnly) delete row.text;
|
|
761
|
+
all.push(row);
|
|
762
|
+
}
|
|
763
|
+
let start = 0;
|
|
764
|
+
if (cursor?.after) {
|
|
765
|
+
start = all.findIndex((row) => row.id === cursor.after) + 1;
|
|
766
|
+
if (!start) {
|
|
767
|
+
account(self);
|
|
768
|
+
if (input.restartExpired)
|
|
769
|
+
return { rows: [], account_id: self, expired: true };
|
|
770
|
+
fail(
|
|
771
|
+
"Notification page changed; restart the read (coverage incomplete)",
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
const rows = all.slice(start, start + limit);
|
|
776
|
+
const moreInPage = start + rows.length < all.length;
|
|
777
|
+
if (!moreInPage && cursor && next === cursor.source) {
|
|
778
|
+
if (all.length) fail("Notification cursor did not advance");
|
|
779
|
+
next = undefined;
|
|
780
|
+
}
|
|
781
|
+
const nextCursor = moreInPage
|
|
782
|
+
? JSON.stringify({
|
|
783
|
+
v: 1,
|
|
784
|
+
kind: "notifications",
|
|
785
|
+
account: self,
|
|
786
|
+
source: cursor?.source ?? null,
|
|
787
|
+
after: rows.at(-1).id,
|
|
788
|
+
})
|
|
789
|
+
: next
|
|
790
|
+
? JSON.stringify({
|
|
791
|
+
v: 1,
|
|
792
|
+
kind: "notifications",
|
|
793
|
+
account: self,
|
|
794
|
+
source: next,
|
|
795
|
+
after: null,
|
|
796
|
+
})
|
|
797
|
+
: undefined;
|
|
798
|
+
if (account() !== self)
|
|
799
|
+
fail("X account changed during the notification read");
|
|
800
|
+
return {
|
|
801
|
+
rows,
|
|
802
|
+
account_id: self,
|
|
803
|
+
hasMore: !!nextCursor,
|
|
804
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
globalThis[key] = { version, read, listen, send, detach, readNotifications };
|
|
591
808
|
}
|