@lobu/runtime-server 24.11.1 → 24.12.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 +1113 -107
- package/dist/catalogs/skills.json +2 -2
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +2 -2
- package/dist/connectors/chat-transport-actions.ts +50 -0
- package/dist/connectors/discord.ts +2 -0
- package/dist/connectors/gchat.ts +2 -0
- package/dist/connectors/github.ts +4 -4
- package/dist/connectors/google_drive.ts +20 -0
- package/dist/connectors/google_gmail.ts +49 -8
- package/dist/connectors/herdr.ts +1 -1
- package/dist/connectors/imessage.ts +1 -0
- package/dist/connectors/linkedin-browser-script.ts +11 -0
- package/dist/connectors/linkedin-draft-page.js +24 -8
- package/dist/connectors/linkedin-inbox-adapter.js +209 -19
- package/dist/connectors/linkedin-inbox.ts +152 -4
- package/dist/connectors/linkedin-network.ts +788 -0
- package/dist/connectors/linkedin-search.ts +1284 -0
- package/dist/connectors/linkedin.ts +892 -27
- package/dist/connectors/microsoft_outlook.ts +57 -19
- package/dist/connectors/rss.ts +179 -33
- package/dist/connectors/slack.ts +2 -0
- package/dist/connectors/source-file-attachment.ts +46 -0
- package/dist/connectors/teams.ts +2 -0
- package/dist/connectors/telegram.ts +2 -0
- package/dist/connectors/tiktok_web.ts +1 -1
- package/dist/connectors/whatsapp.ts +2 -0
- package/dist/connectors/whatsapp_web.ts +3 -3
- package/dist/connectors/x-dm-adapter.js +8 -10
- package/dist/connectors/x.ts +8 -9
- package/dist/db/migrations/20261115040000_account_two_factor.sql +20 -0
- package/dist/db/migrations/20261115130000_entities_retired_type_idx.sql +34 -0
- package/dist/db/migrations/20261115140000_entity_identities_personal_owner_idx.sql +34 -0
- package/dist/db/migrations/20261117090000_write_policy_kind_note.sql +65 -0
- package/dist/db/migrations/20261117120000_app_policy_principal.sql +48 -0
- package/dist/db/migrations/20261117170000_personal_org_connector_auto_policy_backfill.sql +57 -0
- package/dist/db/migrations/20261117190000_org_slug_reserved_paths.sql +29 -0
- package/dist/db/migrations/20261118120000_workspace_view_top_level_paths.sql +69 -0
- package/dist/db/migrations/preconditions/20261117190000_org_slug_reserved_paths.sql +14 -0
- package/dist/db/migrations/preconditions/20261118120000_workspace_view_top_level_paths.sql +21 -0
- package/dist/dependencies.bun.lock +51 -46
- package/dist/guest.bundle.js +11 -2
- package/dist/owletto/dist/assets/_-BC9j6MkU.js +2 -0
- package/dist/owletto/dist/assets/_-Z1u1cIe6.js +3 -0
- package/dist/owletto/dist/assets/_agentId-B-TFq9TP.js +2 -0
- package/dist/owletto/dist/assets/{_agentId-CGScf8z_.js → _agentId-BGatZWsd.js} +2 -2
- package/dist/owletto/dist/assets/_automationId-CMUrWPvr.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey._connectionId-CUoAoP0_.js +2 -0
- package/dist/owletto/dist/assets/_connectorKey.index-Bs49QGGH.js +2 -0
- package/dist/owletto/dist/assets/_conversationId-CszP1den.js +2 -0
- package/dist/owletto/dist/assets/_eventId-C0AZUBnD.js +2 -0
- package/dist/owletto/dist/assets/_owner-B4ydA75k.js +3 -0
- package/dist/owletto/dist/assets/_shape-C4-ikE70.js +2 -0
- package/dist/owletto/dist/assets/_slug-DE5J3KVu.js +2 -0
- package/dist/owletto/dist/assets/_viewKey-Dkcd8JQC.js +2 -0
- package/dist/owletto/dist/assets/{accept-invitation-BKeIzZXE.js → accept-invitation-DmrQQu_W.js} +2 -2
- package/dist/owletto/dist/assets/{activity-route-location-sLvKaSCa.js → activity-route-location-Bec6fW-t.js} +2 -2
- package/dist/owletto/dist/assets/activity-route-view-DCSNBKZU.js +2 -0
- package/dist/owletto/dist/assets/agent-client-connections-xvabPpi6.js +4 -0
- package/dist/owletto/dist/assets/agent-connect-pages-DDPtkcmq.js +6 -0
- package/dist/owletto/dist/assets/{agent-editor-form-DVFyyMyd.js → agent-editor-form-BrhQbHZg.js} +2 -2
- package/dist/owletto/dist/assets/{agent-loading-shells-BLNHIy-r.js → agent-loading-shells-D3y98xuO.js} +2 -2
- package/dist/owletto/dist/assets/{agent-permissions-matrix-UBKRR5vs.js → agent-permissions-matrix-jQJjSa9i.js} +2 -2
- package/dist/owletto/dist/assets/{agent-skill-context-fqedKd0D.js → agent-skill-context-CCcknBYE.js} +2 -2
- package/dist/owletto/dist/assets/{agent-subpage-shell-BUCoY2Nf.js → agent-subpage-shell-6f_53cSf.js} +2 -2
- package/dist/owletto/dist/assets/agent-thread-v_lSSnJi.js +6 -0
- package/dist/owletto/dist/assets/{app._appId-ByIypCL9.js → app._appId-CKWzZ2ic.js} +2 -2
- package/dist/owletto/dist/assets/assist-composer-Q9ZJjAta.js +2 -0
- package/dist/owletto/dist/assets/automation-run-now-Dl0MKx3N.js +2 -0
- package/dist/owletto/dist/assets/{callback-Pz5uS-k7.js → callback-Bentv78L.js} +2 -2
- package/dist/owletto/dist/assets/{card-CAPpY9P5.js → card-C4oPCVh6.js} +2 -2
- package/dist/owletto/dist/assets/{claim-DgWWK0KI.js → claim-B3C4qIi2.js} +2 -2
- package/dist/owletto/dist/assets/client-activity-scopes-DqaFEyir.js +2 -0
- package/dist/owletto/dist/assets/{client-rows-Dd5YV8vn.js → client-rows-rse9thnk.js} +2 -2
- package/dist/owletto/dist/assets/{clients-Bf7ZgGro.js → clients-BhPMbxHi.js} +2 -2
- package/dist/owletto/dist/assets/{code-editor-z1Sy_hiX.js → code-editor-CTdKUDPY.js} +2 -2
- package/dist/owletto/dist/assets/connect-D8o7HBlo.js +2 -0
- package/dist/owletto/dist/assets/connect-menu-D5EZvSHb.js +2 -0
- package/dist/owletto/dist/assets/connect._clientId-Dbagcg9L.js +2 -0
- package/dist/owletto/dist/assets/connected._clientId-DALW9S2K.js +2 -0
- package/dist/owletto/dist/assets/connection-DyxzSqVE.js +2 -0
- package/dist/owletto/dist/assets/connection-feed-detail-LqpxUCdy.js +2 -0
- package/dist/owletto/dist/assets/{connector-page-shell-an3SYLim.js → connector-page-shell-DZjKv9zQ.js} +2 -2
- package/dist/owletto/dist/assets/{connector-provenance-mSZCOud-.js → connector-provenance-DtTJn1Nk.js} +2 -2
- package/dist/owletto/dist/assets/connectors-BVl-AR33.js +2 -0
- package/dist/owletto/dist/assets/{consent-1ulwyJ3k.js → consent-XCqsHLxS.js} +2 -2
- package/dist/owletto/dist/assets/{core.esm-Ctg_pXLe.js → core.esm-B1du4Zwy.js} +3 -3
- package/dist/owletto/dist/assets/create-BYKCtGL4.js +2 -0
- package/dist/owletto/dist/assets/create-D6Mmuxcq.js +2 -0
- package/dist/owletto/dist/assets/{create-CGuoqPh8.js → create-GHTb6wKX.js} +2 -2
- package/dist/owletto/dist/assets/{create-automation-form-CD6jSlWL.js → create-automation-form-CTiy_S9G.js} +3 -3
- package/dist/owletto/dist/assets/create._connectorKey-DMH97KkK.js +2 -0
- package/dist/owletto/dist/assets/custom-guardrail-edits-DZy66ucV.js +2 -0
- package/dist/owletto/dist/assets/definition-comparison-C2mPfIMD.js +2 -0
- package/dist/owletto/dist/assets/detail-page-skeleton-DNBL7nyk.js +2 -0
- package/dist/owletto/dist/assets/device-CwP1PY8q.js +2 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-Dkj7hrBE.js → device-pin-tombstone-DYTt7kU5.js} +2 -2
- package/dist/owletto/dist/assets/device._deviceId-DZ2kqI4Y.js +2 -0
- package/dist/owletto/dist/assets/{entity-options-D4t-NAcg.js → entity-options-D9K_5Lcs.js} +2 -2
- package/dist/owletto/dist/assets/entity-page-DggKXrcE.js +2 -0
- package/dist/owletto/dist/assets/entity-pages-C6M6yKFf.js +2 -0
- package/dist/owletto/dist/assets/{entity-schema-graph-Cq96SJ3c.js → entity-schema-graph-B255NKjF.js} +2 -2
- package/dist/owletto/dist/assets/entity-type-page-CGBAP2wt.js +2 -0
- package/dist/owletto/dist/assets/event-attachments-D8Z8uwv9.js +2 -0
- package/dist/owletto/dist/assets/event-detail-CgG3pDLA.js +2 -0
- package/dist/owletto/dist/assets/events-feed-ClhEywwV.js +2 -0
- package/dist/owletto/dist/assets/{filter-editors-DGVl9U4D.js → filter-editors-D_Sfn0dv.js} +3 -3
- package/dist/owletto/dist/assets/{full-page-spinner-CtVlF8GQ.js → full-page-spinner-C1clibUY.js} +2 -2
- package/dist/owletto/dist/assets/{index-CK5GDX4B.js → index-04B26s6E.js} +2 -2
- package/dist/owletto/dist/assets/index-2HrEO-nl.js +2 -0
- package/dist/owletto/dist/assets/index-BU3k9wpw.js +2 -0
- package/dist/owletto/dist/assets/{index-DvuJ_S_o.js → index-BXHqp23o.js} +2 -2
- package/dist/owletto/dist/assets/index-BdLRUDIR.js +2 -0
- package/dist/owletto/dist/assets/index-C2FrGwYN.js +2 -0
- package/dist/owletto/dist/assets/index-CB9wGfUm.js +2 -0
- package/dist/owletto/dist/assets/index-Caihaftb.js +2 -0
- package/dist/owletto/dist/assets/index-CwH59DJV.js +2 -0
- package/dist/owletto/dist/assets/index-DB2lVKuV.js +7908 -0
- package/dist/owletto/dist/assets/{index-DbjbHlDe.js → index-DTvJRjrM.js} +2 -2
- package/dist/owletto/dist/assets/index-SF2ni1Rs.css +1 -0
- package/dist/owletto/dist/assets/{index-BifR-LE9.js → index-mSrdbx3C.js} +9 -9
- package/dist/owletto/dist/assets/index-uFn-Ilrx.js +2 -0
- package/dist/owletto/dist/assets/{json-diff-OjtREegr.js → json-diff-Ce6YAXzY.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-CH0qQBYk.js → list-skeleton-DLPBTnbR.js} +2 -2
- package/dist/owletto/dist/assets/login-DeWlvogD.js +2 -0
- package/dist/owletto/dist/assets/{logout-DfdgOLoM.js → logout-CJY0ceN9.js} +2 -2
- package/dist/owletto/dist/assets/{member-scope-gate-Cxg2zGQT.js → member-scope-gate-CBPMprXu.js} +2 -2
- package/dist/owletto/dist/assets/memory-browse-page-D5kj1RaR.js +74 -0
- package/dist/owletto/dist/assets/{model-selector-D2OpDkwH.js → model-selector-CjkBPpjN.js} +2 -2
- package/dist/owletto/dist/assets/new-BKrNkOQD.js +2 -0
- package/dist/owletto/dist/assets/new-BetiMuDq.js +2 -0
- package/dist/owletto/dist/assets/new-dk_-eXqU.js +2 -0
- package/dist/owletto/dist/assets/new-efN--4Wx.js +2 -0
- package/dist/owletto/dist/assets/organization-C3rpwx_d.js +2 -0
- package/dist/owletto/dist/assets/pdf-document--AN-oCKj.css +1 -0
- package/dist/owletto/dist/assets/pdf-document-2W1q0sRA.js +56 -0
- package/dist/owletto/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
- package/dist/owletto/dist/assets/peek-pane-content-ChsBWO0P.js +3 -0
- package/dist/owletto/dist/assets/{pending-seed-BBACroge.js → pending-seed-CTKYdA4X.js} +2 -2
- package/dist/owletto/dist/assets/proposal-review-shell-EyGWEYwQ.js +2 -0
- package/dist/owletto/dist/assets/public-shell-ready-_KWdfzEM.js +2 -0
- package/dist/owletto/dist/assets/record-session-D27VNxP_.js +2 -0
- package/dist/owletto/dist/assets/{renderer-CTKNMcXP.js → renderer-B8yZ5lql.js} +34 -33
- package/dist/owletto/dist/assets/{reset-password-DKBEneyR.js → reset-password-BGVJIh2I.js} +2 -2
- package/dist/owletto/dist/assets/run-initiator-C0sur8lU.js +2 -0
- package/dist/owletto/dist/assets/runs-list-CJOFMgpk.js +2 -0
- package/dist/owletto/dist/assets/schema-value-DDNHANGs.js +3 -0
- package/dist/owletto/dist/assets/{scoped-feed-bar-DNFL0sYX.js → scoped-feed-bar-BTv9mPcR.js} +2 -2
- package/dist/owletto/dist/assets/settings-Ponr5XbS.js +3 -0
- package/dist/owletto/dist/assets/{status-variants-SzXYYedJ.js → status-variants-mLqVhg5O.js} +2 -2
- package/dist/owletto/dist/assets/subDays-BGA_fkig.js +2 -0
- package/dist/owletto/dist/assets/two-factor-pqoxGSgL.js +2 -0
- package/dist/owletto/dist/assets/{use-automations-DfBtVzGa.js → use-automations-DcdlmVuX.js} +2 -2
- package/dist/owletto/dist/assets/{use-login-redirect-BDiS3eyl.js → use-login-redirect-D7HW5Ed6.js} +2 -2
- package/dist/owletto/dist/assets/{use-mention-search-khySpz_V.js → use-mention-search-BniE-K2d.js} +3 -3
- package/dist/owletto/dist/assets/view-card-Cg6PeEiV.js +2 -0
- package/dist/owletto/dist/assets/view-param-filters-CvrKw0mZ.js +2 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/server-main.bundle.mjs +5718 -2991
- package/npm-shrinkwrap.json +195 -172
- package/package.json +2 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +20 -0
- package/vendor/connector-sdk/dist/define-connector.js +2 -0
- package/vendor/connector-sdk/dist/extension-dom-scrape.d.ts +2 -0
- package/vendor/connector-sdk/dist/extension-dom-scrape.js +5 -0
- package/vendor/connector-sdk/dist/reaction-client-types.d.ts +20 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/contracts/entity-reference.d.ts +2 -0
- package/vendor/core/dist/contracts/entity-reference.js +4 -3
- package/vendor/core/dist/contracts/tools/entity-list-sort.d.ts +18 -0
- package/vendor/core/dist/contracts/tools/entity-list-sort.js +64 -0
- package/vendor/core/dist/contracts/tools/manage-agents.d.ts +1 -1
- package/vendor/core/dist/contracts/tools/manage-agents.js +3 -3
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +11 -1
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +29 -3
- package/vendor/core/dist/contracts/tools/manage-operations.js +24 -2
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +36 -0
- package/vendor/core/dist/contracts/tools/manage-views.js +15 -2
- package/vendor/core/dist/contracts/tools/view-definition.js +7 -2
- package/vendor/core/dist/contracts/tools/view-host.js +5 -0
- package/vendor/core/dist/contracts/tools/view-path.d.ts +8 -1
- package/vendor/core/dist/contracts/tools/view-path.js +11 -1
- package/vendor/core/dist/reserved.d.ts +7 -1
- package/vendor/core/dist/reserved.js +17 -0
- package/vendor/core/package.json +6 -1
- package/vendor/views/dist/api.d.ts +19 -3
- package/vendor/views/dist/api.js +53 -5
- package/vendor/views/dist/components.d.ts +7 -0
- package/vendor/views/dist/components.js +223 -2
- package/vendor/views/dist/embed.js +13 -2
- package/vendor/views/dist/live-gate.d.ts +34 -0
- package/vendor/views/dist/live-gate.js +100 -0
- package/vendor/views/dist/native.d.ts +43 -1
- package/vendor/views/dist/native.js +1 -0
- package/vendor/views/package.json +1 -1
- package/dist/owletto/dist/assets/_-BDMUN9XZ.js +0 -2
- package/dist/owletto/dist/assets/_-CF5X4ANe.js +0 -3
- package/dist/owletto/dist/assets/_agentId-EQU2aUP0.js +0 -2
- package/dist/owletto/dist/assets/_automationId-PXZ33jsF.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey._connectionId-DcI29kGy.js +0 -2
- package/dist/owletto/dist/assets/_connectorKey.index-Cr2NDJWX.js +0 -2
- package/dist/owletto/dist/assets/_conversationId-CnmLYlVS.js +0 -2
- package/dist/owletto/dist/assets/_eventId-w5sDz5oa.js +0 -2
- package/dist/owletto/dist/assets/_owner-CkOZR4n0.js +0 -3
- package/dist/owletto/dist/assets/_shape-C_FmSf9G.js +0 -2
- package/dist/owletto/dist/assets/_slug-COPpRXLt.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-BVdJiilV.js +0 -2
- package/dist/owletto/dist/assets/_viewKey-mxxpqjtC.js +0 -2
- package/dist/owletto/dist/assets/activity-route-view-msesKUwn.js +0 -2
- package/dist/owletto/dist/assets/agent-connect-pages-DVq9nAR7.js +0 -4
- package/dist/owletto/dist/assets/agent-thread-Cqf9ITrT.js +0 -6
- package/dist/owletto/dist/assets/assist-composer-kG_heHXo.js +0 -2
- package/dist/owletto/dist/assets/automation-run-now-C5XTS00o.js +0 -2
- package/dist/owletto/dist/assets/client-activity-scopes-Aqdo6Pdr.js +0 -2
- package/dist/owletto/dist/assets/connect-BFNp1y_s.js +0 -2
- package/dist/owletto/dist/assets/connect-menu-BWrAhMqO.js +0 -2
- package/dist/owletto/dist/assets/connect._clientId-CSPfwYIN.js +0 -2
- package/dist/owletto/dist/assets/connected._clientId-CuOeHafK.js +0 -2
- package/dist/owletto/dist/assets/connection-CVeHmDLs.js +0 -2
- package/dist/owletto/dist/assets/connection-feed-detail-BYo7zdVD.js +0 -2
- package/dist/owletto/dist/assets/connectors-DBEM9QQz.js +0 -2
- package/dist/owletto/dist/assets/copy-button-Xhh7ZnjO.js +0 -2
- package/dist/owletto/dist/assets/create-Ccb5R-S4.js +0 -2
- package/dist/owletto/dist/assets/create-DmhbacIa.js +0 -2
- package/dist/owletto/dist/assets/create._connectorKey-CZsAqj1p.js +0 -2
- package/dist/owletto/dist/assets/custom-guardrail-edits-Ce_BwiwD.js +0 -2
- package/dist/owletto/dist/assets/definition-comparison-D_qP25jR.js +0 -2
- package/dist/owletto/dist/assets/detail-page-skeleton-CPAfZLG0.js +0 -2
- package/dist/owletto/dist/assets/device-DDl5XKvt.js +0 -2
- package/dist/owletto/dist/assets/device._deviceId-bNhTcops.js +0 -2
- package/dist/owletto/dist/assets/dynamic-schema-form-CRyUchXo.js +0 -2
- package/dist/owletto/dist/assets/entity-page-BOOL_vy3.js +0 -2
- package/dist/owletto/dist/assets/entity-pages-_nuesgnp.js +0 -2
- package/dist/owletto/dist/assets/entity-type-page-CkCSbkBx.js +0 -2
- package/dist/owletto/dist/assets/event-detail-DUvlqn9b.js +0 -2
- package/dist/owletto/dist/assets/events-feed-DcKTkJVe.js +0 -2
- package/dist/owletto/dist/assets/index-BUlkNJzX.js +0 -2
- package/dist/owletto/dist/assets/index-BoqrvLHQ.js +0 -7906
- package/dist/owletto/dist/assets/index-CA9mW_ZM.js +0 -2
- package/dist/owletto/dist/assets/index-CH0GzG4i.js +0 -2
- package/dist/owletto/dist/assets/index-CtI5Eomq.js +0 -2
- package/dist/owletto/dist/assets/index-DmtQ0bds.js +0 -2
- package/dist/owletto/dist/assets/index-Du_J8hnx.js +0 -2
- package/dist/owletto/dist/assets/index-Pae_f9LM.css +0 -1
- package/dist/owletto/dist/assets/index-XETZnN7L.js +0 -2
- package/dist/owletto/dist/assets/login-DG0b9uSC.js +0 -2
- package/dist/owletto/dist/assets/memory-browse-page-qEDQ9Z18.js +0 -74
- package/dist/owletto/dist/assets/missing-view-xT0B-f5z.js +0 -2
- package/dist/owletto/dist/assets/needs-you-list-3uMsWcDv.js +0 -2
- package/dist/owletto/dist/assets/new-AdGV6a8R.js +0 -2
- package/dist/owletto/dist/assets/new-BdtIhBpo.js +0 -2
- package/dist/owletto/dist/assets/new-BjGwX6s6.js +0 -2
- package/dist/owletto/dist/assets/new-D-iMjV74.js +0 -2
- package/dist/owletto/dist/assets/organization-qaIpEiQg.js +0 -2
- package/dist/owletto/dist/assets/peek-pane-content-CEsDVScl.js +0 -2
- package/dist/owletto/dist/assets/proposal-review-shell-C8ZfIAYn.js +0 -2
- package/dist/owletto/dist/assets/public-shell-ready-K2R8iXSI.js +0 -2
- package/dist/owletto/dist/assets/record-session-BrM9cdXu.js +0 -2
- package/dist/owletto/dist/assets/run-initiator-BKSgI1o0.js +0 -2
- package/dist/owletto/dist/assets/runs-k2NpbZm8.js +0 -2
- package/dist/owletto/dist/assets/runs-list-DUXRMkWN.js +0 -2
- package/dist/owletto/dist/assets/schema-value-wjqGxXhv.js +0 -3
- package/dist/owletto/dist/assets/settings-V0m5Om5j.js +0 -2
- package/dist/owletto/dist/assets/source-record-panels-BMut9YIA.js +0 -2
- package/dist/owletto/dist/assets/subDays-9s9OEl5t.js +0 -2
- package/dist/owletto/dist/assets/table-ZuYMOjVR.js +0 -2
- package/dist/owletto/dist/assets/view-card-DiHWlypr.js +0 -2
- package/dist/owletto/dist/assets/view-param-filters-DGKxSr7r.js +0 -2
- package/dist/owletto/dist/assets/views-access-required-HA-PiOwA.js +0 -2
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type SyncContext,
|
|
22
22
|
type SyncResult,
|
|
23
23
|
} from '@lobu/connector-sdk';
|
|
24
|
+
import { type SourceFileAttachment, sourceFileAttachment } from './source-file-attachment';
|
|
24
25
|
|
|
25
26
|
// ---------------------------------------------------------------------------
|
|
26
27
|
// Microsoft Graph API types
|
|
@@ -57,6 +58,8 @@ interface GraphMessage {
|
|
|
57
58
|
isRead: boolean;
|
|
58
59
|
webLink: string;
|
|
59
60
|
parentFolderId: string;
|
|
61
|
+
/** Expanded on the feed's list call, metadata only (never `contentBytes`). */
|
|
62
|
+
attachments?: GraphAttachment[];
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
interface GraphEvent {
|
|
@@ -119,6 +122,33 @@ function formatRecipients(
|
|
|
119
122
|
return recipients.map((r) => r.emailAddress.name || r.emailAddress.address).join(', ');
|
|
120
123
|
}
|
|
121
124
|
|
|
125
|
+
const FILE_ATTACHMENT_TYPE = '#microsoft.graph.fileAttachment';
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The files a message carries, kept in Outlook: each entry names the message
|
|
129
|
+
* and attachment that download_attachment fetches when someone opens it.
|
|
130
|
+
* Inline parts (a signature image the body draws) are not files, and only a
|
|
131
|
+
* file attachment has bytes to fetch; a reference attachment is a cloud link
|
|
132
|
+
* and an item attachment is an embedded message.
|
|
133
|
+
*/
|
|
134
|
+
function messageFileAttachments(message: GraphMessage): SourceFileAttachment[] {
|
|
135
|
+
return (message.attachments ?? [])
|
|
136
|
+
.filter(
|
|
137
|
+
(attachment) =>
|
|
138
|
+
!attachment.isInline &&
|
|
139
|
+
(attachment['@odata.type'] ?? FILE_ATTACHMENT_TYPE) === FILE_ATTACHMENT_TYPE
|
|
140
|
+
)
|
|
141
|
+
.map((attachment) =>
|
|
142
|
+
sourceFileAttachment({
|
|
143
|
+
filename: attachment.name ?? attachment.id,
|
|
144
|
+
mimeType: attachment.contentType ?? 'application/octet-stream',
|
|
145
|
+
sizeBytes: attachment.size,
|
|
146
|
+
operation: 'download_attachment',
|
|
147
|
+
input: { message_id: message.id, attachment_id: attachment.id },
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
122
152
|
// ---------------------------------------------------------------------------
|
|
123
153
|
// Connector
|
|
124
154
|
// ---------------------------------------------------------------------------
|
|
@@ -262,7 +292,7 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
|
|
|
262
292
|
kind: 'read',
|
|
263
293
|
name: 'List Attachments',
|
|
264
294
|
description:
|
|
265
|
-
"List a message's attachments with their IDs, names, types and sizes
|
|
295
|
+
"List a message's attachments with their IDs, names, types and sizes, including inline images and cloud links the feed's file list leaves out. Use it to learn what to download.",
|
|
266
296
|
requiredScopes: ['Mail.Read'],
|
|
267
297
|
inputSchema: {
|
|
268
298
|
type: 'object',
|
|
@@ -278,6 +308,7 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
|
|
|
278
308
|
download_attachment: {
|
|
279
309
|
key: 'download_attachment',
|
|
280
310
|
kind: 'read',
|
|
311
|
+
outputFiles: 'source-copy',
|
|
281
312
|
name: 'Download Attachment',
|
|
282
313
|
description:
|
|
283
314
|
'Download one attachment from an Outlook message. The bytes are published as an attachment with a `download_url` a device can fetch, and small text files are ALSO returned inline as `content`. Get `attachment_id` from `list_attachments`.',
|
|
@@ -484,29 +515,36 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
|
|
|
484
515
|
`?$top=${this.PAGE_SIZE}` +
|
|
485
516
|
'&$orderby=receivedDateTime desc' +
|
|
486
517
|
`&$filter=receivedDateTime ge ${window.start} and receivedDateTime lt ${window.end}` +
|
|
487
|
-
'&$select=id,conversationId,subject,bodyPreview,from,toRecipients,ccRecipients,receivedDateTime,sentDateTime,hasAttachments,importance,isRead,webLink'
|
|
518
|
+
'&$select=id,conversationId,subject,bodyPreview,from,toRecipients,ccRecipients,receivedDateTime,sentDateTime,hasAttachments,importance,isRead,webLink' +
|
|
519
|
+
// Attachment names ride on the page itself: one request per page, not
|
|
520
|
+
// one per message, and the selected fields leave the bytes behind.
|
|
521
|
+
'&$expand=attachments($select=id,name,contentType,size,isInline)';
|
|
488
522
|
|
|
489
523
|
return this.walkPages<GraphMessage>(ctx, http, {
|
|
490
524
|
window,
|
|
491
525
|
firstUrl,
|
|
492
526
|
maxResults: (config.max_results as number) ?? 50,
|
|
493
|
-
toEvent: (msg) =>
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
527
|
+
toEvent: (msg) => {
|
|
528
|
+
const attachments = messageFileAttachments(msg);
|
|
529
|
+
return {
|
|
530
|
+
origin_id: `outlook_msg_${msg.id}`,
|
|
531
|
+
title: msg.subject,
|
|
532
|
+
payload_text: msg.bodyPreview || msg.subject,
|
|
533
|
+
...(attachments.length > 0 ? { attachments } : {}),
|
|
534
|
+
author_name: msg.from?.emailAddress?.name || msg.from?.emailAddress?.address,
|
|
535
|
+
source_url: msg.webLink,
|
|
536
|
+
occurred_at: new Date(msg.receivedDateTime),
|
|
537
|
+
origin_type: 'email',
|
|
538
|
+
metadata: {
|
|
539
|
+
from: msg.from?.emailAddress?.address,
|
|
540
|
+
to: formatRecipients(msg.toRecipients ?? []),
|
|
541
|
+
cc: formatRecipients(msg.ccRecipients ?? []),
|
|
542
|
+
importance: msg.importance,
|
|
543
|
+
has_attachments: msg.hasAttachments,
|
|
544
|
+
is_read: msg.isRead,
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
},
|
|
510
548
|
// The next window starts where this one ended.
|
|
511
549
|
completed: { last_sync_at: window.end },
|
|
512
550
|
});
|
package/dist/connectors/rss.ts
CHANGED
|
@@ -2,14 +2,25 @@
|
|
|
2
2
|
* RSS / Atom Connector (V1 runtime)
|
|
3
3
|
*
|
|
4
4
|
* Fetches and parses RSS 2.0 and Atom feeds. Supports multiple feed URLs,
|
|
5
|
-
* deduplication via checkpoint, and HTML entity decoding.
|
|
5
|
+
* deduplication via checkpoint, and HTML entity decoding. Sync stores only
|
|
6
|
+
* items it has not seen before; a source read returns the feed's current items
|
|
7
|
+
* in document order, which is the only way to see what a ranking-style feed
|
|
8
|
+
* (trending lists, charts) lists right now.
|
|
6
9
|
* No external XML parsing dependencies — uses regex-based parsing.
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
import {
|
|
13
|
+
assertNoMatch,
|
|
14
|
+
assertNoOffsetPaging,
|
|
15
|
+
assertNoQuery,
|
|
16
|
+
assertNoSort,
|
|
17
|
+
assertNoWindow,
|
|
18
|
+
assertPositiveReadLimit,
|
|
10
19
|
type RuntimeConnectorDefinition,
|
|
11
20
|
ConnectorRuntime,
|
|
12
21
|
type EventEnvelope,
|
|
22
|
+
type FeedReadContext,
|
|
23
|
+
type FeedReadResult,
|
|
13
24
|
type SyncContext,
|
|
14
25
|
type SyncResult,
|
|
15
26
|
validatePublicUrl,
|
|
@@ -25,8 +36,18 @@ interface RSSFeedItem {
|
|
|
25
36
|
link: string;
|
|
26
37
|
content: string;
|
|
27
38
|
author: string;
|
|
28
|
-
|
|
39
|
+
/** Null when the source states no (parseable) publication time. */
|
|
40
|
+
publishedAt: Date | null;
|
|
29
41
|
feedUrl: string;
|
|
42
|
+
/** 1-based position of the item in its feed document. */
|
|
43
|
+
position: number;
|
|
44
|
+
/** Channel-level pubDate/lastBuildDate (RSS) or feed `updated` (Atom). */
|
|
45
|
+
feedPublishedAt: Date | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface FeedFetchError {
|
|
49
|
+
url: string;
|
|
50
|
+
error: string;
|
|
30
51
|
}
|
|
31
52
|
|
|
32
53
|
interface RSSCheckpoint {
|
|
@@ -48,7 +69,7 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
48
69
|
key: 'rss',
|
|
49
70
|
name: 'RSS / Atom',
|
|
50
71
|
description: 'Fetches and parses RSS 2.0 and Atom feeds to collect articles.',
|
|
51
|
-
version: '1.0
|
|
72
|
+
version: '1.1.0',
|
|
52
73
|
faviconDomain: 'rss.com',
|
|
53
74
|
authSchema: {
|
|
54
75
|
methods: [{ type: 'none' }],
|
|
@@ -58,7 +79,9 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
58
79
|
key: 'articles',
|
|
59
80
|
name: 'Feed Articles',
|
|
60
81
|
sync: (ctx) => this.syncFeed(ctx),
|
|
61
|
-
|
|
82
|
+
read: (ctx) => this.readFeed(ctx),
|
|
83
|
+
description:
|
|
84
|
+
'Articles from RSS/Atom feeds. Sync stores items not seen before; a source read returns every item the feed lists right now, in document order.',
|
|
62
85
|
configSchema: {
|
|
63
86
|
type: 'object',
|
|
64
87
|
required: ['feed_urls'],
|
|
@@ -107,43 +130,31 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
107
130
|
|
|
108
131
|
private async syncFeed(ctx: SyncContext): Promise<SyncResult> {
|
|
109
132
|
const config = ctx.config as unknown as RSSConfig;
|
|
110
|
-
const feedUrls = config
|
|
111
|
-
if (!feedUrls || !Array.isArray(feedUrls) || feedUrls.length === 0) {
|
|
112
|
-
throw new Error('feed_urls is required and must be a non-empty array.');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const maxItemsPerFeed = config.max_items_per_feed ?? 100;
|
|
133
|
+
const feedUrls = this.requireFeedUrls(config);
|
|
116
134
|
const checkpoint = (ctx.checkpoint as RSSCheckpoint | null) ?? {
|
|
117
135
|
last_item_ids: [],
|
|
118
136
|
};
|
|
119
137
|
const seenIds = new Set<string>(checkpoint.last_item_ids ?? []);
|
|
120
138
|
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
try {
|
|
126
|
-
const items = await this.fetchAndParseFeed(feedUrl, maxItemsPerFeed);
|
|
127
|
-
allItems.push(...items);
|
|
128
|
-
} catch (err) {
|
|
129
|
-
fetchErrors.push({
|
|
130
|
-
url: feedUrl,
|
|
131
|
-
error: err instanceof Error ? err.message : String(err),
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
139
|
+
const { items: allItems, fetchErrors } = await this.fetchFeeds(
|
|
140
|
+
feedUrls,
|
|
141
|
+
config.max_items_per_feed ?? 100
|
|
142
|
+
);
|
|
135
143
|
|
|
136
144
|
// A run where every configured feed failed must fail — a "completed" run
|
|
137
145
|
// with 0 items is indistinguishable from a genuinely empty feed.
|
|
138
146
|
if (fetchErrors.length === feedUrls.length) {
|
|
139
147
|
throw new Error(
|
|
140
|
-
`All ${feedUrls.length} feed URL(s) failed to fetch: `
|
|
141
|
-
fetchErrors.map((e) => `${e.url} (${e.error})`).join('; ')
|
|
148
|
+
`All ${feedUrls.length} feed URL(s) failed to fetch: ${this.describeErrors(fetchErrors)}`
|
|
142
149
|
);
|
|
143
150
|
}
|
|
144
151
|
|
|
152
|
+
// Items without a stated publication time are stamped with the fetch time.
|
|
153
|
+
const fetchedAt = new Date();
|
|
154
|
+
const occurredAt = (item: RSSFeedItem) => item.publishedAt ?? fetchedAt;
|
|
155
|
+
|
|
145
156
|
// Sort by occurred_at descending
|
|
146
|
-
allItems.sort((a, b) => b.
|
|
157
|
+
allItems.sort((a, b) => occurredAt(b).getTime() - occurredAt(a).getTime());
|
|
147
158
|
|
|
148
159
|
// Deduplicate against checkpoint
|
|
149
160
|
const events: EventEnvelope[] = [];
|
|
@@ -161,7 +172,7 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
161
172
|
payload_text: item.content,
|
|
162
173
|
author_name: item.author || undefined,
|
|
163
174
|
source_url: item.link || undefined,
|
|
164
|
-
occurred_at: item
|
|
175
|
+
occurred_at: occurredAt(item),
|
|
165
176
|
origin_type: 'article',
|
|
166
177
|
metadata: {
|
|
167
178
|
feed_url: item.feedUrl,
|
|
@@ -197,6 +208,125 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
197
208
|
};
|
|
198
209
|
}
|
|
199
210
|
|
|
211
|
+
// -------------------------------------------------------------------------
|
|
212
|
+
// read
|
|
213
|
+
// -------------------------------------------------------------------------
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Live snapshot of what the configured feeds list right now. Unlike sync,
|
|
217
|
+
* nothing is dropped for having been seen before and no sync item cap
|
|
218
|
+
* applies, so an item that stays on a ranking feed for days appears in every
|
|
219
|
+
* read. Fails closed when any feed URL fails: a snapshot missing one feed is
|
|
220
|
+
* not the current contents.
|
|
221
|
+
*
|
|
222
|
+
* Pages continue with a connector cursor carrying the next position and a
|
|
223
|
+
* SHA-256 of every returned row. Every page refetches the feed, so a feed that
|
|
224
|
+
* changed between pages fails the read instead of mixing two editions.
|
|
225
|
+
*/
|
|
226
|
+
private async readFeed(ctx: FeedReadContext): Promise<FeedReadResult> {
|
|
227
|
+
const unsupported =
|
|
228
|
+
'RSS source reads return the whole current feed in document order; they do not support';
|
|
229
|
+
assertNoQuery(ctx, `${unsupported} queries`);
|
|
230
|
+
assertNoSort(ctx, `${unsupported} sorting`);
|
|
231
|
+
assertNoWindow(ctx, `${unsupported} time windows`);
|
|
232
|
+
assertNoMatch(ctx, `${unsupported} exact-match filters`);
|
|
233
|
+
assertNoOffsetPaging(ctx, `${unsupported} offsets; continue with the returned cursor`);
|
|
234
|
+
assertPositiveReadLimit(ctx);
|
|
235
|
+
|
|
236
|
+
const config = ctx.config as unknown as RSSConfig;
|
|
237
|
+
const feedUrls = this.requireFeedUrls(config);
|
|
238
|
+
const { items, fetchErrors } = await this.fetchFeeds(feedUrls, Number.POSITIVE_INFINITY);
|
|
239
|
+
if (fetchErrors.length > 0) {
|
|
240
|
+
throw new Error(
|
|
241
|
+
`${fetchErrors.length} of ${feedUrls.length} feed URL(s) failed to fetch: ${this.describeErrors(fetchErrors)}`
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const allRows = items.map((item) => ({
|
|
246
|
+
id: item.id,
|
|
247
|
+
title: item.title,
|
|
248
|
+
link: item.link || null,
|
|
249
|
+
content: item.content,
|
|
250
|
+
author: item.author || null,
|
|
251
|
+
published_at: item.publishedAt?.toISOString() ?? null,
|
|
252
|
+
feed_url: item.feedUrl,
|
|
253
|
+
position: item.position,
|
|
254
|
+
feed_published_at: item.feedPublishedAt?.toISOString() ?? null,
|
|
255
|
+
}));
|
|
256
|
+
// Covers every returned field, so an edition that keeps item ids but
|
|
257
|
+
// changes content or dates still invalidates an earlier page's cursor.
|
|
258
|
+
const fingerprint = await this.sha256Hex(JSON.stringify(allRows));
|
|
259
|
+
const start = ctx.cursor ? this.decodeReadCursor(ctx.cursor, fingerprint) : 0;
|
|
260
|
+
const end = Math.min(allRows.length, start + (ctx.limit ?? allRows.length));
|
|
261
|
+
const rows = allRows.slice(start, end);
|
|
262
|
+
|
|
263
|
+
return {
|
|
264
|
+
rows,
|
|
265
|
+
columns: [
|
|
266
|
+
{ name: 'id', type: 'string' },
|
|
267
|
+
{ name: 'title', type: 'string' },
|
|
268
|
+
{ name: 'link', type: 'string' },
|
|
269
|
+
{ name: 'content', type: 'string' },
|
|
270
|
+
{ name: 'author', type: 'string' },
|
|
271
|
+
{ name: 'published_at', type: 'timestamp' },
|
|
272
|
+
{ name: 'feed_url', type: 'string' },
|
|
273
|
+
{ name: 'position', type: 'integer' },
|
|
274
|
+
{ name: 'feed_published_at', type: 'timestamp' },
|
|
275
|
+
],
|
|
276
|
+
total: allRows.length,
|
|
277
|
+
...(end < allRows.length ? { nextCursor: `${end}.${fingerprint}` } : { hasMore: false }),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
private async sha256Hex(value: string): Promise<string> {
|
|
282
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(value));
|
|
283
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Resume position from a read cursor; rejects a cursor from another edition. */
|
|
287
|
+
private decodeReadCursor(cursor: string, fingerprint: string): number {
|
|
288
|
+
const separator = cursor.indexOf('.');
|
|
289
|
+
const position = Number(cursor.slice(0, separator));
|
|
290
|
+
if (separator < 1 || !Number.isSafeInteger(position) || position < 1) {
|
|
291
|
+
throw new Error('Invalid RSS read cursor');
|
|
292
|
+
}
|
|
293
|
+
if (cursor.slice(separator + 1) !== fingerprint) {
|
|
294
|
+
throw new Error('The feed changed since the previous page; restart the read from the first page');
|
|
295
|
+
}
|
|
296
|
+
return position;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
private requireFeedUrls(config: RSSConfig): string[] {
|
|
300
|
+
const feedUrls = config.feed_urls;
|
|
301
|
+
if (!feedUrls || !Array.isArray(feedUrls) || feedUrls.length === 0) {
|
|
302
|
+
throw new Error('feed_urls is required and must be a non-empty array.');
|
|
303
|
+
}
|
|
304
|
+
return feedUrls;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
private async fetchFeeds(
|
|
308
|
+
feedUrls: string[],
|
|
309
|
+
maxItemsPerFeed: number
|
|
310
|
+
): Promise<{ items: RSSFeedItem[]; fetchErrors: FeedFetchError[] }> {
|
|
311
|
+
const items: RSSFeedItem[] = [];
|
|
312
|
+
const fetchErrors: FeedFetchError[] = [];
|
|
313
|
+
for (const feedUrl of feedUrls) {
|
|
314
|
+
try {
|
|
315
|
+
items.push(...(await this.fetchAndParseFeed(feedUrl, maxItemsPerFeed)));
|
|
316
|
+
} catch (err) {
|
|
317
|
+
fetchErrors.push({
|
|
318
|
+
url: feedUrl,
|
|
319
|
+
error: err instanceof Error ? err.message : String(err),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return { items, fetchErrors };
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
private describeErrors(fetchErrors: FeedFetchError[]): string {
|
|
327
|
+
return fetchErrors.map((e) => `${e.url} (${e.error})`).join('; ');
|
|
328
|
+
}
|
|
329
|
+
|
|
200
330
|
// -------------------------------------------------------------------------
|
|
201
331
|
// execute
|
|
202
332
|
// -------------------------------------------------------------------------
|
|
@@ -250,6 +380,10 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
250
380
|
|
|
251
381
|
private parseRSS(xml: string, feedUrl: string, maxItems: number): RSSFeedItem[] {
|
|
252
382
|
const items: RSSFeedItem[] = [];
|
|
383
|
+
const channelHeader = this.headerBefore(xml, 'item');
|
|
384
|
+
const channelDate =
|
|
385
|
+
this.extractTag(channelHeader, 'pubDate') ?? this.extractTag(channelHeader, 'lastBuildDate');
|
|
386
|
+
const feedPublishedAt = channelDate ? this.parseDate(channelDate) : null;
|
|
253
387
|
const itemRegex = /<item[\s>]([\s\S]*?)<\/item>/gi;
|
|
254
388
|
let match: RegExpExecArray | null;
|
|
255
389
|
|
|
@@ -268,7 +402,7 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
268
402
|
const id = guid || this.hashString(`${title ?? ''}|${link ?? ''}`);
|
|
269
403
|
const content = contentEncoded || description || '';
|
|
270
404
|
|
|
271
|
-
const publishedAt = pubDate ? this.parseDate(pubDate) :
|
|
405
|
+
const publishedAt = pubDate ? this.parseDate(pubDate) : null;
|
|
272
406
|
|
|
273
407
|
items.push({
|
|
274
408
|
id,
|
|
@@ -278,6 +412,8 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
278
412
|
author: this.decodeEntities(this.stripHtml(author)),
|
|
279
413
|
publishedAt,
|
|
280
414
|
feedUrl,
|
|
415
|
+
position: items.length + 1,
|
|
416
|
+
feedPublishedAt,
|
|
281
417
|
});
|
|
282
418
|
}
|
|
283
419
|
|
|
@@ -290,6 +426,8 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
290
426
|
|
|
291
427
|
private parseAtom(xml: string, feedUrl: string, maxItems: number): RSSFeedItem[] {
|
|
292
428
|
const items: RSSFeedItem[] = [];
|
|
429
|
+
const feedUpdated = this.extractTag(this.headerBefore(xml, 'entry'), 'updated');
|
|
430
|
+
const feedPublishedAt = feedUpdated ? this.parseDate(feedUpdated) : null;
|
|
293
431
|
const entryRegex = /<entry[\s>]([\s\S]*?)<\/entry>/gi;
|
|
294
432
|
let match: RegExpExecArray | null;
|
|
295
433
|
|
|
@@ -305,7 +443,7 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
305
443
|
const author = this.extractAtomAuthor(block);
|
|
306
444
|
|
|
307
445
|
const externalId = id || this.hashString(`${title ?? ''}|${link ?? ''}`);
|
|
308
|
-
const publishedAt = published ? this.parseDate(published) :
|
|
446
|
+
const publishedAt = published ? this.parseDate(published) : null;
|
|
309
447
|
|
|
310
448
|
items.push({
|
|
311
449
|
id: externalId,
|
|
@@ -315,6 +453,8 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
315
453
|
author: this.decodeEntities(this.stripHtml(author)),
|
|
316
454
|
publishedAt,
|
|
317
455
|
feedUrl,
|
|
456
|
+
position: items.length + 1,
|
|
457
|
+
feedPublishedAt,
|
|
318
458
|
});
|
|
319
459
|
}
|
|
320
460
|
|
|
@@ -325,6 +465,12 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
325
465
|
// XML extraction helpers
|
|
326
466
|
// -------------------------------------------------------------------------
|
|
327
467
|
|
|
468
|
+
/** The document up to its first `<tagName>` element: the channel/feed header. */
|
|
469
|
+
private headerBefore(xml: string, tagName: string): string {
|
|
470
|
+
const match = new RegExp(`<${tagName}[\\s>]`, 'i').exec(xml);
|
|
471
|
+
return match ? xml.slice(0, match.index) : xml;
|
|
472
|
+
}
|
|
473
|
+
|
|
328
474
|
/** Extract text content from an XML tag. Handles CDATA and regular text. */
|
|
329
475
|
private extractTag(block: string, tagName: string): string | null {
|
|
330
476
|
// Try CDATA first
|
|
@@ -447,10 +593,10 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
447
593
|
.trim();
|
|
448
594
|
}
|
|
449
595
|
|
|
450
|
-
/** Parse a date string
|
|
451
|
-
private parseDate(dateStr: string): Date {
|
|
596
|
+
/** Parse a date string; null when it is not a valid date. */
|
|
597
|
+
private parseDate(dateStr: string): Date | null {
|
|
452
598
|
const parsed = new Date(dateStr);
|
|
453
|
-
return Number.isNaN(parsed.getTime()) ?
|
|
599
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
454
600
|
}
|
|
455
601
|
|
|
456
602
|
/** Simple hash of a string, returned as a hex string. */
|
package/dist/connectors/slack.ts
CHANGED
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
IntegrationConnector,
|
|
32
32
|
} from "@lobu/connector-sdk";
|
|
33
33
|
import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
|
|
34
|
+
import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Bot scopes requested by `/slack/install`. The Slack manifest does not drive
|
|
@@ -84,6 +85,7 @@ export default class SlackConnector extends IntegrationConnector {
|
|
|
84
85
|
"Connect a Slack workspace to Lobu. Mention the bot, DM it, or run /lobu in any channel to drive a sandboxed agent.",
|
|
85
86
|
version: "1.0.0",
|
|
86
87
|
automationEvents: CHAT_AUTOMATION_EVENTS,
|
|
88
|
+
actions: CHAT_TRANSPORT_ACTIONS,
|
|
87
89
|
faviconDomain: "slack.com",
|
|
88
90
|
webhook: {
|
|
89
91
|
// App-level delivery: one webhook is configured ONCE on the Slack app, and
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An event attachment that stays in its source.
|
|
3
|
+
*
|
|
4
|
+
* A feed that sees a file (a mail attachment, a Drive file) records it on the
|
|
5
|
+
* event as metadata only: no bytes, no artifact, no download URL. `open` names
|
|
6
|
+
* the connection's own read operation and the input that fetches this one
|
|
7
|
+
* file, so the app can run it on demand through `operations.execute` (normal
|
|
8
|
+
* connector policy applies) and show the short-lived file it publishes.
|
|
9
|
+
*
|
|
10
|
+
* Every value in `open.input` must be a string or a number, because the event
|
|
11
|
+
* row stores it verbatim and the app passes it back unchanged.
|
|
12
|
+
*/
|
|
13
|
+
export interface SourceFileAttachment {
|
|
14
|
+
kind: 'image' | 'audio' | 'video' | 'file';
|
|
15
|
+
filename: string;
|
|
16
|
+
mime_type: string;
|
|
17
|
+
size_bytes?: number;
|
|
18
|
+
open: { operation: string; input: Record<string, string | number> };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function sourceFileAttachment(file: {
|
|
22
|
+
filename: string;
|
|
23
|
+
mimeType: string;
|
|
24
|
+
sizeBytes?: number;
|
|
25
|
+
operation: string;
|
|
26
|
+
input: Record<string, string | number>;
|
|
27
|
+
}): SourceFileAttachment {
|
|
28
|
+
const mimeType = file.mimeType.toLowerCase();
|
|
29
|
+
return {
|
|
30
|
+
kind: attachmentKind(mimeType),
|
|
31
|
+
filename: file.filename,
|
|
32
|
+
mime_type: mimeType,
|
|
33
|
+
...(typeof file.sizeBytes === 'number' && Number.isFinite(file.sizeBytes)
|
|
34
|
+
? { size_bytes: file.sizeBytes }
|
|
35
|
+
: {}),
|
|
36
|
+
open: { operation: file.operation, input: file.input },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Same media-type split the gateway applies when it publishes a file.
|
|
41
|
+
function attachmentKind(mimeType: string): SourceFileAttachment['kind'] {
|
|
42
|
+
if (mimeType.startsWith('image/')) return 'image';
|
|
43
|
+
if (mimeType.startsWith('audio/')) return 'audio';
|
|
44
|
+
if (mimeType.startsWith('video/')) return 'video';
|
|
45
|
+
return 'file';
|
|
46
|
+
}
|
package/dist/connectors/teams.ts
CHANGED
|
@@ -3,12 +3,14 @@ import {
|
|
|
3
3
|
IntegrationConnector,
|
|
4
4
|
} from "@lobu/connector-sdk";
|
|
5
5
|
import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
|
|
6
|
+
import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
|
|
6
7
|
|
|
7
8
|
export default class TeamsConnector extends IntegrationConnector {
|
|
8
9
|
readonly definition: ConnectorDefinition = {
|
|
9
10
|
key: "teams",
|
|
10
11
|
kind: "integration",
|
|
11
12
|
automationEvents: CHAT_AUTOMATION_EVENTS,
|
|
13
|
+
actions: CHAT_TRANSPORT_ACTIONS,
|
|
12
14
|
name: "Microsoft Teams",
|
|
13
15
|
description: "Connect a Microsoft Teams bot to Lobu.",
|
|
14
16
|
version: "1.0.0",
|
|
@@ -3,12 +3,14 @@ import {
|
|
|
3
3
|
IntegrationConnector,
|
|
4
4
|
} from "@lobu/connector-sdk";
|
|
5
5
|
import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
|
|
6
|
+
import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
|
|
6
7
|
|
|
7
8
|
export default class TelegramConnector extends IntegrationConnector {
|
|
8
9
|
readonly definition: ConnectorDefinition = {
|
|
9
10
|
key: "telegram",
|
|
10
11
|
kind: "integration",
|
|
11
12
|
automationEvents: CHAT_AUTOMATION_EVENTS,
|
|
13
|
+
actions: CHAT_TRANSPORT_ACTIONS,
|
|
12
14
|
name: "Telegram",
|
|
13
15
|
description: "Connect a Telegram bot and route chats to Lobu agents.",
|
|
14
16
|
version: "1.0.0",
|
|
@@ -252,7 +252,7 @@ export default class TikTokConnector extends ConnectorRuntime {
|
|
|
252
252
|
actions: {
|
|
253
253
|
set_like: { key: "set_like", name: "Set like", kind: "write", description: "Set a post's liked state and verify it after reload. Already-matching posts are left unchanged. May focus a scratch tab to load the post. Selection and budgets belong in Automations.", annotations: { idempotentHint: true, destructiveHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "liked"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, liked: { type: "boolean" } } } },
|
|
254
254
|
inspect_post: { key: "inspect_post", name: "Inspect post visuals", kind: "read", description: "Return post metadata and real screenshots at requested video times or photo indices. Images are visual samples, not full video or audio understanding. May focus a scratch tab to load media.", annotations: { readOnlyHint: true, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, frame_times: { type: "array", minItems: 1, maxItems: 6, items: { type: "number", minimum: 0 }, default: [0] }, photo_indices: { type: "array", minItems: 1, maxItems: 10, items: { type: "integer", minimum: 0 }, description: "Zero-based photos to capture; defaults to the first photo." } } } },
|
|
255
|
-
prepare_comment: { key: "prepare_comment", name: "Prepare comment", kind: "write", description: "Prepare a video comment for human submission. Call operations.execute with activation: { kind: 'page_visit', urls: [post_url] }. After the user opens that exact post, fills its empty composer. The user must click Post. Fails without page activation; never submits or overwrites a draft. Photo comments are not supported.", annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "body"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, body: { type: "string", minLength: 1 } } } },
|
|
255
|
+
prepare_comment: { key: "prepare_comment", name: "Prepare comment", kind: "write", description: "Prepare a video comment for human submission. Call operations.execute with activation: { kind: 'page_visit', urls: [post_url] }. After the user opens that exact post, fills its empty composer. The user must click Post. Fails without page activation; never submits or overwrites a draft. Photo comments are not supported.", annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true }, inputSchema: { type: "object", required: ["post_url", "body"], additionalProperties: false, properties: { post_url: { type: "string", format: "uri" }, body: { type: "string", minLength: 1, "x-multiline": true } } } },
|
|
256
256
|
},
|
|
257
257
|
};
|
|
258
258
|
|
|
@@ -3,12 +3,14 @@ import {
|
|
|
3
3
|
IntegrationConnector,
|
|
4
4
|
} from "@lobu/connector-sdk";
|
|
5
5
|
import { CHAT_AUTOMATION_EVENTS } from "./chat-automation-events.js";
|
|
6
|
+
import { CHAT_TRANSPORT_ACTIONS } from "./chat-transport-actions.js";
|
|
6
7
|
|
|
7
8
|
export default class WhatsAppConnector extends IntegrationConnector {
|
|
8
9
|
readonly definition: ConnectorDefinition = {
|
|
9
10
|
key: "whatsapp",
|
|
10
11
|
kind: "integration",
|
|
11
12
|
automationEvents: CHAT_AUTOMATION_EVENTS,
|
|
13
|
+
actions: CHAT_TRANSPORT_ACTIONS,
|
|
12
14
|
name: "WhatsApp Cloud",
|
|
13
15
|
description: "Connect a WhatsApp Cloud API phone number to Lobu.",
|
|
14
16
|
version: "1.0.0",
|
|
@@ -498,7 +498,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
498
498
|
chat_jid: { type: "string" },
|
|
499
499
|
chat_name: { type: "string" },
|
|
500
500
|
self_chat: { type: "boolean", const: true },
|
|
501
|
-
text: { type: "string", minLength: 1, maxLength: 65536 },
|
|
501
|
+
text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
|
|
502
502
|
},
|
|
503
503
|
anyOf: [
|
|
504
504
|
{ required: ["chat_jid"] },
|
|
@@ -529,7 +529,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
529
529
|
chat_jid: { type: "string" },
|
|
530
530
|
chat_name: { type: "string" },
|
|
531
531
|
self_chat: { type: "boolean", const: true },
|
|
532
|
-
text: { type: "string", minLength: 1, maxLength: 65536 },
|
|
532
|
+
text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
|
|
533
533
|
},
|
|
534
534
|
anyOf: [
|
|
535
535
|
{ required: ["chat_jid"] },
|
|
@@ -560,7 +560,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
560
560
|
type: "string",
|
|
561
561
|
description: "Raw WhatsApp message key.id.",
|
|
562
562
|
},
|
|
563
|
-
text: { type: "string", minLength: 1, maxLength: 65536 },
|
|
563
|
+
text: { type: "string", minLength: 1, maxLength: 65536, "x-multiline": true },
|
|
564
564
|
},
|
|
565
565
|
},
|
|
566
566
|
outputSchema: {
|
|
@@ -307,12 +307,11 @@ export function xDirectMessagesProgram() {
|
|
|
307
307
|
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
308
308
|
.join("");
|
|
309
309
|
}
|
|
310
|
-
// X's client request id, derived from the
|
|
311
|
-
//
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
);
|
|
310
|
+
// X's client request id, derived from the operation run so a retry or
|
|
311
|
+
// re-claim of the same run carries the same id and can recognise its
|
|
312
|
+
// earlier attempt.
|
|
313
|
+
async function requestIdOf(self, conversationId, runId) {
|
|
314
|
+
const hex = await digest(JSON.stringify([self, conversationId, runId]));
|
|
316
315
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-5${hex.slice(13, 16)}-${((Number.parseInt(hex[16], 16) & 3) | 8).toString(16)}${hex.slice(17, 20)}-${hex.slice(20, 32)}`;
|
|
317
316
|
}
|
|
318
317
|
// An outgoing message on the latest page that is this send's earlier attempt.
|
|
@@ -351,10 +350,9 @@ export function xDirectMessagesProgram() {
|
|
|
351
350
|
fail("The conversation does not belong to the signed-in account");
|
|
352
351
|
const text = typeof input.text === "string" ? input.text : "";
|
|
353
352
|
if (!text.trim()) fail("text is required");
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const requestId = await requestIdOf(self, conversationId, idempotencyKey);
|
|
353
|
+
const runId = typeof input.run_id === "string" ? input.run_id : "";
|
|
354
|
+
if (!runId) fail("run_id is required");
|
|
355
|
+
const requestId = await requestIdOf(self, conversationId, runId);
|
|
358
356
|
const delivered = (prior) => ({
|
|
359
357
|
sent: true,
|
|
360
358
|
deduplicated: true,
|