@lobu/runtime-server 23.0.0 → 24.1.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-dm-adapter.js +65 -30
- 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/db/migrations/20261021010000_views_compile_config_hash.sql +16 -0
- package/dist/dependencies.bun.lock +64 -61
- package/dist/guest.bundle.js +362 -300
- package/dist/owletto/dist/assets/_-BorucF19.js +3 -0
- package/dist/owletto/dist/assets/_-CkGyNi0G.js +2 -0
- package/dist/owletto/dist/assets/_agentId-BrhcaxUk.js +2 -0
- package/dist/owletto/dist/assets/_agentId-DgRrCE2B.js +2 -0
- package/dist/owletto/dist/assets/_automationId-DSrZIYcs.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DWxv1uoi.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-BTP5ijdT.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-98Y3RuRO.js +2 -0
- package/dist/owletto/dist/assets/{_deploymentId-BuUzGtVL.js → _deploymentId-B1UWPY0i.js} +2 -2
- package/dist/owletto/dist/assets/_eventId-BAnr8g8z.js +2 -0
- package/dist/owletto/dist/assets/_name-BUfFO_A0.js +2 -0
- package/dist/owletto/dist/assets/_owner-C79BwQ0I.js +3 -0
- package/dist/owletto/dist/assets/_shape-Ep6JpyFX.js +2 -0
- package/dist/owletto/dist/assets/_skillKey-B24alBfT.js +2 -0
- package/dist/owletto/dist/assets/_slug-DbPdDc-5.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-DDUxjjFD.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-hdpq3RoX.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-w17IFTtf.js → accept-invitation-UXU5Fx2G.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-D7ORHntE.js +2 -0
- package/dist/owletto/dist/assets/{agent-card-controls-mnTN2AZt.js → agent-card-controls-CplnPhbv.js} +2 -2
- package/dist/owletto/dist/assets/{agent-client-setup-list-Bg3hBfUV.js → agent-client-setup-list-BlXB4SE5.js} +2 -2
- package/dist/owletto/dist/assets/agent-connect-pages-BmknviTI.js +2 -0
- package/dist/owletto/dist/assets/agent-editor-form-DsSoeQeF.js +2 -0
- package/dist/owletto/dist/assets/{agent-guardrails-route-BOrCXcAl.js → agent-guardrails-route-TdvvIc_J.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-Dqcvky-k.js → agent-loading-shells-B7v6Cffw.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-BOo_4r_4.js → agent-permissions-matrix-BkZu1LYE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-CCdvtlmH.js → agent-skill-context-DFucg4c4.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skills-route-BUxIswuq.js → agent-skills-route-B3vvvZZe.js} +2 -2
- package/dist/owletto/dist/assets/agent-subpage-shell-CZJvnjNC.js +2 -0
- package/dist/owletto/dist/assets/agent-thread-D38STyeu.js +6 -0
- package/dist/owletto/dist/assets/agents-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/agents-workbench-DJ67GZ93.js +2 -0
- package/dist/owletto/dist/assets/app._appId-Cp78oEZ9.js +2 -0
- package/dist/owletto/dist/assets/automation-detail-content-DSwbRpbx.js +2 -0
- package/dist/owletto/dist/assets/automations-DAOln24A.js +2 -0
- package/dist/owletto/dist/assets/callback-CBexCo3F.js +2 -0
- package/dist/owletto/dist/assets/{card-Djgp00r_.js → card-jzhQrMDP.js} +2 -2
- package/dist/owletto/dist/assets/{claim-BYUZnyMp.js → claim-B-wq745Q.js} +2 -2
- package/dist/owletto/dist/assets/client-rows-BYbsXGy9.js +2 -0
- package/dist/owletto/dist/assets/{clients-D3Zbjxin.js → clients-BhNl1tVq.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-DHeyRGZI.js → code-editor-CEqoCky-.js} +2 -2
- package/dist/owletto/dist/assets/connect-wx-qqLir.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-kk0_4Svo.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-QR8o-7M5.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.activity-BqprYeOX.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId.index-DhRoSzBr.js +2 -0
- package/dist/owletto/dist/assets/{connection-C3XXFEqh.js → connection-CNm2ukrI.js} +2 -2
- package/dist/owletto/dist/assets/{connection-feed-detail-CIJJLDP8.js → connection-feed-detail-WcGCA6qY.js} +2 -2
- package/dist/owletto/dist/assets/connections-browser-CrtnAs0Q.js +2 -0
- package/dist/owletto/dist/assets/{connector-provenance-8-d8hl10.js → connector-provenance-D-ECOlMJ.js} +2 -2
- package/dist/owletto/dist/assets/connector-scope-lists-CRFEpSvk.js +2 -0
- package/dist/owletto/dist/assets/connectors-CH4KBZyT.js +2 -0
- package/dist/owletto/dist/assets/{consent-CdSvVCgx.js → consent-C9ZpHb7V.js} +2 -2
- package/dist/owletto/dist/assets/{conversations-table-BdXoZAfc.js → conversations-table-D_HOe1jN.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-CYvgWCuv.js → core.esm-BupT3V0i.js} +2 -2
- package/dist/owletto/dist/assets/create-C4lptGWj.js +2 -0
- package/dist/owletto/dist/assets/create-CCjZxIkK.js +2 -0
- package/dist/owletto/dist/assets/create-DkgUQAbB.js +2 -0
- package/dist/owletto/dist/assets/{create-automation-form-CtSSeYj3.js → create-automation-form-Bpy92SM5.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-D6Kc-YQ3.js +2 -0
- package/dist/owletto/dist/assets/{cronstrue-n4qGUraE.js → cronstrue-CWImw-kf.js} +2 -2
- package/dist/owletto/dist/assets/{deployments-RvUdVkj3.js → deployments-C5hvipQh.js} +2 -2
- package/dist/owletto/dist/assets/deployments-CPpFAd_w.js +2 -0
- package/dist/owletto/dist/assets/{deployments-body-BMp7UsMo.js → deployments-body-DGII20dQ.js} +2 -2
- package/dist/owletto/dist/assets/{device-CPU6CjkJ.js → device-D-7WBe9E.js} +2 -2
- package/dist/owletto/dist/assets/device-pin-tombstone-2U0UMu3_.js +2 -0
- package/dist/owletto/dist/assets/device._deviceId-Bn37UpWH.js +2 -0
- package/dist/owletto/dist/assets/entity-avatar-mdh7Kq5D.js +2 -0
- package/dist/owletto/dist/assets/entity-options-Clz_WXK-.js +2 -0
- package/dist/owletto/dist/assets/entity-page-D3e4iPle.js +2 -0
- package/dist/owletto/dist/assets/entity-type-page-DebN1vCM.js +2 -0
- package/dist/owletto/dist/assets/event-detail-DV_zfWnC.js +2 -0
- package/dist/owletto/dist/assets/events-feed-DO3IiJO2.js +2 -0
- package/dist/owletto/dist/assets/filter-editors-Bwhqj7lY.js +2 -0
- package/dist/owletto/dist/assets/{full-page-spinner-DqpH99np.js → full-page-spinner-BVbcpW3R.js} +2 -2
- package/dist/owletto/dist/assets/guardrails-BiJollCA.js +2 -0
- package/dist/owletto/dist/assets/identity-HCFWtdaI.js +2 -0
- package/dist/owletto/dist/assets/index-8wxsyxqt.js +2 -0
- package/dist/owletto/dist/assets/index-9YuSRymd.js +7950 -0
- package/dist/owletto/dist/assets/index-B3c-0eZG.js +2 -0
- package/dist/owletto/dist/assets/index-B64PGxQm.js +2 -0
- package/dist/owletto/dist/assets/index-BSH07yVD.css +1 -0
- package/dist/owletto/dist/assets/{index-Hio-HRfo.js → index-BTlx9K_t.js} +2 -2
- package/dist/owletto/dist/assets/index-BX0EA_oB.js +2 -0
- package/dist/owletto/dist/assets/index-CdJJaQDX.js +2 -0
- package/dist/owletto/dist/assets/index-CfT_W8Vo.js +2 -0
- package/dist/owletto/dist/assets/index-CxF2XXzl.js +2 -0
- package/dist/owletto/dist/assets/index-D3WHeGql.js +2 -0
- package/dist/owletto/dist/assets/{index-ICgKp3YK.js → index-D7gHOpfg.js} +2 -2
- package/dist/owletto/dist/assets/{index-B9uPN6FC.js → index-DB1iWI_a.js} +2 -2
- package/dist/owletto/dist/assets/index-DMNzF8Lf.js +2 -0
- package/dist/owletto/dist/assets/index-DyB3IzOA.js +2 -0
- package/dist/owletto/dist/assets/{index-BQVliQW1.js → index-fgAJydgX.js} +2 -2
- package/dist/owletto/dist/assets/{json-diff-DBoag_OS.js → json-diff-DIN5Jhfx.js} +3 -3
- package/dist/owletto/dist/assets/{list-skeleton-C_GuoxAH.js → list-skeleton-CepswBka.js} +2 -2
- package/dist/owletto/dist/assets/login-DxGYyE4n.js +2 -0
- package/dist/owletto/dist/assets/{logout-CLGgeZB7.js → logout-Bkzc7J44.js} +2 -2
- package/dist/owletto/dist/assets/member-scope-gate-DD4YBFn-.js +2 -0
- package/dist/owletto/dist/assets/memory-browse-page-D_UlBa27.js +103 -0
- package/dist/owletto/dist/assets/{model-selector-dAbDgJvx.js → model-selector-CDrAjH31.js} +2 -2
- package/dist/owletto/dist/assets/models-BAVeysNq.js +2 -0
- package/dist/owletto/dist/assets/new-C2av0diq.js +2 -0
- package/dist/owletto/dist/assets/{new-BkdULx2r.js → new-ktz9Cs_P.js} +2 -2
- package/dist/owletto/dist/assets/new-snm1ctHn.js +2 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-BxsjwgdH.js → oauth-workspace-access-lZNZ9gul.js} +2 -2
- package/dist/owletto/dist/assets/{organization-gxGeDjIV.js → organization-Cb0W823y.js} +2 -2
- package/dist/owletto/dist/assets/peek-pane-content-BNR9ImQY.js +2 -0
- package/dist/owletto/dist/assets/{permissions-aPHaKLec.js → permissions-Dv39zWKt.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-CFhOqCLf.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-DqX8AXfw.js +2 -0
- package/dist/owletto/dist/assets/{recent-D-65Pgu-.js → recent-QhnLDU1_.js} +2 -2
- package/dist/owletto/dist/assets/record-activity-ZJntBfN_.js +2 -0
- package/dist/owletto/dist/assets/record-field-peek-Brh1IQGy.js +2 -0
- package/dist/owletto/dist/assets/record-session-Pbr5czGw.js +2 -0
- package/dist/owletto/dist/assets/{reset-password-uX_V6bip.js → reset-password-CzZw6RcC.js} +2 -2
- package/dist/owletto/dist/assets/runs-panel-C0_DNTcq.js +2 -0
- package/dist/owletto/dist/assets/runs-table-B1APZv7d.js +2 -0
- package/dist/owletto/dist/assets/schema-value-normalization-CKdPjdPC.js +97 -0
- package/dist/owletto/dist/assets/settings-CgZ5Z7wD.js +2 -0
- package/dist/owletto/dist/assets/settings-VDNiffKU.js +2 -0
- package/dist/owletto/dist/assets/skills-DgDGscm5.js +2 -0
- package/dist/owletto/dist/assets/{source-record-panels-CPyzlfD1.js → source-record-panels-BdfOVPWn.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-By8RZyKW.js → use-mention-search-Dcunv4L0.js} +2 -2
- package/dist/owletto/dist/assets/view-param-filters-B0quibBi.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +4226 -3348
- package/npm-shrinkwrap.json +280 -264
- 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/tools/view-runtime.d.ts +74 -0
- package/vendor/core/dist/contracts/tools/view-runtime.js +86 -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 +16 -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
|
@@ -31,10 +31,16 @@ export function xDirectMessagesProgram() {
|
|
|
31
31
|
const UPDATE_PAGES_PER_PASS = 10;
|
|
32
32
|
// Matching recent text without a request id is ambiguous, not delivery proof.
|
|
33
33
|
const RESEND_WINDOW_MS = 10 * 60 * 1000;
|
|
34
|
+
// Reconcile 503 responses before retrying: a failed response can still land.
|
|
35
|
+
const UNAVAILABLE_SEND_RETRY_DELAYS_MS = [3000, 7000];
|
|
36
|
+
// Abort network work before Chrome's 80s awaited-evaluation deadline.
|
|
37
|
+
const SEND_TIMEOUT_MS = 70000;
|
|
34
38
|
const BATCH_EVENTS = 500;
|
|
35
39
|
const BATCH_BYTES = 128 * 1024;
|
|
36
|
-
function fail(message) {
|
|
37
|
-
|
|
40
|
+
function fail(message, status) {
|
|
41
|
+
const error = new Error(`X direct messages: ${message}`);
|
|
42
|
+
if (status !== undefined) error.status = status;
|
|
43
|
+
throw error;
|
|
38
44
|
}
|
|
39
45
|
function cookie(name) {
|
|
40
46
|
const raw = document.cookie
|
|
@@ -49,13 +55,16 @@ export function xDirectMessagesProgram() {
|
|
|
49
55
|
return match[1];
|
|
50
56
|
}
|
|
51
57
|
async function request(path, init = {}) {
|
|
58
|
+
init.signal?.throwIfAborted();
|
|
52
59
|
const self = account();
|
|
53
60
|
const csrf = cookie("ct0");
|
|
54
61
|
if (!csrf) fail("Sign in to X in the paired browser");
|
|
55
62
|
const response = await fetch(path, {
|
|
56
63
|
credentials: "include",
|
|
57
|
-
signal: AbortSignal.timeout(20000),
|
|
58
64
|
...init,
|
|
65
|
+
signal: init.signal
|
|
66
|
+
? AbortSignal.any([init.signal, AbortSignal.timeout(20000)])
|
|
67
|
+
: AbortSignal.timeout(20000),
|
|
59
68
|
headers: {
|
|
60
69
|
authorization: WEB_CLIENT_BEARER,
|
|
61
70
|
"x-csrf-token": csrf,
|
|
@@ -73,6 +82,7 @@ export function xDirectMessagesProgram() {
|
|
|
73
82
|
}
|
|
74
83
|
fail(
|
|
75
84
|
`request failed (HTTP ${response.status}${code === null ? "" : `, X error ${code}`})`,
|
|
85
|
+
response.status,
|
|
76
86
|
);
|
|
77
87
|
}
|
|
78
88
|
const body = await response.json();
|
|
@@ -85,10 +95,11 @@ export function xDirectMessagesProgram() {
|
|
|
85
95
|
);
|
|
86
96
|
return body?.inbox_initial_state ?? fail("Inbox state is unavailable");
|
|
87
97
|
}
|
|
88
|
-
async function conversation(conversationId, maxId) {
|
|
98
|
+
async function conversation(conversationId, maxId, signal) {
|
|
89
99
|
const page = maxId ? `&max_id=${encodeURIComponent(maxId)}` : "";
|
|
90
100
|
const body = await request(
|
|
91
101
|
`${DM_API}/conversation/${conversationId}.json?context=FETCH_DM_CONVERSATION&${DM_PARAMS}${page}`,
|
|
102
|
+
signal ? { signal } : {},
|
|
92
103
|
);
|
|
93
104
|
return body?.conversation_timeline ?? fail("Conversation is unavailable");
|
|
94
105
|
}
|
|
@@ -294,6 +305,7 @@ export function xDirectMessagesProgram() {
|
|
|
294
305
|
}
|
|
295
306
|
async function send(input) {
|
|
296
307
|
const self = account();
|
|
308
|
+
const signal = AbortSignal.timeout(SEND_TIMEOUT_MS);
|
|
297
309
|
const conversationId = String(input.conversation_id ?? "");
|
|
298
310
|
if (!CONVERSATION_ID.test(conversationId))
|
|
299
311
|
fail("conversation_id must be an exact X DM conversation id");
|
|
@@ -308,41 +320,64 @@ export function xDirectMessagesProgram() {
|
|
|
308
320
|
typeof input.idempotency_key === "string" ? input.idempotency_key : "";
|
|
309
321
|
if (!idempotencyKey) fail("idempotency_key is required");
|
|
310
322
|
const requestId = await requestIdOf(self, conversationId, idempotencyKey);
|
|
323
|
+
const delivered = (prior) => ({
|
|
324
|
+
sent: true,
|
|
325
|
+
deduplicated: true,
|
|
326
|
+
id: prior.id,
|
|
327
|
+
message_id: prior.message_id,
|
|
328
|
+
conversation_id: conversationId,
|
|
329
|
+
occurred_at: prior.occurred_at,
|
|
330
|
+
});
|
|
331
|
+
const readConversation = () => {
|
|
332
|
+
if (account() !== self) fail("X account changed before the send read");
|
|
333
|
+
return conversation(conversationId, undefined, signal);
|
|
334
|
+
};
|
|
311
335
|
// Only an existing conversation the account can read is a send target.
|
|
312
|
-
const before = await
|
|
336
|
+
const before = await readConversation();
|
|
313
337
|
const prior = earlierAttempt(before, self, requestId, text);
|
|
314
|
-
if (prior)
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
338
|
+
if (prior) return delivered(prior);
|
|
339
|
+
let response;
|
|
340
|
+
for (const delay of [...UNAVAILABLE_SEND_RETRY_DELAYS_MS, null]) {
|
|
341
|
+
if (account() !== self) fail("X account changed before the send");
|
|
342
|
+
try {
|
|
343
|
+
response = await request(`${DM_API}/new2.json`, {
|
|
344
|
+
method: "POST",
|
|
345
|
+
signal,
|
|
346
|
+
headers: { "content-type": "application/json" },
|
|
347
|
+
body: JSON.stringify({
|
|
348
|
+
conversation_id: conversationId,
|
|
349
|
+
recipient_ids: false,
|
|
350
|
+
request_id: requestId,
|
|
351
|
+
text,
|
|
352
|
+
cards_platform: "Web-12",
|
|
353
|
+
include_cards: 1,
|
|
354
|
+
include_quote_count: true,
|
|
355
|
+
dm_users: false,
|
|
356
|
+
}),
|
|
357
|
+
});
|
|
358
|
+
break;
|
|
359
|
+
} catch (error) {
|
|
360
|
+
if (error?.status !== 503) throw error;
|
|
361
|
+
signal.throwIfAborted();
|
|
362
|
+
if (delay !== null)
|
|
363
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
364
|
+
const landed = earlierAttempt(
|
|
365
|
+
await readConversation(),
|
|
366
|
+
self,
|
|
367
|
+
requestId,
|
|
368
|
+
text,
|
|
369
|
+
);
|
|
370
|
+
if (landed) return delivered(landed);
|
|
371
|
+
if (delay === null) throw error;
|
|
372
|
+
}
|
|
323
373
|
}
|
|
324
|
-
if (account() !== self) fail("X account changed before the send");
|
|
325
|
-
const response = await request(`${DM_API}/new2.json`, {
|
|
326
|
-
method: "POST",
|
|
327
|
-
headers: { "content-type": "application/json" },
|
|
328
|
-
body: JSON.stringify({
|
|
329
|
-
conversation_id: conversationId,
|
|
330
|
-
recipient_ids: false,
|
|
331
|
-
request_id: requestId,
|
|
332
|
-
text,
|
|
333
|
-
cards_platform: "Web-12",
|
|
334
|
-
include_cards: 1,
|
|
335
|
-
include_quote_count: true,
|
|
336
|
-
dm_users: false,
|
|
337
|
-
}),
|
|
338
|
-
});
|
|
339
374
|
const created = messagesOf(response).find(
|
|
340
375
|
(message) => String(message.conversation_id) === conversationId,
|
|
341
376
|
);
|
|
342
377
|
const messageId = created ? String(created.id ?? "") : "";
|
|
343
378
|
if (!/^[0-9]+$/.test(messageId))
|
|
344
379
|
fail("X accepted the send but returned no message id");
|
|
345
|
-
const after = await
|
|
380
|
+
const after = await readConversation();
|
|
346
381
|
const landed = rowsOf(after, self).find(
|
|
347
382
|
(row) => row.message_id === messageId && row.from_me,
|
|
348
383
|
);
|
|
@@ -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;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
-- migrate:up
|
|
2
|
+
-- lobu:quiesce running code matches and writes the retired type/entity/placement/surface/event_kind attach shapes
|
|
3
|
+
-- View attachments name a page by key: { record, id? }, { collection, when? },
|
|
4
|
+
-- { workspace: true } and { event, type? }. Placement is gone: a record view
|
|
5
|
+
-- renders as a card on the record page and opens fullscreen from there.
|
|
6
|
+
-- { type } -> { collection } and { record } (it showed on both)
|
|
7
|
+
-- { type, placement: overview } -> { record } (collections only showed tabs)
|
|
8
|
+
-- { type, surface: record } -> { record }
|
|
9
|
+
-- { type, surface: collection, when? } -> { collection, when? }
|
|
10
|
+
-- { entity: <id or top-level slug> } -> { record: <its type>, id }
|
|
11
|
+
-- (a pin whose record no longer exists is dropped: it rendered nowhere)
|
|
12
|
+
-- { workspace: true, placement? } -> { workspace: true }
|
|
13
|
+
-- { event_kind, type? } -> { event, type? }
|
|
14
|
+
-- Lock safety: `views` holds one row per authored view, not per render or event.
|
|
15
|
+
UPDATE public.views v
|
|
16
|
+
SET attach = COALESCE((
|
|
17
|
+
SELECT jsonb_agg(m.entry ORDER BY a.ord, m.sub)
|
|
18
|
+
FROM jsonb_array_elements(v.attach) WITH ORDINALITY AS a(x, ord)
|
|
19
|
+
CROSS JOIN LATERAL (
|
|
20
|
+
SELECT 1 AS sub,
|
|
21
|
+
jsonb_strip_nulls(jsonb_build_object('event', a.x->'event_kind', 'type', a.x->'type')) AS entry
|
|
22
|
+
WHERE a.x ? 'event_kind'
|
|
23
|
+
UNION ALL
|
|
24
|
+
SELECT 1, '{"workspace": true}'::jsonb
|
|
25
|
+
WHERE a.x ? 'workspace'
|
|
26
|
+
UNION ALL
|
|
27
|
+
SELECT 1, jsonb_strip_nulls(jsonb_build_object('collection', a.x->'type', 'when', a.x->'when'))
|
|
28
|
+
WHERE a.x ? 'type' AND NOT a.x ? 'event_kind'
|
|
29
|
+
AND COALESCE(a.x->>'surface', '') <> 'record'
|
|
30
|
+
AND COALESCE(a.x->>'placement', 'tab') = 'tab'
|
|
31
|
+
UNION ALL
|
|
32
|
+
SELECT 2, jsonb_build_object('record', a.x->'type')
|
|
33
|
+
WHERE a.x ? 'type' AND NOT a.x ? 'event_kind'
|
|
34
|
+
AND COALESCE(a.x->>'surface', '') <> 'collection'
|
|
35
|
+
UNION ALL
|
|
36
|
+
SELECT 1, jsonb_build_object('record', et.slug, 'id', e.id)
|
|
37
|
+
FROM public.entities e
|
|
38
|
+
JOIN public.entity_types et ON et.id = e.entity_type_id
|
|
39
|
+
WHERE a.x ? 'entity'
|
|
40
|
+
AND e.organization_id = v.organization_id
|
|
41
|
+
AND e.deleted_at IS NULL
|
|
42
|
+
AND (
|
|
43
|
+
(jsonb_typeof(a.x->'entity') = 'number' AND e.id = (a.x->>'entity')::bigint)
|
|
44
|
+
OR (jsonb_typeof(a.x->'entity') = 'string' AND e.parent_id IS NULL AND e.slug = a.x->>'entity')
|
|
45
|
+
)
|
|
46
|
+
) m
|
|
47
|
+
), '[]'::jsonb)
|
|
48
|
+
WHERE EXISTS (
|
|
49
|
+
SELECT 1 FROM jsonb_array_elements(v.attach) x
|
|
50
|
+
WHERE x ?| ARRAY['entity', 'event_kind', 'placement', 'surface']
|
|
51
|
+
OR (x ? 'type' AND NOT x ? 'event')
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
-- migrate:down
|
|
55
|
+
-- Record views come back as Overview cards; a pinned record keeps its id.
|
|
56
|
+
UPDATE public.views v
|
|
57
|
+
SET attach = COALESCE((
|
|
58
|
+
SELECT jsonb_agg(
|
|
59
|
+
CASE
|
|
60
|
+
WHEN a.x ? 'event' THEN jsonb_strip_nulls(jsonb_build_object('event_kind', a.x->'event', 'type', a.x->'type'))
|
|
61
|
+
WHEN a.x ? 'collection' THEN jsonb_strip_nulls(jsonb_build_object('type', a.x->'collection', 'surface', 'collection', 'when', a.x->'when'))
|
|
62
|
+
WHEN a.x ? 'id' THEN jsonb_build_object('entity', a.x->'id', 'placement', 'overview')
|
|
63
|
+
WHEN a.x ? 'record' THEN jsonb_build_object('type', a.x->'record', 'surface', 'record', 'placement', 'overview')
|
|
64
|
+
ELSE a.x
|
|
65
|
+
END ORDER BY a.ord)
|
|
66
|
+
FROM jsonb_array_elements(v.attach) WITH ORDINALITY AS a(x, ord)
|
|
67
|
+
), '[]'::jsonb)
|
|
68
|
+
WHERE EXISTS (
|
|
69
|
+
SELECT 1 FROM jsonb_array_elements(v.attach) x
|
|
70
|
+
WHERE x ?| ARRAY['record', 'collection', 'event']
|
|
71
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- migrate:up
|
|
2
|
+
-- lobu:no-quiesce old code never reads the column, and a bundle it writes no longer matches the stamp's digest
|
|
3
|
+
-- `<compiler fingerprint>:<bundle digest>` for a compiled_code the server
|
|
4
|
+
-- compiled itself: the fingerprint covers the bootstrap, the bundled
|
|
5
|
+
-- @lobu/views runtime, pinned package versions and esbuild. NULL for a bundle
|
|
6
|
+
-- the caller supplied and for rows saved before this column existed. When the
|
|
7
|
+
-- digest still matches compiled_code and the fingerprint differs from the
|
|
8
|
+
-- running server's, the bundle is stale and the server rebuilds it from
|
|
9
|
+
-- source_code when the view is served. A writer that replaces compiled_code
|
|
10
|
+
-- without restamping leaves a mismatched digest, so that bundle is never
|
|
11
|
+
-- rebuilt.
|
|
12
|
+
ALTER TABLE public.views ADD COLUMN IF NOT EXISTS compile_config_hash text;
|
|
13
|
+
|
|
14
|
+
-- migrate:down
|
|
15
|
+
|
|
16
|
+
ALTER TABLE public.views DROP COLUMN IF EXISTS compile_config_hash;
|